The ESOAsg API reference¶
ESOAsg¶
The archive_catalogues module¶
The archive_observations module¶
The archive_science_portal module¶
- ESOAsg.archive_science_portal.query_from_polygons(polygons=None, instruments=None, data_types=None, open_link=False, show_link=False)[source]¶
Query the ESO ASP service given a polygon
The polygons value (or list) needs to be given as a string defining the location in the sky of the polygon with RA, Dec, separated by commas and with the first RA, Dec pair that matches the last one (to close the polygon)
- Parameters
polygons (list) – list of str (or single str) containing the coordinates of the polygon in the sky you want to query
instruments (list) – list of str (or single str) containing the instruments used to limit the search
data_types (list) – list of str (or single str) containing the data types used to limit the search
open_link (bool) – open a link to the ASP page
show_link (bool) – show the link on the terminal
- Returns
None
- ESOAsg.archive_science_portal.query_from_radec(positions, radius=None, instruments=None, data_types=None, open_link=False, show_link=False)[source]¶
Query the ESO ASP service given a position
The positions value (or list) needs to be given as an astropy.coordinates.SkyCoord object. For further detail see here: astropy coordinates
- Parameters
positions (astropy.coordinates.SkyCoord) – coordinates (or list of coordinates) of the sky you want to query
radius (float) – search radius in arcseconds
instruments (list) – list of str (or single str) containing the instruments used to limit the search
data_types (list) – list of str (or single str) containing the data types used to limit the search
open_link (bool) – open a link to the ASP page
show_link (bool) – show the link on the terminal
- Returns
None
ESOAsg.queries¶
The query.Query class¶
The query_catalogues.ESOCatalogues class¶
The query_observations.ESOObservations class¶
ESOAsg.core¶
The tap_queries module¶
The asp_queries module¶
Module to create and run ASP queries
The ESO Archive Science Portal (ASP) allows browsing and exploration of archive content using an intuitive interactive user interface that supports iterative queries
- ESOAsg.core.asp_queries.condition_data_types(data_types, connector=None)[source]¶
Return condition for data types
- ESOAsg.core.asp_queries.condition_instruments(instruments, connector=None)[source]¶
Return condition for instruments
- ESOAsg.core.asp_queries.condition_polygon(polygon, connector=None)[source]¶
Return condition for polygon
- ESOAsg.core.asp_queries.condition_position(ra, dec, radius=None, connector=None)[source]¶
Return condition for position
- Parameters
ra (any) – string containing the RA of the source in degree
dec (any) – string containing the Dec of the source in degree
radius (any) – string containing the search radius in arcseconds
connector (str, optional) – connector to be put in front of the the condition (e.g., ‘&’)
- Returns
string containing the pos= condition for ASP
- Return type
- ESOAsg.core.asp_queries.condition_radius(radius, connector=None)[source]¶
Return condition for radius
- ESOAsg.core.asp_queries.run_query(query_url, show_link=True, open_link=True)[source]¶
Run the ASP query
ESOAsg.datacontainers¶
eso_prodcatg¶
Class that defines the properties of an ESO PRODCATG
The current implementation follows the ESO Science Data Products Standard Version 6. More information in the Document ESO-044286.
- class ESOAsg.datacontainers.eso_prodcatg.ProdCatg(prodcatg_type=None)[source]¶
Class that defines the data product categories of the ESO Archive
- Parameters
prodcatg_type (str) – Name of the data product category
- Raises
TypeError – if prodcatg is not a str
ValueError – if prodcatg is not a valid category accordingly to the ESO standard
- data_format()[source]¶
Returns a string describing the data format associated to the prodcatg.
- Returns
string containing the general description of the data format of the given prodcatg.
- Return type
- property descriptor¶
Dictionary that dictates the property of a prodcatg
- property header_keywords¶
Dictionary that dictates the property of the header keywords of a prodcatg
- property prodcatg¶
Name of the prodcatg.
This set also the descriptor dictionary containing the relevant properties of the prodcatg.
science_cube_ifs¶
Class to work on SCIENCE.CUBE.IFS
- class ESOAsg.datacontainers.science_cube_ifs.ScienceCubeIfs(primary_header=None, scidata_hdu=None, errdata_hdu=None, qualdata_hdu=None, others_hdu=None)[source]¶
A class used to define and make simple operations on data of type PRODCATG=`SCIENCE.CUBE.IFS`
This is a child of
ESOAsg.datacontainers.DataContainer
.Please refer to the ESO Science Data Products Standard for a full description of the format.
Attributes:
Methods:
ESOASG.ancillary¶
checks¶
Module that performs some useful and basic checks and transformations
- ESOAsg.ancillary.checks.check_checksums(hdul) → bool[source]¶
Test if the datasum and checksum keywords in a HDUList are present and up-to-date
- Parameters
hdul (
astropy.io.fits.hdu.hdulist.HDUList
) – list of astropy HDUs to be checked- Returns
True all the HDUs in the input HDUL have the correct datasum and checksum
- Return type
- ESOAsg.ancillary.checks.check_disk_space(min_disk_space=6.0) → bool[source]¶
Check that there is enough space on the location where the code is running
Given a disk space limit in GB, the macro returns True if the disk where the code is running has more free GB than the given limit.
Warning
The current implementation checks the disk where the code is running (i.e., from the directory: ./). This may cause some troubles with shared disks.
- ESOAsg.ancillary.checks.connection_to_website(url, timeout=1.0) → bool[source]¶
Check there is an active connection to a website
- ESOAsg.ancillary.checks.fits_file_is_valid(fits_file, verify_fits=False, overwrite=False) → bool[source]¶
Check if a file exists and has a valid extension
The option verify_fits checks the header of the fits file using astropy.io.fits.verify
- Parameters
- Returns
True if exists False and warning raised if not.
- Return type