IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42556 for trunk/ppStack


Ignore:
Timestamp:
Dec 3, 2023, 2:53:06 PM (3 years ago)
Author:
eugene
Message:

do not crash if readout->covariance is not defined

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackConvolve.c

    r35455 r42556  
    203203        }
    204204        psFree(maskHeader);
    205         if (!ppStackWriteVariance(options->convVariances->data[i], hdu->header, readout->variance, readout->covariance->image, config)) {
     205        psImage *covarImage = readout->covariance ? readout->covariance->image : NULL;
     206        if (!ppStackWriteVariance(options->convVariances->data[i], hdu->header, readout->variance, covarImage, config)) {
    206207            psError(PPSTACK_ERR_IO, false, "Unable to write convolved variance %d", i);
    207208            psFree(fpaList);
     
    216217        {
    217218            psString name = NULL;
    218             psStringAppend(&name, "covariance_%d.fits", i);
    219             ppStackWriteImage(name, hdu->header, readout->covariance->image, config);
    220             pmStackVisualPlotTestImage(readout->covariance->image, name);
    221             psFree(name);
     219            if (readout->covariance) {
     220              psStringAppend(&name, "covariance_%d.fits", i);
     221              ppStackWriteImage(name, hdu->header, readout->covariance->image, config);
     222              pmStackVisualPlotTestImage(readout->covariance->image, name);
     223              psFree(name);
     224            }
    222225        }
    223226        {
Note: See TracChangeset for help on using the changeset viewer.