ortk95 / planetmapper

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

Allow customisation of the target's surface altitude when converting to `lonlat` coordinates #368

Closed ortk95 closed 2 months ago

ortk95 commented 2 months ago

Added an additional alt keyword only parameter to transformations to longitude/latitude coordinates, which allows the altitude of the target's surface to be specified. For example, you can now specify the altitude with methods like:

body.radec2lonlat(..., alt=500)
body.get_backplane_img(..., alt=500)
body.plot_wireframe_radec(..., alt=500)
body.map_img(..., alt=500)

This is a continuation of the work in #365, and means that all PlanetMapper conversions to and from lonlat coordinates can now have the altitude customised. In addition to coordinate conversion methods (e.g. radec2lonlat, lonlat2radec, ...), wireframe plotting methods and backplanes can now also produce altitude dependent outputs.

Internally, this is implemented using a context manager (and associated decorator) to modify SPICE kernel variables and instance attributes defining the target's radii. Within the _AdjustedSurfaceAltitude context, all relevant methods will use these adjusted radii values. On exit of the context manager, the original kernel variables and instance attributes will be restored. This is a relatively complex change, so I've added some significant new tests to help ensure that the state is changed appropriately.

Closes #350

Pull request checklist

See CONTRIBUTING.md for more details.

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 9546337265

Details


Totals Coverage Status
Change from base Build 9499096159: 0.02%
Covered Lines: 3050
Relevant Lines: 3062

💛 - Coveralls