getting started with PyOTC -- Exercise 2


In [ ]:
import sys
sys.path.append('../..')

import pyotc

set working directory


In [ ]:
from os.path import join
from os.path import expanduser

directory = '../exampleData/height_calibration_single_psds/'
#homefolder = expanduser('~')
#directory = join(homefolder,'')

create HeightCalibration object and scan folder for psd-files


In [ ]:
basename = 'B01_'

hc = pyotc.HeightCalibration()
hc.get_psd_files(basename, directory=directory)

In [ ]:
hc.files

initialize fits for each psd data file


In [ ]:
hc.gen_psd_fits()

setup PSD fits


In [ ]:
hc.setup_psd_fits(model='hydro',
                  lp_filter=True, lp_fixed=True,
                  aliasing=False, f_sample=None, N_alias=9,
                  f3dB=9000, alpha=0.3)

Fit all psd measurements


In [ ]:
bounds = {'x': (10, 10e3), 'y': (10, 11e3), 'z': (10, 5e3)}
excl = {'x': [], 'z': [21952, 21960, 22296, 22304]}

hc.fit_psds(bounds=bounds, f_exclude=excl, plot_fits=True);

Save height-dependent data


In [ ]:
hc.save_hc_data(basename, directory)

In [ ]: