Package: scamp
Version: 2.0.4-2+b1
Severity: normal
Tags: patch
Dear Maintainer,
1. how to reproduce this bug
a) Find a FITS file and rename it to img.fits .
I use a image [1] of M31 from NED in this demonstration.
b) Run SExtractor:
$ sextractor -d > default.sex
$ echo -e "XWIN_IMAGE\nYWIN_IMAGE\nERRAWIN_IMAGE\nERRBWIN_IMAGE" >
scamp.param
$ echo -e "ERRTHETAWIN_IMAGE\nFLUX_AUTO\nFLUXERR_AUTO\nFLAGS" >> scamp.param
$ echo -e "FLAGS_WEIGHT\nFLUX_RADIUS" >> scamp.param
$ cp /usr/share/sextractor/default.conv .
$ sextractor -c default.sex -CATALOG_NAME img.cat \
-PARAMETERS_NAME scamp.param -CATALOG_TYPE FITS_LDAC img.fits
c) Run SCAMP:
$ scamp -d > scamp.conf
$ scamp -c scamp.conf -ASTREF_CATALOG GSC-2.3 -SAVE_REFCATALOG Y \
-CHECKPLOT_DEV NULL -WRITE_XML N img.cat
SCAMP can be killed when it has downloaded a reference catalog and start
astrometric matching.
d) Use ldactoasc to view the reference catalog:
$ ldactoasc GSC-2.3*.cat
The ra is from 168.25 to 168.70, and the dec is from -0.25 to 0.25, while
the expected ra should be about 10.5 and the expected dec should be about 41.
2. which types of reference catalogs are affected
A quick test shows GSC-2.2, GSC-2.3, NOMAD-1.0, PPMX, UCAC-2, USNO-A1.0,
USNO-A2.0 are affected. The queried catalogs of these types are all centered
on (ra~168.5, dec~0), expect for PPMX which is centered on (ra=0, dec=0).
Catalogs of 2MASS, CMC-14, GSC-1.3, TYCHO-2 don't have this problem.
Other catalogs like SDSS-R*, UCAC-3, UCAC-4 can not be downloaded.
3. patch
After apply the attached patch, catalogs of 2MASS, CMC-14, GSC-1.3, GSC-2.2,
GSC-2.3, NOMAD-1.0, PPMX, SDSS-R8, SDSS-R9, TYCHO-2, UCAC-2, UCAC-3,
UCAC-4, USNO-A1.0, USNO-A2.0, USNO-B1.0 can be downloaded and all have
right sky zone.
Other catalog can not be downloaded which may due to they do not cover M31.
Though I did not examine it.
In the attched patch, the comma "," between ra and dec in the cmdline for
curl is removed, and "%2b"(URL encoding for "+") is added when dec is large
than 0. When catalog servers process the URL, a string ra%2bdec will converted
to ra+dec. This may be the reason why the patch works.
Please consider further examining this bug.
Regards,
Jun MO
[1]
https://ned.ipac.caltech.edu/img/1997UITVi.U..K....C/MESSIER_031:I:V:c1997:ne.v3x300s.fits.gz
-- System Information:
Debian Release: stretch/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.6.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages scamp depends on:
ii curl 7.47.0-1
ii libatlas3-base 3.10.2-9+b1
ii libc6 2.23-4
ii libcsiro0 5.10.0+dfsg2-0.2
ii libfftw3-single3 3.3.4-2+b1
ii libltdl7 2.4.6-1
ii libplplot12 5.10.0+dfsg2-0.2
ii libqhull7 2015.2-1
ii libqsastime0 5.10.0+dfsg2-0.2
ii libshp2 1.3.0-8
scamp recommends no packages.
scamp suggests no packages.
-- debconf-show failed
diff -Nru scamp-2.0.4/debian/patches/aclient.patch scamp-2.0.4/debian/patches/aclient.patch
--- scamp-2.0.4/debian/patches/aclient.patch 2015-05-28 15:14:03.000000000 +0800
+++ scamp-2.0.4/debian/patches/aclient.patch 2016-07-28 11:56:09.000000000 +0800
@@ -57,7 +57,7 @@
/* If these are not angular coordinates, file mode becomes mandatory */
if (lng == lat && refcat!=ASTREFCAT_FILE)
-@@ -223,13 +223,13 @@
+@@ -223,17 +223,17 @@
/* Prepare mag limit section of the command line */
if (prefs.astref_maglim[0]>-99.0 || prefs.astref_maglim[1]<99.0)
@@ -70,8 +70,13 @@
- sprintf(cmdline, "%s %s%s %s -c %f12%+f12 -r %16g %s",
- prefs.cdsclient_path,
-+ sprintf(cmdline, "%s \"http://%s%s/viz-bin/aserver.cgi?%s&-c&%f,%f&-r&%g&%s\"",
++ sprintf(cmdline, "%s \"http://%s%s/viz-bin/aserver.cgi?%s&-c&%f%s%f&-r&%g&%s\"",
+ "curl",
prefs.ref_server[0],
sport,
astrefcat[(int)refcat].cdsname,
+- wcspos[lng], wcspos[lat],
++ wcspos[lng], wcspos[lat] > 0 ? "%2b" : "", wcspos[lat],
+ maxradius*DEG/ARCMIN,
+ maglimcmd);
+
Author: Ole Streicher <[email protected]>
Description: Replace aclient_cgi call by wget
aclient_cgi is a script file that is distributed with cdsclient, which
is not packaged for Debian.
--- a/configure.ac
+++ b/configure.ac
@@ -163,11 +163,6 @@
[AS_HELP_STRING([--with-mkl-dir=<MKL path>],
[Provide an alternative path to the MKL library])])
-# Provide a special option for CDSClient
-AC_ARG_WITH(cdsclient-dir,
- [AS_HELP_STRING([--with-cdsclient-dir=<aclient execution path>],
- [Alternative default to the aclient execution path])])
-
# Provide a special option for the default XSLT URL
with_xsl_url="file://"$(URBI_RESOLVE_DIR([$datadir]))"/$PACKAGE_NAME/$PACKAGE_NAME.xsl"
AC_ARG_WITH(xsl_url,
@@ -263,18 +258,6 @@
################# handle the CDSclient package (CDS queries) #################
-ACX_CDSCLIENT($with_cdsclient_dir,
- if test "$with_cdsclient_dir" = ""; then
- cdsclient="aclient_cgi"
- else
- cdsclient="$with_cdsclient_dir/aclient_cgi"
- fi,
- AC_MSG_ERROR([$cdsclient not found. exiting.]
- ["aclient_cgi" from the CDSclient package is required to use SCAMP:]
- [1. Install the CDSclient package: http://cdsweb.u-strasbg.fr/doc/cdsclient.html]
- [2. Use the --with-cdsclient-dir=<aclient_path> configure option
- if aclient_cgi is not in your execution PATH.]))
-AC_DEFINE_UNQUOTED(CDSCLIENT, "$cdsclient", [CDSclient executable])
# Compile with profiling option
if test "$enable_profiling" = "yes"; then
--- a/src/preflist.h
+++ b/src/preflist.h
@@ -225,7 +225,7 @@
" ",
"REF_SERVER cocat1.u-strasbg.fr # Internet addresses of catalog servers",
"*REF_PORT 80 # Ports to connect to catalog servers",
-"*CDSCLIENT_EXEC " CDSCLIENT " # CDSclient executable",
+"*CDSCLIENT_EXEC curl # CDSclient executable",
"ASTREF_CATALOG 2MASS # NONE, FILE, USNO-A1,USNO-A2,USNO-B1,",
" # GSC-1.3,GSC-2.2,GSC-2.3,",
" # TYCHO-2, UCAC-1,UCAC-2,UCAC-3,UCAC-4,",
--- a/src/astrefcat.c
+++ b/src/astrefcat.c
@@ -156,7 +156,7 @@
if (prefs.ref_port[0]==80 || prefs.ref_port[0]==0)
sprintf(sport,"");
else
- sprintf(sport, " %d", prefs.ref_port[0]);
+ sprintf(sport, ":%d", prefs.ref_port[0]);
/* If these are not angular coordinates, file mode becomes mandatory */
if (lng == lat && refcat!=ASTREFCAT_FILE)
@@ -223,17 +223,17 @@
/* Prepare mag limit section of the command line */
if (prefs.astref_maglim[0]>-99.0 || prefs.astref_maglim[1]<99.0)
- sprintf(maglimcmd, "-lm%s %f,%f -m 10000000",
+ sprintf(maglimcmd, "-lm%s&%f,%f&-m&10000000",
cdsbandname, prefs.astref_maglim[0],prefs.astref_maglim[1]);
else
- strcpy(maglimcmd, "-m 10000000");
+ strcpy(maglimcmd, "-m&10000000");
- sprintf(cmdline, "%s %s%s %s -c %f12%+f12 -r %16g %s",
- prefs.cdsclient_path,
+ sprintf(cmdline, "%s \"http://%s%s/viz-bin/aserver.cgi?%s&-c&%f%s%f&-r&%g&%s\"",
+ "curl",
prefs.ref_server[0],
sport,
astrefcat[(int)refcat].cdsname,
- wcspos[lng], wcspos[lat],
+ wcspos[lng], wcspos[lat] > 0 ? "%2b" : "", wcspos[lat],
maxradius*DEG/ARCMIN,
maglimcmd);