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

tissot going over the North Pole #451

Open
floglass opened this issue Jan 15, 2019 · 1 comment
Open

tissot going over the North Pole #451

floglass opened this issue Jan 15, 2019 · 1 comment

Comments

@floglass
Copy link

Sorry if this is a known bug, but I could not find it in this repository, I think I might have seen it in Matplotlib:

When using tissot to plot the theoretical field of view of a satellite looking down to Earth, a ValueError is encountered if the tissot polygon crosses the North Pole. It does not happen on the South Pole.

ValueError: undefined inverse geodesic (may be an antipodal point)

Code snipplet below. I installed Basemap (v1.2.0) through pip.

import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import math

earth_radius = 6371000.  # m
fig = plt.figure()
m = Basemap(projection='cyl', resolution='l',
            llcrnrlat=-90, urcrnrlat=90,
            llcrnrlon=-180, urcrnrlon=180)

# define the position of the satellite
position = [300000., 75., 0.]  # altitude, latitude, longitude

# radius needed by the tissot method
radius = math.degrees(math.acos(earth_radius / (earth_radius + position[0])))
m.tissot(position[2], position[1], radius, 100, facecolor='tab:blue', alpha=0.3)  # longitude, latitude
m.scatter(position[2], position[1], marker='*', c='tab:red')

plt.show()
@DWesl
Copy link
Contributor

DWesl commented Jun 4, 2024

I suspect the problem is here:

az12,az21,dist = g.inv(lon_0,lat_0,lon_0,lat_0+radius_deg)
seg = [self(lon_0,lat_0+radius_deg)]

As a workaround, does passing a negative radius_deg allow plotting this indicatrix? This would cause problems at the south pole, so plotting indicatrices at both poles would require two calls.

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