IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8392


Ignore:
Timestamp:
Aug 16, 2006, 2:30:23 PM (20 years ago)
Author:
eugene
Message:

update to new DVO APIs

Location:
trunk/Ohana/src/getstar
Files:
5 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/getstar/Makefile

    r6968 r8392  
    2424$(SRC)/Shutdown.$(ARCH).o        \
    2525$(SRC)/SetSignals.$(ARCH).o      \
    26 $(SRC)/gcatalog.$(ARCH).o        \
    27 $(SRC)/load_pt_catalog.$(ARCH).o \
    28 $(SRC)/select_by_region.$(ARCH).o \
    29 $(SRC)/wcatalog.$(ARCH).o        \
    30 $(SRC)/init_catalog.$(ARCH).o    \
    31 $(SRC)/mkcatalog.$(ARCH).o
     26$(SRC)/select_by_region.$(ARCH).o
    3227
    3328OBJ = $(GETSTAR)
  • trunk/Ohana/src/getstar/src/getstar.c

    r6968 r8392  
    1616  SkyTableSetFilenames (sky, CATDIR, "cpt");
    1717
    18   /* choose elements to load based on options */
    19   catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
    20   init_catalog (&output);
     18  // create an output catalog with the desired name and format options
     19  output.filename  = OUTPUT;
     20  output.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
     21  output.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
     22  output.Nsecfilt  = GetPhotcodeNsecfilt ();
     23  dvo_catalog_open (&output, NULL, VERBOSE, "w");
    2124
    2225  switch (MODE) {
     
    2831      skylist = SkyListByPatch (sky, -1, &REGION);
    2932      for (i = 0; i < skylist[0].Nregions; i++) {
     33        // set the parameters which guide catalog open/load/create
    3034        catalog.filename = skylist[0].filename[i];
    31         load_pt_catalog (&catalog, skylist[0].regions[i]);
    32         unlock_catalog (&catalog);
     35        catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
     36        catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
     37
     38        // an error exit status here is a significant error
     39        if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "r")) {
     40          fprintf (stderr, "ERROR: failure to open/create catalog file %s\n", catalog.filename);
     41          exit (2);
     42        }
     43        if (!catalog.Nave_disk) {
     44          dvo_catalog_unlock (&catalog);
     45          dvo_catalog_free (&catalog);
     46          continue;
     47        }
     48        dvo_catalog_unlock (&catalog);
    3349
    3450        /* skip empty catalogs */
    35         if (catalog.Nave_disk == 0) continue;
    3651        select_by_region (&output, &catalog, &REGION, 0, 0);
    3752      }
     
    4661      skylist = SkyListByImage (sky, -1, &image, &Nimage);
    4762      for (i = 0; i < skylist[0].Nregions; i++) {
    48           catalog.filename = skylist[0].filename[i];
    49           load_pt_catalog (&catalog, skylist[0].regions[i]);
    50           unlock_catalog (&catalog);
     63        // set the parameters which guide catalog open/load/create
     64        catalog.filename = skylist[0].filename[i];
     65        catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
     66        catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
    5167
    52           /* skip empty catalogs */
    53           if (catalog.Nave_disk == 0) continue;
    54           stars = select_by_image (&catalog, &image, 0, 0, stars, &Nstars);
     68        // an error exit status here is a significant error
     69        if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "r")) {
     70          fprintf (stderr, "ERROR: failure to open/create catalog file %s\n", catalog.filename);
     71          exit (2);
     72        }
     73        /* skip empty catalogs */
     74        if (!catalog.Nave_disk) continue;
     75        stars = select_by_image (&catalog, &image, 0, 0, stars, &Nstars);
    5576      }
    5677      # endif
     
    7091
    7192  /* write out the selected stars */
    72   wcatalog (OUTPUT, &output);
     93  // XXX need to set the catalog boundaries by hand? RA0-RA1, DEC0-DEC1
     94  dvo_catalog_save (&output, VERBOSE);
     95  dvo_catalog_unlock (&output);
     96  dvo_catalog_free (&output);
    7397  fprintf (stderr, "SUCCESS\n");
    7498  exit (0);
    75 
    7699}
Note: See TracChangeset for help on using the changeset viewer.