Skip to content

Add revert chip config script

Emily Anne Thompson requested to merge add_revert_chip_config_script into devel

Added script to revert chip configs to previous state. The script takes as input a connectivity file and a YARR scan output directory, containing chip configs before/after the scan. For each of the chips listed in the connectivity file, the script searches for the corresponding chip config in the YARR scan output directory with the .before suffix (or .after if user supplies -A option). If found, a copy of the current chip config is stored in the YARR scan output directory with .revert suffix, and it is then replaced with the .before version of the chip config. The connectivity file is left unchanged.

/home/eathompson/YARR$ ./bin/revert-chip-configs -h
 revert-chip-configs

 Usage: ./bin/revert-chip-configs [options]
 Options:
   -c          Input connectivity JSON file path [required]
   -d          Output directory with YARR scan data [required]
   -i          Position of chip in connectivity file chips list, starting from 0 (default: all chips)
   -n          Chip name (if given will override use of chip index)
   -A          Revert to .after configs instead of .before
   -h|--help   Print this help message and exit

Example output:

/home/eathompson/YARR$ ./bin/revert-chip-configs -c ../discbump/20UPGM22001172/20UPGM22001172_L2_warm.json -d ../discbump/20UPGM22001172/tune1500noHV_Sep26_pixelretune/015484_std_retune_pixelthreshold/
Writing backup: ../discbump/20UPGM22001172/tune1500noHV_Sep26_pixelretune/015484_std_retune_pixelthreshold/0x1527a_L2_warm.json.revert
Replacing ../discbump/20UPGM22001172/L2_warm/0x1527a_L2_warm.json with ../discbump/20UPGM22001172/tune1500noHV_Sep26_pixelretune/015484_std_retune_pixelthreshold/0x1527a_L2_warm.json.before
Writing backup: ../discbump/20UPGM22001172/tune1500noHV_Sep26_pixelretune/015484_std_retune_pixelthreshold/0x1525c_L2_warm.json.revert
Replacing ../discbump/20UPGM22001172/L2_warm/0x1525c_L2_warm.json with ../discbump/20UPGM22001172/tune1500noHV_Sep26_pixelretune/015484_std_retune_pixelthreshold/0x1525c_L2_warm.json.before
Writing backup: ../discbump/20UPGM22001172/tune1500noHV_Sep26_pixelretune/015484_std_retune_pixelthreshold/0x15263_L2_warm.json.revert
Replacing ../discbump/20UPGM22001172/L2_warm/0x15263_L2_warm.json with ../discbump/20UPGM22001172/tune1500noHV_Sep26_pixelretune/015484_std_retune_pixelthreshold/0x15263_L2_warm.json.before
Writing backup: ../discbump/20UPGM22001172/tune1500noHV_Sep26_pixelretune/015484_std_retune_pixelthreshold/0x15279_L2_warm.json.revert
Replacing ../discbump/20UPGM22001172/L2_warm/0x15279_L2_warm.json with ../discbump/20UPGM22001172/tune1500noHV_Sep26_pixelretune/015484_std_retune_pixelthreshold/0x15279_L2_warm.json.before
Done.

Tagging @theim .

Merge request reports