From b95f3fd9d93d922d5ae2b695a2cbbdc1392ce3b9 Mon Sep 17 00:00:00 2001 From: Saadiq Mohiuddin <34844565+smohiudd@users.noreply.github.com> Date: Wed, 4 Dec 2024 12:09:57 -0700 Subject: [PATCH] feat(release): Add cmap for tornado datasets (#448) --- raster_api/runtime/src/cmap_data/README.md | 25 ++++++++++++++++++ .../src/cmap_data/tornado_ef_scale.npy | Bin 0 -> 1152 bytes 2 files changed, 25 insertions(+) create mode 100644 raster_api/runtime/src/cmap_data/tornado_ef_scale.npy diff --git a/raster_api/runtime/src/cmap_data/README.md b/raster_api/runtime/src/cmap_data/README.md index 1a489350..1ad7b09e 100644 --- a/raster_api/runtime/src/cmap_data/README.md +++ b/raster_api/runtime/src/cmap_data/README.md @@ -109,4 +109,29 @@ for k in texture_categories.keys(): cmap[int(k)] = np.array(parse_color(texture_categories[k])) np.save("soil_texture.npy", cmap) +``` + +##### Tornadoes colormap + +```python +from rio_tiler.colormap import parse_color +import numpy as np + +# Colormap for Enhanced Fujita (EF) scale ratings +tornado_ef_scale = { + "0": "#add8e6", #EF0 + "1": "#90ee90", #EF1 + "2": "#ffe71f", #EF2 + "3": "#ffa500", #EF3 + "4": "#ff0000", #EF4 + "5": "#ff00ff", #EF5 + "6": "#b3bcc9", #EFU +} + +cmap = np.zeros((256, 4), dtype=np.uint8) +cmap[:] = np.array([0, 0, 0, 255]) +for k in tornado_ef_scale.keys(): + cmap[int(k)] = np.array(parse_color(tornado_ef_scale[k])) + +np.save("tornado_ef_scale.npy", cmap) ``` \ No newline at end of file diff --git a/raster_api/runtime/src/cmap_data/tornado_ef_scale.npy b/raster_api/runtime/src/cmap_data/tornado_ef_scale.npy new file mode 100644 index 0000000000000000000000000000000000000000..f91528143491a9fe4c92d2a08d4bbba1cd91a032 GIT binary patch literal 1152 zcmbR27wQ`j$;eQ~P_3SlTAW;@Zl$1JQ);NLqoAIaUsO_*m=~X4l#&V(cT3DEP6dh= zXCxM+0{I$7re-<{CYm}5wF+bcuC+Iw{h#n|!vFuz<^TU*%JBa`0|@{Bzj@C|Ad_Jf NkA}f$8W_fD008jUC`teT literal 0 HcmV?d00001