Skip to content
256 changes: 157 additions & 99 deletions sasdata/metadata.py

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions sasdata/quantities/unit_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from re import findall, fullmatch

from sasdata.quantities.units import Dimensions, NamedUnit, Unit, UnitGroup, symbol_lookup, unit_groups
import sasdata.quantities.units as units
from sasdata.quantities.units import NamedUnit, Unit, UnitGroup, symbol_lookup, unit_groups

# TODO: This shouldn't be in this file but I don't want to edit Lucas' code before he is finished.

Expand Down Expand Up @@ -128,7 +129,7 @@ def parse_unit(unit_str: str, longest_unit: bool = True) -> Unit:
try:
if not validate_unit_str(unit_str):
raise ValueError(f"unit_str ({unit_str}) contains forbidden characters.")
parsed_unit = Unit(1, Dimensions())
parsed_unit = units.none
unit_stack = parse_unit_stack(unit_str, longest_unit)
for unit in unit_stack:
# parsed_unit = combine_units(parsed_unit, unit)
Expand Down
16 changes: 8 additions & 8 deletions test/test_files/reference/14250.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Process:
Term: None
Notes: None
Sample:
ID: None
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
ID: None
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
Aperture:
Name: None
Aperture size: None
Expand All @@ -41,8 +41,8 @@ Source:
Wavelength: None
Min. Wavelength: None
Max. Wavelength: None
Wavelength Spread: None
Beam Size: None
Wavelength spread: None
Beam size: None
Transmission Spectrum:
Name: None
Timestamp: None
Expand Down
16 changes: 8 additions & 8 deletions test/test_files/reference/33837.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ Process:
Term: None
Notes: None
Sample:
ID: None
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
ID: None
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
Aperture:
Name: None
Aperture size: None
Expand All @@ -40,8 +40,8 @@ Source:
Wavelength: None
Min. Wavelength: None
Max. Wavelength: None
Wavelength Spread: None
Beam Size: None
Wavelength spread: None
Beam size: None
Transmission Spectrum:
Name: None
Timestamp: None
Expand Down
4 changes: 2 additions & 2 deletions test/test_files/reference/33837_v3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ Source:
Wavelength: None
Min. Wavelength: None
Max. Wavelength: None
Wavelength Spread: None
Beam Size: None
Wavelength spread: None
Beam size: None
Transmission Spectrum:
Name: None
Timestamp: None
Expand Down
16 changes: 8 additions & 8 deletions test/test_files/reference/BAM.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Process:
Term: None
Notes: None
Sample:
ID: None
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
ID: None
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
Aperture:
Name: None
Aperture size: None
Expand All @@ -41,8 +41,8 @@ Source:
Wavelength: None
Min. Wavelength: None
Max. Wavelength: None
Wavelength Spread: None
Beam Size: None
Wavelength spread: None
Beam size: None
Transmission Spectrum:
Name: None
Timestamp: None
Expand Down
50 changes: 25 additions & 25 deletions test/test_files/reference/ISIS_1_0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,42 @@ Metadata:

Definition: TK49 c10_SANS
Process:
Name: Mantid generated CanSAS1D XML
Date: 02-Aug-2013 16:54:14
Name: Mantid generated CanSAS1D XML
Date: 02-Aug-2013 16:54:14
Description: None
Terms:
svn: 2.5.3
user_file: K:/masks/MASKLOQ_MAN_132E_Lu_Banjo_12mm.txt
Sample:
ID: TK49 c10_SANS
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
ID: TK49 c10_SANS
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
Collimation:
Length: None
Length: None
Detector:
Name: HAB
Distance: 0.575 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Name: HAB
Distance: 0.575 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Detector:
Name: main-detector-bank
Distance: 4.14502 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Name: main-detector-bank
Distance: 4.14502 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Source:
Radiation: neutron
Shape: None
Wavelength: None
Min. Wavelength: None
Max. Wavelength: None
Wavelength Spread: None
Beam Size: None
Wavelength spread: None
Beam size: None
50 changes: 25 additions & 25 deletions test/test_files/reference/ISIS_1_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,42 @@ Metadata:

Definition: TK49 c10_SANS
Process:
Name: Mantid generated CanSAS1D XML
Date: 02-Aug-2013 16:53:56
Name: Mantid generated CanSAS1D XML
Date: 02-Aug-2013 16:53:56
Description: None
Terms:
svn: 2.5.3
user_file: K:/masks/MASKLOQ_MAN_132E_Lu_Banjo_12mm.txt
Sample:
ID: TK49 c10_SANS
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
ID: TK49 c10_SANS
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
Collimation:
Length: None
Length: None
Detector:
Name: HAB
Distance: 0.575 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Name: HAB
Distance: 0.575 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Detector:
Name: main-detector-bank
Distance: 4.14502 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Name: main-detector-bank
Distance: 4.14502 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Source:
Radiation: neutron
Shape: None
Wavelength: None
Min. Wavelength: None
Max. Wavelength: None
Wavelength Spread: None
Beam Size: None
Wavelength spread: None
Beam size: None
50 changes: 25 additions & 25 deletions test/test_files/reference/ISIS_1_1_doubletrans.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,42 @@ Metadata:

Definition: TK49 c10_SANS
Process:
Name: Mantid generated CanSAS1D XML
Date: 02-Aug-2013 16:53:56
Name: Mantid generated CanSAS1D XML
Date: 02-Aug-2013 16:53:56
Description: None
Terms:
svn: 2.5.3
user_file: K:/masks/MASKLOQ_MAN_132E_Lu_Banjo_12mm.txt
Sample:
ID: TK49 c10_SANS
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
ID: TK49 c10_SANS
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
Collimation:
Length: None
Length: None
Detector:
Name: HAB
Distance: 0.575 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Name: HAB
Distance: 0.575 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Detector:
Name: main-detector-bank
Distance: 4.14502 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Name: main-detector-bank
Distance: 4.14502 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Source:
Radiation: neutron
Shape: None
Wavelength: None
Min. Wavelength: None
Max. Wavelength: None
Wavelength Spread: None
Beam Size: None
Wavelength spread: None
Beam size: None
50 changes: 25 additions & 25 deletions test/test_files/reference/ISIS_1_1_notrans.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,42 @@ Metadata:

Definition: TK49 c10_SANS
Process:
Name: Mantid generated CanSAS1D XML
Date: 02-Aug-2013 16:53:56
Name: Mantid generated CanSAS1D XML
Date: 02-Aug-2013 16:53:56
Description: None
Terms:
svn: 2.5.3
user_file: K:/masks/MASKLOQ_MAN_132E_Lu_Banjo_12mm.txt
Sample:
ID: TK49 c10_SANS
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
ID: TK49 c10_SANS
Transmission: None
Thickness: None
Temperature: None
Position: None
Orientation: None
Collimation:
Length: None
Length: None
Detector:
Name: HAB
Distance: 0.575 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Name: HAB
Distance: 0.575 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Detector:
Name: main-detector-bank
Distance: 4.14502 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Name: main-detector-bank
Distance: 4.14502 m
Offset: None
Orientation: None
Beam center: None
Pixel size: None
Slit length: None
Source:
Radiation: neutron
Shape: None
Wavelength: None
Min. Wavelength: None
Max. Wavelength: None
Wavelength Spread: None
Beam Size: None
Wavelength spread: None
Beam size: None
Loading
Loading