IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35734


Ignore:
Timestamp:
Jul 2, 2013, 9:09:29 AM (13 years ago)
Author:
eugene
Message:

set projID/skycellID in boundary tree table, avoid string match; pass projID/skycellID with image data

Location:
branches/eam_branches/ipp-20130509/Ohana/src/relphot
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130509/Ohana/src/relphot/include/relphot.h

    r35604 r35734  
    1717# define GRID_V2
    1818# define NO_IMAGE -100
     19
     20# define ID_SECF_STACK_PRIMARY 0x00004000
    1921
    2022// choose off_t or int depending on full-scale relphot analysis resources
     
    114116  unsigned int photom_map_id;
    115117  unsigned int flags;
     118  int projID;
     119  int skycellID;
     120  unsigned int tzero;
    116121  unsigned int tzero;
    117122  unsigned char trate;
     
    149154char        *IMAGES;
    150155char        *BCATALOG;
     156char        *BOUNDARY_TREE;
    151157ModeType     MODE;
    152158
  • branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/ImageSubset.c

    r35104 r35734  
    6363  GET_COLUMN (map,     "PHOTOM_MAP", int);
    6464  GET_COLUMN (flags,   "FLAGS",      int);
     65  GET_COLUMN (projID,  "PROJ_ID",    int);
     66  GET_COLUMN (skycellID, "SKYCELL_ID", int);
    6567  GET_COLUMN (tzero,   "TZERO",      int);
    6668  GET_COLUMN (trate,   "TRATE",      short);
     
    7678    image[i].photom_map_id = map[i];
    7779    image[i].flags         = flags[i];
     80    image[i].projID        = projID[i];
     81    image[i].skycellID     = skycellID[i];
    7882    image[i].tzero         = tzero[i];
    7983    image[i].trate         = trate[i];
     
    8791  free (map);
    8892  free (flags);
     93  free (projID);
     94  free (skycellID);
    8995  free (tzero);
    9096  free (trate);
     
    124130  gfits_define_bintable_column (&theader, "J", "FLAGS", "flags", NULL, 1.0, 1.0*0x8000);
    125131
     132  gfits_define_bintable_column (&theader, "J", "PROJ_ID", "ID", NULL, 1.0, 0.0);
     133  gfits_define_bintable_column (&theader, "J", "SKYCELL_ID", "ID", NULL, 1.0, 0.0);
     134
    126135  gfits_define_bintable_column (&theader, "J", "TZERO", "exposure start", NULL, 1.0, 1.0*0x8000);
    127136  gfits_define_bintable_column (&theader, "I", "TRATE", "tti rate", NULL, 1.0, 0.0);
     
    134143  float *Mcal, *dMcal;
    135144  unsigned int *imageID, *map, *flags, *tzero;
     145  int *projID, *skycellID;
    136146  unsigned short *trate;
    137147  short *ucdist;
    138148
    139149  // create intermediate storage arrays
    140   ALLOCATE (Mcal,    float,          Nimage);
    141   ALLOCATE (dMcal,   float,          Nimage);
    142   ALLOCATE (imageID, unsigned int,   Nimage);
    143   ALLOCATE (map,     unsigned int,   Nimage);
    144   ALLOCATE (flags,   unsigned int,   Nimage);
    145   ALLOCATE (tzero,   unsigned int,   Nimage);
    146   ALLOCATE (trate,   unsigned short, Nimage);
    147   ALLOCATE (ucdist,  short,          Nimage);
     150  ALLOCATE (Mcal,      float,        Nimage);
     151  ALLOCATE (dMcal,     float,        Nimage);
     152  ALLOCATE (imageID,   unsigned int,   Nimage);
     153  ALLOCATE (map,       unsigned int,   Nimage);
     154  ALLOCATE (flags,     unsigned int,   Nimage);
     155  ALLOCATE (projID,    int,            Nimage);
     156  ALLOCATE (skycellID, int,            Nimage);
     157  ALLOCATE (tzero,     unsigned int,   Nimage);
     158  ALLOCATE (trate,     unsigned short, Nimage);
     159  ALLOCATE (ucdist,    short,          Nimage);
    148160
    149161  // assign the storage arrays
     
    157169    trate[i]   = image[i].trate;
    158170    ucdist[i]  = image[i].ubercalDist;
     171
     172    projID[i] = -1;
     173    skycellID[i] = -1;
     174    if (!strncmp (image[i].name, "RINGS.V3.skycell", strlen("RINGS.V3.skycell"))) {
     175      projID[i] = atoi(&image[i].name[18]);
     176      skycellID[i] = atoi(&image[i].name[23]);
     177    }
    159178  }
    160179
    161180  // add the columns to the output array
    162   gfits_set_bintable_column (&theader, &ftable, "MCAL",         Mcal,    Nimage);
    163   gfits_set_bintable_column (&theader, &ftable, "MCAL_ERR",     dMcal,   Nimage);
    164   gfits_set_bintable_column (&theader, &ftable, "IMAGE_ID",     imageID, Nimage);
    165   gfits_set_bintable_column (&theader, &ftable, "PHOTOM_MAP",   map,     Nimage);
    166   gfits_set_bintable_column (&theader, &ftable, "FLAGS",        flags,   Nimage);
    167   gfits_set_bintable_column (&theader, &ftable, "TZERO",        tzero,   Nimage);
    168   gfits_set_bintable_column (&theader, &ftable, "TRATE",        trate,   Nimage);
    169   gfits_set_bintable_column (&theader, &ftable, "UBERCAL_DIST", ucdist,  Nimage);
     181  gfits_set_bintable_column (&theader, &ftable, "MCAL",         Mcal,      Nimage);
     182  gfits_set_bintable_column (&theader, &ftable, "MCAL_ERR",     dMcal,     Nimage);
     183  gfits_set_bintable_column (&theader, &ftable, "IMAGE_ID",     imageID,   Nimage);
     184  gfits_set_bintable_column (&theader, &ftable, "PHOTOM_MAP",   map,       Nimage);
     185  gfits_set_bintable_column (&theader, &ftable, "FLAGS",        flags,     Nimage);
     186  gfits_set_bintable_column (&theader, &ftable, "PROJ_ID",      projID,    Nimage);
     187  gfits_set_bintable_column (&theader, &ftable, "SKYCELL_ID",   skycellID, Nimage);
     188  gfits_set_bintable_column (&theader, &ftable, "TZERO",        tzero,     Nimage);
     189  gfits_set_bintable_column (&theader, &ftable, "TRATE",        trate,     Nimage);
     190  gfits_set_bintable_column (&theader, &ftable, "UBERCAL_DIST", ucdist,    Nimage);
    170191
    171192  free (Mcal);
     
    174195  free (map);
    175196  free (flags);
     197  free (projID);
     198  free (skycellID);
    176199  free (tzero);
    177200  free (trate);
  • branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/args.c

    r35728 r35734  
    211211  }
    212212
     213  BOUNDARY_TREE = NULL;
    213214  if ((N = get_argument (argc, argv, "-boundary-tree"))) {
    214215    remove_argument (N, &argc, argv);
    215     load_tree (argv[N]);
     216    BOUNDARY_TREE = strcreate(argv[N]);
     217    load_tree (BOUNDARY_TREE);
    216218    remove_argument (N, &argc, argv);
    217219  }
     
    409411    remove_argument (N, &argc, argv);
    410412    strcpy (STATMODE, argv[N]);
     413    remove_argument (N, &argc, argv);
     414  }
     415
     416  BOUNDARY_TREE = NULL;
     417  if ((N = get_argument (argc, argv, "-boundary-tree"))) {
     418    remove_argument (N, &argc, argv);
     419    BOUNDARY_TREE = strcreate(argv[N]);
     420    load_tree (BOUNDARY_TREE);
    411421    remove_argument (N, &argc, argv);
    412422  }
  • branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/reload_catalogs.c

    r35104 r35734  
    187187    if (!KEEP_UBERCAL)    { snprintf (tmpline, 1024, "%s -reset-ubercal",       command);                                         strcpy (command, tmpline); }
    188188    if (UPDATE_CATFORMAT) { snprintf (tmpline, 1024, "%s -update-catformat %s", command, UPDATE_CATFORMAT);                       strcpy (command, tmpline); }
     189    if (BOUNDARY_TREE)    { snprintf (tmpline, 1024, "%s -boundary-tree %s",    command, BOUNDARY_TREE);                          strcpy (command, tmpline); }
    189190    if (SET_MREL_VERSION != 1) { snprintf (tmpline, 1024, "%s -set-mrel-version %d", command, SET_MREL_VERSION);                  strcpy (command, tmpline); }
    190191    if (AreaSelect)       { snprintf (tmpline, 1024, "%s -area %f %f %f %f",    command, AreaXmin, AreaXmax, AreaYmin, AreaYmax); strcpy (command, tmpline); }
  • branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/setMrelFinal.c

    r34749 r35734  
    1616    // flags used by the photometry analysis (excluding UBERCAL)
    1717    unsigned int PHOTOM_FLAGS =
    18       ID_MEAS_NOCAL |       // detection ignored for this analysis (photcode, time range)
    19       ID_MEAS_POOR_PHOTOM | // detection is photometry outlier
    20       ID_MEAS_SKIP_PHOTOM | // detection was ignored for photometry measurement
    21       ID_MEAS_AREA;       // detetion was outside acceptable area of device
    22    
     18      ID_MEAS_NOCAL |          // detection ignored for this analysis (photcode, time range)
     19      ID_MEAS_POOR_PHOTOM |    // detection is photometry outlier
     20      ID_MEAS_SKIP_PHOTOM |    // detection was ignored for photometry measurement
     21      ID_MEAS_AREA |           // detetion was outside acceptable area of device
     22      ID_MEAS_SYNTH_MAG |      // magnitude is synthetic
     23      ID_MEAS_STACK_PRIMARY |  // this stack measurement is in the primary skycell
     24      ID_MEAS_STACK_PHOT_SRC;  // this measurement supplied the stack photometry
     25
     26    // ID_MEAS_PHOTOM_UBERCAL -- externally-supplied zero point from ubercal analysis
     27    // this is set by 'setphot', do not reset here
     28
    2329    // flags used by the photometry analysis (excluding UBERCAL)
    2430    // unsigned int secfiltFlags =
Note: See TracChangeset for help on using the changeset viewer.