JwstClass¶
- class astroquery.esa.jwst.JwstClass(*, tap_plus_handler=None, data_handler=None, show_messages=True)[source]¶
Bases:
BaseQuery
Proxy class to default TapPlus object (pointing to JWST Archive)
Attributes Summary
Methods Summary
cone_search
(coordinate, radius, *[, ...])Cone search sorted by distance in sync/async mode TAP & TAP+
download_files_from_program
(proposal_id, *)Get JWST products given its proposal ID.
get_decoded_string
(str)get_obs_products
(*[, observation_id, ...])Get a JWST product given its observation ID.
get_product
(*[, artifact_id, file_name])Get a JWST product given its Artifact ID or File name.
get_product_list
(*[, observation_id, ...])Get the list of products of a given JWST observation_id.
get_related_observations
(observation_id)In case of processing levels < 3, get the list of level 3 products that make use of a given JWST observation_id.
Retrieve the messages to inform users about the status of JWST TAP
gzip_uncompress
(input_file, output_file)is_gz_file
(filepath)launch_job
(query, *[, name, output_file, ...])Launches a synchronous or asynchronous job TAP & TAP+
list_async_jobs
(*[, verbose])Returns all the asynchronous jobs TAP & TAP+
load_async_job
(*[, jobid, name, verbose])Loads an asynchronous job TAP & TAP+
load_table
(table, *[, verbose])Loads the specified table TAP+ only
load_tables
(*[, only_names, ...])Loads all public tables TAP & TAP+
login
(*[, user, password, credentials_file, ...])Performs a login.
logout
(*[, verbose])Performs a logout TAP+ only
query_region
(coordinate, *[, radius, width, ...])Launches a query region job in sync/async mode TAP & TAP+
query_target
(target_name, *[, ...])Searches for a specific target defined by its name and other parameters TAP & TAP+
remove_jobs
(jobs_list, *[, verbose])Removes the specified jobs TAP+
resolve_target_coordinates
(target_name, ...)save_results
(job, *[, verbose])Saves job results TAP & TAP+
search_async_jobs
(*[, jobfilter, verbose])Searches for jobs applying the specified filter TAP+ only
set_token
(token)Links a MAST token to the logged user
Attributes Documentation
- ARTIFACT_PRODUCT_TYPES = ['info', 'thumbnail', 'auxiliary', 'science', 'preview']¶
- CAL_LEVELS = ['ALL', 1, 2, 3, -1]¶
- INSTRUMENT_NAMES = ['NIRISS', 'NIRSPEC', 'NIRCAM', 'MIRI', 'FGS']¶
- JWST_DEFAULT_COLUMNS = ['observationid', 'calibrationlevel', 'public', 'dataproducttype', 'instrument_name', 'energy_bandpassname', 'target_name', 'target_ra', 'target_dec', 'position_bounds_center', 'position_bounds_spoly']¶
- PLANE_DATAPRODUCT_TYPES = ['image', 'cube', 'measurements', 'spectrum']¶
- REQUESTED_OBSERVATION_ID = "Missing required argument: 'observation_id'"¶
- TARGET_RESOLVERS = ['ALL', 'SIMBAD', 'NED', 'VIZIER']¶
Methods Documentation
- cone_search(coordinate, radius, *, observation_id=None, cal_level='Top', prod_type=None, instrument_name=None, filter_name=None, proposal_id=None, only_public=False, show_all_columns=False, async_job=False, background=False, output_file=None, output_format='votable', verbose=False, dump_to_file=False)[source]¶
Cone search sorted by distance in sync/async mode TAP & TAP+
- Parameters:
- coordinateastropy.coordinate, mandatory
coordinates center point
- radiusastropy.units, mandatory
radius
- observation_idstr, optional, default None
get the observation given by its ID.
- cal_levelobject, optional, default ‘Top’
get the planes with the given calibration level. Options are: ‘Top’: str, only the planes with the highest calibration level 1,2,3: int, the given calibration level
- prod_typestr, optional, default None
get the observations providing the given product type. Options are: ‘image’,’cube’,’measurements’,’spectrum’: str, only results of the given product type
- instrument_namestr, optional, default None
get the observations corresponding to the given instrument name. Options are: ‘NIRISS’, ‘NIRSPEC’, ‘NIRCAM’, ‘MIRI’, ‘FGS’: str, only results of the given instrument
- filter_namestr, optional, default None
get the observations made with the given filter.
- proposal_idstr, optional, default None
get the observations from the given proposal ID.
- only_publicbool, optional, default ‘False’
flag to show only metadata corresponding to public observations
- show_all_columnsbool, optional, default ‘False’
flag to show all available columns in the output. Default behaviour is to show the most representative columns only
- async_jobbool, optional, default ‘False’
executes the job in asynchronous/synchronous mode (default synchronous)
- backgroundbool, optional, default ‘False’
when the job is executed in asynchronous mode, this flag specifies whether the execution will wait until results are available
- output_filestr, optional, default None
file name where the results are saved if dumpToFile is True. If this parameter is not provided, the jobid is used instead
- output_formatstr, optional, default ‘votable’
results format. Options are: ‘votable’: str, binary VOTable format ‘csv’: str, comma-separated values format ‘fits’: str, FITS format
- verbosebool, optional, default ‘False’
flag to display information about the process
- dump_to_filebool, optional, default ‘False’
if True, the results are saved in a file instead of using memory
- Returns:
- A Job object
- download_files_from_program(proposal_id, *, product_type=None, verbose=False)[source]¶
Get JWST products given its proposal ID.
- Parameters:
- proposal_idint, mandatory
Program or Proposal ID associated to the observations.
- product_typestr or list, optional, default None
If the string or at least one element of the list is empty, the value is replaced by None. With None, all products will be downloaded. Possible string values: ‘thumbnail’, ‘preview’, ‘auxiliary’, ‘science’ or ‘info’. Posible list values: any combination of string values.
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns:
- allobslist
Returns the observationsid included into the proposal_id.
- get_obs_products(*, observation_id=None, cal_level='ALL', product_type=None, output_file=None)[source]¶
Get a JWST product given its observation ID.
- Parameters:
- observation_idstr, mandatory
Observation identifier.
- cal_levelstr or int, optional
Calibration level. Default value ia ‘ALL’, to download all the products associated to this observation_id and lower levels. Requesting more accurate levels than the one associated to the observation_id is not allowed (as level 3 observations are composite products based on level 2 products). To request upper levels, please use get_related_observations functions first. Possible values: ‘ALL’, 3, 2, 1, -1
- product_typestr or list, optional, default None
If the string or at least one element of the list is empty, the value is replaced by None. With None, all products will be downloaded. Possible string values: ‘thumbnail’, ‘preview’, ‘auxiliary’, ‘science’ or ‘info’. Posible list values: any combination of string values.
- output_filestr, optional
Output file. If no value is provided, a temporary one is created.
- Returns:
- local_pathstr
Returns the local path where the product(s) are saved.
- get_product(*, artifact_id=None, file_name=None)[source]¶
Get a JWST product given its Artifact ID or File name.
- Parameters:
- artifact_idstr, mandatory (if no file_name is provided)
Artifact ID of the product.
- file_namestr, mandatory (if no artifact_id is provided)
- Returns:
- local_pathstr
Returns the local path that the file was downloaded to.
- get_product_list(*, observation_id=None, cal_level='ALL', product_type=None)[source]¶
Get the list of products of a given JWST observation_id.
- Parameters:
- observation_idstr, mandatory
Observation identifier.
- cal_levelstr or int, optional
Calibration level. Default value is ‘ALL’, to download all the products associated to this observation_id and lower processing levels. Requesting more accurate levels than the one associated to the observation_id is not allowed (as level 3 observations are composite products based on level 2 products). To request upper levels, please use get_related_observations functions first. Possible values: ‘ALL’, 3, 2, 1, -1
- product_typestr, optional, default None
List only products of the given type. If None, all products are listed. Possible values: ‘thumbnail’, ‘preview’, ‘info’, ‘auxiliary’, ‘science’.
- Returns:
- The list of products (astropy.table).
In case of processing levels < 3, get the list of level 3 products that make use of a given JWST observation_id. In case of processing level 3, retrieves the list of products used to create this composite observation
- Parameters:
- observation_idstr, mandatory
Observation identifier.
- Returns:
- A list of strings with the observation_id of the associated
- observations that can be used in get_product_list and
- get_obs_products functions
- launch_job(query, *, name=None, output_file=None, output_format='votable', verbose=False, dump_to_file=False, background=False, upload_resource=None, upload_table_name=None, async_job=False)[source]¶
Launches a synchronous or asynchronous job TAP & TAP+
- Parameters:
- querystr, mandatory
query to be executed
- namestr, optional, default None
name of the job to be executed
- output_filestr, optional, default None
file name where the results are saved if dumpToFile is True. If this parameter is not provided, the jobid is used instead
- output_formatstr, optional, default ‘votable’
results format. Options are: ‘votable’: str, binary VOTable format ‘csv’: str, comma-separated values format ‘fits’: str, FITS format
- verbosebool, optional, default ‘False’
flag to display information about the process
- dump_to_filebool, optional, default ‘False’
if True, the results are saved in a file instead of using memory
- backgroundbool, optional, default ‘False’
when the job is executed in asynchronous mode, this flag specifies whether the execution will wait until results are available
- upload_resource: str, optional, default None
resource to be uploaded to UPLOAD_SCHEMA
- upload_table_name: str, required if uploadResource is provided
Default None resource temporary table name associated to the uploaded resource
- async_job: bool, optional, default ‘False’
tag to execute the job in sync or async mode
- Returns:
- A Job object
- list_async_jobs(*, verbose=False)[source]¶
Returns all the asynchronous jobs TAP & TAP+
- Parameters:
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns:
- A list of Job objects
- load_async_job(*, jobid=None, name=None, verbose=False)[source]¶
Loads an asynchronous job TAP & TAP+
- Parameters:
- jobidstr, mandatory if no name is provided, default None
job identifier
- namestr, mandatory if no jobid is provided, default None
job name
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns:
- A Job object
- load_table(table, *, verbose=False)[source]¶
Loads the specified table TAP+ only
- Parameters:
- tablestr, mandatory
full qualified table name (i.e. schema name + table name)
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns:
- A table object
- load_tables(*, only_names=False, include_shared_tables=False, verbose=False)[source]¶
Loads all public tables TAP & TAP+
- Parameters:
- only_namesbool, TAP+ only, optional, default ‘False’
True to load table names only
- include_shared_tablesbool, TAP+, optional, default ‘False’
True to include shared tables
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns:
- A list of table objects
- login(*, user=None, password=None, credentials_file=None, token=None, verbose=False)[source]¶
Performs a login. TAP+ only User and password can be used or a file that contains user name and password (2 lines: one for user name and the following one for the password)
- Parameters:
- userstr, mandatory if ‘file’ is not provided, default None
login name
- passwordstr, mandatory if ‘file’ is not provided, default None
user password
- credentials_filestr, mandatory if no ‘user’ & ‘password’ are
provided file containing user and password in two lines
- token: str, optional
MAST token to have access to propietary data
- verbosebool, optional, default ‘False’
flag to display information about the process
- logout(*, verbose=False)[source]¶
Performs a logout TAP+ only
- Parameters:
- verbosebool, optional, default ‘False’
flag to display information about the process
- query_region(coordinate, *, radius=None, width=None, height=None, observation_id=None, cal_level='Top', prod_type=None, instrument_name=None, filter_name=None, proposal_id=None, only_public=False, show_all_columns=False, async_job=False, verbose=False)[source]¶
Launches a query region job in sync/async mode TAP & TAP+
- Parameters:
- coordinateastropy.coordinate, mandatory
coordinates center point
- radiusastropy.units, required if no ‘width’ nor ‘height’
are provided radius (deg)
- widthastropy.units, required if no ‘radius’ is provided
box width
- heightastropy.units, required if no ‘radius’ is provided
box height
- observation_idstr, optional, default None
get the observation given by its ID.
- cal_levelobject, optional, default ‘Top’
get the planes with the given calibration level. Options are: ‘Top’: str, only the planes with the highest calibration level 1,2,3: int, the given calibration level
- prod_typestr, optional, default None
get the observations providing the given product type. Options are: ‘image’,’cube’,’measurements’,’spectrum’: str, only results of the given product type
- instrument_namestr, optional, default None
get the observations corresponding to the given instrument name. Options are: ‘NIRISS’, ‘NIRSPEC’, ‘NIRCAM’, ‘MIRI’, ‘FGS’: str, only results of the given instrument
- filter_namestr, optional, default None
get the observations made with the given filter.
- proposal_idstr, optional, default None
get the observations from the given proposal ID.
- show_all_columnsbool, optional, default ‘False’
flag to show all available columns in the output. Default behaviour is to show the most representative columns only
- only_publicbool, optional, default ‘False’
flag to show only metadata corresponding to public observations
- async_jobbool, optional, default ‘False’
executes the query (job) in asynchronous/synchronous mode (default synchronous)
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns:
- The job results (astropy.table).
- query_target(target_name, *, target_resolver='ALL', radius=None, width=None, height=None, observation_id=None, cal_level='Top', prod_type=None, instrument_name=None, filter_name=None, proposal_id=None, only_public=False, show_all_columns=False, async_job=False, verbose=False)[source]¶
Searches for a specific target defined by its name and other parameters TAP & TAP+
- Parameters:
- target_namestr, mandatory
name of the target that will be used as center point
- target_resolverstr, optional, default ALL
resolver used to associate the target name with its coordinates. The ALL option evaluates a “SIMBAD then NED then VIZIER” approach. Options are: ALL, SIMBAD, NED, VIZIER.
- radiusastropy.units, required if no ‘width’ nor ‘height’ are
provided. radius (deg)
- widthastropy.units, required if no ‘radius’ is provided
box width
- heightastropy.units, required if no ‘radius’ is provided
box height
- observation_idstr, optional, default None
get the observation given by its ID.
- cal_levelobject, optional, default ‘Top’
get the planes with the given calibration level. Options are: ‘Top’: str, only the planes with the highest calibration level 1,2,3: int, the given calibration level
- prod_typestr, optional, default None
get the observations providing the given product type. Options are: ‘image’,’cube’,’measurements’,’spectrum’: str, only results of the given product type
- instrument_namestr, optional, default None
get the observations corresponding to the given instrument name. Options are: ‘NIRISS’, ‘NIRSPEC’, ‘NIRCAM’, ‘MIRI’, ‘FGS’: str, only results of the given instrument
- filter_namestr, optional, default None
get the observations made with the given filter.
- proposal_idstr, optional, default None
get the observations from the given proposal ID.
- only_publicbool, optional, default ‘False’
flag to show only metadata corresponding to public observations
- show_all_columnsbool, optional, default ‘False’
flag to show all available columns in the output. Default behaviour is to show the most representative columns only
- async_jobbool, optional, default ‘False’
executes the query (job) in asynchronous/synchronous mode (default synchronous)
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns:
- The job results (astropy.table).
- remove_jobs(jobs_list, *, verbose=False)[source]¶
Removes the specified jobs TAP+
- Parameters:
- jobs_liststr, mandatory
jobs identifiers to be removed
- verbosebool, optional, default ‘False’
flag to display information about the process
- save_results(job, *, verbose=False)[source]¶
Saves job results TAP & TAP+
- Parameters:
- jobJob, mandatory
job
- verbosebool, optional, default ‘False’
flag to display information about the process