Changeset 15562 for trunk/psastro/src/psastroDefineFiles.c
- Timestamp:
- Nov 9, 2007, 3:09:20 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroDefineFiles.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroDefineFiles.c
r14212 r15562 4 4 5 5 // these calls bind the I/O handle to the specified fpa 6 pmFPAfile *output = NULL;6 bool status; 7 7 8 output = pmFPAfileDefineOutput (config, input->fpa, "PSASTRO.OUTPUT"); 8 // select the current recipe 9 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE); 10 if (!recipe) { 11 psError(PSASTRO_ERR_CONFIG, false, "Can't find PSASTRO recipe!\n"); 12 return false; 13 } 14 15 pmFPAfile *output = pmFPAfileDefineOutput (config, input->fpa, "PSASTRO.OUTPUT"); 9 16 if (!output) { 10 17 psError(PSASTRO_ERR_CONFIG, false, "Failed to build FPA from PSASTRO.INPUT"); … … 12 19 } 13 20 output->save = true; 21 22 bool fixChips = psMetadataLookupBool (&status, recipe, "PSASTRO.FIX.CHIPS"); 23 24 if (fixChips) { 25 if (!psastroDefineFile (config, input->fpa, "PSASTRO.REF.ASTROM", "REF.ASTROM", PM_FPA_FILE_ASTROM, PM_DETREND_TYPE_ASTROM)) { 26 psError (PS_ERR_IO, false, "Can't find a reference astrometry file"); 27 return NULL; 28 } 29 } 14 30 15 31 # if (0) … … 25 41 return true; 26 42 } 43 44 bool psastroDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType, pmDetrendType detrendType) { 45 46 bool status; 47 pmFPAfile *file; 48 49 // look for the file on the argument list 50 file = pmFPAfileDefineFromArgs (&status, config, filerule, argname); 51 if (!status) { 52 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 53 return false; 54 } 55 if (file) { 56 if (file->type != fileType) { 57 psError(PS_ERR_IO, true, "%s is not of type %s", filerule, pmFPAfileStringFromType (fileType)); 58 return false; 59 } 60 return true; 61 } 62 63 // look for the file in the camera config table 64 file = pmFPAfileDefineFromConf (&status, config, filerule); 65 if (!status) { 66 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 67 return false; 68 } 69 if (file) { 70 if (file->type != fileType) { 71 psError(PS_ERR_IO, true, "%s is not of type %s", filerule, pmFPAfileStringFromType (fileType)); 72 return false; 73 } 74 return true; 75 } 76 77 // look for the file to be loaded from the detrend database 78 file = pmFPAfileDefineFromDetDB (&status, config, filerule, input, detrendType); 79 if (!status) { 80 psError (PS_ERR_UNKNOWN, false, "failed to load file definition"); 81 return false; 82 } 83 if (file) { 84 if (file->type != fileType) { 85 psError(PS_ERR_IO, true, "%s is not of type %s", filerule, pmFPAfileStringFromType (fileType)); 86 return false; 87 } 88 return true; 89 } 90 return false; 91 } 92
Note:
See TracChangeset
for help on using the changeset viewer.
