Skip to content

Instantly share code, notes, and snippets.

View j08lue's full-sized avatar

Jonas j08lue

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j08lue
j08lue / fiona-transform-crs-issue.ipynb
Last active May 29, 2018 20:30
Fiona issue with transform_geom and rasterio CRS
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j08lue
j08lue / xr-decode-times-roundoff.ipynb
Created January 25, 2018 12:48
xarray 0.10.0 time decoding round-off error
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j08lue
j08lue / llc-windows.ipynb
Created October 26, 2017 05:58
LLC fmin example fails on Windows
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j08lue
j08lue / rasterio_reproject.py
Created October 5, 2017 12:21
rasterio reproject array to array and write to disk
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)
@j08lue
j08lue / array_resample_py2_fails.ipynb
Created June 20, 2017 09:43
Rasterio array resampling in Python 2 - fails
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j08lue
j08lue / stack_band_files.py
Created May 1, 2017 12:36
Stack band files with rasterio
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
@j08lue
j08lue / netcdf-missing-value-int-variables-1-scipy.ipynb
Last active April 28, 2016 10:57
assigning data with missing values to int-type netCDF variables with scipy and netCDF4
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j08lue
j08lue / scipy-netcdf-nan-integers.ipynb
Last active April 25, 2016 11:06
scipy io netcdf issue with NaN written to integer variable
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j08lue
j08lue / resize_colorbar.py
Created April 4, 2016 11:22
Cartopy resize colorbar
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