From 550bb945bdcaf81ccf8a0a06995ae21391086e46 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 13 Sep 2016 14:21:17 -0500 Subject: [PATCH] fixed UDR problems in the agilent_binary class --- stim/envi/agilent_binary.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stim/envi/agilent_binary.h b/stim/envi/agilent_binary.h index 8c95921..8e1c718 100644 --- a/stim/envi/agilent_binary.h +++ b/stim/envi/agilent_binary.h @@ -202,7 +202,10 @@ public: //double int_delta = 0.00012656; //interferogram sample spacing in centimeters double int_delta = (1.0 / ELWN) * ((double)UDR / 2.0); //calculate the interferogram spacing double int_length = int_delta * R[2]; //interferogram length in centimeters - double fft_delta = 1/int_length; //spectrum spacing (in inverse centimeters, wavenumber + double fft_delta = 1/int_length; //spectrum spacing (in inverse centimeters, wavenumber) + double fft_max = fft_delta * R[2]/2; //get the maximum wavenumber value supported by the specified number of interferogram samples + + if(band_max > fft_max) band_max = fft_max; //the user gave a band outside of the FFT range, reset the band to the maximum available size_t start_i = (size_t)std::ceil(band_min / fft_delta); //calculate the first band to store size_t size_i = (size_t)std::floor(band_max / fft_delta) - start_i; //calculate the number of bands to store -- libgit2 0.21.4