Skip to content

Commit 58cc140

Browse files
committed
data: add updated simulation files to pooch, and add provider for parameters
1 parent 161415a commit 58cc140

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

src/ess/beer/data.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@
2828
"silicon-dhkl.tab": "md5:59ee9ed57a7c039ce416c8df886da9cc",
2929
"duplex-dhkl.tab": "md5:b4c6c2fcd66466ad291f306b2d6b346e",
3030
"dhkl_quartz_nc.tab": "md5:40887d736e3acf859e44488bfd9a9213",
31+
# Simulations from new model with corrected(?) L0.
32+
# For correct reduction you need to use
33+
# beer.io.mcstas_chopper_delay_from_mode_new_simulations
34+
# to obtain the correct WavelengthDefinitionChopperDelay for these files.
35+
"silicon-mode10-new-model.h5": "md5:98500830f27700fc719634e1acd49944",
36+
"silicon-mode16-new-model.h5": "md5:393f9287e7d3f97ceedbe64343918413",
37+
"silicon-mode7-new-model.h5": "md5:d2070d3132722bb551d99b243c62752f",
38+
"silicon-mode8-new-model.h5": "md5:d6dfdf7e87eccedf4f83c67ec552ca22",
39+
"silicon-mode9-new-model.h5": "md5:694a17fb616b7f1c20e94d9da113d201",
3140
},
3241
)
3342

@@ -54,6 +63,14 @@ def mcstas_silicon_medium_resolution() -> Path:
5463
return _registry.get_path('silicon-mode09.h5')
5564

5665

66+
def mcstas_silicon_new_model(mode: int) -> Path:
67+
"""
68+
Simulated intensity from silicon sample with
69+
medium resolution chopper configuration.
70+
"""
71+
return _registry.get_path(f'silicon-mode{mode}-new-model.h5')
72+
73+
5774
def duplex_peaks() -> Path:
5875
return _registry.get_path('duplex-dhkl.tab')
5976

src/ess/beer/io.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ def load_beer_mcstas_provider(
231231
def mcstas_chopper_delay_from_mode(
232232
da: DetectorData[SampleRun],
233233
) -> WavelengthDefinitionChopperDelay:
234+
'''These settings are good for the set of McStas runs that we
235+
use in the docs currently.
236+
Eventually we will want to determine this from the chopper information
237+
in the files, but that information is not in the simulation output.'''
234238
mode = next(iter(d.coords['mode'] for d in da.values())).value
235239
if mode in ('7', '8', '9', '10'):
236240
return sc.scalar(0.0024730158730158727, unit='s')
@@ -239,6 +243,25 @@ def mcstas_chopper_delay_from_mode(
239243
raise ValueError(f'Mode {mode} is not known.')
240244

241245

246+
def mcstas_chopper_delay_from_mode_new_simulations(
247+
da: DetectorData[SampleRun],
248+
) -> WavelengthDefinitionChopperDelay:
249+
'''Celine has a new simulation with some changes to the chopper placement(?).
250+
For those simulations we need to adapt the chopper delay values.'''
251+
mode = next(iter(d.coords['mode'] for d in da.values())).value
252+
if mode == '7':
253+
return sc.scalar(0.001370158730158727, unit='s')
254+
if mode == '8':
255+
return sc.scalar(0.001370158730158727, unit='s')
256+
if mode == '9':
257+
return sc.scalar(0.0022630158730158727, unit='s')
258+
if mode == '10':
259+
return sc.scalar(0.0022630158730158727, unit='s')
260+
if mode == '16':
261+
return sc.scalar(0.000476984126984127, unit='s')
262+
raise ValueError(f'Mode {mode} is not known.')
263+
264+
242265
def mcstas_modulation_period_from_mode(da: DetectorData[SampleRun]) -> ModulationPeriod:
243266
mode = next(iter(d.coords['mode'] for d in da.values())).value
244267
if mode in ('7', '8'):

0 commit comments

Comments
 (0)