SunPy Constants

The example shows all of the solar physics specific constants provided by SunPy.

from sunpy.sun import constants as con

All constants are stored in a dictionary. A list of all available keys which describe each constant can be had with the following command.

print(con.constants.keys())

Out:

dict_keys(['mass', 'radius', 'luminosity', 'mean distance', 'perihelion distance', 'aphelion distance', 'age', 'solar flux unit', 'visual magnitude', 'average angular size', 'surface area', 'average density', 'surface gravity', 'moment of inertia', 'volume', 'escape velocity', 'oblateness', 'metallicity', 'sunspot cycle', 'average intensity', 'effective temperature', 'mass conversion rate', 'center density', 'center temperature', 'absolute magnitude', 'mean energy production', 'ellipticity', 'GM'])

The following command will display all constants.

print(con.print_all())

Out:

         key           ...
---------------------- ...
                  mass ...
                radius ...
            luminosity ...
         mean distance ...
   perihelion distance ...
     aphelion distance ...
                   age ...
       solar flux unit ...
      visual magnitude ...
  average angular size ...
                   ... ...
           metallicity ...
         sunspot cycle ...
     average intensity ...
 effective temperature ...
  mass conversion rate ...
        center density ...
    center temperature ...
    absolute magnitude ...
mean energy production ...
           ellipticity ...
                    GM ...
Length = 28 rows

Total running time of the script: ( 0 minutes 0.098 seconds)

Gallery generated by Sphinx-Gallery