Skip to content

Commit

Permalink
refactor: rewrite the mocserver module
Browse files Browse the repository at this point in the history
this is mainly motivated by the new support for time mocs and space-time mocs upstream
  • Loading branch information
ManonMarchand committed Nov 27, 2024
1 parent 75547fb commit 12670e1
Show file tree
Hide file tree
Showing 12 changed files with 1,557 additions and 817 deletions.
28 changes: 28 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,34 @@ esa.jwst

- Add download_files_from_program method to get all products by program id [#3073]

mocserver
^^^^^^^^^

- Switch to https instead of http for the default url (allows pyodide to use the module) [#3139]

- Add ``TimeMOC`` and ``STMOC`` as possible entries in ``MOCServer.query_region`` to
allow temporal and space-time searches [#3139]

- ``return_moc`` now allows to ask for a Time-MOC or a Space-Time MOC rather than only
Space-MOCs [#3139]

- Fix query by MOC that would write a file ``moc.fits`` where the method was executed
in overwriting mode (potentially deleting data if there was a conflicting file) [#3139]

- Returned tables now have a default list of fields instead of the > 130 columns returned
previously. The full list of fields can be displayed with the new method
``MOCServer.list_fields`` [#3139]

- Add ``casesensitive`` parameter in the queries (previously, this was hardcoded
to ``True``) [#3139]

- Add ``spacesys`` parameter to the queries to allow to filter on the different bodies
or frames. The list of available space systems can be printed with the new method
``MOCServer.list_spacesys`` [#3139]

- Add ``query_hips`` method, which is convenient to filter only Hierarchical progressive
surveys [#3139]

mpc
^^^

Expand Down
25 changes: 17 additions & 8 deletions astroquery/mocserver/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
CDS MOCServer Query Tool
------------------------
"""CDS MOCServer Query Tool.
----------------------------
:Author: Matthieu Baumann (matthieu.baumann@astro.unistra.fr)
Expand All @@ -13,8 +12,9 @@
Note: If the access to MOCs with the MOCServer tool was helpful for your research,
the following acknowledgment would be appreciated::
This research has made use of the MOCServer, a tool developed at CDS, Strasbourg, France aiming at retrieving
MOCs/meta-data from known data-sets. MOC is an IVOA standard described in the following paper :
This research has made use of the MOCServer, a tool developed at CDS, Strasbourg,
France aiming at retrieving MOCs/meta-data from known data-sets. MOC is an IVOA
standard described in :
http://www.ivoa.net/documents/MOC/20140602/REC-MOC-1.0-20140602.pdf
"""

Expand All @@ -24,12 +24,11 @@


class Conf(_config.ConfigNamespace):
"""
Configuration parameters for ``astroquery.template_module``.
"""
"""Configuration parameters for ``astroquery.template_module``."""

server = _config.ConfigItem(
[
"https://alasky.unistra.fr/MocServer/query",
"http://alasky.unistra.fr/MocServer/query",
"http://alaskybis.unistra.fr/MocServer/query",
],
Expand All @@ -40,6 +39,16 @@ class Conf(_config.ConfigNamespace):
30, "Time limit for connecting to template_module server."
)

default_fields = [
"ID",
"obs_title",
"obs_description",
"nb_rows",
"obs_regime",
"bib_reference",
"dataproduct_type",
]


conf = Conf()

Expand Down
Loading

0 comments on commit 12670e1

Please sign in to comment.