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

    r5320 r5451  
    77 
    88  int i, j, k, m, N, N1, Nr, mode[2];
    9   int NSTAR, Nstar, Nsec, Nregions;
    10   char filename[256], catdir[256], *RegionName, *RegionList;
     9  int NSTAR, Nstar, Nsec;
     10  char *RegionName, *RegionList;
    1111  double *M1, M2, dM2, color;
    1212
    1313  Catalog catalog;
    14   RegionFile *regions;
    1514  PhotCode *code[2];
     15  SkyList *skylist;
    1616  Vector **vec;
    1717
    1818  /* these need to be freed in the end */
    19   regions = NULL;
    2019  catalog.average = NULL;
    2120  catalog.secfilt = NULL;
     
    2827  if (!InitPhotcodes ()) goto escape;
    2928  Nsec = GetPhotcodeNsecfilt ();
    30 
    31   /* find CATDIR in config system */
    32   if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape;
    3329
    3430  /* command line arguments */
     
    7167
    7268  /* load region corresponding to selection above */
    73   if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape;
    74   if (!SetImageSelection (MEAS_XMOSAIC)) goto escape;
     69  if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape;
     70  if (!SetImageSelection (MEAS_XMOSAIC, ((RegionName == NULL) && (RegionList == NULL)))) goto escape;
    7571
    76   for (Nr = 0; Nr < Nregions; Nr++) {
     72  for (Nr = 0; Nr < skylist[0].Nregions; Nr++) {
    7773    if (Nr && !(Nr % 500)) { fprintf (stderr, "."); }
    7874
    7975    /* lock, load, unlock catalog */
    80     sprintf (filename, "%s/%s", catdir, regions[Nr].name);
    81     catalog.filename = filename;
     76    catalog.filename = (char *) skylist[0].regions[Nr][0].filename;
    8277    switch (lock_catalog (&catalog, LCK_SOFT)) {
    8378    case 2:
     
    153148    catalog.measure = (Measure *) NULL;
    154149  }
    155   if (regions != NULL) free (regions); 
     150
     151  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    156152  for (i = 0; i < NVEC; i++) {
    157153    vec[i][0].Nelements = N;
     
    167163 
    168164  FreeImageSelection ();
    169   if (regions != NULL) free (regions); 
     165  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    170166  for (i = 0; i < NVEC; i++) {
    171167    DeleteVector (vec[i]);
Note: See TracChangeset for help on using the changeset viewer.