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

    r5320 r5451  
    33int ccd (int argc, char **argv) {
    44 
    5   char filename[256], catdir[256], *RegionName, *RegionList;
     5  char *RegionName, *RegionList;
    66  double *M1, *M2;
    77  int i, m, k, Npts, NPTS, N;
    88  int N1, N2, i1, i2, mode[4];
    9   int Nsec, Nregions, KeepNulls;
     9  int Nsec, KeepNulls;
    1010
    1111  Catalog catalog;
    12   RegionFile *regions;
    1312  PhotCode *code[4];
     13  SkyList *skylist;
    1414  Vector *xvec, *yvec;
    1515
    1616  /* defaults */
    17   regions = NULL;
    1817  catalog.average = NULL;
    1918  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 */
     
    5147
    5248  /* load region corresponding to selection above */
    53   if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape;
     49  if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape;
    5450
    5551  /* init vectors to save data */
     
    6056
    6157  /* loop over regions, extract data for each region */
    62   for (k = 0; k < Nregions; k++) {
     58  for (k = 0; k < skylist[0].Nregions; k++) {
    6359    /* lock, load, unlock catalog */
    64     sprintf (filename, "%s/%s", catdir, regions[k].name);
    65     catalog.filename = filename;
     60    catalog.filename = (char *) skylist[0].regions[k][0].filename;
    6661    switch (lock_catalog (&catalog, LCK_SOFT)) {
    6762      case 2:
     
    121116    catalog.measure = (Measure *) NULL;
    122117  }
    123   if (regions != NULL) free (regions);
     118  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    124119  xvec[0].Nelements = yvec[0].Nelements = Npts;
    125120  return (TRUE);
     
    130125
    131126escape:
    132   if (regions != NULL) free (regions);
     127  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    133128  if (catalog.average != NULL) free (catalog.average);
    134129  if (catalog.secfilt != NULL) free (catalog.secfilt);
Note: See TracChangeset for help on using the changeset viewer.