Created
March 31, 2020 20:46
-
-
Save celoyd/e999af52aaf99736f9b89929b1e1f7ec 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
import himawari.HimawariScene as hsd | |
from sys import argv | |
import rasterio as rio | |
import numpy as np | |
scaleup = 64 | |
scene = hsd.HimawariScene(argv[1]) | |
rad = scene.radiances() | |
rad[rad.mask] = 0 | |
rad = np.clip(rad.data, 0, 65535/scaleup) | |
rad = (rad * scaleup).astype(np.uint16) | |
meta = { | |
'driver': 'GTiff', | |
'count': 1, | |
'height': rad.shape[0], | |
'width': rad.shape[1], | |
'dtype': np.uint16, | |
'compress': 'LZW' | |
} | |
with rio.open(argv[2], 'w', **meta) as dst: | |
dst.write(rad, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment