-
Notifications
You must be signed in to change notification settings - Fork 25
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
issue when mapping data with surface! and missing data #133
Comments
I simplified your setup a little and it basically seems to work for me locally: julia> using GeoMakie, GLMakie, HDF5
julia> h5open("test.h5") do file
global cth = file["cth"][:,:]
global lat = file["lat"][:,:]
global lon = file["lon"][:,:]
end
julia> fig = Figure()
julia> ga = GeoAxis(fig[1,1]; coastlines=true, dest = "+proj=ortho", lonlims = (-10,10), latlims=(35,55));
julia> sf = surface!(ga, lon, lat, cth; shading=false); julia/system info:julia> versioninfo()
Julia Version 1.8.2
Commit 36034abf260 (2022-09-29 15:21 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin21.3.0)
CPU: 8 × Apple M1
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, apple-m1)
Threads: 1 on 4 virtual cores
(test) pkg> st
Status `~/Documents/test/Project.toml`
[13f3f980] CairoMakie v0.9.1
[e9467ef8] GLMakie v0.7.1
[db073c08] GeoMakie v0.4.6
⌃ [f67ccb44] HDF5 v0.14.2
Info Packages marked with ⌃ have new versions available and may be upgradable. |
Maybe try to crop your data to fit the image (i.e., no longitudes outside +-90)? I seem to recall that being an issue sometimes. |
Thank you very much for having looked at it. @haakon-e Actually, my problem is precisely that I cannot use the GLMakie backend because I work on a virtual machine without graphic adapter and GLMakie woud not compile. Hence, CairoMakie. @asinghvi17 the image is already cropped (western Europe). In other regions near the disk edge, I take care of setting to NaN the out-of-range coordinates. |
Have you seen: https://docs.makie.org/v0.18.2/documentation/headless/index.html#glmakie ? |
Thank you very much for having looked at it. @haakon-e Actually, my problem is precisely that I cannot use the GLMakie backend because I work on a virtual machine without graphic adapter and GLMakie woud not compile. Hence, CairoMakie. @asinghvi17 the image is already cropped (western Europe). In other regions near the disk edge, I take care of setting to NaN the out-of-range coordinates.
Thank you for the link. Unfortunately, I do not have control on the server in my organization, so installing virtualGL is not an option. I use the X2GO client. |
Should be solved by MakieOrg/Makie.jl#2598 - surface in CairoMakie was accidentally changing all instances of NaN to 0. Here are some renders off that branch: |
@asinghvi17 Hi, I update the packages as follows (Pkg status output): but applying the same code as in my initial post, I still get the "0-centered" data. Did you preprocess the data in a way or another, or use another code ? |
It looks like that PR still hasn't merged, there were some bugs in the implementation for certain plot types. You could probably still run |
@asinghvi17 Thank you for your prompt detailed response. Much appreciated ! It works as it could now. Thanks again. |
Hello,
I get some sort of artefact when mapping a physical parameter (cloud top height) on the Earth's disk.
Basically, I have data in a 160x160 matrix and the corresponding lat/lon coordinates, each of which being also in a 160x160 matrix.
the grid is irregular. Some of the data are missing and set to NaN. Same for the corresponding coordinates as shown in the following heatmaps:
And this is the map I get. Several data point to the center of the disk:
This is the code I use:
using GeoMakie, CairoMakie, Colors
using HDF5
h5open("test.h5") do file
global cth = file["cth"][:,:]
global lat = file["lat"][:,:]
global lon = file["lon"][:,:]
end
colormap = :turbo
fig = Figure()
ax = GeoAxis(fig[2,1]; coastlines = true, lonlims = (-90,90), latlims=(-90,90), source = "+proj=lonlat +datum=WGS84", dest = "+proj=ortho")
sf = surface!(ax, lon, lat, cth; colormap = colormap, shading = false, colorrange = (300,20000))
cb = Colorbar(fig[1,1]; colormap = colormap, limits = (300,20000), label = "cth", vertical= false, height = 15, minorticksvisible=true) #height = Relative(0.15))
rowsize!(fig.layout, 2, Aspect(1,0.6))
A different projection (like eqc) does not solve the problem.
I plotted these very same data using Python Cartopy and it works fine.
If any of you could help me to fix this, I would greatly appreciate. The test data file "test.zip" attached contains the HDF5 data read in the code above.
test.zip
The text was updated successfully, but these errors were encountered: