diff --git a/orangecontrib/spectroscopy/io/neaspec.py b/orangecontrib/spectroscopy/io/neaspec.py index fcec2d00a..f7f41827c 100644 --- a/orangecontrib/spectroscopy/io/neaspec.py +++ b/orangecontrib/spectroscopy/io/neaspec.py @@ -283,13 +283,18 @@ def _format_file(self, gsf_a, gsf_p, parameters, channel_a, channel_p): # calculate datapoint spacing in cm for the fft widget number_of_points = px_z - scan_size = float( - info["Interferometer Center/Distance"][2].replace(",", "") - ) # Microns - scan_size = scan_size * 1e-4 # Convert to cm - step_size = (scan_size * 2) / (number_of_points - 1) - # metadata info for the fft widget calculation - info["Calculated Datapoint Spacing (Δx)"] = ["[cm]", step_size] + try: + scan_size = float( + info["Interferometer Center/Distance"][2].replace(",", "") + ) # Microns + except KeyError: + scan_size = None + if scan_size is not None: + scan_size = scan_size * 1e-4 # Convert to cm + step_size = (scan_size * 2) / (number_of_points - 1) + # metadata info for the fft widget calculation + info["Calculated Datapoint Spacing (Δx)"] = ["[cm]", step_size] + # metadata info for selecting the correct fft method in the fft widget info["Channel Data Type"] = "Polar", "i.e. Amplitude and Phase separated"