IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 5, 2018, 4:17:43 PM (8 years ago)
Author:
watersc1
Message:

Be more aggressive at checking parameters for the PSREFCAT field, as dependent code isn't run when quality != 0 and the warping process is being aborted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpUpdateMetadata.c

    r40344 r40354  
    2020    bool bilevelAstrometry = psMetadataLookupBool (NULL, skycell->analysis, "ASTROMETRY.BILEVEL");
    2121
    22     psString refcat = psMetadataLookupStr (NULL, output->analysis, "REFERENCE_CATALOG");
     22    psString refcat = NULL;
     23
     24    if ((output)&&(output->analysis)) {   
     25      psMetadataItem *refItem = psMetadataLookup(output->analysis, "REFERENCE_CATALOG");
     26      if (refItem) {
     27        refcat = psMetadataLookupStr (NULL, output->analysis, "REFERENCE_CATALOG");
     28      }
     29    }
    2330    pmChip *chip;
    2431    while ((chip = pmFPAviewNextChip (view, output, 1)) != NULL) {
     
    167174
    168175    if (refcat) {
    169       psMetadataAddStr(output->hdu->header, PS_LIST_TAIL, "PSREFCAT", PS_META_REPLACE, "Reference catalog used for calibration", refcat);
     176      if ((output)&&(output->hdu)&&(output->hdu->header)) {
     177        psMetadataAddStr(output->hdu->header, PS_LIST_TAIL, "PSREFCAT", PS_META_REPLACE,
     178                         "Reference catalog used for calibration", refcat);
     179      }
    170180    }
    171181   
Note: See TracChangeset for help on using the changeset viewer.