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/subpix.c

    r5320 r5448  
    55int subpix (int argc, char **argv) {
    66 
    7   int i, j, I, Nlo, Nhi, Nentry, Nstars, Nregions, Nimage, Nmeasure;
     7  int i, j, I, Nlo, Nhi, Nentry, Nstars, Nimage, Nmeasure;
    88  int *index, *entry;
    99  int Nmin, Nsub, NSUB, status;
     
    1717  Measure *measure;
    1818  Image *image;
    19   RegionFile *regions;
    2019  Catalog catalog;
    2120
     
    3534  Radius = atof (argv[3]);
    3635
     36  /* load sky from correct table */
     37  sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, -1, VERBOSE);
     38  SkyTableSetFilenames (sky, CATDIR, "cpt");
     39
    3740  /* load star nearest position */
    38   regions = find_regions (Ra, Dec, Radius, &Nregions);
    39   if (Nregions > 1) {
     41  skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius);
     42  if (skylist[0].Nregions > 1) {
    4043    fprintf (stderr, "warning, radius overlaps region boundary, not yet implemented\n");
    4144  }
    4245
    4346  /* lock, load, unlock catalog */
    44   sprintf (filename, "%s/%s", catdir, regions[0].name);
    45   catalog.filename = filename;
     47  catalog.filename = skylist[0].regions[0][0].filename;
    4648  switch (lock_catalog (&catalog, LCK_SOFT)) {
    4749  case 2:
     
    9294    if (catalog.average != 0) free (catalog.average);
    9395    if (catalog.measure != 0) free (catalog.measure);
    94     free (regions);
     96    SkyListFree (skylist);
    9597    return (TRUE);
    9698  }
     
    158160  free (image);
    159161  free (index);
    160   free (regions);
     162  SkyListFree (regions);
    161163
    162164  return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.