IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25908


Ignore:
Timestamp:
Oct 21, 2009, 12:43:41 PM (17 years ago)
Author:
eugene
Message:

correctly handle cases of per-exposure vs per-chip zero point stats

Location:
trunk/Ohana/src/addstar/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/GetZeroPointExposure.c

    r24973 r25908  
    11# include "addstar.h"
    22
    3 // XXX this needs to handle the nominal zero point for the photcode(s) and the airmass term
     3// this function evaluates the collection of image headers for keywords of the form ZPT_OBS.
     4// Downstream, we will set the zero point offset for the image (image[0].Mcal) based on the
     5// value calculated here and the nominal zero point for the chip photcode. Four possible modes
     6// are defined:
     7
     8// NOMINAL: in this case, the database value for the nominal zero point is used and
     9// image[0].Mcal is set to zero.
     10
     11// CHIP_HEADER: in this case, the zero point offset measured for each chip is applied
     12// independently to image[0].Mcal
     13
     14// CHIP_AVERAGE: in this case, the per-chip measured zero points are converted to offsets from
     15// the nominal zero points, and the median zero point offset is calculate, and later applied to
     16// image[0].Mcal
     17
     18// PHU_HEADER: in this case, the zero point measured for the entire exposure and reported in
     19// the PHU header is used to set the zero point offset for each chip.  Note that in this case,
     20// ZERO_POINT_OFFSET in this funciton is actually set to the zero point, and adjusted to an
     21// offset in ReadImageHeader based on the per-chip zero points in the photcode database
     22
    423int GetZeroPointExposure (Header **headers, HeaderSet *headerSets, int Nimages) {
    524
     25    // the zero point correction is not applied
    626    if (!strcasecmp(ZERO_POINT_OPTION, "NOMINAL")) {
    727        ZERO_POINT_OFFSET = 0.0;
     
    929    }
    1030
     31    // the zero point correction is applied in ReadImageHeader
    1132    if (!strcasecmp(ZERO_POINT_OPTION, "CHIP_HEADER")) {
    1233        ZERO_POINT_OFFSET = 0.0;
     
    1435    }
    1536
     37    // the zero point correction is measured here and applied in ReadImageHeader
    1638    if (!strcasecmp(ZERO_POINT_OPTION, "CHIP_AVERAGE")) {
    1739        int i, Nzpt, Nmid, Nhead;
     
    6688    }
    6789   
    68     // this option is not consistent with the options for photcodes
     90    // the zero point (NOT the correction) is measured here and applied in ReadImageHeader
    6991    if (!strcasecmp(ZERO_POINT_OPTION, "PHU_HEADER")) {
    7092        int i, Nhead;
  • trunk/Ohana/src/addstar/src/ReadImageHeader.c

    r24988 r25908  
    203203  }
    204204
    205   // if it exists, find the
     205  // in this case, lookup and apply the zero point measured for this chip
    206206  if (!strcasecmp(ZERO_POINT_OPTION, "CHIP_HEADER")) {
    207207      float ZPT_OBS;
     
    214214  }
    215215
     216  // in this case, lookup and apply the zero point measured for the exposure
     217  if (!strcasecmp(ZERO_POINT_OPTION, "PHU_HEADER")) {
     218      if (!photcodeData) {
     219          fprintf (stderr, "photcode data not supplied for this chip\n");
     220          ZERO_POINT_OFFSET = 0.0;
     221      } else {
     222          ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZERO_POINT_OFFSET;
     223      }   
     224  }
     225
    216226  /* secz is in units milli-airmass */
    217227  image[0].Mcal = ZERO_POINT_OFFSET;
Note: See TracChangeset for help on using the changeset viewer.