irfpy.vnpi.background

VEX/NPI background proxy module

It provides a getter of background proxy.

The best practice is to use DataCenterVnpiBackground class as folows.

>>> from irfpy.vnpi import background
>>> dc = background.DataCenterVnpiBackground()
>>> import datetime
>>> tobs, (back, total) = dc.nearest(datetime.datetime(2006, 12, 5, 5, 42))
>>> print(tobs)
2006-12-05 05:42:00.898000
>>> print(back)
6.0
>>> print(total)
130.0
class irfpy.vnpi.background.DataCenterVnpiBackground[source]

Bases: irfpy.npicommon.background.DataCenterBackground

VEX NPD background data center

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

Get VEX/IMA 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]))
832
irfpy.vnpi.background.doctests()[source]