irfpy.vels.rawdata

VEX/ELS with the “data center” support.

A data center for VEX/ELS.

The data structure is in the irfpy.vels.scidata.ElsCountData object.

class irfpy.vels.rawdata.DataCenterElsCounts[source]

Bases: irfpy.util.datacenter.BaseDataCenter

ELS count rate data’s data center.

The data is in numpy array with a shape of (E128, A16).

>>> from irfpy.vels import rawdata
>>> import datetime
>>> t0 = datetime.datetime(2010, 10, 30, 23, 15)
>>> velsdc = rawdata.DataCenterElsCounts()   # ELS count's data center.
>>> tobs, cnts = velsdc.nearest(t0)
>>> print(tobs, cnts.shape, cnts.max())
2010-10-30 23:15:00.509000 (128, 16) 44

Initializer.

Parameters
  • cache_size – Size of the ring cache.

  • name – The name of the

  • copy – Boolean if the returned data is to be deep-copied (True) or reference (False). It is good to return the data after the copy, since then the data is always original. Returning reference is possibly faster, while there are side effect that the post-processing will destroy the original data. Therefore, it is recommended to set True always. The copy value can be overwritten by each method as necessity.

search_files()[source]

Search the data files, returning a list of data file.

This method searches the data files under the base_folder. This method should return a list / tuple of the data file name (usually a full path).

This method is called only once when __init__() was called.

Returns

A list / tuple of the data file. It should be full path (or relative path from the current path), and sorted from earlier data to later data.

read_file(filename)[source]

Read the file contents.

From a given file, electron data is read. The format is in the irfpy.vels.scidata.ElsCountData object.

approximate_starttime(filename)[source]

Start time should be guessed for each file.

A guessed start time should be returned. It is OK if it is very approximate, but the orders of the guessed-start and the exact-start should be identical. This method must be very fast, because it is called for all the files in the data base (i.e. all the files retuned by search_files() method).

A practical suggestion for implementation is to guess the time from the filename.

Parameters

filename – A string, filename.

Returns

An approximate, guessed start time of the file

Return type

datetime.datetime

class irfpy.vels.rawdata.DataCenterElsLevel[source]

Bases: irfpy.util.datacenter.BaseDataCenter

VEX/ELS level data’s data center.

The data is in numpy array with a shape of (E128,).

>>> from irfpy.vels import rawdata
>>> import datetime
>>> t0 = datetime.datetime(2010, 10, 30, 23, 15)
>>> velsdc = rawdata.DataCenterElsLevel()   # ELS level's data center.
>>> tobs, levels = velsdc.nearest(t0)
>>> print(tobs, levels.shape, levels.max())
2010-10-30 23:14:48.509000 (128,) 4095

Initializer.

Parameters
  • cache_size – Size of the ring cache.

  • name – The name of the

  • copy – Boolean if the returned data is to be deep-copied (True) or reference (False). It is good to return the data after the copy, since then the data is always original. Returning reference is possibly faster, while there are side effect that the post-processing will destroy the original data. Therefore, it is recommended to set True always. The copy value can be overwritten by each method as necessity.

search_files()[source]

Search the data files, returning a list of data file.

This method searches the data files under the base_folder. This method should return a list / tuple of the data file name (usually a full path).

This method is called only once when __init__() was called.

Returns

A list / tuple of the data file. It should be full path (or relative path from the current path), and sorted from earlier data to later data.

read_file(filename)[source]

Read the file contents.

From a given file, electron data is read. The format is in the irfpy.vels.scidata.ElsCountData object.

approximate_starttime(filename)[source]

Start time should be guessed for each file.

A guessed start time should be returned. It is OK if it is very approximate, but the orders of the guessed-start and the exact-start should be identical. This method must be very fast, because it is called for all the files in the data base (i.e. all the files retuned by search_files() method).

A practical suggestion for implementation is to guess the time from the filename.

Parameters

filename – A string, filename.

Returns

An approximate, guessed start time of the file

Return type

datetime.datetime

class irfpy.vels.rawdata.DataCenterElsAs128[source]

Bases: irfpy.vels.rawdata.DataCenterElsCounts

ELS data center.

>>> from irfpy.vels import rawdata
>>> import datetime
>>> t0 = datetime.datetime(2010, 10, 30, 23, 15)
>>> velsdc = rawdata.DataCenterElsAs128()   # ELS count's data center.
>>> tobs, cnts = velsdc.nearest(t0)
>>> print(tobs)
2010-10-30 23:15:00.509000
>>> print(cnts)
<ElsCountData at 2010-10-30T23:15:00, count_max=44.0, level=(Defined (@2010-10-30T23:14:48))>

Initializer.

Parameters
  • cache_size – Size of the ring cache.

  • name – The name of the

  • copy – Boolean if the returned data is to be deep-copied (True) or reference (False). It is good to return the data after the copy, since then the data is always original. Returning reference is possibly faster, while there are side effect that the post-processing will destroy the original data. Therefore, it is recommended to set True always. The copy value can be overwritten by each method as necessity.

read_file(filename)[source]

Read the file contents.

From a given file, electron data is read. The format is in the irfpy.vels.scidata.ElsCountData object.

class irfpy.vels.rawdata.DataCenterEls[source]

Bases: irfpy.vels.rawdata.DataCenterElsCounts

ELS data center.

>>> from irfpy.vels import rawdata
>>> import datetime
>>> t0 = datetime.datetime(2010, 10, 30, 23, 15)
>>> velsdc = rawdata.DataCenterEls()   # ELS count's data center.
>>> tobs, cnts = velsdc.nearest(t0)
>>> print(tobs)
2010-10-30 23:15:00.509000
>>> print(cnts)
<ElsCountDataE128 at 2010-10-30T23:15:00, count_max=44.0, level=(Defined)>

Initializer.

Parameters
  • cache_size – Size of the ring cache.

  • name – The name of the

  • copy – Boolean if the returned data is to be deep-copied (True) or reference (False). It is good to return the data after the copy, since then the data is always original. Returning reference is possibly faster, while there are side effect that the post-processing will destroy the original data. Therefore, it is recommended to set True always. The copy value can be overwritten by each method as necessity.

read_file(filename)[source]

Read the file contents.

From a given file, electron data is read. The format is in the irfpy.vels.scidata.ElsCountData object.