We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Only when I try it as below it does not work, i.e., wrapping the mapCube function in another function:
axlist = [ RangeAxis("time", Date(1979,1,1):Day(1):Date(2021,12,31)), RangeAxis("lon", range(-60,-70, length=11)), RangeAxis("lat", range(-30, -40, length=11)), ] data = rand(Bool,length(axlist[1]), 11, 11) ds = YAXArray(axlist, data) function aggregate(xout, xin) for m in xout.Time.values aggval = sum(xin[time=(m, m + Year(1) - Day(1))].data) xout[Time=m].data .= aggval end end function aggregate(cube::YAXArray, var_name, thr) indims = InDims("Time", artype=YAXArray) ym = unique(year.(cube.time.values)) outdims = OutDims(RangeAxis("Time", Date.(ym)), artype=YAXArray, outtype = UInt16, path = "/scratch/jcortes/git_test_$(var_name)_$thr.zarr") mapCube(aggregate, cube; indims, outdims) end var_names = ["t2m", "t2mmax", "t2mmin", "tp", "spei_30", "spei_90", "spei_180"] thrs = [0.95, 0.05] for var_name in var_names for thr in thrs event_cube = ds aggregate(event_cube, var_name, thr) end end
The above code runs without errors, but the cubes are not saved.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Only when I try it as below it does not work, i.e., wrapping the mapCube function in another function:
The above code runs without errors, but the cubes are not saved.
The text was updated successfully, but these errors were encountered: