irfpy.mexop.eventfile

A module to read the aspera-3 event file

ASPERA-3 event file is a list of the command that is important for data analysis.

After the OBCP commanding in late 2011, no more reasonable event file is generated (TBC).

Slight difference is found with VEX event file but the idea behind is the same.

class irfpy.mexop.eventfile.EventFile(filename)[source]

Bases: object

The event file.

Parameters

filename – The file name of the event file.

Type

string

The event file is loaded, parsed, and stored in the memory. Each event is stored as an instance of Event. Usually, one can use direct access to the member named list.

Below is an sample.

>> event = EventFile(filename)
>> for ev in event.list:
..     print(ev)
..     # Some processing
logger = <Logger irfpy.mexop.eventfile (DEBUG)>
version

No version supported for A3 event file

list

List of event

parse()[source]
class irfpy.mexop.eventfile.Event(evtname, orbnr, orbtime, utc, cmdname, prms)[source]

Bases: object

Class of an event.

The class behave as a structure. Member variables are:

Eventname

Name of the event. string

Orbnr

Orbit nubmer. int

Orbtime

Time relative to the pericenter. datetime.timedelta

Utc

Time in UTC. datetime.datetime

Cmdname

Name of the command. string

Parameters

Dictionary of parameters. dict of string to string.

classmethod parse(str)[source]

Parse the given string returning the Event instance.

>>> str = 'A3_ON               00023 -03:47:18 2004-01-15T22:19:22 AASF01A2'
>>> event = Event.parse(str)
>>> print(event.eventname)
A3_ON
>>> print(event.orbnr)
23
>>> print(event.orbtime)
-1 day, 20:12:42
>>> print(list(event.parameters.keys()))
[]
>>> print(event)
<Event: A3_ON        0023 2004-01-15T22:19:22 AASF01A2 (0 prms)>
>>> str = 'IMA_M_24            00041  00:23:17 2004-01-22T22:31:01 AASF60A1,VAS04054=006,VAS05010=024'
>>> event = Event.parse(str)
>>> print(event.eventname)
IMA_M_24
>>> print(event.orbnr)
41
>>> print(event.orbtime)
0:23:17
>>> print(sorted(event.parameters.keys()))
['VAS04054', 'VAS05010']
>>> print(event.parameters['VAS04054'])
006
>>> print(event)
<Event: IMA_M_24     0041 2004-01-22T22:31:01 AASF60A1 (2 prms)>
irfpy.mexop.eventfile.default_eventfile_reader(fn)[source]
irfpy.mexop.eventfile.default_eventfile()[source]

Return the EventFile class of the default event file.

Returns the EventFile instance corresponding to the default event file.

The default event file can be specified by the .irfpyrc file.:

[mexop]
default_eventfile = http://aspera-3.irf.se/archive/commanding/pors/EV_ASPERA.MEX

It is usually recommended to download the default file to local, and set it as a new default.:

[mexop]
default_eventfile = /Volumes/scidata/data/mars/support/EV_ASPERA.MEX
irfpy.mexop.eventfile.isdb()[source]