From ee2a21928b07d9343bba13f76fad616be78686bf Mon Sep 17 00:00:00 2001 From: manishvenu Date: Tue, 2 Jun 2026 11:38:49 -0600 Subject: [PATCH 1/4] GLORYS change --- CrocoDash/raw_data_access/datasets/glorys.py | 30 ++------------------ CrocoDash/visualCaseGen | 2 +- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/CrocoDash/raw_data_access/datasets/glorys.py b/CrocoDash/raw_data_access/datasets/glorys.py index 719693ee..4fa9eb9d 100644 --- a/CrocoDash/raw_data_access/datasets/glorys.py +++ b/CrocoDash/raw_data_access/datasets/glorys.py @@ -12,7 +12,7 @@ import pandas as pd from .utils import convert_lons_to_180_range from CrocoDash.raw_data_access.base import * - +from mom6_forge._source_bathy import longitude_slicer class GLORYS(ForcingProduct): product_name = "glorys" @@ -75,9 +75,6 @@ def get_glorys_data_from_rda( ds_in_files = [] date_strings = [date.strftime("%Y%m%d") for date in dates] - # Adjust lat lon inputs to make sure they are in the correct range of -180 to 180 - lon_min, lon_max = convert_lons_to_180_range(lon_min, lon_max) - for date in date_strings: pattern = os.path.join(ds_in_path, "**", f"*_{date}_*.nc") ds_in_files.extend(glob.glob(pattern, recursive=True)) @@ -87,30 +84,9 @@ def get_glorys_data_from_rda( ds_in_files, decode_times=False, engine="h5netcdf", parallel=True )[variables] - if lon_min * lon_max > 0: - dataset = ds.sel( - latitude=slice(lat_min - 1, lat_max + 1), - longitude=slice(lon_min - 1, lon_max + 1), - ) - else: - dataset = xr.concat( - [ - ds.sel( - latitude=slice(lat_min - 1, lat_max + 1), - **{"longitude": slice(lon_min - 1, 360)}, - ), - ds.sel( - latitude=slice(lat_min - 1, lat_max + 1), - **{"longitude": slice(-180, lon_max + 1)}, - ), - ], - dim="longitude", - ) - - # convert longitude from degree west to degree east - dataset["longitude"] = (360 - dataset["longitude"]) % 360 - dataset = dataset.sortby("longitude") + buf = 1.0 # buffer in degrees to ensure we have enough data for interpolation at the boundaries + dataset = longitude_slicer(ds,[lon_min-buf, lon_max+buf], longitude_coords = "longitude") dataset.to_netcdf(path) return path diff --git a/CrocoDash/visualCaseGen b/CrocoDash/visualCaseGen index e71f479a..1d149132 160000 --- a/CrocoDash/visualCaseGen +++ b/CrocoDash/visualCaseGen @@ -1 +1 @@ -Subproject commit e71f479a9827bdf5c94c458c46f5928251085aeb +Subproject commit 1d14913270a75368c7f65415101e6dbbd4802f29 From f3cf5a9a45700de611e499d82fb51bd7026e91f9 Mon Sep 17 00:00:00 2001 From: manishvenu Date: Tue, 2 Jun 2026 11:42:11 -0600 Subject: [PATCH 2/4] This --- CrocoDash/visualCaseGen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CrocoDash/visualCaseGen b/CrocoDash/visualCaseGen index 1d149132..0ac0cac3 160000 --- a/CrocoDash/visualCaseGen +++ b/CrocoDash/visualCaseGen @@ -1 +1 @@ -Subproject commit 1d14913270a75368c7f65415101e6dbbd4802f29 +Subproject commit 0ac0cac38bd4e29a7f7e77dac18f034d2f4aa5bf From 54494d75f41309ff1b373dde15be7d85b38224a9 Mon Sep 17 00:00:00 2001 From: manishvenu Date: Tue, 2 Jun 2026 11:56:46 -0600 Subject: [PATCH 3/4] Real Import --- CrocoDash/raw_data_access/datasets/glorys.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CrocoDash/raw_data_access/datasets/glorys.py b/CrocoDash/raw_data_access/datasets/glorys.py index 4fa9eb9d..58a9ed65 100644 --- a/CrocoDash/raw_data_access/datasets/glorys.py +++ b/CrocoDash/raw_data_access/datasets/glorys.py @@ -12,7 +12,7 @@ import pandas as pd from .utils import convert_lons_to_180_range from CrocoDash.raw_data_access.base import * -from mom6_forge._source_bathy import longitude_slicer +from mom6_forge.utils import longitude_slicer class GLORYS(ForcingProduct): product_name = "glorys" From a06310bd669e222b8dc7ea103f59478288ad4464 Mon Sep 17 00:00:00 2001 From: manishvenu Date: Tue, 2 Jun 2026 12:01:15 -0600 Subject: [PATCH 4/4] Black --- CrocoDash/raw_data_access/datasets/glorys.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CrocoDash/raw_data_access/datasets/glorys.py b/CrocoDash/raw_data_access/datasets/glorys.py index 58a9ed65..ace5ed10 100644 --- a/CrocoDash/raw_data_access/datasets/glorys.py +++ b/CrocoDash/raw_data_access/datasets/glorys.py @@ -14,6 +14,7 @@ from CrocoDash.raw_data_access.base import * from mom6_forge.utils import longitude_slicer + class GLORYS(ForcingProduct): product_name = "glorys" description = "GLORYS (Global Ocean Physics Reanalysis) is a public dataset provided through the copernicus marine service." @@ -86,7 +87,9 @@ def get_glorys_data_from_rda( buf = 1.0 # buffer in degrees to ensure we have enough data for interpolation at the boundaries - dataset = longitude_slicer(ds,[lon_min-buf, lon_max+buf], longitude_coords = "longitude") + dataset = longitude_slicer( + ds, [lon_min - buf, lon_max + buf], longitude_coords="longitude" + ) dataset.to_netcdf(path) return path