Changeset 6522 for trunk/psphot/src/psphotImageLoop.c
- Timestamp:
- Mar 5, 2006, 2:02:35 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotImageLoop.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotImageLoop.c
r6379 r6522 1 1 # include "psphot.h" 2 2 3 bool psphotImageLoop (p pFile *file, ppConfig *config) {3 bool psphotImageLoop (psphotData *data, ppConfig *config) { 4 4 5 bool status; 6 ppImageLoadDepth imageLoadDepth; 5 pmFPA *fpa = data->input->fpa; 7 6 8 // determine the load depth 9 const char *depth = psMetadataLookupStr(&status, config->recipe, "LOAD.DEPTH"); 10 if (! status || ! depth || strlen(depth) == 0) { 11 psLogMsg("psphot", PS_LOG_ERROR, "LOAD.DEPTH not specified in recipe."); 12 exit(EXIT_FAILURE); 13 } 14 imageLoadDepth = PP_LOAD_NONE; 15 if (!strcasecmp(depth, "FPA")) imageLoadDepth = PP_LOAD_FPA; 16 if (!strcasecmp(depth, "CHIP")) imageLoadDepth = PP_LOAD_CHIP; 17 if (!strcasecmp(depth, "CELL")) imageLoadDepth = PP_LOAD_CELL; 18 if (imageLoadDepth == PP_LOAD_NONE) { 19 psLogMsg(__func__, PS_LOG_ERROR, "LOAD.DEPTH in recipe is not FPA, CHIP or CELL."); 20 exit(EXIT_FAILURE); 21 } 7 psphotDataIO (data, config, -1, -1); 22 8 23 if (imageLoadDepth == PP_LOAD_FPA) { 24 psTrace(__func__, 1, "Loading pixels for FPA...\n"); 25 ppImageLoadPixels(file, config->database, -1, -1); 26 } 27 28 for (int i = 0; i < file->fpa->chips->n; i++) { 29 pmChip *chip = file->fpa->chips->data[i]; // Chip of interest in input image 9 for (int i = 0; i < fpa->chips->n; i++) { 10 pmChip *chip = fpa->chips->data[i]; // Chip of interest in input image 30 11 31 12 psLogMsg ("psphot", 4, "Chip %d: %x %x\n", i, chip->exists, chip->process); 32 13 if (! chip->process) { continue; } 33 14 34 if (imageLoadDepth == PP_LOAD_CHIP) { 35 psTrace(__func__, 1, "Loading pixels for chip %d...\n", i); 36 ppImageLoadPixels(file, config->database, i, -1); 37 } 15 psphotDataIO (data, config, i, -1); 38 16 39 17 for (int j = 0; j < chip->cells->n; j++) { … … 43 21 if (! cell->process) { continue; } 44 22 45 if (imageLoadDepth == PP_LOAD_CELL) { 46 psTrace(__func__, 1, "Loading pixels for chip %d, cell %d...\n", i, j); 47 ppImageLoadPixels(file, config->database, i, j); 48 } 49 23 psphotDataIO (data, config, i, j); 24 50 25 // XXX optional mask and weight input image should be loaded here? 51 26 // this sets the weight map and basic mask applying CELL.BAD and CELL.SATURATION … … 61 36 // run a single-model test if desired 62 37 psphotModelTest (readout, config->arguments, config->recipe); 63 psphotReadout (readout, config->recipe); 64 psphotOutput (readout, config->arguments); 38 39 // run the actual photometry analysis 40 psphotReadout (readout, data, config); 41 42 // XXX what do we do if we have multiple readouts? 43 psphotOutput (readout, data, config); 65 44 } 66 45 } 67 46 } 47 psphotOutputClose (data); 68 48 return true; 69 49 }
Note:
See TracChangeset
for help on using the changeset viewer.
