Changeset 11352 for trunk/ppImage/src/ppImagePhotom.c
- Timestamp:
- Jan 27, 2007, 5:02:24 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImagePhotom.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImagePhotom.c
r11351 r11352 7 7 // the top portion of this function is equivalent to psphotParseCamera, 8 8 // but different in a few important ways. 9 // XXX move this section to ppImageParseCamera? 9 10 bool ppImagePhotom (pmConfig *config, pmFPAview *view) { 10 11 … … 27 28 // we set the freeLevel to be FPA so this pmFPAfile may be used as input to psastro 28 29 // XXX make this the resonsibility of a ppImageAstrom call? 29 pmFPAfile *outfile = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT"); 30 outfile->freeLevel = PM_FPA_LEVEL_FPA; 30 // XXX test for psastro requests? 31 // XXX need to make this an INTERNAL file if output is not requested. 32 bool saveOutput = psMetadataLookupBool (NULL, recipe, "SAVE.OUTPUT"); 33 if (saveOutput) { 34 pmFPAfile *outfile = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT"); 35 outfile->freeLevel = PM_FPA_LEVEL_FPA; 36 } 31 37 } 32 38 33 39 // if we have requested PSPHOT.SRC (externally supplied sources), attempt to resolve it 34 40 if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.SRC")) { 35 pmFPAfileDefineFromArgs (&status, config, "PSPHOT.SRC", " SRC");41 pmFPAfileDefineFromArgs (&status, config, "PSPHOT.SRC", "PSPHOT.SRC"); 36 42 if (!status) { 37 43 psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.SRC"); … … 42 48 // select recipe options supplied on command line 43 49 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 50 51 // NOTE the difference here from psphotParseCamera: the mask and weight 52 // images are supplied by ppImage and need not / should not be loaded here. 53 54 // optionally load the PSF Model and/or fixed stars 55 pmFPAfileBindFromArgs (NULL, input, config, "PSPHOT.PSF", "PSPHOT.PSF"); 44 56 45 57 // set default recipe values here … … 60 72 // optionally save the residual image 61 73 if (psMetadataLookupBool(NULL, recipe, "SAVE.RESID")) { 62 pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID"); 74 if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID")) { 75 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL"); 76 return false; 77 } 63 78 } 64 79 … … 70 85 // optionally save the background model (small FITS image) 71 86 if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKMDL")) { 72 pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL"); 87 if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL")) { 88 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL"); 89 return false; 90 } 73 91 } 74 92 // optionally save the full background image 75 93 if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKGND")) { 76 pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKGND"); 94 if (!pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKGND")) { 95 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKGND"); 96 return false; 97 } 77 98 } 78 99 // optionally save the background-subtracted image 79 100 if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKSUB")) { 80 pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKSUB"); 101 if (!pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKSUB")) { 102 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT."); 103 return false; 104 } 81 105 } 82 106 // optionally save the PSF Model 83 107 if (psMetadataLookupBool(NULL, recipe, "SAVE.PSF")) { 84 pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE"); 108 if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE")) { 109 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.PSF.SAVE"); 110 return false; 111 } 85 112 } 86 // optionally load the PSF Model 87 if (psMetadataLookupBool(NULL, recipe, "LOAD.PSF")) { 88 pmFPAfileDefineInput (config, input->fpa, "PSPHOT.PSF.LOAD"); 113 114 // optionally save output plots 115 if (psMetadataLookupBool(NULL, recipe, "SAVE.PLOTS")) { 116 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.MOMENTS")) { 117 psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.MOMENTS"); 118 } 119 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.PSFMODEL")) { 120 psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.PSFMODEL"); 121 } 89 122 } 90 123 … … 92 125 // pmFPAfileConstruct (config->files, format, config->camera, "PSPHOT.PSF_SAMPLE"); 93 126 127 // XXX probably need to deactivate all files and activate the psphot ones explicitly 128 129 // In this section, we iterate over the cells and readout for this chip 130 // and run the psphot analysis routine here 94 131 // XXX worry about this not having unique PHOTCODES... 95 132 // view->cell = -1;
Note:
See TracChangeset
for help on using the changeset viewer.
