def transform_grid(func):
@wraps(func)<EOL>def wrapper(profile, grid, *args, **kwargs):<EOL><INDENT>"""<STR_LIT>"""<EOL>if not isinstance(grid, TransformedGrid):<EOL><INDENT>return func(profile, profile.transform_grid_to_reference_frame(grid), *args, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>return func(profile, grid, *args, **kwargs)<EOL><DEDENT><DEDENT>return wrapper<EOL>
Wrap the function in a function that checks whether the coordinates have been transformed. If they have not \ 
    been transformed then they are transformed.

    Parameters
    ----------
    func : (profiles, *args, **kwargs) -> Object
        A function that requires transformed coordinates

    Returns
    -------
        A function that can except cartesian or transformed coordinates