parse_cm.get_acis_tables#

parse_cm.get_acis_tables(cfg_file=None, dat_file=None)#

Parse the ACIS tables (.cfg and .dat files) and retrieve information.

From the configuration (.cfg) file: dictionary of SIMODES which contains the number of ACIS command packets, the specific packets used, and the delay times in seconds after each command.

From the data (.dat) file: dictionary of ACIS command packets with word_length, command_opcode, slot_id, file_format, packet_duration, and binary_data.

Looks first for an environment variable $ACIS_TABLES_DIR for the location of the tables, and failing that, looks in $SKA/data/acis_tables.

Parameters:
cfg_filestring or Path object, optional

The ACIS tables CFG file to use. Default is “current.cfg.”

dat_filestring or Path object, optional

The ACIS tables CFG file to use. Default is “current.dat.”

Returns:
Two Python dictionaries containing the .cfg and .dat
table information, in that order.

Examples

>>> from parse_cm import get_acis_tables
>>> tab_cfg, tab_dat = get_acis_tables()
>>> print(tab_cfg["TE_007AC"])
{
    'cmd_cnt': 6,
    'packets': [
        'WSVIDALLDN',
        'WSPOW0CF3F',
        'WT007AD024',
        'XTZ0000005',
        'RS_0000001',
        'RH_0000001'
    ],
    'delays': [18, 63, 4, 4, 4, 23]
}
>>> print(tab_dat["WSPOW0CF3F"])
{
    'word_length': 7,
    'cmd_type': '',
    'slot_id': '',
    'file_format': '2',
    'packet_duration': 0,
    'binary_data': [1792, 26369, 8192, 0, 52992, 256, 16128]
}