5. Utils

General functions that may be useful.

utils.ortho_distance(lon_1, lat_1, lon_2, lat_2)

Compute the orthodromic distance in kilometers between (lon_1, lat_1) and (lon_2, lat_2).

utils.spherical_heading(lon_1, lat_1, lon_2, ...)

Compute the spherical heading in degrees between the north and the direction formed by the two positions (lon_1, lat_1) and (lon_2, lat_2).

utils.convert_utc_to_loc(df, local_timezone)

Convert datetime from UTC to the local timezone.

utils.convert_loc_to_utc(df, local_timezone)

Convert datetime column from the local timezone to UTC.

utils.apply_functions_between_samples(df, ...)

Apply a chosen function (e.g. sum, mean, min, max) over every high resolution elements between two subsamples defined by a given resolution.

utils.get_largest_factor(n)

Compute the largest factor.

utils.nearsq_grid_layout(n[, tol])

Compute the near-square grid layout dimensions with a width to height ratio being smaller than a given tolerance.