km3dq_common.common_library¶
Functions¶
|
Return the detector id |
|
Extract the current detector names from the database |
|
For a given dataset / detector, returns the path for QAQC files |
|
Retrieve run properties from the database with the km3db package |
|
For a given dataset/detector, returns the run numbers, their lengths, |
|
Retrieve the run start/stop by combining db and QAQC quantities to get the |
|
Extract the all runs acquired in the last nweeks of running |
|
Returns the site (ORCA or ARCA) |
|
Retrieve the range of DU active |
|
Retrieve the number of variables in the QAQC file |
|
Create a ttree from qaqc sftp file and defect variables stored on git |
|
Computes the veto/Q-score for a detector/tag using a QAQC source. |
|
Write the run range and run list on disk |
|
sftp QAQC file reading |
|
Decode the source of degradation stored in the TTree |
Module Contents¶
- km3dq_common.common_library.get_current_detector(site)[source]¶
Extract the current detector names from the database
- km3dq_common.common_library.get_file_paths(dataset, qaqc_name)[source]¶
For a given dataset / detector, returns the path for QAQC files
- km3dq_common.common_library.get_run_properties_from_db(det, filt='PHYS')[source]¶
Retrieve run properties from the database with the km3db package Inputs: - det: string like (e.g: D0ARCA030, D1ORCA024…) - filt: string containing the accepted run type (PHYS, COMM…) separated by a space
- km3dq_common.common_library.get_run_properties_from_qaqc(dataset, dq_tag, origin='qaqc_sftp', startrun=0, endrun=1000000000.0)[source]¶
For a given dataset/detector, returns the run numbers, their lengths, time counter… A dataset may be restricted to a user-defined run range Source: QAQC file
- km3dq_common.common_library.get_run_timerange(det, filt='PHYS')[source]¶
Retrieve the run start/stop by combining db and QAQC quantities to get the most accurate timing. If QAQC data exist (normally for all PHYS runs), use them, otherwise use the DB ones So far used only in km3net_lw_db_interface
Inputs: - det: string like (e.g: D0ARCA030, D1ORCA024…) - filt: string containing the accepted run type (PHYS, COMM…) separated by a space
Outputs: - dictionary with run as key and a list of [run_start, run_stop, source, runtype] with source = 0 (QAQC) or 1 (DB only)
- km3dq_common.common_library.get_last_n_weeks_runs_qaqc(det, nweeks=2)[source]¶
Extract the all runs acquired in the last nweeks of running
- km3dq_common.common_library.get_active_dus_range(det)[source]¶
Retrieve the range of DU active To be improved with database information
- km3dq_common.common_library.get_nb_qaqc_variables(qaqc_vers)[source]¶
Retrieve the number of variables in the QAQC file NB: in a near future, the det argument should be replaced by a Jpp version === Arguments === - det : detector name - [string] - Ex: “D0ARCA021”, “D0ORCA018”…
=== Output === - Number of QAQC variables
- km3dq_common.common_library.create_ttree_from_qaqc(det, var_to_fill, source, tag, append_veto_qsco=False)[source]¶
Create a ttree from qaqc sftp file and defect variables stored on git It includes some advanced check about the QAQC file integrity. === Arguments === - det : detector name - [string] - Ex: “D0ARCA021”, “D0ORCA018”… - var_to_fill : QAQC variables or defect to fill - [array of string] -
Ex: [‘run’, ‘timestampdiff’, ‘def_operation’, ‘def_oos’]
source : QAQC source, a priori “qaqc_sftp” - [string]
- tagdata-quality tag (not its name) as created by
configure_dataquality_tag
append_veto_qsco: append the veto and Qscore - [boolean]
=== Output === - TTree - Error log
- km3dq_common.common_library.compute_veto_qscore(var_prop, var_val)[source]¶
Computes the veto/Q-score for a detector/tag using a QAQC source.
- km3dq_common.common_library.log_run_range(det, run_0, run_1, log_file)[source]¶
Write the run range and run list on disk
- km3dq_common.common_library.read_qaqc_file(det, source, qaqc_name, run_range)[source]¶
sftp QAQC file reading === Arguments === - det : detector name - [string] - Ex: “D0ARCA021”, “D0ORCA018”… - source : QAQC source, a priori “qaqc_sftp” - [string] - qaqc_name : - run_range : string as defined in DQ tag “[min_run]-[max_run]” (inclusive)
=== Output === - TTree - Error log