Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fermi: migrate from LATDataQuery.cgi scraping to the new REST API
  • Loading branch information
Sheimy Paz Serpa
Sheimy Paz Serpa committed Jul 17, 2026
commit 303277a68c7e039b6207b6c85e9ec336e4a9e951
22 changes: 22 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,28 @@ vizier

- Methods ``get_catalog``, ``get_catalog_async`` and ``query_*`` now always return UCD1+ instead of UCD1. [#3458]

fermi
^^^^^

- The module now uses the new Fermi LAT Data Query REST API
(``/ssc/data/access/lat/query/api/v1``), which replaces the retired
``LATDataQuery.cgi`` endpoint whose HTML responses were previously scraped
with regular expressions. The user-facing ``FermiLAT.query_object()``
signature is unchanged. [#XXXX]
- ``FermiLAT.query_object_async()`` now returns the server-assigned
``query_id`` instead of the URL of an HTML results page. [#XXXX]
- New methods ``FermiLAT.get_status()``, ``FermiLAT.list_results()``,
``FermiLAT.wait_for_completion()`` and ``FermiLAT.get_file_urls()`` expose
the individual steps of the asynchronous query workflow. [#XXXX]
- New keyword arguments: ``zenithangle`` (maximum zenith angle in degrees) and
``coordsystem`` (``'J2000'``, ``'B1950'`` or ``'Galactic'``). All-sky
queries (radius > 60 deg, observation window <= 24 h) are now supported. [#XXXX]
- ``GetFermilatDatafile`` and ``get_fermilat_datafile`` are deprecated; they
now delegate to ``FermiLAT.get_file_urls()`` and take a ``query_id`` rather
than a results-page URL. [#XXXX]
- The module no longer emits an "Experimental" warning on import. [#XXXX]


mast
^^^^
- ``utils.mast_relative_path`` is now deprecated in favor of ``utils.get_cloud_paths``. [#3488]
Expand Down
23 changes: 15 additions & 8 deletions astroquery/fermi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

https://fermi.gsfc.nasa.gov
https://fermi.gsfc.nasa.gov/ssc/data/

As of 2026, the Fermi LAT Data Server exposes a JSON REST API. This module
targets that API; the legacy ``LATDataQuery.cgi`` HTML-scraping path has been
removed.
"""
from astropy import config as _config

Expand All @@ -14,25 +18,28 @@ class Conf(_config.ConfigNamespace):
"""

url = _config.ConfigItem(
'https://fermi.gsfc.nasa.gov/cgi-bin/ssc/LAT/LATDataQuery.cgi',
'Fermi query URL.')
'https://fermi.gsfc.nasa.gov/ssc/data/access/lat/query/api/v1',
'Base URL of the Fermi LAT Data Query REST API. Endpoints '
'(/query, /query/{id}/status, /query/{id}/results) are appended to it.')
file_base_url = _config.ConfigItem(
# NOTE: the results endpoint returns bare filenames; download URLs are
# reconstructed against this staging area. Currently a /test/ path -
# revisit if the staging location changes at production cutover.
'https://fermi.gsfc.nasa.gov/FTP/fermi/data/lat/test/queries/',
'Base URL under which query result files are staged.')
timeout = _config.ConfigItem(
60,
'Time limit for connecting to Fermi server.')
'Time limit for connecting to the Fermi server.')
retrieval_timeout = _config.ConfigItem(
120,
'Time limit for retrieving a data file once it has been located.')


conf = Conf()

from .core import FermiLAT, FermiLATClass, GetFermilatDatafile, get_fermilat_datafile
from .core import FermiLAT, FermiLATClass, GetFermilatDatafile, get_fermilat_datafile # noqa: E402

__all__ = ['FermiLAT', 'FermiLATClass',
'GetFermilatDatafile', 'get_fermilat_datafile',
'Conf', 'conf',
]

import warnings
warnings.warn("Experimental: Fermi-LAT has not yet been refactored to have "

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🎉

"its API match the rest of astroquery.")
Loading