Skip to content
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

Constructor for MeshArray with multiple times #50

Open
ggebbie opened this issue Feb 23, 2021 · 4 comments
Open

Constructor for MeshArray with multiple times #50

ggebbie opened this issue Feb 23, 2021 · 4 comments

Comments

@ggebbie
Copy link

ggebbie commented Feb 23, 2021

I'm enjoying learning julia and the MeshArrays package. Thank you @gaelforget

I would like to pre-allocate a variable of type MeshArray that is filled with zeroes and that has multiple time snapshots. What's the best way to do it?

Here's one attempt.
nout = 5 # an example number of time snapshots
θout = MeshArray(γ,Float32,nout) # some nans are here!
fill!(θout,0.0)

Perhaps I just missed a good example somewhere in the code. Any help is appreciated.

@gaelforget
Copy link
Member

I'm enjoying learning julia and the MeshArrays package. Thank you @gaelforget

Cool!

I would like to pre-allocate a variable of type MeshArray that is filled with zeroes and that has multiple time snapshots. What's the best way to do it?

Sorry for lag in response.

I feel that a good way to go about this could be to add the time dimension at the inner array level (make these 3D rather than 2D). Have you tried something like this?

A broader comment though is that writing a loop and loading one record at a time is definitely more scalable. Have you looked at onlinestats.jl and other lazy programming options for example? I am not sure if how to do something like PCA/EOF this way but I have been meaning to dig into that.

@ggebbie
Copy link
Author

ggebbie commented Sep 23, 2021

Now I am the one with the slow response --- oops! I haven't tried adding the time dimension at the inner array level. That does make some intuitive sense to me. On the other hand, I've extended some methods to work with the time dimension on the outer array level already.

Good idea regarding loading one record at a time for better scalability. I wrote a function for removing the seasonal cycle and interannual variability from ECCO output that operates in that fashion. It treats the filter operation like a matrix where multiplication is done by weighting the columns (which each represent one time). I am trying to clean up the repo and to make it public.

@gaelforget
Copy link
Member

Should be able to spend some time on this in coming week. Thanks for your patience

@ggebbie
Copy link
Author

ggebbie commented Nov 17, 2021

Initialization of a MeshArrays.gcmarray seems to be a minor issue. My existing initializations seem fast and they aren't too ugly. I have built on the format of having time or depth in the outer level and so I don't yet see a good reason to move one of them to the "inner" structure.

Good idea regarding loading one record at a time. I wrote some temporal filters that work even though only one time period is stored in memory at a time. I will link to the code when it's better organized (currently in ggebbie/ECCOtour.jl but should be moved to its own module).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants