-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Cartesian coordinate handling could be generalized in a utils-package, something like:
from functools import wraps
def use_carts(use_carts=False, latitude_xy_threshold=60):
"""Convert input to a function to cartesian and back."""
def decorator(func):
@wraps(func)
def wrapper(data, **kwargs):
if use_carts:
data = _lonlat2xyz(*data)
result = func(data, **kwargs)
if use_carts:
result = _xyz2lonlat(*result, latitude_xy_threshold=latitude_xy_threshold)
return result
return wrapper
return decorator
Usage would be simplified to
interpolate = use_carts(to_cart)(tie_points_interpolation)
return interpolate([longitude, latitude], scan_alt_tie_points, tie_points_factor)
Metadata
Metadata
Assignees
Labels
No labels