Module qc analysis tools
Project description
module-qc-analysis-tools
A general python tool for running ITkPixV1.1 module QC test analysis. An overview of the steps in the module QC procedure is documented in the Electrical specification and QC procedures for ITkPixV1.1 modules document and in this spreadsheet. The analysis scripts in this repository require input files with measurement data. The measurement data should be collected using the module-qc-measurement-tools package.
Requirements
This tool requires users to have >python3.6 with the following packages installed:
numpy
scipy
tabulate
matplotlib
jsonschema
Installation
First clone the project:
git clone https://gitlab.cern.ch/atlas-itk/pixel/module/module-qc-analysis-tools.git
Upon a successful checkout, cd
to the new module-qc-analysis-tools
directory
and run the following to install the necessary software:
$ python3 -m venv env
$ source env/bin/activate
$ python -m pip install --upgrade pip
$ python -m pip install -e .
Note that users should use the latest python version (check python version via
python3 -V
). Python3.7 is the minimum requirement for developers. See
For Developer section.
Scripts
Analyze ADC Calibration
This analysis script performs the ADC calibration. It produces several diagnostic plots and an output file with the ADC calibration slope and offset.
analysis-ADC-CALIBRATION --help
analysis-ADC-CALIBRATION --help
usage: analysis-ADC-CALIBRATION [-h] -i INPUT_MEAS [-o OUTPUT_DIR] [-q QC_CRITERIA] [-l LAYER] [--permodule]
[-f {root,numpy}] [-v VERBOSITY]
optional arguments:
-h, --help show this help message and exit
-i INPUT_MEAS, --input-meas INPUT_MEAS
path to the input measurement file or directory containing input measurement files.
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
output directory
-q QC_CRITERIA, --qc-criteria QC_CRITERIA
path to json file with QC selection criteria (default: $(module-qc-analysis-tools --prefix)/analysis_cuts.json)
-l LAYER, --layer LAYER
Layer of module, used for applying correct QC criteria settings. Options: L0, L1, L2
(default)
--permodule Store results in one file per module (default: one file per chip)
-f {root,numpy}, --fit-method {root,numpy}
fitting method
-v VERBOSITY, --verbosity VERBOSITY
Log level [options: DEBUG, INFO (default), WARNING, ERROR]
Analyze Analog Readback
This analysis script performs the Analog Readback. It produces an output file with the calculated internal biases, temperature from the internal and external temperature sensor, and VDDA/VDDD vs Trim, including diagnostic plots with slope and offset.
analysis-ANALOG-READBACK --help
$ analysis-ANALOG-READBACK --help
usage: analysis-ANALOG-READBACK [-h] -i INPUT_MEAS [-o OUTPUT_DIR] [-q QC_CRITERIA] [-l LAYER] [--permodule]
[-f {root,numpy}] [-v VERBOSITY] [--verbose]
optional arguments:
-h, --help show this help message and exit
-i INPUT_MEAS, --input-meas INPUT_MEAS
path to the input measurement file or directory containing input measurement files.
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
output directory
-q QC_CRITERIA, --qc-criteria QC_CRITERIA
path to json file with QC selection criteria (default: $(module-qc-analysis-tools --prefix)/analysis_cuts.json)
-l LAYER, --layer LAYER
Layer of module, used for applying correct QC criteria settings. Options: L0, L1, L2
(default)
--permodule Store results in one file per module (default: one file per chip)
-f {root,numpy}, --fit-method {root,numpy}
fitting method
-v VERBOSITY, --verbosity VERBOSITY
Log level [options: DEBUG, INFO (default), WARNING, ERROR]
--verbose verbose mode
Analyze SLDO
This script analyses the SLDO curve. It produces several diagnostic plots and an output file with several parameters extracted from the SLDO curves.
analysis-SLDO --help
$ analysis-SLDO --help
usage: analysis-SLDO [-h] -i INPUT_MEAS [-o OUTPUT_DIR] [-q QC_CRITERIA] [-l LAYER] [--permodule] [-n NCHIPS]
[-f {root,numpy}] [-v VERBOSITY] [--lp-enable]
optional arguments:
-h, --help show this help message and exit
-i INPUT_MEAS, --input-meas INPUT_MEAS
path to the input measurement file or directory containing input measurement files.
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
output directory
-q QC_CRITERIA, --qc-criteria QC_CRITERIA
path to json file with QC selection criteria (default: $(module-qc-analysis-tools --prefix)/analysis_cuts.json)
-l LAYER, --layer LAYER
Layer of module, used for applying correct QC criteria settings. Options: L0, L1, L2
(default)
--permodule Store results in one file per module (default: one file per chip)
-n NCHIPS, --nChips NCHIPS
Number of chips powered in parallel (e.g. 4 for a quad module, 3 for a triplet, 1 for an
SCC.)
-f {root,numpy}, --fit-method {root,numpy}
fitting method
-v VERBOSITY, --verbosity VERBOSITY
Log level [options: DEBUG, INFO (default), WARNING, ERROR]
--lp-enable low power mode
Analyze VCal Calibration
This analysis script performs the VCal calibration. It produces several diagnostic plots and an output file with the VCal calibration slope and offset.
analysis-VCAL-CALIBRATION --help
$ analysis-VCAL-CALIBRATION --help
usage: analysis-VCAL-CALIBRATION [-h] -i INPUT_MEAS [-o OUTPUT_DIR] [-q QC_CRITERIA] [-l LAYER] [--permodule]
[-f {root,numpy}] [-v VERBOSITY]
optional arguments:
-h, --help show this help message and exit
-i INPUT_MEAS, --input-meas INPUT_MEAS
path to the input measurement file or directory containing input measurement files.
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
output directory
-q QC_CRITERIA, --qc-criteria QC_CRITERIA
path to json file with QC selection criteria (default: $(module-qc-analysis-tools --prefix)/analysis_cuts.json)
-l LAYER, --layer LAYER
Layer of module, used for applying correct QC criteria settings. Options: L0, L1, L2
(default)
--permodule Store results in one file per module (default: one file per chip)
-f {root,numpy}, --fit-method {root,numpy}
fitting method
-v VERBOSITY, --verbosity VERBOSITY
Log level [options: DEBUG, INFO (default), WARNING, ERROR]
Analyze Injection capacitance
This analysis script performs the injection capacitance. It produces several diagnostic plots and an output file with the measured pixel injection capacitance.
analysis-INJECTION-CAPACITANCE --help
$ analysis-INJECTION-CAPACITANCE
usage: analysis-INJECTION-CAPACITANCE [-h] -i INPUT_MEAS [-o OUTPUT_DIR] [-q QC_CRITERIA] [-l LAYER] [--permodule]
[-v VERBOSITY]
optional arguments:
-h, --help show this help message and exit
-i INPUT_MEAS, --input-meas INPUT_MEAS
path to the input measurement file or directory containing input measurement files.
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
output directory
-q QC_CRITERIA, --qc-criteria QC_CRITERIA
path to json file with QC selection criteria (default: $(module-qc-analysis-tools --prefix)/analysis_cuts.json)
-l LAYER, --layer LAYER
Layer of module, used for applying correct QC criteria settings. Options: L0, L1, L2
(default)
--permodule Store results in one file per module (default: one file per chip)
-v VERBOSITY, --verbosity VERBOSITY
Log level [options: DEBUG, INFO (default), WARNING, ERROR]
Notes
Example commands for a chip in a quad module (L2):
analysis-ADC-CALIBRATION -i ../module-qc-tools/emulator/outputs/SLDO_reference/1674670016/ --layer L2
analysis-SLDO -i ../module-qc-tools/emulator/outputs/SLDO_reference/1674670016/ --layer L2
analysis-ANALOG-READBACK -i ../module-qc-tools/emulator/outputs/SLDO_reference/1674670016/ --layer L2
analysis-VCAL-CALIBRATION -i ../module-qc-tools/emulator/outputs/SLDO_reference/1674670016/ --layer L2
analysis-INJECTION-CAPACITANCE -i ../module-qc-tools/emulator/outputs/SLDO_reference/1674670016/ --layer L2
Update Trim, ADC Calibration Parameters, VCal calibration parameters
After each analysis, update the setting in the chip config by running the following scripts:
analysis-overwrite-ADCcalPar -i <path to ADC CALIBRATION analysis output directory> -c <path to YARR config directory> -t <config type>
analysis-overwrite-trim -i <path to ANALOG READBACK analysis output directory> -c <path to YARR config directory> -t <config type>
analysis-overwrite-VcalPar -i <path to VCAL CALIBRATION analysis output directory> -c <path to YARR config directory> -t <config type>
JsonChecker and DataExtractor
Two classes are designed for general purposes of the module qc analysis tool.
-
JsonChecker
a. Check whether the test type is implemented b. For a specific task, check if required keywords exist c. Check if lengths of measurements are identical d. Check if there are negative numbers of measurements -
DataExtractor
This class finds measurements by Vmux value and convert them to quantites.
Params overwrite
The script overwrite_config.py
writes fitted parameters to a chip config file.
Recursion is used to search for the Parameter
part of the original config file
and values corresponding to the key in the analysis output json file will
replace the original parameters.
Usage:
analysis-overwrite-config --help
```$ analysis-overwrite-config -h usage: analysis-overwrite-config [-h] -i INPUT_FILE -c CONFIG_FILE
optional arguments: -h, --help show this help message and exit -i INPUT_FILE, --input-file INPUT_FILE analysis output file -c CONFIG_FILE, --config-file CONFIG_FILE the config file to be modified
</details>
<details> <summary> Example </summary>
$ analysis-overwrite-config -i overwrite/0x16a4c_vcal_calib_InjVcalHigh_LargeRange_1662583926_anad.json -c overwrite/metadata.json
</details>
## For Developer
### python version
A python version higher than 3.7 is needed for this repository. Check the local
python version with `python -V`.
If the local python version is lower, set up a virtual python environment
following the instructions
[here](https://itk.docs.cern.ch/general/Virtual_Environments/).
### pre-commit
Install pre-commit to avoid CI failure. Once pre-commit is installed, a git hook
script will be run to identify simple issues before submission to code review.
Instruction for installing pre-commit in a python environment:
1. Activate python environment, e.g. `source venv/bin/activate`.
2. Run `python3 -m pip install pre-commit`.
3. Run `pre-commit install` to install the hooks in `.pre-commit-config.yaml`.
After installing pre-commit, `.pre-commit-config.yaml` will be run every time
`git commit` is done. Redo `git add` and `git commit`, if the pre-commit script
changes any files.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file module_qc_analysis_tools-1.0.tar.gz
.
File metadata
- Download URL: module_qc_analysis_tools-1.0.tar.gz
- Upload date:
- Size: 27.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 763f2373e9b02b819001c8a944adb8f7661494c9bd47f92b7a1df63fd2bda004 |
|
MD5 | 762fa140fa59c4c34cca66bab35f8fa4 |
|
BLAKE2b-256 | 8f7e66cf3e8160ec26666c703e1b1326f02aab2208be8631325266d1b931c786 |
File details
Details for the file module_qc_analysis_tools-1.0-py3-none-any.whl
.
File metadata
- Download URL: module_qc_analysis_tools-1.0-py3-none-any.whl
- Upload date:
- Size: 39.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0136b020d2de2cfaedd6ecf8f0ecffa89756ef417643ca1767ba323b1aed2a1c |
|
MD5 | 009a7850a306869eb163209e146f2049 |
|
BLAKE2b-256 | f7e1c2a0577d21af99649ea8bf44bec24571d09c8384fa534b6e02e44153d4c7 |