Changeset 34830
- Timestamp:
- Dec 17, 2012, 6:26:01 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20121130/Ohana/src
- Files:
-
- 8 edited
-
addstar/src/findskycell.c (modified) (8 diffs)
-
addstar/src/sky_tessalation.c (modified) (3 diffs)
-
libdvo/include/dvo.h (modified) (1 diff)
-
libdvo/src/BoundaryTree.c (modified) (6 diffs)
-
opihi/dvo/gimages.c (modified) (1 diff)
-
relphot/src/BoundaryTreeOps.c (modified) (1 diff)
-
relphot/src/ImageOps.c (modified) (1 diff)
-
relphot/src/StarOps.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121130/Ohana/src/addstar/src/findskycell.c
r34827 r34830 149 149 ALLOCATE (tree.ra, double *, tree.Nzone); 150 150 ALLOCATE (tree.dec, double *, tree.Nzone); 151 ALLOCATE (tree.Xo, int*, tree.Nzone);152 ALLOCATE (tree.Yo, int*, tree.Nzone);151 ALLOCATE (tree.Xo, double *, tree.Nzone); 152 ALLOCATE (tree.Yo, double *, tree.Nzone); 153 153 ALLOCATE (tree.dX, int *, tree.Nzone); 154 154 ALLOCATE (tree.dY, int *, tree.Nzone); … … 183 183 ALLOCATE (tree.ra[zone], double, tree.NBAND[zone]); 184 184 ALLOCATE (tree.dec[zone], double, tree.NBAND[zone]); 185 ALLOCATE (tree.Xo[zone], int, tree.NBAND[zone]);186 ALLOCATE (tree.Yo[zone], int, tree.NBAND[zone]);185 ALLOCATE (tree.Xo[zone], double, tree.NBAND[zone]); 186 ALLOCATE (tree.Yo[zone], double, tree.NBAND[zone]); 187 187 ALLOCATE (tree.dX[zone], int, tree.NBAND[zone]); 188 188 ALLOCATE (tree.dY[zone], int, tree.NBAND[zone]); … … 192 192 tree.ra[zone][band] = NAN; 193 193 tree.dec[zone][band] = NAN; 194 tree.Xo[zone][band] = -1;195 tree.Yo[zone][band] = -1;194 tree.Xo[zone][band] = NAN; 195 tree.Yo[zone][band] = NAN; 196 196 tree.dX[zone][band] = -1; 197 197 tree.dY[zone][band] = -1; … … 218 218 REALLOCATE (tree.ra[zone], double, tree.NBAND[zone]); 219 219 REALLOCATE (tree.dec[zone], double, tree.NBAND[zone]); 220 REALLOCATE (tree.Xo[zone], int, tree.NBAND[zone]);221 REALLOCATE (tree.Yo[zone], int, tree.NBAND[zone]);220 REALLOCATE (tree.Xo[zone], double, tree.NBAND[zone]); 221 REALLOCATE (tree.Yo[zone], double, tree.NBAND[zone]); 222 222 REALLOCATE (tree.dX[zone], int, tree.NBAND[zone]); 223 223 REALLOCATE (tree.dY[zone], int, tree.NBAND[zone]); … … 227 227 tree.ra[zone][j] = NAN; 228 228 tree.dec[zone][j] = NAN; 229 tree.Xo[zone][band] = -1;230 tree.Yo[zone][band] = -1;229 tree.Xo[zone][band] = NAN; 230 tree.Yo[zone][band] = NAN; 231 231 tree.dX[zone][band] = -1; 232 232 tree.dY[zone][band] = -1; … … 377 377 } 378 378 379 fprintf (stdout, "%10.6f %10.6f %3d %3d %s\n", ra, dec, zone, band, tree->name[zone][band]);380 381 379 // I know the projection cell (band,zone), but I need to find the skycell within that projection cell. 382 380 // the proj cell is divided into Nx, Ny bits. … … 390 388 double y = 0.0; 391 389 BoundaryTreeProjection (&x, &y, ra, dec, tree, zone, band); 392 fprintf (stdout, "%6.1f %6.1f\n", x, y);393 390 394 391 int xi = x / tree->dX[zone][band]; … … 402 399 snprintf (skycellname, 128, format, N); 403 400 404 fprintf (std err, "skycell: %s\n", skycellname);401 fprintf (stdout, "%10.6f %10.6f %8.3f %8.3f %3d %3d %s\n", ra, dec, x, y, zone, band, skycellname); 405 402 } 406 403 -
branches/eam_branches/ipp-20121130/Ohana/src/addstar/src/sky_tessalation.c
r34260 r34830 275 275 // convert the SkyRectangles to Images for output 276 276 sky_subdivide_image (&image[j*NX_SUB*NY_SUB], &ring[j], NX_SUB, NY_SUB); 277 printf("%s %8.2f %8.2f\n", ring[j].name, ring[j].coords.crval1, ring[j].coords.crval2);277 // printf("%s %8.2f %8.2f\n", ring[j].name, ring[j].coords.crval1, ring[j].coords.crval2); 278 278 } 279 279 … … 691 691 // fprintf (stdout, "%f %f %f %f %f %f %f %f %f %f %f\n", dec, decUpper, dRA, arg, root1, root2, theta1, theta2, r1, r2, k*r2); 692 692 } 693 fprintf (stdout, "%f %f %f x %f (%d)\n", dec, decUpper, dRA, theta, nRA);693 // fprintf (stdout, "%f %f %f x %f (%d)\n", dec, decUpper, dRA, theta, nRA); 694 694 695 695 // I think we need to return the value of dec for the next ring, but I am not sure... … … 776 776 ring[N].coords.crval2 = (j == 0) ? dec / d2r : -dec / d2r; 777 777 778 printf(" \t %d %25.20f %25.20f\n", i, ring[N].coords.crval2, ring[N].coords.crval1);778 // printf(" \t %d %25.20f %25.20f\n", i, ring[N].coords.crval2, ring[N].coords.crval1); 779 779 780 780 ring[N].coords.pc1_1 = +1.0 * X_PARITY; -
branches/eam_branches/ipp-20121130/Ohana/src/libdvo/include/dvo.h
r34827 r34830 331 331 double dPix; 332 332 333 int**Xo;334 int**Yo;333 double **Xo; 334 double **Yo; 335 335 int **dX; 336 336 int **dY; -
branches/eam_branches/ipp-20121130/Ohana/src/libdvo/src/BoundaryTree.c
r34827 r34830 79 79 ALLOCATE (tree->ra, double *, tree->Nzone); 80 80 ALLOCATE (tree->dec, double *, tree->Nzone); 81 ALLOCATE (tree->Xo, int*, tree->Nzone);82 ALLOCATE (tree->Yo, int*, tree->Nzone);81 ALLOCATE (tree->Xo, double *, tree->Nzone); 82 ALLOCATE (tree->Yo, double *, tree->Nzone); 83 83 ALLOCATE (tree->dX, int *, tree->Nzone); 84 84 ALLOCATE (tree->dY, int *, tree->Nzone); … … 88 88 ALLOCATE (tree->ra[i], double, tree->Nband[i]); 89 89 ALLOCATE (tree->dec[i], double, tree->Nband[i]); 90 ALLOCATE (tree->Xo[i], int, tree->Nband[i]);91 ALLOCATE (tree->Yo[i], int, tree->Nband[i]);90 ALLOCATE (tree->Xo[i], double, tree->Nband[i]); 91 ALLOCATE (tree->Yo[i], double, tree->Nband[i]); 92 92 ALLOCATE (tree->dX[i], int, tree->Nband[i]); 93 93 ALLOCATE (tree->dY[i], int, tree->Nband[i]); … … 114 114 GET_COLUMN_NEW(band, "BAND", int); 115 115 GET_COLUMN_NEW(index, "INDEX", int); 116 GET_COLUMN_NEW(Xo, "X_CENT", int);117 GET_COLUMN_NEW(Yo, "Y_CENT", int);116 GET_COLUMN_NEW(Xo, "X_CENT", double); 117 GET_COLUMN_NEW(Yo, "Y_CENT", double); 118 118 GET_COLUMN_NEW(dX, "X_GRID", int); 119 119 GET_COLUMN_NEW(dY, "Y_GRID", int); … … 251 251 gfits_define_bintable_column (&theader, "J", "BAND", "band sequence number", "none", 1.0, 0.0); 252 252 gfits_define_bintable_column (&theader, "J", "INDEX","cell index", "none", 1.0, 0.0); 253 gfits_define_bintable_column (&theader, " J", "X_CENT", "projection cell center pixel", "none", 1.0, 0.0);254 gfits_define_bintable_column (&theader, " J", "Y_CENT", "projection cell center pixel", "none", 1.0, 0.0);253 gfits_define_bintable_column (&theader, "D", "X_CENT", "projection cell center pixel", "none", 1.0, 0.0); 254 gfits_define_bintable_column (&theader, "D", "Y_CENT", "projection cell center pixel", "none", 1.0, 0.0); 255 255 gfits_define_bintable_column (&theader, "J", "X_GRID", "skycell grid spacing", "none", 1.0, 0.0); 256 256 gfits_define_bintable_column (&theader, "J", "Y_GRID", "skycell grid spacing", "none", 1.0, 0.0); … … 272 272 int *band ; ALLOCATE (band, int, Ncell); 273 273 int *index ; ALLOCATE (index, int, Ncell); 274 int *Xo ; ALLOCATE (Xo, int,Ncell);275 int *Yo ; ALLOCATE (Yo, int,Ncell);274 double *Xo ; ALLOCATE (Xo, double, Ncell); 275 double *Yo ; ALLOCATE (Yo, double, Ncell); 276 276 int *dX ; ALLOCATE (dX, int, Ncell); 277 277 int *dY ; ALLOCATE (dY, int, Ncell); … … 372 372 int BoundaryTreeProjection (double *x, double *y, double r, double d, BoundaryTree *tree, int zone, int band) { 373 373 374 double Xo = tree-> Yo[zone][band];375 double Yo = tree-> Xo[zone][band];374 double Xo = tree->Xo[zone][band]; 375 double Yo = tree->Yo[zone][band]; 376 376 double Ro = tree->ra[zone][band]; 377 377 double Do = tree->dec[zone][band]; -
branches/eam_branches/ipp-20121130/Ohana/src/opihi/dvo/gimages.c
r34260 r34830 212 212 status = XY_to_RD (&Rout, &Dout, X, Y, &image[i].coords); 213 213 fprintf (stderr, "r,d = %f,%f\n", Rout, Dout); 214 status = RD_to_XY (&X, &Y, Ra, Dec, &image[i].coords); 215 fprintf (stderr, "x,y = %f,%f\n", X, Y); 214 216 } 215 217 # endif -
branches/eam_branches/ipp-20121130/Ohana/src/relphot/src/BoundaryTreeOps.c
r34825 r34830 21 21 } 22 22 23 # define USE_PROJECTION_CELL 0 24 # if (USE_PROJECTION_CELL) 23 25 snprintf (primaryCellName, DVO_MAX_PATH, "RINGS.V3.%s", tree->name[zone][band]); 26 # else 24 27 25 28 // I have ra, dec, and the primary projection cell. In order to choose the primary skycell, 26 29 // I just need to project to ra,dec to X,Y based on the center of the cell and then get the subdivision right. 30 31 double x = 0.0; 32 double y = 0.0; 33 BoundaryTreeProjection (&x, &y, ra, dec, tree, zone, band); 34 35 int xi = x / tree->dX[zone][band]; 36 int yi = y / tree->dY[zone][band]; 37 int N = xi + tree->NX_SUB * yi; 38 39 // XXX short-circuit this for now (we should use this code if we make tree have more variable NX,NY values 40 // char format[24], skycellname[128]; 41 // int Ndigit = (int)(log10(tree->NX_SUB*tree->NY_SUB)) + 1 ; 42 // snprintf (format, 24, "%s.%%0%dd", tree->name[zone][band], Ndigit); 43 // snprintf (skycellname, 128, format, N); 44 45 snprintf (primaryCellName, DVO_MAX_PATH, "RINGS.V3.%s.%03d", tree->name[zone][band], N); 46 # endif 27 47 28 48 return TRUE; -
branches/eam_branches/ipp-20121130/Ohana/src/relphot/src/ImageOps.c
r34260 r34830 400 400 if (i == -1) return FALSE; 401 401 402 // this is a bit crude: stack image names are of the form 403 // RINGS.V3.skycell.1495.027.sky.191211.stk.988232.cmf 404 // the primaryCell has a name of the form RINGS.V3.skycell.1495 402 // this is a bit crude: stack image names are of the form: 403 // RINGS.V3.skycell.1495.027.sky.191211.stk.988232.cmf. 404 405 // the primaryCell has a name of the form RINGS.V3.skycell.1495 or RINGS.V3.skycell.1495.027 406 // (if we use projection or skycell as the primary) 405 407 406 408 if (!strncmp(image[i].name, name, strlen(name))) return TRUE; -
branches/eam_branches/ipp-20121130/Ohana/src/relphot/src/StarOps.c
r34749 r34830 363 363 364 364 if (isSetMrelFinal) { 365 // set the name of the primary skycell (this is used in a strcmp to match the skycells in stack detections) 365 366 BoundaryTreePrimaryCell(primaryCell, catalog[Nc].average[j].R, catalog[Nc].average[j].D); 366 367 }
Note:
See TracChangeset
for help on using the changeset viewer.
