IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 5, 2009, 4:31:25 PM (17 years ago)
Author:
Paul Price
Message:

Merging pap_branch_20090128. Resolved a small number of conflicts. Compiles, but not tested in detail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmHDUGenerate.c

    r18227 r21363  
    274274        pmReadout *readout = cell->readouts->data[0]; // The first readout, as representative
    275275        // The proper image, used to get the size
    276         psImage *image = readout->image ? readout->image : (readout->mask ? readout->mask : readout->weight);
     276        psImage *image = readout->image ? readout->image : (readout->mask ? readout->mask : readout->variance);
    277277        if (!image) {
    278278            continue;
     
    283283                     image->numCols, image->numRows, readout->mask->numCols, readout->mask->numRows);
    284284        }
    285         if (readout->weight &&
    286                 (readout->weight->numCols != image->numCols || readout->weight->numRows != image->numRows)) {
    287             psWarning("Image and weight have different sizes (%dx%d vs %dx%d)!\n",
    288                      image->numCols, image->numRows, readout->weight->numCols, readout->weight->numRows);
     285        if (readout->variance &&
     286                (readout->variance->numCols != image->numCols || readout->variance->numRows != image->numRows)) {
     287            psWarning("Image and variance have different sizes (%dx%d vs %dx%d)!\n",
     288                     image->numCols, image->numRows, readout->variance->numCols, readout->variance->numRows);
    289289        }
    290290        // New reference
     
    355355    psElemType imageType = 0;           // Type of readout images
    356356    psElemType maskType = 0;            // Type of readout masks
    357     psElemType weightType = 0;          // Type of readout weights
     357    psElemType varianceType = 0;        // Type of readout variances
    358358    {
    359359        psListIterator *iter = psListIteratorAlloc(cells, PS_LIST_HEAD, false); // Iterator for cells
     
    381381                    maskType = checkTypes(maskType, readout->mask->type.type);
    382382                }
    383                 if (!hdu->weights && readout->weight) {
    384                     weightType = checkTypes(weightType, readout->weight->type.type);
     383                if (!hdu->variances && readout->variance) {
     384                    varianceType = checkTypes(varianceType, readout->variance->type.type);
    385385                }
    386386            }
     
    388388        psFree(iter);
    389389    }
    390     if (numReadouts == 0 || (imageType == 0 && maskType == 0 && weightType == 0)) {
     390    if (numReadouts == 0 || (imageType == 0 && maskType == 0 && varianceType == 0)) {
    391391        // Nothing from which to create an HDU
    392392        psFree(cells);
     
    421421        }
    422422    }
    423     if (weightType) {
    424         hdu->weights = psArrayAlloc(numReadouts);
     423    if (varianceType) {
     424        hdu->variances = psArrayAlloc(numReadouts);
    425425        for (int i = 0; i < numReadouts; i++) {
    426             psImage *weight = psImageAlloc(xSize, ySize, weightType);
    427             psImageInit(weight, 0.0);
    428             hdu->weights->data[i] = weight;
     426            psImage *variance = psImageAlloc(xSize, ySize, varianceType);
     427            psImageInit(variance, 0.0);
     428            hdu->variances->data[i] = variance;
    429429        }
    430430    }
     
    448448
    449449            psArray *readouts = cell->readouts; // Array of readouts
     450
    450451            psArray *hduImages = hdu->images; // Array of images in the HDU
    451452            psArray *hduMasks = hdu->masks; // Array of masks in the HDU
    452             psArray *hduWeights = hdu->weights; // Array of weights in the HDU
     453            psArray *hduVariances = hdu->variances; // Array of variances in the HDU
    453454            for (int i = 0; i < readouts->n; i++) {
    454455                pmReadout *readout = readouts->data[i]; // The readout of interest
     
    467468                    readout->mask = new;
    468469                }
    469                 if (readout->weight) {
    470                     psImage *new = pasteImage(hduWeights->data[i], readout->weight, trimsec);
    471                     psFree(readout->weight);
    472                     readout->weight = new;
     470                if (readout->variance) {
     471                    psImage *new = pasteImage(hduVariances->data[i], readout->variance, trimsec);
     472                    psFree(readout->variance);
     473                    readout->variance = new;
    473474                }
    474475
     
    504505
    505506// Return the level that an extension applies to
    506 static pmFPALevel extensionLevel(pmHDU *hdu // HDU to check
     507static pmFPALevel extensionLevel(const pmHDU *hdu // HDU to check
    507508                                )
    508509{
     
    512513    }
    513514    bool mdok = true;                   // Status of MD lookup
    514     psMetadata *file = psMetadataLookupMetadata(&mdok, hdu->format, "FILE"); // File information for camera format
     515    psMetadata *file = psMetadataLookupMetadata(&mdok, hdu->format, "FILE"); // File info for camera format
    515516    if (!mdok || !file) {
    516517        psError(PS_ERR_UNEXPECTED_NULL, true, "Can't file FILE information for camera format "
     
    581582        return false;
    582583    }
    583     if (hdu->images && hdu->masks && hdu->weights) {
     584    if (hdu->images && hdu->masks && hdu->variances) {
    584585        // It's already here!
    585586        return true;
     
    631632        return generateForCells(chip);
    632633    }
    633     if (hdu->images && hdu->masks && hdu->weights) {
     634    if (hdu->images && hdu->masks && hdu->variances) {
    634635        // It's already here!
    635636        return true;
     
    680681        return generateForChips(fpa);
    681682    }
    682     if (hdu->images && hdu->masks && hdu->weights) {
     683    if (hdu->images && hdu->masks && hdu->variances) {
    683684        // It's already here!
    684685        return true;
Note: See TracChangeset for help on using the changeset viewer.