Changeset 14247 for trunk/ppSub/src/ppSubArguments.c
- Timestamp:
- Jul 16, 2007, 4:46:30 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppSub/src/ppSubArguments.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSub/src/ppSubArguments.c
r14245 r14247 17 17 { 18 18 fprintf(stderr, "\nPan-STARRS PSF-matched image subtraction\n\n"); 19 fprintf(stderr, "Usage: %s INPUT.fits REFERENCE.fits OUTPUT_ROOT\n", program); 19 fprintf(stderr, "Usage: %s INPUT.fits REFERENCE.fits OUTPUT_ROOT \n" 20 "\t[-psf REFERENCE.psf.fits|-psflist REFERENCE.list]\n", 21 program); 20 22 fprintf(stderr, "\n"); 21 23 psArgumentHelp(arguments); … … 153 155 } 154 156 157 // Add a single filename to the arguments as an array, so that it can be used with pmFPAfileBindFromArgs, etc 158 static void fileList(const char *file, // The symbolic name for the file 159 const char *name, // The name of the file 160 const char *comment, // Description of the file 161 pmConfig *config // Configuration 162 ) 163 { 164 psArray *files = psArrayAlloc(1); // Array with file names 165 files->data[0] = psStringCopy(name); 166 psMetadataAddArray(config->arguments, PS_LIST_TAIL, file, 0, comment, files); 167 psFree(files); 168 return; 169 } 155 170 156 171 bool ppSubArguments(int argc, char *argv[], pmConfig *config) … … 185 200 } 186 201 187 psArray *files = psArrayAlloc(1); // Array with file names 188 files->data[0] = psStringCopy(argv[1]); 189 psMetadataAddArray(config->arguments, PS_LIST_TAIL, "INPUT", 0, "Name of the input image", files); 190 psFree(files); 191 files = psArrayAlloc(1); 192 files->data[0] = psStringCopy(argv[2]); 193 psMetadataAddArray(config->arguments, PS_LIST_TAIL, "REF", 0, "Name of the reference image", files); 194 psFree(files); 202 fileList("INPUT", argv[1], "Name of the input image", config); 203 fileList("REF", argv[2], "Name of the reference image", config); 195 204 psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[3]); 196 205 197 valueArgStr(arguments, "-inmask", "INPUT.MASK", config->arguments); 198 valueArgStr(arguments, "-inweight", "INPUT.WEIGHT", config->arguments); 199 valueArgStr(arguments, "-refmask", "REF.MASK", config->arguments); 200 valueArgStr(arguments, "-refweight", "REF.WEIGHT", config->arguments); 206 const char *inMask = psMetadataLookupStr(NULL, arguments, "-inmask"); // Name of input mask 207 if (inMask && strlen(inMask) > 0) { 208 fileList("INPUT.MASK", inMask, "Name of the input mask image", config); 209 } 210 const char *inWeight = psMetadataLookupStr(NULL, arguments, "-inweight"); // Name of input weight 211 if (inWeight && strlen(inWeight) > 0) { 212 fileList("INPUT.WEIGHT", inWeight, "Name of the input weight image", config); 213 } 214 215 const char *refMask = psMetadataLookupStr(NULL, arguments, "-refmask"); // Name of reference mask 216 if (refMask && strlen(refMask) > 0) { 217 fileList("REF.MASK", refMask, "Name of the reference mask image", config); 218 } 219 const char *refWeight = psMetadataLookupStr(NULL, arguments, "-refweight"); // Name of reference weight 220 if (refWeight && strlen(refWeight) > 0) { 221 fileList("REF.WEIGHT", refWeight, "Name of the reference weight image", config); 222 } 223 201 224 valueArgStr(arguments, "-stats", "STATS", config->arguments); 202 225
Note:
See TracChangeset
for help on using the changeset viewer.
