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

    r5448 r5451  
    44 
    55  int i, j, k, I;
    6   int Nimage, N, NPTS, skip, mode, TimeSelect;
    7   int n, Nregion, Ntregion, TimeFormat;
     6  int Nimage, N, NPTS, found, mode, TimeSelect;
     7  int n, Nregions, NREGIONS, TimeFormat;
    88  int *subset, Nsubset;
    9   char filename[256];
    109  double trange;
    1110  unsigned long tzero, start, stop, TimeReference;
     
    8180
    8281  /* load sky from correct table */
    83   sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, -1, VERBOSE);
    84   SkyTableSetFilenames (sky, CATDIR, "cpt");
     82  sky = GetSkyTable ();
    8583
    8684  Nregions = 0;
    8785  NREGIONS = 10;
    8886  ALLOCATE (skylist, SkyList, 1);
    89   ALLOCATE (skylist[0].regions, SkyRegions *, NREGIONS);
     87  ALLOCATE (skylist[0].regions, SkyRegion *, NREGIONS);
    9088
    9189  /* for each image of interest, find the appropriate region files */
     
    9492
    9593    if (!FindMosaicForImage (image, Nimage, I)) continue;
    96     skyset = SkyListByImage (table, -1, &image[I]);
     94    skyset = SkyListByImage (sky, -1, &image[I]);
    9795
    9896    for (j = 0; j < skyset[0].Nregions; j++) {
    9997      found = FALSE;
    100       for (k = 0; (k < skylist[0].Nregion) && !found; k++) {
    101         found = !strcmp (skylist[0].regions[k].name, skyset[0].regions[j].name);
     98      for (k = 0; (k < skylist[0].Nregions) && !found; k++) {
     99        found = !strcmp (skylist[0].regions[k][0].name, skyset[0].regions[j][0].name);
    102100      }
    103101      if (found) continue;
    104102      skylist[0].regions[Nregions] = skyset[0].regions[j];
    105103      Nregions ++;
    106       CHECK_REALLOCATE (skylist[0].regions, SkyRegions *, NREGIONS, Nregions, 10);
    107     }
    108     SkyListFree (skyset);
     104      CHECK_REALLOCATE (skylist[0].regions, SkyRegion *, NREGIONS, Nregions, 10);
     105    }
     106    SkyListFree (skyset, FALSE);
    109107  }     
    110108  free (subset);
     
    122120
    123121    /* get file name and open */
    124     catalog.filename = skylist[0].regions[j][0].filename;
     122    catalog.filename = (char *) skylist[0].regions[j][0].filename;
    125123    switch (lock_catalog (&catalog, LCK_SOFT)) {
    126124    case 2:
Note: See TracChangeset for help on using the changeset viewer.