Changeset 23914 for trunk/Ohana/src/addstar/src/sky_tessalation.c
- Timestamp:
- Apr 17, 2009, 4:19:49 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/addstar/src/sky_tessalation.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/sky_tessalation.c
r23229 r23914 231 231 int sky_tessellation_rings (FITS_DB *db, int level, int Nmax) { 232 232 233 int j, nDEC, Nimage, Nring ;233 int j, nDEC, Nimage, Nring, Ntotal, Ndigit; 234 234 float dec, dDEC; 235 235 SkyRectangle *ring; 236 236 Image *image; 237 char format[16]; 237 238 238 239 // The tessellation has one input parameter: the approximate cell size. Starting with … … 246 247 nDEC += 2; 247 248 248 // a test 249 // for (dec = 0.0 + 0.5*dDEC; dec < +90.0; dec += dDEC) { 249 // how many total projection cells for this realization? divide sky area by cell area: 250 // this is used to set the number of digits, so it does not need to be very accurate... 251 Ntotal = 41254.2 / (dDEC*dDEC); 252 Ndigit = (int)(log10(Ntotal)) + 1 ; 253 snprintf (format, 16, "skycell.%%0%dd", Ndigit); 250 254 251 255 // generate the a collection of rectangles for each ring 252 256 for (dec = -90.0; dec < +90.0 + 0.5*dDEC; dec += dDEC) { 253 257 254 ring = sky_rectangle_ring (dec, dDEC, &Nring );258 ring = sky_rectangle_ring (dec, dDEC, &Nring, format); 255 259 if (!ring) continue; 256 260 … … 534 538 535 539 // define the parameters of a single sky projection center 536 SkyRectangle *sky_rectangle_ring (float dec, float dDEC, int *nring) { 537 540 SkyRectangle *sky_rectangle_ring (float dec, float dDEC, int *nring, char *format) { 541 542 static int Nname = 0; 538 543 int i, NX, NY, nRA; 539 544 SkyRectangle *ring; … … 631 636 strcpy (ring[i].coords.ctype, "DEC--TAN"); 632 637 633 ring[i].NX = NX ;634 ring[i].NY = NY ;638 ring[i].NX = NX*(1.0 + PADDING); 639 ring[i].NY = NY*(1.0 + PADDING); 635 640 ring[i].photcode = 1; // this needs to be set more sensibly 636 641 642 snprintf (ring[i].name, DVO_IMAGE_NAME_LEN, format, Nname); 643 Nname++; 637 644 638 645 // fprintf (stderr, "%f %f : %f %f\n",
Note:
See TracChangeset
for help on using the changeset viewer.
