-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FieldTimeSeries
support for NetCDF
#3935
Comments
For a very first PR, it is only necessary to figure out how to reconstruct the I would focus completely on one backend --- probably |
Small PRs are always better because they lead to better design and easier review. |
Maybe a good starting point would be to add enough functionality so that a
Definitely agree! I might instead say that a PR should have one clear purpose. Perhaps the narrower the better. I suppose even narrowly-scoped PRs can grow quite large though. |
That works! But don't reinvent the wheel or implement something too specific. I would start by looking at the existing functionality for reconstructing grids eg Oceananigans.jl/src/Grids/rectilinear_grid.jl Lines 374 to 394 in 82ad840
I think you have to save the topology and location as strings. Does NetCDF support tuples? |
You could have function reconstruct_grid(filename)
args, kwargs = constructor_arguments(filename)
GridType = get_grid_type(filename)
arch = args[:architecture]
FT = args[:number_type]
return GridType(arch, FT; kwargs...)
end I think that will work for lat lon and rectilinear? For |
This is cleaner / nicer than saving all the metrics down and loading them back, because you might end up with loaded grids that don't match the original (eg ranges get converted to arrays?) |
@ali-ramadhan and I are interesting in expanding
FieldTimeSeries
to supportNetCDF
.None of us is super familiar with FTS, but it seems like, for the most part, all we need would be to figure out a way to reconstruct
grid
s based onNetCDF
output and figure out how to deal with memory access if the data isPartlyInMemory
. Is that correct or are there other items that we pay attention to?For the former we can output the relevant grid parameters to file and reconstruct it in a way that's already done for JLD2 whenever the
grid
can't be restored directly:Oceananigans.jl/src/OutputReaders/field_time_series.jl
Lines 489 to 529 in 82ad840
We were also wondering if this is worth doing over one PR and a few small ones.
cc @glwagner
The text was updated successfully, but these errors were encountered: