IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40354


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.

Location:
trunk/pswarp/src
Files:
3 edited

Legend:

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

    r40344 r40354  
    124124
    125125                        // Determine the reference catalog used
    126                         if (!refcat) {
    127                           refcat = psMetadataLookupStr(NULL, astromRO->parent->parent->hdu->header, "PSREFCAT");
    128                           psMetadataAddStr(output->fpa->analysis, PS_LIST_TAIL, "REFERENCE_CATALOG", PS_META_REPLACE, "Reference catalog used for calibration.", refcat);
     126                        if ((!refcat)&&(astromRO)) {
     127                          if ((astromRO->parent->parent->hdu->header)&&(output->fpa->analysis)) {
     128                            psMetadataItem *refItem = psMetadataLookup(astromRO->parent->parent->hdu->header, "PSREFCAT");
     129                            if (refItem) {
     130                              refcat = psMetadataLookupStr(NULL, astromRO->parent->parent->hdu->header, "PSREFCAT");
     131                              psMetadataAddStr(output->fpa->analysis, PS_LIST_TAIL, "REFERENCE_CATALOG", PS_META_REPLACE,
     132                                               "Reference catalog used for calibration.", refcat);
     133                            }
     134                          }
    129135                        }
    130 
    131136                       
    132137                    }
  • trunk/pswarp/src/pswarpLoopBackground.c

    r40345 r40354  
    137137                    if (astrom != input) {
    138138                      pmReadout *astromRO = pmFPAviewThisReadout(view, astrom->fpa); // Readout for astrometry
    139                       if (!refcat) {
    140                         refcat = psMetadataLookupStr(NULL, astromRO->parent->parent->hdu->header, "PSREFCAT");
    141 
    142                         psMetadataAddStr(output->fpa->analysis, PS_LIST_TAIL, "REFERENCE_CATALOG", PS_META_REPLACE, "Reference catalog used for calibration.", refcat);
     139                      if ((!refcat)&&(astromRO)) {
     140                        if ((astromRO->parent->parent->hdu->header)&&(output->fpa->analysis)) {
     141                          psMetadataItem *refItem = psMetadataLookup(astromRO->parent->parent->hdu->header, "PSREFCAT");
     142                          if (refItem) {
     143                            refcat = psMetadataLookupStr(NULL, astromRO->parent->parent->hdu->header, "PSREFCAT");
     144                            psMetadataAddStr(output->fpa->analysis, PS_LIST_TAIL, "REFERENCE_CATALOG", PS_META_REPLACE,
     145                                             "Reference catalog used for calibration.", refcat);
     146                          }
     147                        }
    143148                      }
    144149                    }
  • 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.