Created
October 27, 2021 17:30
-
-
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.
This file contains 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 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