appl121105_iotorus.jupiter
ΒΆ
Jupiter module.
Jupiter module, with particular interest in magnetic dipole phase.
''' Jupiter module.
Jupiter module, with particular interest in magnetic dipole phase.
'''
import numpy as np
from . import parameters as p
class JupiterPhase:
'''Jupiter class, with particular interest in magnetic dipole phase
'''
def __init__(self, inital_subsolar_longitude=0.):
''' The Jupiter class.
:keyword inital_subsolar_longitude: Initial (t=0) system III
longitude of the subsolar point in degrees.
The magnetic dipole is system III longitude 200 degrees and
system III latitude of 80 degrees.
'''
self.initsslon = np.deg2rad(inital_subsolar_longitude)
self.dipolelon = np.deg2rad(p.maglon)
self.dipolelat = np.deg2rad(p.maglat)
def _omega_t(self, t=0.):
''' Return the phase angle in radian for the given times
Here, the phase angle is how much is the rotation angle is.
>>> jup = JupiterPhase()
>>> print(jup._omega_t([0, 10, 100, 36000]))
[ 0.00000000e+00 1.75851814e-03 1.75851814e-02 6.33066530e+00]
'''
omega = 2 * np.pi / p.tj
return omega * np.array(t)
def get_subsolar_longitude_sys3(self, t=0.):
''' Return the phase angle in degrees for the given times.
>>> jup = JupiterPhase(inital_subsolar_longitude=30.)
>>> print(jup.get_subsolar_longitude_sys3(0))
30.0
>>> print('%.3f' % jup.get_subsolar_longitude_sys3(t=3000.))
-0.227
'''
return np.rad2deg(self.initsslon - self._omega_t(t=t))
def get_magnetic_dipole_lonitude_jeqs(self, t=0.):
''' Return the magnetic dipole longitude in degrees in JEqS frame.
'''
return np.rad2deg(self.initsslon + self.dipolelon + self._omega_t(t=t))
import unittest
import doctest
def doctests():
return unittest.TestSuite((
doctest.DocTestSuite(),
))
if __name__ == '__main__':
unittest.main(defaultTest='doctests')