Changeset 6571 for trunk/psphot/src/testPSphotLoop.c
- Timestamp:
- Mar 11, 2006, 5:27:13 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/testPSphotLoop.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/testPSphotLoop.c
r6522 r6571 1 1 # include "psphot.h" 2 2 3 bool psphot Loop (psphotData *data, ppConfig *config) {3 bool psphotImageLoop (pmConfig *config) { 4 4 5 psRegion region = {0,0,0,0}; 6 pmFPA *fpa = data->input->fpa; 7 pmFPAiterator *fpi = pmFPAiteratorAlloc (fpa, region); 5 psMetadata *recipe = psMetadataLookupPts (NULL, config->recipes, PSPHOT_RECIPE); 6 if (!recipe) { 7 psErrorStackPrint(stderr, "Can't find recipe configuration!\n"); 8 exit(EXIT_FAILURE); 9 } 10 11 pmFPA *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT"); 12 pmFPAview *view = pmFPAviewAlloc (0); 8 13 9 14 // files associated with the science image 10 pmFileDefine (fpi, config->camera, "PPIMAGE.INPUT"); 11 pmFileDefine (fpi, config->camera, "PPIMAGE.OUTPUT.HEAD"); 12 pmFileDefine (fpi, config->camera, "PPIMAGE.OUTPUT.DATA"); 13 pmFileDefine (fpi, config->camera, "PPIMAGE.BACKGND"); 14 pmFileDefine (fpi, config->camera, "PPIMAGE.BACKSUB"); 15 pmFileDefine (fpi, config->camera, "PPIMAGE.RESID"); 16 pmFileDefine (fpi, config->camera, "PPIMAGE.PSF"); 17 pmFileIOChecks (fpi); 15 pmFPAfileReadChecks (config->files, view); 18 16 19 while ((chip = pmChipNext ( fpi)) != NULL) {17 while ((chip = pmChipNext (view, input)) != NULL) { 20 18 21 19 psLogMsg ("psphot", 4, "Chip %d: %x %x\n", i, chip->exists, chip->process); 22 20 if (! chip->process) { continue; } 23 pmF ileIOChecks (fpi);21 pmFPAfileReadChecks (config->files, view); 24 22 25 while ((cell = pmCellNext ( fpi)) != NULL) {23 while ((cell = pmCellNext (view, input)) != NULL) { 26 24 27 25 psLogMsg ("psphot", 4, "Cell %d: %x %x\n", j, cell->exists, cell->process); 28 26 if (! cell->process) { continue; } 29 pmFileIOChecks (fpi); 27 pmFPAfileReadChecks (config->files, view); 28 29 // XXX optional mask and weight input image should be loaded here? 30 // this sets the weight map and basic mask applying CELL.BAD and CELL.SATURATION 31 pmCellSetWeights(cell); 32 33 // I have a valid mask, now mask in the analysis region of interest 34 pmCellSetMask (cell, recipe); 30 35 31 36 // process each of the readouts 32 while ((readout = pmReadoutNext ( fpi)) != NULL) {33 pmF ileIOChecks (fpi);37 while ((readout = pmReadoutNext (view, input)) != NULL) { 38 pmFPAfileReadChecks (config->files, view); 34 39 40 // run a single-model test if desired 41 // XXX move this to psphotReadout?? 42 // psphotModelTest (readout, recipe); 43 35 44 // run the actual photometry analysis 36 psphotReadout (readout, config); 45 psphotReadout (config, view); 46 47 pmFPAfileWriteChecks (config->files, view); 37 48 38 49 // write out the desired output dataset(s) 39 psphotOutput (readout, config);50 // psphotOutput (view, recipe); 40 51 } 52 pmFPAfileWriteChecks (config->files, view); 41 53 } 54 pmFPAfileWriteChecks (config->files, view); 42 55 } 43 pmF ileClose (fpi);56 pmFPAfileWriteChecks (config->files, view); 44 57 return true; 45 58 } 59 60 // I/O files related to psphot: 61 // PSPHOT.INPUT : input image file(s) 62 // PSPHOT.RESID : residual image 63 // PSPHOT.OUTPUT : output object tables (object) 64 65 // PSPHOT.BACKSUB : background subtracted image 66 // PSPHOT.BACKGND : background model (full-scale image?) 67 // PSPHOT.BACKMDL : background model (binned image?) 68 // PSPHOT.PSF : sample PSF images 69 70 71 /** 72 73 filename | pmFPAfile | pmFPA | pmFPAview 74 chip00.f | PSPHOT.IN | input | view 75 chip01.f | PSPHOT.IN | input | view 76 chip02.f | PSPHOT.IN | input | view 77 chip03.f | PSPHOT.IN | input | view 78 79 out00.f | PSPHOT.OUT | input | view 80 out01.f | PSPHOT.OUT | input | view 81 out02.f | PSPHOT.OUT | input | view 82 out03.f | PSPHOT.OUT | input | view 83 84 obj00.f | PSPHOT.OBJ | input | view 85 obj01.f | PSPHOT.OBJ | input | view 86 obj02.f | PSPHOT.OBJ | input | view 87 obj03.f | PSPHOT.OBJ | input | view 88 89 bin00.f | PSPHOT.BIN | binned | view 90 bin01.f | PSPHOT.BIN | binned | view 91 bin02.f | PSPHOT.BIN | binned | view 92 bin03.f | PSPHOT.BIN | binned | view 93 94 mosaic.f | PSPHOT.MOS | mosaic | view 95 96 **/
Note:
See TracChangeset
for help on using the changeset viewer.
