IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42129 for trunk/psModules


Ignore:
Timestamp:
Mar 19, 2022, 8:44:17 AM (4 years ago)
Author:
eugene
Message:

add some explicit error messages in PSF I/O for failures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmPSF_IO.c

    r40553 r42129  
    903903    // load the PSF model parameters from the FITS table
    904904    char *modelName = psMetadataLookupStr (&status, header, "PSF_NAME");
     905    if (!modelName) {
     906        psError(PS_ERR_UNKNOWN, true, "missing model name in psf file %s", file->filename);
     907        return false;
     908    }
     909
    905910    options->type = pmModelClassGetType (modelName);
    906911    if (options->type == -1) {
     
    939944    // check the number of expected parameters
    940945    int nPar = psMetadataLookupS32 (&status, header, "PSF_NPAR");
     946    if (!status) {
     947        psError(PS_ERR_UNKNOWN, true, "PSF file %s missing PSF_NPAR value", file->filename);
     948        return false;
     949    }
     950
    941951    if (nPar != pmModelClassParameterCount (psf->type))
    942952        psAbort("mismatch model par count");
     
    10511061
    10521062        int xBin  = psMetadataLookupS32 (&status, header, "XBIN");
     1063        if (!status) {
     1064            psError(psErrorCodeLast(), false, "XBIN not set in PSF residual image header.");
     1065            return false;
     1066        }
    10531067        int yBin  = psMetadataLookupS32 (&status, header, "YBIN");
     1068        if (!status) {
     1069            psError(psErrorCodeLast(), false, "YBIN not set in PSF residual image header.");
     1070            return false;
     1071        }
    10541072
    10551073        int xSize = Nx / xBin;
Note: See TracChangeset for help on using the changeset viewer.