fix GSC lookup

This commit is contained in:
Florian Tham
2020-01-24 12:35:39 +01:00
parent facf5c6fbe
commit bd48b7007f
3 changed files with 102 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
--- a/GUI/xephem/gscnet.c 2020-01-24 12:20:10.210100009 +0100
+++ b/GUI/xephem/gscnet.c 2020-01-24 12:20:43.711842644 +0100
@@ -29,7 +29,7 @@
{
#define GSC23MAXFOV degrad(30./60.0) /* max fov */
/* http://gsss.stsci.edu/webservices/vo/ConeSearch.aspx?RA=10.0&DEC=5.0&SR=0.2&FORMAT=CSV */
- static char ifmt[] = "%[^,],%lf,%lf,%*[^,],%*[^,],%*[^,],%*[^,],%lf,%lf,%*[^,],%*[^,],%lf,%lf,%lf,%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%d";
+ static char ifmt[] = "%[^,],%*[^,],%lf,%lf,%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%lf,%*[^,],%*[^,],%lf,%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%lf,%*[^,],%*[^,],%lf,%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%d";
static char gfmt[] = " GET http://%s%s?RA=%g&DEC=%g&SR=%g&FORMAT=CSV HTTP/1.0\r\nUser-Agent: xephem/%s\r\n\r\n";
char host[1024];
char buf[2048];
@@ -80,7 +80,7 @@
while ((n = recvlineb (sockfd, buf, sizeof(buf))) > 0) {
char name[1024];
double radeg, decdeg;
- double fmag, jmag, bmag, vmag, rmag;
+ double fmag, jmag, bmag, vmag;
int class;
Obj *op;
@@ -90,9 +90,9 @@
/* crack */
if (sscanf (buf, ifmt, name, &radeg, &decdeg, &fmag, &jmag, &bmag,
- &vmag, &rmag, &class) != 9)
+ &vmag, &class) != 8)
continue;
- if (fmag>lmag && jmag>lmag && bmag>lmag && vmag>lmag && rmag>lmag)
+ if (fmag>lmag && jmag>lmag && bmag>lmag && vmag>lmag)
continue;
/* good -- grow list */
@@ -120,8 +120,6 @@
set_fmag (op, vmag);
else if (bmag<=lmag)
set_fmag (op, bmag);
- else if (rmag<=lmag)
- set_fmag (op, rmag);
else if (fmag<=lmag)
set_fmag (op, fmag);
else