gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 6e6af0f 1/3: Query: added NASA/IPAC Extragalac


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 6e6af0f 1/3: Query: added NASA/IPAC Extragalactic Database (NED)
Date: Wed, 20 Jan 2021 19:37:41 -0500 (EST)

branch: master
commit 6e6af0f9a81dc1ea0155867f041e788e60a9a6c9
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Query: added NASA/IPAC Extragalactic Database (NED)
    
    With this commit, Query now also supports NED. The necessary documentation
    has also been added in the book.
    
    This task was done with the help of Xiuqin Wu from NED.
---
 THANKS                        |  1 +
 bin/query/Makefile.am         |  5 ++-
 bin/query/gaia.c              |  2 +-
 bin/query/gaia.h              |  2 +-
 bin/query/ned.c               | 88 +++++++++++++++++++++++++++++++++++++++++++
 bin/query/{vizier.h => ned.h} | 10 ++---
 bin/query/query.c             |  2 +
 bin/query/query.h             |  1 +
 bin/query/ui.c                |  6 ++-
 bin/query/vizier.c            |  2 +-
 bin/query/vizier.h            |  4 +-
 doc/announce-acknowledge.txt  |  1 +
 doc/gnuastro.texi             | 58 +++++++++++++++++-----------
 13 files changed, 146 insertions(+), 36 deletions(-)

diff --git a/THANKS b/THANKS
index d341069..27b5fe8 100644
--- a/THANKS
+++ b/THANKS
@@ -99,6 +99,7 @@ support in Gnuastro. The list is ordered alphabetically (by 
family name).
     Aaron Watkins                        aaron.watkins@oulu.fi
     Michael H.F. Wilkinson               m.h.f.wilkinson@gmail.com
     Christopher Willmer                  cnaw@as.arizona.edu
+    Xiuqin Wu                            xiuqin@ipac.caltech.edu
     Sara Yousefi Taemeh                  s.yousefi.t@gmail.com
     Johannes Zabl                        johannes.zabl@irap.omp.eu
 
diff --git a/bin/query/Makefile.am b/bin/query/Makefile.am
index 0039917..41888c0 100644
--- a/bin/query/Makefile.am
+++ b/bin/query/Makefile.am
@@ -41,9 +41,10 @@ bin_PROGRAMS = astquery
 astquery_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
                  $(MAYBE_NORPATH)
 
-astquery_SOURCES = main.c ui.c query.c gaia.c tap.c vizier.c
+astquery_SOURCES = main.c ui.c query.c gaia.c ned.c tap.c vizier.c
 
-EXTRA_DIST = main.h authors-cite.h args.h ui.h query.h gaia.h tap.h vizier.h
+EXTRA_DIST = main.h authors-cite.h args.h ui.h query.h gaia.h ned.h \
+             tap.h vizier.h
 
 
 
diff --git a/bin/query/gaia.c b/bin/query/gaia.c
index b012637..398f1ce 100644
--- a/bin/query/gaia.c
+++ b/bin/query/gaia.c
@@ -1,5 +1,5 @@
 /*********************************************************************
-Gaia Query: retrieve tables from Gaia catalog.
+Settings for ESA's Gaia.
 Query is part of GNU Astronomy Utilities (Gnuastro) package.
 
 Original author:
diff --git a/bin/query/gaia.h b/bin/query/gaia.h
index 45cb89b..090c465 100644
--- a/bin/query/gaia.h
+++ b/bin/query/gaia.h
@@ -1,5 +1,5 @@
 /*********************************************************************
-Gaia Query: retrieve tables from Gaia catalog.
+Settings for ESA's Gaia.
 Query is part of GNU Astronomy Utilities (Gnuastro) package.
 
 Original author:
diff --git a/bin/query/ned.c b/bin/query/ned.c
new file mode 100644
index 0000000..9feb4f0
--- /dev/null
+++ b/bin/query/ned.c
@@ -0,0 +1,88 @@
+/*********************************************************************
+Settings for NED.
+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
+ned_sanity_checks(struct queryparams *p)
+{
+  /* Set the summarized names. */
+  if(p->datasetstr)
+    {
+      if( !strcmp(p->datasetstr, "objdir") )
+        {
+          free(p->datasetstr);
+          gal_checkset_allocate_copy("NEDTAP.objdir", &p->datasetstr);
+        }
+    }
+
+  /* Currently NED only has a single table for TAP access, so warn the
+     users about this if they ask for any other table. */
+  if( strcmp(p->datasetstr, "NEDTAP.objdir") && p->cp.quiet==0 )
+    {
+      printf("\n\n");
+      error(EXIT_FAILURE, 0, "WARNING: NED currently only supports "
+            "a single dataset called 'NEDTAP.objdir' (which you can "
+            "also call in Query with 'objdir'). TAP access to more "
+            "tables will be provided in the future");
+    }
+}
+
+
+
+
+
+void
+ned_prepare(struct queryparams *p)
+{
+  /* NED-specific. */
+  ned_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://ned.ipac.caltech.edu/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/vizier.h b/bin/query/ned.h
similarity index 85%
copy from bin/query/vizier.h
copy to bin/query/ned.h
index 8d24431..01effeb 100644
--- a/bin/query/vizier.h
+++ b/bin/query/ned.h
@@ -1,11 +1,11 @@
 /*********************************************************************
-Access VizieR servers for query.
+Settings for NED.
 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,12 +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 VIZIER_H
-#define VIZIER_H
+#ifndef NED_H
+#define NED_H
 
 #include "main.h"
 
 void
-vizier_prepare(struct queryparams *p);
+ned_prepare(struct queryparams *p);
 
 #endif
diff --git a/bin/query/query.c b/bin/query/query.c
index b1c1a93..1fabed9 100644
--- a/bin/query/query.c
+++ b/bin/query/query.c
@@ -34,6 +34,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <gnuastro-internal/checkset.h>
 
 #include "tap.h"
+#include "ned.h"
 #include "gaia.h"
 #include "query.h"
 #include "vizier.h"
@@ -348,6 +349,7 @@ query(struct queryparams *p)
   switch(p->database)
     {
     case QUERY_DATABASE_GAIA:   gaia_prepare(p);   break;
+    case QUERY_DATABASE_NED:    ned_prepare(p);    break;
     case QUERY_DATABASE_VIZIER: vizier_prepare(p); break;
     default:
       error(EXIT_FAILURE, 0, "%s: a bug! Please contact us at %s to "
diff --git a/bin/query/query.h b/bin/query/query.h
index f95cd88..db97c1d 100644
--- a/bin/query/query.h
+++ b/bin/query/query.h
@@ -29,6 +29,7 @@ enum query_databases
 {
   QUERY_DATABASE_INVALID,
   QUERY_DATABASE_GAIA,
+  QUERY_DATABASE_NED,
   QUERY_DATABASE_VIZIER,
 };
 
diff --git a/bin/query/ui.c b/bin/query/ui.c
index 852a91b..3be28dc 100644
--- a/bin/query/ui.c
+++ b/bin/query/ui.c
@@ -152,8 +152,9 @@ 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"        \
-  "    vizier     http://vizier.u-strasbg.fr/viz-bin/VizieR\n";           \
-  "    gaia       https://gea.esac.esa.int/archive\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,6 +275,7 @@ ui_read_check_only_options(struct queryparams *p)
 
   /* Convert the given string into a code. */
   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
     error(EXIT_FAILURE, 0, "'%s' is not a recognized database.\n\n"
diff --git a/bin/query/vizier.c b/bin/query/vizier.c
index 81bee59..d7513a0 100644
--- a/bin/query/vizier.c
+++ b/bin/query/vizier.c
@@ -1,5 +1,5 @@
 /*********************************************************************
-Access VizieR servers for query.
+Settings for VizieR.
 Query is part of GNU Astronomy Utilities (Gnuastro) package.
 
 Original author:
diff --git a/bin/query/vizier.h b/bin/query/vizier.h
index 8d24431..c4e0432 100644
--- a/bin/query/vizier.h
+++ b/bin/query/vizier.h
@@ -1,11 +1,11 @@
 /*********************************************************************
-Access VizieR servers for query.
+Settings for VizieR.
 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
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index d3d1636..f04e94d 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -16,6 +16,7 @@ Joanna Sakowska
 Zahra Sharbaf
 Sachin Kumar Singh
 Ignacio Trujillo
+Xiuqin Wu
 
 
 
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index e1d22e7..41fb415 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -10423,6 +10423,42 @@ If the dataset supports IVOA's TAP (Table Access 
Protocol), it should be very ea
 
 
 @table @code
+@item gaia
+@cindex Gaia catalog
+@cindex Catalog, Gaia
+@cindex Database, Gaia
+The Gaia project (@url{https://www.cosmos.esa.int/web/gaia}) database which is 
a large collection of star positions on the celestial sphere, as well as 
peculiar velocities, paralloxes and magnitudes in some bands among many others.
+Besides scientific studies (like studying resolved stellar populations in the 
Galaxy and its halo), Gaia is also invaluable for raw data calibrations, like 
astrometry.
+A query to @code{gaia} is submitted to 
@code{https://gea.esac.esa.int/tap-server/tap/sync}.
+
+Here is the list of short names for popular datasets within Gaia:
+@itemize
+@item
+@code{edr3 --> gaiaedr3.gaia_source}
+@item
+@code{dr2 --> gaiadr2.gaia_source}
+@item
+@code{dr1 --> gaiadr1.gaia_source}
+@item
+@code{tycho2 --> public.tycho2}
+@item
+@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.
+
+@itemize
+@item
+@code{objdir --> NEDTAP.objdir}
+@end itemize
+
 @item vizier
 @cindex VizieR
 @cindex CDS, VizieR
@@ -10493,28 +10529,6 @@ For details on each dataset with necessary citations, 
and links to webpages, loo
 @item
 @code{wise --> II/311/wise} (WISE All-Sky data Release)
 @end itemize
-
-@item gaia
-@cindex Gaia catalog
-@cindex Catalog, Gaia
-@cindex Database, Gaia
-The Gaia project (@url{https://www.cosmos.esa.int/web/gaia}) database which is 
a large collection of star positions on the celestial sphere, as well as 
peculiar velocities, paralloxes and magnitudes in some bands among many others.
-Besides scientific studies (like studying resolved stellar populations in the 
Galaxy and its halo), Gaia is also invaluable for raw data calibrations, like 
astrometry.
-A query to @code{gaia} is submitted to 
@code{https://gea.esac.esa.int/tap-server/tap/sync}.
-
-Here is the list of short names for popular datasets within Gaia:
-@itemize
-@item
-@code{edr3 --> gaiaedr3.gaia_source}
-@item
-@code{dr2 --> gaiadr2.gaia_source}
-@item
-@code{dr1 --> gaiadr1.gaia_source}
-@item
-@code{tycho2 --> public.tycho2}
-@item
-@code{hipparcos --> public.hipparcos}
-@end itemize
 @end table
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]