Skip to content

Commit

Permalink
improve nc_date for fs
Browse files Browse the repository at this point in the history
  • Loading branch information
kongdd committed Oct 10, 2024
1 parent 177be69 commit 5417387
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/nc_date.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
nc_date(ds::NCdata) = ds["time"][:]

function nc_date(file::NCfiles; period=nothing)
function nc_date(file::AbstractString; period=nothing)
nc_open(file) do ds
dates = nc_date(ds)
period === nothing && return dates
Expand All @@ -10,6 +10,10 @@ function nc_date(file::NCfiles; period=nothing)
end
end

function nc_date(fs::Vector{<:AbstractString}; period=nothing)
map(f -> nc_date(f; period), fs) |> x -> vcat(x...)
end

function nc_calendar(file::AbstractString)
nc_open(file) do ds
# typeof(ds["time"][1])
Expand Down

0 comments on commit 5417387

Please sign in to comment.