Skip to content

Commit

Permalink
fix: use only relative motor vals for EDD maps
Browse files Browse the repository at this point in the history
  • Loading branch information
keara-soloway committed Mar 5, 2024
1 parent c3afd12 commit c2d721e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions CHAP/common/models/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def validate_for_scalar_data(self, scalar_data):

def get_value(
self, spec_scans:SpecScans, scan_number:int, scan_step_index:int=0,
scalar_data=[], relative=False, ndigits=None):
scalar_data=[], relative=True, ndigits=None):
"""Return the value recorded for this instance of
`PointByPointScanData` at a specific scan step.
Expand All @@ -373,7 +373,7 @@ def get_value(
`data_type == 'expression'`, defaults to `[]`.
:type scalar_data: list[PointByPointScanData], optional
:param relative: Whether to return a relative value or not,
defaults to `False` (only applies to SPEC motor values).
defaults to `True` (only applies to SPEC motor values).
:type relative: bool, optional
:params ndigits: Round SPEC motor values to the specified
number of decimals if set, defaults to `None`.
Expand Down Expand Up @@ -410,7 +410,7 @@ def get_value(
@cache
def get_spec_motor_value(spec_file:str, scan_number:int,
scan_step_index:int, spec_mnemonic:str,
relative=False, ndigits=None):
relative=True, ndigits=None):
"""Return the value recorded for a SPEC motor at a specific scan
step.
Expand All @@ -425,7 +425,7 @@ def get_spec_motor_value(spec_file:str, scan_number:int,
:param spec_mnemonic: The menmonic of a SPEC motor.
:type spec_mnemonic: str
:param relative: Whether to return a relative value or not,
defaults to `False`.
defaults to `True`.
:type relative: bool, optional
:params ndigits: Round SPEC motor values to the specified
number of decimals if set, defaults to `None`.
Expand Down Expand Up @@ -940,7 +940,7 @@ def validate_map_type(cls, map_type, values):
scalar_data = values['scalar_data']
import_scanparser(values['station'], values['experiment_type'])
for i, dim in enumerate(deepcopy(independent_dimensions)):
if scan_type > 2 and dim.label in fly_axis_labels:
if dim.label in fly_axis_labels:
relative = True
ndigits = 3
else:
Expand Down Expand Up @@ -971,7 +971,7 @@ def validate_map_type(cls, map_type, values):
list(dims[dim.label]).index(
dim.get_value(scans, scan_number, scan_step_index,
scalar_data, True, 3))
if scan_type > 2 and dim.label in fly_axis_labels else
if dim.label in fly_axis_labels else
list(dims[dim.label]).index(
dim.get_value(scans, scan_number, scan_step_index,
scalar_data))
Expand Down Expand Up @@ -1025,7 +1025,7 @@ def coords(self):
fly_axis_labels = self.attrs.get('fly_axis_labels', [])
coords = {}
for dim in self.independent_dimensions:
if scan_type > 2 and dim.label in fly_axis_labels:
if dim.label in fly_axis_labels:
relative = True
ndigits = 3
else:
Expand Down Expand Up @@ -1146,7 +1146,7 @@ def get_scan_step_index(self, map_index):
dim.get_value(
scans, scan_number, scan_step_index,
self.scalar_data, True, 3)
if scan_type > 2 and dim.label in fly_axis_labels
if dim.label in fly_axis_labels
else
dim.get_value(
scans, scan_number, scan_step_index,
Expand Down

0 comments on commit c2d721e

Please sign in to comment.