2. Preparation of calibration data

[1]:
%pylab inline
Populating the interactive namespace from numpy and matplotlib
[2]:
from meas_data_preprocessing import *
from hydrophone_data_preprocessing import *
/home/ludwig10/code/envs/PyDynamic_tutorials-py38/lib/python3.8/site-packages/PyDynamic/identification/fit_filter.py:24: DeprecationWarning: The module *identification* will be combined with the module *deconvolution* and renamed to *model_estimation* in the next major release 2.0.0. From version 1.4.1 on you should only use the new module *model_estimation* instead.
  warnings.warn(
/home/ludwig10/code/envs/PyDynamic_tutorials-py38/lib/python3.8/site-packages/PyDynamic/identification/fit_transfer.py:23: DeprecationWarning: The package *identification* will be combined with the package *deconvolution* and renamed to *model_estimation* in the next major release 2.0.0. From version 1.4.1 on you should only use the new package *model_estimation* instead.
  warnings.warn(
/home/ludwig10/code/envs/PyDynamic_tutorials-py38/lib/python3.8/site-packages/PyDynamic/uncertainty/interpolation.py:24: PendingDeprecationWarning: The module :mod:`PyDynamic.uncertainty.interpolation` will be renamed to :mod:`PyDynamic.uncertainty.interpolate` in the next major release 2.0.0. From version 1.4.3 on you should only use the new module instead.
  warnings.warn(

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.
/home/ludwig10/code/envs/PyDynamic_tutorials-py38/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.
  and should_run_async(code)
[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"]));
../../_images/PyDynamic_tutorials_deconvolution_02_Preparation_of_calibration_data_10_0.png
[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"]));

/home/ludwig10/code/envs/PyDynamic_tutorials-py38/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.
  and should_run_async(code)
../../_images/PyDynamic_tutorials_deconvolution_02_Preparation_of_calibration_data_11_1.png