Skip to content

Conversation

@EZoni
Copy link
Member

@EZoni EZoni commented Jan 9, 2026

Overview

Add a selector that allows the user to choose whether the parameters displayed in the sliders and plots are the experiment parameters or the simulation parameters (which can be mapped into each other through the calibration constants).

Comparison before (left) v. after (right) this PR:

Screenshot from 2026-01-09 09-28-13 Screenshot from 2026-01-09 10-35-26

Linked issues

Close #345.

Notes

This PR also moves the output selector to the parameters control panel. I think this looks simpler and less cluttered, but I'm ready to revert the change, should any objections be raised.

To do

@EZoni EZoni changed the title [WIP] Add control to select type of inputs to display [WIP] Add control to select type of inputs displayed Jan 9, 2026
@EZoni
Copy link
Member Author

EZoni commented Jan 14, 2026

To be understood why we have the following when we inspect the columns of the experiment and simulation dataframes:

  • Experiment dataframe columns:
    df_copy.columns = Index(['_id', 'n_protons', 'experiment_flag', 'date',
           'DAZZLER-LT-3rdorder value1', 'Preplasma Z (MFA)'],
          dtype='object')
    
  • Simulation dataframe columns:
    df_copy.columns = Index(['_id', 'experiment_flag', 'date', 'target_to_focus_distance',
           'n_protons_2d', 'TOD', 'Preplasma Z (MFA)',
           'DAZZLER-LT-3rdorder value1', 'n_protons'],
          dtype='object')
    

@EZoni
Copy link
Member Author

EZoni commented Jan 15, 2026

@RemiLehe

The data structure we have with the current implementation in this PR is something along the lines of

{
    'exp': {
        'Preplasma Z (MFA)': 12.1,
        'DAZZLER-LT-3rdorder value1': 80000.0
    },
    'sim': {
        'target_to_focus_distance': 99.99999999999964,
        'TOD': 80000.0
    }
}

if you consider, for example, the state.parameters state variable.

I think this is not very handy and maybe could be replaced by something along the lines of

{
    'input1': {
        'exp_name': 'Preplasma Z (MFA)',
        'sim_name': 'target_to_focus_distance',
        'exp_value': 12.1,
        'sim_value': 99.99999999999964,
    },
    'input2': {
        'exp_name': 'DAZZLER-LT-3rdorder value1',
        'sim_name': 'TOD',
        'exp_value': 80000.0,
        'sim_value': 80000.0,
    },
} 

to make it easy to switch between experiment representation and simulation representation while pointing to a given parameter. Not sure whether the top layer should be a dictionary or a list, it is just to give an idea.

On the other hand, I noticed that for the staging injector experiment, some of the simulation inputs in the calibration section are said to depend on some of the experiment outputs. I'm not sure what this means, but it should probably be taken into account when choosing the data structure above.

What do you think?

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.

Add component to choose experiment parameters v. simulation parameters

1 participant