Skip to content

Commit

Permalink
Merge pull request #759 from brnovasco/neaspec-wavenumber-scaling
Browse files Browse the repository at this point in the history
NeaReaderMultiChannel - Apply wavenumber scaling to Δx
  • Loading branch information
markotoplak authored Oct 5, 2024
2 parents a3c182f + faaf4d4 commit 5a74ade
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion orangecontrib/spectroscopy/io/neaspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,20 @@ def create_padded_domain(self, df, padding=100):
M maximum values are outside the expected range."
)
self.domain = np.arange(d_start, d_end, dm)
dx = 2 * float(dm) * 1e2 # convert [m] to [cm]
self.calculate_datapoint_spacing(dm)

def calculate_datapoint_spacing(self, domain_spacing):
# calculate datapoint spacing in cm for the fft widget as the optical path
dx = 2 * float(domain_spacing) * 1e2 # convert [m] to [cm]
# check file headers for wavenumber scaling factor
# and apply it to the calculated spacing
try:
wavenumber_scaling = self.info["Wavenumber Scaling"]
wavenumber_scaling = float(wavenumber_scaling)
dx = dx / wavenumber_scaling
except KeyError:
pass
# register the calculated spacing in the metadata
self.info["Calculated Datapoint Spacing (Δx)"] = ["[cm]", dx]

def create_original_df(self, fpath):
Expand Down

0 comments on commit 5a74ade

Please sign in to comment.