Changeset 34826
- Timestamp:
- Dec 15, 2012, 7:16:10 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20121130/Ohana/src
- Files:
-
- 3 edited
-
addstar/src/findskycell.c (modified) (3 diffs)
-
libdvo/include/dvo.h (modified) (1 diff)
-
libdvo/src/BoundaryTree.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121130/Ohana/src/addstar/src/findskycell.c
r34825 r34826 202 202 tree.ra[zone][band] = ra; 203 203 tree.dec[zone][band] = dec; 204 tree.Xo[zone][band] = x; 205 tree.Yo[zone][band] = y; 204 206 tree.cell[zone][band] = i; 205 207 … … 342 344 // the proj cell is divided into Nx, Ny bits. 343 345 // (ra,dec) for (Ro,Do) -> (x,y). given (Xo,Yo),(dX,dY) I can find ix,iy 344 // I currently track Ro,Do (tree->RA_origin[zone], tree->...) 345 346 // I currently track Ro,Do (tree->ra[zone][band], tree->dec[zone][band]) 347 // I need to have the skycell center in pixels (Xo,Yo) and the scale dX,dY 348 349 // convert R,D to X,Y with hard-wired projection and scale, orientation? 350 351 TreeCellProjection (&x, &y, ra, dec, tree, zone, band); 352 353 xi = x / tree->NX_SUB; 354 yi = y / tree->NY_SUB; 355 356 346 357 347 358 } … … 349 360 exit (0); 350 361 } 362 -
branches/eam_branches/ipp-20121130/Ohana/src/libdvo/include/dvo.h
r34749 r34826 322 322 int *NBAND; 323 323 324 double **ra; 325 double **dec; 326 int **cell; 327 char ***name; 324 double **ra; // RA of projection cell center 325 double **dec; // DEC of projection cell center 326 int **cell; // zone,band -> proj cell sequence 327 char ***name; // projection cell name 328 329 int NX_SUB, NY_SUB; 330 331 int **Xo; 332 int **Yo; 328 333 } BoundaryTree; 329 334 -
branches/eam_branches/ipp-20121130/Ohana/src/libdvo/src/BoundaryTree.c
r34291 r34826 318 318 } 319 319 320 321 // projection = TAN 322 // need Ro, Do, Xo, Yo, dPix 323 324 int TreeCellProjection (double *x, double *y, double r, double d, BoundaryTree *tree, int zone, int band) { 325 326 double Xo = tree->Yo[zone][band]; 327 double Yo = tree->Xo[zone][band]; 328 double Ro = tree->ra[zone][band]; 329 double Do = tree->dec[zone][band]; 330 double dPix = tree->dPix; 331 332 // this block only depends on Ro, Do 333 334 sdp = sin(RAD_DEG*Do); 335 cdp = cos(RAD_DEG*Do); 336 salp = sin(RAD_DEG*(ra - Ro)); 337 calp = cos(RAD_DEG*(ra - Ro)); 338 sdel = sin(RAD_DEG*dec); 339 cdel = cos(RAD_DEG*dec); 340 341 stht = sdel*sdp + cdel*cdp*calp; /* sin(theta) */ 342 sphi = cdel*salp; /* = cos(theta)*sin(phi) */ 343 cphi = cdel*sdp*calp - sdel*cdp; /* = cos(theta)*cos(phi) */ 344 345 // defines the TAN projection (one of zenithal projections available, libdvo/src/coordops.c 346 // R = cot (theta) = cos(theta) / sin(theta) 347 if (stht == 0) { 348 Rc = hypot(sphi, cphi); 349 L = 180.0 * sphi / Rc; 350 M = 180.0 * cphi / Rc; 351 } else { 352 L = +DEG_RAD * sphi / stht; 353 M = -DEG_RAD * cphi / stht; 354 } 355 356 // scale, rotation, parity: 357 // rotation == 0.0 (pc1_1 == pc2_2 == 1.0, pc1_2 = pc2_1 = 0.0) 358 359 // if there were rotation or parity: 360 // Ro = (coords[0].pc1_1*coords[0].pc2_2 - coords[0].pc1_2*coords[0].pc2_1); 361 // Xo = (coords[0].pc2_2*L - coords[0].pc1_2*M) / Ro; 362 // Yo = (coords[0].pc1_1*M - coords[0].pc2_1*L) / Ro; 363 364 Xo = L; 365 Yo = M; 366 367 // scale is dPix 368 369 *x = Xo / dPix + Xo; 370 *y = Yo / dPix + Yo; 371 372 return TRUE; 373 } 374
Note:
See TracChangeset
for help on using the changeset viewer.
