IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 7, 2008, 9:31:00 AM (18 years ago)
Author:
Paul Price
Message:

Allowing use of old-style darks if OLDDARK(BOOL) is TRUE in the recipe.

File:
1 edited

Legend:

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

    r16844 r16870  
    3333
    3434    // set up the dark and bias
    35     pmCell *dark = NULL;
     35    pmCell *dark = NULL;                // Multi-dark
     36    pmReadout *oldDark = NULL;          // Old-fashioned dark
    3637    pmReadout  *bias = NULL;
    3738    if (options->doBias) {
     
    3940    }
    4041    if (options->doDark) {
    41         dark = pmFPAfileThisCell(config->files, detview, "PPIMAGE.DARK");
     42        bool mdok;                      // Status of MD lookup
     43        psMetadata *recipe = psMetadataLookupPtr (&mdok, config->recipes, RECIPE_NAME);
     44        assert(mdok && recipe);
     45        if (psMetadataLookupBool(&mdok, recipe, "OLDDARK")) {
     46            oldDark = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.DARK");
     47        } else {
     48            dark = pmFPAfileThisCell(config->files, detview, "PPIMAGE.DARK");
     49        }
    4250    }
    4351
    4452    // Bias, dark and overscan subtraction are all merged.
    4553    if (options->doBias || options->doOverscan) {
    46         if (!pmBiasSubtract(input, options->overscan, bias, NULL, view)) {
     54        if (!pmBiasSubtract(input, options->overscan, bias, oldDark, view)) {
    4755            psError(PS_ERR_UNKNOWN, false, "Unable to subtract bias.");
    4856            return false;
     
    5664    }
    5765
    58     if (options->doDark) {
     66    if (options->doDark && dark) {
    5967        if (!pmDarkApply(input, dark, options->maskValue)) {
    6068            psError(PS_ERR_UNKNOWN, false, "Unable to subtract dark.");
Note: See TracChangeset for help on using the changeset viewer.