IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6812


Ignore:
Timestamp:
Apr 7, 2006, 8:41:21 AM (20 years ago)
Author:
eugene
Message:

updating getstar dvo interactions

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

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/getstar/include/getstar.h

    r6239 r6812  
    1212};
    1313
     14# if (0)
    1415typedef struct {
    1516  double X;
     
    2425  int found;
    2526} Stars;
     27# endif
    2628
    2729/* global variables set in parameter file */
  • trunk/Ohana/src/getstar/src/getstar.c

    r6239 r6812  
    1212  set_db (&db);
    1313
     14  sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, SKY_DEPTH, VERBOSE);
     15  SkyTableSetFilenames (sky, CATDIR, "cpt");
     16
     17  /* choose elements to load based on options */
     18  catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
     19
    1420  Nstars = 0;
    1521  stars = NULL;
     
    2026    case BY_RADIUS:
    2127
    22       /* load corresponding sky regions, associated images */
    23       status = dvo_image_lock (&db, ImageCat, 60.0, LCK_SOFT);
    24       if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename);
     28      /* load corresponding sky regions */
     29      skylist = SkyListByPatch (sky, -1, &REGION);
     30      for (i = 0; i < skylist[0].Nregions; i++) {
     31        catalog.filename = skylist[0].filename[i];
     32        load_pt_catalog (&catalog, skylist[0].regions[i]);
     33        unlock_catalog (&catalog);
    2534
    26       skylist = SkyListByPatch (sky, -1, &REGION);
    27       overlap = gimages (&db, &image, MOSAIC, &Noverlap);
    28       dvo_image_unlock (&db);
     35        /* skip empty catalogs */
     36        if (catalog.Nave_disk == 0) continue;
     37        select_by_region (&output, &catalog, &REGION, 0, 0);
     38      }
     39      break;
    2940
     41    case BY_IMLIST:
     42      /* load image list */
     43    case BY_IMAGE:
     44
     45      # if (0)
     46      /* load corresponding sky regions */
     47      skylist = SkyListByImage (sky, -1, &image);
    3048      for (i = 0; i < skylist[0].Nregions; i++) {
    31          
    3249          catalog.filename = skylist[0].filename[i];
    3350          load_pt_catalog (&catalog, skylist[0].regions[i]);
     
    3653          /* skip empty catalogs */
    3754          if (catalog.Nave_disk == 0) continue;
    38 
    39           stars = find_matches (&catalog, &image, 0, 0, stars, &Nstars);
    40 
     55          stars = select_by_image (&catalog, &image, 0, 0, stars, &Nstars);
     56      }
     57      # endif
    4158      break;
    4259
     
    4562      break;
    4663
    47     case BY_IMAGE:
    48 
    49       break;
    50 
    51     case BY_IMLIST:
    52 
     64      /* not implemented */
    5365      break;
    5466  }
    5567
    56   image = gimages (argv[1]);
    57 
    58   region = gregions (&image[0], &Nregions);
    59 
    60   stars = (Stars *) NULL;
    61   Nstars = 0;
    62 
    63   for (i = 0; i < Nregions; i++) {
    64     if (VERBOSE) fprintf (stderr, "extracting from %s\n", region[i].filename);
    65     catalog.filename = region[i].filename;  /* don't free region before catalog! */
    66     switch (lock_catalog (&catalog, LCK_SOFT)) {
    67     case 0:
    68       fprintf (stderr, "ERROR: can't lock file\n");
    69       exit (1);
    70     case 1:
    71       gcatalog (&catalog);
    72       break;
    73     case 2:
    74       fprintf (stderr, "no data in %s, skipping\n", catalog.filename);
    75       catalog.Naverage = 0;
    76       catalog.Nmeasure = 0;
    77       break;
    78     default:
    79       fprintf (stderr, "weird lock_catalog exit state\n");
    80       exit (1);
    81     }
    82     unlock_catalog (&catalog);
    83     stars = find_matches (&catalog, &image[0], 0, 0, stars, &Nstars);
    84   }
    85 
    8668  /* write out the selected stars */
    87   clean_stars (stars, &Nstars, image);
    88   wstars (argv[2], stars, Nstars, image);
     69  wcatalog (argv[2], output);
    8970  fprintf (stderr, "SUCCESS\n");
    9071  exit (0);
Note: See TracChangeset for help on using the changeset viewer.