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

Mercator areas not shown and used correctly #374

Open
ameraner opened this issue Jun 12, 2023 · 4 comments
Open

Mercator areas not shown and used correctly #374

ameraner opened this issue Jun 12, 2023 · 4 comments
Labels
bug Something isn't working component: scene graph

Comments

@ameraner
Copy link
Collaborator

Problem

It seems that areas in the mercator projection are not shown and used correctly.
For example, when using the area

CE_1160x800:
  description:   Central Europe 1160x800
  projection:
    proj: merc
    lat_0: 50
    lon_0: 14.5
    ellps: WGS84
  shape:
    width: 1160
    height: 800
  area_extent:
    lower_left_xy: [-1805152.04,  5172213.35]
    upper_right_xy: [1811322.74,  7660679.05]

just a black screen appears on the main window:
image

If I try to resample a LEO granule that is over France to this area, and then switch to plate carree, I see that the data has been resampled to Mongolia:
image

For reference, this is the plain Satpy result:
image

Additional Information

  • Not sure if it's related, but there is a code comment mentioning mercator issues workarounds here:

    sift/uwsift/view/visuals.py

    Lines 941 to 942 in f5e584c

    # Clip lats to +/- 89.9 otherwise PROJ.4 on mercator projection will fail
    np.clip(vertex_buffer[:, 1], -89.9, 89.9, out=vertex_buffer[:, 1])
  • logs do not show anything particular, apart from the usual
2023-06-12 16:22:06 DEBUG document:change_projection:L125 Changing projection (area definition) from 'MSG SEVIRI FES 3km' to 'CE_1160x800'
/tcenas/proj/optcalimg/OFTs/SIFT/conda-packaged_v2.0.0b0/SIFT_2.0.0b0/lib/python3.11/site-packages/pyproj/crs/crs.py:1286: UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
  proj = self._crs.to_proj4(version=version)

@djhoese
Copy link
Member

djhoese commented Jun 12, 2023

Off the top of my head, I don't think a mercator projection with a non-equator lat_0 is valid in PROJ. Right?

@djhoese
Copy link
Member

djhoese commented Jun 12, 2023

https://proj.org/en/9.2/operations/projections/merc.html

No mention of lat_0. Not that that explains it, but yeah, maybe affecting it.

@ameraner ameraner added component: scene graph EUM-WIP This issue is (scheduled to) being worked on by EUM labels May 6, 2024
@arcanerr
Copy link

arcanerr commented May 7, 2024

Is mercator implemented in SIFT or exactly speaking VisPy at all? If I remember correctly, VisPy has an own implementation of the projections and at least equidistant cylindrical (eqc) is missing.

@djhoese
Copy link
Member

djhoese commented May 7, 2024

Vispy does not implement any geographic projects. I wrote them into SIFT in shader language by modifying a OpenCL (not OpenGL) version of PROJ if I remember correctly. The main point here is that mercator with a lat_0 other than 0 is not very standard and is not implemented most likely.

@ameraner ameraner removed the EUM-WIP This issue is (scheduled to) being worked on by EUM label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: scene graph
Projects
None yet
Development

No branches or pull requests

3 participants