Transform heights using a local grid#

Choose the operation from the survey’s horizontal CRS, height datum and target CRS. Keep the grid’s identity with the results so the control can be checked against the same resource.

Choose the height route#

Height datum

Source

Target

Additional requirement

EGM96

EPSG:4326+5773

EPSG:4979

Local EGM96 resource

EGM2008

EPSG:4326+3855

Survey target with a verified operation for the CRS pair

Applicable local grid resource

GEOID18

EPSG:6318+5703

EPSG:6319

Applicable local grid resource

GEOID18

EPSG:6318+5703

EPSG:9754

Applicable local grid resource and epoch

Check an EGM96 control#

Set resource_directory to the local directory containing the required EGM96 resource. This candidate converts an orthometric height of 100 metres at longitude −77°, latitude 39° to WGS 84 ellipsoidal height. Inspect the operation printed by explain() to identify its grid stage and grid identity.

import numpy as np
from cugeo.proj import Transformer

resource_directory = "<directory-containing-the-EGM96-resource>"
longitude = np.array([-77.0])
latitude = np.array([39.0])
height = np.array([100.0])

with Transformer.from_crs(
    "EPSG:4326+5773",
    "EPSG:4979",
    always_xy=True,
    resource_directory=resource_directory,
) as transformer:
    print("selected operation and grid:", transformer.explain())
    out_lon, out_lat, out_height, status = transformer.transform(
        longitude, latitude, height, return_status=True
    )
    print("input height (m):", height[0])
    print("ellipsoidal height (m):", out_height[0])
    print("output minus input (m):", out_height[0] - height[0])
    print("status:", status[0])

Check that the control lies inside valid grid coverage and that its status is OK. Compare the output with an independent calculation using the same operation and grid. The printed difference is the height correction at that location. For a deliverable needed on the GPU, use CuPy columns on the supported device route and check the same control there.

Investigate a missing resource or failed row#

If creation reports a missing resource, check for the named file in the supplied directory. If a completed batch contains a failed row, request its optional cause to distinguish coverage from grid nodata. Use that cause to diagnose the failed coordinate.