astro query:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- astroquery v0.4.11 »
- Cologne Database for Molecular Spectroscopy (CDMS) Queries (`astroquery.linelists.cdms`) »
- CDMSClass

# CDMSClass

class astroquery.linelists.cdms.CDMSClass

  Bases: `BaseQuery`

  Attributes Summary

  `CLASSIC_URL` |
  `MALFORMATTED_MOLECULE_LIST` |
  `SERVER` |
  `TIMEOUT` |
  `URL` |

  Methods Summary

  `get_molecule`(molecule_id, *[, cache]) | Retrieve the whole molecule table for a given molecule id
  `get_species_table`(*[, catfile, use_cached, ...]) | A directory of the catalog is found in a file called 'catdir.cat.'
  `query_lines`(*args, **kwargs) | Queries the service and returns a table object.
  `query_lines_async`(min_frequency, ...[, ...]) | Creates an HTTP POST request based on the desired parameters and returns a response.

  Attributes Documentation

  CLASSIC_URL = 'https://cdms.astro.uni-koeln.de/classic'
  MALFORMATTED_MOLECULE_LIST = ['017506 NH3-wHFS', '028582 H2NC', '058501 H2C2S', '064527 HC3HCN']
  SERVER = 'https://cdms.astro.uni-koeln.de/'
  TIMEOUT = 60
  URL = 'https://cdms.astro.uni-koeln.de/cgi-bin/cdmssearch'

  Methods Documentation

  get_molecule(molecule_id, *, cache=True)

    Retrieve the whole molecule table for a given molecule id

  get_species_table(*, catfile='partfunc.cat', use_cached=True, catfile_url='https://cdms.astro.uni-koeln.de/classic/entries/partition_function.html', catfile2='catdir.cat', catfile_url2='https://cdms.astro.uni-koeln.de/classic/predictions/catalog/catdir.html', write_new_species_cache=False)

    A directory of the catalog is found in a file called ‘catdir.cat.’

    The table is derived from https://cdms.astro.uni-koeln.de/classic/entries/partition_function.html

    Parameters:
      catfile str, name of file, default ‘catdir.cat’

        The catalog file, installed locally along with the package

      use_cached bool, optional

        If True, use the cached file if it exists. If False, download the file from the CDMS server and save it to the cache if `write_new_species_cache` is set.

      write_new_species_cache bool, optional

        Overrides ``use_cached=True``. If True, write the species data table files to the CDMS data directory. Use this option if you need to update the index from CDMS; this should be set to False for testing.

    Returns:
      Table: `Table`
        tag : The species tag or molecular identifier.
        molecule : An ASCII name for the species.
        #line : The number of lines in the catalog.
        lg(Q(n)) : A seven-element vector containing the base 10 logarithm of the partition function.
  query_lines(*args, **kwargs)

    Queries the service and returns a table object.

    Creates an HTTP POST request based on the desired parameters and returns a response.

    Parameters:
      min_frequency `astropy.units.Quantity` or None

        Minimum frequency (or any spectral() equivalent). `None` can be interpreted as zero.

      max_frequency `astropy.units.Quantity` or None

        Maximum frequency (or any spectral() equivalent). `None` can be interpreted as infinite.

      min_strength int, optional

        Minimum strength in catalog units, the default is -500

      molecule list, string of regex if parse_name_locally=True, optional

        Identifiers of the molecules to search for. If this parameter is not provided the search will match any species. Default is ‘All’. As a first pass, the molecule will be searched for with a direct string match. If no string match is found, a regular expression match is attempted. Note that if the molecule name regex contains parentheses, they must be escaped. For example, ‘H2C(CN)2.*’ must be specified as ‘H2C(CN)2.*’ (but because of the first-attempt full-string matching, ‘H2C(CN)2’ will match that molecule successfully).

      temperature_for_intensity float

        The temperature to use when computing the intensity Smu^2. Set to 300 by default for compatibility with JPL and the native catalog format, which defaults to 300. ** If temperature is set to zero, the return value in this column will be the Einstein A value **

      flags int, optional

        Regular expression flags. Default is set to 0

      parse_name_locally bool, optional

        When set to True it allows the method to parse through catdir.cat (see `get_species_table`) in order to match the regex inputted in the molecule parameter and request the corresponding tags of the matches instead. Default is set to False

      get_query_payload bool, optional

        When set to `True` the method should return the HTTP request parameters as a dict. Default value is set to False

      cache bool

        Defaults to True. If set overrides global caching behavior. See caching documentation.

    Returns:
      table A `Table` object.

    Examples

        >>> table = CDMS.query_lines(min_frequency=100*u.GHz,
        ...                          max_frequency=110*u.GHz,
        ...                          min_strength=-500,
        ...                          molecule="018505 H2O+")
        >>> print(table)
            FREQ     ERR   LGINT   DR   ELO    GUP  TAG  QNFMT  Ju  Ku  vu  Jl  Kl  vl      F      name
            MHz      MHz  MHz nm2      1 / cm
        ----------- ----- ------- --- -------- --- ----- ----- --- --- --- --- --- --- ----------- ----
        103614.4941 2.237 -4.1826   3 202.8941   8 18505  2356   4   1   4   4   0   4 3 2 1 3 0 3 H2O+
        107814.8763 148.6 -5.4438   3 878.1191  12 18505  2356   6   5   1   7   1   6 7 4 4 8 1 7 H2O+
        107822.3481 148.6 -5.3846   3 878.1178  14 18505  2356   6   5   1   7   1   7 7 4 4 8 1 8 H2O+
        107830.1216 148.6 -5.3256   3 878.1164  16 18505  2356   6   5   1   7   1   8 7 4 4 8 1 9 H2O+

  query_lines_async(min_frequency, max_frequency, *, min_strength=-500, molecule='All', temperature_for_intensity=300, flags=0, parse_name_locally=False, get_query_payload=False, cache=True)

    Creates an HTTP POST request based on the desired parameters and returns a response.

    Parameters:
      min_frequency `astropy.units.Quantity` or None

        Minimum frequency (or any spectral() equivalent). `None` can be interpreted as zero.

      max_frequency `astropy.units.Quantity` or None

        Maximum frequency (or any spectral() equivalent). `None` can be interpreted as infinite.

      min_strength int, optional

        Minimum strength in catalog units, the default is -500

      molecule list, string of regex if parse_name_locally=True, optional

        Identifiers of the molecules to search for. If this parameter is not provided the search will match any species. Default is ‘All’. As a first pass, the molecule will be searched for with a direct string match. If no string match is found, a regular expression match is attempted. Note that if the molecule name regex contains parentheses, they must be escaped. For example, ‘H2C(CN)2.*’ must be specified as ‘H2C(CN)2.*’ (but because of the first-attempt full-string matching, ‘H2C(CN)2’ will match that molecule successfully).

      temperature_for_intensity float

        The temperature to use when computing the intensity Smu^2. Set to 300 by default for compatibility with JPL and the native catalog format, which defaults to 300. ** If temperature is set to zero, the return value in this column will be the Einstein A value **

      flags int, optional

        Regular expression flags. Default is set to 0

      parse_name_locally bool, optional

        When set to True it allows the method to parse through catdir.cat (see `get_species_table`) in order to match the regex inputted in the molecule parameter and request the corresponding tags of the matches instead. Default is set to False

      get_query_payload bool, optional

        When set to `True` the method should return the HTTP request parameters as a dict. Default value is set to False

      cache bool

        Defaults to True. If set overrides global caching behavior. See caching documentation.

    Returns:
      response `requests.Response`

        The HTTP response returned from the service.

    Examples

        >>> table = CDMS.query_lines(min_frequency=100*u.GHz,
        ...                          max_frequency=110*u.GHz,
        ...                          min_strength=-500,
        ...                          molecule="018505 H2O+")
        >>> print(table)
            FREQ     ERR   LGINT   DR   ELO    GUP  TAG  QNFMT  Ju  Ku  vu  Jl  Kl  vl      F      name
            MHz      MHz  MHz nm2      1 / cm
        ----------- ----- ------- --- -------- --- ----- ----- --- --- --- --- --- --- ----------- ----
        103614.4941 2.237 -4.1826   3 202.8941   8 18505  2356   4   1   4   4   0   4 3 2 1 3 0 3 H2O+
        107814.8763 148.6 -5.4438   3 878.1191  12 18505  2356   6   5   1   7   1   6 7 4 4 8 1 7 H2O+
        107822.3481 148.6 -5.3846   3 878.1178  14 18505  2356   6   5   1   7   1   7 7 4 4 8 1 8 H2O+
        107830.1216 148.6 -5.3256   3 878.1164  16 18505  2356   6   5   1   7   1   8 7 4 4 8 1 9 H2O+