irfpy.vima.background
¶
VEX/IMA background proxy module
It provides a getter of background proxy.
The best-practice is to use DataCenterVimaBackground
class as follows.
>>> from irfpy.vima import background
>>> dc = background.DataCenterVimaBackground()
>>> import datetime
>>> tobs, (back, total) = dc.nearest(datetime.datetime(2009, 12, 28, 6, 10))
>>> print(tobs) # Observed time nearest to the given time (2009-12-28T06:10)
2009-12-28 06:11:34.837000
>>> print(back) # Background count
5.18
>>> print(total) # Total count
15778.0
- class irfpy.vima.background.DataCenterVimaBackground[source]¶
Bases:
irfpy.imacommon.background.DataCenterBackground
VEX IMA background data center
- irfpy.vima.background.get_background_level(t0, t1, refresh=False, base=None)[source]¶
Get VEX 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])) 225