irfpy.mima.imaextra_util

IMA extra processing module.

Differential flux

IMA extra data (irfpy.mima.imaextra.ImaExtra) is in counts. Here the IMA extra data is converted to the differential flux.

Simple conversion follows the standard definition of the G-factor, and no quality control is implemented.

class irfpy.mima.imaextra_util.SimpleConvCJ(imaextraobj, lowest_ene_P=300, lowest_ene_G=300, lowest_ene_O=30)[source]

Bases: object

Claculating conversion between counts, differential flux, and moment for IMA extra

Users can also use high-level functions: simple_jH() or simple_jO()

>>> from irfpy.mima import imaextra
>>> import datetime
>>> t0 = datetime.datetime(2011, 3, 3, 14)
>>> t1 = datetime.datetime(2011, 3, 3, 15)
>>> imaextradata = imaextra.getImaExtra(t0, t1)
>>> print(imaextradata.ndat)
18
>>> converter = SimpleConvCJ(imaextradata)
>>> print(converter.energytable().shape)
(96, 18)
>>> jHr = converter.jHreal()
>>> print(jHr.shape)
(16, 96, 16, 18)
>>> import numpy as np
>>> print('{:.2f}'.format(np.nanmax(jHr)))
173704.77
>>> jG = converter.jGhost()
>>> print('{:.2f}'.format(np.nanmax(jG)))
32947337.26
>>> jO = converter.jO()
>>> print('{:.2f}'.format(np.nanmax(jO)))
42098.34

Initialize the simple conversion class.

Parameters
  • imaextraobj (irfpy.mima.imaextra.ImaExtra) – IMAEXTRA object

  • lowest_ene_P – Lowest energy of proton to be considered

  • lowest_ene_G – Lowest energy of ghost ot be considered

  • lowest_ene_O – Lowest energy of oxygen to be considered

dPhi = 0.39269908169872414
dt = 0.1209
energytable(lowest_energy=0)[source]

Return the time series of energy table

Returns

(96, N) array of energy table in eV.

j(species, lowest_energy=0)[source]

Calculate the differential flux for a specific species.

Parameters

species – Species. Either of (“Proton”, “ProtonGhost”, or “Oxygen”).

Returns

An array of differential flux in [AEPT] order. Unit is in /cm2 s sr eV

jHreal()[source]

Calculate the proton differential flux (real signal).

Returns

An array of differential flux in [AEPT] order. Unit is in /cm2 s sr eV

jGhost()[source]

Calcuate the proton differential flux from ghost signal.

Returns

An array of differential flux in [AEPT] order.

jO()[source]
irfpy.mima.imaextra_util.simple_jH(imaextraobj, lowest_energy=300)[source]

Calculate the differential flux of proton.

Parameters
  • imaextraobj (irfpy.imaextra.ImaExtra) – IMAEXTRA object.

  • lowest_energy – Lowest energy to be used.

Returns

An array of differential flux. [AEPT] order.

irfpy.mima.imaextra_util.simple_jG(imaextraobj, lowest_energy=300)[source]

Calculate the differential flux of proton ghost.

Parameters
  • imaextraobj (irfpy.imaextra.ImaExtra) – IMAEXTRA object.

  • lowest_energy – Lowest energy to be used.

Returns

An array of differential flux. [AEPT] order.

irfpy.mima.imaextra_util.simple_jO(imaextraobj, lowest_energy=30)[source]

Calculate the differential flux of proton.

Parameters
  • imaextraobj (irfpy.imaextra.ImaExtra) – IMAEXTRA object.

  • lowest_energy – Lowest energy to be used.

Returns

An array of differential flux. [AEPT] order.