Coder Social home page Coder Social logo

oda-hub / astroquery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from astropy/astroquery

0.0 2.0 0.0 142.53 MB

Functions and classes to access online data resources. Maintainers: @keflavich and @bsipocz and @ceb8

Home Page: http://astroquery.readthedocs.org/en/latest/

License: BSD 3-Clause "New" or "Revised" License

Python 76.94% HTML 23.04% Shell 0.02%

astroquery's Introduction

Documentation | Blog | View on Github | Download Stable ZIP | Download Stable TAR

Latest PyPI version

Documentation Status

Github Actions CI Status

Coverage results

Zenodo

Accessing Online Astronomical Data

Astroquery is an astropy affiliated package that contains a collection of tools to access online Astronomical data. Each web service has its own sub-package. For example, to interface with the SIMBAD website, use the simbad sub-package:

>>> from astroquery.simbad import Simbad
>>> theta1c = Simbad.query_object('tet01 Ori C')
>>> theta1c.pprint()
   MAIN_ID          RA           DEC      ... COO_QUAL COO_WAVELENGTH     COO_BIBCODE
------------- ------------- ------------- ... -------- -------------- -------------------
* tet01 Ori C 05 35 16.4637 -05 23 22.848 ...        A              O 2007A&A...474..653V

Installation and Requirements

Astroquery works with Python 3.6 or later. As an astropy affiliate, astroquery requires astropy version 3.1.2 or later.

astroquery uses the requests module to communicate with the internet. BeautifulSoup and html5lib' are needed for HTML parsing for some services. The keyring module is also required for accessing services that require a login. These can all be installed using pip or anaconda. Running the tests requires curl to be installed.

The latest version of astroquery can be conda installed:

$ conda install -c conda-forge astroquery

or pip installed:

$ pip install --pre astroquery

and the 'bleeding edge' main version:

$ pip install https://github.com/astropy/astroquery/archive/main.zip

or cloned and installed from source:

$ # If you have a github account:
$ git clone [email protected]:astropy/astroquery.git
$ # If you do not:
$ git clone https://github.com/astropy/astroquery.git
$ cd astroquery
$ python setup.py install

Using astroquery

Importing astroquery on its own doesn't get you much: you need to import each sub-module specifically. Check out the docs to find a list of the tools available. The API shows the standard suite of tools common to most modules, e.g. query_object and query_region.

To report bugs and request features, please use the issue tracker. Code contributions are very welcome, though we encourage you to follow the API and contributing guidelines as much as possible.

List of Modules

The following modules have been completed using a common API:

  • ALMA Archive
  • Atomic Line List: A collection of more than 900,000 atomic transitions.
  • Besancon: Model of stellar population synthesis in the Galaxy.
  • CDS MOC Service: A collection of all-sky survey coverage maps.
  • CADC: Canadian Astronomy Data Centre.
  • ESASky: ESASky is a science driven discovery portal providing easy visualizations and full access to the entire sky as observed with ESA Space astronomy missions.
  • ESO Archive
  • FIRST: Faint Images of the Radio Sky at Twenty-cm. 20-cm radio images of the extragalactic sky from the VLA.
  • Gaia: European Space Agency Gaia Archive.
  • ESA XMM: European Space Agency XMM-Newton Science Archive.
  • ESA Hubble: European Space Agency Hubble Science Archive.
  • ESA ISO: European Space Agency ISO Data Archive.
  • GAMA database
  • Gemini: Gemini Archive.
  • HEASARC: NASA's High Energy Astrophysics Science Archive Research Center.
  • IBE: IRSA Image Server program interface (IBE) Query Tool provides access to the 2MASS, WISE, and PTF image archives.
  • IRSA: NASA/IPAC Infrared Science Archive. Science products for all of NASA's infrared and sub-mm missions.
  • IRSA dust: Galactic dust reddening and extinction maps from IRAS 100 um data.
  • MAGPIS: Multi-Array Galactic Plane Imaging Survey. 6 and 20-cm radio images of the Galactic plane from the VLA.
  • MAST: Barbara A. Mikulski Archive for Space Telescopes.
  • Minor Planet Center
  • NASA ADS: SAO/NASA Astrophysics Data System.
  • NED: NASA/IPAC Extragalactic Database. Multiwavelength data from both surveys and publications.
  • NIST: National Institute of Standards and Technology (NIST) atomic lines database.
  • NRAO: Science data archive of the National Radio Astronomy Observatory. VLA, JVLA, VLBA and GBT data products.
  • NVAS archive
  • Simbad: Basic data, cross-identifications, bibliography and measurements for astronomical objects outside the solar system.
  • Skyview: NASA SkyView service for imaging surveys.
  • Splatalogue: National Radio Astronomy Observatory (NRAO)-maintained (mostly) molecular radio and millimeter line list service.
  • UKIDSS: UKIRT Infrared Deep Sky Survey. JHK images of 7500 sq deg. in the northern sky.
  • Vamdc: VAMDC molecular line database.
  • Vizier: Set of 11,000+ published, multiwavelength catalogues hosted by the CDS.
  • VO Simple Cone Search
  • xMatch: Cross-identify sources between very large data sets or between a user-uploaded list and a large catalogue.

These others are functional, but do not follow a common or consistent API:

  • Alfalfa: Arecibo Legacy Fast ALFA survey; extragalactic HI radio data.
  • CosmoSim: The CosmoSim database provides results from cosmological simulations performed within different projects: the MultiDark project, the BolshoiP project, and the CLUES project.
  • Exoplanet Orbit Database
  • Fermi: Fermi gamma-ray telescope archive.
  • HITRAN: Access to the high-resolution transmission molecular absorption database.
  • JPL Horizons: JPL Solar System Dynamics Horizons Service.
  • JPL SBDB: JPL Solar System Dynamics Small-Body Database Browser Service.
  • Lamda: Leiden Atomic and Molecular Database; energy levels, radiative transitions, and collisional rates for astrophysically relevant atoms and molecules.
  • NASA Exoplanet Archive
  • OAC API: Open Astronomy Catalog REST API Service.
  • Ogle: Optical Gravitational Lensing Experiment III; information on interstellar extinction towards the Galactic bulge.
  • Open Expolanet Catalog (OEC)
  • SDSS: Sloan Digital Sky Survey data, including optical images, spectra, and spectral templates.
  • SHA: Spitzer Heritage Archive; infrared data products from the Spitzer Space Telescope.

Citing Astroquery

If you use astroquery, please cite the paper we published in The Astronomical Journal.

The BibTeX entry is available from the package itself:

import astroquery
astroquery.__citation__

In addition you may also want to refer to specific versions of the package. We create a separate Zenodo DOI for each version, they can be looked up at the following Zenodo page

Download Development ZIP | Download Development TAR

Maintained by Adam Ginsburg and Brigitta Sipocz ([email protected])

astroquery's People

Contributors

adamginsburg avatar agroener avatar astrofrog avatar bmatthieu3 avatar bmorris3 avatar bsipocz avatar burnout87 avatar cadenarmstrong avatar cam72cam avatar cdeil avatar derdon avatar dmcollom avatar ellieb avatar eteq avatar imbasimba avatar jcsegovia avatar jd-au avatar jdnc avatar jvinniec avatar jwoillez avatar keflavich avatar loicseguin avatar migueldvb avatar mirochaj avatar mkelley avatar mommermi avatar mwcraig avatar pllim avatar saimn avatar vilhelmp avatar

Watchers

 avatar  avatar

astroquery's Issues

legacysurvey: fails for some input (Mrk 422)

from astroquery.legacysurvey import LegacySurvey
from astropy.coordinates import Angle
from astropy.coordinates import SkyCoord
from astroquery.simbad import Simbad

name_input_here = "Mrk 422"
result_simbad = Simbad.query_object(name_input_here, wildcard=True)

ra_degree = Angle(result_simbad['RA'].data[0],unit='hourangle').degree
dec_degree = Angle(result_simbad['DEC'].data[0],unit='degree').degree

source = SkyCoord(ra_degree,dec_degree,unit='degree')
radius_degree = Angle(3.0, unit='arcmin').degree
radius = Angle(radius_degree, unit='degree')

query1 = LegacySurvey.query_region(source, radius=radius,data_release=9)

fails with Mrk 422, but succeeds with Mrk 421

The output with Mrk 422 is the following:

completed fits file request
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-58-0737f8f1675c> in <module>
     14 radius = Angle(radius_degree, unit='degree')
     15 
---> 16 query1 = LegacySurvey.query_region(source, radius=radius,data_release=9)
     17 
     18 

/opt/anaconda3/envs/smartsky/lib/python3.8/site-packages/astroquery/utils/class_or_instance.py in f(*args, **kwds)
     23         def f(*args, **kwds):
     24             if obj is not None:
---> 25                 return self.fn(obj, *args, **kwds)
     26             else:
     27                 return self.fn(cls, *args, **kwds)

/opt/anaconda3/envs/smartsky/lib/python3.8/site-packages/astroquery/utils/process_asyncs.py in newmethod(self, *args, **kwargs)
     27             if kwargs.get('get_query_payload') or kwargs.get('field_help'):
     28                 return response
---> 29             result = self._parse_result(response, verbose=verbose)
     30             self.table = result
     31             return result

/opt/anaconda3/envs/smartsky/lib/python3.8/site-packages/astroquery/legacysurvey/core.py in _parse_result(self, response, verbose)
    256             # TODO figure out on how to avoid writing in a file
    257             with open('/tmp/file_content', 'wb') as fin:
--> 258                 fin.write(response.content)
    259 
    260             table = Table.read('/tmp/file_content', hdu=1)

AttributeError: 'NoneType' object has no attribute 'content'

heasarc stopped working?..

import astroquery.heasarc

with astroquery.heasarc.Conf.server.set_temp('https://www.isdc.unige.ch/browse/w3query.pl'):
    R = astroquery.heasarc.Heasarc().query_region(
                       position=source_coord, 
                       mission='integral_rev3_scw', resultmax=1000000, radius=5*u.deg, cache=False,
                       time="2001-01-01 .. 2021-01-01",
                       fields='All',
                       good_isgri=">1000",
                       scw_type="POINTING"

       )

import `pyvo` causes error during tests

I am trying to address the last comments for merging DESILegacySurvey and I get the following error when trying to run a test.

Anyone has any idea?

astroquery/desi/tests/test_desi_remote.py:None (astroquery/desi/tests/test_desi_remote.py)
/usr/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:848: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
../__init__.py:38: in <module>
    from .core import DESILegacySurvey, DESILegacySurveyClass
../core.py:6: in <module>
    import pyvo as vo
../../../venv/lib/python3.8/site-packages/pyvo/__init__.py:35: in <module>
    from . import registry
../../../venv/lib/python3.8/site-packages/pyvo/registry/__init__.py:7: in <module>
    from .regtap import search, ivoid2service, get_RegTAP_query
../../../venv/lib/python3.8/site-packages/pyvo/registry/regtap.py:23: in <module>
    from astropy import table
../../../venv/lib/python3.8/site-packages/astropy/table/__init__.py:5: in <module>
    from .column import Column, MaskedColumn, StringTruncateWarning, ColumnInfo
../../../venv/lib/python3.8/site-packages/astropy/table/column.py:21: in <module>
    from ._column_mixins import _ColumnGetitemShim, _MaskedColumnGetitemShim
astropy/table/_column_mixins.pyx:1: in init astropy.table._column_mixins
    ???
E   RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 80 from C header, got 96 from PyObject

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.