Skip to content
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

Makie image recipe is putting the data on the wrong lat lon position #510

Closed
felixcremer opened this issue Sep 4, 2023 · 2 comments
Closed

Comments

@felixcremer
Copy link
Contributor

When I plot a Raster with image that gives a wrong position. I can use heatmap to properly plot the data. The mismatch depends on some properties of the dimensions.
Below is an example script and I will attach the exemplary nc file. I would have expected that the position of the rectangle in the corner would be the same for heatmap and for image.
I could not reproduce the mismatch with a simple reverse ordered Y-Axis.

julia> r = Raster("./image_vs_heatmap_corner.nc")
[ Info: No `name` or `key` keyword provided, using first valid layer with name `:unnamed`
559×561 Raster{Union{Missing, Float32},2} unnamed with dimensions: 
  X Mapped{Float64} Float64[635090.3685878773, 636033.1138663981, , 1.1601994887240704e6, 1.1607739741281688e6] ForwardOrdered Irregular Points crs: EPSG mappedcrs: EPSG,
  Y Mapped{Float64} Float64[6.306992429753325e6, 6.306049684474804e6, , 5.779997819060089e6, 5.779202377731337e6] ReverseOrdered Irregular Points crs: EPSG mappedcrs: EPSG
extent: Extent(X = (635090.3685878773, 1.1607739741281688e6), Y = (5.779202377731337e6, 6.306992429753325e6))
missingval: missing
crs: EPSG:4326
mappedcrs: EPSG:4326
parent:
            6.30699e6  6.30605e6  6.30511e6  6.30416e6    5.78188e6  5.78094e6  5.78e6  5.7792e6
 6.3509e5   1.0        1.0        1.0        1.0           0.0        0.0        0.0     0.0
 6.36033e5  1.0        1.0        1.0        1.0           0.0        0.0        0.0     0.0
                                                                                       
 1.1602e6   0.0        0.0        0.0        0.0          0.0        0.0        0.0     0.0
 1.16077e6  0.0        0.0        0.0        0.0           0.0        0.0        0.0     0.0

julia> image(r, interpolate=false)


julia> heatmap(r, interpolate=false)

julia> figim, axim, im = image(r, interpolate=false)

julia> heatmap(r, interpolate=false, colormap=:greys)

julia> display(GLMakie.Screen(), figim)
GLMakie.Screen(...)

image_vs_heatmap_corner.zip

I had to zip it because of github.

@rafaqz
Copy link
Owner

rafaqz commented Sep 9, 2023

Weird that they are different, will have to look into it.

But possibly we can ignore this now as all the lower level plotting will move to
https://github.com/rafaqz/DimensionalData.jl/pull/

And just make sure they match over there

@felixcremer
Copy link
Contributor Author

This is fixed on Rasters main with DD main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants