IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9342


Ignore:
Timestamp:
Oct 5, 2006, 5:36:46 PM (20 years ago)
Author:
Paul Price
Message:

Adding shutter correction.

Location:
trunk/ppImage/src
Files:
6 edited

Legend:

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

    r9058 r9342  
    5757    pmConfigFileSetsMD (config->arguments, config, "BIAS", "-bias", "-biaslist");
    5858    pmConfigFileSetsMD (config->arguments, config, "DARK", "-dark", "-darklist");
     59    pmConfigFileSetsMD (config->arguments, config, "SHUTTER", "-shutter", "-shutterlist");
    5960    pmConfigFileSetsMD (config->arguments, config, "FLAT", "-flat", "-flatlist");
    6061    pmConfigFileSetsMD (config->arguments, config, "MASK", "-mask", "-masklist");
  • trunk/ppImage/src/ppImageDetrendReadout.c

    r9142 r9342  
    4949    }
    5050
     51    // Shutter correction
     52    if (options->doShutter) {
     53        pmReadout *shutter = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.SHUTTER");
     54        if (!pmShutterCorrectionApply(input, shutter)) {
     55            return false;
     56        }
     57    }
     58
    5159    // Flat-field correction (no options used?)
    5260    if (options->doFlat) {
  • trunk/ppImage/src/ppImageOptions.c

    r8751 r9342  
    2323
    2424    // default flags for various activities
    25     options->doMask     = false;        // Mask bad pixels
     25    options->doMask     = false;        // Mask bad pixels
    2626    options->maskValue  = 0xff;         // Default mask value
    2727
    28     options->doNonLin   = false;        // Non-linearity correction
    29     options->doBias     = false;        // Bias subtraction
    30     options->doDark     = false;        // Dark subtraction
     28    options->doNonLin   = false;        // Non-linearity correction
     29    options->doBias     = false;        // Bias subtraction
     30    options->doDark     = false;        // Dark subtraction
    3131    options->doOverscan = false;        // Overscan subtraction
    32     options->doFlat     = false;        // Flat-field normalisation
    33     options->doFringe   = false;        // Fringe subtraction
    34     options->doPhotom   = false;        // Source identification and photometry
    35     options->doAstromChip = false;      // Astrometry
    36     options->doAstromMosaic = false;    // Astrometry
    37 
    38     options->BaseFITS   = false;        // create binned image (scale 1)
    39     options->ChipFITS   = false;        // create binned image (scale 1)
    40     options->FPA1FITS   = false;        // create binned image (scale 1)
    41     options->FPA2FITS   = false;        // create binned image (scale 1)
    42 
    43     options->Bin1FITS   = false;        // create binned image (scale 1)
    44     options->Bin2FITS   = false;        // create binned image (scale 2)
    45     options->Bin1JPEG   = false;        // create jpeg of binned image (scale 1)
    46     options->Bin2JPEG   = false;        // create jpeg of binned image (scale 2)
     32    options->doShutter  = false;        // Shutter correction
     33    options->doFlat     = false;        // Flat-field normalisation
     34    options->doFringe   = false;        // Fringe subtraction
     35    options->doPhotom   = false;        // Source identification and photometry
     36    options->doAstromChip = false;      // Astrometry
     37    options->doAstromMosaic = false;    // Astrometry
     38
     39    options->BaseFITS   = false;        // create binned image (scale 1)
     40    options->ChipFITS   = false;        // create binned image (scale 1)
     41    options->FPA1FITS   = false;        // create binned image (scale 1)
     42    options->FPA2FITS   = false;        // create binned image (scale 1)
     43
     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)
    4748
    4849    // Overscan defaults
    49     options->overscan      = NULL;      // Overscan options
     50    options->overscan      = NULL;      // Overscan options
    5051
    5152    // Non-linearity default options
    5253    options->nonLinearType   = 0;       // Type of non-linearity data (vector, string or metadata)
    53     options->nonLinearData   = NULL;    // The non-linearity data
     54    options->nonLinearData   = NULL;    // The non-linearity data
    5455    options->nonLinearSource = NULL;    // If the non-linearity data is a menu, this provides the key
    5556
     
    119120
    120121        // How do we fit it?
    121         pmFit overscanFit = PM_FIT_NONE; // Fit type for overscan
    122         int overscanOrder = 0;          // Order for overscan fit
     122        pmFit overscanFit = PM_FIT_NONE; // Fit type for overscan
     123        int overscanOrder = 0;          // Order for overscan fit
    123124        psString fit = psMetadataLookupStr(NULL, recipe, "OVERSCAN.FIT");
    124125        if (! strcasecmp(fit, "POLYNOMIAL")) {
     
    132133        } else if (strcasecmp(fit, "NONE")) {
    133134            psLogMsg(__func__, PS_LOG_WARN, "OVERSCAN.FIT (%s) in recipe %s is not one of NONE, POLYNOMIAL, or SPLINE", fit, RECIPE_NAME);
    134             exit(EXIT_FAILURE);
    135         }
    136 
    137         // What method do we use to measure the overscan statistics?
    138         psStats *overscanStats = NULL;  // Statistics for overscan
     135            exit(EXIT_FAILURE);
     136        }
     137
     138        // What method do we use to measure the overscan statistics?
     139        psStats *overscanStats = NULL;  // Statistics for overscan
    139140        psString stat = psMetadataLookupStr(NULL, recipe, "OVERSCAN.STAT");
    140141        if (! strcasecmp(stat, "MEAN")) {
     
    144145        } else {
    145146            psErrorStackPrint(stderr, "OVERSCAN.STAT (%s) in recipe %s is not one of MEAN or MEDIAN", stat, RECIPE_NAME);
    146             exit(EXIT_FAILURE);
     147            exit(EXIT_FAILURE);
    147148        }
    148149
     
    156157    psMaskType maskValue = psMetadataLookupU8(&status, recipe, "MASK.VALUE");
    157158    if (status) {
    158         options->maskValue = maskValue;
     159        options->maskValue = maskValue;
    159160    }
    160161
     
    162163    options->doDark = psMetadataLookupBool(NULL, recipe, "DARK");
    163164    options->doFlat = psMetadataLookupBool(NULL, recipe, "FLAT");
     165    options->doShutter = psMetadataLookupBool(NULL, recipe, "SHUTTER");
    164166
    165167    // binned image options
    166     options->xBin1 = psMetadataLookupS32(&status, recipe, "BIN1.XBIN"); 
     168    options->xBin1 = psMetadataLookupS32(&status, recipe, "BIN1.XBIN");
    167169    if (!status) options->xBin1 = 16;
    168     options->yBin1 = psMetadataLookupS32(&status, recipe, "BIN1.YBIN"); 
     170    options->yBin1 = psMetadataLookupS32(&status, recipe, "BIN1.YBIN");
    169171    if (!status) options->yBin1 = 16;
    170172
    171     options->xBin2 = psMetadataLookupS32(&status, recipe, "BIN2.XBIN"); 
     173    options->xBin2 = psMetadataLookupS32(&status, recipe, "BIN2.XBIN");
    172174    if (!status) options->xBin1 = 16;
    173     options->yBin2 = psMetadataLookupS32(&status, recipe, "BIN2.YBIN"); 
     175    options->yBin2 = psMetadataLookupS32(&status, recipe, "BIN2.YBIN");
    174176    if (!status) options->yBin1 = 16;
    175177
     
    183185    options->Bin2FITS = psMetadataLookupBool(NULL, recipe, "BIN2.FITS");
    184186    options->Bin2JPEG = psMetadataLookupBool(NULL, recipe, "BIN2.JPEG");
    185    
     187
    186188    options->doPhotom = psMetadataLookupBool(NULL, recipe, "PHOTOM");
    187189    options->doAstromChip = psMetadataLookupBool(NULL, recipe, "ASTROM.CHIP");
    188190    options->doAstromMosaic = psMetadataLookupBool(NULL, recipe, "ASTROM.MOSAIC");
    189191    if ((options->doAstromChip || options->doAstromMosaic) && !options->doPhotom) {
    190         psLogMsg(__func__, PS_LOG_ERROR, "Invalid Phase2 Options: cannot do ASTROMetry without PHOTOMetry");
    191         exit(EXIT_FAILURE);
     192        psLogMsg(__func__, PS_LOG_ERROR, "Invalid Phase2 Options: cannot do ASTROMetry without PHOTOMetry");
     193        exit(EXIT_FAILURE);
    192194    }
    193195
    194196    options->doAddstar = psMetadataLookupBool(NULL, recipe, "ADDSTAR");
    195197    if (options->doAddstar && !(options->doAstromChip || options->doAstromMosaic)) {
    196         psLogMsg(__func__, PS_LOG_ERROR, "Invalid Phase2 Options: cannot Addstar without Astrometry");
    197         exit(EXIT_FAILURE);
     198        psLogMsg(__func__, PS_LOG_ERROR, "Invalid Phase2 Options: cannot Addstar without Astrometry");
     199        exit(EXIT_FAILURE);
    198200    }
    199201
  • trunk/ppImage/src/ppImageOptions.h

    r7771 r9342  
    99    bool doBias;                        // Bias subtraction
    1010    bool doDark;                        // Dark subtraction
     11    bool doShutter;                     // Shutter correction
    1112    bool doFlat;                        // Flat-field normalisation
    1213    bool doFringe;                      // Fringe subtraction
     
    1415    bool doAstromChip;                  // per-chip Astrometry
    1516    bool doAstromMosaic;                // full-mosaic Astrometry
    16     bool doAddstar;                     // add results to object database?
     17    bool doAddstar;                     // add results to object database?
    1718
    1819    bool doOverscan;                    // Overscan subtraction
  • trunk/ppImage/src/ppImageParseCamera.c

    r8934 r9342  
    4848        pmFPAfileDefineFromDetDB (&status, config, "PPIMAGE.MASK", input->fpa, PM_DETREND_TYPE_MASK);
    4949        if (!status) psAbort ("ppImageParseDetrend", "can't find a mask image source");
     50    }
     51    if (options->doShutter) {
     52        bool status = false;
     53        pmFPAfileDefineFromArgs  (&status, config, "PPIMAGE.SHUTTER", "SHUTTER");
     54        pmFPAfileDefineFromConf  (&status, config, "PPIMAGE.SHUTTER");
     55        pmFPAfileDefineFromDetDB (&status, config, "PPIMAGE.SHUTTER", input->fpa, PM_DETREND_TYPE_FLAT);
     56        if (!status) psAbort ("ppImageParseDetrend", "can't find a shutter image source");
    5057    }
    5158    if (options->doFlat) {
  • trunk/ppImage/src/ppImageParseDetrend.c

    r8751 r9342  
    66
    77// identify all needed detrend and other I/O files
    8 // create the pmFPAfiles for the active I/O files 
     8// create the pmFPAfiles for the active I/O files
    99
    1010bool ppImageParseDetrend(ppImageOptions *options, pmConfig *config)
     
    1616    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PPIMAGE.INPUT");
    1717
    18     // the following are defined from the argument list, if given, 
     18    // the following are defined from the argument list, if given,
    1919    // otherwise they revert to the config information
    2020
    2121    if (options->doBias) {
    22         bool status = false;
    23         pmFPAfileFromArgs (&status, config, "PPIMAGE.BIAS", "BIAS");
    24         pmFPAfileFromConf (&status, config, "PPIMAGE.BIAS", input->fpa);
    25         if (!status) psAbort ("ppImageParseDetrend", "can't find a bias image source");
     22        bool status = false;
     23        pmFPAfileFromArgs (&status, config, "PPIMAGE.BIAS", "BIAS");
     24        pmFPAfileFromConf (&status, config, "PPIMAGE.BIAS", input->fpa);
     25        if (!status) psAbort ("ppImageParseDetrend", "can't find a bias image source");
    2626    }
    2727
    2828    if (options->doDark) {
    29         bool status = false;
    30         pmFPAfileFromArgs (&status, config, "PPIMAGE.DARK", "DARK");
    31         pmFPAfileFromConf (&status, config, "PPIMAGE.DARK", input->fpa);
    32         if (!status) psAbort ("ppImageParseDetrend", "can't find a dark image source");
     29        bool status = false;
     30        pmFPAfileFromArgs (&status, config, "PPIMAGE.DARK", "DARK");
     31        pmFPAfileFromConf (&status, config, "PPIMAGE.DARK", input->fpa);
     32        if (!status) psAbort ("ppImageParseDetrend", "can't find a dark image source");
    3333    }
    3434
    3535    if (options->doMask) {
    36         bool status = false;
    37         pmFPAfileFromArgs (&status, config, "PPIMAGE.MASK", "MASK");
    38         pmFPAfileFromConf (&status, config, "PPIMAGE.MASK", input->fpa);
    39         if (!status) psAbort ("ppImageParseDetrend", "can't find a mask image source");
     36        bool status = false;
     37        pmFPAfileFromArgs (&status, config, "PPIMAGE.MASK", "MASK");
     38        pmFPAfileFromConf (&status, config, "PPIMAGE.MASK", input->fpa);
     39        if (!status) psAbort ("ppImageParseDetrend", "can't find a mask image source");
     40    }
     41
     42    if (options->doShutter) {
     43        bool status = false;
     44        pmFPAfileFromArgs (&status, config, "PPIMAGE.SHUTTER", "SHUTTER");
     45        pmFPAfileFromConf (&status, config, "PPIMAGE.SHUTTER", input->fpa);
     46        if (!status) psAbort ("ppImageParseDetrend", "can't find a shutter image source");
    4047    }
    4148
    4249    if (options->doFlat) {
    43         bool status = false;
    44         pmFPAfileFromArgs (&status, config, "PPIMAGE.FLAT", "FLAT");
    45         pmFPAfileFromConf (&status, config, "PPIMAGE.FLAT", input->fpa);
    46         if (!status) psAbort ("ppImageParseDetrend", "can't find a flat image source");
     50        bool status = false;
     51        pmFPAfileFromArgs (&status, config, "PPIMAGE.FLAT", "FLAT");
     52        pmFPAfileFromConf (&status, config, "PPIMAGE.FLAT", input->fpa);
     53        if (!status) psAbort ("ppImageParseDetrend", "can't find a flat image source");
    4754    }
    4855
     
    5360    // XXX do these need to construct a new fpa?
    5461    if (options->doBin1) {
    55         pmFPAfile *file = pmFPAfileFromFPA (config, input->fpa, options->xBin1, options->yBin1, "PPIMAGE.BIN1");
    56         pmFPAfileDefine (config->files, config->camera, file->fpa, "PPIMAGE.JPEG1");
     62        pmFPAfile *file = pmFPAfileFromFPA (config, input->fpa, options->xBin1, options->yBin1, "PPIMAGE.BIN1");
     63        pmFPAfileDefine (config->files, config->camera, file->fpa, "PPIMAGE.JPEG1");
    5764    }
    5865    if (options->doBin2) {
    59         pmFPAfile *file = pmFPAfileFromFPA (config, input->fpa, options->xBin2, options->yBin2, "PPIMAGE.BIN2");
    60         pmFPAfileDefine (config->files, config->camera, file->fpa, "PPIMAGE.JPEG2");
     66        pmFPAfile *file = pmFPAfileFromFPA (config, input->fpa, options->xBin2, options->yBin2, "PPIMAGE.BIN2");
     67        pmFPAfileDefine (config->files, config->camera, file->fpa, "PPIMAGE.JPEG2");
    6168    }
    6269
Note: See TracChangeset for help on using the changeset viewer.