IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23914


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

Location:
trunk/Ohana/src/addstar
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/include/skycells.h

    r23137 r23914  
    9898int          sky_triangle_coords            PROTO((SkyTriangle *triangle));
    9999
    100 SkyRectangle *sky_rectangle_ring            PROTO((float dec, float dDEC, int *nring));
     100SkyRectangle *sky_rectangle_ring            PROTO((float dec, float dDEC, int *nring, char *format));
    101101
    102102SkyTriangle *sky_divide_triangles           PROTO((SkyTriangle *in, int *ntriangles));
  • trunk/Ohana/src/addstar/src/args_skycells.c

    r23138 r23914  
    182182
    183183  fprintf (stderr, "  -mode (name)                : define the type of tessellation.  available options are:\n");
    184   fprintf (stderr, "     SQUARE                   : generate rectangular skycells using icosahedron base solid (default)\n");
     184  fprintf (stderr, "     SQUARE                   : generate rectangular skycells using base solid (default)\n");
    185185  fprintf (stderr, "     TRIANGLE                 : generate triangular skycells using icosahedron base solid\n");
     186  fprintf (stderr, "     RINGS                    : generate rectangular skycells using declination strips\n");
    186187  fprintf (stderr, "     LOCAL                    : generate a local tessellation around a spot on the sky\n");
    187188  fprintf (stderr, "                                 (Note that this tessellation does not cover the full sky)\n");
    188   fprintf (stderr, "  -solid (name)               : specify the base solid\n");
     189  fprintf (stderr, "  -solid (name)               : specify the base solid (default: ICOSAHEDRON)\n");
    189190  fprintf (stderr, "                                value may be one of: TETRAHEDRON, CUBE, OCTOHEDRON, DODECAHEDRON, ICOSAHEDRON\n");
    190191  fprintf (stderr, "                                for convenience, only the first 4 characters are required\n");
  • 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.