From 9baeef12ea1629873f5c122ea09418fc25bfebce Mon Sep 17 00:00:00 2001 From: Fariborz Daneshvar Date: Mon, 22 Jan 2024 19:32:34 +0000 Subject: [PATCH 1/2] change datum default to MSL for coops_product_within_region --- searvey/coops.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/searvey/coops.py b/searvey/coops.py index b98f77c..731be27 100644 --- a/searvey/coops.py +++ b/searvey/coops.py @@ -870,7 +870,7 @@ def coops_product_within_region( :param region: polygon or multipolygon denoting region of interest :param start_date: start date of CO-OPS query :param end_date: start date of CO-OPS query - :param datum: tidal datum + :param datum: tidal datum, one of ``STND``, ``MSL``, ``MHHW``, ``MHW``, ``MTL``, ``MLW``, ``MLLW``, ``NAVD`` :param interval: data time interval :param station_status: either ``active`` or ``discontinued`` :return: array of data within the specified region @@ -878,7 +878,7 @@ def coops_product_within_region( >>> from datetime import datetime, timedelta >>> import shapely >>> east_coast = shapely.geometry.box(-85, 25, -65, 45) - >>> coops_product_within_region('water_level', region=east_coast, start_date=datetime(2022, 4, 2, 12), end_date=datetime(2022, 4, 2, 12, 30)) + >>> coops_product_within_region('water_level', region=east_coast, datum='MSL', start_date=datetime(2022, 4, 2, 12), end_date=datetime(2022, 4, 2, 12, 30)) Dimensions: (t: 6, nos_id: 111) Coordinates: @@ -893,6 +893,8 @@ def coops_product_within_region( f (nos_id, t) object '0,0,0,0' '0,0,0,0' ... '1,0,0,0' '1,0,0,0' q (nos_id, t) object 'p' 'p' 'p' 'p' 'p' 'p' ... 'p' 'p' 'p' 'p' 'p' """ + if datum is None: + datum = 'MSL' # change the default from STND to MSL stations = coops_stations_within_region(region=region, station_status=station_status) station_data = [ From cb45875258dc4b4f5453bd9401e1cba45303ab88 Mon Sep 17 00:00:00 2001 From: Fariborz Daneshvar Date: Mon, 22 Jan 2024 22:31:37 +0000 Subject: [PATCH 2/2] format revised coops.py with black --- searvey/coops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searvey/coops.py b/searvey/coops.py index 731be27..8729f6f 100644 --- a/searvey/coops.py +++ b/searvey/coops.py @@ -894,7 +894,7 @@ def coops_product_within_region( q (nos_id, t) object 'p' 'p' 'p' 'p' 'p' 'p' ... 'p' 'p' 'p' 'p' 'p' """ if datum is None: - datum = 'MSL' # change the default from STND to MSL + datum = "MSL" # change the default from STND to MSL stations = coops_stations_within_region(region=region, station_status=station_status) station_data = [