Changeset 37101
- Timestamp:
- Jul 22, 2014, 3:40:58 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140717/Ohana/src
- Files:
-
- 5 edited
-
addstar/src/BoundaryTreeIO.c (modified) (1 diff)
-
addstar/src/findskycell.c (modified) (6 diffs)
-
libdvo/include/dvo.h (modified) (2 diffs)
-
libdvo/src/BoundaryTree.c (modified) (7 diffs)
-
libdvo/src/TessellationTable.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140717/Ohana/src/addstar/src/BoundaryTreeIO.c
r34260 r37101 1 1 # include "addstar.h" 2 3 /** this file is deprecated (functions moved to libdvo) ***/ 2 4 3 5 # define GET_COLUMN_NEW(OUT,NAME,TYPE) \ -
branches/eam_branches/ipp-20140717/Ohana/src/addstar/src/findskycell.c
r37036 r37101 27 27 int apply_tree (char *treefile, char *datafile); 28 28 29 float SCALE = 1.0;30 int NX_SUB = 1;31 int NY_SUB = 1;29 float SCALE = 1.0; 30 float NX_SUB = 1.0; 31 float NY_SUB = 1.0; 32 32 33 33 double R_MIN = 0.0; … … 217 217 ALLOCATE (tree.Xo, double *, tree.Nzone); 218 218 ALLOCATE (tree.Yo, double *, tree.Nzone); 219 ALLOCATE (tree.dX, int *, tree.Nzone);220 ALLOCATE (tree.dY, int *, tree.Nzone);219 ALLOCATE (tree.dX, float *, tree.Nzone); 220 ALLOCATE (tree.dY, float *, tree.Nzone); 221 221 ALLOCATE (tree.cell, int *, tree.Nzone); 222 222 ALLOCATE (tree.name, char **, tree.Nzone); … … 251 251 ALLOCATE (tree.Xo[zone], double, tree.NBAND[zone]); 252 252 ALLOCATE (tree.Yo[zone], double, tree.NBAND[zone]); 253 ALLOCATE (tree.dX[zone], int, tree.NBAND[zone]);254 ALLOCATE (tree.dY[zone], int, tree.NBAND[zone]);253 ALLOCATE (tree.dX[zone], float, tree.NBAND[zone]); 254 ALLOCATE (tree.dY[zone], float, tree.NBAND[zone]); 255 255 ALLOCATE (tree.cell[zone], int, tree.NBAND[zone]); 256 256 ALLOCATE (tree.name[zone], char *, tree.NBAND[zone]); … … 260 260 tree.Xo[zone][band] = NAN; 261 261 tree.Yo[zone][band] = NAN; 262 tree.dX[zone][band] = -1;263 tree.dY[zone][band] = -1;262 tree.dX[zone][band] = NAN; 263 tree.dY[zone][band] = NAN; 264 264 tree.cell[zone][band] = -1; 265 265 ALLOCATE (tree.name[zone][band], char, BOUNDARY_TREE_NAME_LENGTH); … … 286 286 REALLOCATE (tree.Xo[zone], double, tree.NBAND[zone]); 287 287 REALLOCATE (tree.Yo[zone], double, tree.NBAND[zone]); 288 REALLOCATE (tree.dX[zone], int, tree.NBAND[zone]);289 REALLOCATE (tree.dY[zone], int, tree.NBAND[zone]);288 REALLOCATE (tree.dX[zone], float, tree.NBAND[zone]); 289 REALLOCATE (tree.dY[zone], float, tree.NBAND[zone]); 290 290 REALLOCATE (tree.cell[zone], int, tree.NBAND[zone]); 291 291 REALLOCATE (tree.name[zone], char *, tree.NBAND[zone]); … … 295 295 tree.Xo[zone][band] = NAN; 296 296 tree.Yo[zone][band] = NAN; 297 tree.dX[zone][band] = -1;298 tree.dY[zone][band] = -1;297 tree.dX[zone][band] = NAN; 298 tree.dY[zone][band] = NAN; 299 299 tree.cell[zone][j] = -1; 300 300 ALLOCATE (tree.name[zone][j], char, BOUNDARY_TREE_NAME_LENGTH); -
branches/eam_branches/ipp-20140717/Ohana/src/libdvo/include/dvo.h
r37093 r37101 383 383 char ***name; // projection cell name 384 384 385 int NX_SUB;386 int NY_SUB;385 float NX_SUB; 386 float NY_SUB; 387 387 double dPix; 388 388 389 389 double **Xo; 390 390 double **Yo; 391 int **dX;392 int **dY;391 float **dX; 392 float **dY; 393 393 } BoundaryTree; 394 394 … … 411 411 double Do; 412 412 double dPix; 413 int dX;414 int dY;415 416 int NX_SUB;417 int NY_SUB;413 float dX; 414 float dY; 415 416 float NX_SUB; 417 float NY_SUB; 418 418 419 419 char *basename; -
branches/eam_branches/ipp-20140717/Ohana/src/libdvo/src/BoundaryTree.c
r36490 r37101 84 84 gfits_scan (headerPHU, "DEC_ORI", "%lf", 1, &tree->DEC_origin); 85 85 gfits_scan (headerPHU, "DEC_OFF", "%lf", 1, &tree->DEC_offset); 86 gfits_scan (headerPHU, "NX_SUB", "% d", 1, &tree->NX_SUB);87 gfits_scan (headerPHU, "NY_SUB", "% d", 1, &tree->NY_SUB);86 gfits_scan (headerPHU, "NX_SUB", "%f", 1, &tree->NX_SUB); 87 gfits_scan (headerPHU, "NY_SUB", "%f", 1, &tree->NY_SUB); 88 88 gfits_scan (headerPHU, "PIXSCALE", "%lf", 1, &tree->dPix); 89 89 … … 111 111 ALLOCATE (tree->Xo, double *, tree->Nzone); 112 112 ALLOCATE (tree->Yo, double *, tree->Nzone); 113 ALLOCATE (tree->dX, int *, tree->Nzone);114 ALLOCATE (tree->dY, int *, tree->Nzone);113 ALLOCATE (tree->dX, float *, tree->Nzone); 114 ALLOCATE (tree->dY, float *, tree->Nzone); 115 115 ALLOCATE (tree->cell, int *, tree->Nzone); 116 116 ALLOCATE (tree->projID, int *, tree->Nzone); … … 121 121 ALLOCATE (tree->Xo[i], double, tree->Nband[i]); 122 122 ALLOCATE (tree->Yo[i], double, tree->Nband[i]); 123 ALLOCATE (tree->dX[i], int, tree->Nband[i]);124 ALLOCATE (tree->dY[i], int, tree->Nband[i]);123 ALLOCATE (tree->dX[i], float, tree->Nband[i]); 124 ALLOCATE (tree->dY[i], float, tree->Nband[i]); 125 125 ALLOCATE (tree->cell[i], int, tree->Nband[i]); 126 126 ALLOCATE (tree->projID[i], int, tree->Nband[i]); … … 147 147 GET_COLUMN_NEW(&headerCell, &ftableCell, Xo, "X_CENT", double); 148 148 GET_COLUMN_NEW(&headerCell, &ftableCell, Yo, "Y_CENT", double); 149 GET_COLUMN_NEW(&headerCell, &ftableCell, dX, "X_GRID", int);150 GET_COLUMN_NEW(&headerCell, &ftableCell, dY, "Y_GRID", int);149 GET_COLUMN_NEW(&headerCell, &ftableCell, dX, "X_GRID", float); 150 GET_COLUMN_NEW(&headerCell, &ftableCell, dY, "Y_GRID", float); 151 151 GET_COLUMN_NEW(&headerCell, &ftableCell, name, "NAME", char); // XXX how is this done? 152 152 gfits_free_header (&headerCell); … … 214 214 gfits_modify (&header, "DEC_OFF", "%lf", 1, tree->DEC_offset); 215 215 216 gfits_modify (&header, "NX_SUB", "% d", 1, tree->NX_SUB);217 gfits_modify (&header, "NY_SUB", "% d", 1, tree->NY_SUB);216 gfits_modify (&header, "NX_SUB", "%f", 1, tree->NX_SUB); 217 gfits_modify (&header, "NY_SUB", "%f", 1, tree->NY_SUB); 218 218 gfits_modify (&header, "PIXSCALE", "%lf", 1, tree->dPix); 219 219 … … 289 289 gfits_define_bintable_column (&theader, "D", "X_CENT", "projection cell center pixel", "none", 1.0, 0.0); 290 290 gfits_define_bintable_column (&theader, "D", "Y_CENT", "projection cell center pixel", "none", 1.0, 0.0); 291 gfits_define_bintable_column (&theader, " J", "X_GRID", "skycell grid spacing", "none", 1.0, 0.0);292 gfits_define_bintable_column (&theader, " J", "Y_GRID", "skycell grid spacing", "none", 1.0, 0.0);291 gfits_define_bintable_column (&theader, "E", "X_GRID", "skycell grid spacing", "none", 1.0, 0.0); 292 gfits_define_bintable_column (&theader, "E", "Y_GRID", "skycell grid spacing", "none", 1.0, 0.0); 293 293 gfits_define_bintable_column (&theader, fmt, "NAME", "cell name", "none", 1.0, 0.0); 294 294 … … 310 310 double *Xo ; ALLOCATE (Xo, double, Ncell); 311 311 double *Yo ; ALLOCATE (Yo, double, Ncell); 312 int *dX ; ALLOCATE (dX, int,Ncell);313 int *dY ; ALLOCATE (dY, int,Ncell);312 float *dX ; ALLOCATE (dX, float, Ncell); 313 float *dY ; ALLOCATE (dY, float, Ncell); 314 314 char *name ; ALLOCATE (name, char, Ncell*BOUNDARY_TREE_NAME_LENGTH); 315 315 -
branches/eam_branches/ipp-20140717/Ohana/src/libdvo/src/TessellationTable.c
r36490 r37101 28 28 tess[i].dPix = NAN; 29 29 30 tess[i].dX = 0;31 tess[i].dY = 0;32 33 tess[i].NX_SUB = 0;34 tess[i].NY_SUB = 0;30 tess[i].dX = NAN; 31 tess[i].dY = NAN; 32 33 tess[i].NX_SUB = NAN; 34 tess[i].NY_SUB = NAN; 35 35 36 36 tess[i].basename = NULL; … … 123 123 GET_COLUMN_NEW(Xo, "X_CENT", double); 124 124 GET_COLUMN_NEW(Yo, "Y_CENT", double); 125 GET_COLUMN_NEW(dX, "X_GRID", int);126 GET_COLUMN_NEW(dY, "Y_GRID", int);125 GET_COLUMN_NEW(dX, "X_GRID", float); 126 GET_COLUMN_NEW(dY, "Y_GRID", float); 127 127 GET_COLUMN_NEW(Rmin, "R_MIN", double); 128 128 GET_COLUMN_NEW(Rmax, "R_MAX", double); … … 130 130 GET_COLUMN_NEW(Dmax, "D_MAX", double); 131 131 GET_COLUMN_NEW(dPix, "SCALE", double); 132 GET_COLUMN_NEW(NX_SUB, "NX_SUB", int);133 GET_COLUMN_NEW(NY_SUB, "NY_SUB", int);132 GET_COLUMN_NEW(NX_SUB, "NX_SUB", float); 133 GET_COLUMN_NEW(NY_SUB, "NY_SUB", float); 134 134 GET_COLUMN_NEW(TYPE, "TYPE", int); 135 135 … … 280 280 gfits_modify (&header, "DEC_OFF", "%lf", 1, rings->DEC_offset); 281 281 282 gfits_modify (&header, "NX_SUB", "% d", 1, rings->NX_SUB);283 gfits_modify (&header, "NY_SUB", "% d", 1, rings->NY_SUB);282 gfits_modify (&header, "NX_SUB", "%f", 1, rings->NX_SUB); 283 gfits_modify (&header, "NY_SUB", "%f", 1, rings->NY_SUB); 284 284 gfits_modify (&header, "PIXSCALE", "%lf", 1, rings->dPix); 285 285 } … … 300 300 gfits_define_bintable_column (&theader, "D", "X_CENT", "projection cell center pixel", "none", 1.0, 0.0); 301 301 gfits_define_bintable_column (&theader, "D", "Y_CENT", "projection cell center pixel", "none", 1.0, 0.0); 302 gfits_define_bintable_column (&theader, " J", "X_GRID", "skycell grid spacing", "none", 1.0, 0.0);303 gfits_define_bintable_column (&theader, " J", "Y_GRID", "skycell grid spacing", "none", 1.0, 0.0);302 gfits_define_bintable_column (&theader, "E", "X_GRID", "skycell grid spacing", "none", 1.0, 0.0); 303 gfits_define_bintable_column (&theader, "E", "Y_GRID", "skycell grid spacing", "none", 1.0, 0.0); 304 304 gfits_define_bintable_column (&theader, "D", "R_MIN", "RA limit (lower)", "none", 1.0, 0.0); 305 305 gfits_define_bintable_column (&theader, "D", "R_MAX", "RA limit (upper)", "none", 1.0, 0.0); … … 307 307 gfits_define_bintable_column (&theader, "D", "D_MAX", "DEC limit (upper)", "none", 1.0, 0.0); 308 308 gfits_define_bintable_column (&theader, "D", "SCALE", "pixel scale for projection cell", "none", 1.0, 0.0); 309 gfits_define_bintable_column (&theader, " J", "NX_SUB", "skycell subdivision in x", "none", 1.0, 0.0);310 gfits_define_bintable_column (&theader, " J", "NY_SUB", "skycell subdivision in y", "none", 1.0, 0.0);309 gfits_define_bintable_column (&theader, "E", "NX_SUB", "skycell subdivision in x", "none", 1.0, 0.0); 310 gfits_define_bintable_column (&theader, "E", "NY_SUB", "skycell subdivision in y", "none", 1.0, 0.0); 311 311 gfits_define_bintable_column (&theader, "J", "TYPE", "type of tessellation", "none", 1.0, 0.0); 312 312 … … 330 330 double *Xo ; ALLOCATE (Xo , double, Nout); 331 331 double *Yo ; ALLOCATE (Yo , double, Nout); 332 int *dX ; ALLOCATE (dX , int,Nout);333 int *dY ; ALLOCATE (dY , int,Nout);332 float *dX ; ALLOCATE (dX , float, Nout); 333 float *dY ; ALLOCATE (dY , float, Nout); 334 334 double *Rmin ; ALLOCATE (Rmin , double, Nout); 335 335 double *Rmax ; ALLOCATE (Rmax , double, Nout); … … 337 337 double *Dmax ; ALLOCATE (Dmax , double, Nout); 338 338 double *dPix ; ALLOCATE (dPix , double, Nout); 339 int *NX_SUB ; ALLOCATE (NX_SUB, int,Nout);340 int *NY_SUB ; ALLOCATE (NY_SUB, int,Nout);339 float *NX_SUB ; ALLOCATE (NX_SUB, float, Nout); 340 float *NY_SUB ; ALLOCATE (NY_SUB, float, Nout); 341 341 int *TYPE ; ALLOCATE (TYPE, int, Nout); 342 342 … … 559 559 int xi = x / tess[myTess].tree->dX[zone][band]; 560 560 int yi = y / tess[myTess].tree->dY[zone][band]; 561 562 xi = MAX(MIN(xi, tess[myTess].NX_SUB - 1.0), 0); 563 yi = MAX(MIN(yi, tess[myTess].NY_SUB - 1.0), 0); 564 561 565 int N = xi + tess[myTess].tree->NX_SUB * yi; 562 566
Note:
See TracChangeset
for help on using the changeset viewer.
