Skip to content

Commit 3368a15

Browse files
committed
Adding imports to make scripts self contained
1 parent 143d4a2 commit 3368a15

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

docs/linelists/cdms/cdms.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
.. _astroquery.cdms:
1+
.. _astroquery.linelists.cdms:
22

3-
****************************************************************************
4-
Cologne Database for Molecular Spectroscopy (CDMS) Queries (astroquery.cdms)
5-
****************************************************************************
3+
******************************************************************************************
4+
Cologne Database for Molecular Spectroscopy (CDMS) Queries (``astroquery.linelists.cdms``)
5+
******************************************************************************************
66

77
Getting Started
88
===============
@@ -149,23 +149,24 @@ shown below:
149149
>>> plt.scatter(temp,part)
150150
>>> plt.xlabel('Temperature (K)')
151151
>>> plt.ylabel('Partition Function Value')
152-
>>> plt.title('Parititon Fn vs Temp')
152+
>>> plt.title('Partition Function vs Temperature')
153153

154154
.. plot::
155155
:context: reset
156156

157+
import numpy as np
157158
import matplotlib.pyplot as plt
158159
from astroquery.linelists.cdms import CDMS
159160

160161
result = CDMS.get_species_table()
161-
mol = result[result['TAG'] == 28503] #do not include signs of TAG for this
162+
mol = result[result['TAG'] == 28503] # do not include signs of TAG for this
162163
keys = [k for k in mol.keys() if 'lg' in k]
163164
temp = np.array([float(k.split('(')[-1].split(')')[0]) for k in keys])
164165
part = list(mol[keys][0])
165166
plt.scatter(temp,part)
166167
plt.xlabel('Temperature (K)')
167168
plt.ylabel('Partition Function Value')
168-
plt.title('Parititon Fn vs Temp')
169+
plt.title('Partition Function vs Temperature')
169170

170171
For non-linear molecules like H2CO, curve fitting methods can be used to
171172
calculate production rates at different temperatures with the proportionality:
@@ -204,12 +205,13 @@ other temperatures using curve fitting models:
204205
.. plot::
205206
:context: reset
206207

208+
import numpy as np
207209
import matplotlib.pyplot as plt
208210
from astroquery.linelists.cdms import CDMS
209211
from scipy.optimize import curve_fit
210212

211213
result = CDMS.get_species_table()
212-
mol = result[result['TAG'] == 30501] #do not include signs of TAG for this
214+
mol = result[result['TAG'] == 30501] # do not include signs of TAG for this
213215
def f(T, a):
214216
return np.log10(a*T**(1.5))
215217
keys = [k for k in mol.keys() if 'lg' in k]
@@ -248,12 +250,13 @@ We can then compare linear interpolation to the fitted interpolation above:
248250
.. plot::
249251
:context: reset
250252

253+
import numpy as np
251254
import matplotlib.pyplot as plt
252255
from astroquery.linelists.cdms import CDMS
253256
from scipy.optimize import curve_fit
254257

255258
result = CDMS.get_species_table()
256-
mol = result[result['TAG'] == 30501] #do not include signs of TAG for this
259+
mol = result[result['TAG'] == 30501] # do not include signs of TAG for this
257260
def f(T, a):
258261
return np.log10(a*T**(1.5))
259262
keys = [k for k in mol.keys() if 'lg' in k]

0 commit comments

Comments
 (0)