We can basic arithmetic operations (plus, minus, multiplication and division) with DataArrays, both with scalars, numpy arrays and other DataArrays. The output will in all cases be a new DataArray.
import mikeio
fn1 = "../tests/testdata/oresundHD_run1.dfsu"
da1 = mikeio.read(fn1, items="Surface elevation")[0]
fn2 = "../tests/testdata/oresundHD_run2.dfsu"
da2 = mikeio.read(fn2, items="Surface elevation")[0]
We can scale a DataArray or add a constant using *, +, / and -
da1.values.mean()
0.18681715078618902
da1_A = da1 + 1
da1_B = da1 - 1
da1_A.values.mean(), da1_B.values.mean()
(1.186817150786189, -0.813182849213811)
da1_C = da1 * 2
da1_D = da1 / 2
da1_C.values.mean(), da1_D.values.mean()
(0.37363430157237804, 0.09340857539309451)
Assume that we have two calibration runs and we wan't to find the difference...
da_diff = da1-da2
da_diff.plot(title="Difference");
da_diff = da1/da2
da_diff.plot(title="da1/da2");