Skip to content

Commit 0061bed

Browse files
committed
Updated documentation and examples to match new input rules
1 parent 43c21ff commit 0061bed

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

docs/sbpy/spectroscopy.rst

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ JPLSpec Constants and Line Intensity Integral Conversion
1414
`sbpy.spectroscopy` has a function called ``molecular_data`` which takes care of
1515
querying the JPL Molecular Spectral Catalog through the use of
1616
`astroquery.jplspec` and calculates all the necessary constants needed for both
17-
production rate and Einstein coefficient calculations. The function
18-
``intensity_conversion`` takes care of converting the intensity line integral at
19-
300 K found in JPL Spec catalog and convert it closer to the temperature given
20-
by the user.
17+
production rate and Einstein coefficient calculations. ``molecular_data``
18+
returns an `sbpy.data.phys` instance with quantities in the order of: Transition
19+
Frequency, Temperature, Integrated line intensity at 300 K, and Partition
20+
function at 300 K. The function ``intensity_conversion`` takes care of
21+
converting the intensity line integral at 300 K found in JPL Spec catalog and
22+
convert it closer to the temperature given by the user.
2123

2224
.. code-block:: python
2325
@@ -82,18 +84,21 @@ section.
8284
.. code-block:: python
8385
8486
>>> from sbpy.spectroscopy import prodrate_np
87+
>>> from astropy.time import Time
88+
>>> from sbpy.data import Ephem
8589
>>> temp_estimate = 33. * u.K
86-
>>> target = '900918'
90+
>>> target = '103P'
8791
>>> vgas = 0.8 * u.km / u.s
8892
>>> aper = 30 * u.m
8993
>>> b = 1.13
9094
>>> mol_tag = 27001
9195
>>> transition_freq = 265.886434 * u.MHz
9296
>>> spectra = 1.22 * u.K * u.km / u.s
93-
>>> time = '2010-11-3 00:48:06'
97+
>>> time = Time('2010-11-3 00:48:06', format='iso')
98+
>>> ephemobj = Ephem(target, epochs=time.jd, id_type='id')
9499
>>> q = prodrate_np(spectra, temp_estimate, transition_freq,
95-
mol_tag, time, target, vgas, aper,
96-
b=b, id_type='id')
100+
mol_tag, ephemobj, vgas, aper,
101+
b=b)
97102
98103
>>> q
99104
<Quantity 1.0432591198553935e+25 1 / s>
@@ -113,6 +118,8 @@ model does account for the effects of photolysis.
113118
.. code-block:: python
114119
115120
>>> from sbpy.activity.gas import Haser
121+
>>> from astropy.time import Time
122+
>>> from sbpy.data import Ephem
116123
>>> coma = Haser(Q, v, parent)
117124
>>> Q = spec.production_rate(coma, molecule='H2O')
118125
@@ -126,14 +133,15 @@ model does account for the effects of photolysis.
126133
>>> vgas = 0.5 * u.km / u.s
127134
128135
>>> time = '2017-12-22 05:24:20'
136+
>>> ephemobj = Ephem(target, epochs=time.jd)
129137
>>> spectra = 0.26 * u.K * u.km / u.s
130138
131139
>>> parent = photo_timescale('CO') * vgas
132140
133141
>>> coma = Haser(Q_estimate, vgas, parent)
134142
135143
>>> Q = spec.production_rate(coma, spectra, temp_estimate,
136-
transition_freq, mol_tag, time, target,
144+
transition_freq, mol_tag, ephemobj,
137145
aper=aper, b=b)
138146
139147
>>> print(Q)
@@ -169,7 +177,7 @@ The names of the built-in sources are stored as an internal array. They can be
169177

170178
>>> from sbpy.spectroscopy import Sun
171179
>>> Sun.show_builtin()
172-
name description
180+
name description
173181
------------ -----------------------------------------------------------------
174182
E490_2014 E490-00a (2014) reference solar spectrum (Table 3)
175183
E490_2014LR E490-00a (2014) low resolution reference solar spectrum (Table 4)

sbpy/spectroscopy/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ def prodrate_np(self, spectra, temp_estimate, transition_freq,
509509
510510
>>> temp_estimate = 33. * u.K # doctest: +SKIP
511511
512-
>>> target = '900918' # doctest: +SKIP
512+
>>> target = '103P' # doctest: +SKIP
513513
514514
>>> vgas = 0.8 * u.km / u.s # doctest: +SKIP
515515
@@ -625,7 +625,7 @@ def prodrate_np(self, spectra, temp_estimate, transition_freq,
625625
au = einstein_coeff(temp_estimate, transition_freq, mol_tag)
626626

627627
photod = photod_rate(ephemobj, mol_tag)
628-
628+
629629
delta = photod["delta"]
630630

631631
calc = ((16*np.pi*k*t_freq.decompose() *

0 commit comments

Comments
 (0)