Skip to content

Instantly share code, notes, and snippets.

@celoyd
Created June 30, 2015 01:23
Show Gist options
  • Select an option

  • Save celoyd/6bd4d3be01489da82d03 to your computer and use it in GitHub Desktop.

Select an option

Save celoyd/6bd4d3be01489da82d03 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import rasterio as rio
import numpy as np
import sys
with rio.open(sys.argv[1], 'r') as src:
meta = src.meta
cplx = src.read(1)
meta.update(
count=1,
dtype=np.float64
)
real = cplx.real
with rio.open(sys.argv[2], 'w', **meta) as dst:
dst.write(1, real)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment