Created
April 19, 2016 15:24
-
-
Save danieljfarrell/4bdda931f085d26a1bb09187950a71b3 to your computer and use it in GitHub Desktop.
APS make_frequency_information function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_frequency_information(self): | |
"""NB kUseNewFFTMethod = True for MATLAB algorithm.""" | |
reference = self.measurement.reference | |
if len(reference) > 1: | |
dt = self.measurement.optical_delay_spacing | |
t_offset = self.measurement.optical_delay_offset | |
f_max = 1./(2*dt) | |
if kUseNewFFTMethod: | |
freq = np.linspace(0.0, f_max, len(reference) + 1) | |
else: | |
freq = np.linspace(0.0, f_max, 1+len(reference)/2.) | |
else: | |
f_max = 40.0 | |
dt = 1./(2*f_max) # in ps | |
if kUseNewFFTMethod: | |
t_offset = -2048*dt | |
freq = np.linspace(0.0, f_max, 2048) | |
else: | |
t_offset = -1024*dt | |
freq = np.linspace(0.0, f_max, 1024) | |
# freq array, spacing, offset | |
return freq, dt, t_offset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment