IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 25, 2010, 9:45:07 PM (15 years ago)
Author:
watersc1
Message:

Merge of czw_branch/20100817 into trunk. This includes the non-linearity correction application code.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ppImage/src/ppImageDetrendNonLinear.c

    r11702 r29833  
    4444}
    4545
    46 bool ppImageDetrendNonLinear(pmReadout *input, ppImageOptions *options) {
     46
     47bool ppImageDetrendNonLinear(pmReadout *input, pmFPAview *detview, pmConfig  *config) {
     48    bool status;
     49
     50    pmFPAfile *linearity_file = psMetadataLookupPtr(&status,config->files,"PPIMAGE.LINEARITY");
     51    psFits *linearity_fits = linearity_file->fits;
     52
     53    char *extname = psMetadataLookupStr(&status,input->parent->concepts,"CELL.NAME");
     54    if (!extname) {
     55        psError(PS_ERR_IO, false, "missing CELL.NAME in concepts");
     56        return(false);
     57    }
     58
     59    if (!psFitsMoveExtName(linearity_fits,extname)) {
     60        psError(PS_ERR_IO, false, "Unable to move to non-linearity table %s", extname);
     61        return(false);
     62    }
     63 
     64    psArray *table = psFitsReadTable(linearity_fits);
     65    if (!table) {
     66        psError(PS_ERR_IO, false, "Unable to read non-linearity table.\n");
     67        return(false);
     68    }
     69
     70    // It might be better to pack lookup table here...
     71    // Why? I only use that lookup table once for the single cell it matches.
     72 
     73    if (!pmNonLinearityApply(input,table)) {
     74        psError(PS_ERR_UNKNOWN, false, "Unable to apply non-linearity corrections.\n");
     75        psFree (table);
     76        return(false);
     77    }       
     78    psFree (table);
     79
     80    return true;
     81}
     82
     83bool ppImageDetrendNonLinear_Original(pmReadout *input, ppImageOptions *options) {
    4784
    4885    psMetadataItem *concept;
     
    5996
    6097      case PS_DATA_METADATA:
    61         // XXX EAM: this is somewhat confusing : let's wrap in a function when i understand it
    62 
    6398        // Go looking for the value in the hierarchy
    6499        concept = psMetadataLookup(cell->concepts, options->nonLinearSource);
Note: See TracChangeset for help on using the changeset viewer.