TNO Intern

Commit fa713cea authored by Arjo Segers's avatar Arjo Segers
Browse files

Changed imports for python packaging.

parent 230664b6
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@
# 2023-08, Arjo Segers
#   Remove rounding errors when locations are very close.
#
# 2026-01, Arjo Segers
#   Changed imports for python packaging.
#

########################################################################
###
@@ -89,7 +92,7 @@ def LonLatDistance(lon1, lat1, lon2, lat2):
    import numpy

    # tools:
    from cso_constants import EarthRadius
    from . import cso_constants

    # convert:
    delta = lon2 - lon1
@@ -102,7 +105,7 @@ def LonLatDistance(lon1, lat1, lon2, lat2):
    phi = numpy.arccos(x.clip(-1.0, 1.0))  # radians

    # in m over the globe:
    return phi * EarthRadius  # m
    return phi * cso_constants.EarthRadius  # m


# enddef  # LonLatDistance
@@ -176,7 +179,7 @@ def LonLatTrianglesArea(xx, yy):
    import numpy

    # tools:
    from cso_constants import EarthRadius
    from . import cso_constants

    # areas:
    aa = TrianglesArea(numpy.radians(xx), numpy.radians(yy))  # rad2
@@ -186,7 +189,7 @@ def LonLatTrianglesArea(xx, yy):

    # areas:
    #       rad2                                m2
    return aa * numpy.cos(yy_aver) * EarthRadius**2  # m2
    return aa * numpy.cos(yy_aver) * cso_constants.EarthRadius**2  # m2


# enddef LonLatTrianglesArea