-
Notifications
You must be signed in to change notification settings - Fork 120
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
Suggest changing status history into non-masked array always showing actual status #1420
Comments
Yes, this is a bit awkward, but for legacy reasons: Today, an Xarray Dataset would be an obvious choice for the datamodel. However, at the birth of OpenDrift, Xarray was not very mature, and a masked array was chosen. And only one timestep is kept in memory (though with some caching of 100 timesteps for performance), and flushed to disk after each timestep. We hope to make a new inner datamodel based on Xarray Dataset quite soon, and then this issue will be eliminated. |
@knutfrode Do you still have the experiement from our Mjølfjell-Opendrift-Workshop? I think you created an example with xarray that flushes data to disk on demand and handled by xarray? |
I had almost forgotten that test! Could it be this test-script? Here I am writing to zarr. |
At present, the array
o.history['status']
is a masked array, and for a given particle, the status is always0
(active), except in the timestep in which it became deactivated, where the status will be for example1
for seafloor or2
for stranded. For all later times, the status is-999
(and also masked).When plotting a mass balance, it is convenient to know the status of a particle also at times after it was deactivated. It would therefore be handy if the status array actually held the status at all times. The status array doesn't have to be a masked array either, as any status other than
0
means the particle is not active. It could also a status number (-1, for example) representing particles that are not seeded yet.One can of course create the array I describe post hoc, like so:
but is there any reason not to create the array like this in the first place?
The text was updated successfully, but these errors were encountered: