diff --git a/Project.toml b/Project.toml index d6f128e..1a58b9e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "OceanRobots" uuid = "0b51df41-3294-4961-8d23-db645e32016d" authors = ["gaelforget "] -version = "0.2.13" +version = "0.2.14" [deps] ArgoData = "9eb831cf-c491-48dc-bed4-6aca718df73c" diff --git a/ext/OceanRobotsMakieExt.jl b/ext/OceanRobotsMakieExt.jl index 8d260a1..1689c8f 100644 --- a/ext/OceanRobotsMakieExt.jl +++ b/ext/OceanRobotsMakieExt.jl @@ -218,7 +218,7 @@ note : the list of valid `expocode` values (e.g., "33RR20160208") can be found a ``` using OceanRobots, CairoMakie -cruise=ShipCruise("33RR20160208") +cruise=read(ShipCruise(),"33RR20160208") plot(cruise) ``` diff --git a/src/files_XBT.jl b/src/files_XBT.jl index 4b35fa9..c2a0deb 100644 --- a/src/files_XBT.jl +++ b/src/files_XBT.jl @@ -356,6 +356,13 @@ end ### +""" + scan_XBT_AOML(ii=0,jj=0; path="XBT_AOML") + +- if `ii==0` then list all sections +- if only `ii` is specified, then list of files for section `ii` +- if `ii` & `jj` are specified, then list files in cruise `jj` of section `ii` +""" function scan_XBT_AOML(ii=0,jj=0; path="XBT_AOML") list1=glob("*.csv",path) if ii==0 @@ -396,7 +403,7 @@ XBT.read_XBT_AOML(1,1) ``` """ function read_XBT_AOML(ii=1,jj=1; path="XBT_AOML") - list=scan_XBT_AOML(ii,jj) + list=scan_XBT_AOML(ii,jj,path=path) read_XBT_AOML(list; path=path) end @@ -411,17 +418,17 @@ function read_XBT_AOML(list4::AbstractDataFrame; path="XBT_AOML") end function valid_XBT_AOML(;path="XBT_AOML") - list1=scan_XBT_AOML() + list1=scan_XBT_AOML(path=path) df=DataFrame() for ii in 1:length(list1) - list2=scan_XBT_AOML(ii) + list2=scan_XBT_AOML(ii,path=path) for jj in 1:length(list2) - list4=scan_XBT_AOML(ii,jj) + list4=scan_XBT_AOML(ii,jj,path=path) transect=list4[1,:transect] cruise=list4[1,:cruise] subfolder=transect*"_"*string(cruise) test=try - read_XBT_AOML(ii,jj) + read_XBT_AOML(ii,jj,path=path) true catch false diff --git a/test/runtests.jl b/test/runtests.jl index 9448d19..a6f84bf 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -142,4 +142,8 @@ using Test XBT.download_all_AOML(path=path0,quick_test=true) @test isfile(joinpath(path0,"list_AX01.csv")) + df0=XBT.valid_XBT_AOML(path=path0) + xbt=XBT.read_XBT_AOML(df0.subfolder[1],path=path0) + @test isa(xbt,XBTtransect) + end