Skip to content

Commit e54a51b

Browse files
committed
fix import
1 parent 4e17560 commit e54a51b

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

astroquery/linelists/cdms/tests/test_cdms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from astropy import units as u
66
from astropy.table import Table
7-
from astroquery.utils.cdms import CDMS
7+
from astroquery.linelists.cdms import CDMS
88

99

1010
def data_path(filename):

docs/cdms/cdms.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,19 @@ shown below:
150150
>>> plt.xlabel('Temperature (K)')
151151
>>> plt.ylabel('Partition Function Value')
152152
>>> plt.title('Parititon Fn vs Temp')
153-
>>> plt.show()
154153

155154
.. plot::
155+
import matplotlib.pyplot as plt
156+
from astroquery.linelists.cdms import CDMS
157+
from scipy.optimize import curve_fit
156158

157-
.. figure:: images/docplot_cdms_q.png
158-
:scale: 50%
159-
:alt: Plot of Partition Function vs Temperature
160-
161-
The resulting plot from the example above
159+
keys = [k for k in mol.keys() if 'lg' in k]
160+
temp = np.array([float(k.split('(')[-1].split(')')[0]) for k in keys])
161+
part = list(mol[keys][0])
162+
plt.scatter(temp,part)
163+
plt.xlabel('Temperature (K)')
164+
plt.ylabel('Partition Function Value')
165+
plt.title('Parititon Fn vs Temp')
162166

163167
For non-linear molecules like H2CO, curve fitting methods can be used to
164168
calculate production rates at different temperatures with the proportionality:
@@ -192,7 +196,6 @@ other temperatures using curve fitting models:
192196
>>> plt.title('Partition Function vs Temperature')
193197
>>> plt.xlabel('Temperature')
194198
>>> plt.ylabel('Log10 of Partition Function')
195-
>>> plt.show()
196199

197200

198201
.. plot::
@@ -221,7 +224,6 @@ other temperatures using curve fitting models:
221224
plt.title('Partition Function vs Temperature')
222225
plt.xlabel('Temperature')
223226
plt.ylabel('Log10 of Partition Function')
224-
plt.show()
225227

226228

227229
We can then compare linear interpolation to the fitted interpolation above:

0 commit comments

Comments
 (0)