Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/ess/powder/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,10 @@ class DataWithScatteringCoordinates(sciline.Scope[RunType, sc.DataArray], sc.Dat
d-spacing."""


NeXusDetectorDimensions = NewType("NeXusDetectorDimensions", dict[str, int])
"""Logical detector dimensions."""


class DspacingData(sciline.Scope[RunType, sc.DataArray], sc.DataArray):
"""Data converted to d-spacing."""


class DspacingDataWithoutVariances(sciline.Scope[RunType, sc.DataArray], sc.DataArray):
"""Data converted to d-spacing where variances where removed."""


DspacingHistogram = NewType("DspacingHistogram", sc.DataArray)
"""Histogrammed intensity vs d-spacing."""

Expand Down
6 changes: 3 additions & 3 deletions src/ess/snspowder/powgen/beamline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import scipp as sc

from ...powder.types import (
NeXusDetectorDimensions,
DetectorBankSizes,
NeXusDetectorName,
)

Expand Down Expand Up @@ -55,9 +55,9 @@ def map_detector_to_spectrum(

def powgen_detector_dimensions(
detector_name: NeXusDetectorName,
) -> NeXusDetectorDimensions:
) -> DetectorBankSizes:
"""Dimensions used by POWGEN detectors."""
return NeXusDetectorDimensions(DETECTOR_BANK_SIZES[detector_name])
return DetectorBankSizes(DETECTOR_BANK_SIZES[detector_name])


providers = (powgen_detector_dimensions,)
Expand Down
8 changes: 4 additions & 4 deletions src/ess/snspowder/powgen/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

import scipp as sc

from ...powder.types import (
from ess.powder.types import (
AccumulatedProtonCharge,
CalibrationData,
CalibrationFilename,
DetectorBankSizes,
DetectorData,
Filename,
NeXusDetectorDimensions,
ProtonCharge,
RawDataAndMetadata,
RunType,
Expand Down Expand Up @@ -103,7 +103,7 @@ def pooch_load(filename: Filename[RunType]) -> RawDataAndMetadata[RunType]:

def pooch_load_calibration(
filename: CalibrationFilename,
detector_dimensions: NeXusDetectorDimensions,
detector_dimensions: DetectorBankSizes,
) -> CalibrationData:
"""Load the calibration data for the POWGEN test data."""
if filename is None:
Expand All @@ -119,7 +119,7 @@ def pooch_load_calibration(


def extract_raw_data(
dg: RawDataAndMetadata[RunType], sizes: NeXusDetectorDimensions
dg: RawDataAndMetadata[RunType], sizes: DetectorBankSizes
) -> DetectorData[RunType]:
"""Return the events from a loaded data group."""
# Remove the tof binning and dimension, as it is not needed and it gets in the way
Expand Down