climart/utils/plotting.py
def height_errors(Ytrue: np.ndarray, preds: np.ndarray, height_ticks=None,
                  xlabel='', ylabel='height', fill_between=True, show=True):
    """
    Plot MAE and MBE as a function of the height/pressure
    :param Ytrue:
    :param preds:
    :param height_ticks: must have same shape as Ytrue.shape[1]
    :param show:
    :return:
    """
    n_samples, n_levels = Ytrue.shape
    diff = Ytrue - preds
    abs_diff = np.abs(diff)
    levelwise_MBE = np.mean(diff, axis=0)
    levelwise_MAE = np.mean(abs_diff, axis=0)

    levelwise_MBE_std = np.std(diff, axis=0)
    levelwise_MAE_std = np.std(abs_diff, axis=0)

    # Plotting
    plotting_kwargs = {'yticks': height_ticks, 'ylabel': ylabel, 'show': show, "fill_between": fill_between}
    yaxis = np.arange(n_levels)
    figMBE = height_plot(yaxis, levelwise_MBE, levelwise_MBE_std, xlabel=xlabel + ' MBE', **plotting_kwargs)
    figMAE = height_plot(yaxis, levelwise_MAE, levelwise_MAE_std, xlabel=xlabel + ' MAE', **plotting_kwargs)

    if show:
        plt.show()
    return figMAE, figMBE

    Plot MAE and MBE as a function of the height/pressure
    :param Ytrue:
    :param preds:
    :param height_ticks: must have same shape as Ytrue.shape[1]
    :param show:
    :return:
    
Plot MAE and MBE as a function of the height/pressure
Plot MAE and MBE as a function of the height / pressure
def height_errors(Ytrue: np.ndarray, preds: np.ndarray, height_ticks=None,
                  xlabel='', ylabel='height', fill_between=True, show=True):
    n_samples, n_levels = Ytrue.shape
    diff = Ytrue - preds
    abs_diff = np.abs(diff)
    levelwise_MBE = np.mean(diff, axis=0)
    levelwise_MAE = np.mean(abs_diff, axis=0)
    levelwise_MBE_std = np.std(diff, axis=0)
    levelwise_MAE_std = np.std(abs_diff, axis=0)
    plotting_kwargs = {'yticks': height_ticks, 'ylabel': ylabel, 'show': show, "fill_between": fill_between}
    yaxis = np.arange(n_levels)
    figMBE = height_plot(yaxis, levelwise_MBE, levelwise_MBE_std, xlabel=xlabel + ' MBE', **plotting_kwargs)
    figMAE = height_plot(yaxis, levelwise_MAE, levelwise_MAE_std, xlabel=xlabel + ' MAE', **plotting_kwargs)
    if show:
        plt.show()
    return figMAE, figMBE
def height_errors ( Ytrue : np . ndarray , preds : np . ndarray , height_ticks = None , xlabel = '' , ylabel = 'height' , fill_between = True , show = True ) : n_samples , n_levels = Ytrue . shape diff = Ytrue - preds abs_diff = np . abs ( diff ) levelwise_MBE = np . mean ( diff , axis = 0 ) levelwise_MAE = np . mean ( abs_diff , axis = 0 ) levelwise_MBE_std = np . std ( diff , axis = 0 ) levelwise_MAE_std = np . std ( abs_diff , axis = 0 ) plotting_kwargs = { 'yticks' : height_ticks , 'ylabel' : ylabel , 'show' : show , "fill_between" : fill_between } yaxis = np . arange ( n_levels ) figMBE = height_plot ( yaxis , levelwise_MBE , levelwise_MBE_std , xlabel = xlabel + ' MBE' , ** plotting_kwargs ) figMAE = height_plot ( yaxis , levelwise_MAE , levelwise_MAE_std , xlabel = xlabel + ' MAE' , ** plotting_kwargs ) if show : plt . show ( ) return figMAE , figMBE
Plot MAE and MBE as a function of the height/pressure
Plot MAE and MBE as a function of the height / pressure
"""
    Plot MAE and MBE as a function of the height/pressure
    :param Ytrue:
    :param preds:
    :param height_ticks: must have same shape as Ytrue.shape[1]
    :param show:
    :return:
    """ # Plotting
None
Ytrue
np.ndarray
None
preds
np.ndarray
None
height_ticks
must have same shape as Ytrue.shape[1]
must have same shape as Ytrue . shape [ 1 ]
xlabel
ylabel
fill_between
show
None