Commit 550bb945bdcaf81ccf8a0a06995ae21391086e46
1 parent
7cd9bfa8
fixed UDR problems in the agilent_binary class
Showing
1 changed file
with
4 additions
and
1 deletions
Show diff stats
stim/envi/agilent_binary.h
... | ... | @@ -202,7 +202,10 @@ public: |
202 | 202 | //double int_delta = 0.00012656; //interferogram sample spacing in centimeters |
203 | 203 | double int_delta = (1.0 / ELWN) * ((double)UDR / 2.0); //calculate the interferogram spacing |
204 | 204 | double int_length = int_delta * R[2]; //interferogram length in centimeters |
205 | - double fft_delta = 1/int_length; //spectrum spacing (in inverse centimeters, wavenumber | |
205 | + double fft_delta = 1/int_length; //spectrum spacing (in inverse centimeters, wavenumber) | |
206 | + double fft_max = fft_delta * R[2]/2; //get the maximum wavenumber value supported by the specified number of interferogram samples | |
207 | + | |
208 | + 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 | |
206 | 209 | |
207 | 210 | size_t start_i = (size_t)std::ceil(band_min / fft_delta); //calculate the first band to store |
208 | 211 | size_t size_i = (size_t)std::floor(band_max / fft_delta) - start_i; //calculate the number of bands to store | ... | ... |