irfpy.imacommon.imamode

IMA/ICA mode for MEX, VEX, and Rosetta.

IMA has 40 selectable mode defined at the time of operation. The mode defines, for a primary purpose, the binning parameter (i.e., how many bins are used for data retrieval).

The mode 24 (M24) was generally used for MEX, and later half of VEX operation. The mode 25 (M25) was generally used for the first half of VEX mission.

M provides the list of the mode object. You may also use the synonim, Mnn.

>>> print(M24)
<IMA:Mode-24 (Exm-0) M32/A16/E96/P16>
>>> print(M[24])
<IMA:Mode-24 (Exm-0) M32/A16/E96/P16>
>>> print(M24 == M[24])
True

You may get the binning parameter using m, a, e, and p as follows:

>>> print(M24.e)
96
>>> print(M24.p, M25.p)
16 8
>>> print(M25.m, M25.a, M25.e, M25.p)
32 16 96 8

The mode is defined in the The ICA-IMA TC/TM data formats and related software aspects by Hans Borg.

Useful function

If you want to prepare a new array that has the same shape of the specific mode, you can use get_zeros_array3d() or get_zeros_array2d() method.

>>> arr25 = M25.get_zeros_array3d()
>>> print(arr25.shape)
(32, 16, 96, 8)

IRFPY extension

After a long operation, the IMA operation mode became more and more complex. There are several update of the onboard software, and in particular for the introduction of fast scan (24s time resolution), the fast scan cannot repreesnted by the exsiting table.

IRF extends the table, thus, as follows.

M40: "IRFPY_fast24s". M32/A16/E32/P6
M41: "IRFPY_fast24s_emul". M32/A16/E64/P16, but [:, :, 32:, 6:] will be masked.
class irfpy.imacommon.imamode.Mode(index)[source]

Bases: object

Mode class.

Users are note recommended to instance this class. Use M [nn] or Mnn for practical use.

>>> print(M24)
<IMA:Mode-24 (Exm-0) M32/A16/E96/P16>

If entry is not defined, -1 is filled.

name

Name of the mode

i

Index number of the mode

m

Mass number of the mode

a

Azimuth number of the mode

e

Energy number of the mode

p

Polar number of the mode

maxset

Maxset of the mode

get_zeros_array2d()[source]

Return an array fitting to the mode filled by zero.

Returns

An array, with the shape of (m, a, e), with values initialized by zero.

>>> arr = M24.get_zeros_array2d()
>>> print(arr.shape)           # The array shape is for mode 24
(32, 16, 96)
>>> print((arr == 0).all())    # All elements are zero
True
get_zeros_array3d()[source]

Return an array fitting to the mode filled by zero.

Returns

An array, with the shape of (m, a, e, p), with values initialized by zero.

>>> arr = M24.get_zeros_array3d()
>>> print(arr.shape)           # The array shape is for mode 24
(32, 16, 96, 16)
>>> print((arr == 0).all())    # All elements are zero
True
irfpy.imacommon.imamode.M = [<IMA:Mode-00 ( Idle) M-1/A-1/E-1/P-1>, <IMA:Mode-01 ( Void) M-1/A-1/E-1/P-1>, <IMA:Mode-02 ( Mspo) M 2/A 1/E32/P 1>, <IMA:Mode-03 ( Void) M-1/A-1/E-1/P-1>, <IMA:Mode-04 ( Msis) M 6/A 1/E96/P 1>, <IMA:Mode-05 ( Mexm) M32/A 1/E96/P 1>, <IMA:Mode-06 ( Void) M-1/A-1/E-1/P-1>, <IMA:Mode-07 ( Void) M-1/A-1/E-1/P-1>, <IMA:Mode-08 (Nrm-0) M 6/A16/E96/P16>, <IMA:Mode-09 (Nrm-1) M 6/A16/E96/P 8>, <IMA:Mode-10 (Nrm-2) M 6/A16/E96/P 4>, <IMA:Mode-11 (Nrm-3) M 6/A16/E96/P 2>, <IMA:Mode-12 (Nrm-4) M 6/A 8/E96/P 2>, <IMA:Mode-13 (Nrm-5) M 6/A 4/E96/P 2>, <IMA:Mode-14 (Nrm-6) M 3/A 4/E96/P 2>, <IMA:Mode-15 (Nrm-7) M 3/A 4/E96/P 1>, <IMA:Mode-16 (Har-0) M16/A16/E96/P16>, <IMA:Mode-17 (Har-1) M16/A16/E96/P 8>, <IMA:Mode-18 (Har-2) M16/A16/E96/P 4>, <IMA:Mode-19 (Har-3) M 8/A16/E96/P 4>, <IMA:Mode-20 (Har-4) M 4/A16/E96/P 4>, <IMA:Mode-21 (Har-5) M 2/A16/E96/P 4>, <IMA:Mode-22 (Har-6) M 2/A 8/E96/P 4>, <IMA:Mode-23 (Har-7) M 2/A 8/E96/P 2>, <IMA:Mode-24 (Exm-0) M32/A16/E96/P16>, <IMA:Mode-25 (Exm-1) M32/A16/E96/P 8>, <IMA:Mode-26 (Exm-2) M32/A16/E96/P 4>, <IMA:Mode-27 (Exm-3) M32/A16/E96/P 2>, <IMA:Mode-28 (Exm-4) M32/A 8/E96/P 2>, <IMA:Mode-29 (Exm-5) M32/A 4/E96/P 2>, <IMA:Mode-30 (Exm-6) M32/A 2/E96/P 2>, <IMA:Mode-31 (Exm-7) M32/A 2/E96/P 1>, <IMA:Mode-32 ( Test) M-1/A-1/E-1/P-1>, <IMA:Mode-33 ( Cal1) M-1/A-1/E-1/P-1>, <IMA:Mode-34 ( Cal2) M-1/A-1/E-1/P-1>, <IMA:Mode-35 ( Fake) M-1/A-1/E-1/P-1>, <IMA:Mode-36 ( Void) M-1/A-1/E-1/P-1>, <IMA:Mode-37 ( Void) M-1/A-1/E-1/P-1>, <IMA:Mode-38 ( Void) M-1/A-1/E-1/P-1>, <IMA:Mode-39 ( Void) M-1/A-1/E-1/P-1>, <IMA:Mode-40 (IRFPY_fast24) M32/A16/E32/P 6>, <IMA:Mode-41 (IRFPY_fast24_emul) M32/A16/E96/P16>]

List of mode object. Index is the mode number.

irfpy.imacommon.imamode.M24 = <IMA:Mode-24 (Exm-0) M32/A16/E96/P16>

Mode 24, which is the full mode, and generally used.

irfpy.imacommon.imamode.M25 = <IMA:Mode-25 (Exm-1) M32/A16/E96/P 8>

Mode 25, with elevation is half (8 polar).

irfpy.imacommon.imamode.M40 = <IMA:Mode-40 (IRFPY_fast24) M32/A16/E32/P 6>

Mode 40, extended by IRFPY. Fast 24s mode. EEPROM=13.

irfpy.imacommon.imamode.M41 = <IMA:Mode-41 (IRFPY_fast24_emul) M32/A16/E96/P16>

Mode 41, extended by IRFPY. Fast 24s mode. EEPROM=13. Emulating the full mode.

This is used to express the fast24s mode (EEPROM=13). The contents should be the same to M40, but the shape of the matrix and the binning parameters are emulating M24 (full mode).

This may be used for data analysis equivalent to the existing code assuming the matrix size as M24.

irfpy.imacommon.imamode.model(index)[source]

Return the list expression of the corresponding mode

irfpy.imacommon.imamode.moded(index)[source]

Return the dictionary expression of the corresponding mode