IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 13, 2012, 2:13:03 PM (14 years ago)
Author:
bills
Message:

add option to to ppstamp to return an entire file instead of a region of interest.
This is useful for two purposes.

  1. To undo the asinh storage for stacks
  2. To replace the astrometry from chip stage with the camera stage fit

Also fixed a bug in jpeg creation for chip stage. Dropped the flipping for chip
stage as well. That is incorrect. We want the jpeg to match the chip image.
Also made the default to no_censor_masked since that isn't the usual case now
that magic is no longer a requirement

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/src/ppstampParseCamera.c

    r33389 r33504  
    88
    99// Set up the ppstamp output Image file
    10 bool setupOutput(pmConfig *config, pmFPAfile *input, psString stage, bool doMask, bool doWeight, pmFPAfile **pOutput)
     10bool setupOutput(pmConfig *config, pmFPAfile *input, ppstampOptions *options, bool doMask, bool doWeight, pmFPAfile **pOutput)
    1111{
    12     pmFPAfile *output;
    13    
    14     if (!stage || (strcmp(stage, "diff") != 0)) {
    15         output = pmFPAfileDefineSkycell(config, NULL, "PPSTAMP.OUTPUT");
     12    if (!options->stage || (strcmp(options->stage, "diff") != 0)) {
     13        if (options->nocompress) {
     14            options->outputFileRule = "PPSTAMP.OUTPUT.NOCOMP";
     15        } else {
     16            options->outputFileRule = "PPSTAMP.OUTPUT";
     17        }
    1618    } else {
    1719        // need special filerule for diff stage image to allow for negative values
    18         output = pmFPAfileDefineSkycell(config, NULL, "PPSTAMP.OUTPUT.DIFF");
     20        if (options->nocompress) {
     21            options->outputFileRule = "PPSTAMP.OUTPUT.DIFF.NOCOMP";
     22        } else {
     23            options->outputFileRule = "PPSTAMP.OUTPUT.DIFF";
     24        }
    1925    }
     26    pmFPAfile *output = pmFPAfileDefineSkycell(config, NULL, options->outputFileRule);
    2027    if (!output) {
    2128        psError(PS_ERR_UNKNOWN, false, "Unable to setup output.");
     
    2734
    2835    if (doMask) {
    29         pmFPAfile *outMask = pmFPAfileDefineSkycell(config, output->fpa, "PPSTAMP.OUTPUT.MASK");
     36        char *rule;
     37        if (options->nocompress) {
     38            rule =  "PPSTAMP.OUTPUT.MASK.NOCOMP";
     39        } else {
     40            rule =  "PPSTAMP.OUTPUT.MASK";
     41        }
     42        pmFPAfile *outMask = pmFPAfileDefineSkycell(config, output->fpa, rule);
    3043        outMask->save = true;
    3144    }
    3245    if (doWeight) {
    33         pmFPAfile *outWeight = pmFPAfileDefineSkycell(config, output->fpa, "PPSTAMP.OUTPUT.VARIANCE");
     46        char *rule;
     47        if (options->nocompress) {
     48            rule =  "PPSTAMP.OUTPUT.VARIANCE.NOCOMP";
     49        } else {
     50            rule =  "PPSTAMP.OUTPUT.VARIANCE";
     51        }
     52        pmFPAfile *outWeight = pmFPAfileDefineSkycell(config, output->fpa, rule);
    3453        outWeight->save = true;
    3554    }
    36 
    3755
    3856    return true;
     
    97115    // Set up the output target
    98116    pmFPAfile *output;
    99     if (!setupOutput(config, input, options->stage, doMask, doWeight, &output)) {
     117    if (!setupOutput(config, input, options, doMask, doWeight, &output)) {
    100118        psError(PS_ERR_UNKNOWN, false, "Unable to setup output.");
    101119        return false;
     
    113131
    114132    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);
     133        char *filerule = "PPSTAMP.OUTPUT.JPEG";
     134        pmFPAfile *jpg = pmFPAfileDefineSkycell(config, output->fpa, filerule);
    125135        if (!jpg) {
    126136            psError(PS_ERR_IO, false, "Unable to generate new file from %s", filerule);
Note: See TracChangeset for help on using the changeset viewer.