In [ ]:
import sys
sys.path.append('../..')
import pyotc
In [ ]:
from os.path import join
from os.path import expanduser
directory = '../exampleData/height_calibration_single_psds/'
#home = expanduser('~')
#directory = join(home, 'Downloads/exampleData/height_calib_lvfiles/converted_data/')
In [ ]:
dfile = 'B01_1000.dat'
pm = pyotc.PSDMeasurement(warn=False)
pm.load(directory, dfile)
In [ ]:
pm.freq_x
In [ ]:
pm.psd_x
In [ ]:
pm.ex_amplitude
In [ ]:
pm.exp_setting.radius
In [ ]:
pm._freq_unit
In [ ]:
pm._psd_unit
In [ ]:
pm.exp_setting.get_radius(unit='ly')
In [ ]:
pm.plot_psds()
In [ ]:
# active calibration?
pm.active_calibration
In [ ]:
# active oscillations at
pm.ex_freq
In [ ]:
# create a PSDfit object from the loaded psd measurement
pf = pyotc.PSDFit(pm)
# setup the fit model - include low pass filtering or aliasing
pf.setup_fit(model='lorentzian')
pf.fit_psds()
In [ ]:
# show the fits
pf.plot_fits()
In [ ]:
# did not work out? Tweak the model
pf.setup_fit(model='lorentzian', lp_filter=True, lp_fixed=True, f3dB=8000, alpha=0.33)
bounds = {'x': (10, 35e3), 'y': (10, 35e3), 'z': (10, 35e3)}
pf.fit_psds(bounds=bounds)
pf.plot_fits(showLegend=False)
In [ ]:
conf_level = 0.95
pf.is_outlier()
In [ ]:
# where are the fits located?
pf.fits
In [ ]:
# get the fit parameters
f = pf.fits['x']
f.params.pretty_print()
In [ ]:
pf.print_results()
In [ ]:
pf.print_pc_results()
In [ ]:
pf.ac_results['x'].get_dissens(unit='nm/V')
In [21]:
# default writes the results to the parameter files of the psdmeasurement
pf.write_results_to_file()
In [ ]: