Created
June 30, 2015 01:23
-
-
Save celoyd/6bd4d3be01489da82d03 to your computer and use it in GitHub Desktop.
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
| #!/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