IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 27, 2018, 3:31:55 PM (8 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/czw_branch/20170908
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20170908

  • branches/czw_branch/20170908/pswarp/src/pswarpLoop.c

    r36835 r40483  
    5858    }
    5959
     60    psString refcat = NULL;
    6061    // loop over this section once per input group
    6162    for (int i = 0; i < nInputs; i++) {
     
    121122                            psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY, "Sources from input astrometry", detections);
    122123                        }
     124
     125                        // Determine the reference catalog used
     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                          }
     135                        }
     136                       
    123137                    }
    124138
  • branches/czw_branch/20170908/pswarp/src/pswarpLoopBackground.c

    r35683 r40483  
    6262    pmFPAfileActivate(config->files, true, "PSWARP.BKGMODEL");
    6363
     64    psString refcat = NULL;
    6465    // loop over this section once per input group
    6566    for (int i = 0; i < nInputs; i++) {
     
    134135                    }
    135136
     137                    if (astrom != input) {
     138                      pmReadout *astromRO = pmFPAviewThisReadout(view, astrom->fpa); // Readout for astrometry
     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                        }
     148                      }
     149                    }
     150                   
    136151                    // re-normalize the BKGMODEL pixels by modified astrometry
    137152                    for (int x = 0; x < readout->image->numCols; x++) {
  • branches/czw_branch/20170908/pswarp/src/pswarpUpdateMetadata.c

    r36835 r40483  
    2020    bool bilevelAstrometry = psMetadataLookupBool (NULL, skycell->analysis, "ASTROMETRY.BILEVEL");
    2121
     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    }
    2230    pmChip *chip;
    2331    while ((chip = pmFPAviewNextChip (view, output, 1)) != NULL) {
     
    165173    }
    166174
     175    if (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      }
     180    }
     181   
    167182    // apply the bilevel astrometry elements to the target
    168183    if (bilevelAstrometry) {
Note: See TracChangeset for help on using the changeset viewer.