Changeset 35737
- Timestamp:
- Jul 2, 2013, 11:01:53 AM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130509/Ohana/src/relphot
- Files:
-
- 6 edited
-
include/relphot.h (modified) (2 diffs)
-
src/BoundaryTreeOps.c (modified) (3 diffs)
-
src/ImageOps.c (modified) (7 diffs)
-
src/ImageSubset.c (modified) (2 diffs)
-
src/reload_catalogs.c (modified) (1 diff)
-
src/setMrelCatalog.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130509/Ohana/src/relphot/include/relphot.h
r35734 r35737 118 118 int projID; 119 119 int skycellID; 120 unsigned int tzero;121 120 unsigned int tzero; 122 121 unsigned char trate; … … 401 400 402 401 int MatchImageName (off_t meas, int cat, char *name); 402 int MatchImageSkycellID (off_t meas, int cat, int myProjectionID, int mySkycellID); 403 403 404 404 int load_tree (char *treefile); 405 405 int BoundaryTreePrimaryCell (char *primaryCellName, double ra, double dec); 406 int BoundaryTreePrimaryCellIDs (int *projID, int *skycellID, double ra, double dec); 406 407 407 408 int print_measure_set_alt (Average *average, SecFilt *secfilt, Measure *measure); -
branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/BoundaryTreeOps.c
r35735 r35737 53 53 int zone, band; 54 54 55 if (!primaryCellName) return FALSE; 56 57 primaryCellName[0] = 0; 55 *projID = -1; 56 *skycellID = -1; 58 57 59 58 if (!tree) return FALSE; … … 64 63 } 65 64 66 # define USE_PROJECTION_CELL 067 # if (USE_PROJECTION_CELL)68 snprintf (primaryCellName, DVO_MAX_PATH, "RINGS.V3.%s", tree->name[zone][band]);69 # else70 71 65 // I have ra, dec, and the primary projection cell. In order to choose the primary skycell, 72 66 // I just need to project to ra,dec to X,Y based on the center of the cell and then get the subdivision right. … … 80 74 int N = xi + tree->NX_SUB * yi; 81 75 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; 90 78 91 79 return TRUE; -
branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/ImageOps.c
r35735 r35737 45 45 static IDX_T **ImageToMeasure = NULL; // measure for given measure on image : ImageMeasure[ImageIndex][i] = cat (i : 0 < NonImage[ImageIndex]) 46 46 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. 50 int *projectID = NULL; 51 int *skycellID = NULL; 52 47 53 // MeasureToImage was 'bin' 48 54 // ImageToCatalog was 'clist' … … 74 80 ALLOCATE (imageIdx, off_t, Nimage); 75 81 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 76 86 for (i = 0; i < Nimage; i++) { 77 87 imageIdx[i] = i; 78 88 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 80 98 llsortpair (imageIDs, imageIdx, Nimage); 81 99 } … … 88 106 // create full a Image array and save the needed values 89 107 ALLOCATE (image, Image, N); 108 ALLOCATE (projectID, int, N); 109 ALLOCATE (skycellID, int, N); 110 90 111 for (i = 0; i < N; i++) { 91 112 image[i].imageID = input[i].imageID ; … … 97 118 image[i].trate = input[i].trate ; 98 119 image[i].ubercalDist = input[i].ubercalDist ; 120 projectID[i] = input[i].projID ; 121 skycellID[i] = input[i].skycellID ; 99 122 } 100 123 LineNumber = line_number; … … 130 153 subset[i].trate = image[i].trate ; 131 154 subset[i].ubercalDist = image[i].ubercalDist ; 155 subset[i].projID = projectID[i]; 156 subset[i].skycellID = skycellID[i]; 132 157 } 133 158 return subset; … … 436 461 437 462 // 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; 463 int MatchImageSkycellID (off_t meas, int cat, int myProjectionID, int mySkycellID) { 464 465 off_t i; 444 466 445 467 if (!MeasureToImage) return FALSE; … … 448 470 if (i == -1) return FALSE; 449 471 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; 458 479 } 459 480 -
branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/ImageSubset.c
r35734 r35737 58 58 char type[16]; 59 59 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); 70 70 71 71 // XXX free the fits table data here … … 161 161 // assign the storage arrays 162 162 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; 178 173 } 179 174 -
branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/reload_catalogs.c
r35734 r35737 156 156 // load the list of hosts 157 157 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 } 158 165 159 166 int i; -
branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/setMrelCatalog.c
r35733 r35737 406 406 407 407 // 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); 409 412 410 413 int NstackGood = 0; … … 474 477 // which stack image should we use for the mean value? 475 478 // if we request the primary (USE_TREE_FOR_PRIMARY), then find the min distances for data from the primary cell 476 if (MatchImage Name (meas, cat, primaryCell)) {479 if (MatchImageSkycellID (meas, cat, projectID, skycellID)) { 477 480 float stackPrimaryOffset = getCenterOffset (meas, cat, &measure[k], &stackImageID); 478 481 if (stackPrimaryOffset < stackPrimaryOffsetMin) {
Note:
See TracChangeset
for help on using the changeset viewer.
