Skip to content

New tuning and measurement tools architecture#218

Merged
JeanLucPons merged 16 commits intomainfrom
new-response-matrix-architecture
Mar 17, 2026
Merged

New tuning and measurement tools architecture#218
JeanLucPons merged 16 commits intomainfrom
new-response-matrix-architecture

Conversation

@JeanLucPons
Copy link
Contributor

The aim of this PR is to provide a unified way of accessing response matrix data.

@JeanLucPons JeanLucPons marked this pull request as draft March 12, 2026 10:55
@JeanLucPons
Copy link
Contributor Author

@kparasch
I modify a bit the orbit tuning tools.
The mods are rather minor (renaming of input and output) and base class for matrix data and matrix measurement.

Please:

  • Could you double check matrix saving for orbit (I'm almost sure that the field naming will be wrong during saving)
  • Could you follow the workflow initiated by @Amoutardier that I implemented in TuneResponseMatrix

Thanks

@JeanLucPons JeanLucPons changed the title New response matrices architecture New tuning and measurement tools architecture Mar 16, 2026
@kparasch
Copy link
Contributor

@JeanLucPons

Could you double check matrix saving for orbit (I'm almost sure that the field naming will be wrong during saving)

I am making a PR to this branch for the orm saving for orbit.

Could you follow the workflow initiated by @Amoutardier that I implemented in TuneResponseMatrix

I didn't understand which workflow you meant here.

@JeanLucPons
Copy link
Contributor Author

JeanLucPons commented Mar 16, 2026

I didn't understand which workflow you meant here.
@kparasch
This concern measurement tools:
The idea is to have overridable default values:

  • in the code
  • in the config
  • in the measure function call

i.e.:

class ConfigModel(ElementConfigModel):
    """
    Configuration model for Tune response matrix

    Parameters
    ----------
    quad_array_name : str
        Array name of quad used to adjust the tune
    betatron_tune_name : str
        Name of the diagnostic pyaml device for measuring the tune
    quad_delta : float
        Delta strength used to get the response matrix
    n_step: int, optional
        Number of step for fitting the tune [-quad_delta/n_step..quad_delta/n_step]
        Default 1
    sleep_between_step: float
        Default time sleep after quad exitation
        Default: 0
    n_tune_meas : int, optional
        Default number of tune measurement per step used for averaging
        Default 1
    sleep_between_meas: float
        Default time sleep between two tune measurment
        Default: 0
    """

    quad_array_name: str
    betatron_tune_name: str
    quad_delta: float
    n_step: Optional[int] = 1
    sleep_between_step: Optional[float] = 0
    n_tune_meas: Optional[int] = 1
    sleep_between_meas: Optional[float] = 0
    def measure(
        self,
        quad_delta: Optional[float] = None,
        n_step: Optional[int] = None,
        sleep_between_step: Optional[float] = None,
        n_tune_meas: Optional[int] = None,
        sleep_between_meas: Optional[float] = None,
        callback: Optional[Callable] = None,
    ):
        """
        Measure tune response matrix

        Parameters
        ----------
        quad_delta : float
            Delta strength used to get the response matrix
        n_step: int, optional
            Number of step for fitting the tune [-quad_delta/n_step..quad_delta/n_step]
            Default from config
        ...
        """

@JeanLucPons
Copy link
Contributor Author

JeanLucPons commented Mar 16, 2026

@kparasch

# all metadata is discarded here. Should we keep something?

I would say if we want to add additional metadata, we should update OrbitResponseMatrixDataConfigModel as well.

@JeanLucPons JeanLucPons force-pushed the new-response-matrix-architecture branch from 9d65643 to 26241c0 Compare March 17, 2026 12:16
@JeanLucPons JeanLucPons requested a review from kparasch March 17, 2026 13:20
@JeanLucPons JeanLucPons marked this pull request as ready for review March 17, 2026 13:20
@JeanLucPons JeanLucPons merged commit 0cf44ff into main Mar 17, 2026
3 checks passed
@JeanLucPons JeanLucPons deleted the new-response-matrix-architecture branch March 17, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants