From 30445d593a09d6e8f818257e9bd72d217028b551 Mon Sep 17 00:00:00 2001 From: Weite Dai Date: Wed, 27 May 2026 11:56:38 +1000 Subject: [PATCH 1/2] feat(oceancurrent): add swotGsla-ssh for image indexing --- ARGO/oceancurrent/oceancurrent_file_server_api.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ARGO/oceancurrent/oceancurrent_file_server_api.py b/ARGO/oceancurrent/oceancurrent_file_server_api.py index 0aa300d0..a4798a40 100644 --- a/ARGO/oceancurrent/oceancurrent_file_server_api.py +++ b/ARGO/oceancurrent/oceancurrent_file_server_api.py @@ -503,6 +503,18 @@ def _load_api_endpoint(): "region_layer": 3, "max_layer": 3, "save_in_product_folder": True + }, + { + "productId": "swotGsla-ssh", + "include": [ + {"path": "DR_SWOT", "layer": 1}, + {"path": "^SSH$", "layer": 2}, + {"path": "^(AlbEsp|Bass|Brisbane2|CGBR|CLeeu|GoC|Indo|JBGulf|Kimberley|LordHoweS|NGBR|NWS|Ningaloo|Perth|RechEyre|Rowley|SAgulfs|SGBR|SNSW|Tas|Au)$", "layer": 3} + ], + "filetype": ".gif", + "region_layer": 3, + "max_layer": 3, + "save_in_product_folder": True } ] From 173193fd8ad1e57e7a6794e43cecfdb1ec493c7f Mon Sep 17 00:00:00 2001 From: Weite Dai Date: Wed, 27 May 2026 14:41:18 +1000 Subject: [PATCH 2/2] test(oceancurrent): add swotGsla-ssh test cases --- .../oceancurrent_file_server_api.py | 3 +- .../test_oceancurrent_file_server_api.py | 29 +++++++++++++++++++ .../website/DR_SWOT/SSH/Au/20260426223317.gif | 0 .../DR_SWOT/SSH/Tas/20260424190628.gif | 0 .../DR_SWOT/SSH/archive/20260101000000.gif | 0 5 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 ARGO/oceancurrent/tests/mnt/oceancurrent/website/DR_SWOT/SSH/Au/20260426223317.gif create mode 100644 ARGO/oceancurrent/tests/mnt/oceancurrent/website/DR_SWOT/SSH/Tas/20260424190628.gif create mode 100644 ARGO/oceancurrent/tests/mnt/oceancurrent/website/DR_SWOT/SSH/archive/20260101000000.gif diff --git a/ARGO/oceancurrent/oceancurrent_file_server_api.py b/ARGO/oceancurrent/oceancurrent_file_server_api.py index a4798a40..47d1006b 100644 --- a/ARGO/oceancurrent/oceancurrent_file_server_api.py +++ b/ARGO/oceancurrent/oceancurrent_file_server_api.py @@ -513,8 +513,7 @@ def _load_api_endpoint(): ], "filetype": ".gif", "region_layer": 3, - "max_layer": 3, - "save_in_product_folder": True + "max_layer": 3 } ] diff --git a/ARGO/oceancurrent/test_oceancurrent_file_server_api.py b/ARGO/oceancurrent/test_oceancurrent_file_server_api.py index 80b31b40..82b61aa2 100644 --- a/ARGO/oceancurrent/test_oceancurrent_file_server_api.py +++ b/ARGO/oceancurrent/test_oceancurrent_file_server_api.py @@ -401,6 +401,30 @@ def prepare_test_cases(self): ] } ], + "swotGsla-ssh": [ + { + "path": "/DR_SWOT/SSH/Au", + "productId": "swotGsla-ssh", + "region": "Au", + "depth": None, + "files": [ + { + "name": "20260426223317.gif" + } + ] + }, + { + "path": "/DR_SWOT/SSH/Tas", + "productId": "swotGsla-ssh", + "region": "Tas", + "depth": None, + "files": [ + { + "name": "20260424190628.gif" + } + ] + } + ], } def load_and_normalize_json(self, file_path): @@ -493,6 +517,11 @@ def test_file_structure_explorer(self): self.verify_json("tidalCurrents-sl", "tides", "tidalCurrents-sl") self.verify_json("tidalCurrents-monthplots", "tides", "tidalCurrents-monthplots") self.verify_json("EACMooringArray", "EAC_array_figures", "EACMooringArray") + self.verify_json("swotGsla-ssh", "DR_SWOT/SSH", "SSH") + # Verify unrelated directories under DR_SWOT/SSH are excluded by the region whitelist + swot_json_path = os.path.join(self.file_test_dir, "DR_SWOT", "SSH", "SSH.json") + swot_regions = {item["region"] for item in self.load_and_normalize_json(swot_json_path)} + self.assertNotIn("archive", swot_regions, "Unrelated directory 'archive' should not be indexed") # Verify no JSON file required if no gif files listed not_existed_path = os.path.join(self.file_test_dir, "timeseries", "currentMetersCalendar-48.json") self.assertFalse(os.path.exists(not_existed_path)) diff --git a/ARGO/oceancurrent/tests/mnt/oceancurrent/website/DR_SWOT/SSH/Au/20260426223317.gif b/ARGO/oceancurrent/tests/mnt/oceancurrent/website/DR_SWOT/SSH/Au/20260426223317.gif new file mode 100644 index 00000000..e69de29b diff --git a/ARGO/oceancurrent/tests/mnt/oceancurrent/website/DR_SWOT/SSH/Tas/20260424190628.gif b/ARGO/oceancurrent/tests/mnt/oceancurrent/website/DR_SWOT/SSH/Tas/20260424190628.gif new file mode 100644 index 00000000..e69de29b diff --git a/ARGO/oceancurrent/tests/mnt/oceancurrent/website/DR_SWOT/SSH/archive/20260101000000.gif b/ARGO/oceancurrent/tests/mnt/oceancurrent/website/DR_SWOT/SSH/archive/20260101000000.gif new file mode 100644 index 00000000..e69de29b