Coverage for pyaxqg / __init__.py: 100%
21 statements
« prev ^ index » next coverage.py v7.14.0, created at 2026-08-31 15:27 -0400
« prev ^ index » next coverage.py v7.14.0, created at 2026-08-31 15:27 -0400
2# -*- coding: utf-8 -*-
4u'''A pure Python implementation of a biaxial and U{triaxial reference ellipsoid for the Earth
5<https://link.Springer.com/article/10.1007/s00190-023-01717-1>} with conversion between geodetic
6lat-, longitude with ellipsoidal height C{h} and cartesian X, Y, Z with orthometric height C{H}
7or quasi-geoid height C{N} using bilinear or bivariate spline interpolation of C{1-degree},
8whole Earth grids.
10The 5 grid columns C{Nbiaxial}, C{Ntriaxial}, C{xE}, C{xyE} and C{xzE} of the C{reference ellipsoids}
11U{Supplementary file 2<https://link.Springer.com/article/10.1007/s00190-023-01717-1#Sec21>} are
12included, making C{pyaxqg} a self-contained package.
14See U{pygeodesy.geoids<https://mrjean1.GitHub.io/PyGeodesy/docs/pygeodesy.geoids-module.html>} for
15other pure Python geoid implementations and height interpolations.
17See the L{pyaxqg main<pyaxqg.__main__>} module for some usage examples and comparison with the
18U{pygeodesy.GeoidKarney<https://GeographicLib.SourceForge.io/C++/doc/geoid.html#geoidinst>} results.
19'''
20import os.path as os_path
21import sys
23# _isfrozen = getattr(_sys, 'frozen', False)
24pyaxqg_abspath = os_path.dirname(os_path.abspath(__file__)) # _sys._MEIPASS + '/pyaxqg'
25_pyaxqg_ = __package__ or os_path.basename(pyaxqg_abspath)
27# setting __path__ should ...
28__path__ = [pyaxqg_abspath]
29try: # ... make this import work, ...
30 import pyaxqg.__pygeodesy as __pygeodesy
31except ImportError: # ... if not, extend sys.path
32 if pyaxqg_abspath not in sys.path:
33 sys.path.insert(0, pyaxqg_abspath)
34 import pyaxqg.__pygeodesy as __pygeodesy # PYCHOK re-import
36import pyaxqg.axqgs as _axqgs # noqa: F401
38__all__ = __pygeodesy._ALL_STAR(_pyaxqg_, _axqgs, __pygeodesy)
39__version__ = '26.09.02'
41del _axqgs # os_path, sys
44def _sys_modules_pyaxqg(_ax_grids_):
45 # set sys.modules['pyaxqg.ax_grids'] to ax_grids from ax_grids.zip
46 p = os_path.join(pyaxqg_abspath, __pygeodesy._DOT_(_ax_grids_, 'zip'))
47 sys.path.insert(0, p)
48 try: # ignore Zipimporter.exec_module, .load_module
49 import ax_grids
50 sys.modules[__pygeodesy._DOT_(_pyaxqg_, _ax_grids_)] = ax_grids
51 except ImportError:
52 ax_grids = None
53 finally:
54 assert sys.path.pop(0) == p
55 return ax_grids
58def _versions(**sep): # in .__main__, .test/bases
59 # Get the pyaxqg, pygeodesy, Python ... versions (C{str}).
60 return __pygeodesy._versions(pyaxqg=__version__, **sep)
62# **) MIT License
63#
64# Copyright (C) 2026-2026 -- mrJean1 at Gmail -- All Rights Reserved.
65#
66# Permission is hereby granted, free of charge, to any person obtaining a
67# copy of this software and associated documentation files (the "Software"),
68# to deal in the Software without restriction, including without limitation
69# the rights to use, copy, modify, merge, publish, distribute, sublicense,
70# and/or sell copies of the Software, and to permit persons to whom the
71# Software is furnished to do so, subject to the following conditions:
72#
73# The above copyright notice and this permission notice shall be included
74# in all copies or substantial portions of the Software.
75#
76# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
77# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
78# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
79# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
80# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
81# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
82# OTHER DEALINGS IN THE SOFTWARE.