irfpy.mima.mode

IMA mode.

See also irfpy.imacommon.imamode.

irfpy.mima.mode.get(t)[source]

Return the mode at t as int from the operation file

Warning

This function relies on the operation file, while operation module is not continuously maintained nowadays (2020-09-02).

For usual data analysis, IMA mode can be obtained from the data itself. Example follows.

>>> from irfpy.mima import rawdata
>>> dc = rawdata.DataCenterCount3d()
>>> import datetime
>>> t = datetime.datetime(2004, 1, 22, 22, 40)
>>> tdata, imadata = dc.nearest(t)     # This is a nominal way of getting data.
>>> print(imadata.mode_data)     # mode_data refer to the mode of the original data.
<IMA:Mode-24 (Exm-0) M32/A16/E96/P16>
Returns

The mode used for IMA operation

If unknown or invalid, -999 is returned.

>>> import datetime
>>> import irfpy.mexop.imastatus
>>> if not irfpy.mexop.imastatus.isdb():
...     print("No data source is found.")    
... else:
...     print(get(datetime.datetime(2004, 1, 22, 22, 40)))
24
...     print get(datetime.datetime(2004, 1, 22))
8
...     print get(datetime.datetime(1988, 3, 15))
-999