IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14209


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

adding options for mask and weight outputs, some cleanups

Location:
trunk/ppImage/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImage.h

    r14000 r14209  
    2121// Options for ppImage processing
    2222typedef struct {
     23    // actions which ppImage should perform
    2324    bool doMask;                        // Mask bad pixels
    24     psMaskType maskValue;               // apply this bit-mask to choose masked bits
    25     psMaskType satMask;                 // Mask value to give saturated pixels
    26     psMaskType badMask;                 // Mask value to give bad pixels
    27     psMaskType flatMask;                // Mask value to give bad flat pixels
    28     psMaskType blankMask;               // Mask value to give blank pixels
    29 
     25    bool doNonLin;                      // Non-linearity correction
     26    bool doOverscan;                    // Overscan subtraction
    3027    bool doBias;                        // Bias subtraction
    3128    bool doDark;                        // Dark subtraction
     
    3633    bool doAstromChip;                  // per-chip Astrometry
    3734    bool doAstromMosaic;                // full-mosaic Astrometry
    38     bool doAddstar;                     // add results to object database?
     35    bool doStats;                       // call ppStats on the image
    3936
    40     bool doOverscan;                    // Overscan subtraction
    41     pmOverscanOptions *overscan;        // Overscan options
     37    // output files requested
     38    bool BaseFITS;
     39    bool BaseMaskFITS;
     40    bool BaseWeightFITS;
    4241
    43     bool doNonLin;                      // Non-linearity correction
     42    bool ChipFITS;
     43    bool ChipMaskFITS;
     44    bool ChipWeightFITS;
     45
     46    bool FPA1FITS;
     47    bool FPA2FITS;
     48    bool Bin1FITS;
     49    bool Bin1JPEG;
     50    bool Bin2FITS;
     51    bool Bin2JPEG;
     52
     53    // make values for abstract concepts of masking
     54    psMaskType maskValue;               // apply this bit-mask to choose masked bits
     55    psMaskType satMask;                 // Mask value to give saturated pixels
     56    psMaskType badMask;                 // Mask value to give bad pixels
     57    psMaskType flatMask;                // Mask value to give bad flat pixels
     58    psMaskType blankMask;               // Mask value to give blank pixels
     59
     60    // non-linear correction parameters
    4461    psDataType nonLinearType;
    4562    psMetadataItem *nonLinearData;
    4663    void *nonLinearSource;
    4764
    48     bool doStats;
     65    // options for the analysis
     66    pmOverscanOptions *overscan;        // Overscan options
    4967
    50     bool BaseFITS;
    51     bool ChipFITS;
    52     bool FPA1FITS;
    53     bool FPA2FITS;
     68    // binning parameters
     69    int xBin1;                          // x-binning, scale 1
     70    int yBin1;                          // y-binning, scale 1
     71    int xBin2;                          // x-binning, scale 2
     72    int yBin2;                          // y-binning, scale 2
    5473
    55     bool Bin1FITS;
    56     bool Bin1JPEG;
    57     int xBin1, yBin1;
    58 
    59     bool Bin2FITS;
    60     bool Bin2JPEG;
    61     int xBin2, yBin2;
    62 
     74    // parameters used by the fringe analysis
    6375    float fringeRej;                    // Fringe rejection limit
    6476    int fringeIter;                     // Fringe iterations
    6577    float fringeKeep;                   // Fringe keep fraction
     78
    6679} ppImageOptions;
    6780
  • trunk/ppImage/src/ppImageOptions.c

    r13970 r14209  
    1717    psMemSetDeallocator(options, (psFreeFunc)imageOptionsFree);
    1818
    19     // Initialise options
    20     options->nonLinearData = NULL;
    21     options->nonLinearSource = NULL;
     19    // actions which ppImage should perform
     20    options->doMask          = false;   // Mask bad pixels
     21    options->doNonLin        = false;   // Non-linearity correction
     22    options->doOverscan      = false;   // Overscan subtraction
     23    options->doBias          = false;   // Bias subtraction
     24    options->doDark          = false;   // Dark subtraction
     25    options->doShutter       = false;   // Shutter correction
     26    options->doFlat          = false;   // Flat-field normalisation
     27    options->doFringe        = false;   // Fringe subtraction
     28    options->doPhotom        = false;   // Source identification and photometry
     29    options->doAstromChip    = false;   // Astrometry (per-chip)
     30    options->doAstromMosaic  = false;   // Astrometry (full-mosaic)
     31    options->doStats         = false;   // Measure and save image statistics
     32
     33    // output files requested
     34    options->BaseFITS        = false;   // create output image
     35    options->BaseMaskFITS    = false;   // create output mask image
     36    options->BaseWeightFITS  = false;   // create output weight image
     37
     38    options->ChipFITS        = false;   // create output chip-mosaic image
     39    options->ChipMaskFITS    = false;   // create output chip-mosaic mask image
     40    options->ChipWeightFITS  = false;   // create output chip-mosaic weight image
     41
     42    options->FPA1FITS        = false;   // create fpa-mosaic binned image (scale 1)
     43    options->FPA2FITS        = false;   // create fpa-mosaic binned image (scale 2)
     44    options->Bin1FITS        = false;   // create binned image (scale 1)
     45    options->Bin2FITS        = false;   // create binned image (scale 2)
     46    options->Bin1JPEG        = false;   // create jpeg of binned image (scale 1)
     47    options->Bin2JPEG        = false;   // create jpeg of binned image (scale 2)
    2248
    2349    // default flags for various activities
    24     options->doMask     = false;        // Mask bad pixels
    25     options->maskValue  = 0x00;         // Default mask value
    26     options->satMask    = 0x00;         // Saturated pixels
    27     options->badMask    = 0x00;         // Bad pixels
    28     options->flatMask   = 0x00;         // Bad flat pixels
    29     options->blankMask  = 0x00;         // Blank (no data, cell gap) pixels
    30 
    31     options->doNonLin   = false;        // Non-linearity correction
    32     options->doBias     = false;        // Bias subtraction
    33     options->doDark     = false;        // Dark subtraction
    34     options->doOverscan = false;        // Overscan subtraction
    35     options->doShutter  = false;        // Shutter correction
    36     options->doFlat     = false;        // Flat-field normalisation
    37     options->doFringe   = false;        // Fringe subtraction
    38     options->doPhotom   = false;        // Source identification and photometry
    39     options->doAstromChip = false;      // Astrometry
    40     options->doAstromMosaic = false;    // Astrometry
    41 
    42     options->doStats    = false;        // Measure and save image statistics
    43 
    44     options->BaseFITS   = false;        // create binned image (scale 1)
    45     options->ChipFITS   = false;        // create binned image (scale 1)
    46     options->FPA1FITS   = false;        // create binned image (scale 1)
    47     options->FPA2FITS   = false;        // create binned image (scale 1)
    48 
    49     options->Bin1FITS   = false;        // create binned image (scale 1)
    50     options->Bin2FITS   = false;        // create binned image (scale 2)
    51     options->Bin1JPEG   = false;        // create jpeg of binned image (scale 1)
    52     options->Bin2JPEG   = false;        // create jpeg of binned image (scale 2)
    53 
    54     // Overscan defaults
    55     options->overscan   = NULL;      // Overscan options
    56 
    57     // Fringe defaults
    58     options->fringeRej = NAN;
    59     options->fringeIter = 0;
    60     options->fringeKeep = 1.0;
     50    options->maskValue       = 0x00;    // Default mask value
     51    options->satMask         = 0x00;    // Saturated pixels
     52    options->badMask         = 0x00;    // Bad pixels
     53    options->flatMask        = 0x00;    // Bad flat pixels
     54    options->blankMask       = 0x00;    // Blank (no data, cell gap) pixels
    6155
    6256    // Non-linearity default options
     
    6458    options->nonLinearData   = NULL;    // The non-linearity data
    6559    options->nonLinearSource = NULL;    // If the non-linearity data is a menu, this provides the key
     60
     61    // Overscan defaults
     62    options->overscan        = NULL;    // Overscan options
     63
     64    // binning parameters
     65    options->xBin1           = 16;      // x-binning, scale 1
     66    options->yBin1           = 16;      // y-binning, scale 1
     67    options->xBin2           = 16;      // x-binning, scale 2
     68    options->yBin2           = 16;      // y-binning, scale 2
     69
     70    // Fringe defaults
     71    options->fringeRej       = NAN;     // Fringe rejection limit
     72    options->fringeIter      = 0;       // Fringe iterations
     73    options->fringeKeep      = 1.0;     // Fringe keep fraction
    6674
    6775    return options;
     
    199207    if (!status) {
    200208        psWarning("BIN1.XBIN not found in recipe: setting to default value.\n");
    201         options->xBin1 = 16;
    202209    }
    203210    options->yBin1 = psMetadataLookupS32(&status, recipe, "BIN1.YBIN");
     
    218225    }
    219226
    220     options->BaseFITS = psMetadataLookupBool(NULL, recipe, "BASE.FITS");
    221     options->ChipFITS = psMetadataLookupBool(NULL, recipe, "CHIP.FITS");
    222     options->FPA1FITS = psMetadataLookupBool(NULL, recipe, "FPA1.FITS");
    223     options->FPA2FITS = psMetadataLookupBool(NULL, recipe, "FPA2.FITS");
    224 
    225     options->Bin1FITS = psMetadataLookupBool(NULL, recipe, "BIN1.FITS");
    226     options->Bin1JPEG = psMetadataLookupBool(NULL, recipe, "BIN1.JPEG");
    227     options->Bin2FITS = psMetadataLookupBool(NULL, recipe, "BIN2.FITS");
    228     options->Bin2JPEG = psMetadataLookupBool(NULL, recipe, "BIN2.JPEG");
    229 
    230     options->doPhotom = psMetadataLookupBool(NULL, recipe, "PHOTOM");
    231     options->doAstromChip = psMetadataLookupBool(NULL, recipe, "ASTROM.CHIP");
     227    options->BaseFITS       = psMetadataLookupBool(NULL, recipe, "BASE.FITS");
     228    options->BaseMaskFITS   = psMetadataLookupBool(NULL, recipe, "BASE.MASK.FITS");
     229    options->BaseWeightFITS = psMetadataLookupBool(NULL, recipe, "BASE.WEIGHT.FITS");
     230
     231    options->ChipFITS       = psMetadataLookupBool(NULL, recipe, "CHIP.FITS");
     232    options->ChipMaskFITS   = psMetadataLookupBool(NULL, recipe, "CHIP.MASK.FITS");
     233    options->ChipWeightFITS = psMetadataLookupBool(NULL, recipe, "CHIP.WEIGHT.FITS");
     234
     235    options->FPA1FITS       = psMetadataLookupBool(NULL, recipe, "FPA1.FITS");
     236    options->FPA2FITS       = psMetadataLookupBool(NULL, recipe, "FPA2.FITS");
     237
     238    options->Bin1FITS       = psMetadataLookupBool(NULL, recipe, "BIN1.FITS");
     239    options->Bin1JPEG       = psMetadataLookupBool(NULL, recipe, "BIN1.JPEG");
     240    options->Bin2FITS       = psMetadataLookupBool(NULL, recipe, "BIN2.FITS");
     241    options->Bin2JPEG       = psMetadataLookupBool(NULL, recipe, "BIN2.JPEG");
     242
     243    options->doPhotom       = psMetadataLookupBool(NULL, recipe, "PHOTOM");
     244    options->doAstromChip   = psMetadataLookupBool(NULL, recipe, "ASTROM.CHIP");
    232245    options->doAstromMosaic = psMetadataLookupBool(NULL, recipe, "ASTROM.MOSAIC");
     246
    233247    if ((options->doAstromChip || options->doAstromMosaic) && !options->doPhotom) {
    234248        psLogMsg(__func__, PS_LOG_ERROR, "Invalid PPIMAGE options: cannot do ASTROMetry without PHOTOMetry");
    235         exit(EXIT_FAILURE);
    236     }
    237 
    238     options->doAddstar = psMetadataLookupBool(NULL, recipe, "ADDSTAR");
    239     if (options->doAddstar && !(options->doAstromChip || options->doAstromMosaic)) {
    240         psLogMsg(__func__, PS_LOG_ERROR, "Invalid PPIMAGE options: cannot Addstar without Astrometry");
    241249        exit(EXIT_FAILURE);
    242250    }
Note: See TracChangeset for help on using the changeset viewer.