Changeset 38384
- Timestamp:
- Jun 5, 2015, 12:36:49 PM (11 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 3 edited
-
psphotStackArguments.c (modified) (1 diff)
-
psphotStackImageLoop.c (modified) (2 diffs)
-
psphotStackParseCamera.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotStackArguments.c
r34282 r38384 31 31 // these options override the PSPHOT recipe values loaded from recipe files 32 32 psMetadata *options = pmConfigRecipeOptions (config, PSPHOT_RECIPE); 33 34 bool updateMode = false; 35 if ((N = psArgumentGet (argc, argv, "-updatemode"))) { 36 psArgumentRemove (N, &argc, argv); 37 updateMode = true; 38 } 39 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "PSPHOT.STACK.UPDATEMODE", 0, "update mode flag", updateMode); 33 40 34 41 // visual : interactive display mode -
trunk/psphot/src/psphotStackImageLoop.c
r36839 r38384 30 30 31 31 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE); 32 bool updateMode = psMetadataLookupBool(&status, config->arguments, "PSPHOT.STACK.UPDATEMODE"); 32 33 33 34 // just load the full set of images up front except for EXPNUM which we defer … … 61 62 62 63 // XXX for now, we assume there is only a single chip in the PHU: 63 if (!psphotStackReadout (config, view)) { 64 psError(psErrorCodeLast(), false, "failure in psphotStackReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 65 psFree (view); 66 return false; 67 } 64 if (!updateMode) { 65 if (!psphotStackReadout (config, view)) { 66 psError(psErrorCodeLast(), false, "failure in psphotStackReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 67 psFree (view); 68 return false; 69 } 70 } else { 71 if (!psphotStackUpdateReadout (config, view)) { 72 psError(psErrorCodeLast(), false, "failure in psphotStackReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 73 psFree (view); 74 return false; 75 } 76 } 68 77 69 78 UpdateHeadersForReadout(config, view); -
trunk/psphot/src/psphotStackParseCamera.c
r37608 r38384 18 18 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 19 19 bool savePSF = psMetadataLookupBool(&status, recipe, "SAVE.PSF"); 20 // XXX: bills: I don't think psphotStack will work if SAVE.BACKMDL is false 20 21 bool saveBackgroundModel = psMetadataLookupBool(&status, recipe, "SAVE.BACKMDL"); 21 22 bool saveBackground = psMetadataLookupBool(&status, recipe, "SAVE.BACKGND"); … … 26 27 bool saveChisq = psMetadataLookupBool(&status, recipe, "SAVE.CHISQ"); 27 28 bool useRaw = psMetadataLookupBool(&status, recipe, "PSPHOT.STACK.USE.RAW"); 29 30 bool updateMode = psMetadataLookupBool(&status, config->arguments, "PSPHOT.STACK.UPDATEMODE"); 31 if (updateMode) { 32 // Tell the sources reader to save a copy of the header from the input sources file on 33 // readout->analysis so that we can copy some metadata from measurements that are skipped 34 // in update mode from there to the analysis structure. 35 psMetadataAddBool(recipe, PS_LIST_TAIL, "SAVE.INPUT.SOURCES.HEADER", PS_META_REPLACE, "", true); 36 } 28 37 29 38 … … 65 74 } 66 75 } 67 psString psf = psMetadataLookupStr(&status, input, "RAW:PSF"); // Name of mask76 psString psf = psMetadataLookupStr(&status, input, "RAW:PSF"); // Name of psf 68 77 if (psf && strlen(psf) > 0) { 69 if (!defineFile(config, rawInputFile, "PSPHOT.STACK.PSF.RAW", psf, PM_FPA_FILE_PSF)) { 78 // if (!defineFile(config, rawInputFile, "PSPHOT.STACK.PSF.RAW", psf, PM_FPA_FILE_PSF)) { 79 if (!defineFile(config, rawInputFile, "PSPHOT.PSF.LOAD", psf, PM_FPA_FILE_PSF)) { 70 80 psError(PS_ERR_UNKNOWN, false, "Unable to define file from psf %d (%s)", i, psf); 81 return false; 82 } 83 } 84 psString backmdl = psMetadataLookupStr(&status, input, "RAW:BACKMDL"); // Name of background model 85 if (backmdl && strlen(backmdl) > 0) { 86 if (!defineFile(config, NULL, "PSPHOT.STACK.BACKMDL.RAW", backmdl, PM_FPA_FILE_IMAGE)) { 87 psError(PS_ERR_UNKNOWN, false, "Unable to define file from backmdl %d (%s)", i, backmdl); 71 88 return false; 72 89 } … … 144 161 } 145 162 146 psString sources = psMetadataLookupStr(&status, input, "SOURCES"); // Name of mask 147 if (sources && strlen(sources) > 0) { 148 if (!defineFile(config, NULL, "PSPHOT.STACK.SOURCES", sources, PM_FPA_FILE_CMF)) { 149 psError(PS_ERR_UNKNOWN, false, "Unable to define file from sources %d (%s)", i, sources); 150 return false; 151 } 152 } 163 psString sources = psMetadataLookupStr(&status, input, "SOURCES"); // Name of sources 164 if (sources && strlen(sources) > 0) { 165 // input sources are not bound to fpa. 166 // XXX: bills: I believe that they are only required in -updatemode now. 167 if (!defineFile(config, NULL, "PSPHOT.STACK.SOURCES", sources, PM_FPA_FILE_CMF)) { 168 psError(PS_ERR_UNKNOWN, false, "Unable to define file from sources %d (%s)", i, sources); 169 return false; 170 } 171 } 153 172 154 173 psS64 stack_id = psMetadataLookupS64(&status, input, "STACK_ID"); … … 207 226 return false; 208 227 } 209 output->save = true; 228 // don't save psf in update mode? 229 output->save = !updateMode; 210 230 output->fileID = stack_id; 211 231 } … … 219 239 } 220 240 221 output->save = true; 241 // do not save the background model file when in update mode. We need to create the file above 242 // but we don't need save it. 243 output->save = !updateMode; 222 244 output->fileID = stack_id; 223 245 }
Note:
See TracChangeset
for help on using the changeset viewer.
