Skip to content

Commit d41e772

Browse files
author
Troupin Charles
committed
function to get aphiaID
1 parent 7046b03 commit d41e772

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/BenthosInterp.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,22 @@ function read_results(resfile::String)
643643
end
644644
end
645645

646+
"""
647+
get_aphiaID(filename)
648+
649+
Return the aphiaID of the species interpolated in the netCDF file
650+
```julia-repl
651+
julia> aphiaID = get_aphiaID("Bathyporeia_density.nc")
652+
julia> 101742
653+
```
654+
"""
655+
function get_aphiaID(filename::String)::Int32
656+
NCDatasets.Dataset(filename) do ds
657+
aphiaID = ds.attrib["Species_aphiaID"]
658+
return aphiaID
659+
end
660+
end
661+
646662
"""
647663
merge_netcdf_file(filelist, mergedfile)
648664

0 commit comments

Comments
 (0)