Changeset 33378 for trunk/pstamp/src
- Timestamp:
- Feb 28, 2012, 11:56:52 AM (14 years ago)
- Location:
- trunk/pstamp/src
- Files:
-
- 3 edited
-
ppstampArguments.c (modified) (2 diffs)
-
ppstampOptions.h (modified) (1 diff)
-
ppstampParseCamera.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/src/ppstampArguments.c
r29885 r33378 21 21 fprintf(stderr, "\n"); 22 22 fprintf(stderr, "Optional arguments:\n"); 23 fprintf(stderr, " [-class_id class_id] selects class_id (only used with -pixcenter)\n"); 24 fprintf(stderr, " [-astrom astrom.cmp] : provide an alternative astrometry calibration\n"); 25 fprintf(stderr, " [-mask mk_image] : mask image\n"); 26 fprintf(stderr, " [-variance var_image] : variance image\n"); 27 fprintf(stderr, " [-no_censor_masked] : do not set masked pixels to NAN\n"); 23 fprintf(stderr, " [-class_id class_id] : selects class_id (only used with -pixcenter)\n"); 24 fprintf(stderr, " [-astrom astrom.cmp] : provide an alternative astrometry calibration\n"); 25 fprintf(stderr, " [-mask mk_image] : mask image\n"); 26 fprintf(stderr, " [-variance var_image] : variance image\n"); 27 fprintf(stderr, " [-stage stage] : stage of input image (raw, chip, warp, stack, diff)\n"); 28 fprintf(stderr, " [-write_jpeg] : write a JPEG format of the image stamp\n"); 29 // fprintf(stderr, " [-no_censor_masked] : do not set masked pixels to NAN\n"); 28 30 fprintf(stderr, "\n"); 29 31 … … 84 86 psArgumentRemove(argnum, &argc, argv); 85 87 } 88 if ((argnum = psArgumentGet(argc, argv, "-write_jpeg"))) { 89 psArgumentRemove(argnum, &argc, argv); 90 options->writeJPEG = true; 91 } else { 92 options->writeJPEG = false; 93 } 86 94 87 95 pmConfigFileSetsMD(config->arguments, &argc, argv, "ASTROM", "-astrom", "-astromlist"); -
trunk/pstamp/src/ppstampOptions.h
r29885 r33378 16 16 psRegion roi; // roi in chip coordinates 17 17 bool censorMasked; 18 18 bool writeJPEG; 19 19 } ppstampOptions; 20 20 -
trunk/pstamp/src/ppstampParseCamera.c
r29379 r33378 8 8 9 9 // Set up the ppstamp output Image file 10 bool setupOutput(pmConfig *config, pmFPAfile *input, psString stage, bool doMask, bool doWeight )10 bool setupOutput(pmConfig *config, pmFPAfile *input, psString stage, bool doMask, bool doWeight, pmFPAfile **pOutput) 11 11 { 12 12 pmFPAfile *output; … … 22 22 return false; 23 23 } 24 *pOutput = output; 24 25 25 26 output->save = true; … … 33 34 outWeight->save = true; 34 35 } 36 35 37 36 38 return true; … … 76 78 77 79 78 79 80 // XXX: create a filerule for PPSTAMP.ASTROM 80 81 pmFPAfile *astrom = pmFPAfileDefineFromArgs(&status, config, "PSWARP.ASTROM", "ASTROM"); … … 95 96 96 97 // Set up the output target 97 if (!setupOutput(config, input, options->stage, doMask, doWeight)) { 98 pmFPAfile *output; 99 if (!setupOutput(config, input, options->stage, doMask, doWeight, &output)) { 98 100 psError(PS_ERR_UNKNOWN, false, "Unable to setup output."); 99 101 return false; 100 102 } 101 103 102 pmFPAfile *chipImage = pmFPAfileDefineChipMosaic(config, input->fpa, "PPSTAMP.CHIP");104 pmFPAfile *chipImage = pmFPAfileDefineChipMosaic(config, output->fpa, "PPSTAMP.CHIP"); 103 105 if (!chipImage) { 104 106 psError(PS_ERR_IO, false, _("Unable to generate new file from PPSTAMP.CHIP")); … … 108 110 psError(PS_ERR_IO, true, "PPSTAMP.CHIP is not of type IMAGE"); 109 111 return NULL; 112 } 113 114 if (options->writeJPEG) { 115 char *filerule; 116 // If stage is chip flip the X axis otherwise don't flip. 117 // XXX: is this the right thing to do? 118 // Shouldn't the JPEG match the stamp even for chip stage? 119 if (!options->stage || strcmp(options->stage, "chip")) { 120 filerule = "PPSTAMP.OUTPUT.JPEG"; 121 } else { 122 filerule = "PPSTAMP.OUTPUT.JPEG.FLIP"; 123 } 124 pmFPAfile *jpg = pmFPAfileDefineOutput(config, output->fpa, filerule); 125 if (!jpg) { 126 psError(PS_ERR_IO, false, "Unable to generate new file from %s", filerule); 127 return NULL; 128 } 129 if (jpg->type != PM_FPA_FILE_JPEG) { 130 psError(PS_ERR_IO, true, "%s is not of type JPEG", filerule); 131 return NULL; 132 } 133 jpg->save = true; 110 134 } 111 135
Note:
See TracChangeset
for help on using the changeset viewer.
