xarray_werrmul
- PlasmaCalcs.tools.xarray_tools.xarray_werr_stats.xarray_werrmul(A, B, *, require_std=True)
returns dataset of ‘mean’ and ‘std’ for A * B, including error propagation.
Assumes independent errors and applies the “standard” formula:z = A * Bmean(z) = mean(A) * mean(B)std(z) = abs(mean(z)) * sqrt((std(A)/mean(A))**2 + (std(B)/mean(B))**2)A, B: xarray.Dataset or DataArray; B can also be any other value.Dataset –> mean = ds[‘mean’]; std = ds.get(‘std’, default=0).else –> assume it represents ‘mean’, with std=0.require_std: boolwhether to require at least one of A or B to have ‘std’.if True and std missing from both, crash with InputError.