Changeset 26288
- Timestamp:
- Nov 29, 2009, 3:16:26 PM (16 years ago)
- Location:
- trunk/Ohana/src/getstar
- Files:
-
- 3 edited
-
include/dvoImagesAtCoords.h (modified) (1 diff)
-
src/args_coords.c (modified) (3 diffs)
-
src/dvoImagesAtCoords.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/getstar/include/dvoImagesAtCoords.h
r25208 r26288 27 27 } Point; 28 28 29 char *astromFile; 30 char *coordsFile; 31 double cmd_line_ra; 32 double cmd_line_dec; 33 int fullNames; 29 34 int WITH_PHU; 30 35 int SOLO_PHU; 31 36 int ACCEPT_ASTROM; 32 char *astromFile;33 37 34 // These functions belong to dvoImage Overap38 // These functions belong to dvoImagesAtCoords 35 39 int args_coords PROTO((int argc, char **argv)); 36 40 int ConfigInit_coords PROTO((int *argc, char **argv)); -
trunk/Ohana/src/getstar/src/args_coords.c
r24914 r26288 3 3 void help () { 4 4 fprintf (stderr, "USAGE: \n" 5 "dvoImagesAtCoords [-astrom astrom_file] (coords_file)\n" 5 "dvoImagesAtCoords [-astrom astrom_file] -coords coords_file\n" 6 "dvoImagesAtCoords [-astrom astrom_file] (ra) (dec))\n" 6 7 ); 7 8 exit (2); … … 18 19 } 19 20 21 coordsFile = NULL; 22 if ((N = get_argument(argc, argv, "-coords"))) { 23 remove_argument (N, &argc, argv); 24 if (argv[N] == NULL) { 25 fprintf (stderr, "ERROR: no file provided with -coords\n"); 26 exit (1); 27 } 28 coordsFile = strdup(argv[N]); 29 remove_argument (N, &argc, argv); 30 } 20 31 astromFile = NULL; 21 32 if ((N = get_argument(argc, argv, "-astrom"))) { … … 81 92 } 82 93 83 if (argc != 2) help(); 94 fullNames = 0; 95 if ((N = get_argument(argc, argv, "-full-names"))) { 96 remove_argument (N, &argc, argv); 97 fullNames = 1; 98 } 99 100 if (coordsFile) { 101 if (argc != 1) help(); 102 } else { 103 // expect RA and DEC on command line 104 if (argc != 3) help(); 105 106 cmd_line_ra = atof(argv[1]); 107 cmd_line_dec = atof(argv[2]); 108 } 84 109 85 110 return (TRUE); -
trunk/Ohana/src/getstar/src/dvoImagesAtCoords.c
r25707 r26288 7 7 8 8 static int readPoints(char *filename, Point **pointsOut); 9 static int makePoint(double ra, double dec, Point **pointsOut); 9 10 static int ListImagesAtCoords (Image *dbImages, Point *points, int Npoints); 10 11 … … 22 23 23 24 Point *points; 24 Npoints = readPoints(argv[1], &points); 25 if (coordsFile) { 26 Npoints = readPoints(coordsFile, &points); 27 } else { 28 Npoints = makePoint(cmd_line_ra, cmd_line_dec, &points); 29 } 25 30 if (!Npoints) { 26 31 exit(1); … … 100 105 } 101 106 107 static int makePoint(double ra, double dec, Point **pointsOut) 108 { 109 Point *pts; 110 ALLOCATE(pts, Point, 1); 111 112 pts[0].id = 1; 113 pts[0].ra = ra; 114 pts[0].dec = dec; 115 pts[0].Nmatches = 0; 116 ALLOCATE(pts[0].matches, int, 20); 117 pts[0].arrayLength = 20; 118 119 *pointsOut = pts; 120 121 return 1; 122 } 123 102 124 static int ListImagesAtCoords (Image *dbImages, Point *points, int Npoints) 103 125 { … … 113 135 // output of lookup is filename[class_id.hdr] for astrometry files 114 136 char *left_bracket = rindex(dbImages[N].name, '['); 115 if ( left_bracket) {137 if (!fullNames && left_bracket) { 116 138 copy = strdup(left_bracket + 1); 117 139 name = copy;
Note:
See TracChangeset
for help on using the changeset viewer.
