IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 13, 2007, 5:41:45 PM (19 years ago)
Author:
eugene
Message:

adding options for mask, weight outputs; deprecating the FILE.SAVE in camera.config

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageParseCamera.c

    r13901 r14211  
    143143
    144144    // the following files are output targets
    145     pmFPAfile *output = pmFPAfileDefineOutput(config, input->fpa, "PPIMAGE.OUTPUT");
    146     if (!output) {
     145    pmFPAfile *outImage = pmFPAfileDefineOutput(config, input->fpa, "PPIMAGE.OUTPUT");
     146    if (!outImage) {
    147147        psError(PS_ERR_IO, false, _("Unable to generate output file from PPIMAGE.OUTPUT"));
    148148        psFree(options);
    149149        return NULL;
    150150    }
    151     if (output->type != PM_FPA_FILE_IMAGE) {
     151    if (outImage->type != PM_FPA_FILE_IMAGE) {
    152152        psError(PS_ERR_IO, true, "PPIMAGE.OUTPUT is not of type IMAGE");
    153153        psFree(options);
     
    177177    }
    178178
    179     // XXX should these be bound explicitly to the output->fpa rather than the input->fpa?
     179    // XXX should these be bound explicitly to the outImage->fpa rather than the input->fpa?
    180180    pmFPAfile *chipImage = pmFPAfileDefineChipMosaic(config, input->fpa, "PPIMAGE.CHIP");
    181181    if (!chipImage) {
     
    238238    // we create a copy of the mosaicked image for psphot so we can write out a clean image
    239239    if (options->doPhotom) {
     240
     241        // this file is just used as a carrier; output files (eg, PSPHOT.RESID) are defined by
     242        // psphotDefineFiles
    240243        pmFPAfile *psphotInput = pmFPAfileDefineFromFPA (config, chipImage->fpa, 1, 1, "PSPHOT.INPUT");
    241244        PS_ASSERT (psphotInput, false);
    242 
    243         // this file is just used as a carrier;
    244         // actual output files (eg, PSPHOT.RESID) are defined below
    245         psphotInput->save = false;
    246245
    247246        // define associated psphot input/output files
     
    274273
    275274    // save any of these files?
    276     output->save = outMask->save = outWeight->save = options->BaseFITS;
    277     chipImage->save = chipMask->save = chipWeight->save = options->ChipFITS;
    278     byFPA1->save = options->FPA1FITS;
    279     byFPA2->save = options->FPA2FITS;
    280 
    281     // output is used as a carrier: input to chipImage -> require the data to remain at the CHIP level
    282     output->freeLevel = PS_MIN (output->freeLevel, PM_FPA_LEVEL_CHIP);
    283     output->dataLevel = output->freeLevel;
    284     output->fileLevel = PS_MIN (output->fileLevel, output->dataLevel);
    285 
    286     // outMask and outWeight must be freed at the same level as output (all freed by pmFPAFreeData)
    287     outMask->freeLevel   = output->freeLevel;
    288     outWeight->freeLevel = output->freeLevel;
    289     outMask->dataLevel   = output->dataLevel;
    290     outWeight->dataLevel = output->dataLevel;
     275    outImage->save   = options->BaseFITS;
     276    outMask->save    = options->BaseMaskFITS;
     277    outWeight->save  = options->BaseWeightFITS;
     278
     279    chipImage->save  = options->ChipFITS;
     280    chipMask->save   = options->ChipMaskFITS;
     281    chipWeight->save = options->ChipWeightFITS;
     282
     283    byFPA1->save     = options->FPA1FITS;
     284    byFPA2->save     = options->FPA2FITS;
     285
     286    // outImage is used as a carrier: input to chipImage -> require the data to remain at the CHIP level
     287    outImage->freeLevel = PS_MIN (outImage->freeLevel, PM_FPA_LEVEL_CHIP);
     288    outImage->dataLevel = outImage->freeLevel;
     289    outImage->fileLevel = PS_MIN (outImage->fileLevel, outImage->dataLevel);
     290
     291    // outMask and outWeight must be freed at the same level as outImage (all freed by pmFPAFreeData)
     292    outMask->freeLevel   = outImage->freeLevel;
     293    outWeight->freeLevel = outImage->freeLevel;
     294    outMask->dataLevel   = outImage->dataLevel;
     295    outWeight->dataLevel = outImage->dataLevel;
    291296
    292297    // Ditto for the chip-mosaicked version
     
    296301    chipWeight->dataLevel = chipImage->dataLevel;
    297302
    298     // the input data is the same as the output data : force the free levels to match
    299     input->freeLevel = PS_MIN (output->freeLevel, input->freeLevel);
     303    // the input data is the same as the outImage data : force the free levels to match
     304    input->freeLevel = PS_MIN (outImage->freeLevel, input->freeLevel);
    300305
    301306    // define the binned target files (which may just be carriers for some camera configurations)
     
    376381        // It's a fringe file, so change the file type
    377382        input->type = PM_FPA_FILE_FRINGE;
    378         output->type = PM_FPA_FILE_FRINGE;
     383        outImage->type = PM_FPA_FILE_FRINGE;
    379384    }
    380385
    381386    // Turn off mask and weight output if we're not doing anything interesting
    382     if (!options->doMask && !options->doShutter && !options->doFlat && !options->doPhotom) {
     387    bool noMask = (!options->doMask && !options->doShutter && !options->doFlat && !options->doPhotom);
     388    if (noMask && outMask->save) {
     389        psWarning("output mask image (BASE.MASK.FITS) requested, but not generated: skipping.\n");
    383390        outMask->save = false;
     391    }
     392    if (noMask && outWeight->save) {
     393        psWarning("output weight image (BASE.WEIGHT.FITS) requested, but not generated: skipping.\n");
    384394        outWeight->save = false;
     395    }
     396    if (noMask && chipMask->save) {
     397        psWarning("output mask image (CHIP.MASK.FITS) requested, but not generated: skipping.\n");
    385398        chipMask->save = false;
     399    }
     400    if (noMask && chipWeight->save) {
     401        psWarning("output weight image (CHIP.WEIGHT.FITS) requested, but not generated: skipping.\n");
    386402        chipWeight->save = false;
    387403    }
Note: See TracChangeset for help on using the changeset viewer.