HDFMapDigiSISCrate¶
- class bapsflib._hdf.maps.digitizers.siscrate.HDFMapDigiSISCrate(group: Group)¶
Bases:
HDFMapDigiTemplate
Mapping class for the ‘SIS crate’ digitizer.
Simple group structure looks like:
+-- SIS crate | +-- config01 | | +-- SIS crate 3302 calibration[0] | | | +-- . | | +-- SIS crate 3302 configurations[0] | | | +-- . | | +-- SIS crate 3305 calibration[0] | | | +-- . | | +-- SIS crate 3305 configurations[0] | | | +-- . . | | +-- SIS crate 3820 configurations[0] | | | +-- | +-- config01 [Slot 5: SIS 3302 ch 1] | +-- config01 [Slot 5: SIS 3302 ch 1] headers . . . | +-- config01 [Slot 13: SIS 3305 FPGA 1 ch 1] | +-- config01 [Slot 13: SIS 3305 FPGA 1 ch 1] headers . | +-- config01 [Slot 13: SIS 3305 FPGA 2 ch 1] | +-- config01 [Slot 13: SIS 3305 FPGA 2 ch 1] headers . . .
- Parameters:
group – the HDF5 digitizer group
Attributes Summary
List of active digitizer configurations
Dictionary containing al the relevant mapping information to translate the HDF5 data into a numpy array by
HDFReadData
.Tuple of the analog-digital-convert (adc) names integrated into the digitizer.
Name of digitizer
Instance of the HDF5 digitizer group
Digitizer dictionary of meta-info. For example, ::.
Slot info dictionary.
Methods Summary
construct_dataset_name
(board, channel[, ...])Construct the name of the HDF5 dataset containing digitizer data. The dataset naming follows two formats based on their associated adc::.
construct_header_dataset_name
(board, channel)Construct the name of the HDF5 header dataset associated with the digitizer dataset. The header dataset stores shot numbers and other shot number specific meta-data. It also has a one- to-one row correspondence with the digitizer dataset. The header dataset name follows the format::.
deduce_config_active_status
(config_name)Determines if data was recorded using the configuration specified by
config_name
.get_adc_info
(board, channel[, adc, config_name])Get adc setup info dictionary associated with board and channel.
get_slot
(brd, adc)Get slot number for given board number and adc.
Attributes Documentation
- active_configs¶
List of active digitizer configurations
- configs¶
Dictionary containing al the relevant mapping information to translate the HDF5 data into a numpy array by
HDFReadData
.– Constructing
configs
–The
configs
dict is a nested dictionary where the first level of keys represents the digitizer configuration names. Each configuration dictionary then consists of a set of non-polymorphic and polymorphic keys. Any additional keys are currently ignored. The non-polymorphic keys are as follows:¶ Key
Description
config['active']
True
orFalse
indicating if this configuration was used in recording the digitizer datasetsconfig['adc']
Tuple of strings naming the adc’s used for this configuration. For example,
('SIS 3301', )
config['config group path']
Internal HDF5 path to the digitizer configuration group. For example,
'/foo/bar/SIS 3301/Configuration: first_run'
config['shotnum']
Dictionary defining how the digitzier shot numbers are recorded. It is assumed, the shot numbers are recorded in the header dataset associated with the main dataset. The dictionary should look like,
config['shotnum'] = { 'dset field': ('Shot number',), 'shape': (), 'dtype': numpy.uint32, }
where
'dset field'
is the field name of the header dataset containing shot numbers,'shape'
is the numpy shape of the shot number data, and'dtype'
is the numpydtype
of the data. This all defines the numpydtype
of the'shotnum'
field in theHDFReadData
constructed numpy array.The required polymorphic keys are the names of each adc listed in
configs['config name']['adc']
. These entries contain the adc board and channel hookup configuration, as well as, the adc setup configuration for each connected board. Continuing with the example above, this key would look something like>>> type(config['SIS 3301']) tuple >>> type(config['SIS 3301'][0]) tuple >>> len(config['SIS 3301'][0]) 3
where each nested tuple represents one board connection to the adc and is 3 elements long. The breakdown of the nested tuple follows:
¶ Key
Description
config['SIS 3301'][0][0]
int
representing the connected board numberconfig['SIS 3301'][0][1]
Tuple[int, ...]
representing the connected channel numbers associated with the board numberconfig['SIS 3301'][0][2]
Dict[str, Any]
representing the setup configuration of the adc. The dictionary should look like:config['SIS 3301'][0][2] = { 'bit: 10, 'clock rate': astropy.units.Quantity(100.0, unit='MHz'), 'nshotnum': 10, 'nt': 10000, 'sample average (hardware)': None, 'shot average (software)': None, }
where
'bit'
represents the bit resolution of the adc,'clock rate'
represents the base clock rate of the adc,'nshotnum'
is the number of shot numbers recorded,'nt'
is the number of time samples recorded,'sample average (hardware)'
is the number of time samples averaged together (this and the'clock rate'
make up the'sample rate'
), and'shot average (software)'
is the number of shots intended to be average together.
- device_adcs¶
Tuple of the analog-digital-convert (adc) names integrated into the digitizer.
- device_name¶
Name of digitizer
- group¶
Instance of the HDF5 digitizer group
- info¶
Digitizer dictionary of meta-info. For example,
info = { 'group name': 'Digitizer', 'group path': '/foo/bar/Digitizer', }
- slot_info¶
Slot info dictionary. Contains relationship between slot number and the associated board number and adc name.
Methods Documentation
- construct_dataset_name(board: int, channel: int, config_name=None, adc=None, return_info=False) str | Tuple[str, Dict[str, Any]] ¶
Construct the name of the HDF5 dataset containing digitizer data. The dataset naming follows two formats based on their associated adc:
# for 'SIS 3302' '<config_name> [Slot <slot>: SIS 3302 ch <ch>]' # for 'SIS 3305' '<config_name> [Slot <slot>: SIS 3305 FPGA <num> ch <ch>]'
where
<config_name>
is the digitizer configuration name,<slot>
is the slot number in the digitizer crate that is associated with the board number,<ch>
is the requested channel number, and<num>
is the FPGA number. Only the ‘SIS 3305’ utilizes the FPGA nomenclature, where channels 1-4 reside on ‘FPGA 1’ and channels 5-8 reside on ‘FPGA 2’.- Parameters:
- Returns:
digitizer dataset name. If
return_info=True
, then returns a tuple of (dataset name, dictionary of meta-info)
The returned adc information dictionary looks like:
adc_dict = { 'adc': str, 'bit': int, 'clock rate': astropy.units.Quantity, 'configuration name': str, 'digitizer': str, 'nshotnum': int, 'nt': int, 'sample average (hardware)': int, 'shot average (software)': int, }
- construct_header_dataset_name(board: int, channel: int, config_name=None, adc=None, **kwargs) str ¶
Construct the name of the HDF5 header dataset associated with the digitizer dataset. The header dataset stores shot numbers and other shot number specific meta-data. It also has a one- to-one row correspondence with the digitizer dataset. The header dataset name follows the format:
'<dataset name> headers'
where
<dataset name>
is the digitizer dataset name specified by the input arguments and constructed byconstruct_dataset_name()
.
- deduce_config_active_status(config_name: str) bool ¶
Determines if data was recorded using the configuration specified by
config_name
. This is done by comparing the configuration name against the dataset names.- Parameters:
config_name – digitizer configuration name
- Returns:
True
if the configuration was used in recording the group datasets; otherwise,False
Note
If the digitizer does not use the configuration name in the name of the created datasets, then the subclassing digitzier mapping class should override this method with a rule that is appropriate for the digitizer the class is being designed for.
- get_adc_info(board: int, channel: int, adc=None, config_name=None) Dict[str, Any] ¶
Get adc setup info dictionary associated with board and channel.
- Parameters:
board – board number
channel – channel number
adc (str) – analog-digital-converter name
config_name – digitizer configuration name
- Returns:
dictionary of adc setup info (bit, clock rate, averaging, etc.) associated with board* and **channel