km3dq_common.lw_db_defect_library

Functions

check_defect_diag_byte(value, bit_list)

decode_defect_diag_byte(value, def_type0)

Decodes the assigned defect (integer) for a given type and returns a single

decode_defect_file(defect_file_dict, run_nb)

Decode the defect file and returns

read_defect_file(det[, def_tag, type_filter])

Read defect files stored on SFTP

read_basic_defect_file(det, def_type, def_diag[, def_tag])

Read defect files stored on SFTP. Simply returns lines

Module Contents

km3dq_common.lw_db_defect_library.check_defect_diag_byte(value, bit_list)[source]
km3dq_common.lw_db_defect_library.decode_defect_diag_byte(value, def_type0)[source]

Decodes the assigned defect (integer) for a given type and returns a single string.

=== Arguments === - value : diagnosis value for a given type - [integer] - def_type: defect type (“daq”, “operation”…) - [string]

=== Output === - Single string contained all the corresponding defects separated by a slash Ex: ‘missing_data_dst / jmergefitfailure /’

km3dq_common.lw_db_defect_library.decode_defect_file(defect_file_dict, run_nb)[source]

Decode the defect file and returns

=== Arguments === - defect_file_dict: defect dictionnary produced by the read_defect_file

function - [dictionnary]

  • run_nb : run number - [integer]

=== Output === - Defects assigned to this run. Both a dict and string (to be used in html - See qaqcprocessing/dst-process.py) are returned. Ex: {‘str’: ‘<b> def_data_processing </b>: missing_data_dst / ‘,

‘dict’: {‘def_data_processing’: ‘missing_data_dst / ‘}}

km3dq_common.lw_db_defect_library.read_defect_file(det, def_tag='def-HEAD', type_filter=None)[source]

Read defect files stored on SFTP

=== Arguments === - det : detector name - [string] - Ex: “D0ARCA021”, “D0ORCA018”… - def_tag : defect tag - [string] - type_filter : if not empty, filter on the defect type - If empty, read

all defect files except the sign_off (specific function defined) [array of strings] - Ex: [“daq”, “operation”]

=== Output === - Dictionnary with def_[defect] as keys and a value for each affected run. This value will be decoded by the decode_defect_diag_byte function. Ex: {‘def_daq’: {}, ‘def_operation’: {16501: 1, 16503: 2}…}

km3dq_common.lw_db_defect_library.read_basic_defect_file(det, def_type, def_diag, def_tag='def-HEAD')[source]

Read defect files stored on SFTP. Simply returns lines

=== Arguments === - det : detector name - [string] - Ex: “D0ARCA021”, “D0ORCA018”… - defect_type - defect_diag - def_tag : defect tag - [string]

=== Output === - Array of lines