Changeset 6812
- Timestamp:
- Apr 7, 2006, 8:41:21 AM (20 years ago)
- Location:
- trunk/Ohana/src/getstar
- Files:
-
- 5 added
- 2 edited
-
include/getstar.h (modified) (2 diffs)
-
src/Shutdown.c (added)
-
src/getstar.c (modified) (4 diffs)
-
src/mkcatalog.c (added)
-
src/select_by_image.c (added)
-
src/select_by_region.c (added)
-
src/wcatalog.c (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/getstar/include/getstar.h
r6239 r6812 12 12 }; 13 13 14 # if (0) 14 15 typedef struct { 15 16 double X; … … 24 25 int found; 25 26 } Stars; 27 # endif 26 28 27 29 /* global variables set in parameter file */ -
trunk/Ohana/src/getstar/src/getstar.c
r6239 r6812 12 12 set_db (&db); 13 13 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 14 20 Nstars = 0; 15 21 stars = NULL; … … 20 26 case BY_RADIUS: 21 27 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, ®ION); 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); 25 34 26 skylist = SkyListByPatch (sky, -1, ®ION); 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, ®ION, 0, 0); 38 } 39 break; 29 40 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); 30 48 for (i = 0; i < skylist[0].Nregions; i++) { 31 32 49 catalog.filename = skylist[0].filename[i]; 33 50 load_pt_catalog (&catalog, skylist[0].regions[i]); … … 36 53 /* skip empty catalogs */ 37 54 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 41 58 break; 42 59 … … 45 62 break; 46 63 47 case BY_IMAGE: 48 49 break; 50 51 case BY_IMLIST: 52 64 /* not implemented */ 53 65 break; 54 66 } 55 67 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 86 68 /* write out the selected stars */ 87 clean_stars (stars, &Nstars, image); 88 wstars (argv[2], stars, Nstars, image); 69 wcatalog (argv[2], output); 89 70 fprintf (stderr, "SUCCESS\n"); 90 71 exit (0);
Note:
See TracChangeset
for help on using the changeset viewer.
