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

    r5320 r5451  
    55int calextract (int argc, char **argv) {
    66 
    7   int i, j, m, N, Nr, Nregions, mode[2];
     7  int i, j, m, N, Nr, mode[2];
    88  int Nsec, NSTAR;
    9   char filename[256], catdir[256], *RegionName, *RegionList;
     9  char *RegionName, *RegionList;
    1010  double M1, M2, dM2, color;
    1111
     12  PhotCode *code[2];
    1213  Catalog catalog;
    13   RegionFile *regions;
    14   PhotCode *code[2];
     14  SkyList *skylist;
    1515  Vector **vec;
    1616
    1717  /* these need to be freed in the end */
    18   regions = NULL;
    1918  catalog.average = NULL;
    2019  catalog.secfilt = NULL;
     
    2726  if (!InitPhotcodes ()) return (FALSE);
    2827  Nsec = GetPhotcodeNsecfilt ();
    29 
    30   /* find CATDIR in config system */
    31   if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape;
    3228
    3329  /* command line arguments */
     
    5955
    6056  /* load region corresponding to selection above */
    61   if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape;
     57  if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape;
    6258
    63   for (Nr = 0; Nr < Nregions; Nr++) {
     59  for (Nr = 0; Nr < skylist[0].Nregions; Nr++) {
    6460    if (Nr && !(Nr % 500)) { fprintf (stderr, "."); }
    6561
    6662    /* lock, load, unlock catalog */
    67     sprintf (filename, "%s/%s", catdir, regions[Nr].name);
    68     catalog.filename = filename;
     63    catalog.filename = (char *) skylist[0].regions[Nr][0].filename;
    6964    switch (lock_catalog (&catalog, LCK_SOFT)) {
    7065    case 2:
     
    127122    catalog.measure = (Measure *) NULL;
    128123  }
    129   if (regions != NULL) free (regions); 
     124
     125  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    130126  for (i = 0; i < NVEC; i++) {
    131127    vec[i][0].Nelements = N;
     
    141137  if (RegionName != NULL) free (RegionName);
    142138  if (RegionList != NULL) free (RegionList);
    143   if (regions != NULL) free (regions); 
     139  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    144140  for (i = 0; i < NVEC; i++) {
    145141    DeleteVector (vec[i]);
Note: See TracChangeset for help on using the changeset viewer.