From 896b7414b4db2e0799023ec9ebb3d8b659e0112d Mon Sep 17 00:00:00 2001 From: konstntokas Date: Tue, 15 Sep 2026 17:12:33 +0200 Subject: [PATCH 01/13] add coord position parameter --- deep_code/tools/new.py | 1 + deep_code/tools/prr.py | 1 + deep_code/utils/dataset_stac_generator.py | 58 +++++++++++++++++++---- 3 files changed, 50 insertions(+), 10 deletions(-) diff --git a/deep_code/tools/new.py b/deep_code/tools/new.py index 5558501..fcc8ca8 100644 --- a/deep_code/tools/new.py +++ b/deep_code/tools/new.py @@ -86,6 +86,7 @@ def generate_dataset_template(output_path: str | None = None) -> str: "osc_project_title": "[OPTIONAL: display title of the OSC project as it appears in the catalog (e.g. DeepESDL). Defaults to a formatted version of osc_project if omitted]", "access_link_root": "[OPTIONAL: public S3 URL of the Zarr store — defaults to s3://deep-esdl-public]", "collection_title": "[OPTIONAL: title present in the collection and in the STAC browser]", + "coord_position": "[OPTIONAL: Position of the coordinates within each grid cell. 'center' assumes coordinates represent cell centers, 'left' assumes they represent the left/top edge, and 'right' assumes they represent the right/bottom edge.]", "cf_parameter": [ {"name": "[OPTIONAL: CF standard name]", "units": "[unit string]"} ], diff --git a/deep_code/tools/prr.py b/deep_code/tools/prr.py index 6a65035..52194c4 100644 --- a/deep_code/tools/prr.py +++ b/deep_code/tools/prr.py @@ -93,6 +93,7 @@ def generate_prr_collection( thumbnail_media_type=config.get("thumbnail_media_type"), sci_doi=config.get("sci_doi"), sci_citation=config.get("sci_citation"), + coord_position=config.get("coord_position"), ) out_dir = output_dir or config.get("prr_output_dir") or "prr" diff --git a/deep_code/utils/dataset_stac_generator.py b/deep_code/utils/dataset_stac_generator.py index 373029b..fcae271 100644 --- a/deep_code/utils/dataset_stac_generator.py +++ b/deep_code/utils/dataset_stac_generator.py @@ -7,7 +7,7 @@ import logging from dataclasses import dataclass from datetime import datetime, timezone -from typing import Any +from typing import Any, Literal import numpy as np import pandas as pd @@ -92,6 +92,7 @@ def __init__( thumbnail_media_type: str | None = None, sci_doi: str | None = None, sci_citation: str | None = None, + coord_position: Literal["left", "center", "right"] = "center", ): if " " in collection_id: raise ValueError( @@ -128,10 +129,28 @@ def __init__( self.thumbnail_media_type = thumbnail_media_type self.sci_doi = sci_doi self.sci_citation = sci_citation + self.coord_position = coord_position self.logger = logging.getLogger(__name__) - def _get_spatial_extent(self, dataset: xr.Dataset) -> SpatialExtent: - """Extract the spatial extent and return it in EPSG:4326.""" + def _get_spatial_extent( + self, + dataset: xr.Dataset, + coord_position: Literal["left", "center", "right"] = "center", + ) -> SpatialExtent: + """Extract the spatial extent and return it in EPSG:4326. + + Args: + dataset: Input dataset. + coord_position: Position of the coordinates within each grid cell. + ``"center"`` assumes coordinates represent cell centers, + ``"left"`` assumes they represent the left/top edge, and + ``"right"`` assumes they represent the right/bottom edge. + """ + if coord_position not in {"left", "center", "right"}: + raise ValueError( + f"Invalid coord_position: {coord_position!r}. " + "Must be 'left', 'center', or 'right'." + ) if {"lon", "lat"}.issubset(dataset.coords): x_name, y_name = "lon", "lat" @@ -145,10 +164,29 @@ def _get_spatial_extent(self, dataset: xr.Dataset) -> SpatialExtent: "('lon', 'lat'), ('longitude', 'latitude'), or ('x', 'y')." ) - x_min = float(dataset[x_name].min()) - x_max = float(dataset[x_name].max()) - y_min = float(dataset[y_name].min()) - y_max = float(dataset[y_name].max()) + x = dataset[x_name] + y = dataset[y_name] + + x_min = float(x.min()) + x_max = float(x.max()) + y_min = float(y.min()) + y_max = float(y.max()) + + # Calculate the grid resolution from adjacent coordinates. + x_res = float(abs(x.diff(x_name).median())) + y_res = float(abs(y.diff(y_name).median())) + + if coord_position == "center": + x_min -= x_res / 2 + x_max += x_res / 2 + y_min -= y_res / 2 + y_max += y_res / 2 + elif coord_position == "left": + x_max += x_res + y_max += y_res + elif coord_position == "right": + x_min -= x_res + y_min -= y_res crs = self._get_crs(dataset) @@ -623,7 +661,7 @@ def build_zarr_stac_item( f"for collection '{self.collection_id}'." ) dataset = open_dataset(item_config.dataset_id, logger=self.logger) - spatial_extent = self._get_spatial_extent(dataset) + spatial_extent = self._get_spatial_extent(dataset, self.coord_position) temporal_extent = self._get_temporal_extent(dataset) general_metadata = self._get_general_metadata(dataset) @@ -880,7 +918,7 @@ def build_prr_stac_item(self, item_config: ItemConfig) -> Item: f"for collection '{self.collection_id}'." ) dataset = open_dataset(item_config.dataset_id, logger=self.logger) - spatial_extent = self._get_spatial_extent(dataset) + spatial_extent = self._get_spatial_extent(dataset, self.coord_position) temporal_extent = self._get_temporal_extent(dataset) general_metadata = self._get_general_metadata(dataset) @@ -1160,7 +1198,7 @@ def build_dataset_stac_collection( try: assert len(self.items_config) == 1 dataset = open_dataset(self.items_config[0].dataset_id, logger=self.logger) - spatial_extent = self._get_spatial_extent(dataset) + spatial_extent = self._get_spatial_extent(dataset, self.coord_position) temporal_extent = self._get_temporal_extent(dataset) variables = self.get_variable_ids(dataset) general_metadata = self._get_general_metadata(dataset) From bf23ae71daedbf53129d17a764811b23729038b8 Mon Sep 17 00:00:00 2001 From: konstntokas Date: Tue, 15 Sep 2026 17:46:59 +0200 Subject: [PATCH 02/13] change cube:dimension accoringly --- deep_code/utils/dataset_stac_generator.py | 60 ++++++++++++++++++----- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/deep_code/utils/dataset_stac_generator.py b/deep_code/utils/dataset_stac_generator.py index fcae271..8e59cce 100644 --- a/deep_code/utils/dataset_stac_generator.py +++ b/deep_code/utils/dataset_stac_generator.py @@ -62,6 +62,10 @@ class OscDatasetStacGenerator: osc_missions: List of satellite missions associated with the dataset. cf_params: CF metadata parameters for the dataset. osc_project: OSC project identifier (default: "deep-earth-system-data-lab"). + coord_position: Position of the coordinates within each grid cell. + ``"center"`` assumes coordinates represent cell centers, + ``"left"`` assumes they represent the left/top edge, and + ``"right"`` assumes they represent the right/bottom edge. """ def __init__( @@ -831,38 +835,66 @@ def _get_crs(dataset: xr.Dataset) -> pyproj.CRS: pass return pyproj.CRS.from_epsg(4326) - def _get_cube_dimensions(self, dataset: xr.Dataset) -> dict[str, dict]: + def _get_cube_dimensions( + self, + dataset: xr.Dataset, + coord_position: Literal["left", "center", "right"] = "center", + ) -> dict[str, dict]: """Build the ``cube:dimensions`` object from the dataset coordinates. Follows the datacube STAC extension: horizontal spatial dimensions are classified by axis (x/y), the ``time`` coordinate becomes a temporal dimension, and any remaining index coordinate is emitted as an additional dimension. + + Args: + dataset: Dataset from which to extract the cube dimensions. + coord_position: Position of spatial coordinates within each grid cell. + ``"center"`` assumes cell-center coordinates, ``"left"`` assumes + left/bottom edge coordinates, and ``"right"`` assumes + right/top edge coordinates. """ + if coord_position not in {"left", "center", "right"}: + raise ValueError( + f"Invalid coord_position: {coord_position!r}. " + "Must be 'left', 'center', or 'right'." + ) + crs = self._get_crs(dataset) x_names = {"lon", "longitude", "x"} y_names = {"lat", "latitude", "y"} dimensions: dict[str, dict] = {} + for name, coord in dataset.coords.items(): if name not in dataset.dims: # Skip non-dimension coordinates (e.g. scalar or auxiliary coords). continue + name = str(name) lname = name.lower() - if lname in x_names: - dimensions[name] = { - "type": "spatial", - "axis": "x", - "extent": [float(coord.min()), float(coord.max())], - "reference_system": crs.to_epsg(), - } - elif lname in y_names: + + if lname in x_names or lname in y_names: + coord_min = float(coord.min()) + coord_max = float(coord.max()) + resolution = float(abs(coord.diff(name).median())) + + if coord_position == "center": + extent_min = coord_min - resolution / 2 + extent_max = coord_max + resolution / 2 + elif coord_position == "left": + extent_min = coord_min + extent_max = coord_max + resolution + else: # coord_position == "right" + extent_min = coord_min - resolution + extent_max = coord_max + dimensions[name] = { "type": "spatial", - "axis": "y", - "extent": [float(coord.min()), float(coord.max())], + "axis": "x" if lname in x_names else "y", + "extent": [extent_min, extent_max], "reference_system": crs.to_epsg(), } + elif lname == "time": time_min = pd.to_datetime(coord.min().values).to_pydatetime() time_max = pd.to_datetime(coord.max().values).to_pydatetime() @@ -870,6 +902,7 @@ def _get_cube_dimensions(self, dataset: xr.Dataset) -> dict[str, dict]: "type": "temporal", "extent": [time_min.isoformat(), time_max.isoformat()], } + else: try: dimensions[name] = { @@ -881,6 +914,7 @@ def _get_cube_dimensions(self, dataset: xr.Dataset) -> dict[str, dict]: "type": lname, "values": [str(v) for v in coord.values.tolist()], } + return dimensions @staticmethod @@ -956,7 +990,9 @@ def build_prr_stac_item(self, item_config: ItemConfig) -> Item: "description": general_metadata.get("description", ""), "created": now_iso, "updated": now_iso, - "cube:dimensions": self._get_cube_dimensions(dataset), + "cube:dimensions": self._get_cube_dimensions( + dataset, self.coord_position + ), "cube:variables": self._get_cube_variables(dataset), }, ) From 5452869bf155f0ebeb60efcdaae4834c554c5391 Mon Sep 17 00:00:00 2001 From: konstntokas Date: Wed, 16 Sep 2026 09:17:25 +0200 Subject: [PATCH 03/13] adjut coord names for cube extension --- deep_code/utils/dataset_stac_generator.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/deep_code/utils/dataset_stac_generator.py b/deep_code/utils/dataset_stac_generator.py index 8e59cce..7d677e2 100644 --- a/deep_code/utils/dataset_stac_generator.py +++ b/deep_code/utils/dataset_stac_generator.py @@ -850,9 +850,9 @@ def _get_cube_dimensions( Args: dataset: Dataset from which to extract the cube dimensions. coord_position: Position of spatial coordinates within each grid cell. - ``"center"`` assumes cell-center coordinates, ``"left"`` assumes - left/bottom edge coordinates, and ``"right"`` assumes - right/top edge coordinates. + ``"center"`` assumes cell-center coordinates, + ``"left"`` assumes left/bottom edge coordinates, and + ``"right"`` assumes right/top edge coordinates. """ if coord_position not in {"left", "center", "right"}: raise ValueError( @@ -876,21 +876,24 @@ def _get_cube_dimensions( if lname in x_names or lname in y_names: coord_min = float(coord.min()) coord_max = float(coord.max()) - resolution = float(abs(coord.diff(name).median())) if coord_position == "center": + resolution = float(abs(coord[:2].diff(name))) extent_min = coord_min - resolution / 2 + resolution = float(abs(coord[-2:].diff(name))) extent_max = coord_max + resolution / 2 elif coord_position == "left": extent_min = coord_min + resolution = float(abs(coord[-2:].diff(name))) extent_max = coord_max + resolution else: # coord_position == "right" + resolution = float(abs(coord[:2].diff(name))) extent_min = coord_min - resolution extent_max = coord_max dimensions[name] = { "type": "spatial", - "axis": "x" if lname in x_names else "y", + "axis": lname, "extent": [extent_min, extent_max], "reference_system": crs.to_epsg(), } From ab39367b778b99b7bf55521a1ddadaab56ed1787 Mon Sep 17 00:00:00 2001 From: konstntokas Date: Wed, 16 Sep 2026 09:34:50 +0200 Subject: [PATCH 04/13] adjut coord names for cube extension --- deep_code/utils/dataset_stac_generator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deep_code/utils/dataset_stac_generator.py b/deep_code/utils/dataset_stac_generator.py index 7d677e2..606b6c7 100644 --- a/deep_code/utils/dataset_stac_generator.py +++ b/deep_code/utils/dataset_stac_generator.py @@ -878,16 +878,16 @@ def _get_cube_dimensions( coord_max = float(coord.max()) if coord_position == "center": - resolution = float(abs(coord[:2].diff(name))) + resolution = float(abs(coord[:2].diff(name))[0]) extent_min = coord_min - resolution / 2 - resolution = float(abs(coord[-2:].diff(name))) + resolution = float(abs(coord[-2:].diff(name))[0]) extent_max = coord_max + resolution / 2 elif coord_position == "left": extent_min = coord_min - resolution = float(abs(coord[-2:].diff(name))) + resolution = float(abs(coord[-2:].diff(name))[0]) extent_max = coord_max + resolution else: # coord_position == "right" - resolution = float(abs(coord[:2].diff(name))) + resolution = float(abs(coord[:2].diff(name))[0]) extent_min = coord_min - resolution extent_max = coord_max From 7d6d0adb1847839af415351897c429980321d680 Mon Sep 17 00:00:00 2001 From: konstntokas Date: Wed, 16 Sep 2026 09:39:32 +0200 Subject: [PATCH 05/13] adjut coord names for cube extension --- deep_code/utils/dataset_stac_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deep_code/utils/dataset_stac_generator.py b/deep_code/utils/dataset_stac_generator.py index 606b6c7..6090f08 100644 --- a/deep_code/utils/dataset_stac_generator.py +++ b/deep_code/utils/dataset_stac_generator.py @@ -893,7 +893,7 @@ def _get_cube_dimensions( dimensions[name] = { "type": "spatial", - "axis": lname, + "axis": "x" if lname in x_names else "y", "extent": [extent_min, extent_max], "reference_system": crs.to_epsg(), } From e122f675161f03226c13f41c8711c1ab255ce772 Mon Sep 17 00:00:00 2001 From: konstntokas Date: Wed, 16 Sep 2026 09:49:42 +0200 Subject: [PATCH 06/13] fix tests --- .../utils/test_dataset_stac_generator.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/deep_code/tests/utils/test_dataset_stac_generator.py b/deep_code/tests/utils/test_dataset_stac_generator.py index 9b0a2d7..8779bff 100644 --- a/deep_code/tests/utils/test_dataset_stac_generator.py +++ b/deep_code/tests/utils/test_dataset_stac_generator.py @@ -36,8 +36,8 @@ def setUp(self): """Set up a mock dataset and generator.""" self.mock_dataset = Dataset( coords={ - "lon": ("lon", np.linspace(-180, 180, 10)), - "lat": ("lat", np.linspace(-90, 90, 5)), + "lon": ("lon", np.arange(-175, 176, 10)), + "lat": ("lat", np.arange(-87.5, 88, 5)), "time": ( "time", [ @@ -50,7 +50,7 @@ def setUp(self): data_vars={ "var1": ( ("time", "lat", "lon"), - np.random.rand(2, 5, 10), + np.random.rand(2, 36, 36), { "description": "dummy", "standard_name": "var1", @@ -59,7 +59,7 @@ def setUp(self): ), "var2": ( ("time", "lat", "lon"), - np.random.rand(2, 5, 10), + np.random.rand(2, 36, 36), { "description": "dummy", "standard_name": "var2", @@ -751,8 +751,8 @@ def test_spatial_extent_longitude_latitude(self, mock_open_ds): mock_open_ds.return_value = ds gen = self._make_generator(ds) extent = gen._get_spatial_extent(ds) - self.assertAlmostEqual(extent.bboxes[0][0], -10.0) - self.assertAlmostEqual(extent.bboxes[0][1], -5.0) + self.assertAlmostEqual(extent.bboxes[0][0], -15.0) + self.assertAlmostEqual(extent.bboxes[0][1], -10.0) @patch("deep_code.utils.dataset_stac_generator.open_dataset") def test_spatial_extent_x_y(self, mock_open_ds): @@ -760,7 +760,7 @@ def test_spatial_extent_x_y(self, mock_open_ds): mock_open_ds.return_value = ds gen = self._make_generator(ds) extent = gen._get_spatial_extent(ds) - self.assertAlmostEqual(extent.bboxes[0][0], 0.0) + self.assertAlmostEqual(extent.bboxes[0][0], -25.0) @patch("deep_code.utils.dataset_stac_generator.open_dataset") def test_spatial_extent_unknown_coords_raises(self, mock_open_ds): @@ -861,7 +861,7 @@ class TestPRRCollection(unittest.TestCase): def setUp(self): self.dataset = Dataset( coords={ - "lon": ("lon", np.linspace(-20, 20, 4)), + "lon": ("lon", np.linspace(-20, 20, 3)), "lat": ("lat", np.linspace(-10, 10, 3)), "time": ( "time", @@ -874,12 +874,12 @@ def setUp(self): data_vars={ "sst": ( ("time", "lat", "lon"), - np.random.rand(2, 3, 4), + np.random.rand(2, 3, 3), {"units": "K", "long_name": "Sea surface temperature"}, ), "chl": ( ("time", "lat", "lon"), - np.random.rand(2, 3, 4), + np.random.rand(2, 3, 3), {"units": "mg m-3"}, ), # A CRS var that must be excluded from cube:variables and drive EPSG. @@ -944,9 +944,9 @@ def test_get_cube_dimensions(self): self.assertEqual(dims["lon"]["type"], "spatial") self.assertEqual(dims["lon"]["axis"], "x") self.assertEqual(dims["lon"]["reference_system"], 3035) - self.assertEqual(dims["lon"]["extent"], [-20.0, 20.0]) + self.assertEqual(dims["lon"]["extent"], [-30.0, 30.0]) self.assertEqual(dims["lat"]["axis"], "y") - self.assertEqual(dims["lat"]["extent"], [-10.0, 10.0]) + self.assertEqual(dims["lat"]["extent"], [-15.0, 15.0]) self.assertEqual(dims["time"]["type"], "temporal") self.assertEqual(len(dims["time"]["extent"]), 2) From 04765d2b6ce3b331d9289760b6da21fde89d169c Mon Sep 17 00:00:00 2001 From: konstntokas Date: Wed, 16 Sep 2026 10:06:04 +0200 Subject: [PATCH 07/13] added tests for coverage --- .../utils/test_dataset_stac_generator.py | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/deep_code/tests/utils/test_dataset_stac_generator.py b/deep_code/tests/utils/test_dataset_stac_generator.py index 8779bff..ca9f83a 100644 --- a/deep_code/tests/utils/test_dataset_stac_generator.py +++ b/deep_code/tests/utils/test_dataset_stac_generator.py @@ -103,9 +103,19 @@ def test_open_dataset(self): def test_get_spatial_extent(self): """Test spatial extent extraction.""" + + # center extent = self.generator._get_spatial_extent(self.mock_dataset) self.assertEqual(extent.bboxes[0], [-180.0, -90.0, 180.0, 90.0]) + # left + extent = self.generator._get_spatial_extent(self.mock_dataset, "left") + self.assertEqual(extent.bboxes[0], [-175.0, -87.5, 185.0, 92.5]) + + # right + extent = self.generator._get_spatial_extent(self.mock_dataset, "right") + self.assertEqual(extent.bboxes[0], [-185.0, -92.5, 175.0, 87.5]) + def test_get_temporal_extent(self): """Test temporal extent extraction.""" extent = self.generator._get_temporal_extent(self.mock_dataset) @@ -938,7 +948,7 @@ def test_get_epsg_default_4326(self, mock_open_ds): ) self.assertEqual(gen._get_crs(ds).to_epsg(), 4326) - def test_get_cube_dimensions(self): + def test_get_cube_dimensions_center(self): dims = self.gen._get_cube_dimensions(self.dataset) self.assertEqual(set(dims), {"lon", "lat", "time"}) self.assertEqual(dims["lon"]["type"], "spatial") @@ -950,6 +960,30 @@ def test_get_cube_dimensions(self): self.assertEqual(dims["time"]["type"], "temporal") self.assertEqual(len(dims["time"]["extent"]), 2) + def test_get_cube_dimensions_left(self): + dims = self.gen._get_cube_dimensions(self.dataset, "left") + self.assertEqual(set(dims), {"lon", "lat", "time"}) + self.assertEqual(dims["lon"]["type"], "spatial") + self.assertEqual(dims["lon"]["axis"], "x") + self.assertEqual(dims["lon"]["reference_system"], 3035) + self.assertEqual(dims["lon"]["extent"], [-20.0, 40.0]) + self.assertEqual(dims["lat"]["axis"], "y") + self.assertEqual(dims["lat"]["extent"], [-10.0, 20.0]) + self.assertEqual(dims["time"]["type"], "temporal") + self.assertEqual(len(dims["time"]["extent"]), 2) + + def test_get_cube_dimensions_right(self): + dims = self.gen._get_cube_dimensions(self.dataset, "right") + self.assertEqual(set(dims), {"lon", "lat", "time"}) + self.assertEqual(dims["lon"]["type"], "spatial") + self.assertEqual(dims["lon"]["axis"], "x") + self.assertEqual(dims["lon"]["reference_system"], 3035) + self.assertEqual(dims["lon"]["extent"], [-40.0, 20.0]) + self.assertEqual(dims["lat"]["axis"], "y") + self.assertEqual(dims["lat"]["extent"], [-20.0, 10.0]) + self.assertEqual(dims["time"]["type"], "temporal") + self.assertEqual(len(dims["time"]["extent"]), 2) + def test_get_cube_variables(self): variables = self.gen._get_cube_variables(self.dataset) # CRS variable must be excluded. From 47a3fba8759a7f7e02b1b4e6b4a6a8ae2e22c1ee Mon Sep 17 00:00:00 2001 From: Konstantin Ntokas <38956538+konstntokas@users.noreply.github.com> Date: Wed, 16 Sep 2026 13:24:54 +0200 Subject: [PATCH 08/13] Update deep_code/utils/dataset_stac_generator.py Co-authored-by: Tejas Morbagal Harish --- deep_code/utils/dataset_stac_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deep_code/utils/dataset_stac_generator.py b/deep_code/utils/dataset_stac_generator.py index 6090f08..bdf0981 100644 --- a/deep_code/utils/dataset_stac_generator.py +++ b/deep_code/utils/dataset_stac_generator.py @@ -65,7 +65,7 @@ class OscDatasetStacGenerator: coord_position: Position of the coordinates within each grid cell. ``"center"`` assumes coordinates represent cell centers, ``"left"`` assumes they represent the left/top edge, and - ``"right"`` assumes they represent the right/bottom edge. + ``"right"`` assumes they represent the right/top edge. """ def __init__( From 28672ac27ae0adc5317d13f527ea50bc213689ce Mon Sep 17 00:00:00 2001 From: Konstantin Ntokas <38956538+konstntokas@users.noreply.github.com> Date: Wed, 16 Sep 2026 13:25:06 +0200 Subject: [PATCH 09/13] Update deep_code/utils/dataset_stac_generator.py Co-authored-by: Tejas Morbagal Harish --- deep_code/utils/dataset_stac_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deep_code/utils/dataset_stac_generator.py b/deep_code/utils/dataset_stac_generator.py index bdf0981..8be791a 100644 --- a/deep_code/utils/dataset_stac_generator.py +++ b/deep_code/utils/dataset_stac_generator.py @@ -64,7 +64,7 @@ class OscDatasetStacGenerator: osc_project: OSC project identifier (default: "deep-earth-system-data-lab"). coord_position: Position of the coordinates within each grid cell. ``"center"`` assumes coordinates represent cell centers, - ``"left"`` assumes they represent the left/top edge, and + ``"left"`` assumes they represent the left/bottom edge, and ``"right"`` assumes they represent the right/top edge. """ From 47c907f4215d17b51724deddeb5d63ce0ed1bf52 Mon Sep 17 00:00:00 2001 From: Konstantin Ntokas <38956538+konstntokas@users.noreply.github.com> Date: Wed, 16 Sep 2026 13:25:18 +0200 Subject: [PATCH 10/13] Update deep_code/utils/dataset_stac_generator.py Co-authored-by: Tejas Morbagal Harish --- deep_code/utils/dataset_stac_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deep_code/utils/dataset_stac_generator.py b/deep_code/utils/dataset_stac_generator.py index 8be791a..29aa544 100644 --- a/deep_code/utils/dataset_stac_generator.py +++ b/deep_code/utils/dataset_stac_generator.py @@ -148,7 +148,7 @@ def _get_spatial_extent( coord_position: Position of the coordinates within each grid cell. ``"center"`` assumes coordinates represent cell centers, ``"left"`` assumes they represent the left/top edge, and - ``"right"`` assumes they represent the right/bottom edge. + ``"right"`` assumes they represent the right/top edge. """ if coord_position not in {"left", "center", "right"}: raise ValueError( From 878cf001e4ef4a272c7d05c860fe510aefa9be44 Mon Sep 17 00:00:00 2001 From: Konstantin Ntokas <38956538+konstntokas@users.noreply.github.com> Date: Wed, 16 Sep 2026 13:35:25 +0200 Subject: [PATCH 11/13] Update deep_code/tools/prr.py Co-authored-by: Tejas Morbagal Harish --- deep_code/tools/prr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deep_code/tools/prr.py b/deep_code/tools/prr.py index 52194c4..805825e 100644 --- a/deep_code/tools/prr.py +++ b/deep_code/tools/prr.py @@ -93,7 +93,7 @@ def generate_prr_collection( thumbnail_media_type=config.get("thumbnail_media_type"), sci_doi=config.get("sci_doi"), sci_citation=config.get("sci_citation"), - coord_position=config.get("coord_position"), + coord_position=config.get("coord_position") or "center", ) out_dir = output_dir or config.get("prr_output_dir") or "prr" From 3256ab203e4532a225dcf491432742dff88ffc03 Mon Sep 17 00:00:00 2001 From: Konstantin Ntokas <38956538+konstntokas@users.noreply.github.com> Date: Wed, 16 Sep 2026 13:35:53 +0200 Subject: [PATCH 12/13] Update deep_code/tools/new.py Co-authored-by: Tejas Morbagal Harish --- deep_code/tools/new.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deep_code/tools/new.py b/deep_code/tools/new.py index fcc8ca8..7e42a73 100644 --- a/deep_code/tools/new.py +++ b/deep_code/tools/new.py @@ -86,7 +86,7 @@ def generate_dataset_template(output_path: str | None = None) -> str: "osc_project_title": "[OPTIONAL: display title of the OSC project as it appears in the catalog (e.g. DeepESDL). Defaults to a formatted version of osc_project if omitted]", "access_link_root": "[OPTIONAL: public S3 URL of the Zarr store — defaults to s3://deep-esdl-public]", "collection_title": "[OPTIONAL: title present in the collection and in the STAC browser]", - "coord_position": "[OPTIONAL: Position of the coordinates within each grid cell. 'center' assumes coordinates represent cell centers, 'left' assumes they represent the left/top edge, and 'right' assumes they represent the right/bottom edge.]", + "coord_position": "[OPTIONAL: Position of the coordinates within each grid cell. 'center' assumes coordinates represent cell centers, 'left' assumes they represent the left/bottom edge, and 'right' assumes they represent the right/top edge.]", "cf_parameter": [ {"name": "[OPTIONAL: CF standard name]", "units": "[unit string]"} ], From 1a3b755b06c1934a8328c528d8b040db9b179760 Mon Sep 17 00:00:00 2001 From: Konstantin Ntokas <38956538+konstntokas@users.noreply.github.com> Date: Wed, 16 Sep 2026 13:36:05 +0200 Subject: [PATCH 13/13] Update deep_code/utils/dataset_stac_generator.py Co-authored-by: Tejas Morbagal Harish --- deep_code/utils/dataset_stac_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deep_code/utils/dataset_stac_generator.py b/deep_code/utils/dataset_stac_generator.py index 29aa544..a1baa2a 100644 --- a/deep_code/utils/dataset_stac_generator.py +++ b/deep_code/utils/dataset_stac_generator.py @@ -147,7 +147,7 @@ def _get_spatial_extent( dataset: Input dataset. coord_position: Position of the coordinates within each grid cell. ``"center"`` assumes coordinates represent cell centers, - ``"left"`` assumes they represent the left/top edge, and + ``"left"`` assumes they represent the left/bottom edge, and ``"right"`` assumes they represent the right/top edge. """ if coord_position not in {"left", "center", "right"}: