astro query:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- astroquery v0.4.11 »
- ESA JWST Archive (`astroquery.esa.jwst`) »
- JwstClass

# JwstClass

class astroquery.esa.jwst.JwstClass(*, tap_plus_handler=None, data_handler=None, show_messages=True)

  Bases: `BaseQuery`

  Proxy class to default TapPlus object (pointing to JWST Archive)

  Attributes Summary

  `ARTIFACT_PRODUCT_TYPES` |
  `CAL_LEVELS` |
  `INSTRUMENT_NAMES` |
  `JWST_DEFAULT_COLUMNS` |
  `PLANE_DATAPRODUCT_TYPES` |
  `REQUESTED_OBSERVATION_ID` |
  `TARGET_RESOLVERS` |

  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.
  `get_status_messages`() | Retrieve the messages to inform users about the status of JWST TAP
  `gzip_uncompress`(input_file, output_file) |
  `gzip_uncompress_and_rename_single_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)

    Cone search sorted by distance in sync/async mode TAP & TAP+

    Parameters:
      coordinate astropy.coordinate, mandatory

        coordinates center point

      radius astropy.units, mandatory

        radius

      observation_id str, optional, default None

        get the observation given by its ID.

      cal_level object, 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_type str, 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_name str, 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_name str, optional, default None

        get the observations made with the given filter.

      proposal_id str, optional, default None

        get the observations from the given proposal ID.

      only_public bool, optional, default ‘False’

        flag to show only metadata corresponding to public observations

      show_all_columns bool, optional, default ‘False’

        flag to show all available columns in the output. Default behaviour is to show the most representative columns only

      async_job bool, optional, default ‘False’

        executes the job in asynchronous/synchronous mode (default synchronous)

      background bool, optional, default ‘False’

        when the job is executed in asynchronous mode, this flag specifies whether the execution will wait until results are available

      output_file str, 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_format str, optional, default ‘votable’

        results format. Options are: ‘votable’: str, binary VOTable format ‘csv’: str, comma-separated values format ‘fits’: str, FITS format

      verbose bool, optional, default ‘False’

        flag to display information about the process

      dump_to_file bool, 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)

    Get JWST products given its proposal ID.

    Parameters:
      proposal_id int, mandatory

        Program or Proposal ID associated to the observations.

      product_type str 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.

      verbose bool, optional, default ‘False’

        flag to display information about the process

    Returns:
      allobs list

        Returns the observationsid included into the proposal_id.

  static get_decoded_string(str)
  get_obs_products(*, observation_id=None, cal_level='ALL', product_type=None, output_file=None)

    Get a JWST product given its observation ID.

    Parameters:
      observation_id str, mandatory

        Observation identifier.

      cal_level str 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_type str 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_file str, optional

        Output file. If no value is provided, a temporary one is created.

    Returns:
      local_path str

        Returns the local path where the product(s) are saved.

  get_product(*, artifact_id=None, file_name=None)

    Get a JWST product given its Artifact ID or File name.

    Parameters:
      artifact_id str, mandatory (if no file_name is provided)

        Artifact ID of the product.

      file_name str, mandatory (if no artifact_id is provided)
    Returns:
      local_path str

        Returns the local path that the file was downloaded to.

  get_product_list(*, observation_id=None, cal_level='ALL', product_type=None)

    Get the list of products of a given JWST observation_id.

    Parameters:
      observation_id str, mandatory

        Observation identifier.

      cal_level str 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_type str, 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).
  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. In case of processing level 3, retrieves the list of products used to create this composite observation

    Parameters:
      observation_id str, 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
  get_status_messages()

    Retrieve the messages to inform users about the status of JWST TAP

  static gzip_uncompress(input_file, output_file)
  static gzip_uncompress_and_rename_single_file(input_file)
  static is_gz_file(filepath)
  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)

    Launches a synchronous or asynchronous job TAP & TAP+

    Parameters:
      query str, mandatory

        query to be executed

      name str, optional, default None

        name of the job to be executed

      output_file str, 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_format str, optional, default ‘votable’

        results format. Options are: ‘votable’: str, binary VOTable format ‘csv’: str, comma-separated values format ‘fits’: str, FITS format

      verbose bool, optional, default ‘False’

        flag to display information about the process

      dump_to_file bool, optional, default ‘False’

        if True, the results are saved in a file instead of using memory

      background bool, 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)

    Returns all the asynchronous jobs TAP & TAP+

    Parameters:
      verbose bool, 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)

    Loads an asynchronous job TAP & TAP+

    Parameters:
      jobid str, mandatory if no name is provided, default None

        job identifier

      name str, mandatory if no jobid is provided, default None

        job name

      verbose bool, optional, default ‘False’

        flag to display information about the process

    Returns:
      A Job object
  load_table(table, *, verbose=False)

    Loads the specified table TAP+ only

    Parameters:
      table str, mandatory

        full qualified table name (i.e. schema name + table name)

      verbose bool, 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)

    Loads all public tables TAP & TAP+

    Parameters:
      only_names bool, TAP+ only, optional, default ‘False’

        True to load table names only

      include_shared_tables bool, TAP+, optional, default ‘False’

        True to include shared tables

      verbose bool, 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)

    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:
      user str, mandatory if ‘file’ is not provided, default None

        login name

      password str, mandatory if ‘file’ is not provided, default None

        user password

      credentials_file str, 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

      verbose bool, optional, default ‘False’

        flag to display information about the process

  logout(*, verbose=False)

    Performs a logout TAP+ only

    Parameters:
      verbose bool, 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)

    Launches a query region job in sync/async mode TAP & TAP+

    Parameters:
      coordinate astropy.coordinate, mandatory

        coordinates center point

      radius astropy.units, required if no ‘width’ nor ‘height’

        are provided radius (deg)

      width astropy.units, required if no ‘radius’ is provided

        box width

      height astropy.units, required if no ‘radius’ is provided

        box height

      observation_id str, optional, default None

        get the observation given by its ID.

      cal_level object, 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_type str, 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_name str, 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_name str, optional, default None

        get the observations made with the given filter.

      proposal_id str, optional, default None

        get the observations from the given proposal ID.

      show_all_columns bool, optional, default ‘False’

        flag to show all available columns in the output. Default behaviour is to show the most representative columns only

      only_public bool, optional, default ‘False’

        flag to show only metadata corresponding to public observations

      async_job bool, optional, default ‘False’

        executes the query (job) in asynchronous/synchronous mode (default synchronous)

      verbose bool, 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)

    Searches for a specific target defined by its name and other parameters TAP & TAP+

    Parameters:
      target_name str, mandatory

        name of the target that will be used as center point

      target_resolver str, 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.

      radius astropy.units, required if no ‘width’ nor ‘height’ are

        provided. radius (deg)

      width astropy.units, required if no ‘radius’ is provided

        box width

      height astropy.units, required if no ‘radius’ is provided

        box height

      observation_id str, optional, default None

        get the observation given by its ID.

      cal_level object, 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_type str, 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_name str, 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_name str, optional, default None

        get the observations made with the given filter.

      proposal_id str, optional, default None

        get the observations from the given proposal ID.

      only_public bool, optional, default ‘False’

        flag to show only metadata corresponding to public observations

      show_all_columns bool, optional, default ‘False’

        flag to show all available columns in the output. Default behaviour is to show the most representative columns only

      async_job bool, optional, default ‘False’

        executes the query (job) in asynchronous/synchronous mode (default synchronous)

      verbose bool, optional, default ‘False’

        flag to display information about the process

    Returns:
      The job results (astropy.table).
  remove_jobs(jobs_list, *, verbose=False)

    Removes the specified jobs TAP+

    Parameters:
      jobs_list str, mandatory

        jobs identifiers to be removed

      verbose bool, optional, default ‘False’

        flag to display information about the process

  resolve_target_coordinates(target_name, target_resolver)
  save_results(job, *, verbose=False)

    Saves job results TAP & TAP+

    Parameters:
      job Job, mandatory

        job

      verbose bool, optional, default ‘False’

        flag to display information about the process

  search_async_jobs(*, jobfilter=None, verbose=False)

    Searches for jobs applying the specified filter TAP+ only

    Parameters:
      jobfilter JobFilter, optional, default None

        job filter

      verbose bool, optional, default ‘False’

        flag to display information about the process

    Returns:
      A list of Job objects
  set_token(token)

    Links a MAST token to the logged user

    Parameters:
      token: str, mandatory

        MAST token to have access to propietary data