blaylockbk / Carpenter_Workshop

Brian's python workshop, where he keeps his tools, paint, and anything else useful.
https://blaylockbk.github.io/Carpenter_Workshop/
BSD 3-Clause "New" or "Revised" License
37 stars 7 forks source link

Plot terrain and bathymetry #1

Closed blaylockbk closed 3 years ago

blaylockbk commented 3 years ago

I have always wanted to implement a way to plot terrain and bathymetry data.

This tweet reminded I still want to do this: https://twitter.com/DanJonesOcean/status/1448597935508369411?s=20

I could implement the example from here: https://github.com/mattphysics/plot_bathymetry/blob/master/plot_bathymetry.ipynb

Any better methods and data sources for adding Bathymetry? Could get data from:

blaylockbk commented 3 years ago
from toolbox.cartopy_tools import common_features
ax = common_features('50m', dpi=200).BATHYMETRY(10, kind='contourf').TERRAIN(10, kind='contourf').ax

image

ax = common_features('50m', dpi=200).BATHYMETRY(10, kind='contourf').TERRAIN(10, kind='contourf', cmap='Greys').ax

image

# Full resolution
# This took a long time to run (>2 mins)
ax = common_features('10m', dpi=200).BATHYMETRY(1).TERRAIN(1, cmap='Greys').ax
ax.center_extent(state="CA", pad=5)

image (Issue: notice that some areas that are "land" below 0 are shaded blue. Unfortunately the ETOPO1 dataset does not have a land mask.)

blaylockbk commented 3 years ago

The performance could be improved. This is not very good to use when you need to transform the data to a projection that is not PlateCarree (especially if you use fine resolution).

Perhaps I could do a set_extent method, get the map limits, trim off the data not used in the frame, and then plot TERRAIN and BATHYMETRY.