Using PhysΒΆ

Phys is designed to contain and query physical properties for small bodies; functions to query these properties are available. from_sbdb queries the JPL Small-body Database Browser (SBDB) for physical properties and stores the data in a Phys object, offering the same functionality as all the other data functions, including the use of units.

As an example, the following code will query the properties for a small number of asteroids:

>>> from sbpy.data import Phys
>>> phys = Phys.from_sbdb(['Ceres', '12893', '3552'])  # doctest: +REMOTE_DATA
>>> phys['targetname', 'H', 'diameter'] # doctest: +SKIP
<QTable length=3>
        targetname            H    diameter
                                      km
          str26            float64 float64
-------------------------- ------- --------
                   1 Ceres    3.34    939.4
 12893 Mommert (1998 QS55)    13.9    5.214
3552 Don Quixote (1983 SA)    12.9     19.0

Please note that the SBDB database is not complete with respect to physical properties and should be considered as a sparse dataset.

Phys also contains a function to query molecular data that might be useful for various calculations such as production rate calculations. from_jplspec queries the JPL Molecular Spectroscopy Catalog molecular properties, and stores the data in a Phys object, offering the same functionality as all the other data functions, including the use of units. The results from from_jplspec include the following data:

Transition frequency
Temperature
Integrated line intensity at 300 K
Partition function at 300 K
Partition function at designated temperature
Upper state degeneracy
Upper level energy in Joules
Lower level energy in Joules
Degrees of freedom
>>> from sbpy.data.phys import Phys
>>> import astropy.units as u
>>> temp_estimate = 47. * u.K
>>> transition_freq = (230.53799 * u.GHz).to('MHz')
>>> mol_tag = '^CO$'
>>> mol_data = Phys.from_jplspec(temp_estimate, transition_freq, mol_tag)
>>> mol_data
<QTable length=1>
Transition frequency Temperature ... Degrees of freedom Molecule Identifier
        MHz               K      ...
      float64          float64   ...       int64               int64
-------------------- ----------- ... ------------------ -------------------
            230538.0        47.0 ...                  2               28001