Changeset 36073
- Timestamp:
- Aug 30, 2013, 4:52:59 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130711/Ohana
- Files:
-
- 9 edited
-
. (modified) (1 prop)
-
src/dvomerge (modified) (1 prop)
-
src/getstar/src/dvoImagesAtCoords.c (modified) (3 diffs)
-
src/libdvo/src/HostTable.c (modified) (2 diffs)
-
src/libohana/src (modified) (1 prop)
-
src/opihi (modified) (1 prop)
-
src/opihi/cmd.astro (modified) (1 prop)
-
src/opihi/cmd.data (modified) (1 prop)
-
src/relastro/src (modified) (1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130711/Ohana
- Property svn:mergeinfo changed
/trunk/Ohana merged: 35848,36057
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20130711/Ohana/src/dvomerge
- Property svn:mergeinfo changed
/trunk/Ohana/src/dvomerge (added) merged: 35818
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20130711/Ohana/src/getstar/src/dvoImagesAtCoords.c
r33658 r36073 9 9 static int makePoint(double ra, double dec, Point **pointsOut); 10 10 static int ListImagesAtCoords (Image *dbImages, Point *points, int Npoints); 11 static int readPointFromFile(FILE *f, Point *pt); 11 12 12 13 int main (int argc, char **argv) { … … 23 24 24 25 Point *points; 26 int readStdin = 0; 25 27 if (coordsFile) { 26 Npoints = readPoints(coordsFile, &points); 28 if (strcmp(coordsFile, "-") == 0) { 29 readStdin = 1; 30 } else { 31 Npoints = readPoints(coordsFile, &points); 32 } 27 33 } else { 28 34 Npoints = makePoint(cmd_line_ra, cmd_line_dec, &points); 29 35 } 30 if (!Npoints ) {36 if (!Npoints && !readStdin) { 31 37 exit(1); 32 38 } … … 61 67 } 62 68 63 if (MatchCoords (dbImages, NdbImages, points, Npoints)) { 64 ListImagesAtCoords(dbImages, points, Npoints); 65 exit(0); 69 if (readStdin) { 70 Point pt; 71 memset(&pt, 0, sizeof(pt)); 72 pt.Nmatches = 0; 73 ALLOCATE(pt.matches, Match, 20); 74 pt.arrayLength = 20; 75 76 int status; 77 while ((status = readPointFromFile(stdin, &pt))) { 78 if (status < 0) { 79 fprintf(stdout, "ERROR malformed input line\n"); 80 exit(1); 81 } 82 if (MatchCoords (dbImages, NdbImages, &pt, 1)) { 83 ListImagesAtCoords(dbImages, &pt, 1); 84 } 85 fprintf(stdout, "DONE\n"); 86 fflush(stdout); 87 pt.Nmatches = 0; 88 } 66 89 } else { 67 exit(PSTAMP_NO_OVERLAP); 68 } 90 if (MatchCoords (dbImages, NdbImages, points, Npoints)) { 91 ListImagesAtCoords(dbImages, points, Npoints); 92 } else { 93 exit(PSTAMP_NO_OVERLAP); 94 } 95 } 96 exit(0); 97 } 98 99 static int readPointFromFile(FILE *f, Point *pt) { 100 char buf[80]; 101 char *good = fgets(buf, 80, f); 102 if (!good) { 103 return 0; 104 } 105 // fprintf(stderr, "READ: %s\n", buf); 106 int Nread = sscanf(buf, "%d %lf %lf\n", &pt->id, &pt->ra, &pt->dec); 107 if (Nread == 3) { 108 // got one 109 return 1; 110 } else if (Nread == -1) { 111 // all done time to go 112 return 0; 113 } else { 114 // fprintf(stderr, "malformed input line: %d\n", Nread); 115 return -1; 116 } 69 117 } 70 118 -
branches/eam_branches/ipp-20130711/Ohana/src/libdvo/src/HostTable.c
r35102 r36073 86 86 FreeHosts (hosts, Nhosts); 87 87 free (filename); 88 fclose (f); 88 89 return NULL; 89 90 } … … 133 134 134 135 free (filename); 136 fclose (f); 135 137 return table; 136 138 } -
branches/eam_branches/ipp-20130711/Ohana/src/libohana/src
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20130711/Ohana/src/opihi
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20130711/Ohana/src/opihi/cmd.astro
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20130711/Ohana/src/opihi/cmd.data
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20130711/Ohana/src/relastro/src
- Property svn:mergeinfo changed (with no actual effect on merging)
Note:
See TracChangeset
for help on using the changeset viewer.
