-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Determine standards for saving ensemble #35
Comments
I've copied meta data and attributes from the pyqg pickup file. I've also included both lcs-ml/ensemble_particle_generator/ensemble_generator.py Lines 94 to 110 in 3281517
A single zarr store will be created for each ensemble member. This gets appended to at daily increments during lcs-ml/ensemble_particle_generator/ensemble_generator.py Lines 113 to 119 in 3281517
|
Thanks for this great work Hillary! A few comments:
Could you call |
ds.info()
print(ds) |
I'll fix the units for x,y,x0,y0 and remove the units=none. Do we leave time as timedelta64[ns] and change units to nanoseconds?? Time prints out as nanoseconds even if I save timedelta64[D]. print(ds.time.values[0])
|
Thanks! Strain is not unitless. Its units are the same as vorticity. Don't worry about the |
Oh cool, I didn't realize that |
When xarray opens any dataset, by default it does decoding of CF attributes. So the values you see in the opened dataset are not necessarily the same ones you see on disk. If you do |
Very cool, thanks! I see that ds = xr.open_zarr('/burg/abernathey/users/hillary/lcs/pyqg_ensemble/001.zarr', decode_times=False)
print(ds.time.encoding)
ds = xr.open_zarr('/burg/abernathey/users/hillary/lcs/pyqg_ensemble/001.zarr', decode_times=True)
print(ds.time.encoding)
|
The output of the ensemble now includes the stream function lcs-ml/ensemble_particle_generator/ensemble_generator.py Lines 83 to 84 in 5580d9e
I see that I renamed the x and y particle positions xarray.Dataset {
dimensions:
n = 1 ;
time = 1 ;
y = 512 ;
x = 512 ;
y0 = 1024 ;
x0 = 1024 ;
variables:
int64 n(n) ;
n:long_name = ensemble member ;
float64 p(n, time, y, x) ;
p:long_name = streamfunction in real space ;
p:units = meters squared second ^-1 ;
float64 strain(n, time, y0, x0) ;
strain:long_name = particle strain magnitude ;
strain:units = second ^-1 ;
timedelta64[ns] time(time) ;
time:long_name = model time ;
float64 vort(n, time, y0, x0) ;
vort:long_name = particle relative vorticity ;
vort:units = second ^-1 ;
float64 x(x) ;
x:long_name = model grid points in the x direction ;
x:units = meters ;
float64 x0(x0) ;
x0:long_name = particle grid points in the x direction ;
x0:units = meters ;
float64 xpos(n, time, y0, x0) ;
xpos:long_name = particle position in the x direction ;
xpos:units = meters ;
float64 y(y) ;
y:long_name = model grid points in the y direction ;
y:units = meters ;
float64 y0(y0) ;
y0:long_name = particle grid points in the y direction ;
y0:units = meters ;
float64 ypos(n, time, y0, x0) ;
ypos:long_name = particle position in the y direction ;
ypos:units = meters ;
// global attributes:
:pyqg:L = 1200000 ;
:pyqg:M = 262144 ;
:pyqg:W = 1200000 ;
:pyqg:beta = 1.3e-11 ;
:pyqg:del2 = 0.8 ;
:pyqg:delta = 0.25 ;
:pyqg:dt = 600.0 ;
:pyqg:filterfac = 23.6 ;
:pyqg:nk = 257 ;
:pyqg:nl = 512 ;
:pyqg:ntd = 6 ;
:pyqg:nx = 512 ;
:pyqg:ny = 512 ;
:pyqg:nz = 2 ;
:pyqg:rd = 15000 ;
:pyqg:rek = 5.787037037037037e-07 ;
:pyqg:taveint = 86400 ;
:pyqg:tavestart = 86400 ;
:pyqg:tc = 777600 ;
:pyqg:tmax = 466560000 ;
:pyqg:twrite = 50000 ;
:reference = https://pyqg.readthedocs.io/en/latest/index.html ;
:title = pyqg: Python Quasigeostrophic Model ;
} |
The ensemble will adapt the standards used in
pyqg
to stay consistent.Pickup file generated from the spin up simulation. Contains everything available from the
model.to_dataset()
method inpyqg
.Each member in the ensemble will contain daily snapshots of 4 upper layer properties:
The dimensions of all 4 variables are (time, y0, x0).
Other things to consider:
**You cannot append data to an existing variable without re-creating it with netCDF. However, you can append data to an existing variable with Zarr.
The text was updated successfully, but these errors were encountered: