Changeset 21458
- Timestamp:
- Feb 12, 2009, 10:05:21 AM (17 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 3 edited
-
psphotArguments.c (modified) (3 diffs)
-
psphotImageLoop.c (modified) (2 diffs)
-
psphotParseCamera.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotArguments.c
r21166 r21458 33 33 if ((N = psArgumentGet(argc, argv, "-threads"))) { 34 34 psArgumentRemove(N, &argc, argv); 35 int nThreads = atoi(argv[N]);35 int nThreads = atoi(argv[N]); 36 36 psMetadataAddS32(config->arguments, PS_LIST_TAIL, "NTHREADS", 0, "number of psphot threads", nThreads); 37 37 psArgumentRemove(N, &argc, argv); 38 38 39 // create the thread pool with number of desired threads, supplying our thread launcher function40 psThreadPoolInit (nThreads);39 // create the thread pool with number of desired threads, supplying our thread launcher function 40 psThreadPoolInit (nThreads); 41 41 } 42 42 psphotSetThreads(); … … 82 82 if ((N = psArgumentGet (argc, argv, "-visual"))) { 83 83 psArgumentRemove (N, &argc, argv); 84 psphotSetVisual (true);85 // pmSourceSetVisual (true);84 psphotSetVisual (true); 85 // pmSourceSetVisual (true); 86 86 } 87 87 … … 118 118 // 119 119 pmConfigFileSetsMD (config->arguments, &argc, argv, "MASK", "-mask", "-masklist"); 120 pmConfigFileSetsMD (config->arguments, &argc, argv, " WEIGHT", "-weight", "-weightlist");120 pmConfigFileSetsMD (config->arguments, &argc, argv, "VARIANCE", "-variance", "-variancelist"); 121 121 pmConfigFileSetsMD (config->arguments, &argc, argv, "PSPHOT.PSF", "-psf", "-psflist"); 122 122 pmConfigFileSetsMD (config->arguments, &argc, argv, "SRC", "-src", "-srclist"); -
trunk/psphot/src/psphotImageLoop.c
r20769 r21458 16 16 pmFPAfile *load = psMetadataLookupPtr (&status, config->files, "PSPHOT.LOAD"); 17 17 if (!status) { 18 psError(PSPHOT_ERR_PROG, false, "Can't find input data!");19 return false;18 psError(PSPHOT_ERR_PROG, false, "Can't find input data!"); 19 return false; 20 20 } 21 21 pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT"); 22 22 if (!status) { 23 psError(PSPHOT_ERR_PROG, false, "Can't find input data!");24 return false;23 psError(PSPHOT_ERR_PROG, false, "Can't find input data!"); 24 return false; 25 25 } 26 26 27 27 pmFPAview *view = pmFPAviewAlloc (0); 28 28 29 29 // files associated with the science image 30 30 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for fpa in psphot."); 31 31 32 // for psphot, we force data to be read at the chip level 32 // for psphot, we force data to be read at the chip level 33 33 while ((chip = pmFPAviewNextChip (view, load->fpa, 1)) != NULL) { 34 34 psLogMsg ("psphot", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 35 35 if (! chip->process || ! chip->file_exists) { continue; } 36 36 37 // load just the input image data (image, mask, weight)38 pmFPAfileActivate (config->files, false, NULL);39 pmFPAfileActivate (config->files, true, "PSPHOT.LOAD");40 pmFPAfileActivate (config->files, true, "PSPHOT.MASK");41 pmFPAfileActivate (config->files, true, "PSPHOT.WEIGHT");42 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphot.");37 // load just the input image data (image, mask, weight) 38 pmFPAfileActivate (config->files, false, NULL); 39 pmFPAfileActivate (config->files, true, "PSPHOT.LOAD"); 40 pmFPAfileActivate (config->files, true, "PSPHOT.MASK"); 41 pmFPAfileActivate (config->files, true, "PSPHOT.VARIANCE"); 42 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphot."); 43 43 44 // mosaic the cells of a chip into a single contiguous (trimmed) chip44 // mosaic the cells of a chip into a single contiguous (trimmed) chip 45 45 if (!psphotMosaicChip(config, view, "PSPHOT.INPUT", "PSPHOT.LOAD")) ESCAPE ("Unable to mosaic chip."); 46 46 47 // try to load other supporting data (PSF, SRC, etc).48 // do not re-load the following three files49 pmFPAfileActivate (config->files, true, NULL);50 pmFPAfileActivate (config->files, false, "PSPHOT.LOAD");51 pmFPAfileActivate (config->files, false, "PSPHOT.MASK");52 pmFPAfileActivate (config->files, false, "PSPHOT.WEIGHT");53 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphot.");47 // try to load other supporting data (PSF, SRC, etc). 48 // do not re-load the following three files 49 pmFPAfileActivate (config->files, true, NULL); 50 pmFPAfileActivate (config->files, false, "PSPHOT.LOAD"); 51 pmFPAfileActivate (config->files, false, "PSPHOT.MASK"); 52 pmFPAfileActivate (config->files, false, "PSPHOT.VARIANCE"); 53 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphot."); 54 54 55 // re-activate files so they will be closed and freed below56 pmFPAfileActivate (config->files, true, NULL);55 // re-activate files so they will be closed and freed below 56 pmFPAfileActivate (config->files, true, NULL); 57 57 58 // there is now only a single chip (multiple readouts?). loop over it and process59 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {58 // there is now only a single chip (multiple readouts?). loop over it and process 59 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 60 60 psLogMsg ("psphot", 5, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 61 61 62 // process each of the readouts63 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {64 psLogMsg ("psphot", 6, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);65 if (! readout->data_exists) { continue; }62 // process each of the readouts 63 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) { 64 psLogMsg ("psphot", 6, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 65 if (! readout->data_exists) { continue; } 66 66 67 // run the actual photometry analysis on this chip/cell/readout68 if (!psphotReadout (config, view)) {69 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);70 psFree (view);71 return false;72 }73 }67 // run the actual photometry analysis on this chip/cell/readout 68 if (!psphotReadout (config, view)) { 69 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 70 psFree (view); 71 return false; 72 } 73 } 74 74 75 status = true;76 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");77 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");78 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");79 if (!status) {80 psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files");81 psFree (view);82 return false;83 }84 }75 status = true; 76 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL"); 77 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV"); 78 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND"); 79 if (!status) { 80 psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files"); 81 psFree (view); 82 return false; 83 } 84 } 85 85 86 // save output which is saved at the chip level87 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed output for Chip in psphot.");86 // save output which is saved at the chip level 87 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed output for Chip in psphot."); 88 88 } 89 89 // save output which is saved at the fpa level … … 108 108 109 109 // PSPHOT.MASK 110 // PSPHOT. WEIGHT111 // 110 // PSPHOT.VARIANCE 111 // -
trunk/psphot/src/psphotParseCamera.c
r19141 r21458 15 15 load->dataLevel = PM_FPA_LEVEL_CHIP; // force load at the CHIP level 16 16 17 // if MASK or WEIGHTwas supplied on command line, bind files to 'load'17 // if MASK or VARIANCE was supplied on command line, bind files to 'load' 18 18 // the mask and weight will be mosaicked with the image 19 19 pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.MASK", "MASK"); … … 27 27 } 28 28 29 pmFPAfileBindFromArgs (&status, load, config, "PSPHOT. WEIGHT", "WEIGHT");29 pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.VARIANCE", "VARIANCE"); 30 30 if (!status) { 31 31 psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
Note:
See TracChangeset
for help on using the changeset viewer.
