IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16844


Ignore:
Timestamp:
Mar 6, 2008, 10:51:20 AM (18 years ago)
Author:
Paul Price
Message:

Adding support for multi-darks, instead of traditional darks.

Location:
trunk/ppImage/src
Files:
3 edited

Legend:

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

    r14000 r16844  
    1010    fprintf(stderr, "\t-stats STATS.mdc: Output statistics into STATS.mdc\n");
    1111    fprintf(stderr, "\t-isfringe: The input image contains fringe data.\n");
     12    fprintf(stderr, "\t-isdark: The input image contains dark data.\n");
    1213    fprintf(stderr, "\t-usemask MASKVAL: Use this mask value (override recipe).\n");
    1314    fprintf(stderr, "\t-chip CHIPNUM: Only process this chip number.\n");
     
    7172                          "Input is fringe image", true);
    7273    }
     74    if ((argnum = psArgumentGet(argc, argv, "-isdark"))) {
     75        psArgumentRemove(argnum, &argc, argv);
     76        psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INPUT_IS_DARK", PS_META_REPLACE,
     77                          "Input is dark image", true);
     78    }
    7379
    7480    // the following options override the PPIMAGE recipe options
  • trunk/ppImage/src/ppImageDetrendReadout.c

    r16084 r16844  
    3232# endif
    3333
    34     // set up the readouts for dark and bias
    35     pmReadout *dark = NULL;
     34    // set up the dark and bias
     35    pmCell *dark = NULL;
    3636    pmReadout  *bias = NULL;
    3737    if (options->doBias) {
     
    3939    }
    4040    if (options->doDark) {
    41         dark = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.DARK");
     41        dark = pmFPAfileThisCell(config->files, detview, "PPIMAGE.DARK");
    4242    }
    4343
    4444    // Bias, dark and overscan subtraction are all merged.
    45     if (options->doBias || options->doDark || options->doOverscan) {
    46         if (!pmBiasSubtract(input, options->overscan, bias, dark, view)) {
    47             psError(PS_ERR_UNKNOWN, false, "Unable to subtract bias.\n");
     45    if (options->doBias || options->doOverscan) {
     46        if (!pmBiasSubtract(input, options->overscan, bias, NULL, view)) {
     47            psError(PS_ERR_UNKNOWN, false, "Unable to subtract bias.");
    4848            return false;
    4949        }
     
    5454        // create the target mask and weight images
    5555        pmReadoutGenerateWeight(input, true);
     56    }
     57
     58    if (options->doDark) {
     59        if (!pmDarkApply(input, dark, options->maskValue)) {
     60            psError(PS_ERR_UNKNOWN, false, "Unable to subtract dark.");
     61            return false;
     62        }
    5663    }
    5764
  • trunk/ppImage/src/ppImageParseCamera.c

    r16357 r16844  
    5959    }
    6060    if (options->doDark) {
    61         if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.DARK", "DARK", PM_FPA_FILE_IMAGE, PM_DETREND_TYPE_DARK)) {
     61        if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.DARK", "DARK", PM_FPA_FILE_DARK, PM_DETREND_TYPE_DARK)) {
    6262            psError (PS_ERR_IO, false, "Can't find a dark image source");
    6363            psFree (options);
     
    393393        outImage->type = PM_FPA_FILE_FRINGE;
    394394    }
     395    if (psMetadataLookupBool(NULL, config->arguments, "INPUT_IS_DARK")) {
     396        // It's a dark file, so change the file type
     397        input->type = PM_FPA_FILE_DARK;
     398        outImage->type = PM_FPA_FILE_DARK;
     399    }
    395400
    396401    // Turn off mask and weight output if we're not doing anything interesting
Note: See TracChangeset for help on using the changeset viewer.