Changeset 13413
- Timestamp:
- May 17, 2007, 12:43:04 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotDefineFiles.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotDefineFiles.c
r13225 r13413 17 17 // the output sources are carried on the input->fpa structures 18 18 if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT")) { 19 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.OUTPUT");20 return false;19 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.OUTPUT"); 20 return false; 21 21 } 22 22 23 // if we are choosing not to save the output detections, mark this file inactive so it will 23 // if we are choosing not to save the output detections, mark this file inactive so it will 24 24 // not be written, but will keep the detections in memory for other functions (eg, astrometry) 25 25 if (!psMetadataLookupBool (NULL, recipe, "SAVE.OUTPUT")) { 26 pmFPAfileActivate (config->files, false, "PSPHOT.OUTPUT");26 pmFPAfileActivate (config->files, false, "PSPHOT.OUTPUT"); 27 27 } 28 28 29 // optionally save the residual image 29 // optionally save the residual image 30 30 if (psMetadataLookupBool(NULL, recipe, "SAVE.RESID")) { 31 if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID")) {32 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.RESID");33 return false;34 }31 if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID")) { 32 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.RESID"); 33 return false; 34 } 35 35 } 36 36 // optionally save the background model (small FITS image) 37 37 if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKMDL")) { 38 int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN");39 int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN");40 if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL")) {41 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL");42 return false;43 }38 int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN"); 39 int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN"); 40 if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL")) { 41 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL"); 42 return false; 43 } 44 44 } 45 45 // optionally save the background model's standard deviation (small FITS image) 46 46 if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKMDL.STDEV")) { 47 int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN");48 int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN");49 if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL.STDEV")) {50 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL.STDEV");51 return false;52 }47 int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN"); 48 int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN"); 49 if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL.STDEV")) { 50 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL.STDEV"); 51 return false; 52 } 53 53 } 54 54 // optionally save the full background image 55 55 if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKGND")) { 56 if (!pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKGND")) {57 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKGND");58 return false;59 }56 if (!pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKGND")) { 57 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKGND"); 58 return false; 59 } 60 60 } 61 61 // optionally save the background-subtracted image 62 62 if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKSUB")) { 63 if (!pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKSUB")) {64 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.");65 return false;66 }63 if (!pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKSUB")) { 64 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT."); 65 return false; 66 } 67 67 } 68 68 // optionally save the PSF Model 69 69 if (psMetadataLookupBool(NULL, recipe, "SAVE.PSF")) { 70 if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE")) {71 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.PSF.SAVE");72 return false;73 }70 if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE")) { 71 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.PSF.SAVE"); 72 return false; 73 } 74 74 } 75 75 76 76 // optionally save output plots 77 77 if (psMetadataLookupBool(NULL, recipe, "SAVE.PLOTS")) { 78 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.MOMENTS")) {79 psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.MOMENTS");80 }81 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.PSFMODEL")) {82 psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.PSFMODEL");83 }84 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.APRESID")) {85 psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.APRESID");86 }78 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.MOMENTS")) { 79 psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.MOMENTS"); 80 } 81 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.PSFMODEL")) { 82 psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.PSFMODEL"); 83 } 84 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.APRESID")) { 85 psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.APRESID"); 86 } 87 87 } 88 88 89 if (psMetadataLookupPtr(NULL, config->arguments, "SRC")) { 90 pmFPAfileDefineFromArgs (&status, config, "PSPHOT.INPUT.CMF", "SRC"); 91 if (!status) { 92 psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.INPUT.CMF"); 93 return status; 94 } 89 if (psMetadataLookupPtr(NULL, config->arguments, "SRC")) { 90 status = false; 91 pmFPAfileDefineFromArgs (&status, config, "PSPHOT.INPUT.CMF", "SRC"); 92 if (!status) { 93 psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.INPUT.CMF"); 94 return status; 95 } 95 96 } 96 97 97 if (psMetadataLookupPtr(NULL, config->arguments, "PSF")) { 98 pmFPAfileDefineFromArgs (&status, config, "PSPHOT.PSF.LOAD", "PSF"); 99 if (!status) { 100 psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.SRC"); 101 return status; 102 } 98 if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.PSF")) { 99 status = false; 100 pmFPAfileDefineFromArgs (&status, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF"); 101 if (!status) { 102 psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.SRC"); 103 return status; 104 } 103 105 } 104 106 … … 109 111 } 110 112 111 // if we have requested PSPHOT.SRC, attempt to resolve it 113 // if we have requested PSPHOT.SRC, attempt to resolve it 112 114 // this is a list of input sources, stored in a psphot output format file 113 115 // XXX this was disabled after the switch to CHIP-mosaicked images. It needs to be tested 114 116 // before it is added back into the code. 115 # if (0) 117 # if (0) 116 118 // optionally load the PSF Model and/or fixed stars 117 119 // XXX add this back in later
Note:
See TracChangeset
for help on using the changeset viewer.
