SampleModel to Experiment/Measurement linking
#71
Locked
damskii9992
announced in
ADRs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
General
Our users will have many different and all valid refinement workflows, in general they can be split into 4 groups: single, simultaneous, sequential and decoupled:
1. Single Refinement
1.1. One sample model, one measured dataset.
This is the simplest case. Unfortunately, life is often more complicated, but it’s a good starting point.
1.2. Multiple sample models, one measured dataset.
A slightly more complex case. For example, two crystallographic phases both contribute to the measured data. Both sample models need to be considered during refinement.
2. Simultaneous Refinement
2.1. One sample model, multiple datasets.
This scenario covers measurements of the same sample on different instruments or under different measurement conditions.
In this case, the same sample model parameters are refined simultaneously across multiple datasets, while instrument parameters can be specific to each dataset.
2.2. Multiple sample models, multiple datasets.
Each dataset may include contributions from different sample models. For example:
In this case, all datasets are refined simultaneously as part of a single combined refinement, with both:
3. Sequential Refinement
For example, studying temperature dependence in a phase transition by measuring datasets at different temperatures.
This sequential strategy is particularly important when working with large datasets, such as hundreds of measurements collected at small temperature steps, or in imaging where flight-path calibration has to be done for every experiment.
4. Decoupled Refinement
For example, comparing several candidate magnetic structures to determine which one best fits the data.
Because different techniques have very different requirements, we have 2 different API's / strategies to support these many different types of refinement. All techniques should use one of these two API's / strategies.
1: Linking
SampleModelto theMeasurement/Experimenthappens inAnalysisThe linking of which
SampleModelgoes with whichMeasurement/Experimenthappens in theAnalysispage in the GUI or when constructing theAnalysisobject in the library.This is the strategy employed by
EasyImagingandEasyDynamics.Library API
Users simply pass a list of models and experiments to the
Analysisobject when creating it. The choice of the refinement strategy is decided with keyword arguments:The
Analysisclass handles the logic of choosing which type of refinement is chosen based on its inputs.Application Workflow
The users can load in as many datasets as they want in a project and create as many
Measurement/Experimentsas they want and choose which one to view on theMeasurements/Experimentpage.On the
SampleModelpage the user can also define as many models as they wish and choose which one to view.On the
Analysispage, a table/list/stack of allMeasurements/Experimentsare shown and another table/list/stack of allSampleModelsare shown. AnAnalysisobject can then be created by draggingMeasurements/Experimentsfrom its stack andSampleModelsfrom its stack into an emptyAnalysistable/list/stack. As manyAnalysisobjects can be created as the user wants by simply adding another emptyAnalysisto the stack.On the
Sumarypage, a table/list/stack of allAnalysisobjects are shown, so a summary of each one can be viewed separately or compared.2: Linking
SampleModelto theExperimenthappens inExperimentThis strategy defines the relationship between a
SampleModeland anExperimentas part of theExperiment, rather than creating the relationship later inAnalysis.This is the strategy employed by
EasyDiffractionandEasyReflectometry.Motivation
For diffraction, the
Experimentis the natural place where measured data, instrument configuration, and sample contributions come together.This approach is also consistent with IUCr CIF standards, which separate structural and experimental information into different datablocks. A structure datablock describes the sample model, while an experiment datablock describes the measurement and contains references to the structures contributing to that experiment.
From this perspective, an experiment represents measured data collected from one or more sample contributions using a specific instrument setup. Therefore, an
Experimentshould contain:Important
Importantly, the experiment stores only references to sample models (for example, unique identifiers or names) and experiment-specific contribution parameters. It does not own or duplicate the sample model objects themselves.
This keeps structural information and experimental information clearly separated while preserving the relationship between them.
Library API
The
Experimentowns the information describing which sample models contribute to its calculated pattern.For example:
In this example, both experiments reference the same structural model (
lbco) while maintaining independent experiment-specific contribution parameters. The Bragg experiment additionally references a second structural model (si) that does not contribute to the PDF experiment. This demonstrates that experiments can share sample models while also defining different sets of contributing sample models.The
Analysisobject does not create or manage model–experiment relationships. Instead, it operates on the relationships already defined by the experiments and focuses solely on fitting strategy and execution.For example:
In a joint Bragg + PDF refinement, multiple experiments may reference the same sample model while each experiment maintains its own instrument parameters, background, scale factors, resolution functions, and other experiment-specific settings.
Application Workflow
Sample Model Page
The user defines one or more sample models.
Experiment Page
The user defines one or more experiments.
For each experiment, the user can view and edit the list of contributing sample models together with experiment-specific contribution parameters such as scale factors.
Typical functionality includes:
This allows each experiment to accurately represent the physical system measured in that dataset.
Analysis Page
The Analysis page does not recreate model–experiment relationships.
Instead, it only defines how the existing experiments should be processed, for example:
singlejointsequentialAnalysis jobs are automatically generated from the set of experiments and their linked sample models.
This keeps the Analysis page focused on fitting strategy rather than on redefining the physical content of experiments.
Advantages
This approach is particularly suitable for diffraction because:
Link to the ADR suggestion:
#31
Beta Was this translation helpful? Give feedback.
All reactions