irfpy.jupsci.iotorus

Io torus model

class irfpy.jupsci.iotorus.SimpleNeutralCloudModel(nmax=500.0, radius=0.1, head=45.0, trail=10.0)[source]

Bases: object

A simple neutral cloud model.

The coordinate system is Io fixed frame, meaning that the Io is at (5.9, 0, 0) regardless of time. Jupiter is obviously the origin of the frame. The Io rotation axis around the Jupiter is in z direction. The unit of the length is normalized by the Jupiter radius.

The density is retrieved by the get_density() method. The returned is the in the unit of /cm^3.

The density model is assumed very simple.

  • At Io, the maximum density of 500 /cc

  • The center of the neutral cloud is r=5.9. Note that people knows

    that this assumption is too crude.

  • The radius (HWHM) of the neutral cloud is 0.1 Rj (~7000 km). Exponential distribution assumed. (Smyth+ 2005)

  • In the azimuthal HWHM is 45 deg for the heading (plus) direction and 10 deg for trailing (minus) direction. Exponential distribution assumed.

>>> ncm = SimpleNeutralCloudModel()
>>> print(ncm.get_density(5.9, 0, 0))
500.0
logger = None
get_density(x, y, z)[source]

Return the density in the unit of cm-3

Parameters

x – In Jupiter radii

>>> ncm = SimpleNeutralCloudModel()
>>> print(ncm.get_density(5.9, 0, 0))
500.0
>>> print(ncm.get_density(0, 5.9, 0))
125.0
>>> print(ncm.get_density(0, -5.9, 0))
7.8125
>>> print(ncm.get_density([0, 0], [5.9, -5.9], [0, 0]))
[ 125.        7.8125]
class irfpy.jupsci.iotorus.TwoPeakModel[source]

Bases: object

Two peak model

Two peak model of Io Neutral cloud. Io is assumed to be at (5.9, 0, 0).

get_density(x, y, z)[source]
class irfpy.jupsci.iotorus.RotatingNeutralCloud2(model)[source]

Bases: object

Rotating neutral cloud model with array support.

Similar to RotatingNeutralCloud, but support multiple phases and positions.

For example, RotatingNeutralCloud only support single phase each time.

>>> incr = RotatingNeutralCloud(TwoPeakModel())
>>> incr.set_iophase(np.deg2rad(0.))   # Io phase 0.
>>> print('%.1f' % incr.get_density(0, 6.0, 0))
22.7
>>> print('%.1f' % incr.get_density(0, 6.0, 0))
22.7
>>> incr.set_iophase(np.deg2rad(30.))  # Io phase 30 deg.
>>> print('%.1f' % incr.get_density(0, 6.0, 0))
80.4

It may also accept the array of positions, if the Io phase is fixed.

>>> incr.set_iophase(np.deg2rad(45.))  # Io phase 45 deg.
>>> xyz = incr.get_density([0., 0, 0, 0], [4, 5, 6, 7], [0, 0, 0, 0])
>>> print('%.1f %.1f %.1f %.1f'  % (xyz[0], xyz[1], xyz[2], xyz[3]))
2.1 8.5 191.6 6.5

On the other hand, this RotatingNeutralCloud2 can give phase for each data.

The usage is as follows. No set_iophase method allowed, while you may use iophase keyword in calling get_density().

>>> incr2 = RotatingNeutralCloud2(TwoPeakModel())
>>> print('%.1f' % incr2.get_density(0, 6, 0, iophase=np.deg2rad(30)))
80.4
>>> n = incr2.get_density([0., 0, 0, 0, 0, 0], [6., 6, 4, 5, 6, 7],
...                 [0., 0, 0, 0, 0, 0], iophase=np.deg2rad([0., 30., 45., 45., 45., 45.]))
>>> print('%.1f %.1f %.1f %.1f %.1f %.1f' % (n[0], n[1], n[2], n[3], n[4], n[5]))
22.7 80.4 2.1 8.5 191.6 6.5

Of course you may still use RotatingNeutralCloud, but this RotatingNeutralCloud2 may provide better performance. From a simple test in apps130106_iotorus_performance.ioncrot_getdensity.py, about 10 times better performance.

get_density(x, y, z, iophase=None)[source]
class irfpy.jupsci.iotorus.RotatingNeutralCloud(model)[source]

Bases: object

Rotating neutral cloud model

You can make object of the “non-rotating” model (TwoPeakModel and SimpleNeutralCloudModel) first, and wrap by this class.

>>> inc = TwoPeakModel()
>>> print('%.1f' % inc.get_density(0, 6.0, 0))
22.7

This is the density at 90 degrees ahead of the Io.

>>> incr = RotatingNeutralCloud(inc)
>>> incr.set_iophase(np.deg2rad(30))
>>> print('%.1f' % incr.get_density(-3.0, 5.196, 0))
22.7

To get the same value for Io phase 30 degrees, the position is 120 degrees from the x axis, i.e. (-3.0, 5.196, 0).

>>> print('%.5f' %inc.get_density(5, 0, 0))
14.41595
>>> incr.set_iophase(np.deg2rad(90))
>>> print('%.5f' %incr.get_density(0, 5, 0))
14.41595
Parameters

model – Neutral cloud model. Should have get_density method.

set_iophase(phase_r)[source]

Set the Io phase

Parameters

phase_r – Phase in radians.

get_density(x, y, z)[source]
class irfpy.jupsci.iotorus.PlasmaTorusEnvdoc[source]

Bases: object

Plasma torus model employed from environment document with extrapolation.

get_density(x, y, z)[source]

Return the density

Parameters
  • x – Scalar or (N,) shaped np.array. Unit of Rj.

  • y – Scalar or (N,) shaped np.array. Unit of Rj.

  • z – Scalar or (N,) shaped np.array. Unit of Rj.

Returns

Density in cm^3. Scalar or (N,) shaped np.array

>>> p = PlasmaTorusEnvdoc()
>>> print(p.get_density(3, 4, 0))  # r=5.
100.0
>>> print(p.get_density([2, 0, 0, 13], [0, 0, 6, 0], [0, 5, 0, 0]))
[  1.60000000e+00   1.00000000e+02   1.70000000e+03   3.90000000e+00]
>>> print(p.get_density(3, 5, 100))  # r>25.
0.0
>>> print(p.get_density([3, 0], [5, 0], [100, 0]))  # r>25.
[ 0.   0.1]
get_velocity(x, y, z)[source]

Return the velocity, in km/s

Corotational flow assumed, but no tilt of magnetic field assumed. So in this method, the magnetic field axis is parallel to the rotation axis.

>>> p = PlasmaTorusEnvdoc()
>>> print('%.2f' % p.get_velocity(5.9, 0, 0)[1])
74.17
>>> print('%.2f' % p.get_velocity(0, 0, 5.9)[1])
0.00
>>> print('%.2f' % p.get_velocity(0, 5.9 / np.sqrt(2), 5.9 / np.sqrt(2))[0])
-52.45

You can get multiple data at once.

>>> vels = p.get_velocity([0, 1, 2, 3], [0, 1, 2, 3], [1, 1, 2, 3])
>>> print(vels.shape)
(3, 4)
class irfpy.jupsci.iotorus.PlasmaTorusEnvdocL[source]

Bases: irfpy.jupsci.iotorus.PlasmaTorusEnvdoc

Plasma torus model from environment document with extrapolation.

Constant density along same L-value. Use :class:PlasmaTorusEnvdocLSech6` for more realistic analysis.

get_density(x, y, z)[source]

Return the density

Parameters
  • x – Scalar or (N,) shaped np.array. Unit of Rj.

  • y – Scalar or (N,) shaped np.array. Unit of Rj.

  • z – Scalar or (N,) shaped np.array. Unit of Rj.

Returns

Density in cm^3. Scalar or (N,) shaped np.array

>>> p = PlasmaTorusEnvdoc()
>>> print(p.get_density(3, 4, 0))  # r=5.
100.0
>>> print(p.get_density([2, 0, 0, 13], [0, 0, 6, 0], [0, 5, 0, 0]))
[  1.60000000e+00   1.00000000e+02   1.70000000e+03   3.90000000e+00]
>>> print(p.get_density(3, 5, 100))  # r>25.
0.0
>>> print(p.get_density([3, 0], [5, 0], [100, 0]))  # r>25.
[ 0.   0.1]
class irfpy.jupsci.iotorus.PlasmaTorusEnvdocLScaleHeight(Ti=100.0, Ap=20.0)[source]

Bases: irfpy.jupsci.iotorus.PlasmaTorusEnvdocL

Plasma torus model extended toward latitude.

Starting from Envdoc. The “equatorial” plasma density is from the environment document. See also (PlasmaTorusEnvdocL). exp (-(z/H)^2) dependence is assumed, where z is the distance to the “equator” from the observation point along B field. H is the scale height, which can be retrieved assuming

\[H = 0.64 \times \sqrt{Ti/Ai}\]

where Ti (=100 eV as default) is the temperature and Ai is the average mass (20, as deafult).

Under the dipole assumption, z is taken from the irfpy.util.dipole.distance_along() function.

More for developer

See same-level subclass PlasmaTorusEnvdocLSech6 how to implement.

get_density(xx, yy, zz)[source]

Return the density

Parameters
  • x – Scalar or (N,) shaped np.array. Unit of Rj.

  • y – Scalar or (N,) shaped np.array. Unit of Rj.

  • z – Scalar or (N,) shaped np.array. Unit of Rj.

Returns

Density in cm^3. Scalar or (N,) shaped np.array

>>> p = PlasmaTorusEnvdoc()
>>> print(p.get_density(3, 4, 0))  # r=5.
100.0
>>> print(p.get_density([2, 0, 0, 13], [0, 0, 6, 0], [0, 5, 0, 0]))
[  1.60000000e+00   1.00000000e+02   1.70000000e+03   3.90000000e+00]
>>> print(p.get_density(3, 5, 100))  # r>25.
0.0
>>> print(p.get_density([3, 0], [5, 0], [100, 0]))  # r>25.
[ 0.   0.1]
class irfpy.jupsci.iotorus.PlasmaTorusEnvdocLSech6(idx=6.0)[source]

Bases: irfpy.jupsci.iotorus.PlasmaTorusEnvdocL

Plasma torus model extended from PlasmaTorusEnvdoc.

The equatorial plasma density is from the environment document (PlasmaTorusEnvdoc). In addition, sech(6t) dependence is added along the L-value to simulate the latidudal dependence. Note that t is tha latitude.

The “equator” here is slightly problematic. The maximum density plane should be the best term. As the coordinate system used here is indeed arbitrary (or precisely spealing maximum density plane is THE plane for z=0).

The maximum density plane is, indeed, between the Jupiter equatorial plane (system III) and the magnetic equator.

get_density(x, y, z)[source]

Return the density.

Parameters
  • x – Scalar or (N,) shaped np.array. Unit of Rj.

  • y – Scalar or (N,) shaped np.array. Unit of Rj.

  • z – Scalar or (N,) shaped np.array. Unit of Rj.

Returns

Density in cm^3. Scalar or (N,) shaped np.array

>>> p = PlasmaTorusEnvdocLSech6()
>>> print(p.get_density(3, 4, 0))  # r=5. at equator.
100.0
>>> print(p.get_density([2, 0, 0, 13], [0, 0, 6, 0], [0, 5, 0, 0]))
[  1.60000000e+00   0.00000000e+00   1.70000000e+03   3.90000000e+00]
>>> print(p.get_density(3, 5, 100))  # r>25.
0.0
>>> print(p.get_density([3, 0], [5, 0], [100, 1]))  # r>25.
[ 0.  0.]
class irfpy.jupsci.iotorus.PlasmaTorusEnvdocCos2lat[source]

Bases: object

Plasma torus model extended from PlasmaTorusEnvdoc.

The equatorial plasma density is from the environment document (PlasmaTorusEnvdoc). In addition, the cos^2(lat) dependence is added. The dependence is totally conceptional, so that it does not provide any real configuration. Rather, use PlasmaTorusEnvdocSech6.

get_density(x, y, z)[source]

Return the density

Parameters
  • x – Scalar or (N,) shaped np.array. Unit of Rj.

  • y – Scalar or (N,) shaped np.array. Unit of Rj.

  • z – Scalar or (N,) shaped np.array. Unit of Rj.

Returns

Density in cm^3. Scalar or (N,) shaped np.array

>>> tor0 = PlasmaTorusEnvdoc()
>>> tor1 = PlasmaTorusEnvdocCos2lat()

In the equator, these models returns the same.

>>> print('%.2f' % tor0.get_density(5.9, 0, 0))
1280.57
>>> print('%.2f' % tor1.get_density(5.9, 0, 0))
1280.57

In the pole, first model returns high density while cosine model returns 0.

>>> print('%.2f' % tor0.get_density(0, 0, 5.9))
1280.57
>>> print('%.2f' % tor1.get_density(0, 0, 5.9))
0.00
irfpy.jupsci.iotorus.doctests()[source]