IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 2, 2009, 8:05:38 AM (17 years ago)
Author:
Paul Price
Message:

Adding work on integrating covariances into the read/write system. Not sure I like this framework (putting covariances for an HDU into a common table); might rework to write a covariance image for each cell. I think I started doing that and ran into problems, but I can't remember what they were and how they stopped me.

File:
1 edited

Legend:

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

    r21211 r21264  
    1212#include "pmHDU.h"
    1313#include "pmFPA.h"
     14
     15#define COVARIANCE_INDICATOR "PS_COVAR" // FITS keyword to indicate if covariance matrices are present
    1416
    1517//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    160162    PS_ASSERT_PTR_NON_NULL(fits, false);
    161163
    162     return hduRead(hdu, &hdu->variances, fits);
     164    if (!hduRead(hdu, &hdu->variances, fits)) {
     165        return false;
     166    }
     167
     168    return true;
    163169}
    164170
     
    240246    PS_ASSERT_PTR_NON_NULL(fits, false);
    241247
     248    pmHDUCovariancesWriteHeader(hdu);
     249
    242250    psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask
    243     return hduWrite(hdu, hdu->variances, hdu->masks, maskVal, fits);
    244 }
     251    if (!hduWrite(hdu, hdu->variances, hdu->masks, maskVal, fits)) {
     252        return false;
     253    }
     254    pmHDUCovarianceClearHeader(hdu);
     255
     256    if (!pmHDUCovarianceWrite(hdu, fits)) {
     257        psError(PS_ERR_UNKNOWN, false, "Unable to write covariance");
     258        return false;
     259    }
     260
     261    return true;
     262}
Note: See TracChangeset for help on using the changeset viewer.