Skip to content

Commit

Permalink
use WorldOceanDatabase.extracttar
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Mar 28, 2024
1 parent 4a67f43 commit 5aee3c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
4 changes: 0 additions & 4 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"

[compat]
ZipFile = "0.10"
18 changes: 3 additions & 15 deletions test/test_wod.jl
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@

using ZipFile
using Downloads: download
using PhysOcean: WorldOceanDatabase
using Test

tmpfname = download("https://dox.uliege.be/index.php/s/QBFPUJvOMGOlOvS/download")

tarname = download("https://dox.uliege.be/index.php/s/2QLL1g6DepKc0TT/download")
woddir = tempname()
mkdir(woddir)

zarchive = ZipFile.Reader(tmpfname)
for f in zarchive.files
fullpath = joinpath(woddir,f.name)
if (endswith(f.name,"/") || endswith(f.name,"\\"))
mkdir(fullpath)
else
write(fullpath, read(f))
end
end
close(zarchive)

WorldOceanDatabase.extracttar(tarname,woddir)

obsvalue,obslon,obslat,obsdepth,obstime,obsid = WorldOceanDatabase.load(
Float64,woddir,"Temperature"; prefixid = "1977-")
Expand Down

0 comments on commit 5aee3c7

Please sign in to comment.