irfpy.mima.background

MEX/IMA background proxy module

It provides a getter of background proxy.

The best-practice is to use DataCenterMimaBackground class as follows.

>>> from irfpy.mima import background
>>> dc = background.DataCenterMimaBackground()
>>> import datetime
>>> tobs, (back, total) = dc.nearest(datetime.datetime(2010, 1, 9, 20, 10))
>>> print(tobs)   # Observed time nearest to the given time (2010-01-09:20:10
2010-01-09 20:09:40.355900
>>> print(back)   # Background count
3.45
>>> print(total)   # Total count
68115.0
class irfpy.mima.background.DataCenterMimaBackground[source]

Bases: irfpy.imacommon.background.DataCenterBackground

MEX IMA background data center

irfpy.mima.background.isdb()[source]
irfpy.mima.background.get_background_level(t0, t1, refresh=False, base=None)[source]

Get MEX background level.

Parameters
  • t0 – Time start.

  • t1 – Time end.

  • refresh – If True, a new database is created.

  • base – Give base path of the dataset. If None, the dataset path is given from .irfpyrc.

Returns

(time array, bg array).

>>> import datetime
>>> t0 = datetime.datetime(2006, 12, 4)
>>> t1 = datetime.datetime(2006, 12, 7)
>>> bg = get_background_level(t0, t1)  
>>> print(len(bg[1]))  
294