astro query:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- astroquery v0.4.11 »
- Splatalogue Queries (`astroquery.splatalogue`) »
- SplatalogueClass

# SplatalogueClass

class astroquery.splatalogue.SplatalogueClass(**kwargs)

  Bases: `BaseQuery`

  Initialize a Splatalogue query class with default arguments set. Frequency specification is required for every query, but any default keyword arguments (see `query_lines`) can be overridden here.

  Attributes Summary

  `ALL_LINE_LISTS` |
  `LINES_LIMIT` |
  `QUERY_URL` |
  `SLAP_URL` |
  `TIMEOUT` |
  `VALID_ENERGY_LEVELS` |
  `VALID_ENERGY_TYPES` |
  `VALID_INTENSITY_TYPES` |
  `VALID_LINE_STRENGTHS` |
  `versions` |

  Methods Summary

  `get_fixed_table`(*[, columns]) | Convenience function to get the table with html column names made human readable.
  `get_species_ids`([species_regex, reflags, ...]) | Get a dictionary of "species" IDs, where species refers to the molecule name, mass, and chemical composition.
  `query_lines`(*args, **kwargs) | Queries the service and returns a table object.
  `query_lines_async`([min_frequency, ...]) | The Splatalogue service returns lines with rest frequencies in the range [min_frequency, max_frequency].
  `set_default_options`(**kwargs) | Modify the default options.

  Attributes Documentation

  ALL_LINE_LISTS = ('LovasNIST', 'SLAIM', 'JPL', 'CDMS', 'ToyaMA', 'OSU', 'TopModel', 'Recombination', 'RFI')
  LINES_LIMIT = 1000
  QUERY_URL = 'https://splatalogue.online/splata-slap/advanceded/false'
  SLAP_URL = 'https://find.nrao.edu/splata-slap/slap'
  TIMEOUT = 60
  VALID_ENERGY_LEVELS = {'Four': 'EU_K', 'One': 'EL_cm-1', 'Three': 'EU_cm-1', 'Two': 'EL_K'}
  VALID_ENERGY_TYPES = ('el_cm1', 'eu_cm1', 'eu_k', 'el_k')
  VALID_INTENSITY_TYPES = ('CDMS/JPL (log)', 'Sij-mu2', 'Aij (log)')
  VALID_LINE_STRENGTHS = ('CDMSJPL', 'SijMu2', 'Sij', 'Aij', 'LovasAST')
  versions = ('v1.0', 'v2.0', 'v3.0', 'vall')

  Methods Documentation

  get_fixed_table(*, columns=None)

    Convenience function to get the table with html column names made human readable. It returns only the columns identified with the `columns` keyword. See the source for the defaults.

  get_species_ids(species_regex=None, *, reflags=0, recache=False)

    Get a dictionary of “species” IDs, where species refers to the molecule name, mass, and chemical composition.

    Parameters:
      species_regex str

        String to search for among the species names, if specified. The string will be compiled into a regular expression using the python `re` module.

      reflags int

        Flags to pass to `re`.

      recache bool

        Flag whether to refresh the local cache of species IDs

    Examples

        >>> import re
        >>> import pprint # unfortunate hack required for documentation testing
        >>> rslt = Splatalogue.get_species_ids(species_regex='Formaldehyde')
        >>> pprint.pprint(rslt)
        {'03023 H2CO - Formaldehyde': '194',
         '03106 H213CO - Formaldehyde': '324',
         '03107 HDCO - Formaldehyde': '109',
         '03108 H2C17O - Formaldehyde': '982',
         '03202 H2C18O - Formaldehyde': '155',
         '03203 D2CO - Formaldehyde': '94',
         '03204 HD13CO - Formaldehyde': '1219',
         '03301 D213CO - Formaldehyde': '1220',
         '03315 HDC18O - Formaldehyde': '21141',
         '03410 D2C18O - Formaldehyde': '21140'}
        >>> rslt = Splatalogue.get_species_ids(species_regex='H2CO')
        >>> pprint.pprint(rslt)
        {'03023 H2CO - Formaldehyde': '194',
         '03109 H2COH+ - Hydroxymethylium ion': '224',
         '04406 c-H2COCH2 - Ethylene Oxide': '21',
         '06029 NH2CONH2 - Urea': '21166',
         '07510 H2NCH2COOH - I v=0 - Glycine': '389',
         '07511 H2NCH2COOH - I v=1 - Glycine': '1312',
         '07512 H2NCH2COOH - I v=2 - Glycine': '1313',
         '07513 H2NCH2COOH - II v=0 - Glycine': '262',
         '07514 H2NCH2COOH - II v=1 - Glycine': '1314',
         '07515 H2NCH2COOH - II v=2 - Glycine': '1315',
         '07517 NH2CO2CH3 v=0 - Methyl Carbamate': '1334',
         '07518 NH2CO2CH3 v=1 - Methyl Carbamate': '1335',
         '08902 CH3CHNH2COOH - I - α-Alanine': '1321',
         '08903 CH3CHNH2COOH - II - α-Alanine': '1322'}
        >>> # note the whitespace, preventing H2CO within other
        >>> # more complex molecules
        >>> Splatalogue.get_species_ids(species_regex=' H2CO ')
        {'03023 H2CO - Formaldehyde': '194'}
        >>> Splatalogue.get_species_ids(species_regex=' h2co ', reflags=re.IGNORECASE)
        {'03023 H2CO - Formaldehyde': '194'}

  query_lines(*args, **kwargs)

    Queries the service and returns a table object.

    The Splatalogue service returns lines with rest frequencies in the range [min_frequency, max_frequency].

    Parameters:
      min_frequency `astropy.units`

        Minimum frequency (or any spectral() equivalent)

      max_frequency `astropy.units`

        Maximum frequency (or any spectral() equivalent)

      chemical_name str

        Name of the chemical to search for. Treated as a regular expression. An empty set (‘’, (), [], {}) will match any species. Examples:

        `'H2CO'` - 13 species have H2CO somewhere in their formula.

        `'Formaldehyde'` - There are 8 isotopologues of Formaldehyde

          (e.g., H213CO).

        `'formaldehyde'` - Thioformaldehyde,Cyanoformaldehyde.

        `'formaldehyde',chem_re_flags=re.I` - Formaldehyde,thioformaldehyde,

          and Cyanoformaldehyde.

        `' H2CO '` - Just 1 species, H2CO. The spaces prevent including

          others.

      parse_chemistry_locally bool

        Attempt to determine the species ID #’s locally before sending the query? This will prevent queries that have no matching species. It also performs a more flexible regular expression match to the species IDs. See the examples in `get_species_ids`

      chem_re_flags int

        See the `re` module

      energy_min `None` or float

        Energy range to include. See energy_type

      energy_max `None` or float

        Energy range to include. See energy_type

      energy_type`'el_cm1'`, `'eu_cm1'`, `'eu_k'`, `'el_k'`

        Type of energy to restrict. L/U for lower/upper state energy, cm/K for inverse cm, i.e. wavenumber, or K for Kelvin

      intensity_lower_limit `None` or float

        Lower limit on the intensity. See intensity_type

      intensity_type `None`, `'CDMS/JPL (log)'`, `'Sij-mu2'`, `'Aij (log)'`

        The type of intensity on which to place a lower limit

      transition str

        e.g. 1-0

      version`'v1.0'`, `'v2.0'`, `'v3.0'` or `'vall'`

        Data version

      exclude list

        Types of lines to exclude. Default is: (`'potential'`, `'atmospheric'`, `'probable'`) Can also exclude `'known'`. To exclude nothing, use ‘none’, not the python object None, since the latter is meant to indicate ‘leave as default’

      only_astronomically_observed bool

        Show only astronomically observed species?

      only_NRAO_recommended bool

        Show only NRAO recommended species?

      line_lists list

        Options: Lovas, SLAIM, JPL, CDMS, ToyaMA, OSU, Recombination, RFI

      line_strengths list

        - CDMS/JPL Intensity : ls1

        - Sij : ls3

        - Aij : ls4

        - Lovas/AST : ls5

      energy_levels list

        - E_lower (cm^-1) : “One”

        - E_lower (K) : “Two”

        - E_upper (cm^-1) : “Three”

        - E_upper (K) : “Four”

      export bool

        Set up arguments for the export server (as opposed to the HTML server)?

      export_limit int

        Maximum number of lines in output file

      noHFS bool

        No HFS Display

      displayHFS bool

        Display HFS Intensity

      show_unres_qn bool

        Display Unresolved Quantum Numbers

      show_upper_degeneracy bool

        Display Upper State Degeneracy

      show_molecule_tag bool

        Display Molecule Tag

      show_qn_code bool

        Display Quantum Number Code

      show_lovas_labref bool

        Display Lab Ref

      show_lovas_obsref bool

        Display Obs Ref

      show_orderedfreq_only bool

        Display Ordered Frequency ONLY

      show_nrao_recommended bool

        Display NRAO Recommended Frequencies

    Returns:
      table A `Table` object.
  query_lines_async(min_frequency=None, max_frequency=None, *, cache=True, **kwargs)

    The Splatalogue service returns lines with rest frequencies in the range [min_frequency, max_frequency].

    Parameters:
      min_frequency `astropy.units`

        Minimum frequency (or any spectral() equivalent)

      max_frequency `astropy.units`

        Maximum frequency (or any spectral() equivalent)

      chemical_name str

        Name of the chemical to search for. Treated as a regular expression. An empty set (‘’, (), [], {}) will match any species. Examples:

        `'H2CO'` - 13 species have H2CO somewhere in their formula.

        `'Formaldehyde'` - There are 8 isotopologues of Formaldehyde

          (e.g., H213CO).

        `'formaldehyde'` - Thioformaldehyde,Cyanoformaldehyde.

        `'formaldehyde',chem_re_flags=re.I` - Formaldehyde,thioformaldehyde,

          and Cyanoformaldehyde.

        `' H2CO '` - Just 1 species, H2CO. The spaces prevent including

          others.

      parse_chemistry_locally bool

        Attempt to determine the species ID #’s locally before sending the query? This will prevent queries that have no matching species. It also performs a more flexible regular expression match to the species IDs. See the examples in `get_species_ids`

      chem_re_flags int

        See the `re` module

      energy_min `None` or float

        Energy range to include. See energy_type

      energy_max `None` or float

        Energy range to include. See energy_type

      energy_type`'el_cm1'`, `'eu_cm1'`, `'eu_k'`, `'el_k'`

        Type of energy to restrict. L/U for lower/upper state energy, cm/K for inverse cm, i.e. wavenumber, or K for Kelvin

      intensity_lower_limit `None` or float

        Lower limit on the intensity. See intensity_type

      intensity_type `None`, `'CDMS/JPL (log)'`, `'Sij-mu2'`, `'Aij (log)'`

        The type of intensity on which to place a lower limit

      transition str

        e.g. 1-0

      version`'v1.0'`, `'v2.0'`, `'v3.0'` or `'vall'`

        Data version

      exclude list

        Types of lines to exclude. Default is: (`'potential'`, `'atmospheric'`, `'probable'`) Can also exclude `'known'`. To exclude nothing, use ‘none’, not the python object None, since the latter is meant to indicate ‘leave as default’

      only_astronomically_observed bool

        Show only astronomically observed species?

      only_NRAO_recommended bool

        Show only NRAO recommended species?

      line_lists list

        Options: Lovas, SLAIM, JPL, CDMS, ToyaMA, OSU, Recombination, RFI

      line_strengths list

        - CDMS/JPL Intensity : ls1

        - Sij : ls3

        - Aij : ls4

        - Lovas/AST : ls5

      energy_levels list

        - E_lower (cm^-1) : “One”

        - E_lower (K) : “Two”

        - E_upper (cm^-1) : “Three”

        - E_upper (K) : “Four”

      export bool

        Set up arguments for the export server (as opposed to the HTML server)?

      export_limit int

        Maximum number of lines in output file

      noHFS bool

        No HFS Display

      displayHFS bool

        Display HFS Intensity

      show_unres_qn bool

        Display Unresolved Quantum Numbers

      show_upper_degeneracy bool

        Display Upper State Degeneracy

      show_molecule_tag bool

        Display Molecule Tag

      show_qn_code bool

        Display Quantum Number Code

      show_lovas_labref bool

        Display Lab Ref

      show_lovas_obsref bool

        Display Obs Ref

      show_orderedfreq_only bool

        Display Ordered Frequency ONLY

      show_nrao_recommended bool

        Display NRAO Recommended Frequencies

    Returns:
      response `requests.Response`

        The response of the HTTP request.

  set_default_options(**kwargs)

    Modify the default options. See `query_lines`