IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35737


Ignore:
Timestamp:
Jul 2, 2013, 11:01:53 AM (13 years ago)
Author:
eugene
Message:

fix up the boundary tree for parallel ops

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

Legend:

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

    r35734 r35737  
    118118  int projID;
    119119  int skycellID;
    120   unsigned int tzero;
    121120  unsigned int tzero;
    122121  unsigned char trate;
     
    401400
    402401int MatchImageName (off_t meas, int cat, char *name);
     402int MatchImageSkycellID (off_t meas, int cat, int myProjectionID, int mySkycellID);
    403403
    404404int load_tree (char *treefile);
    405405int BoundaryTreePrimaryCell (char *primaryCellName, double ra, double dec);
     406int BoundaryTreePrimaryCellIDs (int *projID, int *skycellID, double ra, double dec);
    406407
    407408int print_measure_set_alt (Average *average, SecFilt *secfilt, Measure *measure);
  • branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/BoundaryTreeOps.c

    r35735 r35737  
    5353  int zone, band;
    5454
    55   if (!primaryCellName) return FALSE;
    56 
    57   primaryCellName[0] = 0;
     55  *projID = -1;
     56  *skycellID = -1;
    5857
    5958  if (!tree) return FALSE;
     
    6463  }
    6564 
    66 # define USE_PROJECTION_CELL 0
    67 # if (USE_PROJECTION_CELL)
    68   snprintf (primaryCellName, DVO_MAX_PATH, "RINGS.V3.%s", tree->name[zone][band]);
    69 # else
    70 
    7165  // I have ra, dec, and the primary projection cell.  In order to choose the primary skycell,
    7266  // I just need to project to ra,dec to X,Y based on the center of the cell and then get the subdivision right.
     
    8074  int N = xi + tree->NX_SUB * yi;
    8175 
    82   // XXX short-circuit this for now (we should use this code if we make tree have more variable NX,NY values
    83   // char format[24], skycellname[128];
    84   // int Ndigit = (int)(log10(tree->NX_SUB*tree->NY_SUB)) + 1 ;
    85   // snprintf (format, 24, "%s.%%0%dd", tree->name[zone][band], Ndigit);
    86   // snprintf (skycellname, 128, format, N);
    87 
    88   snprintf (primaryCellName, DVO_MAX_PATH, "RINGS.V3.%s.%03d", tree->name[zone][band], N);
    89 # endif
     76  *projID = tree->projID[zone][band];
     77  *skycellID = N;
    9078
    9179  return TRUE;
  • branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/ImageOps.c

    r35735 r35737  
    4545static IDX_T       **ImageToMeasure = NULL; // measure for given measure on image : ImageMeasure[ImageIndex][i] = cat (i : 0 < NonImage[ImageIndex])
    4646
     47// Projection Cell / SkyCell ID : for stack primary detection, we need to know the projection cell and skycell ID for each
     48// stack image.  for now, we generate these ID arrays based on the image names when we load in the image table (initImages).
     49// When we pass data to the remote clients via the ImageSubset, the projID/skycellID values are carried directly in the table.
     50int *projectID = NULL;
     51int *skycellID = NULL;
     52
    4753// MeasureToImage was 'bin'
    4854// ImageToCatalog was 'clist'
     
    7480  ALLOCATE (imageIdx, off_t, Nimage);
    7581
     82  // for stack images, assign projection cell ID and skycell ID based on filenames
     83  ALLOCATE (projectID,   int, Nimage);
     84  ALLOCATE (skycellID,   int, Nimage);
     85
    7686  for (i = 0; i < Nimage; i++) {
    7787    imageIdx[i] = i;
    7888    imageIDs[i] = image[i].imageID;
    79   }
     89    projectID[i] = -1;
     90    skycellID[i] = -1;
     91    if (!strncmp (image[i].name, "RINGS.V3.skycell", strlen("RINGS.V3.skycell"))) {
     92      projectID[i] = atoi(&image[i].name[17]);
     93      skycellID[i] = atoi(&image[i].name[22]);
     94    }
     95  }
     96
     97  // sort the image index by the IDs
    8098  llsortpair (imageIDs, imageIdx, Nimage);
    8199}
     
    88106  // create full a Image array and save the needed values
    89107  ALLOCATE (image, Image, N);
     108  ALLOCATE (projectID, int, N);
     109  ALLOCATE (skycellID, int, N);
     110
    90111  for (i = 0; i < N; i++) {
    91112    image[i].imageID       = input[i].imageID      ;
     
    97118    image[i].trate         = input[i].trate        ;
    98119    image[i].ubercalDist   = input[i].ubercalDist  ;
     120    projectID[i]           = input[i].projID       ;
     121    skycellID[i]           = input[i].skycellID    ;
    99122  }
    100123  LineNumber = line_number;
     
    130153    subset[i].trate         = image[i].trate        ;
    131154    subset[i].ubercalDist   = image[i].ubercalDist  ;
     155    subset[i].projID        = projectID[i];
     156    subset[i].skycellID     = skycellID[i];
    132157  }
    133158  return subset;
     
    436461
    437462// returns image.Mcal - ff(x,y)
    438 int MatchImageSkycellID (off_t meas, int cat, char *name) {
    439 
    440   off_t i;
    441 
    442   if (!name) return FALSE;
    443   if (!name[0]) return FALSE;
     463int MatchImageSkycellID (off_t meas, int cat, int myProjectionID, int mySkycellID) {
     464
     465  off_t i;
    444466
    445467  if (!MeasureToImage) return FALSE;
     
    448470  if (i == -1) return FALSE;
    449471
    450   // this is a bit crude: stack image names are of the form:
    451   // RINGS.V3.skycell.1495.027.sky.191211.stk.988232.cmf.
    452 
    453   // the primaryCell has a name of the form RINGS.V3.skycell.1495 or RINGS.V3.skycell.1495.027
    454   // (if we use projection or skycell as the primary)
    455 
    456   if (!strncmp(image[i].name, name, strlen(name))) return TRUE;
    457   return FALSE;
     472  if (projectID[i] == -1) return FALSE;
     473  if (skycellID[i] == -1) return FALSE;
     474
     475  if (projectID[i] != myProjectionID) return FALSE;
     476  if (skycellID[i] != mySkycellID) return FALSE;
     477 
     478  return TRUE;
    458479}
    459480
  • branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/ImageSubset.c

    r35734 r35737  
    5858  char type[16];
    5959
    60   GET_COLUMN (Mcal,    "MCAL",       float);
    61   GET_COLUMN (dMcal,   "MCAL_ERR",   float);
    62   GET_COLUMN (imageID, "IMAGE_ID",   int);
    63   GET_COLUMN (map,     "PHOTOM_MAP", int);
    64   GET_COLUMN (flags,   "FLAGS",      int);
    65   GET_COLUMN (projID,  "PROJ_ID",    int);
    66   GET_COLUMN (skycellID, "SKYCELL_ID", int);
    67   GET_COLUMN (tzero,   "TZERO",      int);
    68   GET_COLUMN (trate,   "TRATE",      short);
    69   GET_COLUMN (ucdist,  "UBERCAL_DIST", short);
     60  GET_COLUMN (Mcal,      "MCAL",         float);
     61  GET_COLUMN (dMcal,     "MCAL_ERR",     float);
     62  GET_COLUMN (imageID,   "IMAGE_ID",     int);
     63  GET_COLUMN (map,       "PHOTOM_MAP",  int);
     64  GET_COLUMN (flags,     "FLAGS",        int);
     65  GET_COLUMN (projID,    "PROJ_ID",      int);
     66  GET_COLUMN (skycellID, "SKYCELL_ID",   int);
     67  GET_COLUMN (tzero,     "TZERO",        int);
     68  GET_COLUMN (trate,     "TRATE",        short);
     69  GET_COLUMN (ucdist,    "UBERCAL_DIST", short);
    7070
    7171  // XXX free the fits table data here
     
    161161  // assign the storage arrays
    162162  for (i = 0; i < Nimage; i++) {
    163     Mcal[i]    = image[i].Mcal;
    164     dMcal[i]   = image[i].dMcal;
    165     imageID[i] = image[i].imageID;
    166     map[i]     = image[i].photom_map_id;
    167     flags[i]   = image[i].flags;
    168     tzero[i]   = image[i].tzero;
    169     trate[i]   = image[i].trate;
    170     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     }
     163    Mcal[i]      = image[i].Mcal;
     164    dMcal[i]     = image[i].dMcal;
     165    imageID[i]   = image[i].imageID;
     166    map[i]       = image[i].photom_map_id;
     167    flags[i]     = image[i].flags;
     168    tzero[i]     = image[i].tzero;
     169    trate[i]     = image[i].trate;
     170    ucdist[i]    = image[i].ubercalDist;
     171    projID[i]    = image[i].projID;
     172    skycellID[i] = image[i].skycellID;
    178173  }
    179174
  • branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/reload_catalogs.c

    r35734 r35737  
    156156  // load the list of hosts
    157157  HostTable *table = HostTableLoad (CATDIR, sky->hosts);
     158
     159  if (BOUNDARY_TREE) {
     160    char *tmppath = abspath(BOUNDARY_TREE, DVO_MAX_PATH);
     161    free (BOUNDARY_TREE);
     162    BOUNDARY_TREE = tmppath;
     163   
     164  }
    158165
    159166  int i;
  • branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/setMrelCatalog.c

    r35733 r35737  
    406406
    407407  // set the name of the primary skycell (this is used in a strcmp to match the skycells in stack detections)
    408   BoundaryTreePrimaryCell(primaryCell, average[0].R, average[0].D);
     408  // XXX drop BoundaryTreePrimaryCell(primaryCell, average[0].R, average[0].D);
     409  int projectID = -1;
     410  int skycellID = -1;
     411  BoundaryTreePrimaryCellIDs(&projectID, &skycellID, average[0].R, average[0].D);
    409412
    410413  int NstackGood = 0;
     
    474477      // which stack image should we use for the mean value?
    475478      // if we request the primary (USE_TREE_FOR_PRIMARY), then find the min distances for data from the primary cell
    476       if (MatchImageName (meas, cat, primaryCell)) {
     479      if (MatchImageSkycellID (meas, cat, projectID, skycellID)) {
    477480        float stackPrimaryOffset = getCenterOffset (meas, cat, &measure[k], &stackImageID);
    478481        if (stackPrimaryOffset < stackPrimaryOffsetMin) {
Note: See TracChangeset for help on using the changeset viewer.