Skip to content

Commit

Permalink
Remove changes from kurtosis
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed Nov 3, 2023
1 parent 6491991 commit eae57b5
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions examples/advanced/plot_standardization.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
maxc_arr = np.maximum(np.abs(planc_arr), np.abs(profc_arr))

# Remove large outliers
dh_arr[np.abs(dh_arr) > 7 * xdem.spatialstats.nmad(dh_arr)] = np.nan
dh_arr[np.abs(dh_arr) > 4 * xdem.spatialstats.nmad(dh_arr)] = np.nan

# Define bins for 2D binning
custom_bin_slope = np.unique(
Expand Down Expand Up @@ -97,11 +97,6 @@
z_dh.data[mask_glacier.data] = np.nan
z_dh.data[np.abs(z_dh.data) > 4] = np.nan

from scipy.stats import kurtosis
kbef = kurtosis(dh_arr, nan_policy="omit")
kaft = kurtosis(z_dh.flatten(), nan_policy="omit")
print("Excess kurtosis before standardization: {}".format(kbef))
print("Excess kurtosis after standardization: {}".format(kaft))

# %%
# We perform a scale-correction for the standardization, to ensure that the spread of the data is exactly 1.
Expand Down

0 comments on commit eae57b5

Please sign in to comment.