HMUX: read HDF5 FDM X-ray event dataset

class tesfdmtools.hdf.HMUX.HMUX(path=None, filename=None, driver=None)[source]

Open HDF5 file and make the XIFU-defined structure available for reading of X-ray event records.

Kwargs:
  • path = filepath where to find the file. Default: /stage/xmmdat10/Athena/raw_data

  • filename = HDF5 filename to open. If None filename will be asked for.

  • driver = I/O driver to use for HDF5 (see H5py documentation)

properties:

    attrs = file attributes
mux.attrs = mux section attributes
 channels = list of actual channel id's
  channel = the indivudual channel objects
         each channel has the following properties:
                   attrs = channel attributes
           configuration = configuration section of this channel
               freq_conf = frequency configuration data
          freq_conf_keys = list of columns in frequency configuration data
                  sample = iterator class for sample numbers
              samplename = ID of the sampledata if present (ADC1/DAC1/DAC2)
                   freqs = iterator of frequency numbers
                        freq = iterator class of actual frequencies; returns event records
                           each frequency has the following properties:
                                    attrs = frequency section attributes
                                  nevents = number of event records

                           each event record has the 'attrs' property

example of use:

hfile=HMUX()
for channel in hfile.channels:                   # go through all channels of file
   for freq in hfile.channel[channel].freqs:     # go through all frequencies in channel
      for event in hfile.channel[channel].freq[freq]:  # go through all event records in frequency
         pixel=event.attrs["pixel_index"]
         event_time=event.attrs["event_time"]
         Idata=event[:,0]
         Qdata=event[:,1]
         ...process event ...

or access a record individually:

hfile=HMUX()
Idata=hfile.channel[0].freq[8][100][:,0]                # access Idata of record 100 of channel-0, freq-8
attrs

file attributes

channel

individual channel objects in the dataset

channels

list of channel id’s in dataset

hdffile

filename

overview()[source]

Prints overview of file attributes all muxchannels with their attributes. In addition, print overviews of all channels.

class tesfdmtools.hdf.HMUX.channelfreq(chanfreq, ifreq, nevents)[source]

Holds the trigger record objects for a given channel frequency. Used within class muxchannel.

Args:
  • chanfreq = muxchannel object in HDF5 file.

  • ifreq = frequency number of object.

  • nevents = number of records in channel.

attrs

triggers object attributes

chanfreq

triggers object in HDF5 file

nrec

maximum possible record number

overview()[source]

Prints attributes overview for this object.

class tesfdmtools.hdf.HMUX.muxchannel(muxchannel, configuration, ichan)[source]

Muxchannel object. Holds the trigger records for the designated channel. Used within class HMUX.

Args:
  • muxchannel = muxchannel object of HDF5 file

  • configuration = configuration table object in the muxchannel section

  • ichan = channel number

attrs

channel attributes

freq

frequency objects

freq_conf

frequency configuration table

freqs

list of available frequency identifiers

overview()[source]

Prints overview of channel attributes.