SpectralLineSearch — Interface to spectral line searching.

This module defines the SpectralLineSearch class.

class admit.util.SpectralLineSearch.SpectralLineSearch(online=True, tier1freq=[])[source]

Class to act an as interface to the spectral line searching tools. It can search both the slsearch catalog and, if online, the splatalogue database.

Parameters:

online : bool

Whether to use the online splatalogue database. If no internet connection is detected, then it will fall back on slsearch. Default: True.

tier1freq : list

A list of tier1 frequency coverage, to eliminate any matches that fall in the range of a tier1 line.

Attributes

sls_kw (dict) Dictionary to hold the keyword/value pairs for slsearch.
sp_kw (dict) Dictionary to hold the keyword/value paris for splatalogue.

Methods

check_online() Method to check whether we are online or not.
checktier1overlap(freq) Method to check for an overlap with tier1 lines.
search(minfreq, maxfreq, rrlevelstr[, ...]) Method to do the search and return the results.
setkeywords(minfreq, maxfreq, rrlevelstr, ...) Method to set the keywords for the search(es)
slsearch(rrlevelstr, allowExotics) Method to search through the slsearch database.
splatalogue(minfreq, maxfreq, rrlevelstr, ...) Method to search through the slsearch database.
check_online()[source]

Method to check whether we are online or not. Just does a simple http request to www.cv.nrao.edu, the host of splatalogue

Parameters:None
Returns:Boolean saying whether we are online (True) or not (False)
checktier1overlap(freq)[source]

Method to check for an overlap with tier1 lines.

Parameters:

freq : float

The frequency to check if it is within an existing tier1 frequency range

Returns:

Boolean, True if freq is within a tier1 range, False otherwise

search(minfreq, maxfreq, rrlevelstr, allowExotics=False, **kwargs)[source]

Method to do the search and return the results. Regardless of the search method used the results will have the same format and units.

Parameters:

minfreq : float

The starting frequency for the search, in GHz.

maxfreq : float

The ending frequency for the search, in GHz.

rrlevelstr : str

A string representation of the depth of recombination lines to return

allowExotics : bool

Whether or not to allow exotic atoms in the results (e.g. Ti). Default: False

kwargs : dict

Dictionary containing any keyword/value pairs for the search. Possibilities are:

setkeywords(minfreq, maxfreq, rrlevelstr, **kwargs)[source]

Method to set the keywords for the search(es)

Parameters:

minfreq : float

The starting frequency of the search, in GHz.

maxfreq : float

The ending frequency of the search, in GHz.

rrlevelstr : str

A string representation of what recombination lines to allow in the results

kwargs : dict

Dictionary of keyword/value pairs for search options. Possibilities are (no default values for most):

tablename
: str

Output table name for slsearch.

outfile
: str

Output file name for slsearch.

rrlonly
: bool

Only return recombination lines. (slsearch)

verbose
: bool

Be verbose in slsearch.

logfile
: str

Send slsearch results to the given log file.

append
: bool

Append to the slsearch log file.

no_atmospheric
: bool

If True will exclude atmospheric lines from the results. Default: False (splatalogue)

no_potential
: bool

If True will exclude potential species from the results. Default: False (splatalogue)

no_probable
: bool

If True will exclude probable species from the results. Default: False (splatalogue)

exclude
: list

Alternate method of excluding types, can contain any of “atmospheric”, “potential”, or “probable”

include_only_nrao or only_NRAO_recommended
: bool

If True only NRAO recommended transitions will be returned. Default: False (splatalogue)

displayLovas
: bool

If True include results from the Lovas Line List. Default: False (splatalogue)

displaySLAIM
: bool

If True include results from the SLAIM molecular database. Default: False (splatalogue)

displayJPL
: bool

If True include results from the JPL database. Default: False (splatalogue)

displayCDMS
: bool

If True include results from the Cologne database. Default: False (splatalogue)

displayToyaMA
: bool

If True include results from the ToyaMA database. Default: False (splatalogue)

displayOSU
: bool

If True include results from the Ohio State database. Default: False (splatalogue)

displayLisa
: bool

If True include results from the the 13 methyl formate database. Default: False (splatalogue)

displayRFI
: bool

If True include RFI lines Default: False (splatalogue)

line_lists
: list

Alternate method to specify which database to search. Can contain any of the following: “Lovas”, “SLAIM”, “JPL”, “CDMS”, “ToyaMA”, “OSU”, “Lisa”, “RFI” (splatalogue)

ls1
: bool

If True then return the JPL line strength. Default: False (splatalogue)

ls2
: bool

If True then return the Smu^2 line strength. Default: False (splatalogue)

ls3
: bool

If True then return the S line strength. Default: False (splatalogue)

ls4
: bool

If True then return the Eistein A. Default: False (splatalogue)

ls5
: bool

If True then return the Lovas line strength. Default: False (splatalogue)

line_strengths
: list

Alternate way of specifying the line strength(s) to return. Can be any of the following: “ls1”, “ls2”, “ls3”, “ls4”, “ls5” (splatalogue)

el1
: bool

If True then return the lower state energy in cm^-1. Default: False (spltalogue)

el2
: bool

If True then return the lower state energy in K. Default: False (splatalogue)

el3
: bool

If True then return the upper state energy in cm^-1. Default: False (splatalogue)

el4
: bool

If True then return the upper state energy in K. Default: False (splatalogue)

energy_levels
: list

Alternate way of specifying the energy levels to return. Can contain any of the following: “el1”, “el2”, “el3”, “el4” (splatalogue)

fel
: bool

If True exclude results where the frequency uncertainty is more than 50 MHz. Default: False (splatalogue)

noHFS
: bool

If True then do not return hyperfine split lines, only the main component. Default: False (splatalogue)

displayHFS
: bool

If True then return the hyperfine strengths of split lines. Default: False (splatalogue)

show_unres_qn
: bool

If True then return the unresolved quantum numbers. Default: False (splatalogue)

show_upper_degeneracy
: bool

If True then return the uper state degeneracy. Default: False (splatalogue)

show_molecule_tag
: bool

If True then return the molecule tag. Default: False (splatalogue)

show_lovas_labref
: bool

If True then return the Lovas lab reference. Default: False (splatalogue)

show_lovas_obsref
: bool

If True then return the Lovas observational reference. Default: False (splatalogue)

show_orderedfreq_only
: bool

If True then Default: False (splatalogue)

show_nrao_recommended
: bool

If True then return the NRAO recommended frequency. (splatalogue)

top20
: list

Include the results from the given top20 lists. Possibilities are: ‘comet’, ‘planet’, ‘ism_hotcore’, ‘ism_darkcloud’, ‘ism_diffusecloud’ (splatalogue)

comet
: bool

If True then return results most likely found in comets. (splatalogue)

planet
: bool

If True then return results most likely found in planetary atmospheres. (splatalogue)

ism_hotcore
: bool

If True then return results most liekly found in hot cores. (splatalogue)

ism_darkcloud
: bool

If True then return results most likely found in dark clouds. (splatalogue)

ism_diffusecloud
: bool

If True then return results most likely found in diffuse clouds. (splatalogue)

band
: str

Which band to use for frequency range, will override any specified frequency range. (splatalogue)

species
: str

Limit the results to the given molecule

reconly or only_NRAO_recommended
: bool

Only return results with recommended NROA rest frequencies. This option can remove duplicate records arising from the multiple databases inside slsearch and splatalogue. Default: False

chemnames or chemical_name
: str

Limit the results to the given molecule.

qns or transition
: str

Limit the results to the specified quantum numbers.

energy_type
: str

Energy units for both the el and eu keywords. Possibilities are ‘K’ for Kelvin, and ‘cm’ for inverse cm.

el
: list or float

If a list then the range of lower state energies to search between, else it is treated as a lower limit. Note splatalogue only supports a lower limit, so upper limit is ignored, but passed to slsearch.

eu
: list or float

If a list then the range of upper state energies to search between, else it is treated as a lower limit. Note splatalogue only supports a lower limit, so upper limit is ignored, but passed to slsearch.

smu2
: list or float

If a list then the range of line strengths to search between, in D^2, else it is treated as a lower limit. Note splatalogue only supports a lower limit, so upper limit is ignored, but passed to slsearch.

loga
: list or float

If a list then the range of line strengths to search between, in log of the Einstein A, else it is treated as a lower limit. Note splatalogue only supports a lower limit, so upper limit is ignored, but passed to slsearch.

intensity
: list or float

If a list then the range of line strengths to search between, in JPL intensity units, else it is treated as a lower limit. Note splatalogue only supports a lower limit, so upper limit is ignored, but passed to slsearch.

Returns:

None

slsearch(rrlevelstr, allowExotics)[source]

Method to search through the slsearch database. Search options must already have been set. Returns a formatted list of transitions, each item in the list is another list containing the following:

  1. Chemical formula
  2. Name
  3. Rest frequency
  4. Unique identifier
  5. Lower state energy in K
  6. Upper state energy in K
  7. Linestrength in D^2
  8. Mass of molecule (rough)
  9. Transition quantum numbers
  10. Cleanly formatted chemical formula for display purposes
  11. Number of non-standard isotopes in the molecule
Parameters:

rrlevelstr : str

String representation of how deep to search for recombination lines. Possibilities are:

  • off no recombination lines are allowed in the results.
  • shallow only H and He, alpha and beta lines are allowed in the results.
  • deep any recombination line is allowed in the results.

allowExotics : bool

Whether or not to allow exotic atoms in the molecules (e.g Ti)

Returns:

A list of LineData objects, with each containing the data for a single transition.

splatalogue(minfreq, maxfreq, rrlevelstr, allowExotics)[source]

Method to search through the slsearch database. Search options must already have been set. Returns a formatted list of transitions, each item in the list is another list containing the following:

  1. Chemical formula
  2. Name
  3. Rest frequency
  4. Unique identifier
  5. Lower state energy in K
  6. Upper state energy in K
  7. Linestrength in D^2
  8. Mass of molecule (rough)
  9. Transition quantum numbers
  10. Cleanly formatted chemical formula for display purposes
  11. Number of non-standard isotopes in the molecule
Parameters:

rrlevelstr : str

String representation of how deep to search for recombination lines. Possibilities are:

  • off no recombination lines are allowed in the results.
  • shallow only H and He, alpha and beta lines are allowed in the results.
  • deep any recombination line is allowed in the results.

allowExotics : bool

Whether or not to allow exotic atoms in the molecules (e.g Ti)

Returns:

A list of LineData objects, with each containing the data for a single transition.