I'm using the pyproj library (http://pyproj4.github.io/pyproj/stable/index.html) to get translate ellipsoidal heights into gravity related height.
Code:
from pyproj import CRS
from pyproj import Transformer
crs7416 = CRS.from_epsg(7416) # dk1 dvr90
crs7417 = CRS.from_epsg(7417) # dk2 dvr90
crs4326 = CRS.from_epsg(4326) # ellipsoid 2d 1984
crs4979 = CRS.from_epsg(4979) # ellipsoid 3d 1984
crs7912 = CRS.from_epsg(7912) # ellipsoid 3d 1980
crs7789 = CRS.from_epsg(7789) # geocentric reference
geocentrictrans = Transformer.from_crs(7789, 7417, always_xy=True)
newgeocentrictrans = geocentrictrans.transform(12.568337, 55.676098, 100)
print(newgeocentrictrans)
transformer = Transformer.from_crs(4979, 7417, always_xy=True)
newcoord = transformer.transform(12.568337, 55.676098, 100)
print(newcoord)
Output:
(9451442.134520395, 0.0, -6378079.9229382025)
(347093.2566329163, 6172711.4819890065, 100.0)
The transformation seem to work with the geocentric transformation but for some reason the height isn't transformed when i go from ellipsoidal- to gravity related height. As far as i can understand i am using the correct EPSG-references, but correct me if i'm wrong.
It seems like the pyproj library should be able to handle this but i'm missing some piece of the puzzle.