Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.10"
python-version: "3.13"
- name: Ruff
if: success() || failure()
uses: pre-commit/action@v3.0.1
Expand Down
2 changes: 1 addition & 1 deletion docs/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- pandoc
- pip
- polars
- python>=3.10
- python>=3.11
- pyvista
- sphinx-book-theme==1.1.0
- sphinx-gallery
Expand Down
30 changes: 30 additions & 0 deletions gpm/accessor/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,12 @@ def subset_range_where_values(self, variable=None, vmin=-np.inf, vmax=np.inf):

return subset_range_where_values(self._obj, variable=variable, vmin=vmin, vmax=vmax)

@auto_wrap_docstring
def subset_range_by_height(self, vmin=None, vmax=None):
from gpm.utils.manipulations import subset_range_by_height

return subset_range_by_height(self._obj, vmin=vmin, vmax=vmax)

@auto_wrap_docstring
def slice_range_at_height(self, value):
from gpm.utils.manipulations import slice_range_at_height
Expand All @@ -446,6 +452,30 @@ def slice_range_at_min_value(self, variable=None):

return slice_range_at_min_value(self._obj, variable=variable)

@auto_wrap_docstring
def slice_range_at_top(self, variable=None):
from gpm.utils.manipulations import slice_range_at_top

return slice_range_at_top(self._obj, variable=variable)

@auto_wrap_docstring
def slice_range_at_near_surface(self, variable=None):
from gpm.utils.manipulations import slice_range_at_near_surface

return slice_range_at_near_surface(self._obj, variable=variable)

@auto_wrap_docstring
def bin_near_surface(self, variable=None):
from gpm.utils.manipulations import get_bin_near_surface

return get_bin_near_surface(self._obj, variable=variable)

@auto_wrap_docstring
def bin_top(self, variable=None):
from gpm.utils.manipulations import get_bin_top

return get_bin_top(self._obj, variable=variable)

#### Masking utility
@auto_wrap_docstring
def mask_between_bins(self, bottom_bins, top_bins, strict=True, fillvalue=np.nan):
Expand Down
7 changes: 7 additions & 0 deletions gpm/dataset/decoding/decode_2a_radar.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ def decode_flagGraupelHail(da):
return da


def decode_precipWater(da):
"""Decode the 2A-<RADAR> variable precipWater."""
da.attrs["units"] = "g/m^3"
return da


def decode_widthBB(da):
"""Decode the 2A-<RADAR> variable widthBB."""
return da.where(da >= 0) # -1111.1 is set to np.nan
Expand Down Expand Up @@ -295,6 +301,7 @@ def decode_product(ds):
"snowIceCover",
"attenuationNP",
"zFactorMeasured",
"precipWater",
]
# Decode such variables if present in the xarray object
for variable in variables:
Expand Down
25 changes: 0 additions & 25 deletions gpm/etc/colorbars/2A_DPR_colorbars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,6 @@ VILD:
extend: both
extendfrac: 0.05
label: VIL Density [$g \ m^{-3}$]
Dm:
cmap:
name: plasma
bad_alpha: 0.5
bad_color: gray
norm:
name: Norm
vmin: 0.5
vmax: 3
cbar:
extend: both
extendfrac: 0.05
label: $D_m$ [$mm$]
LogNw:
cmap:
name: plasma
Expand All @@ -261,18 +248,6 @@ dBNw:
extend: both
extendfrac: 0.05
label: $N_w$ [10$\log{(mm^{-1} \ m^{-3})}$]
Nw:
cmap:
name: plasma
bad_alpha: 0.5
bad_color: gray
norm:
name: LogNorm
vmin: 1
cbar:
extend: max
extendfrac: 0.05
label: $N_w$ [$mm^{-1} \ m^{-3}$]
flagPrecipitationType:
cmap:
name: tab20c
Expand Down
31 changes: 31 additions & 0 deletions gpm/etc/colorbars/default_colorbars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,37 @@ precipitation_rate:
label: Precipitation intensity [$mm \ hr^{-1}$]
auxiliary:
category: [pysteps, precipitation]
rainfall_rate:
cmap:
name: STEPS-MCH
over_color: darkred
under_color: none
norm:
name: BoundaryNorm
boundaries:
- 0.01
- 0.16
- 0.25
- 0.4
- 0.63
- 1
- 1.6
- 2.5
- 4
- 6.3
- 10
- 16
- 25
- 40
- 63
- 100
- 160
cbar:
extend: max
extendrect: false
label: Rainfall intensity [$mm \ hr^{-1}$]
auxiliary:
category: [pysteps, rainfall]
reflectivity_pysteps:
cmap:
name: STEPS-MCH
Expand Down
141 changes: 141 additions & 0 deletions gpm/etc/colorbars/disdrodb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
---
Nw:
cmap:
name: dusk
norm:
name: LogNorm
vmin: 100
vmax: 100000
cbar:
extend: both
extendfrac: 0.05
label: $N_w$ [$mm^{-1} \ m^{-3}$]
auxiliary:
category: [disdrodb, dsd]
R:
reference: rainfall_rate
Rm:
reference: rainfall_rate
Dm:
cmap:
name: plasma
norm:
name: Norm
vmin: 0.5
vmax: 3
cbar:
extend: both
extendfrac: 0.05
label: $D_m$ [$mm$]
auxiliary:
category: [disdrodb, dsd]
D50:
cmap:
name: plasma
norm:
name: Norm
vmin: 0.5
vmax: 3
cbar:
extend: both
extendfrac: 0.05
label: $D_{50}$ [$mm$]
auxiliary:
category: [disdrodb, dsd]
LWC:
cmap:
name: YlGnBu
norm:
name: LogNorm
vmin: 0.01
cbar:
extend: max
extendfrac: 0.05
label: $LWC$ [$g \ m^{-3}$]
auxiliary:
category: [disdrodb, dsd]
Nt:
cmap:
name: cividis
norm:
name: LogNorm
vmin: 10
cbar:
extend: both
extendfrac: 0.05
label: $N_t$ [$m^{-3}$]
auxiliary:
category: [disdrodb, dsd]
sigma_m:
cmap:
name: cividis
norm:
name: Norm
vmin: 0.2
vmax: 2
cbar:
extend: both
extendfrac: 0.05
label: $\sigma_m$ [$mm$]
auxiliary:
category: [disdrodb, dsd]
M2:
cmap:
name: magma
norm:
name: LogNorm
vmin: 0.01
cbar:
extend: max
extendfrac: 0.05
label: $M_2$ [$m^{-3} \ mm^2$]
auxiliary:
category: [disdrodb, dsd, moment]
M3:
cmap:
name: magma
norm:
name: LogNorm
vmin: 0.01
cbar:
extend: max
extendfrac: 0.05
label: $M_3$ [$m^{-3} \ mm^3$]
auxiliary:
category: [disdrodb, dsd, moment]
M4:
cmap:
name: magma
norm:
name: LogNorm
vmin: 0.01
cbar:
extend: max
extendfrac: 0.05
label: $M_4$ [$m^{-3} \ mm^4$]
auxiliary:
category: [disdrodb, dsd, moment]
M5:
cmap:
name: magma
norm:
name: LogNorm
vmin: 0.01
cbar:
extend: max
extendfrac: 0.05
label: $M_5$ [$m^{-3} \ mm^5$]
auxiliary:
category: [disdrodb, dsd, moment]
M6:
cmap:
name: magma
norm:
name: LogNorm
vmin: 0.01
cbar:
extend: max
extendfrac: 0.05
label: $M_6$ [$m^{-3} \ mm^6$]
auxiliary:
category: [disdrodb, dsd, moment]
Loading
Loading