Line — Spectral line metadata.¶
This module defines the Line class for LINE entries in BDPs.
-
class
admit.util.Line.
Line
(**keyval)[source]¶ Class for holding information on a specific spectral line.
Parameters: keyval : dict
Dictionary of keyword:value pairs.
Attributes
name (str) Name of the molecule/atom. Default: “”. uid (str) Unique identifier for the transition. Default: “”. formula (str) The chemical formula. Default: “”. transition (str) The transition/quantum number information. Default: “”. energies (2 element list) List of the lower and upper state energies of the transition. Default: [0.0, 0.0]. energyunits (str) Units of the upper/lower state energy. Default: K. linestrength (float) The line strength of the transition. Default: 0.0. lsunits (str) The units of the line strength. Default: “Debye^2”. frequency (float) The frequency of the transition. Default: 0.0. funits (str) The units of the frequency. Default: “GHz”. blend (int) If this molecule is blended with others. Value of 0 means no blending any other value gives the index of the blend. Default: 0 (no blending). Methods
getkey
(key)Method to get a data member by name getlowerenergy
()Method to get the lower state energy. getupperenergy
()Method to get the upper state energy. isequal
(line)Experimental method to compare 2 line classes setkey
([name, value])set keys, two styles are possible: setlowerenergy
(value)Method to set the lower state energy. setupperenergy
(value)Method to set the upper state energy. -
getlowerenergy
()[source]¶ Method to get the lower state energy.
Parameters: None Returns: Float of the lower state energy.
-
getupperenergy
()[source]¶ Method to get the upper state energy.
Parameters: None Returns: Float of the upper state energy.
-
isequal
(line)[source]¶ Experimental method to compare 2 line classes
Parameters: line : Line
The class to compare this one to.
Returns: Boolean whether or not the two classes contain the same data.
-
setkey
(name='', value='')[source]¶ set keys, two styles are possible:
- name = {key:val} e.g. setkey({“a”:1})
- name = “key”, value = val e.g. setkey(“a”, 1)
This method checks the type of the keyword value, as it must remain the same. Also new keywords cannot be added.
Parameters: name : dictionary or string
Dictionary of keyword value pais to set or a string with the name of a single key
value : any
The value to change the keyword to
Returns: None
-