Skip to content

Commit 2b38d99

Browse files
authored
Merge pull request #540 from KevinShuman/539-andro-ds
Updating Link to Andro Library #539
2 parents a5be519 + 72e678d commit 2b38d99

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

clouddrift/adapters/andro.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
from clouddrift.adapters.utils import download_with_progress
3030

3131
# order of the URLs is important
32-
ANDRO_URL = "https://www.seanoe.org/data/00360/47077/data/109566.dat"
32+
ANDRO_URL = "https://www.seanoe.org/data/00360/47077/data/116520.dat"
3333
ANDRO_TMP_PATH = os.path.join(tempfile.gettempdir(), "clouddrift", "andro")
34-
ANDRO_VERSION = "2024-03-25"
34+
ANDRO_VERSION = "2025-01"
3535

3636

3737
def to_xarray(tmp_path: str | None = None):

clouddrift/adapters/gdp/gdp1h.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,10 +623,10 @@ def to_raggedarray(
623623
# set dynamic global attributes
624624
if ra.attrs_global:
625625
ra.attrs_global["time_coverage_start"] = (
626-
f"{datetime(1970,1,1) + timedelta(seconds=int(np.min(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
626+
f"{datetime(1970, 1, 1) + timedelta(seconds=int(np.min(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
627627
)
628628
ra.attrs_global["time_coverage_end"] = (
629-
f"{datetime(1970,1,1) + timedelta(seconds=int(np.max(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
629+
f"{datetime(1970, 1, 1) + timedelta(seconds=int(np.max(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
630630
)
631631

632632
return ra

clouddrift/adapters/gdp/gdp6h.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,10 +523,10 @@ def to_raggedarray(
523523

524524
# update dynamic global attributes
525525
ra.attrs_global["time_coverage_start"] = (
526-
f"{datetime.datetime(1970,1,1) + datetime.timedelta(seconds=int(np.min(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
526+
f"{datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=int(np.min(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
527527
)
528528
ra.attrs_global["time_coverage_end"] = (
529-
f"{datetime.datetime(1970,1,1) + datetime.timedelta(seconds=int(np.max(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
529+
f"{datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=int(np.max(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
530530
)
531531

532532
return ra

clouddrift/transfer.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -774,21 +774,21 @@ def kvtilde(
774774

775775
# Prepare zk for vectorized computation
776776
zk = np.tile(z, (nterms, 1)).T
777-
zk[:, 0] = 1
777+
zk[:, 0] = 1.0
778778
zk = np.cumprod(zk, axis=1)
779779

780780
k = np.arange(nterms)
781-
ak = 4 * nu**2 - (2 * k - 1) ** 2
782-
ak[0] = 1
783-
ak = np.cumprod(ak) / (factorial(k) * (8**k))
781+
ak = 4.0 * nu**2 - (2.0 * k - 1.0) ** 2
782+
ak[0] = 1.0
783+
ak = np.cumprod(ak) / (factorial(k) * (8.0**k))
784784

785785
# Handling potential non-finite values in ak
786786
if not np.all(np.isfinite(ak)):
787787
first_nonfinite = np.where(~np.isfinite(ak))[0][0]
788788
ak = ak[:first_nonfinite]
789789
zk = zk[:, :first_nonfinite]
790790

791-
K = sqrt(np.pi / (2 * z)) * (np.dot(1.0 / zk, ak))
791+
K = sqrt(np.pi / (2.0 * z)) * (np.dot(1.0 / zk, ak))
792792
K = K.reshape(sizez)
793793

794794
return K
@@ -811,21 +811,21 @@ def ivtilde(
811811

812812
# Prepare zk for vectorized computation with alternating signs for each term
813813
zk = np.tile(-z, (nterms, 1)).T
814-
zk[:, 0] = 1
814+
zk[:, 0] = 1.0
815815
zk = np.cumprod(zk, axis=1)
816816

817817
k = np.arange(nterms)
818-
ak = 4 * nu**2 - (2 * k - 1) ** 2
819-
ak[0] = 1
820-
ak = np.cumprod(ak) / (factorial(k) * (8**k))
818+
ak = 4.0 * nu**2 - (2.0 * k - 1.0) ** 2
819+
ak[0] = 1.0
820+
ak = np.cumprod(ak) / (factorial(k) * (8.0**k))
821821

822822
# Handling potential non-finite values in ak
823823
if not np.all(np.isfinite(ak)):
824824
first_nonfinite = np.where(~np.isfinite(ak))[0][0]
825825
ak = ak[:first_nonfinite]
826826
zk = zk[:, :first_nonfinite]
827827

828-
I = 1 / sqrt(2 * z * np.pi) * (np.dot(1.0 / zk, ak))
828+
I = 1.0 / sqrt(2.0 * z * np.pi) * (np.dot(1.0 / zk, ak))
829829
I = I.reshape(sizez)
830830

831831
return I

0 commit comments

Comments
 (0)