Skip to content

How to interpolate geoid grid for reference heights #72

Answered by leouieda
geojoeyphillips asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @geojoeyphillips thanks for posting this!

topography_geometric = topography_proj + geoid_proj only works if the two grids are co-registered/co-located. If the coordinates don't line up, xarray can't do the operation and wind up with an empty grid.

The way to do this is to interpolate the geoid array onto the same coordinates as the topography array. This could be done with Verde but for grids the easiest way is to use the xarray interpolation methods:

# fill_value used to extrapolate and avoid having NaNs in the grid
geoid_interp = geoid_proj.interp_like(topography_proj, kwargs={"fill_value": None}) 
topography_geometric = topography_proj + geoid_interp

Be sure to plot the geoid_interp

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@geojoeyphillips
Comment options

@leouieda
Comment options

Answer selected by geojoeyphillips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants