Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Land sea mask generation #1006

Merged
merged 11 commits into from
Dec 18, 2023
Prev Previous commit
Next Next commit
pre-commit fix
  • Loading branch information
lee1043 committed Dec 16, 2023
commit ac74c96c4f5ed1a40f3a9d29406a00a12b6d2614
3 changes: 1 addition & 2 deletions pcmdi_metrics/mean_climate/mean_climate_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
load_and_regrid,
mean_climate_metrics_to_json,
)
from pcmdi_metrics.utils import create_land_sea_mask, create_target_grid
from pcmdi_metrics.variability_mode.lib import sort_human, tree
from pcmdi_metrics.utils import create_land_sea_mask
from pcmdi_metrics.utils import create_target_grid

parser = create_mean_climate_parser()
parameter = parser.get_parameter(argparse_vals_only=False)
Expand Down
2 changes: 1 addition & 1 deletion pcmdi_metrics/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .create_land_sea_mask import create_land_sea_mask
from .create_target_grid import create_target_grid
from .create_target_grid import create_target_grid
7 changes: 4 additions & 3 deletions pcmdi_metrics/utils/create_target_grid.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import xcdat as xc
import xarray as xr
import xcdat as xc


def create_target_grid(target_grid_resolution: str) -> xr.Dataset:
"""Generate a global uniform grid for given resolution
Expand All @@ -22,8 +23,8 @@ def create_target_grid(target_grid_resolution: str) -> xr.Dataset:
start_lon = 0.0 + lon_res / 2
end_lat = 90.0 - lat_res / 2
end_lon = 360.0 - lon_res / 2

t_grid = xc.create_uniform_grid(
start_lat, end_lat, lat_res, start_lon, end_lon, lon_res
)
return t_grid
return t_grid