Oceananigans HDF5 format, manipulate the time axis

Viewed 48

I ran a ocean model using Oceananigans in Julia. And I used JLD2OutputWriter to write the output into jld2 HDF5 file. The results basically consist of several variables 3D evolving over time. To read the file, I did the following:

using Oceananigans

d4 = FieldDataset("./test4_lang.jld2")

d4.fields["u"].times

d4 has the following fields:

julia> d4.fields
Dict{String, FieldTimeSeries} with 5 entries:
  "v"  => 32×32×32×103 FieldTimeSeries{InMemory} located at (Center, Face, Center) on CPU…
  "w"  => 32×32×33×103 FieldTimeSeries{InMemory} located at (Center, Center, Face) on CPU…
  "b"  => 32×32×32×103 FieldTimeSeries{InMemory} located at (Center, Center, Center) on CPU…
  "u"  => 32×32×32×103 FieldTimeSeries{InMemory} located at (Face, Center, Center) on CPU…
  "νₑ" => 32×32×32×103 FieldTimeSeries{InMemory} located at (Center, Center, Center) on CPU…

Now, my question is what shall I do, if I want to change the time axis of this data structure with a complete new time axis array for example: 1, 2, 3, ..... 103, where 103 is the length of the time axis.

0 Answers
Related