irfpy.mnpi.background

MEX/NPI background proxy module

It provides a getter of background proxy.

The best practice is to use DataCenterMnpiBackground class as folows.

>>> from irfpy.mnpi import background
>>> dc = background.DataCenterMnpiBackground()
>>> import datetime
>>> tobs, (back, total) = dc.nearest(datetime.datetime(2010, 1, 9, 20, 10))
>>> print(tobs)
2010-01-09 20:10:00.513000
>>> print(back)
4.0
>>> print(total)
143.0
class irfpy.mnpi.background.DataCenterMnpiBackground[source]

Bases: irfpy.npicommon.background.DataCenterBackground

MEX NPD background data center

irfpy.mnpi.background.isdb()[source]
irfpy.mnpi.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]))
1715
irfpy.mnpi.background.doctests()[source]