ortk95 / planetmapper

PlanetMapper: An open source Python package for visualising, navigating and mapping Solar System observations
https://planetmapper.readthedocs.io
MIT License
11 stars 1 forks source link

Normalise map projection coordinates to be fractions of radius #252

Closed ortk95 closed 1 year ago

ortk95 commented 1 year ago

e.g. line ~1850 in body_xy.py

        elif projection == 'orthographic':
            proj = '+proj=ortho +a={a} +b={b} +lon_0={lon_0} +lat_0={lat_0} +y_0={y_0} +type=crs'.format(
                a=self.r_eq/self.r_eq,
                b=self.r_polar/self.r_eq,
                lon_0=lon,
                lat_0=lat,
                y_0=(self.r_polar/self.r_eq - self.r_eq/self.r_eq) * np.sin(np.radians(lat * 2)),
            )
            lim = max(self.r_eq/self.r_eq, self.r_polar/self.r_eq) * 1.01
            info = dict(projection=projection, lon=lon, lat=lat, size=size)
            return (
                *self._get_pyproj_map_coords(proj, np.linspace(-lim, lim, size)),
                info,
            )
ortk95 commented 1 year ago

255