IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19086


Ignore:
Timestamp:
Aug 16, 2008, 12:35:47 PM (18 years ago)
Author:
eugene
Message:

test for valid image on each readout

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmReadoutCombine.c

    r18861 r19086  
    6363                "ROBUST_MEDIAN, FITTED_MEAN or CLIPPED_MEAN.\n");
    6464        return false;
    65     }
    66 
    67     // weights exist if weights desired?
    68     for (int i = 0; i < inputs->n; i++) {
    69         pmReadout *readout = inputs->data[i]; // Readout of interest
    70         if (params->weights && !readout->weight) {
    71             psError(PS_ERR_UNEXPECTED_NULL, true,
    72                     "Rejection based on weights requested, but no weights supplied for image %d.\n", i);
    73             return false;
    74         }
    7565    }
    7666
     
    179169    PS_ASSERT_FLOAT_WITHIN_RANGE(params->fracLow, 0.0, 1.0, false);
    180170    PS_ASSERT_FLOAT_WITHIN_RANGE(params->fracHigh, 0.0, 1.0, false);
     171
     172    // does required/desired data exist?
     173    for (int i = 0; i < inputs->n; i++) {
     174        pmReadout *readout = inputs->data[i]; // Readout of interest
     175        if (!readout->image) {
     176            psError(PS_ERR_UNEXPECTED_NULL, true, "Image data is missing for image %d.\n", i);
     177            return false;
     178        }
     179        if (params->weights && !readout->weight) {
     180            psError(PS_ERR_UNEXPECTED_NULL, true,
     181                    "Rejection based on weights requested, but no weights supplied for image %d.\n", i);
     182            return false;
     183        }
     184    }
    181185
    182186    pmHDU *hdu = pmHDUFromReadout(output); // Output HDU
Note: See TracChangeset for help on using the changeset viewer.