IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10331


Ignore:
Timestamp:
Nov 30, 2006, 3:09:15 PM (19 years ago)
Author:
Paul Price
Message:

Add processing data to header.

File:
1 edited

Legend:

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

    r10211 r10331  
    141141
    142142
    143 psImage *ppImageDetrendFringeGenerate(pmCell *science, pmCell *fringes)
     143bool ppImageDetrendFringeGenerate(pmCell *science, pmCell *fringes)
    144144{
    145145    PS_ASSERT_PTR_NON_NULL(science, false);
     
    159159        expTime = 1.0;
    160160    }
     161
     162    pmHDU *hdu = pmHDUFromCell(science);// HDU  of interest
    161163
    162164    // Construct the fringe image from the scale
     
    174176            psBinaryOp(sumFringe, sumFringe, "+", fringe);
    175177        }
     178
     179        psVector *md5 = psImageMD5(fringe); // md5 hash
     180        psString md5string = psMD5toString(md5); // String
     181        psFree(md5);
     182        psStringPrepend(&md5string, "Fringe image %d (scale %.3f) MD5: ",
     183                        i, solution->coeff->data.F32[i + 1]);
     184        psMetadataAddStr(hdu->header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK,
     185                         md5string, "");
     186        psFree(md5string);
    176187    }
    177188    if (expTime != 1.0) {
     
    179190    }
    180191
     192    // Apply the correction to all readouts
     193    psArray *readouts = science->readouts; // Array of science readouts
     194    for (int i = 0; i < readouts->n; i++) {
     195        pmReadout *readout = readouts->data[i]; // Readout of interest
     196        if (!readout || !readout->data_exists) {
     197            continue;
     198        }
     199
     200        // XXX: Make generic, so subregions may be subtracted as well
     201        if (!psBinaryOp(readout->image, readout->image, "-", sumFringe)) {
     202            psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to subtract fringe.\n");
     203            return false;
     204        }
     205    }
     206    psFree(sumFringe);
     207
    181208    return sumFringe;
    182209}
Note: See TracChangeset for help on using the changeset viewer.