Changeset 12805 for trunk/psphot/src/psphotParseCamera.c
- Timestamp:
- Apr 11, 2007, 1:57:26 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotParseCamera.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotParseCamera.c
r12792 r12805 1 # include "psphot Internal.h"1 # include "psphotStandAlone.h" 2 2 3 3 // define the needed / desired I/O files … … 15 15 load->dataLevel = PM_FPA_LEVEL_CHIP; // force load at the CHIP level 16 16 17 // if MASK or WEIGHT was supplied on command line, bind files to 'load' 18 // the mask and weight will be mosaicked with the image 19 pmFPAfileBindFromArgs (NULL, load, config, "PSPHOT.MASK", "MASK"); 20 pmFPAfileBindFromArgs (NULL, load, config, "PSPHOT.WEIGHT", "WEIGHT"); 21 17 22 // the psphot analysis is performed on chips 18 23 pmFPAfile *input = pmFPAfileDefineChipMosaic(config, load->fpa, "PSPHOT.INPUT"); … … 22 27 } 23 28 24 // if we have requested PSPHOT.SRC, attempt to resolve it 25 // this is a list of input sources, stored in a psphot output format file 26 # if (0) 27 if (psMetadataLookupPtr(NULL, config->arguments, "SRC")) { 28 pmFPAfileDefineFromArgs (&status, config, "PSPHOT.SRC", "SRC"); 29 if (!status) { 30 psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.SRC"); 31 return status; 32 } 29 // define the additional input/output files associated with psphot 30 if (!psphotDefineFiles (config, input)) { 31 psError(PSPHOT_ERR_CONFIG, false, "Trouble defining the additional input/output files"); 32 return false; 33 33 } 34 # endif35 36 // select recipe options supplied on command line37 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);38 39 // these values are used below to define the background subtraction images.40 41 // if MASK or WEIGHT was supplied on command line, bind files to input fpa42 // XXX these do not quite yet work: pmFPAAddSourceFromHeader is not appropriate43 // the mask and weight will be mosaic'ed with the image44 pmFPAfileBindFromArgs (NULL, load, config, "PSPHOT.MASK", "MASK");45 pmFPAfileBindFromArgs (NULL, load, config, "PSPHOT.WEIGHT", "WEIGHT");46 47 // optionally load the PSF Model and/or fixed stars48 // XXX bind this to the input or the load file?49 // if the readout->analysis entries are copied, we can bind to the load file50 // XXX add this back in later51 // pmFPAfileBindFromArgs (NULL, input, config, "PSPHOT.PSF", "PSF");52 53 // XXX we need to be able to distinguish several cases:54 // 1) the particular output data was not requested55 // 2) the particular output data was requested but was not generated (skipped)56 // 3) the particular output data was requested but was not generated (for valid failure)57 // 4) the particular output data was requested but was not generated (surprising failure)58 59 // the output sources are carried on the input->fpa structures60 if (psMetadataLookupBool (NULL, recipe, "SAVE.OUTPUT")) {61 if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT")) {62 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.OUTPUT");63 return false;64 }65 }66 // optionally save the residual image67 if (psMetadataLookupBool(NULL, recipe, "SAVE.RESID")) {68 if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID")) {69 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL");70 return false;71 }72 }73 // optionally save the background model (small FITS image)74 if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKMDL")) {75 int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN");76 int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN");77 if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL")) {78 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL");79 return false;80 }81 }82 // optionally save the full background image83 if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKGND")) {84 if (!pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKGND")) {85 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKGND");86 return false;87 }88 }89 // optionally save the background-subtracted image90 if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKSUB")) {91 if (!pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKSUB")) {92 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.");93 return false;94 }95 }96 // optionally save the PSF Model97 if (psMetadataLookupBool(NULL, recipe, "SAVE.PSF")) {98 if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE")) {99 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.PSF.SAVE");100 return false;101 }102 }103 104 // optionally save output plots105 if (psMetadataLookupBool(NULL, recipe, "SAVE.PLOTS")) {106 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.MOMENTS")) {107 psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.MOMENTS");108 }109 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.PSFMODEL")) {110 psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.PSFMODEL");111 }112 }113 114 // XXX add in example PSF image thumbnails115 // pmFPAfileConstruct (config->files, format, config->camera, "PSPHOT.PSF_SAMPLE");116 34 117 35 // Chip selection: turn on only the chips specified (pass status to suppress missing-key log msg)
Note:
See TracChangeset
for help on using the changeset viewer.
