:py:mod:`mlair.helpers.geofunctions` ==================================== .. py:module:: mlair.helpers.geofunctions .. autoapi-nested-parse:: Functions related to geo locations etc. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: mlair.helpers.geofunctions.deg2rad_all_points mlair.helpers.geofunctions.haversine_dist Attributes ~~~~~~~~~~ .. autoapisummary:: mlair.helpers.geofunctions.__author__ mlair.helpers.geofunctions.__date__ mlair.helpers.geofunctions.xr_int_float mlair.helpers.geofunctions.tuple_of_2xr_int_float .. py:data:: __author__ :annotation: = Felix Kleinert .. py:data:: __date__ :annotation: = 2021-02-16 .. py:data:: xr_int_float .. py:data:: tuple_of_2xr_int_float .. py:function:: deg2rad_all_points(lat1: xr_int_float, lon1: xr_int_float, lat2: xr_int_float, lon2: xr_int_float) -> Tuple[tuple_of_2xr_int_float, tuple_of_2xr_int_float] Converts coordinates provided in lat1, lon1, lat2, and lon2 from deg to rad. In fact this method just calls dasks deg2rad method on all inputs and returns a tuple of tuples. :param lat1: Latitude(-s) of first location :type lat1: :param lon1: Longitude(-s) of first location :type lon1: :param lat2: Latitude(-s) of second location :type lat2: :param lon2: Longitude(-s) of second location :type lon2: :return: Lats and lons in radians ((lat1, lon1), (lat2, lon2)) :rtype: .. py:function:: haversine_dist(lat1: xr_int_float, lon1: xr_int_float, lat2: xr_int_float, lon2: xr_int_float, to_radians: bool = True, earth_radius: float = 6371.0) -> xarray.DataArray Calculate the great circle distance between two points on the Earth (specified in decimal degrees or in radians) Reference: ToBeAdded (First implementation provided by M. Langguth) :param lat1: Latitude(-s) of first location :param lon1: Longitude(-s) of first location :param lat2: Latitude(-s) of second location :param lon2: Longitude(-s) of second location :param to_radians: Flag if conversion from degree to radiant is required :param earth_radius: Earth radius in kilometers :return: Distance between locations in kilometers