- Timestamp:
- Jul 17, 2014, 12:36:19 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-ops-20130712
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psastro/src/psastroDefineFiles.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-ops-20130712
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-ops-20130712/psastro/src/psastroDefineFiles.c
r32964 r37068 43 43 if (!psastroDefineFile (config, input->fpa, "PSASTRO.MODEL", "ASTROM.MODEL", PM_FPA_FILE_ASTROM_MODEL, PM_DETREND_TYPE_ASTROM)) { 44 44 psError (PS_ERR_IO, false, "Can't find an astrometry model file"); 45 return NULL; 46 } 47 } 45 return false; 46 } 47 } 48 49 bool KHapply = psMetadataLookupBool (&status, recipe, "KH.CORRECT.APPLY"); 50 if (KHapply) { 51 // Get the time from FPA.TIME 52 psTime *time = psMetadataLookupPtr(NULL, input->fpa->concepts, "FPA.TIME"); 53 if (time->sec == 0 && time->nsec == 0) { 54 psError (PM_ERR_CONFIG, false, "KH.CORRECT.APPLY requested, but date/time of exposure not found"); 55 return false; 56 } 57 // what is the appropriate date range for the correction 58 char *KHendDate = psMetadataLookupStr (&status, recipe, "KH.CORRECT.ENDDATE"); 59 if (!KHendDate) { 60 psError (PM_ERR_CONFIG, false, "KH.CORRECT.APPLY requested, but KH.CORRECT.ENDDATE not in recipe"); 61 return false; 62 } 63 psTime *endtime = psTimeFromString (KHendDate, PS_TIME_TAI); 64 if (!endtime) { 65 psError (PM_ERR_CONFIG, false, "KH.CORRECT.APPLY requested, KH.CORRECT.ENDDATE has an invalid date/time"); 66 return false; 67 } 68 if (psTimeDelta (endtime, time) < 0) { 69 KHapply = false; 70 psLogMsg ("psastro", PS_LOG_INFO, "Koppenhoefer correction requested, but exposure after end date, correction skipped"); 71 } else { 72 psLogMsg ("psastro", PS_LOG_INFO, "Koppenhoefer correction requested, exposure in valid date range, correction may be applied"); 73 } 74 psFree (endtime); 75 } 76 if (KHapply) { 77 if (!psastroDefineFile (config, input->fpa, "PSASTRO.KH.CORRECT", "KH.CORRECT", PM_FPA_FILE_KH_CORRECT, PM_DETREND_TYPE_KH_CORRECT)) { 78 psError (PS_ERR_IO, false, "Can't find a Koppenhoefer Correction file"); 79 return NULL; 80 } 81 } 82 // the bool above in the recipe says "apply generally for this camera". here we are asserting that 83 // we can and should apply for this exposure XXX change the name? 84 psMetadataAddBool (recipe, PS_LIST_TAIL, "KH.CORRECT.APPLY.EXP", PS_META_REPLACE, "", KHapply); 48 85 49 86 // this step is optional … … 100 137 } 101 138 139 bool writeCff = psMetadataLookupBool (&status, recipe, "PSASTRO.SAVE.CFF"); 140 if (writeCff) { 141 pmFPAfile *file = pmFPAfileDefineOutputFromFile (config, input, "PSPHOT.OUTPUT.CFF"); 142 if (!file) { 143 psError (PS_ERR_IO, false, "Can't find the output cff file definition"); 144 return NULL; 145 } 146 if (file->type != PM_FPA_FILE_CFF) { 147 psError(PS_ERR_IO, true, "%s is not of type %s", "PSPHOT.OUTPUT.CFF", pmFPAfileStringFromType (PM_FPA_FILE_CFF)); 148 return NULL; 149 } 150 file->save = true; 151 } 152 102 153 103 154 # if (0)
Note:
See TracChangeset
for help on using the changeset viewer.
