Skip to content

Commit

Permalink
feat(release): Add cmap for tornado datasets (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
smohiudd authored Dec 4, 2024
1 parent 1d2d8fd commit b95f3fd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions raster_api/runtime/src/cmap_data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
Binary file not shown.

0 comments on commit b95f3fd

Please sign in to comment.