--- /tmp/astroquery-0.4.1+dfsg-4wxd2q3wz/debian/python-astroquery-doc_0.4.1+dfsg-4_all.deb
+++ python-astroquery-doc_0.4.1+dfsg-4_all.deb
├── file list
│ @@ -1,3 +1,3 @@
│ -rw-r--r-- 0 0 0 4 2020-11-26 17:39:55.000000 debian-binary
│ --rw-r--r-- 0 0 0 16320 2020-11-26 17:39:55.000000 control.tar.xz
│ --rw-r--r-- 0 0 0 1338236 2020-11-26 17:39:55.000000 data.tar.xz
│ +-rw-r--r-- 0 0 0 16300 2020-11-26 17:39:55.000000 control.tar.xz
│ +-rw-r--r-- 0 0 0 1338264 2020-11-26 17:39:55.000000 data.tar.xz
├── control.tar.xz
│ ├── control.tar
│ │ ├── ./control
│ │ │ @@ -1,13 +1,13 @@
│ │ │ Package: python-astroquery-doc
│ │ │ Source: astroquery
│ │ │ Version: 0.4.1+dfsg-4
│ │ │ Architecture: all
│ │ │ Maintainer: Debian Astro Team
requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │References
│ │ │requests.Response
objectThe response of the HTTP request.
│ │ │ +requests.Response
objectThe response of the HTTP request.
│ │ │Just return the dict of HTTP request parameters.
│ │ │requests.Response
The HTTP response returned from the service. │ │ │ +
requests.Response
The HTTP response returned from the service. │ │ │ All async methods should return the raw HTTP response.
│ │ │Use the astroquery internal query result cache
│ │ │requests.Response
The HTTP response returned from the service. │ │ │ +
requests.Response
The HTTP response returned from the service. │ │ │ All async methods should return the raw HTTP response.
│ │ │astroquery.cds.
CdsClass
[source]¶Bases: astroquery.query.BaseQuery
Query the CDS MOCServer
│ │ │The CDS MOCServer allows the user to retrieve all the data sets (with
│ │ │ their meta-datas) having sources in a specific region. This region can be a regions.CircleSkyRegion
, a
│ │ │ -regions.PolygonSkyRegion
or a mocpy.MOC
object.
regions.PolygonSkyRegion
or a mocpy.MOC
object.
│ │ │ This package implements two methods:
│ │ │query_region()
retrieving data-sets (their associated MOCs and meta-datas) having
│ │ │ sources in a given region.
find_datasets()
retrieving data-sets (their associated MOCs and meta-datas) based
│ │ │ on the values of their meta-datas.
object
to the column. Therefore, keep in mind that object
typed columns can contain
│ │ │ values of different types (e.g. lists and singletons or string and floats).
│ │ │ Maximum number of data-sets to return. By default, there is no upper limit.
│ │ │Specifies if we want a mocpy.MOC
object in return. This MOC corresponds to the union of the MOCs of all
│ │ │ +
Specifies if we want a mocpy.MOC
object in return. This MOC corresponds to the union of the MOCs of all
│ │ │ the matching data-sets. By default it is set to False and query_region()
│ │ │ returns an astropy.table.Table
object.
Has sense only if return_moc
is set to True. Specifies the maximum precision order of the returned MOC.
If True, returns a dictionary of the query payload instead of the parsed response.
│ │ │astropy.table.Table
or mocpy.MOC
By default an astropy table of the data-sets matching the query. If return_moc
is set to True, it gives
│ │ │ +
astropy.table.Table
or mocpy.MOC
By default an astropy table of the data-sets matching the query. If return_moc
is set to True, it gives
│ │ │ a MOC object corresponding to the union of the MOCs from all the retrieved data-sets.
query_region
(region=None, get_query_payload=False, verbose=False, **kwargs)[source]¶Query the CDS MOCServer with a region.
│ │ │ -Can be a regions.CircleSkyRegion
, regions.PolygonSkyRegion
or mocpy.MOC
object. Returns the data-sets
│ │ │ +
Can be a regions.CircleSkyRegion
, regions.PolygonSkyRegion
or mocpy.MOC
object. Returns the data-sets
│ │ │ having at least one source in the region.
regions.CircleSkyRegion
, regions.PolygonSkyRegion
or mocpy.MOC
The region to query the MOCServer with. │ │ │ +
regions.CircleSkyRegion
, regions.PolygonSkyRegion
or mocpy.MOC
The region to query the MOCServer with. │ │ │ Can be one of the following types:
│ │ │regions.CircleSkyRegion
: defines an astropy cone region.
regions.PolygonSkyRegion
: defines an astropy polygon region.
mocpy.moc.MOC
: defines a MOC from the MOCPy library. See the MOCPy’s documentation for how to instantiate a MOC object.
overlaps
(default). Returned data-sets are those overlapping the MOC region.
covers
. Returned data-sets are those covering the MOC region.
encloses
. Returned data-sets are those enclosing the MOC region.
Maximum number of data-sets to return. By default, there is no upper limit.
│ │ │Specifies if we want a mocpy.MOC
object in return. This MOC corresponds to the union of the MOCs of all
│ │ │ +
Specifies if we want a mocpy.MOC
object in return. This MOC corresponds to the union of the MOCs of all
│ │ │ the matching data-sets. By default it is set to False and query_region()
│ │ │ returns an astropy.table.Table
object.
Has sense only if return_moc
is set to True. Specifies the maximum precision order of the returned MOC.
Has sense only if return_moc
is set to False. Specifies which meta datas to retrieve. The returned
│ │ │ astropy.table.Table
table will only contain the column names given in fields
.
If True, returns a dictionary of the query payload instead of the parsed response.
│ │ │astropy.table.Table
or mocpy.MOC
By default an astropy table of the data-sets matching the query. If return_moc
is set to True, it gives
│ │ │ +
astropy.table.Table
or mocpy.MOC
By default an astropy table of the data-sets matching the query. If return_moc
is set to True, it gives
│ │ │ a MOC object corresponding to the union of the MOCs from all the retrieved data-sets.
Arbitrary keyword arguments.
│ │ │Response
:The HTTP response from the CDS MOCServer.
│ │ │ +Response
:The HTTP response from the CDS MOCServer.
│ │ │starttime
), or by the table name ('tablename'
).
│ │ │
│ │ │
│ │ │
│ │ │ Response
objectThe requests response for the GET request for finding all │ │ │ +
Response
objectThe requests response for the GET request for finding all │ │ │ existing jobs.
│ │ │The jobid of the sql query. If no jobid is given, it attempts to │ │ │ use the most recent job (if it exists in this session).
│ │ │Response
objectThe requests response phase
│ │ │ +Response
objectThe requests response phase
│ │ │requests.Response
The response of the HTTP request.
│ │ │ +requests.Response
The response of the HTTP request.
│ │ │'sia'
│ │ │ provides access to the ‘simple image access’ IVOA protocol
│ │ │
│ │ │
│ │ │
│ │ │ Response
The HTTP response returned from the service
│ │ │ +Response
The HTTP response returned from the service
│ │ │if set to True
then returns the dictionary sent as the HTTP
│ │ │ request. Defaults to False
requests.Response
The HTTP response returned from the service
│ │ │ +requests.Response
The HTTP response returned from the service
│ │ │Target column list with value separated by a comma(,)
│ │ │requests.Response
The HTTP response returned from the service
│ │ │ +requests.Response
The HTTP response returned from the service
│ │ │Return raw data as obtained by JPL Horizons without parsing the │ │ │ data into a table, default: False
│ │ │requests.Response
The response of the HTTP request.
│ │ │ +requests.Response
The response of the HTTP request.
│ │ │Examples
│ │ │>>> from astroquery.jplhorizons import Horizons
│ │ │ >>> obj = Horizons(id='433', location='500@10',
│ │ │ @@ -1301,15 +1301,15 @@
│ │ │
│ │ │
Enables extra precision in RA and DEC values; default: False
│ │ │requests.Response
The response of the HTTP request.
│ │ │ +requests.Response
The response of the HTTP request.
│ │ │Examples
│ │ │>>> from astroquery.jplhorizons import Horizons
│ │ │ >>> obj = Horizons(id='Ceres', location='568',
│ │ │ @@ -1623,15 +1623,15 @@
│ │ │
Triggers output of time-varying difference between TDB and UT │ │ │ time-scales. Default: False
│ │ │requests.Response
The response of the HTTP request.
│ │ │ +requests.Response
The response of the HTTP request.
│ │ │Examples
│ │ │>>> from astroquery.jplhorizons import Horizons
│ │ │ >>> obj = Horizons(id='2012 TC4', location='257',
│ │ ├── ./usr/share/doc/python-astroquery-doc/html/api/astroquery.jplspec.JPLSpecClass.html
│ │ │ @@ -247,15 +247,15 @@
│ │ │
When set to True
the method should return the HTTP request
│ │ │ parameters as a dict. Default value is set to False
requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │Examples
│ │ │>>> table = JPLSpec.query_lines(min_frequency=100*u.GHz,
│ │ │ ... max_frequency=200*u.GHz,
│ │ ├── ./usr/share/doc/python-astroquery-doc/html/api/astroquery.magpis.MagpisClass.html
│ │ │ @@ -209,15 +209,15 @@
│ │ │
if set to True
then returns the dictionary sent as the HTTP
│ │ │ request. Defaults to False
requests.Response
The HTTP response returned from the service
│ │ │ +requests.Response
The HTTP response returned from the service
│ │ │Default is False. If true instead of downloading files directly, a curl script │ │ │ will be downloaded that can be used to download the data files at a later time.
│ │ │Can be used to override the default behavior of all results being returned to obtain │ │ │ one sepcific page of results.
│ │ │Can be used to override the default behavior of all results being returned to obtain │ │ │ one sepcific page of results.
│ │ │Cache results or use cached results (default: False
).
requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │Notes
│ │ │See the MPES user’s guide [MPES] for details on options and │ │ │ implementation.
│ │ │ @@ -952,15 +952,15 @@ │ │ │ │ │ │Cache results or use cached results (default: True
).
requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │References
│ │ │Examples
│ │ │>>> from astroquery.mpc import MPC
│ │ ├── ./usr/share/doc/python-astroquery-doc/html/api/astroquery.nasa_exoplanet_archive.NasaExoplanetArchiveClass.html
│ │ │ @@ -244,15 +244,15 @@
│ │ │ documentation [1], but some examples include select="*"
to return all columns of
│ │ │ the queried table or where=pl_name='K2-18 b'
to filter a specific column.
│ │ │
│ │ │
│ │ │
│ │ │
requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │References
│ │ │Any other filtering criteria to apply. Values provided using the where
keyword will
│ │ │ be ignored.
requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │References
│ │ │select="*"
to return all columns of
│ │ │ the queried table or where=pl_name='K2-18 b'
to filter a specific column.
│ │ │
│ │ │ requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │References
│ │ │if set to True
then returns the dictionary sent as the HTTP
│ │ │ request. Defaults to False
.
requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │if set to True
then returns the dictionary sent as the HTTP
│ │ │ request. Defaults to False
requests.Response
The HTTP response returned from the service
│ │ │ +requests.Response
The HTTP response returned from the service
│ │ │if set to True
then returns the dictionary sent as the HTTP
│ │ │ request. Defaults to False
.
requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │if set to True
then returns the dictionary sent as the HTTP
│ │ │ request. Defaults to False
.
requests.Response
The HTTP response returned from the service
│ │ │ +requests.Response
The HTTP response returned from the service
│ │ │if set to True
then returns the dictionary sent as the HTTP
│ │ │ request. Defaults to False
requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │If true then returns the dictionary of query parameters, posted to
│ │ │ remote server. Defaults to False
.
requests.Response
objectThe response of the HTTP request.
│ │ │ +requests.Response
objectThe response of the HTTP request.
│ │ │requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │Exception raised for malformed coordinate input
│ │ │When set to True
the method returns the HTTP request parameters.
│ │ │ Defaults to False
.
requests.Response
Response of the query from the server.
│ │ │ +requests.Response
Response of the query from the server.
│ │ │When set to True
the method returns the HTTP request parameters.
│ │ │ Defaults to False
.
requests.Response
Response of the query from the server.
│ │ │ +requests.Response
Response of the query from the server.
│ │ │When set to True
the method returns the HTTP request parameters.
│ │ │ Defaults to False
.
requests.Response
Response of the query from the server.
│ │ │ +requests.Response
Response of the query from the server.
│ │ │Cache the query?
│ │ │requests.Response
Response of the query from the server
│ │ │ +requests.Response
Response of the query from the server
│ │ │When set to True
the method returns the HTTP request parameters.
│ │ │ Defaults to False
.
requests.Response
Response of the query from the server
│ │ │ +requests.Response
Response of the query from the server
│ │ │name of object to be queried
│ │ │requests.Response
Response of the query from the server.
│ │ │ +requests.Response
Response of the query from the server.
│ │ │When set to True
the method returns the HTTP request parameters.
│ │ │ Defaults to False
.
requests.Response
Response of the query from the server
│ │ │ +requests.Response
Response of the query from the server
│ │ │When set to True
the method returns the HTTP request parameters.
│ │ │ Defaults to False
.
requests.Response
Response of the query from the server.
│ │ │ +requests.Response
Response of the query from the server.
│ │ │Display NRAO Recommended Frequencies
│ │ │requests.Response
The response of the HTTP request.
│ │ │ +requests.Response
The response of the HTTP request.
│ │ │SQL constraints to the search. Default is empty (no constrains │ │ │ applied).
│ │ │requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │POST or GET headers. user-agent will be set to │ │ │ astropy:astroquery.version
│ │ │requests.Response
Response object returned by the remote server
│ │ │ +requests.Response
Response object returned by the remote server
│ │ │The catalog(s) that will be retrieved
│ │ │Any key/value pairs besides “catalog” will be parsed │ │ │ as additional column filters.
│ │ │requests.Response
The response of the HTTP request.
│ │ │ +requests.Response
The response of the HTTP request.
│ │ │Examples
│ │ │>>> from astroquery.vizier import Vizier
│ │ │ >>> # note that glon/glat constraints here *must* be floats
│ │ │ @@ -450,15 +450,15 @@
│ │ │ specify a coordinate frame here instead (today, J2000, B1975,
│ │ │ B1950, B1900, B1875, B1855, Galactic, Supergal., Ecl.J2000, )
│ │ │
│ │ │
│ │ │
│ │ │
Constraints on columns of the result. The dictionary contains │ │ │ the column name as keys, and the constraints as values.
│ │ │requests.Response
The response of the HTTP request.
│ │ │ +requests.Response
The response of the HTTP request.
│ │ │SQL constraints to the search. Default is empty (no constrains │ │ │ applied).
│ │ │requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │SQL constraints to the search. Default is empty (no constrains │ │ │ applied).
│ │ │requests.Response
The HTTP response returned from the service.
│ │ │ +requests.Response
The HTTP response returned from the service.
│ │ │regions.CircleSkyRegion
object is given, only sources in
│ │ │ this region will be considered.
│ │ │
│ │ │
│ │ │
│ │ │ You can also query the MOCServer on a regions.PolygonSkyRegion
or even an mocpy.MOC
following the same pattern i.e. just
│ │ │ +
You can also query the MOCServer on a regions.PolygonSkyRegion
or even an mocpy.MOC
following the same pattern i.e. just
│ │ │ by replacing cone
with a polygon or a MOC object.
By default, query_region()
returns an astropy.table.Table
object storing the data-sets
│ │ │ as rows and their meta-datas as columns. Data-sets might have no information for a specific meta-data. If so, the value
│ │ │ associated with this meta-data for this data-set is set to “-“. The above astropy table looks like :
This astropy table has only 3 rows although we know more data-sets match the query. It’s useful if you do not need │ │ │ to retrieve all the data-sets matching a query but only a few. Again, the result will come faster from the MOCServer because │ │ │ this operation is done at the server side.
│ │ │MOC
object as a result¶Some users might want the union of all the MOCs from the data-sets matching the query. You can get a mocpy.MOC
object
│ │ │ +
MOC
object as a result¶Some users might want the union of all the MOCs from the data-sets matching the query. You can get a mocpy.MOC
object
│ │ │ instead of an astropy.table.Table
by setting the parameter return_moc
to True. An additional parameter max_norder
│ │ │ allows the user to set the resolution/precision of the returned MOC that he wants.
As an example, we would like to obtain the union of the spatial coverage of all the Hubble surveys:
│ │ │>>> from mocpy import MOC
│ │ │ >>> # We want to retrieve all the HST surveys i.e. the HST surveys covering any region of the sky.
│ │ │ >>> allsky = CircleSkyRegion(coordinates.SkyCoord(0, 0, unit="deg"), coordinates.Angle(180, unit="deg"))
│ │ │ >>> moc = cds.query_region(region=allsky,
│ │ │ @@ -449,25 +449,25 @@
│ │ │ ... meta_data="ID=*HST*")
│ │ │ >>> moc.plot(title="Union of the spatial coverage of all the Hubble surveys.")
│ │ │
MOC
of a specific data-set¶MOC
of a specific data-set¶Finally, if you want to retrieve the MOC of a specific data-set, please consider using the find_datasets
│ │ │ method with the ID of the data-set you want to retrieve the MOC along with the return_moc
parameter set to True.
│ │ │ -The last example will show you how to get the MOC (i.e. a mocpy.MOC
object) of the GALEXGR6/AIS/FUV
survey.
mocpy.MOC
object) of the GALEXGR6/AIS/FUV
survey.
│ │ │ >>> from mocpy import MOC
│ │ │ >>> moc_galex=cds.find_datasets(meta_data="ID=CDS/P/GALEXGR6/AIS/FUV", return_moc=True)
│ │ │ >>> moc_galex.plot("MOC associated to CDS/P/GALEXGR6/AIS/FUV.")
│ │ │
The cds
package can therefore be used in complementarity with mocpy. We can now retrieve mocpy.MOC
objects
│ │ │ +
The cds
package can therefore be used in complementarity with mocpy. We can now retrieve mocpy.MOC
objects
│ │ │ coming from the MOCServer and manipulate them in a python session with mocpy.
class MockResponse(object):
│ │ │
│ │ │ def __init__(self, content):
│ │ │ self.content = content
│ │ │
MockResponse
is an object intended to have any of the attributes that a
│ │ │ -normal requests.Response
object would have. However, it only needs to
│ │ │ +normal requests.Response
object would have. However, it only needs to
│ │ │ implement the methods that are actually used within the tests.
The tricky bits are in the pytest.fixture
.
The first little magical function is the patch_x
function, where x
should
│ │ │ either be post
or get
.
@pytest.fixture
│ │ │ def patch_get(request):
│ │ │ try:
│ │ │ mp = request.getfixturevalue("monkeypatch")
│ │ │ except AttributeError: # pytest < 3
│ │ │ mp = request.getfuncargvalue("monkeypatch")
│ │ │ mp.setattr(requests.Session, 'request', get_mockreturn)
│ │ │ return mp
│ │ │
This function, when called, changes the requests.Session
’s request
method
│ │ │ +
This function, when called, changes the requests.Session
’s request
method
│ │ │ to call the get_mockreturn
function, defined
│ │ │ below. @pytest.fixture
means that, if any function in this test_module.py
│ │ │ file accepts patch_get
as an argument, patch_get
will be called prior to
│ │ │ running that function.
get_mockreturn
is simple but important: this is where you define a function
│ │ │ to return the appropriate data stored in the data/
directory as a readable
│ │ │ object within the MockResponse
class: