Modern Fortran 3D coordinate conversions for geospace ecef enu eci
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
cmake
src
tests
.appveyor.yml
.gitattributes
.gitignore
.travis.yml
CMakeLists.txt
LICENSE
README.md
compilers.cmake
meson.build
meson_options.txt

README.md

DOI Build Status Build status

Maptran 3D

Modern Fortran 3D coordinate conversions for geospace ecef enu eci. Similar to Python PyMap3D and Matlab / GNU Octave Matmap3d.

Install

Requires Fortran 2008 compiler, such as gfortran, ifort, PGI, nagfor, flang, Cray, IBM XL, etc. Use CMake or Meson to build the suite, which creates libmaptran.so or similar, a shared library with compile-time polymorphism enabled by configuring Fortran preprocessor with one of:

  • -Drealbits=32
  • -Drealbits=64
  • -Drealbits=128

Note: as with any program or programming language, the accuracy of 32-bit reals can be significantly degraded, by orders of magnitude compared to 64-bit reals that are the default for many years. The large real values typical of map coordinates can lead to large error with 32-bit reals. 64-bit reals are the default.

CMake

cd bin

cmake ..

cmake --build .

Optionally, verify Fortran functionality:

ctest -V

Meson

cd bin

meson ..

ninja

Optionally, verify Fortran functionality:

ninja test

Usage

The modern Fortran API is simple like PyMap3D and Matlab Mapping Toolbox. elemental procedures are used throughout to enable seamless support of scalar or array coordinate inputs.

use maptran

call geodetic2ecef(lat,lon,alt, x,y,z)
call geodetic2aer(lat,lon,alt, observer_lat, observer_lon, observer_alt)

Functions

Popular mapping toolbox functions ported to Fortran include the following, where the source coordinate system (before the "2") is converted to the desired coordinate system:

aer2ecef  aer2enu  aer2geodetic  aer2ned
ecef2aer  ecef2enu  ecef2enuv  ecef2geodetic  ecef2ned  ecef2nedv
enu2aer  enu2ecef   enu2geodetic
geodetic2aer  geodetic2ecef  geodetic2enu  geodetic2ned
ned2aer  ned2ecef   ned2geodetic
azel2radec radec2azel
lookAtSpheroid

Abbreviations:

Caveats

  • Atmospheric effects neglected in all functions.
  • Planetary perturbations and nutation etc. not fully considered.