IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 27, 2005, 10:38:30 AM (21 years ago)
Author:
eugene
Message:

implementing SkyRegions in all DVO programs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/gcat.c

    r3462 r5448  
    33int gcat (int argc, char **argv) {
    44 
    5   int i, Nregions;
    6   RegionFile *regions;
    7   char filename[128];
     5  int i;
    86  struct stat filestat;
    97  double Ra, Dec, Radius;
     8  SkyTable *sky;
     9  SkyList *skylist;
    1010  char catdir[256];
    1111
     
    1717  }
    1818
     19  /* load sky from correct table */
     20  sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, -1, VERBOSE);
     21  SkyTableSetFilenames (sky, CATDIR, "cpt");
     22
    1923  Ra = atof (argv[1]);
    2024  Dec = atof (argv[2]);
     
    2428    Radius = 0.0001;
    2529
    26   regions = find_regions (Ra, Dec, Radius, &Nregions);
     30  skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius);
    2731
    28   for (i = 0; i < Nregions; i++) {
    29     sprintf (filename, "%s/%s", catdir, regions[i].name);
    30     if (stat (filename, &filestat) != -1) {
     32  for (i = 0; i < skylist[0].Nregions; i++) {
     33    if (stat (skylist[0].regions[i][0].filename, &filestat) != -1) {
    3134      fprintf (stderr, "%3d %s *\n", i, regions[i].name);
    3235    } else {
     
    3740
    3841  return (TRUE);
    39   free (regions);
    40 
     42  SkyListFree (regions);
    4143}
    42 
Note: See TracChangeset for help on using the changeset viewer.