Changeset 13528
- Timestamp:
- May 25, 2007, 5:09:20 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
ppImage/src/Makefile.am (modified) (2 diffs)
-
ppImage/src/ppFocusParseCamera.c (modified) (1 diff)
-
ppImage/src/ppImage.h (modified) (1 diff)
-
ppImage/src/ppImageParseCamera.c (modified) (4 diffs)
-
ppStack/src/ppStackCamera.c (modified) (1 diff)
-
ppSub/src/ppSubCamera.c (modified) (4 diffs)
-
psphot/src/psphotDefineFiles.c (modified) (3 diffs)
-
psphot/src/psphotParseCamera.c (modified) (1 diff)
-
pswarp/src/pswarpParseCamera.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/Makefile.am
r11291 r13528 26 26 ppImageAstrom.c \ 27 27 ppImageAddstar.c \ 28 ppImageDefineFile.c \ 28 29 ppImageVersion.c 29 30 … … 47 48 ppImageAstrom.c \ 48 49 ppImageAddstar.c \ 50 ppImageDefineFile.c \ 49 51 ppImageVersion.c 50 52 -
trunk/ppImage/src/ppFocusParseCamera.c
r11702 r13528 25 25 // not all input or output images are used in a given recipe 26 26 if (options->doBias) { 27 bool status = false; 28 pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.BIAS", "BIAS"); 29 pmFPAfileDefineFromConf (&status, config, "PPIMAGE.BIAS"); 30 pmFPAfileDefineFromDetDB (&status, config, "PPIMAGE.BIAS", input->fpa, PM_DETREND_TYPE_BIAS); 31 if (!status) psAbort("can't find a bias image source"); 27 if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.BIAS", "BIAS", PM_FPA_FILE_IMAGE)) { 28 psError (PS_ERR_IO, false, "Can't find a bias image source"); 29 return NULL; 30 } 32 31 } 33 32 if (options->doDark) { 34 bool status = false; 35 pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.DARK", "DARK"); 36 pmFPAfileDefineFromConf (&status, config, "PPIMAGE.DARK"); 37 pmFPAfileDefineFromDetDB (&status, config, "PPIMAGE.DARK", input->fpa, PM_DETREND_TYPE_DARK); 38 if (!status) psAbort("can't find a dark image source"); 33 if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.DARK", "DARK", PM_FPA_FILE_IMAGE)) { 34 psError (PS_ERR_IO, false, "Can't find a dark image source"); 35 return NULL; 36 } 39 37 } 40 38 if (options->doMask) { 41 bool status = false; 42 pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.MASK", "MASK"); 43 pmFPAfileDefineFromConf (&status, config, "PPIMAGE.MASK"); 44 pmFPAfileDefineFromDetDB (&status, config, "PPIMAGE.MASK", input->fpa, PM_DETREND_TYPE_MASK); 45 if (!status) psAbort("can't find a mask image source"); 39 if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.MASK", "MASK", PM_FPA_FILE_MASK)) { 40 psError (PS_ERR_IO, false, "Can't find a mask image source"); 41 return NULL; 42 } 46 43 } 47 44 if (options->doFlat) { 48 bool status = false; 49 pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.FLAT", "FLAT"); 50 pmFPAfileDefineFromConf (&status, config, "PPIMAGE.FLAT"); 51 pmFPAfileDefineFromDetDB (&status, config, "PPIMAGE.FLAT", input->fpa, PM_DETREND_TYPE_FLAT); 52 if (!status) psAbort("can't find a flat image source"); 45 if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.FLAT", "FLAT", PM_FPA_FILE_IMAGE)) { 46 psError (PS_ERR_IO, false, "Can't find a shutter image source"); 47 return NULL; 48 } 53 49 } 54 50 -
trunk/ppImage/src/ppImage.h
r12819 r13528 61 61 void ppFocusDropCamera (pmConfig *config); 62 62 63 bool ppImageDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType type); 64 63 65 #endif -
trunk/ppImage/src/ppImageParseCamera.c
r12824 r13528 22 22 // if MASK or WEIGHT was supplied on command line, bind files to 'input' 23 23 // the mask and weight will be mosaicked with the image 24 pmFPAfile *inputMask = pmFPAfileBindFromArgs(NULL, input, config, "PPIMAGE.INPUT.MASK", "INPUT.MASK"); 24 pmFPAfile *inputMask = pmFPAfileBindFromArgs(&status, input, config, "PPIMAGE.INPUT.MASK", "INPUT.MASK"); 25 if (!status) { 26 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 27 return NULL; 28 } 25 29 if (inputMask && inputMask->type != PM_FPA_FILE_MASK) { 26 30 psError(PS_ERR_IO, true, "PPIMAGE.INPUT.MASK is not of type MASK"); … … 28 32 } 29 33 30 pmFPAfile *inputWeight = pmFPAfileBindFromArgs(NULL, input, config, "PPIMAGE.INPUT.WEIGHT", "INPUT.WEIGHT"); 34 pmFPAfile *inputWeight = pmFPAfileBindFromArgs(&status, input, config, "PPIMAGE.INPUT.WEIGHT", "INPUT.WEIGHT"); 35 if (!status) { 36 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 37 return NULL; 38 } 31 39 if (inputWeight && inputWeight->type != PM_FPA_FILE_WEIGHT) { 32 40 psError(PS_ERR_IO, true, "PPIMAGE.INPUT.WEIGHT is not of type WEIGHT"); … … 44 52 // not all input or output images are used in a given recipe 45 53 if (options->doBias) { 46 bool status = false; 47 pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.BIAS", "BIAS"); 48 pmFPAfileDefineFromConf (&status, config, "PPIMAGE.BIAS"); 49 pmFPAfileDefineFromDetDB (&status, config, "PPIMAGE.BIAS", input->fpa, PM_DETREND_TYPE_BIAS); 50 pmFPAfile *bias = psMetadataLookupPtr(NULL, config->files, "PPIMAGE.BIAS"); 51 if (!status || !bias) { 52 psError (PS_ERR_IO, false, "Can't find a bias image source"); 53 psFree(options); 54 return NULL; 55 } 56 if (bias->type != PM_FPA_FILE_IMAGE) { 57 psError(PS_ERR_IO, true, "PPIMAGE.BIAS is not of type IMAGE"); 58 psFree(options); 59 return NULL; 60 } 54 if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.BIAS", "BIAS", PM_FPA_FILE_IMAGE)) { 55 psError (PS_ERR_IO, false, "Can't find a bias image source"); 56 psFree (options); 57 return NULL; 58 } 61 59 } 62 60 if (options->doDark) { 63 bool status = false; 64 pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.DARK", "DARK"); 65 pmFPAfileDefineFromConf (&status, config, "PPIMAGE.DARK"); 66 pmFPAfileDefineFromDetDB (&status, config, "PPIMAGE.DARK", input->fpa, PM_DETREND_TYPE_DARK); 67 pmFPAfile *dark = psMetadataLookupPtr(NULL, config->files, "PPIMAGE.DARK"); 68 if (!status || !dark) { 69 psError (PS_ERR_IO, false, "Can't find a dark image source"); 70 psFree(options); 71 return NULL; 72 } 73 if (dark->type != PM_FPA_FILE_IMAGE) { 74 psError(PS_ERR_IO, true, "PPIMAGE.DARK is not of type IMAGE"); 75 psFree(options); 76 return NULL; 77 } 61 if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.DARK", "DARK", PM_FPA_FILE_IMAGE)) { 62 psError (PS_ERR_IO, false, "Can't find a dark image source"); 63 psFree (options); 64 return NULL; 65 } 78 66 } 79 67 if (options->doMask) { 80 bool status = false; 81 pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.MASK", "MASK"); 82 pmFPAfileDefineFromConf (&status, config, "PPIMAGE.MASK"); 83 pmFPAfileDefineFromDetDB (&status, config, "PPIMAGE.MASK", input->fpa, PM_DETREND_TYPE_MASK); 84 pmFPAfile *mask = psMetadataLookupPtr(NULL, config->files, "PPIMAGE.MASK"); 85 if (!status || !mask) { 86 psError (PS_ERR_IO, false, "Can't find a mask image source"); 87 psFree(options); 88 return NULL; 89 } 90 if (mask->type != PM_FPA_FILE_MASK) { 91 psError(PS_ERR_IO, true, "PPIMAGE.MASK is not of type MASK"); 92 psFree(options); 93 return NULL; 94 } 68 if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.MASK", "MASK", PM_FPA_FILE_MASK)) { 69 psError (PS_ERR_IO, false, "Can't find a mask image source"); 70 psFree (options); 71 return NULL; 72 } 95 73 } 96 74 if (options->doShutter) { 97 bool status = false; 98 pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.SHUTTER", "SHUTTER"); 99 pmFPAfileDefineFromConf (&status, config, "PPIMAGE.SHUTTER"); 100 pmFPAfileDefineFromDetDB (&status, config, "PPIMAGE.SHUTTER", input->fpa, PM_DETREND_TYPE_SHUTTER); 101 pmFPAfile *shutter = psMetadataLookupPtr(NULL, config->files, "PPIMAGE.SHUTTER"); 102 if (!status || !shutter) { 103 psError (PS_ERR_IO, false, "Can't find a shutter image source"); 104 psFree(options); 105 return NULL; 106 } 107 if (shutter->type != PM_FPA_FILE_IMAGE) { 108 psError(PS_ERR_IO, true, "PPIMAGE.SHUTTER is not of type IMAGE"); 109 psFree(options); 110 return NULL; 111 } 75 if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.SHUTTER", "SHUTTER", PM_FPA_FILE_IMAGE)) { 76 psError (PS_ERR_IO, false, "Can't find a flat image source"); 77 psFree (options); 78 return NULL; 79 } 112 80 } 113 81 114 82 if (options->doFlat) { 115 // if we fail to find the item in Args, we try again in Conf, then DetDB 116 // we need to handle the errors and catch serious errors, as opposed to 117 // data-not-found errors 118 bool status = false; 119 pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.FLAT", "FLAT"); 120 psErrorClear(); 121 pmFPAfileDefineFromConf (&status, config, "PPIMAGE.FLAT"); 122 psErrorClear(); 123 pmFPAfileDefineFromDetDB (&status, config, "PPIMAGE.FLAT", input->fpa, PM_DETREND_TYPE_FLAT); 124 pmFPAfile *flat = psMetadataLookupPtr(NULL, config->files, "PPIMAGE.FLAT"); 125 if (!status || !flat) { 126 psError (PS_ERR_IO, false, "Can't find a flat image source"); 127 psFree(options); 128 return NULL; 129 } 130 if (flat->type != PM_FPA_FILE_IMAGE) { 131 psError(PS_ERR_IO, true, "PPIMAGE.FLAT is not of type IMAGE"); 132 psFree(options); 133 return NULL; 134 } 83 if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.FLAT", "FLAT", PM_FPA_FILE_IMAGE)) { 84 psError (PS_ERR_IO, false, "Can't find a shutter image source"); 85 psFree (options); 86 return NULL; 87 } 135 88 } 136 89 … … 183 136 skip_fringe: 184 137 if (options->doFringe) { 185 bool status = false; 186 pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.FRINGE", "FRINGE"); 187 pmFPAfileDefineFromConf (&status, config, "PPIMAGE.FRINGE"); 188 pmFPAfileDefineFromDetDB (&status, config, "PPIMAGE.FRINGE", input->fpa, PM_DETREND_TYPE_FRINGE_IMAGE); 189 pmFPAfile *fringe = psMetadataLookupPtr(NULL, config->files, "PPIMAGE.FRINGE"); 190 if (!status || !fringe) { 191 psError (PS_ERR_IO, false, "Can't find a fringe image source"); 192 psFree(options); 193 return NULL; 194 } 195 if (fringe->type != PM_FPA_FILE_FRINGE) { 196 psError(PS_ERR_IO, true, "PPIMAGE.FRINGE is not of type FRINGE"); 197 psFree(options); 198 return NULL; 199 } 138 if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.FRINGE", "FRINGE", PM_FPA_FILE_FRINGE)) { 139 psError (PS_ERR_IO, false, "Can't find a fringe image source"); 140 return NULL; 141 } 200 142 } 201 143 -
trunk/ppStack/src/ppStackCamera.c
r13515 r13528 87 87 psFree(maskFiles); 88 88 89 found = false; 90 pmFPAfile *maskFile = pmFPAfileBindFromArgs(&found, imageFile, config, "PPSTACK.INPUT.MASK", 91 "MASK.FILENAMES"); 92 if (!maskFile || !found) { 89 bool status; 90 pmFPAfile *maskFile = pmFPAfileBindFromArgs(&status, imageFile, config, "PPSTACK.INPUT.MASK", "MASK.FILENAMES"); 91 if (!status) { 93 92 psError(PS_ERR_UNKNOWN, false, "Unable to define file from mask %d (%s)", i, mask); 94 93 return false; -
trunk/ppSub/src/ppSubCamera.c
r13462 r13528 26 26 27 27 // Input mask 28 pmFPAfile *inputMask = pmFPAfileBindFromArgs(NULL, input, config, "PPSUB.INPUT.MASK", "INPUT.MASK"); 28 pmFPAfile *inputMask = pmFPAfileBindFromArgs(&status, input, config, "PPSUB.INPUT.MASK", "INPUT.MASK"); 29 if (!status) { 30 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 31 return NULL; 32 } 29 33 if (inputMask && inputMask->type != PM_FPA_FILE_MASK) { 30 34 psError(PS_ERR_IO, true, "PPSUB.INPUT.MASK is not of type MASK"); … … 33 37 34 38 // Input weight map 35 pmFPAfile *inputWeight = pmFPAfileBindFromArgs(NULL, input, config, "PPSUB.INPUT.WEIGHT", "INPUT.WEIGHT"); 39 pmFPAfile *inputWeight = pmFPAfileBindFromArgs(&status, input, config, "PPSUB.INPUT.WEIGHT", "INPUT.WEIGHT"); 40 if (!status) { 41 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 42 return NULL; 43 } 36 44 if (inputWeight && inputWeight->type != PM_FPA_FILE_WEIGHT) { 37 45 psError(PS_ERR_IO, true, "PPSUB.INPUT.WEIGHT is not of type WEIGHT"); … … 52 60 53 61 // Reference mask 54 pmFPAfile *refMask = pmFPAfileBindFromArgs(NULL, input, config, "PPSUB.REF.MASK", "REF.MASK"); 62 pmFPAfile *refMask = pmFPAfileBindFromArgs(&status, input, config, "PPSUB.REF.MASK", "REF.MASK"); 63 if (!status) { 64 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 65 return NULL; 66 } 55 67 if (refMask && refMask->type != PM_FPA_FILE_MASK) { 56 68 psError(PS_ERR_IO, true, "PPSUB.REF.MASK is not of type MASK"); … … 59 71 60 72 // Reference weight map 61 pmFPAfile *refWeight = pmFPAfileBindFromArgs(NULL, input, config, "PPSUB.REF.WEIGHT", "REF.WEIGHT"); 73 pmFPAfile *refWeight = pmFPAfileBindFromArgs(&status, input, config, "PPSUB.REF.WEIGHT", "REF.WEIGHT"); 74 if (!status) { 75 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 76 return NULL; 77 } 62 78 if (refWeight && refWeight->type != PM_FPA_FILE_WEIGHT) { 63 79 psError(PS_ERR_IO, true, "PPSUB.REF.WEIGHT is not of type WEIGHT"); -
trunk/psphot/src/psphotDefineFiles.c
r13416 r13528 75 75 76 76 // optionally save output plots 77 // allow specific plots only 77 78 if (psMetadataLookupBool(NULL, recipe, "SAVE.PLOTS")) { 78 79 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.MOMENTS")) { 79 psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.MOMENTS"); 80 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for SOURCE.PLOT.MOMENTS"); 81 return false; 80 82 } 81 83 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.PSFMODEL")) { 82 psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.PSFMODEL"); 84 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for SOURCE.PLOT.PSFMODEL"); 85 return false; 83 86 } 84 87 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.APRESID")) { 85 psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.APRESID"); 88 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for SOURCE.PLOT.APRESID"); 89 return false; 86 90 } 87 91 } 88 92 89 93 if (psMetadataLookupPtr(NULL, config->arguments, "SRC")) { 90 status = false; 91 pmFPAfileDefineFromArgs (&status, config, "PSPHOT.INPUT.CMF", "SRC"); 92 if (!status) { 94 if (!pmFPAfileDefineFromArgs (&status, config, "PSPHOT.INPUT.CMF", "SRC")) { 93 95 psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.INPUT.CMF"); 94 96 return status; … … 97 99 98 100 if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.PSF")) { 99 status = false;100 101 pmFPAfileBindFromArgs(&status, input, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF"); 101 // pmFPAfileDefineFromArgs (&status, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF");102 102 if (!status) { 103 103 psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.PSF.LOAD"); … … 111 111 return true; 112 112 } 113 114 // if we have requested PSPHOT.SRC, attempt to resolve it115 // this is a list of input sources, stored in a psphot output format file116 // XXX this was disabled after the switch to CHIP-mosaicked images. It needs to be tested117 // before it is added back into the code.118 # if (0)119 // optionally load the PSF Model and/or fixed stars120 // XXX add this back in later121 // pmFPAfileBindFromArgs (NULL, input, config, "PSPHOT.PSF", "PSF");122 # endif123 -
trunk/psphot/src/psphotParseCamera.c
r12805 r13528 17 17 // if MASK or WEIGHT was supplied on command line, bind files to 'load' 18 18 // the mask and weight will be mosaicked with the image 19 pmFPAfileBindFromArgs (NULL, load, config, "PSPHOT.MASK", "MASK"); 20 pmFPAfileBindFromArgs (NULL, load, config, "PSPHOT.WEIGHT", "WEIGHT"); 19 pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.MASK", "MASK"); 20 if (!status) { 21 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 22 return NULL; 23 } 24 25 pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.WEIGHT", "WEIGHT"); 26 if (!status) { 27 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 28 return NULL; 29 } 21 30 22 31 // the psphot analysis is performed on chips -
trunk/pswarp/src/pswarpParseCamera.c
r12771 r13528 10 10 status = false; 11 11 pmFPAfile *input = pmFPAfileDefineFromArgs (&status, config, "PSWARP.INPUT", "INPUT"); 12 if (!input ) {12 if (!input || !status) { 13 13 psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.INPUT"); 14 14 return false; … … 17 17 // the input image(s) are required arguments; they define the camera 18 18 status = false; 19 pmFPAfileDefineFromArgs (&status, config, "PSWARP.ASTROM", "ASTROM"); 20 if (status) { 19 pmFPAfile *astrom = pmFPAfileDefineFromArgs (&status, config, "PSWARP.ASTROM", "ASTROM"); 20 if (!status) { 21 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 22 return NULL; 23 } 24 if (astrom) { 21 25 psLogMsg ("pswarp", 3, "using supplied astrometry\n"); 22 26 } else { … … 25 29 26 30 // the mask is not required - but must conform to input camera 27 pmFPAfile *inMask = pmFPAfileBindFromArgs(NULL, input, config, "PSWARP.MASK", "MASK"); 31 pmFPAfile *inMask = pmFPAfileBindFromArgs(&status, input, config, "PSWARP.MASK", "MASK"); 32 if (!status) { 33 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 34 return NULL; 35 } 28 36 if (!inMask) { 29 37 psLogMsg ("pswarp", 3, "no mask supplied\n"); 30 38 } 31 39 32 pmFPAfile *inWeight = pmFPAfileBindFromArgs(NULL, input, config, "PSWARP.WEIGHT", "WEIGHT"); 40 pmFPAfile *inWeight = pmFPAfileBindFromArgs(&status, input, config, "PSWARP.WEIGHT", "WEIGHT"); 41 if (!status) { 42 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 43 return NULL; 44 } 33 45 if (!inWeight) { 34 46 psLogMsg ("pswarp", 3, "no weight supplied\n");
Note:
See TracChangeset
for help on using the changeset viewer.
