- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pswarp/src/pswarpArguments.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/pswarp/src/pswarpArguments.c
r23688 r27840 14 14 # include <glob.h> 15 15 16 17 static void usage (void) { 18 fprintf(stderr, "USAGE: pswarp [-file image(s)] [-list imagelist] [options] (output) (skycell)\n"); 19 fprintf(stderr, " options:\n"); 20 fprintf(stderr, " [-astrom astrom.cmp] : provide an alternative astrometry calibration\n"); 21 fprintf(stderr, " [-mask mask.fits] : provide a corresponding mask image\n"); 22 fprintf(stderr, " [-variance variance.fits] : provide a corresponding variance image\n"); 23 psErrorStackPrint(stderr, "\n"); 24 exit(PS_EXIT_CONFIG_ERROR); 25 } 26 27 16 28 pmConfig *pswarpArguments (int argc, char **argv) { 17 29 … … 20 32 21 33 if (argc == 1) { 22 psError(PSWARP_ERR_ARGUMENTS, true, "No arguments supplied"); 23 return NULL; 34 usage(); 24 35 } 25 36 26 37 // load config data from default locations 27 38 pmConfig *config = pmConfigRead(&argc, argv, PSWARP_RECIPE); 28 if ( config == NULL) {29 psError( PSWARP_ERR_CONFIG, false, "Can't read siteconfiguration");39 if (!config) { 40 psError(psErrorCodeLast(), false, "Can't read configuration"); 30 41 return NULL; 31 42 } … … 33 44 // save the following additional recipe values based on command-line options 34 45 // these options override the PSWARP recipe values loaded from recipe files 35 pmConfigRecipeOptions (config, PSWARP_RECIPE); 46 if (!pmConfigRecipeOptions(config, PSWARP_RECIPE)) { 47 psError(psErrorCodeLast(), false, "Can't do something with recipes"); 48 psFree(config); 49 return NULL; 50 } 36 51 37 52 pmConfigFileSetsMD(config->arguments, &argc, argv, "ASTROM", "-astrom", "-astromlist"); … … 72 87 psThreadPoolInit (nThreads); 73 88 } 74 pswarpSetThreads (); 75 76 // PSF determination? 77 if ((N = psArgumentGet(argc, argv, "-psf"))) { 78 psArgumentRemove(N, &argc, argv); 79 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "PSF", 0, "Do PSF determination?", true); 80 } 89 pswarpSetThreads(); 90 81 91 if ((N = psArgumentGet(argc, argv, "-dumpconfig"))) { 82 92 psArgumentRemove(N, &argc, argv); … … 92 102 93 103 if (argc != 3) { 94 psError(PSWARP_ERR_ARGUMENTS, true, "Incorrect arguments supplied"); 95 return NULL; 104 usage(); 96 105 } 97 106 … … 161 170 poorFrac = 0.0; 162 171 psWarning("POOR.FRAC is not set in the %s recipe --- defaulting to %f.", PSWARP_RECIPE, poorFrac); 172 } 173 174 bool PSF = psMetadataLookupBool(&status, recipe, "PSF"); ///< Generate a PSF model? 175 if (!status) { 176 PSF = true; 177 psWarning("PSF is not set in the %s recipe --- defaulting to TRUE.", PSWARP_RECIPE); 163 178 } 164 179 … … 174 189 psMetadataAddF32(recipe, PS_LIST_TAIL, "POOR.FRAC", PS_META_REPLACE, 175 190 "Fraction of bad flux for a pixel to be marked as poor", poorFrac); 191 psMetadataAddBool(recipe, PS_LIST_TAIL, "PSF", PS_META_REPLACE, "Generate a PSF Model?", PSF); 176 192 177 193 // Set recipe values in the arguments … … 186 202 psMetadataAddF32(config->arguments, PS_LIST_TAIL, "POOR.FRAC", 0, 187 203 "Fraction of bad flux for a pixel to be marked as poor", poorFrac); 204 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "PSF", PS_META_REPLACE, "Generate a PSF Model?", PSF); 188 205 189 206 psTrace("pswarp", 1, "Done with pswarpArguments...\n");
Note:
See TracChangeset
for help on using the changeset viewer.
