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

Add a SphericalAxis function #293

Open
aplavin opened this issue Nov 21, 2024 · 2 comments
Open

Add a SphericalAxis function #293

aplavin opened this issue Nov 21, 2024 · 2 comments

Comments

@aplavin
Copy link

aplavin commented Nov 21, 2024

Currently, as I understand from earlier discussions with @asinghvi17, GeoAxis assumes some ellipse/geoid for the shape, and takes coordinates in degrees. I (and others in astronomy) typically want to plot a regular sphere, with native units (radians) for lat/lon.
I've been using this snippet (again, adapted from @asinghvi17 recommendations):

SphericalAxis(args...; kwargs...) = GeoAxis(args...; 
	source="""
	GEOGCRS["WGS 84",
	    DATUM["World Geodetic System 1984",
	        ELLIPSOID["WGS 84",6378137,298.257223563,
	            LENGTHUNIT["metre",1]],
	        ID["EPSG",6326]],
	    PRIMEM["Greenwich",0,
	        ANGLEUNIT["radian",1],
	        ID["EPSG",8901]],
	    CS[ellipsoidal,2],
	        AXIS["geodetic latitude (Lat)",north,
	            ORDER[1],
	            ANGLEUNIT["Rad",1]],
	        AXIS["geodetic longitude (Lon)",east,
	            ORDER[2],
	            ANGLEUNIT["Rad",1]]]
	""", kwargs...,)

There is quite some magic here, but it works :) Can such a function be added to GeoMakie?

@asinghvi17
Copy link
Member

Not sure about reserving the spherical axis name since that can also mean a 3D sphere. But in general yes, would be nice to host the definition of this CRS in GeoMakie.

Would something like GeoMakie.UNIT_SPHERE_RADIANS_CRS work for this?

@aplavin
Copy link
Author

aplavin commented Feb 16, 2025

I think specifying source=... is not enough for a true "spherical coordinates axis". In particular, I noticed that while limits=(0±π, 0±π/2) work correctly in radians, ticks don't: e.g., it still needs yticks=[-45, 0, 45] instead of yticks=[-π/4, 0, π/4], even with this source.
That's one of the reasons to have SphericalAxis() (or however it's called) – to have all attributes and coordinates in radians, and to have a perfect sphere as the base.

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