Skip to content

Instantly share code, notes, and snippets.

@spestana
Created October 27, 2021 17:30
Show Gist options
  • Save spestana/2ee5740f4c8bfb5c741fd0187e31af68 to your computer and use it in GitHub Desktop.
Save spestana/2ee5740f4c8bfb5c741fd0187e31af68 to your computer and use it in GitHub Desktop.
Converting UW APL Airborne IR and EO (visible) mosiaic imagery from NetCDF files to GeoTIFFs with rioxarray.
import xarray as xr
import rioxarray
# Open airborne TIR or EO mosaic NetCDF file
ds = xr.open_dataset('SNOWEX2020_EO_PLANE_2020Feb08_mosaicked_2020-02-08T194230.nc')
# Write the coordinate reference system with rioxarray
ds.rio.write_crs('epsg:32612', inplace=True)
# Output to geotiff raster
ds.rio.to_raster('SNOWEX2020_EO_PLANE_2020Feb08_mosaicked_2020-02-08T194230.tif')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment