@@ -150,15 +150,19 @@ shown below:
150
150
>>> plt.xlabel(' Temperature (K)' )
151
151
>>> plt.ylabel(' Partition Function Value' )
152
152
>>> plt.title(' Parititon Fn vs Temp' )
153
- >>> plt.show()
154
153
155
154
.. plot ::
155
+ import matplotlib.pyplot as plt
156
+ from astroquery.linelists.cdms import CDMS
157
+ from scipy.optimize import curve_fit
156
158
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')
162
166
163
167
For non-linear molecules like H2CO, curve fitting methods can be used to
164
168
calculate production rates at different temperatures with the proportionality:
@@ -192,7 +196,6 @@ other temperatures using curve fitting models:
192
196
>>> plt.title(' Partition Function vs Temperature' )
193
197
>>> plt.xlabel(' Temperature' )
194
198
>>> plt.ylabel(' Log10 of Partition Function' )
195
- >>> plt.show()
196
199
197
200
198
201
.. plot ::
@@ -221,7 +224,6 @@ other temperatures using curve fitting models:
221
224
plt.title('Partition Function vs Temperature')
222
225
plt.xlabel('Temperature')
223
226
plt.ylabel('Log10 of Partition Function')
224
- plt.show()
225
227
226
228
227
229
We can then compare linear interpolation to the fitted interpolation above:
0 commit comments