'A function decorator for defining transformations.
.. note::
If decorating a static method of a class, ``@staticmethod``
should be  added *above* this decorator.
Parameters
transcls : class
The class of the transformation object to create.
fromsys : class
The coordinate frame class to start from.
tosys : class
The coordinate frame class to transform into.
priority : number
The priority if this transform when finding the shortest
coordinate transform path - large numbers are lower priorities.
Additional keyword arguments are passed into the ``transcls``
constructor.
Returns
deco : function
A function that can be called on another function as a decorator
(see example).
Notes
This decorator assumes the first argument of the ``transcls``
initializer accepts a callable, and that the second and third
are ``fromsys`` and ``tosys``. If this is not true, you should just
initialize the class manually and use `add_transform` instead of
using this decorator.
Examples
graph = TransformGraph()
class Frame1(BaseCoordinateFrame):
class Frame2(BaseCoordinateFrame):
@graph.transform(FunctionTransform, Frame1, Frame2)
def f1_to_f2(f1_obj):
... do something with f1_obj ...
return f2_obj'

def transform(self, transcls, fromsys, tosys, priority=1, **kwargs):

    def deco(func):
        transcls(func, fromsys, tosys, priority=priority, register_graph=self, **kwargs)
        return func
    return deco
