Skip to content

Commit af22db7

Browse files
committed
fix: stripe -> strip
1 parent 3ec0fb3 commit af22db7

File tree

7 files changed

+16
-22
lines changed

7 files changed

+16
-22
lines changed

src/ess/amor/conversions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def add_masks(
163163
and by wavelength.
164164
"""
165165
da = da.assign_masks(
166-
stripe_range=_not_between(da.coords["stripe"], *ylim),
166+
strip_range=_not_between(da.coords["strip"], *ylim),
167167
z_range=_not_between(da.coords["z_index"], *zlims),
168168
)
169169
da = da.bins.assign_masks(

src/ess/amor/geometry.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class Detector:
1010
nBlades = sc.scalar(14)
1111
# number of wires per blade
1212
nWires = sc.scalar(32)
13-
# number of stripes per blade
14-
nStripes = sc.scalar(64)
13+
# number of strips per blade
14+
nStrips = sc.scalar(64)
1515
# angle of incidence of the beam on the blades (def: 5.1)
1616
angle = sc.scalar(5.1, unit="degree").to(unit="rad")
1717
# height-distance of neighboring pixels on one blade
@@ -34,21 +34,21 @@ def pixel_coordinates_in_detector_system() -> tuple[sc.Variable, sc.Variable]:
3434
'row',
3535
1,
3636
(
37-
Detector.nBlades * Detector.nWires * Detector.nStripes + sc.scalar(1)
37+
Detector.nBlades * Detector.nWires * Detector.nStrips + sc.scalar(1)
3838
).values,
3939
unit=None,
4040
).fold(
4141
'row',
4242
sizes={
4343
'blade': Detector.nBlades,
4444
'wire': Detector.nWires,
45-
'stripe': Detector.nStripes,
45+
'strip': Detector.nStrips,
4646
},
4747
),
4848
coords={
4949
'blade': sc.arange('blade', sc.scalar(0), Detector.nBlades),
5050
'wire': sc.arange('wire', sc.scalar(0), Detector.nWires),
51-
'stripe': sc.arange('stripe', sc.scalar(0), Detector.nStripes),
51+
'strip': sc.arange('strip', sc.scalar(0), Detector.nStrips),
5252
},
5353
)
5454
# x position in detector

src/ess/estia/maskings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def add_masks(
2727
and by wavelength.
2828
"""
2929
da = da.assign_masks(
30-
stripe_range=_not_between(da.coords["stripe"], *ylim),
30+
strip_range=_not_between(da.coords["strip"], *ylim),
3131
z_range=_not_between(da.coords["z_index"], *zlims),
3232
divergence_too_large=_not_between(
3333
da.coords["divergence_angle"],

src/ess/estia/workflow.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,16 @@
44
import sciline
55
import scipp as sc
66

7-
from ess.reduce import nexus
8-
97
from ..reflectometry import providers as reflectometry_providers
108
from ..reflectometry import supermirror
119
from ..reflectometry.types import (
1210
BeamDivergenceLimits,
1311
DetectorSpatialResolution,
1412
NeXusDetectorName,
15-
ReferenceRun,
1613
RunType,
1714
SampleRotationOffset,
18-
SampleRun,
1915
)
20-
from . import conversions, corrections, load, maskings, normalization, orso
16+
from . import beamline, conversions, corrections, load, maskings, normalization, orso
2117

2218
_general_providers = (
2319
*reflectometry_providers,
@@ -74,9 +70,7 @@ def EstiaMcStasWorkflow() -> sciline.Pipeline:
7470

7571
def EstiaWorkflow() -> sciline.Pipeline:
7672
"""Workflow for reduction of data for the Estia instrument."""
77-
workflow = nexus.GenericNeXusWorkflow(
78-
run_types=[SampleRun, ReferenceRun], monitor_types=[]
79-
)
73+
workflow = beamline.LoadNeXusWorkflow()
8074
for provider in providers:
8175
workflow.insert(provider)
8276
for name, param in default_parameters().items():

src/ess/reflectometry/normalization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ def reduce_reference(
4040
)
4141
reference = reference.bins.assign_masks(invalid=sc.isnan(R))
4242
reference = reference / R
43-
out = reference.bins.concat(('stripe',)).hist(wavelength=wavelength_bins)
43+
out = reference.bins.concat(('strip',)).hist(wavelength=wavelength_bins)
4444

4545
if 'position' in reference.coords:
46-
out.coords['position'] = reference.coords['position'].mean('stripe')
46+
out.coords['position'] = reference.coords['position'].mean('strip')
4747
return out
4848

4949

@@ -96,7 +96,7 @@ def reduce_sample_over_zw(
9696
9797
Returns reflectivity as a function of ``blade``, ``wire`` and :math:`\\wavelength`.
9898
"""
99-
return sample.bins.concat(('stripe',)).bin(wavelength=wbins) / sc.values(
99+
return sample.bins.concat(('strip',)).bin(wavelength=wbins) / sc.values(
100100
reference.data
101101
)
102102

tests/estia/mcstas_data_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def estia_mcstas_pipeline() -> sciline.Pipeline:
7979
def test_mcstas_compute_reducible_data(estia_mcstas_pipeline: sciline.Pipeline):
8080
estia_mcstas_pipeline[Filename[SampleRun]] = estia_mcstas_sample_run(11)
8181
da = estia_mcstas_pipeline.compute(ReducibleData[SampleRun])
82-
assert da.dims == ('stripe', 'blade', 'wire')
82+
assert da.dims == ('strip', 'blade', 'wire')
8383
assert da.shape == (64, 48, 32)
8484
assert 'position' in da.coords
8585
assert 'sample_rotation' in da.coords

tests/reflectometry/normalization_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ def sample(request):
1515
coords={
1616
'wavelength': sc.linspace('events', 1, 5, n),
1717
'wire': sc.array(dims=('events',), values=np.random.randint(0, 5, n)),
18-
'stripe': sc.array(dims=('events',), values=np.random.randint(0, 10, n)),
18+
'strip': sc.array(dims=('events',), values=np.random.randint(0, 10, n)),
1919
},
2020
)
21-
return da.group('wire', 'stripe')
21+
return da.group('wire', 'strip')
2222

2323

2424
@pytest.fixture
@@ -29,7 +29,7 @@ def reference(request):
2929
coords={
3030
'wavelength': sc.linspace('events', 1, 5, n),
3131
'wire': sc.array(dims=('events',), values=np.random.randint(0, 5, n)),
32-
'stripe': sc.array(dims=('events',), values=np.random.randint(0, 10, n)),
32+
'strip': sc.array(dims=('events',), values=np.random.randint(0, 10, n)),
3333
},
3434
)
3535
return da.group('wire').bin(wavelength=2).bins.sum()

0 commit comments

Comments
 (0)