irfpy.vima.irfima

IRF-produced calibrated IMA files.

The IRF-IMA files are produced by Hans & Gabriella. They are Matlab file.

irfpy.vima.irfima.get_uribase_path()[source]

Return the database path.

Database of IMA flux can be specified by [vima]/irfimauribase in irfpyrc.

class irfpy.vima.irfima.IrfImaDatabase(dbpath=None, fitted_data=False)[source]

Bases: irfpy.util.timeseriesdb.DB

The IMA flux database.

The IMA flux database will have a path, specified by dbpath keyword in the __init__() method. By default, the class referrs to the path in get_uribase_path() method.

Parameters
  • dbpath – Database path. If None, default directory in get_uribase_path() is used.

  • fitted_data – If True, fitted data (name start with fion) is used. If False (default), integrated data (name starts with ion) is used.

First, instance the IrfImaDatabase class.

>>> irfima = IrfImaDatabase()
>>> print(len(irfima))   # Database size  
4302

You can get the file (most probably) corresponding to 2006-12-05T13:00:00

>>> t0 = datetime.datetime(2006, 12, 5, 13, 0, 0)
>>> fnamn = irfima.get(t0)
>>> print(os.path.basename(fnamn))
ion20061205092444.mat

IrfImaDatabase class also support fitted data. You can set fitted_data keyword.

>>> irffima = IrfImaDatabase(fitted_data=True)
>>> print(len(irffima))  
4391
>>> t0 = datetime.datetime(2008, 1, 22, 0, 35, 0)
>>> fnamn = irffima.get(t0)
>>> print(os.path.basename(fnamn))
fion20080121185400.mat
class irfpy.vima.irfima.IrfImaFile(fnamn)[source]

Bases: object

Class representing the matlab file of IRF IMA flux.

The IRF IMA flux file.

Instance it.

>>> samplefile = IrfImaFile.get_sample_filename()
>>> imafile = IrfImaFile(samplefile)
>>> print(imafile.gettimerange()[1].strftime('%FT%T'))
2006-12-05T09:43:44
classmethod get_sample_filename(fitted_data=False)[source]
getobstime()[source]
gettimerange()[source]
irfpy.vima.irfima.doctests()[source]