[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 4057817 2/3: Query: added support for ASTRON's
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 4057817 2/3: Query: added support for ASTRON's VO database |
Date: |
Wed, 20 Jan 2021 19:37:41 -0500 (EST) |
branch: master
commit 405781792980b62abd5527df396a67eb81be2c5c
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Query: added support for ASTRON's VO database
With this commit, Query users can now acess ASTRON's VO service with the
'astron' database name. So far, I have just chosen a set of tables for
short-name based on a general reading of the description of the
datasets. However, I look forward to correcting them or adding more.
This task and necessary links were provided by Javier Moldon.
---
THANKS | 1 +
bin/query/Makefile.am | 7 ++--
bin/query/astron.c | 88 +++++++++++++++++++++++++++++++++++++++++
bin/query/{query.h => astron.h} | 19 +++------
bin/query/query.c | 2 +
bin/query/query.h | 1 +
bin/query/ui.c | 4 +-
doc/announce-acknowledge.txt | 1 +
doc/gnuastro.texi | 22 +++++++++--
9 files changed, 124 insertions(+), 21 deletions(-)
diff --git a/THANKS b/THANKS
index 27b5fe8..2905375 100644
--- a/THANKS
+++ b/THANKS
@@ -65,6 +65,7 @@ support in Gnuastro. The list is ordered alphabetically (by
family name).
Alberto Madrigal brt.madrigal@gmail.com
Guillaume Mahler guillaume.mahler@univ-lyon1.fr
Alireza Molaeinezhad amolaei@gmail.com
+ Javier Moldon jmoldon@iaa.es
Juan Molina Tobar juan.a.molina.t@gmail.com
Francesco Montanari francesco.montanari@openmailbox.org
Raphael Morales rmorales@iaa.es
diff --git a/bin/query/Makefile.am b/bin/query/Makefile.am
index 41888c0..39cbe24 100644
--- a/bin/query/Makefile.am
+++ b/bin/query/Makefile.am
@@ -41,10 +41,11 @@ bin_PROGRAMS = astquery
astquery_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
$(MAYBE_NORPATH)
-astquery_SOURCES = main.c ui.c query.c gaia.c ned.c tap.c vizier.c
+astquery_SOURCES = main.c ui.c query.c astron.c gaia.c ned.c tap.c \
+ vizier.c
-EXTRA_DIST = main.h authors-cite.h args.h ui.h query.h gaia.h ned.h \
- tap.h vizier.h
+EXTRA_DIST = main.h authors-cite.h args.h ui.h query.h astron.h \
+ gaia.h ned.h tap.h vizier.h
diff --git a/bin/query/astron.c b/bin/query/astron.c
new file mode 100644
index 0000000..78545cc
--- /dev/null
+++ b/bin/query/astron.c
@@ -0,0 +1,88 @@
+/*********************************************************************
+Settings for Astron.
+Query is part of GNU Astronomy Utilities (Gnuastro) package.
+
+Original author:
+ Mohammad akhlaghi <mohammad@akhlaghi.org>
+Contributing author(s):
+Copyright (C) 2021, Free Software Foundation, Inc.
+
+Gnuastro is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation, either version 3 of the License, or (at your
+option) any later version.
+
+Gnuastro is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
+**********************************************************************/
+#include <config.h>
+
+#include <stdio.h>
+#include <errno.h>
+#include <error.h>
+#include <string.h>
+
+#include <gnuastro-internal/checkset.h>
+
+#include "main.h"
+
+#include "ui.h"
+#include "tap.h"
+
+
+
+
+
+static void
+astron_sanity_checks(struct queryparams *p)
+{
+ /* Set the summarized names. */
+ if(p->datasetstr)
+ {
+ if( !strcmp(p->datasetstr, "lofartier1") )
+ {
+ free(p->datasetstr);
+ gal_checkset_allocate_copy("lofartier1.main",
+ &p->datasetstr);
+ }
+ else if( !strcmp(p->datasetstr, "mvf") )
+ {
+ free(p->datasetstr);
+ gal_checkset_allocate_copy("mvf.main", &p->datasetstr);
+ }
+ else if( !strcmp(p->datasetstr, "tgssadr") )
+ {
+ free(p->datasetstr);
+ gal_checkset_allocate_copy("tgssadr.main", &p->datasetstr);
+ }
+ }
+}
+
+
+
+
+
+void
+astron_prepare(struct queryparams *p)
+{
+ /* NED-specific. */
+ astron_sanity_checks(p);
+
+ /* Set the URLs, note that this is a simply-linked list, so we need to
+ reverse it in the end (with 'gal_list_str_reverse') to have the same
+ order here. */
+ gal_list_str_add(&p->urls,
+ "https://vo.astron.nl/__system__/tap/run/tap/sync", 0);
+
+ /* Name of default RA Dec columns. */
+ if(p->ra_name==NULL) p->ra_name="ra";
+ if(p->dec_name==NULL) p->dec_name="dec";
+
+ /* Basic sanity checks. */
+ tap_sanity_checks(p);
+}
diff --git a/bin/query/query.h b/bin/query/astron.h
similarity index 76%
copy from bin/query/query.h
copy to bin/query/astron.h
index db97c1d..eabcdc6 100644
--- a/bin/query/query.h
+++ b/bin/query/astron.h
@@ -1,11 +1,11 @@
/*********************************************************************
-Query - Retreive data from a remote data server.
+Settings for Astron.
Query is part of GNU Astronomy Utilities (Gnuastro) package.
Original author:
Mohammad akhlaghi <mohammad@akhlaghi.org>
Contributing author(s):
-Copyright (C) 2020-2021, Free Software Foundation, Inc.
+Copyright (C) 2021, Free Software Foundation, Inc.
Gnuastro is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -20,21 +20,12 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
**********************************************************************/
-#ifndef QUERY_H
-#define QUERY_H
+#ifndef ASTRON_H
+#define ASTRON_H
#include "main.h"
-enum query_databases
-{
- QUERY_DATABASE_INVALID,
- QUERY_DATABASE_GAIA,
- QUERY_DATABASE_NED,
- QUERY_DATABASE_VIZIER,
-};
-
-
void
-query(struct queryparams *p);
+astron_prepare(struct queryparams *p);
#endif
diff --git a/bin/query/query.c b/bin/query/query.c
index 1fabed9..12d0648 100644
--- a/bin/query/query.c
+++ b/bin/query/query.c
@@ -37,6 +37,7 @@ along with Gnuastro. If not, see
<http://www.gnu.org/licenses/>.
#include "ned.h"
#include "gaia.h"
#include "query.h"
+#include "astron.h"
#include "vizier.h"
@@ -348,6 +349,7 @@ query(struct queryparams *p)
/* Download the dataset. */
switch(p->database)
{
+ case QUERY_DATABASE_ASTRON: astron_prepare(p); break;
case QUERY_DATABASE_GAIA: gaia_prepare(p); break;
case QUERY_DATABASE_NED: ned_prepare(p); break;
case QUERY_DATABASE_VIZIER: vizier_prepare(p); break;
diff --git a/bin/query/query.h b/bin/query/query.h
index db97c1d..81fed39 100644
--- a/bin/query/query.h
+++ b/bin/query/query.h
@@ -28,6 +28,7 @@ along with Gnuastro. If not, see
<http://www.gnu.org/licenses/>.
enum query_databases
{
QUERY_DATABASE_INVALID,
+ QUERY_DATABASE_ASTRON,
QUERY_DATABASE_GAIA,
QUERY_DATABASE_NED,
QUERY_DATABASE_VIZIER,
diff --git a/bin/query/ui.c b/bin/query/ui.c
index 3be28dc..bef6e7d 100644
--- a/bin/query/ui.c
+++ b/bin/query/ui.c
@@ -152,6 +152,7 @@ ui_initialize_options(struct queryparams *p,
"specify your desired database, see manual ('info gnuastro " \
"astquery' command) for the current databases, here is the list " \
"of acceptable values (with their web-based search URLs):\n\n" \
+ " astron https://vo.astron.nl/\n" \
" gaia https://gea.esac.esa.int/archive\n" \
" ned https://ned.ipac.caltech.edu/tap/sync\n" \
" vizier http://vizier.u-strasbg.fr/viz-bin/VizieR\n"
@@ -274,7 +275,8 @@ ui_read_check_only_options(struct queryparams *p)
error(EXIT_FAILURE, 0, "no input database! " UI_NODATABASE);
/* Convert the given string into a code. */
- if( !strcmp(p->databasestr, "gaia") ) p->database=QUERY_DATABASE_GAIA;
+ if( !strcmp(p->databasestr, "astron") )
p->database=QUERY_DATABASE_ASTRON;
+ else if( !strcmp(p->databasestr, "gaia") ) p->database=QUERY_DATABASE_GAIA;
else if( !strcmp(p->databasestr, "ned") ) p->database=QUERY_DATABASE_NED;
else if( !strcmp(p->databasestr, "vizier") )
p->database=QUERY_DATABASE_VIZIER;
else
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index f04e94d..bafbdab 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -7,6 +7,7 @@ Bruno Haible
Martin Kuemmel
Javier Licandro
Alireza Molaeinezhad
+Javier Moldon
Sebastian Luna Valero
Samane Raji
Alberto Madrigal
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 41fb415..c50e195 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -10423,6 +10423,23 @@ If the dataset supports IVOA's TAP (Table Access
Protocol), it should be very ea
@table @code
+
+@item astron
+@cindex ASTRON
+@cindex Radio astronomy
+The ASTRON Virtual Observatory service (@url{https://vo.astron.nl}) is a
database focused on radio astronomy data and images, primarily those collected
by ASTRON itself.
+A query to @code{astron} is submitted to
@code{https://vo.astron.nl/__system__/tap/run/tap/sync}.
+
+Here is the list of short names for popular datasets within Gaia:
+@itemize
+@item
+@code{lofartier1 --> lofartier1.main}
+@item
+@code{mvf --> mvf.main}
+@item
+@code{tgssadr --> tgssadr.main}
+@end itemize
+
@item gaia
@cindex Gaia catalog
@cindex Catalog, Gaia
@@ -10445,15 +10462,14 @@ Here is the list of short names for popular datasets
within Gaia:
@code{hipparcos --> public.hipparcos}
@end itemize
-
-
@item ned
@cindex NASA/IPAC Extragalactic Database (NED)
@cindex NED (NASA/IPAC Extragalactic Database)
The NASA/IPAC Extragalactic Database (NED, @url{http://ned.ipac.caltech.edu})
is a fusion database, integrating the information about extra-galactic sources
from many large sky surveys into a single catalog.
It covers the full spectrum, from Gamma rays to radio frequencies and is
updated when new data arrives.
-Currently NED only has a single table for TAP access that is shown below, more
will be added in the future.
+A query to @code{ned} is submitted to
@code{https://ned.ipac.caltech.edu/tap/sync}.
+Currently NED only has a single table for TAP access that is shown below, more
will be added in the future and you can use this short name to access it.
@itemize
@item
@code{objdir --> NEDTAP.objdir}