IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 17, 2009, 4:19:49 PM (17 years ago)
Author:
eugene
Message:

adding padding to RINGS tessellation; fixed name format for RINGS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/sky_tessalation.c

    r23229 r23914  
    231231int sky_tessellation_rings (FITS_DB *db, int level, int Nmax) {
    232232
    233   int j, nDEC, Nimage, Nring;
     233  int j, nDEC, Nimage, Nring, Ntotal, Ndigit;
    234234  float dec, dDEC;
    235235  SkyRectangle *ring;
    236236  Image *image;
     237  char format[16];
    237238
    238239  // The tessellation has one input parameter: the approximate cell size.  Starting with
     
    246247  nDEC += 2;
    247248
    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);
    250254
    251255  // generate the a collection of rectangles for each ring
    252256  for (dec = -90.0; dec < +90.0 + 0.5*dDEC; dec += dDEC) {
    253257
    254     ring = sky_rectangle_ring (dec, dDEC, &Nring);
     258    ring = sky_rectangle_ring (dec, dDEC, &Nring, format);
    255259    if (!ring) continue;
    256260
     
    534538
    535539// define the parameters of a single sky projection center
    536 SkyRectangle *sky_rectangle_ring (float dec, float dDEC, int *nring) {
    537 
     540SkyRectangle *sky_rectangle_ring (float dec, float dDEC, int *nring, char *format) {
     541
     542  static int Nname = 0;
    538543  int i, NX, NY, nRA;
    539544  SkyRectangle *ring;
     
    631636    strcpy (ring[i].coords.ctype, "DEC--TAN");
    632637
    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);
    635640    ring[i].photcode = 1; // this needs to be set more sensibly
    636641
     642    snprintf (ring[i].name, DVO_IMAGE_NAME_LEN, format, Nname);
     643    Nname++;
    637644
    638645    // fprintf (stderr, "%f %f  : %f %f\n",
Note: See TracChangeset for help on using the changeset viewer.