slaclab / ATEF_timing_config

1 stars 1 forks source link

https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=396375975

Overview

The goal of integrating ATEF into our checkout procedure is to check that no static PVs get modified under the radar. However, it is unrealistic to manually configure PV comparisons on a large scale in ATEF. To mass process and configure the PV comparisons in ATEF, we have developed this tool to: 1) Recognize and extract the static PVs across different IOCs and establish a baseline table for default values. 2) Automatically construct the configuration file for tens of thousands of PVs in ATEF checkout. Language: Python

Data Flowchart

https://slac-my.sharepoint.com/:u:/r/personal/rj1_slac_stanford_edu/Documents/Drawing.vsdx?d=w0e642654c14148669a2ced1fa0f1426d&csf=1&web=1&e=lR6VyX

Summary

This readme will show you the steps to generate a config file for a hutch and then how to run that config file to see which PVs have changed from the config file. To begin, make sure that you have access to the SLAC Linux network and the required permissions.

The main function and output is the generation of a .json configuration file. The .json files contain PVs relevant to the hutch or the devices/IOCs and their static values that are to be checked by ATEF. The script that generates the .json essentially samples the PVs for a specified number of iterations for a specified amount of time. At the end of the sampling, the PVs that have not changed are saved to the .json file thus capturing the "static PVs" during the script sampling iterations.

The .json files that are generated can then be natively run through atef to give an indication of which of the PVs have changed from when the config file was generated.

Steps

  1. Sourcing the latest atef module Enter the following command to access atef in your environment:
source /reg/g/pcds/engineering_tools/latest-released/scripts/pcds_conda
  1. Generating the .json config file The config file is a .json file that contains the PVs specific to the hutch.

Before running the script, run this command to see the help information about usage:

python intra_hutch_main.py -h

image

To generate the configuration JSON file, run the following command:

ssh las-console
cd ATEF_timing_config
python intra_hutch_main.py [-h] hutch_code [total_iterations] [interval]

Following the prompts, a time estimation on the generation of the config file will be displayed along with a progress bar. An example run on MFX4.5:

image

  1. Running a config file through ATEF To run the config file through atef, use the following command. The JSON file you just generated is located in the folder named by your target hutch name. For example, MFX_FS4.5/. The name of the .json file starts with the date you generated the file. For example, 20240202.
python -m atef --log DEBUG check "LOCATION OF THE JSON FILE"
  1. Interpreting the Output

The output tells you the discrepancy of the specific PVs within an IOC of a hutch between a previous ATEF run (when the config file was generated) and now. How to interpret the results:

  1. Hutch name
  2. IOC name
  3. PV name and the value recorded last time (after "equal to")
  4. PV name and the value recorded this time (after "value of") Screenshot of the output:

image

The output will show a subset of PVs which have a current value that is different from that which was captured in the config file.