IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.