Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dst_crs = ... | |
nbands, height, width = data.shape | |
dst_transform, width, height = rasterio.warp.calculate_default_transform( | |
src_crs=src_crs, | |
dst_crs=dst_crs, | |
width=width, height=height, | |
resolution=resolution, | |
**bounds) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stack_band_files(infiles, outfile, creation_options={}): | |
"""Stack single-band files into one | |
Parameters | |
---------- | |
infiles : list of str | |
paths to input files | |
outfile : str | |
path to output file | |
creation_options : dict |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_resize_event_function(ax, cbar_ax): | |
""" | |
Returns a function to automatically resize the colorbar | |
for cartopy plots | |
Parameters | |
---------- | |
ax : axis | |
cbar_ax : colorbar axis | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.spatial import cKDTree as KDTree | |
import xarray as xr | |
def grid_to_points(grid, points, coord_names): | |
"""Index a gridded dataset with a Pandas DataFrame of station coordinates | |
grid : xr.Dataset or xr.DataArray | |
gridded source data | |
points : pd.Dataframe |