IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24973


Ignore:
Timestamp:
Aug 2, 2009, 4:27:26 PM (17 years ago)
Author:
eugene
Message:

allow dvo to accept supplied zero point information

Location:
trunk/Ohana/src/addstar
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/Makefile

    r21508 r24973  
    5858$(SRC)/greference.$(ARCH).o \
    5959$(SRC)/grefstars.$(ARCH).o \
     60$(SRC)/GetZeroPointExposure.$(ARCH).o \
    6061$(SRC)/LoadStars.$(ARCH).o \
    6162$(SRC)/LoadHeaders.$(ARCH).o \
  • trunk/Ohana/src/addstar/doc/notes.txt

    r21508 r24973  
     1
     22009.08.02
     3
     4  ZERO POINTS: addstar currently has a couple of inconsistent ways that it
     5  measures or uses image zero points:
     6
     7  * the standard zero point: data in the database is saved as M_inst +
     8    25.0.  This value is written to the image header and checked when
     9    the image is loaded.  This is completely archaic, but removing
     10    this concept from the DVO system will require some work and some
     11    care.  This value is NOT reflected in the image->Mcal values
     12
     13  * on-the-fly calibration: addstar was used by CFHT skyprobe to
     14    measure the sky transparency.  This calculation was done by
     15    measuring the zero point between the Tycho stars in the database
     16    and the stars in the image.  Star data is saved in
     17    AddToCalibration as they are found (in find_matches, or
     18    equivalent).  At the end of the match processing, the zero point
     19    for the image was calculated with FindCalibration and saved to the
     20    image table but NOT the measure table.  For skyprobe, the stars
     21    are normally not saved to the database -- the Tycho stars are kept
     22    in the measure & average tables, and used as the reference for the
     23    zero point calculation above.
     24
     25  For Pan-STARRS, the zero point analysis is performed by psastro
     26  before we run addstar.  However, there are a few ways we could
     27  choose to apply the zero point calculation:
     28
     29  * use the per-chip zero point reported in the individual chip
     30    headers (easy, but fairly wrong)
     31
     32  * calculate the per-exposure zero point from the chip headers and
     33    supply.
     34
     35  * calculate the per-exposure zero point from the MATCHED_REFS table
     36
     37  We also need to consider the zero point error.  We currently have
     38  only dM (poisson error) + dMcal (calibration error).  We need to
     39  divide dMsys into dMcal (photometry calibration error) and dMap
     40  (aperture correction error).
     41
     42  * zero point options:
     43    * NOMINAL : set Mcal = 0.0
     44    * CHIP_HEADER : each chip has zero point in header
     45    * PHU_HEADER : a single exposure-wide value in the header
     46    * CHIP_AVERAGE : determine zero point for exposure from chip zero points
     47    * MATCHED_REFS : recalculate from table
    148
    2492009.02.11
  • trunk/Ohana/src/addstar/include/addstar.h

    r24400 r24973  
    118118double  FAKE_THETA;     // boresite angle for fake images
    119119
     120char    ZERO_POINT_OPTION[64];
     121float   ZERO_POINT_OFFSET;
     122
    120123// carries the mosaic into gstars
    121124
     
    187190HeaderSet *MatchHeaders           PROTO((int **extsize, int *nimage, int mode, Header **headers, int Nheaders));
    188191int        LoadData               PROTO((FILE *f, char *file, Image **images, int *nvalid, Stars **stars, int *Nstars, Header **headers, int *extsize, HeaderSet *headerSets, int NheaderSets));
     192int        GetZeroPointExposure   PROTO((Header **headers, HeaderSet *headerSets, int Nimages));
    189193
    190194int        in_image               PROTO((double r, double d, Image *image));
  • trunk/Ohana/src/addstar/src/ConfigInit.c

    r21508 r24973  
    7777  if (!ScanConfig (config, "EXTNAME-KEYWORD",        "%s",  0, ExtnameKeyword)) {
    7878      strcpy (ExtnameKeyword, "EXTNAME");
     79  }
     80
     81  // if this config variable is not set, do not set any zero point offset
     82  if (!ScanConfig (config, "ZERO_POINT_OPTION", "%s",  0, ZERO_POINT_OPTION)) {
     83      strcpy (ZERO_POINT_OPTION, "NOMINAL");
    7984  }
    8085
  • trunk/Ohana/src/addstar/src/LoadData.c

    r21508 r24973  
    2424  // find image rootname
    2525  name = filebasename (file);
     26
     27  // if zero points are calculated for the full exposure using more than just the matched chip header,
     28  // we need to perform that analysis here
     29  GetZeroPointExposure (headers, headerSets, Nimages);
    2630
    2731  // now run through the images, interpret the headers and read the stars
  • trunk/Ohana/src/addstar/src/ReadImageHeader.c

    r21508 r24973  
    88  double tmp, sec, Cerror, ZeroPt, FWHM_X, FWHM_Y;
    99  char *c, photname[64], line[80];
     10  PhotCode *photcodeData;
    1011
    1112  // zero out the entire image structure
     
    104105      return (FALSE);
    105106    }
    106     photcode = GetPhotcodeCodebyName (photname);
    107     if (photcode == 0) {
     107    photcodeData = GetPhotcodebyName (photname);
     108    if (photcodeData == NULL) {
    108109      fprintf (stderr, "photcode %s not found in photcode table\n", photname);
    109110      return (FALSE);
    110111    }
     112    photcode = photcodeData[0].code;
    111113  }
    112114  if (photcode == 0) {
     
    191193  }
    192194
     195  // XXX this is archaic: we used to set a fixed zero point of 25 to shift data into the range
     196  // 0 - 32 so it would fit in an unsigned int.  This is also needed because some programs like
     197  // sextractor will put in an arbitrary zero point that we need to understand to get back to
     198  // instrumental mags. 
    193199  gfits_scan (header, "ZERO_PT", "%lf", 1, &ZeroPt);
    194200  if (ZeroPt != GetZeroPoint()) {
     
    197203  }
    198204
     205  // if it exists, find the
     206  if (!strcasecmp(ZERO_POINT_OPTION, "CHIP_HEADER")) {
     207      float ZPT_OBS;
     208      if (!gfits_scan (header, "ZPT_OBS", "%f", 1, &ZPT_OBS)) {
     209          fprintf (stderr, "zero point not supplied in header\n");
     210          ZERO_POINT_OFFSET = 0.0;
     211      } else {
     212          ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZPT_OBS;
     213      }   
     214  }
     215
    199216  /* secz is in units milli-airmass */
    200   image[0].Mcal = 0.0;
     217  image[0].Mcal = ZERO_POINT_OFFSET;
    201218  image[0].Xm   = NAN_S_SHORT;
    202219  image[0].flags = 0;
Note: See TracChangeset for help on using the changeset viewer.