Skip to content

Commit

Permalink
Merge pull request #758 from markotoplak/fix-nea-gsf
Browse files Browse the repository at this point in the history
Nea .gsf files not always include Interferometer Center/Distance
  • Loading branch information
markotoplak authored Oct 4, 2024
2 parents 22a97b3 + 6a49688 commit 612d90c
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions orangecontrib/spectroscopy/io/neaspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 612d90c

Please sign in to comment.