-
Notifications
You must be signed in to change notification settings - Fork 16
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
[DOC] Improve regrid documentation #130
Comments
Hello, thanks for the comments and suggestions. I'm gonna write more thorough information when I have some free time. Here's some quick infos: The initial implementation was using scipy under the hood. Hence, The function now uses a hardcoded solution Inverse-Distance from GeoStats ecosystem: ClimateTools.jl/src/functions.jl Line 319 in b803721
My initial idea with the new system would be to provide something like solver = Kriging(
:precipitation => (variogram=GaussianVariogram(range=35.),)
)
R = ClimateTools.regrid(A, B, solver=solver) # regrid information from A into B coordinates where the user provide custom solver (with a default one if not provided). The function # Destination grid
SG = StructuredGrid(londest, latdest)
# Solver
n = Int(round(frac*length(lonorig[:])))
solver = InvDistWeight(target => (neighbors=n,))
SD = StructuredGridData(Dict(target => dataorig[:, :, t]), lonorig, latorig)
problem = EstimationProblem(SD, SG, target)
solution = solve(problem, solver)
OUT[:, :, t] = reshape(solution.mean[target], size(londest)) |
Although the code will produce a result, (lat, lon) coordinates are special, and we definitely need more explicit support in GeoStats.jl for these coordinate systems. @Datseris is aware of this need already, and certainly this will be something to think about after we revamp the spatial data types as planned in the roadmap of the project: https://github.com/JuliaEarth/GeoStats.jl/projects Meanwhile, we are stuck with this ugly syntax for solvers :) In the future, things should look more general, and more flexible as well. That will only happen after I finish writing 2 drafts on my TODO list for conferences this year. |
Hi there,
did i miss something? |
Thanks for the report, I'll take a look! |
ok, found it. I can't remember when, but regrid was renamed I will try to update the documentation to show how GeoStats could be used. |
Thank you @Balinus for updating the docs. I would also recommend adding a link to the book in the docs for those unfamiliar with the stack we are building: https://juliaearth.github.io/geospatial-data-science-with-julia |
Hey there,
I would like to use the regridding functionality to convert my LatLon grid data (1 degree spacing in both lon and lat) to an equal area grid. I am now writing code that produces an approximate equal area grid (which I will then immediately PR here as this seems super duper useful for me :D ).
But I find the
regird
function poorly documented. Firstly, what are the options formethod
? Secondly, may I suggest to have theregrid
docstring into the "interpolation" page instead of "index"? It makes much more sense. Thirdly, this:is way too verbose as a docstring, and I can't imagine the information
t::AbstractArray{N, T} where N where T
is actually useful or relevant for the function. Fourthly, I simply don't understand the call signatureregrid(A::ClimGrid, lon, lat)
. Which field is regrided here? The fieldA
into the given LonLat grid?Lastly, it should also be discussed whether grids are expected in degrees or kilometers (as some people also use kilometers).
The text was updated successfully, but these errors were encountered: