Skip to main content
Ctrl+K
dysh 1.0.1 documentation - Home
  • GitHub
  • Quickstart Guide
  • What’s New?
  • Installation Guide
  • Users Guide
    • Basic Concepts
      • Starting dysh
      • Using the dysh logger
      • Data Structures Explained
      • Loading and Examining data
      • Saving Data to External Files
      • Selecting Data
      • Flagging
    • Calibration Procedures
      • Position-Switched Data Reduction
      • Frequency-switched Data Reduction
      • Nodding Data Reduction
      • SubBeamNod Data Reduction
      • On-The-Fly (OTF) Data Reduction
      • Calibration Without Noise Diodes
      • Vane Calibration
    • Interactive Plotter
    • Advanced Concepts
      • Spectral Axes: Velocity Frames and Doppler Conventions
      • Modifying the Default Values for Surface Error and Aperture Efficiency
      • Working With Repeated Scan Numbers
      • Using Spectral Weights
      • Smoothing
      • Aligning Spectra
      • Gaussian Fitting
      • Custom Baseline Fitting
      • Curve of Growth
      • Data Quality
      • Spectral Line Search
      • Modifying Metadata
      • Merging SDFITS Files
      • Example Reduction of HI Survey
  • Reference Guides
    • Modules and APIs
      • Reading in and writing out observations
      • Spectral classes and functions
      • Plotting classes and functions
      • Spatial and Velocity Coordinates and Reference Frames
      • Utility classes and functions
      • Spectral line search classes and functions
      • Logging classes and functions
    • SDFITS Files
      • GBT SDFITS Files
    • dysh for GBTIDL Users
    • A dysh glossary
    • Single Dish Math
  • For Beta Testers
    • Instructions for Beta Testers
  • For Developers
    • Contributing
    • Installation and Virtual Environment
    • Testing & GitHub Integrations
    • Documentation
    • Managing Requirements
    • Publishing a new dysh release
  • Show source
  • Open issue
  • .ipynb

Spectral Line Search

Contents

  • Dysh commands
  • Loading Modules
  • Setup
  • Example 1. Doing an online or local search with SpectralLineSearch
    • Do an online search for N2H+ lines between 80 and 400 GHz
    • Do a local search for methyl formate
    • Search for Recombination Lines
  • Add in a redshift
  • Example 2. Search within the frequency range of a Spectrum
  • Final Stats

Spectral Line Search#

This notebook shows how to use dysh to search for spectral lines. Searches can be done for a user-specified frequency range or for the frequency axis of a Spectrum. You can use a remote query to Splatalogue or use local tables distributed with dysh.

First we show how to do a search using a SpectralLineSearch object, then using a Spectrum object. Examples are given both with and without a redshift value.

Dysh commands#

The following dysh commands are introduced (leaving out all the function arguments):

  tbl1 = SpectralLineSearch.query_lines()
  tbl2 = SpectralLineSearch.recomb()
  tbl3 = SpectralLineSearch.recomball()
  SpectralLineSearch.clear_cache()

  sp = Spectrum.fake_spectrum()
  sp.plot()
  sp.recomb()
  sp.query_lines()

Loading Modules#

We start by loading the modules we will use.

# These modules are required for this example.
from dysh.line import SpectralLineSearch
from dysh.spectra import Spectrum
from dysh.log import init_logging
from astropy import units as u
# These modules are used for file I/O
from dysh.util.files import dysh_data
from pathlib import Path

Setup#

dysh uses a logger to communicate. If you are working in the command line, then the logging is setup for you. If you are working in a jupyter lab instance, then you need to set it up. You can do so using the init_logging function imported above. As an argument, init_logging takes a number, the verbosity level. level 0 is for error messages only, 1 for warning, 2 for info and 3 for debug. Here we set it to level 2.

init_logging(2)

# also create a local "output" directory where temporary notebook files can be stored.
output_dir = Path.cwd() / "output"
output_dir.mkdir(exist_ok=True)

Example 1. Doing an online or local search with SpectralLineSearch#

SpectralLineSearch is a thin wrapper on top of astroquery.splatalogue.Splatalogue, with some additional conveniences for working in dysh and with GBT data. You search a catalog in a given frequency range, optionally narrow down to specific molecules, line strengths, energies, etc. The return object is an astropy Table. Below are a few example searches.

Do an online search for N2H+ lines between 80 and 400 GHz#

Online searching of Splatalogue is the default. Note in this example we use an initial space in the chemical_name to eliminate other molecules that have the string 'N2H+' in them. We set an intensity_lower_limit to weed out some of the weaker satellite lines. When giving an intensity_lower_limit, one must also provide an intensity_type string, a minimum match to 'CDMS/JPL (log)', 'Sij-mu2', or 'Aij (log)'.

minfreq = 80*u.GHz
maxfreq = 400*u.GHz
table = SpectralLineSearch.query_lines(minfreq, maxfreq, 
                                       chemical_name=" N2H+", 
                                       intensity_lower_limit=-3, 
                                       intensity_type="CDMS")
print(f"{len(table)} rows returned.")
57 rows returned.

To inspect the available columns use the Table.colnames attribute:

print(table.colnames)
['species_id', 'name', 'chemical_name', 'resolved_QNs', 'linelist', 'LovasASTIntensity', 'lower_state_energy', 'upper_state_energy', 'sijmu2', 'sij', 'aij', 'intintensity', 'Lovas_NRAO', 'rest_frequency', 'lower_state_energy_K', 'upper_state_energy_K', 'orderedFreq', 'measFreq', 'upperStateDegen', 'moleculeTag', 'qnCode', 'labref_Lovas_NIST', 'rel_int_HFS_Lovas', 'unres_quantum_numbers', 'lineid', 'transition_in_space', 'transition_in_G358', 'obsref_Lovas_NIST', 'source_Lovas_NIST', 'telescope_Lovas_NIST', 'transitionBandColor', 'searchErrorMessage', 'sqlquery', 'requestnumber', 'obs_frequency']

The rest_frequency column is the rest frequency of the transition in MHz.

Some columns in the table often have embedded HTML. That’s the way they come from Splatalogue. ¯\_(ツ)_/¯

table
Table length=57
species_idnamechemical_nameresolved_QNslinelistLovasASTIntensitylower_state_energyupper_state_energysijmu2sijaijintintensityLovas_NRAOrest_frequencylower_state_energy_Kupper_state_energy_KorderedFreqmeasFrequpperStateDegenmoleculeTagqnCodelabref_Lovas_NISTrel_int_HFS_Lovasunres_quantum_numberslineidtransition_in_spacetransition_in_G358obsref_Lovas_NISTsource_Lovas_NISTtelescope_Lovas_NISTtransitionBandColorsearchErrorMessagesqlqueryrequestnumberobs_frequency
int64str57str11str44str4str4float64float64float64float64float64float64int64float64float64float64str71str67str2int64int64str1str1str18int64int64int64str6str8str13str18str1objectint64float64
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 1 - 0, F<sub>1</sub>= 1- 1JPL0.80.03.1078837.250383.222-4.40932-2.7844193171.880.04.47152<span style = 'color: #DC143C'></span>93.17188 (0.04), <span style = 'color: #DC143C'>93.17188</span>9-29005102J=1-0-F1=1-183034010Cas95L134NNRAO 11mdatatableskyblueNone093171.88
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ = 1 - 0CDMS0.03.10793104.042570.0-4.44034-2.3383193173.39770.04.4716593.1733977 (0.001), <span style = 'color: #DC143C'>93.1733977</span><span style = 'color: #DC143C'></span>27295061011 01463264900datatableskyblueNone093173.3977
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 1 - 0, F<sub>1</sub>= 2- 1JPL0.60.03.1079462.088875.371-4.40926-2.5625193173.70.04.47161<span style = 'color: #DC143C'></span>93.1737 (0.04), <span style = 'color: #DC143C'>93.1737</span>15-29005102J=1-0-F1=2-183034110Cas95L134NNRAO 11mdatatableskyblueNone093173.7
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 1- 0,F<sub>1</sub>= 2- 1,F= 3- 2CDMS0.03.1079426.971660.0-4.44038-2.9246193173.76990.04.4716693.1737699 (0.0012), <span style = 'color: #DC143C'>93.1737699</span><span style = 'color: #DC143C'></span>7295061031 2 3 0 1 21463270400datatableskyblueNone093173.7699
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 2- 1,F<sub>1</sub>= 2- 2,F= 3- 3CDMS3.10799.323638.123940.0-4.05846-2.85341186342.92494.471613.41471186.3429249 (0.0022), <span style = 'color: #DC143C'>186.3429249</span><span style = 'color: #DC143C'></span>7295061032 2 3 1 2 31463271400datatableyellowNone0186342.9249
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 2- 1,F<sub>1</sub>= 1- 0,F= 1- 1CDMS3.1089.323747.467350.0-3.72708-2.891186343.06164.4717513.41486186.3430616 (0.002), <span style = 'color: #DC143C'>186.3430616</span><span style = 'color: #DC143C'></span>3295061032 1 1 1 0 11463271600datatableyellowNone0186343.0616
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 2- 1,F<sub>1</sub>= 1- 0,F= 2- 1CDMS3.1089.3237412.869610.0-3.71253-2.65361186343.26914.4717513.41487186.3432691 (0.0023), <span style = 'color: #DC143C'>186.3432691</span><span style = 'color: #DC143C'></span>5295061032 1 2 1 0 11463271800datatableyellowNone0186343.2691
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 2- 1,F<sub>1</sub>= 2- 1,F= 2- 1CDMS3.10799.3236813.815290.0-3.68173-2.62281186344.39414.471613.41478186.3443941 (0.002), <span style = 'color: #DC143C'>186.3443941</span><span style = 'color: #DC143C'></span>5295061032 2 2 1 1 11463272100datatableyellowNone0186344.3941
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ = 2 - 1CDMS3.10799.32369208.093630.0-3.45807-1.44491186344.68444.471613.4148186.3446844 (0.002), <span style = 'color: #DC143C'>186.3446844</span><span style = 'color: #DC143C'></span>45295061012 11463265000datatableyellowNone0186344.6844
.........................................................................................................
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ=4-3JPL18.647231.07822446.7181738.6-2.47854-0.54991372672.50926.8290144.71436<span style = 'color: #DC143C'></span>372.672509 (0.05), <span style = 'color: #DC143C'>372.672509</span>81-29005101J=4-383034500datatablepalegreenNone0372672.509
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 4- 3,F<sub>1</sub>= 4- 3,F= 5- 4CDMS18.647231.0782252.556770.0-2.54085-1.47931372672.511626.8293444.71491372.6725116 (0.0032), <span style = 'color: #DC143C'>372.6725116</span><span style = 'color: #DC143C'></span>11295061034 4 5 3 3 41463277700datatablepalegreenNone0372672.5116
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 4- 3,F<sub>1</sub>= 5- 4,F= 4- 3CDMS18.647331.0783243.694710.0-2.5339-1.55951372672.516426.8294844.71506372.6725164 (0.0032), <span style = 'color: #DC143C'>372.6725164</span><span style = 'color: #DC143C'></span>9295061034 5 4 3 4 31463277800datatablepalegreenNone0372672.5164
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 4- 3,F<sub>1</sub>= 5- 4,F= 5- 4CDMS18.647231.0782254.591960.0-2.52435-1.46281372672.522826.8293444.71491372.6725228 (0.0032), <span style = 'color: #DC143C'>372.6725228</span><span style = 'color: #DC143C'></span>11295061034 5 5 3 4 41463277900datatablepalegreenNone0372672.5228
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 4- 3,F<sub>1</sub>= 5- 4,F= 6- 5CDMS18.647231.0782266.792640.0-2.5093-1.37521372672.553526.8293444.71491372.6725535 (0.0032), <span style = 'color: #DC143C'>372.6725535</span><span style = 'color: #DC143C'></span>13295061034 5 6 3 4 51463278000datatablepalegreenNone0372672.5535
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 4- 3,F<sub>1</sub>= 3- 2,F= 2- 2CDMS18.647331.078334.114610.0-3.30472-2.58561372672.820126.8294844.71507372.6728201 (0.0037), <span style = 'color: #DC143C'>372.6728201</span><span style = 'color: #DC143C'></span>5295061034 3 2 3 2 21463278100datatablepalegreenNone0372672.8201
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 4- 3,F<sub>1</sub>= 4- 3,F= 3- 3CDMS18.647231.078232.041870.0-3.75515-2.88991372672.921326.8293444.71493372.6729213 (0.0037), <span style = 'color: #DC143C'>372.6729213</span><span style = 'color: #DC143C'></span>7295061034 4 3 3 3 31463278200datatablepalegreenNone0372672.9213
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 4- 3,F<sub>1</sub>= 5- 4,F= 4- 4CDMS18.647231.078232.49590.0-3.7771-2.80271372673.02826.8293444.71494372.673028 (0.0039), <span style = 'color: #DC143C'>372.673028</span><span style = 'color: #DC143C'></span>9295061034 5 4 3 4 41463278300datatablepalegreenNone0372673.028
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 4- 3,F<sub>1</sub>= 3- 3,F= 3- 3CDMS18.647231.078293.043850.0-3.58175-2.71651372674.84626.8293444.71502372.674846 (0.0033), <span style = 'color: #DC143C'>372.674846</span><span style = 'color: #DC143C'></span>7295061034 3 3 3 3 31463278600datatablepalegreenNone0372674.846
148N<sub>2</sub>H<sup>+</sup> <font color="red">v = 0</font>DiazenyliumJ= 4- 3,F<sub>1</sub>= 3- 3,F= 4- 4CDMS18.647231.07833.233870.0-3.66459-2.69021372674.910126.8293444.71503372.6749101 (0.0034), <span style = 'color: #DC143C'>372.6749101</span><span style = 'color: #DC143C'></span>9295061034 3 4 3 3 41463278700datatablepalegreenNone0372674.9101

Do a local search for methyl formate#

This uses a GBT-specific catalog distributed with dysh. You can also provide your own catalog in an astropy Table format. The first time you use a given catalog, there will be some additional overhead to read it in and cache it. Subsequent searches will be faster because they use the cached version. Note the default regular expression matching is case-insensitive. The gbtlines catalog has most lines from 300 MHz to 120 GHz, and commonly observed redshifted lines from 120 GHz to 5 THz.

minfreq = 400*u.MHz
maxfreq = 5550*u.MHz
table = SpectralLineSearch.query_lines(minfreq, maxfreq,
                                       cat='gbtlines', 
                                       chemical_name="methyl formate")
print(f"{len(table)} rows returned.")
48 rows returned.
table
Table length=48
species_idnamechemical_nameresolved_QNslinelistLovasASTIntensitylower_state_energyupper_state_energysijmu2sijaijintintensityLovas_NRAOrest_frequencylower_state_energy_Kupper_state_energy_KorderedFreqmeasFrequpperStateDegenmoleculeTagqnCodelabref_Lovas_NISTrel_int_HFS_Lovasunres_quantum_numberslineidtransition_in_spacetransition_in_G358obsref_Lovas_NISTsource_Lovas_NISTtelescope_Lovas_NISTtransitionBandColorsearchErrorMessagesqlqueryrequestnumberobs_frequency
int64str47str14str44str6bytes1float64float64float64float64float64float64int64float64float64float64str67str64str3int64int64str5bytes1str20int64int64int64bytes1bytes1bytes1str13bytes1objectint64float64
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate1(1, 0) - 1(1, 1), v<sub>t</sub> = 0 - 0, AToyaMA--0.90.953710.00.00.00.0353701610.2491.294911.37219<span style = 'color: #DC143C'></span>1.610249 (0.003), <span style = 'color: #DC143C'>1.610249</span>--00Brown----1069242700------datatablegrey----01610.249
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate1(1, 0) - 1(1, 1), v<sub>t</sub> = 0 - 0, EToyaMA--0.90.953730.00.00.00.0353701610.9061.294911.37222<span style = 'color: #DC143C'></span>1.610906 (0.003), <span style = 'color: #DC143C'>1.610906</span>--00Brown----1069242800------datatablegrey----01610.906
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate27( 8,19)-27( 8,20) AJPL--185.6381185.7044810.708430.0-10.74808--11990.0988267.09028267.185791.9900988 (1.0E-4), <span style = 'color: #DC143C'>1.9900988</span><span style = 'color: #DC143C'></span>110600031404----27 819 0 27 820 01141636400------datatablegrey----01990.0988
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate11( 4, 7)-11( 4, 8) AJPL--34.543934.610396.894920.0-10.55855--11993.292249.7006849.796341.9932922 (1.0E-4), <span style = 'color: #DC143C'>1.9932922</span><span style = 'color: #DC143C'></span>46600031404----11 4 7 0 11 4 8 01141636500------datatablegrey----01993.2922
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate4( 2, 2)- 4( 2, 3) AJPL--5.92365.991324.627460.0-10.30044--12030.06318.522698.620122.0300631 (1.0E-4), <span style = 'color: #DC143C'>2.0300631</span><span style = 'color: #DC143C'></span>18600031404----4 2 2 0 4 2 3 01141636600------datatablegrey----02030.0631
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate23( 7,16)-23( 7,17) AJPL--136.5469136.618599.72730.0-10.62136--12149.165196.4594196.562542.149165 (1.0E-4), <span style = 'color: #DC143C'>2.149165</span><span style = 'color: #DC143C'></span>94600031404----23 716 0 23 717 01141636700------datatablegrey----02149.165
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate15( 5,10)-15( 5,11) AJPL--60.994661.068167.800190.0-10.50287--12205.37787.7571287.862962.205377 (1.0E-4), <span style = 'color: #DC143C'>2.205377</span><span style = 'color: #DC143C'></span>62600031404----15 510 0 15 511 01141636800------datatablegrey----02205.377
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate19( 6,13)-19( 6,14) AJPL--94.99795.07168.752450.0-10.53441--12236.3094136.67871136.786032.2363094 (1.0E-4), <span style = 'color: #DC143C'>2.2363094</span><span style = 'color: #DC143C'></span>78600031404----19 613 0 19 614 01141636900------datatablegrey----02236.3094
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate36(10,26)-36(10,27) AJPL--321.4598321.5472712.038570.0-10.46084--12622.1518462.50629462.632132.6221518 (2.0E-4), <span style = 'color: #DC143C'>2.6221518</span><span style = 'color: #DC143C'></span>146600031404----361026 0 361027 01141637000------datatablegrey----02622.1518
.........................................................................................................
1333CH<sub>3</sub>OCHO<font color="red"> v=1</font>Methyl Formate38(10,28)-38(10,29) AJPL--480.8501481.0084510.956980.0-9.75158--04747.0995691.83205692.059884.7470995 (0.0019), <span style = 'color: #DC143C'>4.7470995</span><span style = 'color: #DC143C'></span>154600031404----381028 3 381029 31141640000------datatablegrey----04747.0995
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate46(12,34)-46(12,35) AJPL--513.7385513.899312.725180.0-9.7486--14820.5148739.15085739.38224.8205148 (7.0E-4), <span style = 'color: #DC143C'>4.8205148</span><span style = 'color: #DC143C'></span>186600031404----461234 0 461235 01141640100------datatablegrey----04820.5148
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate2( 1, 1)- 2( 1, 2) EJPL--1.61841.779442.214440.0-9.23648--14827.96572.32852.560214.8279657 (1.0E-4), <span style = 'color: #DC143C'>4.8279657</span><span style = 'color: #DC143C'></span>10600031404----2 1 1 2 2 1 2 11141640200------datatablegrey----04827.9657
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate2( 1, 1)- 2( 1, 2) AJPL--1.6051.766132.215410.0-9.23557--14830.64092.309222.541064.8306409 (1.0E-4), <span style = 'color: #DC143C'>4.8306409</span><span style = 'color: #DC143C'></span>10600031404----2 1 1 0 2 1 2 01141640300------datatablegrey----04830.6409
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate33( 9,24)-33( 9,25) EJPL--269.4333269.5965910.378770.0-9.67465--14895.3142387.65219387.887124.8953142 (3.0E-4), <span style = 'color: #DC143C'>4.8953142</span><span style = 'color: #DC143C'></span>134600031404----33 924 2 33 925 11141640400------datatablegrey----04895.3142
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate33( 9,24)-33( 9,25) AJPL--269.4373269.6008810.383010.0-9.67218--14903.9512387.65794387.893294.9039512 (3.0E-4), <span style = 'color: #DC143C'>4.9039512</span><span style = 'color: #DC143C'></span>134600031404----33 924 0 33 925 01141640500------datatablegrey----04903.9512
1333CH<sub>3</sub>OCHO<font color="red"> v=1</font>Methyl Formate21( 6,15)-21( 6,16) AJPL--241.7578241.932247.490790.0-9.53759--05229.6632347.83355348.084535.2296632 (4.0E-4), <span style = 'color: #DC143C'>5.2296632</span><span style = 'color: #DC143C'></span>86600031404----21 615 3 21 616 31141640600------datatablegrey----05229.6632
1333CH<sub>3</sub>OCHO<font color="red"> v=1</font>Methyl Formate9( 3, 6)- 9( 3, 7) AJPL--153.0547153.233534.516760.0-9.37024--05361.0499220.21031220.467595.3610499 (3.0E-4), <span style = 'color: #DC143C'>5.3610499</span><span style = 'color: #DC143C'></span>38600031404----9 3 6 3 9 3 7 31141640700------datatablegrey----05361.0499
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate29( 8,21)-29( 8,22) EJPL--209.4473209.632059.383770.0-9.50232--15538.6728301.34621301.612025.5386728 (3.0E-4), <span style = 'color: #DC143C'>5.5386728</span><span style = 'color: #DC143C'></span>118600031404----29 821 2 29 822 11141640800------datatablegrey----05538.6728
393CH<sub>3</sub>OCHO <font color="red">v=0</font>Methyl Formate29( 8,21)-29( 8,22) AJPL--209.4498209.634899.385650.0-9.49981--15549.0032301.34981301.616125.5490032 (3.0E-4), <span style = 'color: #DC143C'>5.5490032</span><span style = 'color: #DC143C'></span>118600031404----29 821 0 29 822 01141640900------datatablegrey----05549.0032

Search for Recombination Lines#

dysh has special methods to search for recombination lines of Hydrogen, Helium, and Carbon. SpectralLineSearch.recomb will search for a specific atom/transition, while SpectralLineSearch.recomball will search for all three species.

minfreq = 300*u.MHz
maxfreq = 2.0*u.GHz
table = SpectralLineSearch.recomb(minfreq, maxfreq,
                                  cat='gbtrecomb',
                                  line="Hebeta")
table
Table length=165
species_idnamechemical_nameresolved_QNslinelistLovasASTIntensitylower_state_energyupper_state_energysijmu2sijaijintintensityLovas_NRAOrest_frequencylower_state_energy_Kupper_state_energy_KorderedFreqmeasFrequpperStateDegenmoleculeTagqnCodelabref_Lovas_NISTrel_int_HFS_Lovasunres_quantum_numberslineidtransition_in_spacetransition_in_G358obsref_Lovas_NISTsource_Lovas_NISTtelescope_Lovas_NISTtransitionBandColorsearchErrorMessagesqlqueryrequestnumberobs_frequency
int64str8str25str17str6bytes1float64float64float64float64float64float64int64float64float64float64str56str38bytes1int64int64bytes1bytes1str13int64int64int64bytes1bytes1bytes1str13bytes1objectint64float64
1161He&beta;Helium Recombination LineHe ( 351 ) &beta;Recomb--0.00.00.00.00.0--1301.6855436647610.00.00.301686, <span style = 'color: #DC143C'>0.301686</span><span style = 'color: #DC143C'></span>--00----He(351)&beta;395658200------datatablegrey----0301.685543664761
1161He&beta;Helium Recombination LineHe ( 350 ) &beta;Recomb--0.00.00.00.00.0--1304.2714337659710.00.00.304271, <span style = 'color: #DC143C'>0.304271</span><span style = 'color: #DC143C'></span>--00----He(350)&beta;395658100------datatablegrey----0304.271433765971
1161He&beta;Helium Recombination LineHe ( 349 ) &beta;Recomb--0.00.00.00.00.0--1306.8869617776960.00.00.306887, <span style = 'color: #DC143C'>0.306887</span><span style = 'color: #DC143C'></span>--00----He(349)&beta;395658000------datatablegrey----0306.886961777696
1161He&beta;Helium Recombination LineHe ( 348 ) &beta;Recomb--0.00.00.00.00.0--1309.5325535354720.00.00.309533, <span style = 'color: #DC143C'>0.309533</span><span style = 'color: #DC143C'></span>--00----He(348)&beta;395657900------datatablegrey----0309.532553535472
1161He&beta;Helium Recombination LineHe ( 347 ) &beta;Recomb--0.00.00.00.00.0--1312.208642238061030.00.00.312209, <span style = 'color: #DC143C'>0.312209</span><span style = 'color: #DC143C'></span>--00----He(347)&beta;395657800------datatablegrey----0312.20864223806103
1161He&beta;Helium Recombination LineHe ( 346 ) &beta;Recomb--0.00.00.00.00.0--1314.9156685964110.00.00.314916, <span style = 'color: #DC143C'>0.314916</span><span style = 'color: #DC143C'></span>--00----He(346)&beta;395657700------datatablegrey----0314.915668596411
1161He&beta;Helium Recombination LineHe ( 345 ) &beta;Recomb--0.00.00.00.00.0--1317.6540809860850.00.00.317654, <span style = 'color: #DC143C'>0.317654</span><span style = 'color: #DC143C'></span>--00----He(345)&beta;395657600------datatablegrey----0317.654080986085
1161He&beta;Helium Recombination LineHe ( 344 ) &beta;Recomb--0.00.00.00.00.0--1320.424335603228030.00.00.320424, <span style = 'color: #DC143C'>0.320424</span><span style = 'color: #DC143C'></span>--00----He(344)&beta;395657500------datatablegrey----0320.42433560322803
1161He&beta;Helium Recombination LineHe ( 343 ) &beta;Recomb--0.00.00.00.00.0--1323.2268966241660.00.00.323227, <span style = 'color: #DC143C'>0.323227</span><span style = 'color: #DC143C'></span>--00----He(343)&beta;395657400------datatablegrey----0323.226896624166
.........................................................................................................
1161He&beta;Helium Recombination LineHe ( 196 ) &beta;Recomb--0.00.00.00.00.0--11721.072570308670.00.01.721073, <span style = 'color: #DC143C'>1.721073</span><span style = 'color: #DC143C'></span>--00----He(196)&beta;395642700------datatablegrey----01721.07257030867
1161He&beta;Helium Recombination LineHe ( 195 ) &beta;Recomb--0.00.00.00.00.0--11747.55107052093010.00.01.747551, <span style = 'color: #DC143C'>1.747551</span><span style = 'color: #DC143C'></span>--00----He(195)&beta;395642600------datatablegrey----01747.5510705209301
1161He&beta;Helium Recombination LineHe ( 194 ) &beta;Recomb--0.00.00.00.00.0--11774.57553115581980.00.01.774576, <span style = 'color: #DC143C'>1.774576</span><span style = 'color: #DC143C'></span>--00----He(194)&beta;395642500------datatablegrey----01774.5755311558198
1161He&beta;Helium Recombination LineHe ( 193 ) &beta;Recomb--0.00.00.00.00.0--11802.160096640620.00.01.80216, <span style = 'color: #DC143C'>1.80216</span><span style = 'color: #DC143C'></span>--00----He(193)&beta;395642400------datatablegrey----01802.16009664062
1161He&beta;Helium Recombination LineHe ( 192 ) &beta;Recomb--0.00.00.00.00.0--11830.319353429690.00.01.830319, <span style = 'color: #DC143C'>1.830319</span><span style = 'color: #DC143C'></span>--00----He(192)&beta;395642300------datatablegrey----01830.31935342969
1161He&beta;Helium Recombination LineHe ( 191 ) &beta;Recomb--0.00.00.00.00.0--11859.068346205050.00.01.859068, <span style = 'color: #DC143C'>1.859068</span><span style = 'color: #DC143C'></span>--00----He(191)&beta;395642200------datatablegrey----01859.06834620505
1161He&beta;Helium Recombination LineHe ( 190 ) &beta;Recomb--0.00.00.00.00.0--11888.422594759070.00.01.888423, <span style = 'color: #DC143C'>1.888423</span><span style = 'color: #DC143C'></span>--00----He(190)&beta;395642100------datatablegrey----01888.42259475907
1161He&beta;Helium Recombination LineHe ( 189 ) &beta;Recomb--0.00.00.00.00.0--11918.398111591760.00.01.918398, <span style = 'color: #DC143C'>1.918398</span><span style = 'color: #DC143C'></span>--00----He(189)&beta;395642000------datatablegrey----01918.39811159176
1161He&beta;Helium Recombination LineHe ( 188 ) &beta;Recomb--0.00.00.00.00.0--11949.011420256970.00.01.949011, <span style = 'color: #DC143C'>1.949011</span><span style = 'color: #DC143C'></span>--00----He(188)&beta;395641900------datatablegrey----01949.01142025697
1161He&beta;Helium Recombination LineHe ( 187 ) &beta;Recomb--0.00.00.00.00.0--11980.279574493510.00.01.98028, <span style = 'color: #DC143C'>1.98028</span><span style = 'color: #DC143C'></span>--00----He(187)&beta;395641800------datatablegrey----01980.27957449351

Search all recombination lines. As with any astropy Table, you can limit the displayed columns with a list.

Alternatively, you could limit the columns being returned with the parameter columns, for example columns=['name', 'chemical_name', 'rest_frequency'].

table = SpectralLineSearch.recomball(minfreq, maxfreq,
                                     cat='gbtrecomb')
table[['name', 'chemical_name', 'rest_frequency']]
Table length=2332
namechemical_namerest_frequency
str10str27float64
H&epsilon;Hydrogen Recombination Line300.134854181299
H&gamma;Hydrogen Recombination Line300.310962014245
He&gamma;Helium Recombination Line300.43333977202605
C&gamma;Carbon Recombination Line300.460803205189
H&delta;Hydrogen Recombination Line300.536517272198
He&delta;Helium Recombination Line300.65898694452807
H&alpha;Hydrogen Recombination Line301.179832211236
He&alpha;Helium Recombination Line301.30256403663304
C&alpha;Carbon Recombination Line301.33010692796296
.........
C&gamma;Carbon Recombination Line1972.4531543176602
H&delta;Hydrogen Recombination Line1976.26579923329
He&delta;Helium Recombination Line1977.0711343954397
H&beta;Hydrogen Recombination Line1979.47293241347
He&beta;Helium Recombination Line1980.27957449351
C&beta;Carbon Recombination Line1980.46059726474
H&zeta;Hydrogen Recombination Line1982.9801715469202
H&epsilon;Hydrogen Recombination Line1995.0739903907402
H&gamma;Hydrogen Recombination Line1999.1730383073698
He&gamma;Helium Recombination Line1999.98770824883

Add in a redshift#

Suppose you wanted to find what CO lines would be in your observing band if they were emitted at a redshift of 1.2? You can add the redshift parameter to the search. The minimum and maximum frequency still refer to the observed band. In the resulting table, obs_frequency is the redshifted frequency value, that is the frequency at which the line will appear.

min_frequency=88*u.GHz
max_frequency=120*u.GHz
redshift=1.2
table = SpectralLineSearch.query_lines(min_frequency, max_frequency,cat='gbtlines', 
                                       redshift=redshift, chemical_name="Carbon Monoxide",
                                       intensity_lower_limit=-5,intensity_type="cdms")
table[['name', 'chemical_name', 'rest_frequency', 'obs_frequency',]]
Table length=13
namechemical_namerest_frequencyobs_frequency
str46str15float64float64
<sup>13</sup>C<sup>18</sup>OCarbon Monoxide209419.13895190.51727272727
<sup>13</sup>C<sup>18</sup>OCarbon Monoxide209419.172195190.53277272727
<sup>13</sup>C<sup>17</sup>OCarbon Monoxide214573.87397533.57863636363
<sup>13</sup>C<sup>17</sup>OCarbon Monoxide214573.87397533.57863636363
C<sup>18</sup>OCarbon Monoxide219560.354199800.16095454544
C<sup>18</sup>OCarbon Monoxide219560.356899800.16218181817
<sup>13</sup>CO <font color="red">v = 0</font>Carbon Monoxide220398.6765100181.21659090908
<sup>13</sup>CO <font color="red">v = 0</font>Carbon Monoxide220398.6842100181.22009090908
C<sup>17</sup>OCarbon Monoxide224714.187102142.81227272727
C<sup>17</sup>OCarbon Monoxide224714.187102142.81227272727
C<sup>17</sup>OCarbon Monoxide224714.385102142.90227272727
CO <font color="red">v = 0</font>Carbon Monoxide230538.0104789.99999999999
CO <font color="red">v = 0</font>Carbon Monoxide230538.0104789.99999999999

Example 2. Search within the frequency range of a Spectrum#

The Spectrum.query_lines. Spectrum.recomb, and Spectrum.recomball methods of Spectrum will use the minimum and maximum frequencies of the spectral axis and the redshift attribute of the Spectrum. Other keywords are the same as in SpectralLineSearch.

For this example we construct a fake spectrum, with 16384 channels that are 1 kHz wide and a rest frequency of 1.4240575 GHz.

cdelt1 = float((1000*u.Hz).value)
nchan = 16384
restfreq = float((1.4240575*u.GHz).to(u.Hz).value)
crval1 = restfreq
s = Spectrum.fake_spectrum(nchan=nchan, 
                           seed=123,
                           crval1=crval1, 
                           restfrq=restfreq, 
                           freqres=cdelt1, 
                           cdelt1=cdelt1, 
                           obsfreq=restfreq, 
                           dopfreq=restfreq, 
                           object='MyFakeSrc')
print(f"Spectrum redshift is {s.redshift}")
Spectrum redshift is 0.012754329663835273
s.plot(vel_frame='lsrk', doppler_convention='radio', xaxis_unit='km/s');
../_images/214637a96f90a369543a9b17ce5975563ab53de09b79dc71aebd239085af9d0a.png

Find the hydrogen recombination lines that could be in this spectrum, and display their name, chemical name and frequency (in MHz).

s.recomb(line='hydrogen', cat='gbtrecomb', columns=['name', 'chemical_name', 'rest_frequency','obs_frequency'])
Table length=5
namechemical_namerest_frequencyobs_frequency
str10str27float64float64
H&gamma;Hydrogen Recombination Line1436.174850144441418.0880871880854
H&beta;Hydrogen Recombination Line1440.719938071341422.5759356166463
H&epsilon;Hydrogen Recombination Line1443.26774384840021425.0916550783502
H&delta;Hydrogen Recombination Line1446.143937522431427.9316268165944
H&zeta;Hydrogen Recombination Line1447.126827094551428.9021381670088

Find all lines in the spectrum’s frequency range.

s.query_lines(cat='gbtlines',columns=['name', 'chemical_name', 'rest_frequency','obs_frequency'])
Table length=25
namechemical_namerest_frequencyobs_frequency
str62str16float64float64
17OHHydroxyl radical1445.03451426.8361612234746
ND<sub>3</sub>Ammonia1434.4481416.3829844856236
ND<sub>3</sub>Ammonia1434.4481416.3829844856236
ND<sub>3</sub>Ammonia1434.4481416.3829844856236
ND<sub>3</sub>Ammonia1434.4481416.3829844856236
ND<sub>3</sub>Ammonia1437.1791419.0795910761938
ND<sub>3</sub>Ammonia1448.0561429.819609342628
ND<sub>3</sub>Ammonia1448.0561429.819609342628
ND<sub>3</sub>Ammonia1448.0561429.819609342628
............
D<sub>2</sub><sup>13</sup>COFormaldehyde1440.63211422.4892037520992
c-H<sub>2</sub>C<sub>2</sub><sup>13</sup>COCyclopropenone1440.04881421.9132496604552
c-HDC<sub>3</sub>OCyclopropenone1446.97111428.7483722536094
<sup>13</sup>CH<sub>2</sub>CHCNVinyl Cyanide1439.30281421.1766445646788
CH<sub>3</sub>CH<sub>2</sub>CN <font color="red">v = 0 </font>Ethyl Cyanide1437.20311419.1033875678936
CH<sub>3</sub>CH<sub>2</sub>CN <font color="red">v = 0 </font>Ethyl Cyanide1437.25891419.1584848391328
CH<sub>3</sub>CH<sub>2</sub>CN <font color="red">v = 0 </font>Ethyl Cyanide1437.45281419.349942919657
CH<sub>2</sub>CNCyanomethyl1439.9761421.841366482208
<sup>13</sup>CH<sub>2</sub>CHCNVinyl Cyanide1439.30281421.1766445646788

To clear the cache, use:

SpectralLineSearch.clear_cache()

Final Stats#

Finally, at the end we compute some statistics over a spectrum, merely as a checksum if the notebook is reproducible.

s.check_stats(0.09961288 * u.K)
23:06:52.481 I rms is OK 

previous

Data Quality

next

Modifying Metadata

Contents
  • Dysh commands
  • Loading Modules
  • Setup
  • Example 1. Doing an online or local search with SpectralLineSearch
    • Do an online search for N2H+ lines between 80 and 400 GHz
    • Do a local search for methyl formate
    • Search for Recombination Lines
  • Add in a redshift
  • Example 2. Search within the frequency range of a Spectrum
  • Final Stats

By Green Bank Observatory

© Copyright 2023-2026, Green Bank Observatory.