Variables | |
color_map = np.array(cm.get_cmap('viridis').colors) | |
colors = np.empty((num_classes, 4), dtype=np.uint) | |
ds = gdal.Open(inname, gdal.GA_ReadOnly) | |
inname = sys.argv[1] | |
max_channel = ds.RasterCount | |
max_val = np.amax(values) | |
int | min_channel = 1 |
min_val = np.amin(values) | |
int | num_classes = max_val - min_val + 1 |
outname = sys.argv[2] | |
png_values = np.zeros((shape[1], shape[2], 4), dtype=np.uint) | |
raster_count = ds.RasterCount | |
shape = values.shape | |
step = int((len(color_map)-1) / (num_classes-1)) | |
values = np.empty((raster_count, y_size, x_size), dtype=np.int) | |
x_size = ds.RasterXSize | |
y_size = ds.RasterYSize | |
scripts.create_png.color_map = np.array(cm.get_cmap('viridis').colors) |
Definition at line 40 of file create_png.py.
scripts.create_png.colors = np.empty((num_classes, 4), dtype=np.uint) |
Definition at line 41 of file create_png.py.
scripts.create_png.ds = gdal.Open(inname, gdal.GA_ReadOnly) |
Definition at line 15 of file create_png.py.
scripts.create_png.inname = sys.argv[1] |
Definition at line 12 of file create_png.py.
scripts.create_png.max_channel = ds.RasterCount |
Definition at line 24 of file create_png.py.
scripts.create_png.max_val = np.amax(values) |
Definition at line 35 of file create_png.py.
int scripts.create_png.min_channel = 1 |
Definition at line 23 of file create_png.py.
scripts.create_png.min_val = np.amin(values) |
Definition at line 34 of file create_png.py.
Definition at line 37 of file create_png.py.
string scripts.create_png.outname = sys.argv[2] |
Definition at line 13 of file create_png.py.
Definition at line 57 of file create_png.py.
scripts.create_png.raster_count = ds.RasterCount |
Definition at line 19 of file create_png.py.
scripts.create_png.shape = values.shape |
Definition at line 56 of file create_png.py.
scripts.create_png.step = int((len(color_map)-1) / (num_classes-1)) |
Definition at line 42 of file create_png.py.
scripts.create_png.values = np.empty((raster_count, y_size, x_size), dtype=np.int) |
Definition at line 26 of file create_png.py.
scripts.create_png.x_size = ds.RasterXSize |
Definition at line 20 of file create_png.py.
scripts.create_png.y_size = ds.RasterYSize |
Definition at line 21 of file create_png.py.