IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 28, 2009, 2:33:51 PM (17 years ago)
Author:
Paul Price
Message:

Changing pmReadout.weight to variance. Adding pmReadout.covariance which will carry around a covariance pseudo-matrix, allowing us to calculate the pixel-to-pixel variance. pmReadout.covariance now exists and is set, but no mechanism yet to read/write, or use it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_20090128/psModules/src/camera/pmFPARead.c

    r21183 r21211  
    2828    FPA_READ_TYPE_IMAGE,                // Read image
    2929    FPA_READ_TYPE_MASK,                 // Read mask
    30     FPA_READ_TYPE_WEIGHT,               // Read weight map
     30    FPA_READ_TYPE_VARIANCE,               // Read variance map
    3131    FPA_READ_TYPE_HEADER                // Read header
    3232} fpaReadType;
     
    5454      case FPA_READ_TYPE_MASK:
    5555        return readout->thisMaskScan;
    56       case FPA_READ_TYPE_WEIGHT:
    57         return readout->thisWeightScan;
     56      case FPA_READ_TYPE_VARIANCE:
     57        return readout->thisVarianceScan;
    5858      default:
    5959        psAbort("Unknown read type: %x\n", type);
     
    7474        readout->thisMaskScan = thisScan;
    7575        return readout->lastMaskScan;
    76       case FPA_READ_TYPE_WEIGHT:
    77         readout->thisWeightScan = thisScan;
    78         return readout->lastWeightScan;
     76      case FPA_READ_TYPE_VARIANCE:
     77        readout->thisVarianceScan = thisScan;
     78        return readout->lastVarianceScan;
    7979      default:
    8080        psAbort("Unknown read type: %x\n", type);
     
    9393      case FPA_READ_TYPE_MASK:
    9494        return readout->lastMaskScan;
    95       case FPA_READ_TYPE_WEIGHT:
    96         return readout->lastWeightScan;
     95      case FPA_READ_TYPE_VARIANCE:
     96        return readout->lastVarianceScan;
    9797      default:
    9898        psAbort("Unknown read type: %x\n", type);
     
    113113        readout->lastMaskScan = lastScan;
    114114        return readout->lastMaskScan;
    115       case FPA_READ_TYPE_WEIGHT:
    116         readout->lastWeightScan = lastScan;
    117         return readout->lastWeightScan;
     115      case FPA_READ_TYPE_VARIANCE:
     116        readout->lastVarianceScan = lastScan;
     117        return readout->lastVarianceScan;
    118118      default:
    119119        psAbort("Unknown read type: %x\n", type);
     
    132132      case FPA_READ_TYPE_MASK:
    133133        return &readout->mask;
    134       case FPA_READ_TYPE_WEIGHT:
    135         return &readout->weight;
     134      case FPA_READ_TYPE_VARIANCE:
     135        return &readout->variance;
    136136      default:
    137137        psAbort("Unknown read type: %x\n", type);
     
    350350    *target = psImageSubset(image, region);
    351351
    352     // Get the list of overscans: only for IMAGE types (no overscan for MASK and WEIGHT)
     352    // Get the list of overscans: only for IMAGE types (no overscan for MASK and VARIANCE)
    353353    if (type == FPA_READ_TYPE_IMAGE) {
    354354        if (readout->bias->n != 0) {
     
    582582    *image = readoutReadComponent(*image, fits, trimsec, readdir, thisScan, lastScan, z, bad, pixelTypes[type]);
    583583
    584     // Read overscans only for "image" type --- weights and masks shouldn't record overscans
     584    // Read overscans only for "image" type --- variances and masks shouldn't record overscans
    585585    if (type == FPA_READ_TYPE_IMAGE) {
    586586        // Blow away existing data
     
    608608}
    609609
    610 // Read into an cell; this is the engine for pmCellRead, pmCellReadMask, pmCellReadWeight
     610// Read into an cell; this is the engine for pmCellRead, pmCellReadMask, pmCellReadVariance
    611611// Does most of the work for the reading --- reads the HDU, and portions the HDU into readouts.
    612612static bool cellRead(pmCell *cell,      // Cell into which to read
     
    640640        dataPointer = hdu->masks;
    641641        break;
    642       case FPA_READ_TYPE_WEIGHT:
    643         hduReadFunc = pmHDUReadWeight;
    644         dataPointer = hdu->weights;
     642      case FPA_READ_TYPE_VARIANCE:
     643        hduReadFunc = pmHDUReadVariance;
     644        dataPointer = hdu->variances;
    645645        break;
    646646      default:
     
    680680        imageArray = hdu->masks;
    681681        break;
    682       case FPA_READ_TYPE_WEIGHT:
    683         imageArray = hdu->weights;
     682      case FPA_READ_TYPE_VARIANCE:
     683        imageArray = hdu->variances;
    684684        break;
    685685      default:
     
    729729
    730730
    731 // Read into an chip; this is the engine for pmChipRead, pmChipReadMask, pmChipReadWeight
     731// Read into an chip; this is the engine for pmChipRead, pmChipReadMask, pmChipReadVariance
    732732// Iterates over component cells, reading each
    733733static bool chipRead(pmChip *chip,      // Chip into which to read
     
    760760
    761761
    762 // Read into an FPA; this is the engine for pmFPARead, pmFPAReadMask, pmFPAReadWeight
     762// Read into an FPA; this is the engine for pmFPARead, pmFPAReadMask, pmFPAReadVariance
    763763// Iterates over component chips, reading each
    764764static bool fpaRead(pmFPA *fpa,         // FPA into which to read
     
    10911091
    10921092//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    1093 // Reading the weight map
    1094 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
    1095 
    1096 bool pmReadoutMoreWeight(pmReadout *readout, psFits *fits, int z, int numScans, pmConfig *config)
     1093// Reading the variance map
     1094//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     1095
     1096bool pmReadoutMoreVariance(pmReadout *readout, psFits *fits, int z, int numScans, pmConfig *config)
    10971097{
    10981098    PS_ASSERT_PTR_NON_NULL(readout, false);
    10991099    PS_ASSERT_FITS_NON_NULL(fits, false);
    11001100
    1101     return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_WEIGHT, config);
    1102 }
    1103 
    1104 bool pmReadoutReadChunkWeight(pmReadout *readout, psFits *fits, int z, int numScans, int overlap,
     1101    return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_VARIANCE, config);
     1102}
     1103
     1104bool pmReadoutReadChunkVariance(pmReadout *readout, psFits *fits, int z, int numScans, int overlap,
    11051105                              pmConfig *config)
    11061106{
     
    11101110    PS_ASSERT_INT_NONNEGATIVE(numScans, false);
    11111111
    1112     return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_WEIGHT, config);
    1113 }
    1114 
    1115 bool pmReadoutReadWeight(pmReadout *readout, psFits *fits, int z, pmConfig *config)
     1112    return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_VARIANCE, config);
     1113}
     1114
     1115bool pmReadoutReadVariance(pmReadout *readout, psFits *fits, int z, pmConfig *config)
    11161116{
    11171117    PS_ASSERT_PTR_NON_NULL(readout, false);
    11181118    PS_ASSERT_FITS_NON_NULL(fits, false);
    11191119
    1120     return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_WEIGHT, config);
    1121 }
    1122 
    1123 bool pmCellReadWeight(pmCell *cell, psFits *fits, pmConfig *config)
     1120    return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_VARIANCE, config);
     1121}
     1122
     1123bool pmCellReadVariance(pmCell *cell, psFits *fits, pmConfig *config)
    11241124{
    11251125    PS_ASSERT_PTR_NON_NULL(cell, false);
    11261126    PS_ASSERT_FITS_NON_NULL(fits, false);
    11271127
    1128     return cellRead(cell, fits, config, FPA_READ_TYPE_WEIGHT);
    1129 }
    1130 
    1131 bool pmChipReadWeight(pmChip *chip, psFits *fits, pmConfig *config)
     1128    return cellRead(cell, fits, config, FPA_READ_TYPE_VARIANCE);
     1129}
     1130
     1131bool pmChipReadVariance(pmChip *chip, psFits *fits, pmConfig *config)
    11321132{
    11331133    PS_ASSERT_PTR_NON_NULL(chip, false);
    11341134    PS_ASSERT_FITS_NON_NULL(fits, false);
    11351135
    1136     return chipRead(chip, fits, config, FPA_READ_TYPE_WEIGHT);
    1137 }
    1138 
    1139 bool pmFPAReadWeight(pmFPA *fpa, psFits *fits, pmConfig *config)
     1136    return chipRead(chip, fits, config, FPA_READ_TYPE_VARIANCE);
     1137}
     1138
     1139bool pmFPAReadVariance(pmFPA *fpa, psFits *fits, pmConfig *config)
    11401140{
    11411141    PS_ASSERT_PTR_NON_NULL(fpa, false);
    11421142    PS_ASSERT_FITS_NON_NULL(fits, false);
    11431143
    1144     return fpaRead(fpa, fits, config, FPA_READ_TYPE_WEIGHT);
     1144    return fpaRead(fpa, fits, config, FPA_READ_TYPE_VARIANCE);
    11451145}
    11461146
Note: See TracChangeset for help on using the changeset viewer.