def test_hef_default_spline(): grid = mercator_grid(center_ll=(10.76, 46.798444), extent=(10000, 7000)) c = Map(grid, countries=False) c.set_lonlat_contours(interval=0) c.set_shapefile(get_demo_file('Hintereisferner_UTM.shp')) c.set_topography(get_demo_file('hef_srtm.tif')) fig, ax = plt.subplots(1, 1) c.visualize(ax=ax, addcbar=False, title='Default: spline deg 3') plt.tight_layout() return fig
def test_hef_from_array(): grid = mercator_grid(center_ll=(10.76, 46.798444), extent=(10000, 7000)) c = Map(grid, countries=False) c.set_lonlat_contours(interval=0) c.set_shapefile(get_demo_file('Hintereisferner_UTM.shp')) dem = GeoTiff(get_demo_file('hef_srtm.tif')) mytopo = dem.get_vardata() c.set_topography(mytopo, crs=dem.grid, interp='spline') fig, ax = plt.subplots(1, 1) c.visualize(ax=ax, addcbar=False, title='From array') plt.tight_layout() return fig
def test_hef_topo_withnan(): grid = mercator_grid(center_ll=(10.76, 46.798444), extent=(10000, 7000)) c = Map(grid, countries=False) c.set_lonlat_contours(interval=10) c.set_shapefile(get_demo_file('Hintereisferner_UTM.shp')) dem = GeoTiff(get_demo_file('hef_srtm.tif')) mytopo = dem.get_vardata() h = c.set_topography(mytopo, crs=dem.grid, interp='spline') c.set_lonlat_contours() c.set_cmap(get_cmap('topo')) c.set_plot_params(nlevels=256) # Try with nan data h[-100:, -100:] = np.NaN c.set_data(h) fig, ax = plt.subplots(1, 1) c.visualize(ax=ax, title='color with NaN') plt.tight_layout() return fig