diff --git a/openflexure_microscope/utilities.py b/openflexure_microscope/utilities.py index 07b2426e..2e8f6a6b 100644 --- a/openflexure_microscope/utilities.py +++ b/openflexure_microscope/utilities.py @@ -26,7 +26,7 @@ def set_properties(obj, **kwargs): setattr(obj, k, v) -def axes_to_array(coordinate_dictionary, axis_keys=('x', 'y', 'z'), base_array=None): +def axes_to_array(coordinate_dictionary, axis_keys=('x', 'y', 'z'), base_array=None, asint=True): """Takes key-value pairs of a JSON value, and maps onto an array""" # If no base array is given if not base_array: @@ -39,7 +39,7 @@ def axes_to_array(coordinate_dictionary, axis_keys=('x', 'y', 'z'), base_array=N # Do the mapping for axis, key in enumerate(axis_keys): if key in coordinate_dictionary: - base_array[axis] = coordinate_dictionary[key] + base_array[axis] = int(coordinate_dictionary[key]) if asint else coordinate_dictionary[key] return base_array