eo-tides 0.7.1.dev4__py3-none-any.whl → 0.7.2.dev1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
eo_tides/validation.py CHANGED
@@ -2,6 +2,7 @@ import datetime
2
2
  import warnings
3
3
  from math import sqrt
4
4
  from numbers import Number
5
+ from pathlib import Path
5
6
 
6
7
  import geopandas as gpd
7
8
  import pandas as pd
@@ -192,8 +193,8 @@ def load_gauge_gesla(
192
193
  correct_mean=False,
193
194
  filter_use_flag=True,
194
195
  site_metadata=True,
195
- data_path="/gdata1/data/sea_level/gesla/",
196
- metadata_path="/gdata1/data/sea_level/GESLA3_ALL 2.csv",
196
+ data_path="GESLA3.0_ALL",
197
+ metadata_path="",
197
198
  ):
198
199
  """
199
200
  Load Global Extreme Sea Level Analysis (GESLA) tide gauge data.
@@ -241,11 +242,13 @@ def load_gauge_gesla(
241
242
  Whether to add tide gauge station metadata as additional columns
242
243
  in the output DataFrame. Defaults to True.
243
244
  data_path : str, optional
244
- Path to the raw GESLA data files. Default is
245
- `/gdata1/data/sea_level/gesla/`.
245
+ Path to the raw GESLA data files ("GESLA-3 DATA", accessible via:
246
+ https://gesla787883612.wordpress.com/downloads/). Defaults to
247
+ "GESLA3.0_ALL".
246
248
  metadata_path : str, optional
247
- Path to the GESLA station metadata file.
248
- Default is `/gdata1/data/sea_level/GESLA3_ALL 2.csv`.
249
+ Path to the GESLA station metadata file ("GESLA-3 CSV META-DATA FILE",
250
+ accessible via: https://gesla787883612.wordpress.com/downloads/).
251
+ Defaults to "GESLA3_ALL 2.csv".
249
252
 
250
253
  Returns
251
254
  -------
@@ -259,6 +262,24 @@ def load_gauge_gesla(
259
262
 
260
263
  ...and additional columns from station metadata.
261
264
  """
265
+ # Expand and validate data and metadata paths
266
+ data_path = Path(data_path).expanduser()
267
+ metadata_path = Path(metadata_path).expanduser()
268
+
269
+ if not data_path.exists():
270
+ raise FileNotFoundError(
271
+ f"GESLA raw data directory not found at: {data_path}\n"
272
+ "Download 'GESLA-3 DATA' from: "
273
+ "https://gesla787883612.wordpress.com/downloads/"
274
+ )
275
+
276
+ if not metadata_path.exists():
277
+ raise FileNotFoundError(
278
+ f"GESLA station metadata file not found at: {metadata_path}\n"
279
+ "Download the 'GESLA-3 CSV META-DATA FILE' from: "
280
+ "https://gesla787883612.wordpress.com/downloads/"
281
+ )
282
+
262
283
  # Load tide gauge metadata
263
284
  metadata_df, metadata_gdf = _load_gauge_metadata(metadata_path)
264
285
 
@@ -301,7 +322,7 @@ def load_gauge_gesla(
301
322
  end_time = _round_date_strings(time[-1], round_type="end")
302
323
 
303
324
  # Identify paths to load and nodata values for each site
304
- metadata_df["file_name"] = data_path + metadata_df["file_name"]
325
+ metadata_df["file_name"] = data_path / metadata_df["file_name"]
305
326
  paths_na = metadata_df.loc[site_code, ["file_name", "null_value"]]
306
327
 
307
328
  # Load and combine into a single dataframe
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eo-tides
3
- Version: 0.7.1.dev4
3
+ Version: 0.7.2.dev1
4
4
  Summary: Tide modelling tools for large-scale satellite earth observation analysis
5
5
  Project-URL: Homepage, https://GeoscienceAustralia.github.io/eo-tides/
6
6
  Project-URL: Repository, https://github.com/GeoscienceAustralia/eo-tides
@@ -3,8 +3,8 @@ eo_tides/eo.py,sha256=TuFt9SSiO9Z2o8Kr1g-wFPzofp0HTcgkfhT83zu03kc,23983
3
3
  eo_tides/model.py,sha256=jRx6HNgTbK0inNqOkVivr52jPMJPWZ85gJeLjY2Vfk8,37697
4
4
  eo_tides/stats.py,sha256=ELQpqIH86442IYgjrGrIK3mi0-pu2ZijFw53arA2FYg,23072
5
5
  eo_tides/utils.py,sha256=T19OuPLHzaUKcovCVGANvmOiRu-L8VuDXSTzmNlA6Bo,26647
6
- eo_tides/validation.py,sha256=KP8WLT5z7KLFjQ9oDla7VJOyLQAK4SVbcz2ySAbsbwI,11882
7
- eo_tides-0.7.1.dev4.dist-info/METADATA,sha256=1FNZVq82hKfz-fiw_AorBsfLwu3xt3Dx6KrTxrj6Xeo,8591
8
- eo_tides-0.7.1.dev4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- eo_tides-0.7.1.dev4.dist-info/licenses/LICENSE,sha256=owxWsXViCL2J6Ks3XYhot7t4Y93nstmXAT95Zf030Cc,11350
10
- eo_tides-0.7.1.dev4.dist-info/RECORD,,
6
+ eo_tides/validation.py,sha256=paTewYzKf5m_HkSZUeBxbDQRz8WPJRtSyHjwo8lFtrc,12685
7
+ eo_tides-0.7.2.dev1.dist-info/METADATA,sha256=vrS24YIni34fHqgfZIhptAAUloCA0KEWMevqRBdscZY,8591
8
+ eo_tides-0.7.2.dev1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ eo_tides-0.7.2.dev1.dist-info/licenses/LICENSE,sha256=owxWsXViCL2J6Ks3XYhot7t4Y93nstmXAT95Zf030Cc,11350
10
+ eo_tides-0.7.2.dev1.dist-info/RECORD,,