ADR Suggestion
The Experiment
Object
#1
Replies: 2 comments 3 replies
-
As mentioned earlier, my issue with this is that Maybe the idea is to have the dataset (profile, spectrum) a separate object, which can be prepared before sending off to Analysis, and have instrumental parameters a different object? |
Beta Was this translation helpful? Give feedback.
-
Slight nitpick here, but surely the forward scattering is also sample dependent? In this case, I'm not sure where it belongs, but it's not purely |
Beta Was this translation helpful? Give feedback.
-
General
Following the discussion of the Top-level API in https://github.com/orgs/easyscience/discussions/29, the
Experiment
object is one of the 5 main objects in the API which the user will interact with.The
Experiment
object is responsible for handling both the measured data and the instrument model of an experiment. I.e. everything directly related to the experiment.Current Implementation
The
Experiment
object has not currently been implementedProposed Implementation
The
Experiment
object will contain two objects itself, theInstrumentModel
object, and theMeasurement
object, as well as a number of utility functions.The
InstrumentModel
ObjectThe
InstrumentModel
object will contain any physics which is related to the specific experimental setup used. It is added on top of the idealizedSampleModel
when fitting, to account for experimental features in order to produce a more realistic model that can be fit to the experimental data.A list of pre-defined
InstrumentModel
s will be provided for common instruments and setups, such as the main experimental setup for the imaging beamline ODIN at ESS, but customInstrumentModel
s can also be defined and saved for future use.The
InstrumentModel
will include the following experimental physics:The
Measurement
ObjectThe
Measurement
object will contain the measured data in the form of a Scipp Data Group, together with a list of Region Of Interests (ROIs).The
Measurement
Object is responsible for converting calls to Scipp syntax in order to interface with the Scipp Data Group and to interface with various data loaders.The
RoiSpectrum
ObjectThe
Experiment
object will include the very critical method:Which will return a
RoiSpectrum
Object by applying the given ROI.The
RoiSpectrum
object will also inherit fromBaseExperiment
and contain similar fields to theExperiment
object defined here.The
InstrumentModel
will be inherited from theExperiment
object, but theMeasurement
object will contain the 1D spectrum of the used ROI region rather than the full data stack.The
RoiSpectrum
will additionally contain the ROI used to define it and a reference to its parentExperiment
object.Utility methods
The
Experiment
object will additionally provide a number of utility methods for user usage:.load_scitiff
will load a scitiff file and create a newInstrumentModel
if the scitiff contains anyInstrumentModel
fields..load_tiff
will load a basic tiff file. Will require a timestep or a list of times to define ToF for each frame..load_instrument_model
will load a previously savedInstrumentModel
.set_instrument_model
will set anInstrumentModel
, either user-defined or from the pre-defined list..plot
will plot the spectrum of the (default first) ROI in the ROI list, if any, otherwise will assume the whole image as ROI..plot_model(sample_model=SampleModel)
will call the class method of theAnalysis
object to plot the theoretical spectrum with the providedSampleModel
and theInstrumentModel
applied, according to https://github.com/orgs/easyscience/discussions/29.calculate_model(sample_model=SampleModel)
will call the class method of theAnalysis
object to calculate the theoretical spectrum with the providedSampleModel
and theInstrumentModel
applied, according to https://github.com/orgs/easyscience/discussions/29.view
will show the time-averaged image if no time is defined, otherwise will show image at that time frame..ROI_list
will print the list of ROI's.add_ROI
will add a new ROI to the list of ROIs.ROI_selector
will open up the image and allow the user to define a ROI using the mouse.Beta Was this translation helpful? Give feedback.
All reactions