mesmer.utils.select.extract_land

Contents

mesmer.utils.select.extract_land#

mesmer.utils.select.extract_land(var, reg_dict=None, wgt=None, ls=None, threshold_land=0.25)#

Extract all land grid points and area weights in regions and in land-sea mask for given threshold.

Parameters:
  • var (dict) – nested variable dictionary with keys

    • [esm][scen] (4d array (run, time, lat, lon) of variable)

  • reg_dict (dict | None) – Deprecated. No longer has an effect.

  • wgt (np.ndarray) – 2d array (lat, lon) of weights to be used for area weighted means

  • ls (dict) – land sea dictionary with keys

    • [“grid_raw”] (2d array (lat, lon) of subsampled land fraction)

    • [“grid_no_ANT”] (grid_raw with Antarctica removed)

  • threshold_land (float, default=0.25) – threshold above which land fraction to consider a grid point as a land grid point

Returns:

  • var_l (dict) – nested variable at land grid points dictionary with keys

    • [esm] (3d array (run, time, gp_l) of variable at land grid points)

  • reg_dict (dict) – Deprecated (empty dict).

  • ls (dict) – land sea dictionary with added keys

    • [“gp_l”] (1d array of fraction of land at land grid points)

    • [“grid_l”] (2d array (lat, lon) of fraction of land at land grid points)

    • [“idx_grid_l”] (2d boolean array (lat, lon) with land grid points = True for plotting on map)

    • [“grid_l_m”] (2d masked array (lat, lon) with ocean masked out for plotting on map)

    • [“wgt_gp_l”] (1d array of land area weights, i.e., area weight * land fraction)