geometry ======== The geometry module allows to define multiple coordinate systems as a tree of nested coordinate systems which can be moved and rotated against each other. Points and directions can be converted between different coordinate systems. The coordinate system trees can be stored e.g. as YAML files on disk. Example ------- Taking the sample ``mounttree.yaml`` from below, a :py:class:`MountTree` instance can be constructed using:: >>> from runmacs.geometry.mounttree import MountTree >>> import yaml >>> mounttree = MountTree.fromDict(yaml.load(open('mounttree.yaml'))) A transformation from a direction in SWIR coordinates to the VNIR camera system which is independent of the dynamic corrdinates (== aircraft position data) can now be performed using:: >>> import numpy as np >>> transformation = mounttree.universe.getTransformation('SWIR', 'VNIR') >>> in_swir_coordinates = np.array((0.5, 0.1, 1.0)) >>> in_vnir_coordinates = transformation.applyDirection(in_swir_coordinates) To transform to earth based coordinates, the position of the aircraft has to be set:: >>> mounttree.update(lat=-40., lon=-3., height=5000., roll=0.1, pitch=0.1, yaw=0.5) >>> transformation = mounttree.universe.getTransformation('VNIR', 'EARTH') >>> in_earth_coordinates = transformation.applyDirection(in_swir_coordinates) .. literalinclude:: ../test/test_geometry/testmounttree.yaml :caption: mounttree.yaml :language: yaml Module documentation -------------------- .. automodule:: runmacs.geometry.coordinateframes :members: .. automodule:: runmacs.geometry.mounttree :members: