Changeset 30118 for branches/czw_branch/20101203/psphot/src/psphotOutput.c
- Timestamp:
- Dec 20, 2010, 2:30:45 PM (16 years ago)
- Location:
- branches/czw_branch/20101203
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20101203
- Property svn:mergeinfo changed
-
branches/czw_branch/20101203/psphot
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20101103/psphot (added) merged: 29660,29824-29825,29904,29914,29918,29920
- Property svn:mergeinfo changed
-
branches/czw_branch/20101203/psphot/src/psphotOutput.c
r29902 r30118 1 1 # include "psphotInternal.h" 2 3 // convert filerule to filerule.NUM and look up in the config->arguments metadata 4 int psphotFileruleCount(const pmConfig *config, const char *filerule) { 5 6 bool status = false; 7 8 psString name = NULL; 9 psStringAppend(&name, "%s.NUM", filerule); 10 int num = psMetadataLookupS32 (&status, config->arguments, name); 11 if (!status) { 12 // we only explicitly define (filerule.NUM) if we have more than 1 13 num = 1; 14 } 15 psFree (name); 16 return num; 17 } 2 18 3 19 pmReadout *psphotSelectBackground (pmConfig *config, … … 63 79 fclose (f); 64 80 return true; 65 }66 67 // XXX replace this with a call to a pmConfig function (pmConfigDump...)68 bool psphotDumpConfig (pmConfig *config) {69 70 psMetadataConfigWrite (config->user, "user.md");71 psMetadataConfigWrite (config->camera, "camera.md");72 psMetadataConfigWrite (config->recipes, "recipes.md");73 psMetadataConfigWrite (config->arguments, "arguments.md");74 psMetadataConfigWrite (config->files, "files.md");75 return true;76 81 } 77 82 … … 126 131 } 127 132 133 bool psphotCleanInputsReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index); 134 bool psphotCleanInputs (pmConfig *config, const pmFPAview *view, const char *filerule) { 135 136 int num = psphotFileruleCount(config, filerule); 137 138 // loop over the available readouts 139 for (int i = 0; i < num; i++) { 140 if (!psphotCleanInputsReadout (config, view, filerule, i)) { 141 psError (PSPHOT_ERR_CONFIG, false, "failed to clean inputs for %s entry %d", filerule, i); 142 return false; 143 } 144 } 145 return true; 146 } 147 148 bool psphotCleanInputsReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index) { 149 150 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, index); // File of interest 151 PS_ASSERT (file, false); 152 153 pmReadout *readout = pmFPAviewThisReadout (view, file->fpa); 154 155 // XXX anything else to remove? 156 if (psMetadataLookup(readout->analysis, "PSPHOT.DETECTIONS")) { 157 psMetadataRemoveKey(readout->analysis, "PSPHOT.DETECTIONS"); 158 } 159 160 return true; 161 } 162 128 163 bool psphotAddPhotcode (pmConfig *config, const pmFPAview *view, const char *filerule) { 129 164 130 bool status = false; 131 132 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 133 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 165 int num = psphotFileruleCount(config, filerule); 134 166 135 167 // loop over the available readouts 136 168 for (int i = 0; i < num; i++) { 137 169 if (!psphotAddPhotcodeReadout (config, view, filerule, i)) { 138 psError (PSPHOT_ERR_CONFIG, false, "failed to add photcode to PSPHOT.INPUT entry %d", i);170 psError (PSPHOT_ERR_CONFIG, false, "failed to add photcode to %s entry %d", filerule, i); 139 171 return false; 140 172 } … … 357 389 // XXX need alternative output function 358 390 // psMetadata *psfData = pmPSFtoMetadata (NULL, try->psf); 359 // psMetadataConfigWrite (psfData, "psfmodel.dat" );391 // psMetadataConfigWrite (psfData, "psfmodel.dat", NULL); 360 392 psLogMsg ("psphot.choosePSF", PS_LOG_INFO, "wrote out psf-subtracted image, psf data, exiting\n"); 361 393
Note:
See TracChangeset
for help on using the changeset viewer.
