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

    r5320 r5451  
    33int dmagaves (int argc, char **argv) {
    44 
    5   char filename[256], catdir[256], *RegionName, *RegionList;
     5  char *RegionName, *RegionList;
    66  double *M1, M2;
    77  int i, j, k, m, N1;
    88  int Npts, NPTS, param, mode[3];
    9   int Nsec, Nregions;
     9  int Nsec;
    1010
     11  PhotCode *code[3];
    1112  Catalog catalog;
    12   RegionFile *regions;
    13   PhotCode *code[3];
     13  SkyList *skylist;
    1414  Vector *xvec, *yvec;
    1515
    1616  /* defaults */
    17   regions = NULL;
    1817  catalog.average = NULL;
    1918  catalog.secfilt = NULL;
     
    2625  if (!InitPhotcodes ()) goto escape;
    2726  Nsec = GetPhotcodeNsecfilt ();
    28 
    29   /* find CATDIR in config system */
    30   if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape;
    3127
    3228  /* interpret command-line options */
     
    4440
    4541  /* load region corresponding to selection above */
    46   if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape;
     42  if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape;
    4743
    4844  /* init vectors to save data */
     
    5248  if ((yvec = SelectVector ("yv", ANYVECTOR, TRUE)) == NULL) goto escape;
    5349
    54   for (j = 0; j < Nregions; j++) {
     50  for (j = 0; j < skylist[0].Nregions; j++) {
    5551    /* lock, load, unlock catalog */
    56     sprintf (filename, "%s/%s", catdir, regions[j].name);
    57     catalog.filename = filename;
     52    catalog.filename = (char *) skylist[0].regions[j][0].filename;
    5853    switch (lock_catalog (&catalog, LCK_SOFT)) {
    5954    case 2:
     
    10196    catalog.measure = (Measure *) NULL;
    10297  }
    103   if (regions != NULL) free (regions);
     98  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    10499  xvec[0].Nelements = yvec[0].Nelements = Npts;
    105100  return (TRUE);
     
    110105
    111106escape:
    112   if (regions != NULL) free (regions);
     107  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    113108  if (catalog.average != NULL) free (catalog.average);
    114109  if (catalog.secfilt != NULL) free (catalog.secfilt);
Note: See TracChangeset for help on using the changeset viewer.