I currently have data that is set on a spherical shell. The data that I have is something like temperature. The coordinates associated with temperature are in latitude and longitude. The latitude has a regular spacing of 1 degree while the longitude has a regular spacing of 2 degree. What are the methods that you would suggest to interpolate the temperature for a given latitude and longitude (i.e. latitude = 42.3 degrees and longitude = 23.9 degrees)?
You can use Meshes.jl to create a Sphere. You can supply Temperature array to color variable.
using Meshes, GLMakie, CoordRefSystems
# grid with latitude and longitude coordinates
LAT = [i for i in -90.0 : 0.1 : 90.0, j in 0.0 : 2.0 : 360.0]
LON = [j for i in -90.0 : 0.1 : 90.0, j in 0.0 : 2.0 : 360.0]
C = typeof(LatLon(0, 0))
grid = StructuredGrid{🌐,C}(LAT, LON)
viz(grid, color = 1:nvertices(grid))
@trung highly recommend reading the GeoStats.jl docs in the interpolation section. If you load your data from a file format recognized by GeoIO.jl, all you need to do is call the Interpolate
or InterpolateNeighbors
transforms.
We are gradually adding spherical methods inside these high-level routines. Currently, they will convert the distances to Euclidean distances using the actual size of the Earth.
Also, check this workshop material I prepared for the FOSS4G conference last year:
It is very much related to your question.
Thanks for the link for the workshop and GeoStats.jl for ideas on interpolations on a sphere. Unfortunately, the data uses the IDL format which seems to be unsupported by GeoIO.jl.
You can load the data into normal Julia arrays and then use the georef function to convert to a geotable. That is what GeoIO.jl does. Let me know if the docs are not clear.