Changeset 36119 for trunk/psphot/src/psphotStackImageLoop.c
- Timestamp:
- Sep 14, 2013, 6:11:12 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotStackImageLoop.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotStackImageLoop.c
r36086 r36119 22 22 23 23 pmFPAview *view = pmFPAviewAlloc (0); 24 pmFPAfile *inputRaw = psMetadataLookupPtr (&status, config->files, "PSPHOT.STACK.INPUT.RAW"); 25 pmFPAfile *inputCnv = psMetadataLookupPtr (&status, config->files, "PSPHOT.STACK.INPUT.CNV"); 26 pmFPAfile *input = inputRaw ? inputRaw : inputCnv; 24 pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.STACK.INPUT.RAW"); 27 25 28 26 if (!input) { … … 32 30 33 31 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE); 34 bool useRaw = psMetadataLookupBool (NULL, recipe, "PSPHOT.STACK.USE.RAW");35 if (useRaw && inputRaw == NULL) {36 psLogMsg ("psphot", 1, "PSPHOT.STACK.USE.RAW set but no raw input.");37 useRaw = false;38 }39 40 bool radial_apertures = psMetadataLookupBool(NULL, recipe, "RADIAL_APERTURES");41 bool match_psfs = radial_apertures;42 bool needConvolved = radial_apertures || !useRaw;43 if (!needConvolved) {44 pmFPAfileActivate (config->files, false, "PSPHOT.STACK.INPUT.CNV");45 pmFPAfileActivate (config->files, false, "PSPHOT.STACK.MASK.CNV");46 pmFPAfileActivate (config->files, false, "PSPHOT.STACK.VARIANCE.CNV");47 pmFPAfileActivate (config->files, false, "PSPHOT.STACK.PSF.CNV");48 }49 32 50 33 // just load the full set of images up front except for EXPNUM which we defer 51 34 pmFPAfileActivate (config->files, false, "PSPHOT.STACK.EXPNUM.RAW"); 52 pmFPAfileActivate (config->files, false, "PSPHOT.STACK.EXPNUM.CNV");53 35 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for fpa in psphot."); 54 36 … … 71 53 psMemDump("load"); 72 54 73 if (match_psfs) { 74 // Generate the 1st PSF-matched image set (larger target PSFs are generated by smoothing this image) 75 if (!psphotStackMatchPSFs (config, view)) { 76 psError(psErrorCodeLast(), false, "failure in psphotStackMatchPSFs for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 77 psFree (view); 78 return false; 79 } 80 } else { 81 if (!psphotStackAllocateOutput (config, view, recipe)) { 82 psError(psErrorCodeLast(), false, "failure in psphotStackAllocateOutput for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 83 psFree (view); 84 return false; 85 } 55 if (!psphotStackAllocateOutput (config, view, recipe)) { 56 psError(psErrorCodeLast(), false, "failure in psphotStackAllocateOutput for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 57 psFree (view); 58 return false; 86 59 } 87 60 psMemDump("stackmatch"); … … 126 99 127 100 // Load the appropriate EXPNUM image 128 pmFPAfileActivate (config->files, true, useRaw ? "PSPHOT.STACK.EXPNUM.RAW" : "PSPHOT.STACK.EXPNUM.CNV");101 pmFPAfileActivate (config->files, true, "PSPHOT.STACK.EXPNUM.RAW"); 129 102 130 103 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for fpa EXPNUM in psphot."); … … 146 119 if (! readout->data_exists) { continue; } 147 120 148 if (!psphotSetNFrames (config, view, useRaw ? inputRaw->name : inputCnv->name)) ESCAPE ("failed to setNFrames.");121 if (!psphotSetNFrames (config, view, input->name)) ESCAPE ("failed to setNFrames."); 149 122 } 150 123 } … … 167 140 bool UpdateHeadersForReadout (pmConfig *config, pmFPAview *view) { 168 141 169 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE);170 bool useRaw = psMetadataLookupBool (NULL, recipe, "PSPHOT.STACK.USE.RAW");171 172 142 int num = psphotFileruleCount(config, "PSPHOT.INPUT"); 173 143 … … 179 149 psAssert (output, "missing file?"); 180 150 181 pmFPAfile *inputRaw = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", i); // File of interest 182 pmFPAfile *inputCnv = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.CNV", i); // File of interest 183 pmFPAfile *input = useRaw ? inputRaw : inputCnv; 151 pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", i); // File of interest 184 152 psAssert (input, "missing input file"); 185 153 … … 205 173 psAssert (output, "missing file?"); 206 174 207 pmFPAfile *inputRaw = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", i); // File of interest 208 pmFPAfile *inputCnv = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.CNV", i); // File of interest 209 pmFPAfile *input = inputRaw ? inputRaw : inputCnv; 175 pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", i); // File of interest 210 176 psAssert (input, "missing input file"); 211 177 … … 242 208 psAssert (output, "missing file?"); 243 209 244 pmFPAfile *inputRaw = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", i); // File of interest 245 pmFPAfile *inputCnv = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.CNV", i); // File of interest 246 pmFPAfile *input = inputRaw ? inputRaw : inputCnv; 210 pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", i); // File of interest 247 211 psAssert (input, "missing input file"); 248 212
Note:
See TracChangeset
for help on using the changeset viewer.
