Basic extrapolation with PyDynamic.uncertainty.interpolate.interp1d_unc

This is the third notebook in the series to illustrate the use of our method interp1d_unc. We will conduct a simple interpolation with constant extrapolation outside the original data’s bounds.

Preparation

First we setup our Python and plotting environment and collect all previously extracted measurement data and their visualization.

Setup the Python environment

[1]:
import holoviews as hv
import numpy as np
import pickle

from PyDynamic.uncertainty import interp1d_unc

Setup plotting environment and labels

[2]:
# Set one of the available plotting backends ('plotly', 'bokeh', 'maplotlib').
hv.extension("bokeh")

# Define labels and units for plots.
timestamp_labels = hv.Dimension(("Time", "relative measurement time"), unit="s")
measurement_labels = hv.Dimension(("Current", "Primary Nominal Current"), unit="A")

Load results from previous lessons

[3]:
try:
    y = np.load("data_points.npy")
    uy = np.load("data_points_unc.npy")
    x = np.load("time_stamps.npy")
    with open("original_plot.p", "rb") as f:
        original_plot = pickle.load(f)
except FileNotFoundError:
    print(
        "The measurement data is not available. Please execute all steps in '01 "
        "Basic measurement data pre-processing' before you proceed."
    )

Setup extra- and interpolation timestamps

We extend the time axis of the original values at both the upper and lower interval boundaries.

[4]:
# Setup list of vectors of extra- and interpolation timestamps with increasing number.
x_news = [
    np.linspace(start=x.min() - 4e-3, stop=x.max() + 4e-3, num=n_nodes)
    for n_nodes in np.arange(start=2, stop=40, step=3)
]
x_news
[4]:
[array([0.   , 0.014]),
 array([0.    , 0.0035, 0.007 , 0.0105, 0.014 ]),
 array([0.   , 0.002, 0.004, 0.006, 0.008, 0.01 , 0.012, 0.014]),
 array([0.    , 0.0014, 0.0028, 0.0042, 0.0056, 0.007 , 0.0084, 0.0098,
        0.0112, 0.0126, 0.014 ]),
 array([0.        , 0.00107692, 0.00215385, 0.00323077, 0.00430769,
        0.00538462, 0.00646154, 0.00753846, 0.00861538, 0.00969231,
        0.01076923, 0.01184615, 0.01292308, 0.014     ]),
 array([0.      , 0.000875, 0.00175 , 0.002625, 0.0035  , 0.004375,
        0.00525 , 0.006125, 0.007   , 0.007875, 0.00875 , 0.009625,
        0.0105  , 0.011375, 0.01225 , 0.013125, 0.014   ]),
 array([0.        , 0.00073684, 0.00147368, 0.00221053, 0.00294737,
        0.00368421, 0.00442105, 0.00515789, 0.00589474, 0.00663158,
        0.00736842, 0.00810526, 0.00884211, 0.00957895, 0.01031579,
        0.01105263, 0.01178947, 0.01252632, 0.01326316, 0.014     ]),
 array([0.        , 0.00063636, 0.00127273, 0.00190909, 0.00254545,
        0.00318182, 0.00381818, 0.00445455, 0.00509091, 0.00572727,
        0.00636364, 0.007     , 0.00763636, 0.00827273, 0.00890909,
        0.00954545, 0.01018182, 0.01081818, 0.01145455, 0.01209091,
        0.01272727, 0.01336364, 0.014     ]),
 array([0.     , 0.00056, 0.00112, 0.00168, 0.00224, 0.0028 , 0.00336,
        0.00392, 0.00448, 0.00504, 0.0056 , 0.00616, 0.00672, 0.00728,
        0.00784, 0.0084 , 0.00896, 0.00952, 0.01008, 0.01064, 0.0112 ,
        0.01176, 0.01232, 0.01288, 0.01344, 0.014  ]),
 array([0.    , 0.0005, 0.001 , 0.0015, 0.002 , 0.0025, 0.003 , 0.0035,
        0.004 , 0.0045, 0.005 , 0.0055, 0.006 , 0.0065, 0.007 , 0.0075,
        0.008 , 0.0085, 0.009 , 0.0095, 0.01  , 0.0105, 0.011 , 0.0115,
        0.012 , 0.0125, 0.013 , 0.0135, 0.014 ]),
 array([0.        , 0.00045161, 0.00090323, 0.00135484, 0.00180645,
        0.00225806, 0.00270968, 0.00316129, 0.0036129 , 0.00406452,
        0.00451613, 0.00496774, 0.00541935, 0.00587097, 0.00632258,
        0.00677419, 0.00722581, 0.00767742, 0.00812903, 0.00858065,
        0.00903226, 0.00948387, 0.00993548, 0.0103871 , 0.01083871,
        0.01129032, 0.01174194, 0.01219355, 0.01264516, 0.01309677,
        0.01354839, 0.014     ]),
 array([0.        , 0.00041176, 0.00082353, 0.00123529, 0.00164706,
        0.00205882, 0.00247059, 0.00288235, 0.00329412, 0.00370588,
        0.00411765, 0.00452941, 0.00494118, 0.00535294, 0.00576471,
        0.00617647, 0.00658824, 0.007     , 0.00741176, 0.00782353,
        0.00823529, 0.00864706, 0.00905882, 0.00947059, 0.00988235,
        0.01029412, 0.01070588, 0.01111765, 0.01152941, 0.01194118,
        0.01235294, 0.01276471, 0.01317647, 0.01358824, 0.014     ]),
 array([0.        , 0.00037838, 0.00075676, 0.00113514, 0.00151351,
        0.00189189, 0.00227027, 0.00264865, 0.00302703, 0.00340541,
        0.00378378, 0.00416216, 0.00454054, 0.00491892, 0.0052973 ,
        0.00567568, 0.00605405, 0.00643243, 0.00681081, 0.00718919,
        0.00756757, 0.00794595, 0.00832432, 0.0087027 , 0.00908108,
        0.00945946, 0.00983784, 0.01021622, 0.01059459, 0.01097297,
        0.01135135, 0.01172973, 0.01210811, 0.01248649, 0.01286486,
        0.01324324, 0.01362162, 0.014     ])]

Conduct and visualize extrapolation

There are several options, how to determine values in the extrapolation range. Those options are available for the extrapolation of measurement values as well as associated uncertainties independently. The provided parameters are fill_value and fill_unc. All of those methods require the parameter bounds_error=False to explicitly express the desire to extrapolate. Otherwise a ValueError will be thrown. In the following we demonstrate the different methods:

Extrapolate based on original data

To conduct the simplest extrapolation, we choose extrapolate as both fill_value and fill_unc to fill the extrapolation range with the next adjacent original values. This results in a constant extrapolation based on the original values’ at the interval bounds.

[5]:
# Create plots of extra- and interpolated values and uncertainties for the increasing
# number of nodes.
interpolation_dict = {}
for x_new in x_news:
    # Conduct the actual extra- and interpolation for the current set of nodes.
    x_new, y_new, uy_new = interp1d_unc(
        x_new=x_new,
        x=x,
        y=y,
        uy=uy,
        kind="cubic",
        bounds_error=False,
        fill_value="extrapolate",
        fill_unc="extrapolate",
    )
    print(x_new, y_new, uy_new)

    # Create plot of the extra- and interpolated values.
    curve_interp = hv.Curve(
        (x_new, y_new),
        timestamp_labels,
        measurement_labels,
        label="interpolated values",
    )

    # Create plot of the extra- and interpolated uncertainties.
    interp_uncertainties = hv.Spread(
        (x_new, y_new, uy_new),
        vdims=[measurement_labels, "Associated Uncertainty"],
        kdims=timestamp_labels,
        label="interpolated uncertainties",
    )

    interpolation_dict[x_new.size] = curve_interp * interp_uncertainties
[0.    0.014] [2.47691988 1.41385091] [0.0371538  0.02120776]
[0.     0.0035 0.007  0.0105 0.014 ] [2.47691988 2.47691988 4.30061078 1.41385091 1.41385091] [0.0371538  0.0371538  0.04827905 0.02120776 0.02120776]
[0.    0.002 0.004 0.006 0.008 0.01  0.012 0.014] [2.47691988 2.47691988 2.47691988 4.1246116  3.95322654 1.41385091
 1.41385091 1.41385091] [0.0371538  0.0371538  0.0371538  0.06186917 0.0592984  0.02120776
 0.02120776 0.02120776]
[0.     0.0014 0.0028 0.0042 0.0056 0.007  0.0084 0.0098 0.0112 0.0126
 0.014 ] [2.47691988 2.47691988 2.47691988 2.70790346 3.92303416 4.30061078
 3.6523559  1.78999209 1.41385091 1.41385091 1.41385091] [0.0371538  0.0371538  0.0371538  0.03596855 0.06624638 0.04827905
 0.06359732 0.02530684 0.02120776 0.02120776 0.02120776]
[0.         0.00107692 0.00215385 0.00323077 0.00430769 0.00538462
 0.00646154 0.00753846 0.00861538 0.00969231 0.01076923 0.01184615
 0.01292308 0.014     ] [2.47691988 2.47691988 2.47691988 2.47691988 2.82682583 3.78589296
 4.26650548 4.18296586 3.4495766  1.98064018 1.41385091 1.41385091
 1.41385091 1.41385091] [0.0371538  0.0371538  0.0371538  0.0371538  0.03879058 0.06650832
 0.05395581 0.05206813 0.06389044 0.03090299 0.02120776 0.02120776
 0.02120776 0.02120776]
[0.       0.000875 0.00175  0.002625 0.0035   0.004375 0.00525  0.006125
 0.007    0.007875 0.00875  0.009625 0.0105   0.011375 0.01225  0.013125
 0.014   ] [2.47691988 2.47691988 2.47691988 2.47691988 2.47691988 2.89916327
 3.69041759 4.17288882 4.30061078 4.02761732 3.30794225 2.09561941
 1.41385091 1.41385091 1.41385091 1.41385091 1.41385091] [0.0371538  0.0371538  0.0371538  0.0371538  0.0371538  0.04116281
 0.06570834 0.05982792 0.04827905 0.05736188 0.06309699 0.03458366
 0.02120776 0.02120776 0.02120776 0.02120776 0.02120776]
[0.         0.00073684 0.00147368 0.00221053 0.00294737 0.00368421
 0.00442105 0.00515789 0.00589474 0.00663158 0.00736842 0.00810526
 0.00884211 0.00957895 0.01031579 0.01105263 0.01178947 0.01252632
 0.01326316 0.014     ] [2.47691988 2.47691988 2.47691988 2.47691988 2.47691988 2.47691988
 2.94776256 3.6208712  4.07844023 4.29301995 4.23716065 3.88341267
 3.20432629 2.17245183 1.41385091 1.41385091 1.41385091 1.41385091
 1.41385091 1.41385091] [0.0371538  0.0371538  0.0371538  0.0371538  0.0371538  0.0371538
 0.04292271 0.06468969 0.06339827 0.05134839 0.04994423 0.06077502
 0.0620627  0.03706643 0.02120776 0.02120776 0.02120776 0.02120776
 0.02120776 0.02120776]
[0.         0.00063636 0.00127273 0.00190909 0.00254545 0.00318182
 0.00381818 0.00445455 0.00509091 0.00572727 0.00636364 0.007
 0.00763636 0.00827273 0.00890909 0.00954545 0.01018182 0.01081818
 0.01145455 0.01209091 0.01272727 0.01336364 0.014     ] [2.47691988 2.47691988 2.47691988 2.47691988 2.47691988 2.47691988
 2.47691988 2.98264639 3.56817364 3.99479809 4.24483779 4.30061078
 4.14443512 3.75862884 3.12551001 2.22739665 1.41385091 1.41385091
 1.41385091 1.41385091 1.41385091 1.41385091 1.41385091] [0.0371538  0.0371538  0.0371538  0.0371538  0.0371538  0.0371538
 0.0371538  0.04423834 0.06369699 0.06532009 0.05563395 0.04827905
 0.0535279  0.06266537 0.06104178 0.03883156 0.02120776 0.02120776
 0.02120776 0.02120776 0.02120776 0.02120776 0.02120776]
[0.      0.00056 0.00112 0.00168 0.00224 0.0028  0.00336 0.00392 0.00448
 0.00504 0.0056  0.00616 0.00672 0.00728 0.00784 0.0084  0.00896 0.00952
 0.01008 0.01064 0.0112  0.01176 0.01232 0.01288 0.01344 0.014  ] [2.47691988 2.47691988 2.47691988 2.47691988 2.47691988 2.47691988
 2.47691988 2.47691988 3.00889661 3.52694483 3.92303416 4.18511483
 4.3011371  4.2590512  4.04680739 3.6523559  3.06364699 2.26863088
 1.41385091 1.41385091 1.41385091 1.41385091 1.41385091 1.41385091
 1.41385091 1.41385091] [0.0371538  0.0371538  0.0371538  0.0371538  0.0371538  0.0371538
 0.0371538  0.0371538  0.04524727 0.06279743 0.06624638 0.05922602
 0.05023311 0.04912985 0.05679877 0.06359732 0.06010796 0.04014406
 0.02120776 0.02120776 0.02120776 0.02120776 0.02120776 0.02120776
 0.02120776 0.02120776]
[0.     0.0005 0.001  0.0015 0.002  0.0025 0.003  0.0035 0.004  0.0045
 0.005  0.0055 0.006  0.0065 0.007  0.0075 0.008  0.0085 0.009  0.0095
 0.01   0.0105 0.011  0.0115 0.012  0.0125 0.013  0.0135 0.014 ] [2.47691988 2.47691988 2.47691988 2.47691988 2.47691988 2.47691988
 2.47691988 2.47691988 2.47691988 3.02936253 3.49384322 3.86178517
 4.1246116  4.27374573 4.30061078 4.19662998 3.95322654 3.5618237
 3.01384466 2.30071266 1.41385091 1.41385091 1.41385091 1.41385091
 1.41385091 1.41385091 1.41385091 1.41385091 1.41385091] [0.0371538  0.0371538  0.0371538  0.0371538  0.0371538  0.0371538
 0.0371538  0.0371538  0.0371538  0.04604122 0.0620018  0.06658834
 0.06186917 0.05332441 0.04827905 0.05153456 0.0592984  0.06395319
 0.05927581 0.04115559 0.02120776 0.02120776 0.02120776 0.02120776
 0.02120776 0.02120776 0.02120776 0.02120776 0.02120776]
[0.         0.00045161 0.00090323 0.00135484 0.00180645 0.00225806
 0.00270968 0.00316129 0.0036129  0.00406452 0.00451613 0.00496774
 0.00541935 0.00587097 0.00632258 0.00677419 0.00722581 0.00767742
 0.00812903 0.00858065 0.00903226 0.00948387 0.00993548 0.0103871
 0.01083871 0.01129032 0.01174194 0.01219355 0.01264516 0.01309677
 0.01354839 0.014     ] [2.47691988 2.47691988 2.47691988 2.47691988 2.47691988 2.47691988
 2.47691988 2.47691988 2.47691988 2.55284495 3.04576482 3.46669813
 3.80932493 4.06732527 4.23437922 4.30416683 4.27036816 4.12666327
 3.8667322  3.48425502 2.97291179 2.32638255 1.53834737 1.41385091
 1.41385091 1.41385091 1.41385091 1.41385091 1.41385091 1.41385091
 1.41385091 1.41385091] [0.0371538  0.0371538  0.0371538  0.0371538  0.0371538  0.0371538
 0.0371538  0.0371538  0.0371538  0.03558371 0.04668041 0.06130304
 0.06658881 0.06371279 0.056357   0.04965463 0.0487502  0.0541722
 0.06108156 0.0639662  0.05854034 0.04195782 0.02094216 0.02120776
 0.02120776 0.02120776 0.02120776 0.02120776 0.02120776 0.02120776
 0.02120776 0.02120776]
[0.         0.00041176 0.00082353 0.00123529 0.00164706 0.00205882
 0.00247059 0.00288235 0.00329412 0.00370588 0.00411765 0.00452941
 0.00494118 0.00535294 0.00576471 0.00617647 0.00658824 0.007
 0.00741176 0.00782353 0.00823529 0.00864706 0.00905882 0.00947059
 0.00988235 0.01029412 0.01070588 0.01111765 0.01152941 0.01194118
 0.01235294 0.01276471 0.01317647 0.01358824 0.014     ] [2.47691988 2.47691988 2.47691988 2.47691988 2.47691988 2.47691988
 2.47691988 2.47691988 2.47691988 2.47691988 2.61436603 3.05920366
 3.44404325 3.76409454 4.01456722 4.19067101 4.28761563 4.30061078
 4.22486619 4.05559155 3.7879966  3.41729104 2.93868457 2.34738693
 1.63860781 1.41385091 1.41385091 1.41385091 1.41385091 1.41385091
 1.41385091 1.41385091 1.41385091 1.41385091 1.41385091] [0.0371538  0.0371538  0.0371538  0.0371538  0.0371538  0.0371538
 0.0371538  0.0371538  0.0371538  0.0371538  0.03519329 0.04720517
 0.06068931 0.06639095 0.06495398 0.0589396  0.05196268 0.04827905
 0.05042291 0.05653217 0.06230174 0.06377662 0.05789089 0.04260903
 0.02203892 0.02120776 0.02120776 0.02120776 0.02120776 0.02120776
 0.02120776 0.02120776 0.02120776 0.02120776 0.02120776]
[0.         0.00037838 0.00075676 0.00113514 0.00151351 0.00189189
 0.00227027 0.00264865 0.00302703 0.00340541 0.00378378 0.00416216
 0.00454054 0.00491892 0.0052973  0.00567568 0.00605405 0.00643243
 0.00681081 0.00718919 0.00756757 0.00794595 0.00832432 0.0087027
 0.00908108 0.00945946 0.00983784 0.01021622 0.01059459 0.01097297
 0.01135135 0.01172973 0.01210811 0.01248649 0.01286486 0.01324324
 0.01362162 0.014     ] [2.47691988 2.47691988 2.47691988 2.47691988 2.47691988 2.47691988
 2.47691988 2.47691988 2.47691988 2.47691988 2.47691988 2.66520347
 3.07041516 3.42485447 3.7248044  3.96654794 4.14636809 4.26054784
 4.30537019 4.27711814 4.17207468 3.9865228  3.71674551 3.35902579
 2.90964664 2.36489106 1.72104205 1.41385091 1.41385091 1.41385091
 1.41385091 1.41385091 1.41385091 1.41385091 1.41385091 1.41385091
 1.41385091 1.41385091] [0.0371538  0.0371538  0.0371538  0.0371538  0.0371538  0.0371538
 0.0371538  0.0371538  0.0371538  0.0371538  0.0371538  0.0354263
 0.04764322 0.06014857 0.06608022 0.06575736 0.06101105 0.05444555
 0.04931408 0.04854929 0.05248837 0.05847941 0.06310264 0.06346951
 0.05731598 0.04314785 0.02362907 0.02120776 0.02120776 0.02120776
 0.02120776 0.02120776 0.02120776 0.02120776 0.02120776 0.02120776
 0.02120776 0.02120776]
[6]:
# Visualize the interpolation result along-side the original data.
(original_plot * hv.HoloMap(interpolation_dict, kdims="number of nodes")).opts(
    width=600, height=320, legend_position="bottom"
)
[6]:

Extrapolate based on additional input

Besides using the values at the interpolation interval bounds, it is possible to specify different constant values for the extrapolation range. This can be done via a single float for both ranges or via a two-tuple. In the latter case the first value will be used for the lower range.

[7]:
# Create plots of extra- and interpolated values and uncertainties for the increasing
# number of nodes.
interpolation_dict = {}
for x_new in x_news:
    # Conduct the actual extra- and interpolation for the current set of nodes.
    x_new, y_new, uy_new = interp1d_unc(
        x_new=x_new,
        x=x,
        y=y,
        uy=uy,
        kind="cubic",
        bounds_error=False,
        fill_value=2,
        fill_unc=[0.1, 0.4],
    )
    print(x_new, y_new, uy_new)

    # Create plot of the extra- and interpolated values.
    curve_interp = hv.Curve(
        (x_new, y_new),
        timestamp_labels,
        measurement_labels,
        label="interpolated values",
    )

    # Create plot of the extra- and interpolated uncertainties.
    interp_uncertainties = hv.Spread(
        (x_new, y_new, uy_new),
        vdims=[measurement_labels, "Associated Uncertainty"],
        kdims=timestamp_labels,
        label="interpolated uncertainties",
    )

    interpolation_dict[x_new.size] = curve_interp * interp_uncertainties
[0.    0.014] [2. 2.] [0.1 0.4]
[0.     0.0035 0.007  0.0105 0.014 ] [2.         2.         4.30061078 2.         2.        ] [0.1        0.1        0.04827905 0.4        0.4       ]
[0.    0.002 0.004 0.006 0.008 0.01  0.012 0.014] [2.         2.         2.47691988 4.1246116  3.95322654 1.41385091
 2.         2.        ] [0.1        0.1        0.0371538  0.06186917 0.0592984  0.02120776
 0.4        0.4       ]
[0.     0.0014 0.0028 0.0042 0.0056 0.007  0.0084 0.0098 0.0112 0.0126
 0.014 ] [2.         2.         2.         2.70790346 3.92303416 4.30061078
 3.6523559  1.78999209 2.         2.         2.        ] [0.1        0.1        0.1        0.03596855 0.06624638 0.04827905
 0.06359732 0.02530684 0.4        0.4        0.4       ]
[0.         0.00107692 0.00215385 0.00323077 0.00430769 0.00538462
 0.00646154 0.00753846 0.00861538 0.00969231 0.01076923 0.01184615
 0.01292308 0.014     ] [2.         2.         2.         2.         2.82682583 3.78589296
 4.26650548 4.18296586 3.4495766  1.98064018 2.         2.
 2.         2.        ] [0.1        0.1        0.1        0.1        0.03879058 0.06650832
 0.05395581 0.05206813 0.06389044 0.03090299 0.4        0.4
 0.4        0.4       ]
[0.       0.000875 0.00175  0.002625 0.0035   0.004375 0.00525  0.006125
 0.007    0.007875 0.00875  0.009625 0.0105   0.011375 0.01225  0.013125
 0.014   ] [2.         2.         2.         2.         2.         2.89916327
 3.69041759 4.17288882 4.30061078 4.02761732 3.30794225 2.09561941
 2.         2.         2.         2.         2.        ] [0.1        0.1        0.1        0.1        0.1        0.04116281
 0.06570834 0.05982792 0.04827905 0.05736188 0.06309699 0.03458366
 0.4        0.4        0.4        0.4        0.4       ]
[0.         0.00073684 0.00147368 0.00221053 0.00294737 0.00368421
 0.00442105 0.00515789 0.00589474 0.00663158 0.00736842 0.00810526
 0.00884211 0.00957895 0.01031579 0.01105263 0.01178947 0.01252632
 0.01326316 0.014     ] [2.         2.         2.         2.         2.         2.
 2.94776256 3.6208712  4.07844023 4.29301995 4.23716065 3.88341267
 3.20432629 2.17245183 2.         2.         2.         2.
 2.         2.        ] [0.1        0.1        0.1        0.1        0.1        0.1
 0.04292271 0.06468969 0.06339827 0.05134839 0.04994423 0.06077502
 0.0620627  0.03706643 0.4        0.4        0.4        0.4
 0.4        0.4       ]
[0.         0.00063636 0.00127273 0.00190909 0.00254545 0.00318182
 0.00381818 0.00445455 0.00509091 0.00572727 0.00636364 0.007
 0.00763636 0.00827273 0.00890909 0.00954545 0.01018182 0.01081818
 0.01145455 0.01209091 0.01272727 0.01336364 0.014     ] [2.         2.         2.         2.         2.         2.
 2.         2.98264639 3.56817364 3.99479809 4.24483779 4.30061078
 4.14443512 3.75862884 3.12551001 2.22739665 2.         2.
 2.         2.         2.         2.         2.        ] [0.1        0.1        0.1        0.1        0.1        0.1
 0.1        0.04423834 0.06369699 0.06532009 0.05563395 0.04827905
 0.0535279  0.06266537 0.06104178 0.03883156 0.4        0.4
 0.4        0.4        0.4        0.4        0.4       ]
[0.      0.00056 0.00112 0.00168 0.00224 0.0028  0.00336 0.00392 0.00448
 0.00504 0.0056  0.00616 0.00672 0.00728 0.00784 0.0084  0.00896 0.00952
 0.01008 0.01064 0.0112  0.01176 0.01232 0.01288 0.01344 0.014  ] [2.         2.         2.         2.         2.         2.
 2.         2.         3.00889661 3.52694483 3.92303416 4.18511483
 4.3011371  4.2590512  4.04680739 3.6523559  3.06364699 2.26863088
 2.         2.         2.         2.         2.         2.
 2.         2.        ] [0.1        0.1        0.1        0.1        0.1        0.1
 0.1        0.1        0.04524727 0.06279743 0.06624638 0.05922602
 0.05023311 0.04912985 0.05679877 0.06359732 0.06010796 0.04014406
 0.4        0.4        0.4        0.4        0.4        0.4
 0.4        0.4       ]
[0.     0.0005 0.001  0.0015 0.002  0.0025 0.003  0.0035 0.004  0.0045
 0.005  0.0055 0.006  0.0065 0.007  0.0075 0.008  0.0085 0.009  0.0095
 0.01   0.0105 0.011  0.0115 0.012  0.0125 0.013  0.0135 0.014 ] [2.         2.         2.         2.         2.         2.
 2.         2.         2.47691988 3.02936253 3.49384322 3.86178517
 4.1246116  4.27374573 4.30061078 4.19662998 3.95322654 3.5618237
 3.01384466 2.30071266 1.41385091 2.         2.         2.
 2.         2.         2.         2.         2.        ] [0.1        0.1        0.1        0.1        0.1        0.1
 0.1        0.1        0.0371538  0.04604122 0.0620018  0.06658834
 0.06186917 0.05332441 0.04827905 0.05153456 0.0592984  0.06395319
 0.05927581 0.04115559 0.02120776 0.4        0.4        0.4
 0.4        0.4        0.4        0.4        0.4       ]
[0.         0.00045161 0.00090323 0.00135484 0.00180645 0.00225806
 0.00270968 0.00316129 0.0036129  0.00406452 0.00451613 0.00496774
 0.00541935 0.00587097 0.00632258 0.00677419 0.00722581 0.00767742
 0.00812903 0.00858065 0.00903226 0.00948387 0.00993548 0.0103871
 0.01083871 0.01129032 0.01174194 0.01219355 0.01264516 0.01309677
 0.01354839 0.014     ] [2.         2.         2.         2.         2.         2.
 2.         2.         2.         2.55284495 3.04576482 3.46669813
 3.80932493 4.06732527 4.23437922 4.30416683 4.27036816 4.12666327
 3.8667322  3.48425502 2.97291179 2.32638255 1.53834737 2.
 2.         2.         2.         2.         2.         2.
 2.         2.        ] [0.1        0.1        0.1        0.1        0.1        0.1
 0.1        0.1        0.1        0.03558371 0.04668041 0.06130304
 0.06658881 0.06371279 0.056357   0.04965463 0.0487502  0.0541722
 0.06108156 0.0639662  0.05854034 0.04195782 0.02094216 0.4
 0.4        0.4        0.4        0.4        0.4        0.4
 0.4        0.4       ]
[0.         0.00041176 0.00082353 0.00123529 0.00164706 0.00205882
 0.00247059 0.00288235 0.00329412 0.00370588 0.00411765 0.00452941
 0.00494118 0.00535294 0.00576471 0.00617647 0.00658824 0.007
 0.00741176 0.00782353 0.00823529 0.00864706 0.00905882 0.00947059
 0.00988235 0.01029412 0.01070588 0.01111765 0.01152941 0.01194118
 0.01235294 0.01276471 0.01317647 0.01358824 0.014     ] [2.         2.         2.         2.         2.         2.
 2.         2.         2.         2.         2.61436603 3.05920366
 3.44404325 3.76409454 4.01456722 4.19067101 4.28761563 4.30061078
 4.22486619 4.05559155 3.7879966  3.41729104 2.93868457 2.34738693
 1.63860781 2.         2.         2.         2.         2.
 2.         2.         2.         2.         2.        ] [0.1        0.1        0.1        0.1        0.1        0.1
 0.1        0.1        0.1        0.1        0.03519329 0.04720517
 0.06068931 0.06639095 0.06495398 0.0589396  0.05196268 0.04827905
 0.05042291 0.05653217 0.06230174 0.06377662 0.05789089 0.04260903
 0.02203892 0.4        0.4        0.4        0.4        0.4
 0.4        0.4        0.4        0.4        0.4       ]
[0.         0.00037838 0.00075676 0.00113514 0.00151351 0.00189189
 0.00227027 0.00264865 0.00302703 0.00340541 0.00378378 0.00416216
 0.00454054 0.00491892 0.0052973  0.00567568 0.00605405 0.00643243
 0.00681081 0.00718919 0.00756757 0.00794595 0.00832432 0.0087027
 0.00908108 0.00945946 0.00983784 0.01021622 0.01059459 0.01097297
 0.01135135 0.01172973 0.01210811 0.01248649 0.01286486 0.01324324
 0.01362162 0.014     ] [2.         2.         2.         2.         2.         2.
 2.         2.         2.         2.         2.         2.66520347
 3.07041516 3.42485447 3.7248044  3.96654794 4.14636809 4.26054784
 4.30537019 4.27711814 4.17207468 3.9865228  3.71674551 3.35902579
 2.90964664 2.36489106 1.72104205 2.         2.         2.
 2.         2.         2.         2.         2.         2.
 2.         2.        ] [0.1        0.1        0.1        0.1        0.1        0.1
 0.1        0.1        0.1        0.1        0.1        0.0354263
 0.04764322 0.06014857 0.06608022 0.06575736 0.06101105 0.05444555
 0.04931408 0.04854929 0.05248837 0.05847941 0.06310264 0.06346951
 0.05731598 0.04314785 0.02362907 0.4        0.4        0.4
 0.4        0.4        0.4        0.4        0.4        0.4
 0.4        0.4       ]
[8]:
# Visualize the interpolation result along-side the original data.
(original_plot * hv.HoloMap(interpolation_dict, kdims="number of nodes")).opts(
    width=600, height=350, legend_position="bottom"
)
[8]: