Skip to content

Commit dd1b7c0

Browse files
committed
fix: reshape to expected dimensions
1 parent c3a6afe commit dd1b7c0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ess/estia/load.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ def load_mcstas_events(
2727
ybins = sc.linspace('y', -0.25, 0.25, 65)
2828
da = da.bin(x=xbins, y=ybins).rename_dims({'y': 'stripe'})
2929
da.coords['stripe'] = sc.arange('stripe', 0, 64)
30-
da.coords['z_index'] = sc.arange('x', 0, 14 * 32)
30+
da.coords['z_index'] = sc.arange('x', 14 * 32 - 1, -1, -1)
3131

3232
# Information is not available in the mcstas output files, therefore it's hardcoded
3333
da.coords['sample_position'] = sc.vector([0.264298, -0.427595, 35.0512], unit='m')
34+
da.coords['source_position'] = sc.vector([0, 0, 0.0], unit='m')
3435
da.coords['detector_position'] = sc.vector(
3536
tuple(map(float, da.coords['position'].value.split(' '))), unit='m'
3637
)
@@ -65,4 +66,6 @@ def load_mcstas_events(
6566
da.coords['sample_length'].value
6667
)
6768
da.coords["beam_size"] = sc.scalar(2.0, unit='mm')
69+
70+
da = da.fold('x', sizes={'blade': 14, 'wire': 32})
6871
return RawDetectorData[RunType](da)

0 commit comments

Comments
 (0)