IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 27, 2005, 7:10:17 PM (21 years ago)
Author:
eugene
Message:

working on SkyRegion conversion

File:
1 edited

Legend:

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

    r5320 r5451  
    44 
    55  int i, j, m, N, NPTS, param;
    6   int Nsec, Nregions, mode;
    7   char filename[256], catdir[256], *RegionName, *RegionList, *p;
     6  int Nsec, mode;
     7  char *RegionName, *RegionList, *p;
    88
    99  Catalog catalog;
    10   RegionFile *regions;
     10  SkyList *skylist;
    1111  PhotCode *code;
    1212  Vector *vec;
    1313
    1414  /* defaults */
    15   regions = NULL;
    1615  catalog.average = NULL;
    1716  catalog.secfilt = NULL;
     
    2524  if (!InitPhotcodes ()) goto escape;
    2625  Nsec = GetPhotcodeNsecfilt ();
    27 
    28   /* find CATDIR in config system */
    29   if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape;
    3026
    3127  /* interpret command-line options */
     
    5046
    5147  /* load region corresponding to selection above */
    52   if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape;
     48  if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape;
    5349
    5450  /* create storage vector */
     
    5753  if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) goto escape;
    5854
    59   for (i = 0; i < Nregions; i++) {
     55  for (i = 0; i < skylist[0].Nregions; i++) {
    6056    /* lock, load, unlock catalog */
    61     sprintf (filename, "%s/%s", catdir, regions[i].name);
    62     catalog.filename = filename;
     57    catalog.filename = (char *) skylist[0].regions[i][0].filename;
    6358    switch (lock_catalog (&catalog, LCK_SOFT)) {
    6459    case 2:
     
    9085  REALLOCATE (vec[0].elements, float, MAX(1,N));
    9186
    92   if (regions != NULL) free (regions);
     87  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    9388  return (TRUE);
    9489
     
    9893
    9994escape:
    100   if (regions != NULL) free (regions);
     95  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    10196  if (catalog.average != NULL) free (catalog.average);
    10297  if (catalog.secfilt != NULL) free (catalog.secfilt);
Note: See TracChangeset for help on using the changeset viewer.