Generic pyAML measurements #48
Replies: 4 comments 3 replies
-
|
These are the features I have come up with so far that we want at HZB. Depending on what happens with the options for bluesky compatible devices maybe not all need to be available in the standard measurement for pyAML. For us it would be fine to eventually implement separate bluesky-based applications for some measurements and make them available as part of the ecosystem for those labs who want features that aren't available in the standard. Top priority: These two are top priority for us because without it there is no point for us to test in the control room since the data won't be useful and the applications will anyway need to be rewritten when these missing features from the specification is implemented.
General features:
|
Beta Was this translation helpful? Give feedback.
-
|
In addition, I add that we would like to: Having callback (or generator) to:
It is important to define what is a Stage:
It is import to define the way of working:
I would like to end with a clear interface such as:
class Stage(ABC):
@abstractmethod
run(self):...
class ORMStageConfig(BaseModel):
step: int
action: int
steerer: Magnet
horbit: np.array
vorbit: np.array
.....
case ORMStage(Stage):
run():
do_something()
class Measurement(ABC):
# Run all stages
@abstractmethod
def run(self, callback:Callable): ...
# Run stages
@abstractmethod
def run(self, stages: list[Stages], callback:Callable): ...
# Retreive data
@abstractmethod
def get(self) -> Data: ...
etc
class ORMMeasurementConfig(BaseModel):
hsteerers: MagnetArray
vsteerers: MagnetArray
bpms: BPMArray
class ORMMeasurement(Measurement):
def __init__(self, cfg:ORMMeasurementConfig):
# Create Stages
def get_stages() -> list[ORMStage]:
# Return stages
def run_stage() -> StageData:
do_something()
def run(self, callback:Callable):
# Run all
def run(self, stages: list[ORMStage], callback:Callable):
# Run list of stages
|
Beta Was this translation helpful? Give feedback.
-
|
I also like the suggestion @yhidaka had of being able to switch out a device which produces a value from just reading a PV to a device which gets it from doing a measurement. He mentioned the tune as example but I think this is also valid for implementing a general response matrix measurement. In MML there is such a measurement which takes a set of actuators and detectors and the orbit and tune response matrices are just implemented as calling that general measurement with specific devices. The chromaticity response matrix however is implemented differently because it requires to measure the chromaticity at each step. But if the chromaticity measurement had been implemented in a way where it could be handled similarly as device the general response matrix measurement could also have been used for that instead of having a completely separate implementation to maintain. There are likely also many other use cases where you would like to measure a response matrix but the detector is something that you can't directly get from the control system and need to measure. |
Beta Was this translation helpful? Give feedback.
-
|
We have previously built a measurement framework at KIT and I was asked for a brief description. The framework is intended to provide an easy entry point to create measurements that can be exposed via the control system (EPICS in our case). The idea is to allow people without much understanding of the control system to create measurements integrated in the control system (as IOC/device). StructureMeasurements are divided into three main blocks implemented for each measurement:
The implementation of the measurement block is intentionally left to the user. Having too strict rules about how to implement/segment the measurement lifts the entry barrier for new people and we tried to keep the barrier as low as possible. Actions and Data AcquisitionThe framework works with Monitor (reading data) and Actuator (controlling stuff) objects which might use the control system but can also perform other tasks or combine multiple calls in one. They work by implementing subclasses for new/complex tasks (Some implementations for simple tasks are provided). Reading data is done by a Resetting and Error HandlingEach Actuator is responsible for resetting it's value when a measurement finishes, crashes or is aborted. Result Analysis and Output FileAnalysis of the measurement is done in the Interfaces and ConfigurationIn addition to the pure measurement and data handling routines, the framework implements configuration and output capabilities. Just by defining configuration and output options (including data type, description etc.) when implementing the measurement, without further code, it's possible to execute it via command line, via python, via a stand alone (auto generated) gui and as an EPICS IOC via the control system. Some important points are:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The aim of this discussion is to identify measurement components that are present in all standard measurements and the level of customisation that is necessary. Please provide your input, based on this input, a suitable implementation can be proposed.
As part of the pyAML project, we aim to standardise how measurements are conducted, logged, and reused across different control modes (live, model, shadow, etc.). The goal is to create a flexible, reusable, and maintainable framework for measurements—such as orbit response matrices, tune corrections, and dispersion measurements, etc. Robustness, error handling, and user customisation should be ensured.
This discussion is based on the pyAML User Interface Specification (Chapter 6) and recent feedback from the dedicated working group (https://github.com/orgs/python-accelerator-middle-layer/discussions/41).
Use Case Definition
We want to enable users to:
Possible generic stages/components of any measurement are:
Beta Was this translation helpful? Give feedback.
All reactions