Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example with ETOPO online dataset #836

Closed
veenstrajelmer opened this issue May 3, 2024 · 0 comments · Fixed by #845
Closed

Add example with ETOPO online dataset #836

veenstrajelmer opened this issue May 3, 2024 · 0 comments · Fixed by #845

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented May 3, 2024

ETOPO 2022 30arcseconds is available via opendap (use surface, not bedlevel). There is also a 15 arcsecond dataset, but this is split up in multiple files.

import xarray as xr
import dfm_tools as dfmt

lon_min, lon_max, lat_min, lat_max = -75, -70.9, 39, 43
file_nc = r"https://www.ngdc.noaa.gov/thredds/dodsC/global/ETOPO2022/30s/30s_bed_elev_netcdf/ETOPO_2022_v1_30s_N90W180_bed.nc"

data_bathy = xr.open_dataset(file_nc)
data_bathy_sel = data_bathy.sel(lon=slice(lon_min-1, lon_max+1), lat=slice(lat_min-1, lat_max+1))

data_bathy_sel.z.plot(robust=True)
dfmt.plot_coastlines()

Gives:
image

The data is also available on p:\metocean-data\open\ETOPO\2022\15s_surface_elev_netcdf. To auto-concat all datasets, use ds = xr.open_mfdataset(nc_files, combine='by_coords')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant