IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13143


Ignore:
Timestamp:
May 2, 2007, 2:21:43 PM (19 years ago)
Author:
eugene
Message:

skip catalog load for only.images, allow read-only load for calibration, only.images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/addstar.c

    r12732 r13143  
    33int main (int argc, char **argv) {
    44
    5   int Nmatch, status;
     5  int Nmatch, status, loadObjects;
    66  int i, Nstars, Nimages, Nsubset;
    77  unsigned long long Naverage, Nmeasure;
     
    7272  if (VERBOSE) fprintf (stderr, "writing to %d regions\n", skylist[0].Nregions);
    7373
    74   /* XXX clean this up a bit : for only_image, I don't need to do this loop
    75      unless we are getting the calibration. */
    76   /*** match stars to existing catalog data (or otherwise manipulate catalog data) ***/
     74  /* don't load the object tables for only_images, unless we are getting the calibration. */
     75  loadObjects = !options.only_images || options.calibrate;
     76
     77  /* match stars to existing catalog data (or otherwise manipulate catalog data) */
    7778  Nmatch = Naverage = Nmeasure = 0;
    78   for (i = 0; i < skylist[0].Nregions; i++) {
     79  for (i = 0; loadObjects && (i < skylist[0].Nregions); i++) {
    7980
    8081    // set the parameters which guide catalog open/load/create
     
    8687    if (options.update) catalog.catflags = LOAD_AVES | LOAD_MEAS_META | LOAD_MISS | LOAD_SECF;
    8788
    88     // an error exit status here is a significant error
    89     if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) {
    90       fprintf (stderr, "ERROR: failure to open/create catalog file %s\n", catalog.filename);
    91       exit (2);
     89    // open as read or write, depending on desire
     90    if (options.only_images && options.calibrate) {
     91      if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "r")) {
     92        continue;
     93      }
     94    } else {
     95      // an error exit status here is a significant error (disk I/O or file access)
     96      if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) {
     97        fprintf (stderr, "ERROR: failure to open/create catalog file %s\n", catalog.filename);
     98        exit (2);
     99      }
    92100    }
     101
    93102    // Nave_disk == 0 implies an empty catalog file
    94103    // for only_match, skip empty catalogs
Note: See TracChangeset for help on using the changeset viewer.