2. Preparation of calibration data
[1]:
%matplotlib inline
[2]:
from meas_data_preprocessing import *
from hydrophone_data_preprocessing import *
Read calibration data for selected measurement scenario
[3]:
infos, hyd_data = read_calib_data(meas_scenario=13, do_plot=False)
Checking if file ../datasets/pD7_MH44.DAT is already present or download it from https://raw.githubusercontent.com/Ma-Weber/Tutorial-Deconvolution/master/MeasuredSignals/pD-Mode%207%20MHz/pD7_MH44.DAT otherwise:
Replace is False and data exists, so doing nothing. Use replace=True to re-download the data.
Checking if file ../datasets/pD7_MH44r.DAT is already present or download it from https://raw.githubusercontent.com/Ma-Weber/Tutorial-Deconvolution/master/MeasuredSignals/pD-Mode%207%20MHz/pD7_MH44r.DAT otherwise:
Replace is False and data exists, so doing nothing. Use replace=True to re-download the data.
Checking if file ../datasets/MW_MH44ReIm.csv is already present or download it from https://raw.githubusercontent.com/Ma-Weber/Tutorial-Deconvolution/master/HydrophoneCalibrationData/MW_MH44ReIm.csv otherwise:
Replace is False and data exists, so doing nothing. Use replace=True to re-download the data.
[4]:
# metadata for chosen measurement scenario
for key in infos.keys():
print("%20s: %s" % (key, infos[key]))
i: 13
hydrophonname: GAMPT MH44
measurementtype: Pulse-Doppler-Mode 7 MHz
measurementfile: ../datasets/pD7_MH44.DAT
noisefile: ../datasets/pD7_MH44r.DAT
hydfilename: ../datasets/MW_MH44ReIm.csv
[5]:
# available measurement data
for key in hyd_data.keys():
print("%10s: %s" % (key, type(hyd_data[key])))
name: <class 'str'>
frequency: <class 'numpy.ndarray'>
real: <class 'numpy.ndarray'>
imag: <class 'numpy.ndarray'>
varreal: <class 'numpy.ndarray'>
varimag: <class 'numpy.ndarray'>
cov: <class 'numpy.ndarray'>
Reduce frequency range
[6]:
hyd_data = reduce_freq_range(hyd_data, fmin=1e6, fmax=100e6)
Plot amplitude and phase data
[7]:
figure(figsize=(16, 8))
plot(
hyd_data["frequency"] / 1e6, np.sqrt(hyd_data["real"] ** 2 + hyd_data["imag"] ** 2)
)
xlabel("Frequency f / MHz")
ylabel("Sensitivity M / V/Pa")
title("Filename: {}".format(hyd_data["name"]))
show()
[8]:
figure(figsize=(16, 8))
plot(hyd_data["frequency"] / 1e6, np.arctan2(hyd_data["imag"], hyd_data["real"]))
xlabel("Frequency f / MHz")
ylabel(r"Phase $\varphi$ / rad")
title("Filename: {}".format(hyd_data["name"]))
show()