Skip to content

Commit

Permalink
Add docstring and option to set nodata to None
Browse files Browse the repository at this point in the history
  • Loading branch information
rubencalje committed Jul 25, 2024
1 parent 5da6118 commit e8e5f1d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nlmod/read/regis.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def get_regis(
possibilities of gaps between layers. The default is True.
probabilities : bool, optional
if True, also download probability data. The default is False.
nodata : int or float, optional
When nodata is not None, set values equal to nodata to nan. The default is
-9999.
Returns
-------
Expand Down Expand Up @@ -167,8 +170,9 @@ def get_regis(

# since version REGIS v02r2s2 (22.07.2024) NaN values are replaced by -9999
# we set these values to NaN again
for var in variables:
ds[var] = ds[var].where(ds[var] != nodata)
if nodata is not None:
for var in variables:
ds[var] = ds[var].where(ds[var] != nodata)

if remove_nan_layers:
# only keep layers with at least one active cell
Expand Down

0 comments on commit e8e5f1d

Please sign in to comment.