diff --git a/apps/hurricanemap/README.md b/apps/hurricanemap/README.md deleted file mode 100644 index d3947bd44..000000000 --- a/apps/hurricanemap/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# Hurricane Map for Tronbyt -Displays current global tropical depressions, storms, hurricanes, cyclones, and typhoons. - -Users can customize their preferred basin (see below), colors, and symbols. They can also hide the app if no storms are present in the selected basin. - -![Hurricane Map for Tronbyt](hurricane_map.webp) - -This app supports 2x display:
-![Hurricane Map at 2x for Tronbyt](hurricane_map@2x.webp) - -## Basins -In addition to global maps, users can choose specific basins to display. - -Selection of the bounds for the basins was adapted from [Bloemendaal et al., 2020](https://doi.org/10.1038/s41597-020-0381-2) (Figure 1). The lateral bounds of the boxes were expanded to fit a 2:1 aspect ratio. - -Map of basins - -## Symbols -For this app, the [Saffir-Simpson scale](https://en.wikipedia.org/wiki/Saffir%E2%80%93Simpson_scale) is used to classify storm intensity. - -A storm's intensity dictates which shapes and colors to use, depending on the selected symbol size. Below is a table of how the symbols will appear using their default colors. The center of a storm is always anchored to the center of its symbol. - -| | Large | Medium | Small | -|---------------------|-------|--------|-------| -| Tropical Depression | ![Tropical Depression - Large](images/icon_large_td.png) | ![Tropical Depression - Medium](images/icon_s_m_td.png) | ![Tropical Depression - Small](images/icon_s_m_td.png) | -| Tropical Storm | ![Tropical Storm - Large](images/icon_large_ts.png) | ![Tropical Storm - Medium](images/icon_medium_ts.png) | ![Tropical Storm - Small](images/icon_small_ts.png) | -| Category 1 | ![Category 1 - Large](images/icon_large_cat1.png) | ![Category 1 - Medium](images/icon_medium_cat1.png) | ![Category 1 - Small](images/icon_small_cat1.png) | -| Category 2 | ![Category 2 - Large](images/icon_large_cat2.png) | ![Category 2 - Medium](images/icon_medium_cat2.png) | ![Category 2 - Small](images/icon_small_cat2.png) | -| Category 3 | ![Category 3 - Large](images/icon_large_cat3.png) | ![Category 3 - Medium](images/icon_medium_cat3.png) | ![Category 3 - Small](images/icon_small_cat3.png) | -| Category 4 | ![Category 4 - Large](images/icon_large_cat4.png) | ![Category 4 - Medium](images/icon_medium_cat4.png) | ![Category 4 - Small](images/icon_small_cat4.png) | -| Category 5 | ![Category 5 - Large](images/icon_large_cat5.png) | ![Category 5 - Medium](images/icon_medium_cat5.png) | ![Category 5 - Small](images/icon_small_cat5.png) | - -## Data sources -Storm data is combined from two sources: -- The [National Hurricane Center](http://www.nhc.noaa.gov/), which covers the Northern Atlantic and Eastern Pacific basins. -- The [Joint Typhoon Warning Center](https://www.metoc.navy.mil/jtwc/jtwc.html), which covers all other basins. - -## Attributions -Basin map adapted from "[Tissot indicatrix world map Mercator proj.svg](https://commons.wikimedia.org/wiki/File:Tissot_indicatrix_world_map_Mercator_proj.svg)" by [Eric Gaba](https://commons.wikimedia.org/wiki/User:Sting), licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). Changes: Tissot indicatrix circles removed, cropped to 80°N - 80°S, degree labels and ocean basin boxes added. This adapted map is licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). - -Coastline data © [OpenStreetMap contributors](https://www.openstreetmap.org/copyright), available under the [Open Database License (ODbL) 1.0](https://opendatacommons.org/licenses/odbl/1.0/). - -The data was obtained via the `earth-coastlines` map (10 km resolution) from [geo-maps](https://github.com/simonepri/geo-maps) by Simone Primarosa (code licensed under the MIT License). - -The map pattern arrays in `helper.star` is a derived rasterization of this data (128x64) and is made available under ODbL 1.0. The dynamically generated SVGs are Produced Works based on OpenStreetMap data. \ No newline at end of file diff --git a/apps/hurricanemap/helper.star b/apps/hurricanemap/helper.star deleted file mode 100644 index 4e6b65638..000000000 --- a/apps/hurricanemap/helper.star +++ /dev/null @@ -1,680 +0,0 @@ -MAP_EP = [ - "10000000000000000000000000000000011111111011000000000111111111111111111111111111111111111111110000000000000001111111000011000000", - "10000000000000000000000000000000011111110000000000000011111111111111111111111111111111111111110000000000000001111111100011000000", - "00000000000000000000000000000000000001110000000000000001111111111111111111111111111111111111111000000000000001111111110111000000", - "00000000000000000000000000000000000001100000000000000000101111111111111111111111111111111111111100000000000000111111111111100000", - "10000000000000000000000000000000000011011000000000000000010111111111111111111111111111111111111100000000000000111111111111110000", - "10000000000000000000000000000000000110000000000000000000001111111111111111111111111111111111111111100000000000111111111111110000", - "10000000000000000000000000000000001100000000000000000000000011111111111111111111111111111111111111110000000100111111111111110000", - "00000000000000000000000000000000110000000000000000000000000111111111111111111111111111111111111111111100000000111111111111111000", - "00000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111100011111111111111111100", - "00000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111100011111111111111111110", - "00000000000000000000000000000000000000000000000000000000000100111111111111111111111111111111111111111111100011111111111111111111", - "00000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111100011111111111111111111", - "00000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111110011111111111111111111", - "00000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111011111111111111111111", - "00000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111100", - "00000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111000", - "00000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111000100001", - "00000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111100110000001", - "00000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111110000011", - "00000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111110000000", - "00000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111110000000", - "00000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111101000", - "00000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111001110000", - "00000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111100011000000", - "00000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111000000000000", - "00000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111000000000000", - "00000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111000000000000", - "00000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111100000000000000", - "00000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111110000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111110000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111100000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111100000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111110000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111100000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000110111111111111111111111111111110000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000110111111111111111111111111111110000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000010011111111111111110001000001110000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000001011111111111111000000000000111000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000001101111111111111000000000000011000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000100111111111110000000000000011000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000010011111111110000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000010001111111110000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000001000111111110000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000011111110000000000000111100000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000011111110000000000000000011000000000000000000", - "00000000000000000000000000000000000000100000000000000000000000000000000000000000000011111111000000111000000001110000000000000000", - "00000000000000000000000000000000000001100000000000000000000000000000000000000000000011111111000001110000000000000011000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111110111110000000001000011100000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111110000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111100000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000010000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000001111110000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011101000011111111111110000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111110111111111111111000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111100", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111110", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111", -] - -MAP_G0 = [ - "11100111111111111111111111111111110000110100011111100000011000000000011111110011111111111111111111111111111111111111111111111111", - "00100111111111111111111111111111111011111000001111000000111000000000111101110011111111111111111111111111111111111111111111111111", - "00000011111111111111111111111111010000111000001110000000010000000001111011111111111111111111111111111111111111111111111111111111", - "00000111111111111111111111111110000011000000001110000000000000000011110011111111111111111111111111111111111111111111111111111110", - "00000111111111111111111111111100000011100000000110000000000000000011110011111111111111111111111111111111111111111111111000111000", - "00000011100000111111111111111100000011100000000000000000000000000011111000111111111111111111111111111111111111111111111001000000", - "00000000100000001111111111111110000011111100000000000000000000100000110011111111111111111111111111111111111111111100000011000000", - "00000001000000000111111111111111100001111100000000000000000000100001110011111111111111111111111111111111111111111000000111000000", - "00000000000000000011111111111111110011111110000000000000000001110001000111111111111111111111111111111111111111110000000110000000", - "00000000000000000011111111111111111011111111000000000000000001010011111111111111111111111111111111111111111111111110000110000000", - "00000000000000000001111111111111111011111111000000000000000000011111111111111111111111111111111111111111111111111110000000000000", - "00000000000000000001111111111111111111110001000000000000000000001111111111111111111111111111111111111111111111111100000000000000", - "00000000000000000000111111111111111111111001100000000000000000011111111111111111111111111111111111111111111111111100000000000000", - "00000000000000000000111111111111111111111000000000000000000000001111111111111111110111111111111111111111111111111000000000000000", - "00000000000000000000111111111111111111100000000000000000000000011111101111000011101111111111111111111111111111110010000000000000", - "00000000000000000000111111111111111111100000000000000000000001111000100111000001100111111111111111111111111111000000000000000000", - "00000000000000000000111111111111111111000000000000000000000001110000010101111111110111111111111111111111111111000000000000000000", - "00000000000000000000111111111111111110000000000000000000000001110000000000111111110111111111111111111111110001000100000000000000", - "00000000000000000000011111111111111110000000000000000000000000001111000000000111111111111111111111111111111001001100000000000000", - "00000000000000000000001111111111111100000000000000000000000001111111000000001111111111111111111111111111111000100000000000000000", - "00000000000000000000000111111111111000000000000000000000000001111111110111111111111111111111111111111111111000000000000000000000", - "00000000000000000000000011111100011000000000000000000000000011111111111111111111101111111111111111111111111000000000000000000000", - "00000000000000000000000001111000001000000000000000000000000111111111111111110111110001111111111111111111110000000000000000000000", - "00000000000000000000000000111000000000000000000000000000001111111111111111111011111110000111111111111111100000000000000000000000", - "00000011000000000000000000011100100000000000000000000000001111111111111111111011111110000011111001111100000000000000000000000000", - "00000000000000000000000000001111100000000000000000000000001111111111111111111101111100000011110000111100000000000000000000000000", - "00000000000000000000000000000001110000000000000000000000001111111111111111111101110000000011100000011110000000000000000000000000", - "00000000000000000000000000000000010000000000000000000000001111111111111111111111000000000001000000011110000000000000000000000000", - "00000000000000000000000000000000001101111100000000000000000111111111111111111111110000000001000000000100000000000000000000000000", - "00000000000000000000000000000000000011111110000000000000000011111111111111111111110000000000100000000000000010000000000000000000", - "00000000000000000000000000000000000011111111110000000000000000000001111111111111100000000000000000101000010000000000000000000000", - "00000000000000000000000000000000000011111111110000000000000000000001111111111111000000000000000000011001110000000000000000000000", - "00000000000000000000000000000000000111111111111100000000000000000001111111111110000000000000000000001001110000000000000000000000", - "00000000000000000000000000000000000111111111111111100000000000000000111111111100000000000000000000001100000000001110000000000000", - "00000000000000000000000000000000000011111111111111110000000000000000011111111100000000000000000000000001000000000111000000000000", - "00000000000000000000000000000000000011111111111111100000000000000000011111111100000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000001111111111111000000000000000000011111111100000000000000000000000000000000010000000000000000", - "00000000000000000000000000000000000001111111111111000000000000000000111111111100010000000000000000000000000011111011000000000000", - "00000000000000000000000000000000000000011111111111000000000000000000111111111000110000000000000000000000000111111111000000000000", - "00000000000000000000000000000000000000011111111111000000000000000000011111110000100000000000000000000000001111111111100000000000", - "00000000000000000000000000000000000000011111111100000000000000000000011111111001100000000000000000000000111111111111110000000000", - "00000000000000000000000000000000000000011111111000000000000000000000011111110000000000000000000000000000111111111111110000000000", - "00000000000000000000000000000000000000011111111000000000000000000000001111100000000000000000000000000000011111111111111000000000", - "00000000000000000000000000000000000000011111110000000000000000000000001111100000000000000000000000000000011111111111110000000000", - "00000000000000000000000000000000000000011111100000000000000000000000001111000000000000000000000000000000011100001111110000000000", - "00000000000000000000000000000000000000111111000000000000000000000000000000000000000000000000000000000000000000000111100000000000", - "00000000000000000000000000000000000000111111000000000000000000000000000000000000000000000000000000000000000000000011100000000010", - "00000000000000000000000000000000000000111100000000000000000000000000000000000000000000000000000000000000000000000000000000000010", - "00000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000100000000100", - "00000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000001000", - "00000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", -] - -MAP_G180 = [ - "00000111111100111111111111111111111111111111111111111111111111111110011111111111111111111111111111000011010001111110000001100000", - "00001111011100111111111111111111111111111111111111111111111111110010011111111111111111111111111111101111100000111100000011100000", - "00011110111111111111111111111111111111111111111111111111111111110000001111111111111111111111111101000011100000111000000001000000", - "00111100111111111111111111111111111111111111111111111111111111100000011111111111111111111111111000001100000000111000000000000000", - "00111100111111111111111111111111111111111111111111111110001110000000011111111111111111111111110000001110000000011000000000000000", - "00111110001111111111111111111111111111111111111111111110010000000000001110000011111111111111110000001110000000000000000000000000", - "00001100111111111111111111111111111111111111111111000000110000000000000010000000111111111111111000001111110000000000000000000010", - "00011100111111111111111111111111111111111111111110000001110000000000000100000000011111111111111110000111110000000000000000000010", - "00010001111111111111111111111111111111111111111100000001100000000000000000000000001111111111111111001111111000000000000000000111", - "00111111111111111111111111111111111111111111111111100001100000000000000000000000001111111111111111101111111100000000000000000101", - "11111111111111111111111111111111111111111111111111100000000000000000000000000000000111111111111111101111111100000000000000000001", - "11111111111111111111111111111111111111111111111111000000000000000000000000000000000111111111111111111111000100000000000000000000", - "11111111111111111111111111111111111111111111111111000000000000000000000000000000000011111111111111111111100110000000000000000001", - "11111111111111111101111111111111111111111111111110000000000000000000000000000000000011111111111111111111100000000000000000000000", - "11111011110000111011111111111111111111111111111100100000000000000000000000000000000011111111111111111110000000000000000000000001", - "10001001110000011001111111111111111111111111110000000000000000000000000000000000000011111111111111111110000000000000000000000111", - "00000101011111111101111111111111111111111111110000000000000000000000000000000000000011111111111111111100000000000000000000000111", - "00000000001111111101111111111111111111111100010001000000000000000000000000000000000011111111111111111000000000000000000000000111", - "11110000000001111111111111111111111111111110010011000000000000000000000000000000000001111111111111111000000000000000000000000000", - "11110000000011111111111111111111111111111110001000000000000000000000000000000000000000111111111111110000000000000000000000000111", - "11111101111111111111111111111111111111111110000000000000000000000000000000000000000000011111111111100000000000000000000000000111", - "11111111111111111011111111111111111111111110000000000000000000000000000000000000000000001111110001100000000000000000000000001111", - "11111111111101111100011111111111111111111100000000000000000000000000000000000000000000000111100000100000000000000000000000011111", - "11111111111110111111100001111111111111111000000000000000000000000000000000000000000000000011100000000000000000000000000000111111", - "11111111111110111111100000111110011111000000000000000000000000000000001100000000000000000001110010000000000000000000000000111111", - "11111111111111011111000000111100001111000000000000000000000000000000000000000000000000000000111110000000000000000000000000111111", - "11111111111111011100000000111000000111100000000000000000000000000000000000000000000000000000000111000000000000000000000000111111", - "11111111111111110000000000010000000111100000000000000000000000000000000000000000000000000000000001000000000000000000000000111111", - "11111111111111111100000000010000000001000000000000000000000000000000000000000000000000000000000000110111110000000000000000011111", - "11111111111111111100000000001000000000000000100000000000000000000000000000000000000000000000000000001111111000000000000000001111", - "00011111111111111000000000000000001010000100000000000000000000000000000000000000000000000000000000001111111111000000000000000000", - "00011111111111110000000000000000000110011100000000000000000000000000000000000000000000000000000000001111111111000000000000000000", - "00011111111111100000000000000000000010011100000000000000000000000000000000000000000000000000000000011111111111110000000000000000", - "00001111111111000000000000000000000011000000000011100000000000000000000000000000000000000000000000011111111111111110000000000000", - "00000111111111000000000000000000000000010000000001110000000000000000000000000000000000000000000000001111111111111111000000000000", - "00000111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111110000000000000", - "00000111111111000000000000000000000000000000000100000000000000000000000000000000000000000000000000000111111111111100000000000000", - "00001111111111000100000000000000000000000000111110110000000000000000000000000000000000000000000000000111111111111100000000000000", - "00001111111110001100000000000000000000000001111111110000000000000000000000000000000000000000000000000001111111111100000000000000", - "00000111111100001000000000000000000000000011111111111000000000000000000000000000000000000000000000000001111111111100000000000000", - "00000111111110011000000000000000000000001111111111111100000000000000000000000000000000000000000000000001111111110000000000000000", - "00000111111100000000000000000000000000001111111111111100000000000000000000000000000000000000000000000001111111100000000000000000", - "00000011111000000000000000000000000000000111111111111110000000000000000000000000000000000000000000000001111111100000000000000000", - "00000011111000000000000000000000000000000111111111111100000000000000000000000000000000000000000000000001111111000000000000000000", - "00000011110000000000000000000000000000000111000011111100000000000000000000000000000000000000000000000001111110000000000000000000", - "00000000000000000000000000000000000000000000000001111000000000000000000000000000000000000000000000000011111100000000000000000000", - "00000000000000000000000000000000000000000000000000111000000000100000000000000000000000000000000000000011111100000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000011110000000000000000000000", - "00000000000000000000000000000000000000000000000000001000000001000000000000000000000000000000000000000011100000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000011100000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", -] - -MAP_NA = [ - "11111111111111111111111000000000000000011111110000100000000000000000000000000000000000000000000000000000000000000001111111111100", - "11111111111111111111111000000000000000111111110000110000000000000000000000000000000000000000000000000000000000000001111111111100", - "11111111111111111111111110000000000000111111111001110000000000000000000000000000000000000000000000000000000000000001110011111000", - "11111111111111111111111110000000000000011111111111111000000000000000000000000000000000000000000000000000010000000000000011111000", - "11111111111111111111111110000000000000001111111111111000000000000000000000000000000000000000000000000000111100000000001011110000", - "11111111111111111111111111111000000000001111111111111000000000000000000000000000000000000000000000000000111000000000011001110000", - "11111111111111111111111111111100000001001111111111111000000000000000000000000000000000000000000000000000111000000000011001110000", - "11111111111111111111111111111110000000011111111111111100000000000000000000000000000000000000000000000000011100000000011111000000", - "11111111111111111111111111111111111000111111111111111111000000000000000000000000000000000000000000000011011100000000010000000000", - "11111111111111111111111111111111111001111111111111111111100000000000000000000000000000000000000000000111001110000000011001001111", - "11111111111111111111111111111111111000111111111111111111110000000000000000000000000000000000000000001111000110000000011111111111", - "11111111111111111111111111111111111000111111111111111111111000000000000000000000000000000000000000000111001111000011111111111111", - "11111111111111111111111111111111111000111111111111111111111000000000000000000000000000000000000000000110001111100111111111111111", - "11111111111111111111111111111111111100111111111111111111110000000000000000000000000000000000000000001100011111000111111111111111", - "11111111111111111111111111111111111111111111111111111111001000000000000000000000000000000000000000000000011111011111111111111111", - "11111111111111111111111111111111111111111111111111111110010000000000000000000000000000000000000000000000000000011111111111111111", - "11111111111111111111111111111111111111111111111100001000011000000000000000000000000000000000000000000000000000111111111111111111", - "11111111111111111111111111111111111111111111111011100000111110000000000000000000000000000000000000000000000011111111111111111111", - "11111111111111111111111111111111111111111111111111000000111110000000000000000000000000000000000000000000011111111111111111111111", - "11111111111111111111111111111111111111111111111111000000000110000000000000000000000000000000000000000000000111111111111111111111", - "11111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000011111111111111111111", - "11111111111111111111111111111111111111111111111111110110000000000000000000000000000000000000000000000000000011111111111111111111", - "11111111111111111111111111111111111111111111111110111000000000000000000000000000000000000000000000000000000011111111111110111111", - "11111111111111111111111111111111111111111111111001100000000000000000000000000000000000000000000000000000000011111111111110011111", - "11111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000011100011111111000111001111", - "11111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000111111111110000000111000011", - "11111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000111111111110000010011110001", - "11111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000011111111100000000000111001", - "11111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000111111111000000010000011101", - "11111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000111111110000000010000001000", - "11111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000111111110000000000000000000", - "11111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000111111110000000000001100000", - "11111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000001111000000101111000000000", - "11111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000001111111111000000000", - "11111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000111111111111111000000000", - "01111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000001111111111111111000000000", - "00011111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000011111111111111111100000000", - "00011111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000111111111111111111111100000", - "00001011111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000111111111111111111111110000", - "00001001111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111", - "00000101111111111111111000010000011100000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111", - "00000110111111111111110000000000011100000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111", - "00000110011111111111100000000000001110000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111", - "00000001001111111111100000000000000110000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111", - "00000001001111111111100000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111", - "00000000100011111111100000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111", - "00000000010011111111100000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111", - "00000000000001111111100000000000010110000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111", - "00000000000000111111100000000100000000100000000000000000000000000000000000000000000000000000001111111111111111111111111111111111", - "00000000000000111111100000011100000000011000000000000000000000000000000000000000000000000000001111111111111111111111111111111111", - "00000000000000111111110000011100000000000001110000000000000000000000000000000000000000000000000111111111111111111111111111111111", - "00000000000000011111111001111100000000000001111000000000000000000000000000000000000000000000000111111111111111111111111111111111", - "00000000000000000111111111111000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111", - "00000000000000000000111111111000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111", - "00000000000000000000000001111111100000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111", - "00000000000000000000000000111111110000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111", - "00000000000000000000000000000011110000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111", - "00000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111", - "00000000000000000000000000000001100000000111111000000000000000000000000000000000000000000000000011111111111111111111111111111111", - "00000000000000000000000000000000110010000111111111111100000000000000000000000000000000000000000001111111111111111111111111111111", - "00000000000000000000000000000000011111101111111111111100000000000000000000000000000000000000000001111111111111111111111111111111", - "00000000000000000000000000000000000000111111111111111111000000000000000000000000000000000000000000111111111111111111111111111111", - "00000000000000000000000000000000000000011111111111111111100000000000000000000000000000000000000000011111111111111111111111111111", - "00000000000000000000000000000000000000011111111111111111111110000000000000000000000000000000000000000111111110000011111111111111", -] - -MAP_NI = [ - "00000000001111111111110000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "00000000001111011111100000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "00000000001110011111000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "11000000000000001111000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "11100000000000001111000001011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "11100000000001001111000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "11000000000011101110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "01100000000011010100000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "01110000000001010000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "00111000000001001000110111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "00111000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "01111000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "01111100011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "01111100111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "01111101111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "00000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "00000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "00011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "01111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "00011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "00011111111111111111111111111111111111001111111111100111111111111111111111111111111111111111111111111111111111111111111111111111", - "00001111111111111111111111111111000110011111111110000111111111111111111111111111111111111111111111111111111111111111111111111111", - "00001111111111110011111111111111000110011111111100001111111111111111111111111111111111111111111111111111111111111111111111111111", - "00001111111111110001111111111110000000001111111100011111111111111111111111111111111111111111111111111111111111111111111111111111", - "00011111111000111000111111111110000000000111111100011111111111111111111111111111111111111111111111111111111111111111111111111111", - "11111111000000011100011111111100000000000011111100001111111111111111111111111111111111111111111111111111111111111111111111110000", - "11111111000001001110001111111100000110000001111110000111111111111111111111111111111111111111111111111111111111111111111111100000", - "11111100000000000111000111111110111111100011111111000111111111111111111111111111111111111111111111111111111111111111111111100000", - "11111000000001000001000111000111111111111111111111000111111111111111111111111111111111111111111111111111111111111100111111000000", - "11111000000001000001000111000111111111111111111111000011111111111111111111111111111111111111111111111111111111111001000110000000", - "11111000000000000001000011100111111111111111111110000011111111111111111111111111111111111111111111111111111111110000000111000000", - "11110000000000001110000011000011111111111111111111000011111111111111111111111111111111111111111111111111111111111000000011000000", - "11100000101111100000000001000011111111111111111111100111111111111111111111111111111111111111111111111111111111111111000011000000", - "00000111111111100000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111100000011100000", - "11111111111111100000000000000000000100111111111111111111111111111111111111111111111111111111111111111111111111111000000011000111", - "11111111111111000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111100000000001110", - "11111111111111100000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111110000000011100", - "11111111111111111110000111000000000001111111111111111111111111111111111111111111111111111111111111111111111111111110000000011000", - "11111111111111111111000111111100110011111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000", - "11111111111111111111110111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000", - "11111111111111111111111111111111111111111111111110011111111111111111111111111111111111111111111111111111111111111111000000000000", - "11111111111111111111111111111111111111111111111110011111111111111111111111111111111111111111111111111111111111111110000000000000", - "11111111111111111111111111111111111101111111111111000111111111111111111111111111111111111111111111111111111111111110000000000000", - "11111111111111111111111111111111111100111111111111000000011111111111111111111111111111111111111111111111111111111100000000000000", - "11111111111111111111111111111111111100111111111111110000001111111111111111111111111111111111111111111111111111111000000000000000", - "11111111111111111111111111111111111110011111111111110001000000000011111111111111111111111111111111111111111111111001000000000000", - "11111111111111111111111111111111111110001111111111111111110000000001111111111111111111111111111111111111111111100010000000000000", - "11111111111111111111111111111111111111001111111111111111111000000000111111111111111111111111111111111111111110000010000000000000", - "11111111111111111111111111111111111111101111111111111111111000000000111111111111111100000111111111111110110000000000000000000000", - "11111111111111111111111111111111111111100111111111111111110000000000000111111111111100000111111111111100000000000000000000000000", - "11111111111111111111111111111111111111100011111111111111100000000000000111111111110000000011111111111000110000000000000000000000", - "11111111111111111111111111111111111111110001111111111111000000000000000111111111100000000001111111111000100000000000000000000000", - "11111111111111111111111111111111111111110001111111111110000000000000000111111111000000000001111111111100000000000011000000000000", - "11111111111111111111111111111111111111111000111111111000000000000000000011111110000000000001001111111110000000000011000000000000", - "11111111111111111111111111111111111111111000111111110000000000000000000011111100000000000000001111111111000000000010000000000000", - "11111111111111111111111111111111111111111110111110000000000000000000000001111100000000000000001111111111000000000001000000000000", - "11111111111111111111111111111111111111111111110000000000000000000000000001111100000000000000001101111111000000000000000000000000", - "11111111111111111111111111111111111111111111000000000000000000000000000001111100000000000000000100111111000000000000001000000000", - "11111111111111111111111111111111111111111111100011100000000000000000000000111000000000000000000000011110000000000000101000000000", - "11111111111111111111111111111111111111111111111111100000000000000000000000111000000000000000001000001100000000000000100000000000", - "11111111111111111111111111111111111111111111111111100000000000000000000000010010000000000000001100000000000000000000001100000000", - "11111111111111111111111111111111111111111111111111000000000000000000000000000110000000000000000100000000000000000000111100000000", - "11111111111111111111111111111111111111111111111111000000000000000000000000000010000000000000000010000000000000010000001000000000", - "11111000001111111111111111111111111111111111111110000000000000000000000000000000000000000000000011000000000000111000000000000000", -] - -MAP_SI = [ - "00000000011111111111111111111111110000000000000000000000000000000000000000000000000000000000010000000000000000000000000000011111", - "00000000001111111111111111111111110000000000000000000000000000000000000000000000000000000000001110000000000000000000000000001111", - "00000000001111111111111111111111110000000000000000000000000000000000000000000000000000000000000011111100000000000000000000001111", - "00000000001111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000011", - "00000000001111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000011100000001", - "00000000001111111111111111111111111000000010000000000000000000000000000000000000000000000000000000000000000000000000111111000001", - "00000000011111111111111111111111111000000011000000000000000000000000000000000000000000000000000000000000000000000100111110000001", - "00000000011111111111111111111111111000000111000000000000000000000000000000000000000000000000000000000000000000001111111111000001", - "00000000011111111111111111111111110000011110000000000000000000000000000000000000000000000000000000000000000000011111111111100011", - "00000000011111111111111111111111100000111110000000000000000000000000000000000000000000000000000000000000000001111111111111111011", - "00000000011111111111111111111110000000111110000000000000000000000000000000000000000000000000000000000000000001111111111111111111", - "00000000001111111111111111111100000000111110000000000000000000000000000000000000000000000000000000000000000011111111111111111111", - "00000000001111111111111111111100000000111100000000000000000000000000000000000000000000000000000000000000011111111111111111111111", - "00000000000111111111111111111100000000111100000000000000000000000000000000000000000000000000000000000001111111111111111111111111", - "00000000000111111111111111111100000001111100000000000000000000000000000000000000000000000000000000000011111111111111111111111111", - "00000000000111111111111111111100000000111000000000000000000000000000000000000000000000000000000000000111111111111111111111111111", - "00000000000111111111111111111100000000111000000000000000000000000000000000000000000000000000000000000111111111111111111111111111", - "00000000000011111111111111110000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111", - "00000000000011111111111111110000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111", - "00000000000011111111111111110000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111", - "00000000000001111111111111100000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111", - "00000000000000111111111111100000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111", - "00000000000000111111111111000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111", - "00000000000000111111111110000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111", - "00000000000000011111111100000000000000000000000000000000000000000000000000000000000000000000000000000001111111111000000011111111", - "00000000000000011111111000000000000000000000000000000000000000000000000000000000000000000000000000000001111111100000000011111111", - "00000000000000011100000000000000000000000000000000000000000000000000000000000000000000000000000000000001111000000000000001011111", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", -] - -MAP_SP = [ - "00000000000000000001111111100110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000001111110110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000001000000000000011100011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000010000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000110000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000011111000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000110111111000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000001111111111000001111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000011111111111110001111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000111111111111111011111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00001111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00001111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "01111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111100000011111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111100000000001111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11000000000000001101111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000001111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000111111111100000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000011111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000011111111000000000000000000000001101000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000100100000000000000000000000001111000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000001110000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000001110000000000000000000000100100000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000110000000000000000000001110000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000110000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000011100000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000001110000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000011110000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000011100000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", -] - -MAP_WP = [ - "11111111111111111111111111111111111111111111111111111111111111111111111111111000000110000000000000000000000000000000011111111011", - "11111111111111111111111111111111111111111111111111111111111111111100000000110000001110000000000000000000000000000000011111110000", - "11111111111111111111111111111111111111111111111111111111111111111000000000000000011100000000000000000000000000000000000001110000", - "11111111111111111111111111111111111111111111111111111111111111111000000000000000111100000000000000000000000000000000000001100000", - "11111111111111111111111111111111111111111111111111111111111111110000000000000001111110000000000000000000000000000000000011001000", - "11111111111111111111111111111111111111111111111111111111111111100000000000000001111110000000000000000000000000000000000110000000", - "11111111111111111111111111111111111111111111111111111111111111000000000000000011111110000000000000000000000000000000001100000000", - "11111111111111111111111111111111111111111111111111111111111110000000000000000011111100000000000000000000000000000000010000000000", - "11111111111111111111111111111111111111111111111111111111111100000000000000000011111100000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111110000000000000000011111000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111111111000000000000011110000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111111111110000000000001100000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111111111110000000000001100000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111111111010000000000001000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111111111010000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111111110011000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111111110011000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111111110010000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111111100010000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111111100010000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111100000010000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111111100000111100000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111111000000001111000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111110000000001000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111110011111100000000001100000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111100100111000000000001100000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111000000111000000000001000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111101000011100000000011000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111100001100000001111000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111110000001100000011111000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111100000001100011111100000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111110000000000111110000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111000000001110000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111000000001000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111111001000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111110001000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111111111111111111111111111111000001000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "11111111111111110000111111111111111011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00011111111111110000011111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000", - "00011111111111000000001111111111100010000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000", - "00011111111110000000001111111111100010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00011111111100000000000111111111110000000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00001111111000000000001101111111111000000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00001111110000000000000000111111111100000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00001111110000000000000000111111111100000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000111110000000000000000111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000111100000000000000000110011111100000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000011100000000000000000100001111000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000011100000000000000000100000110000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000011010000000000000000110000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000011000000000000000010000000000000000000011110000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000011000000000000000001000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000001100000000000011100000000000000000000000000000000000000000000000000000000000000000000000000000000000", -] - -SYMBOL_PATTERNS = { - "small": { - "TD": ["1"], - "TS": ["1"], - "HU": ["1"], - }, - "medium": { - "TD": [ - "000", - "010", - "000", - ], - "TS": [ - "010", - "101", - "010", - ], - "HU": [ - "010", - "111", - "010", - ], - }, - "large": { - "TD": [ - "00100", - "01010", - "10001", - "01010", - "00100", - ], - "TS": [ - "00111", - "01100", - "01010", - "00110", - "11100", - ], - "HU": [ - "00111", - "01100", - "01110", - "00110", - "11100", - ], - }, -} - -STR_TO_NUM = { - # NHC's naming convention only goes up to 49 - "ONE": "1", - "TWO": "2", - "THREE": "3", - "FOUR": "4", - "FIVE": "5", - "SIX": "6", - "SEVEN": "7", - "EIGHT": "8", - "NINE": "9", - "TEN": "10", - "ELEVEN": "11", - "TWELVE": "12", - "THIRTEEN": "13", - "FOURTEEN": "14", - "FIFTEEN": "15", - "SIXTEEN": "16", - "SEVENTEEN": "17", - "EIGHTEEN": "18", - "NINETEEN": "19", - "TWENTY": "20", - "TWENTY-ONE": "21", - "TWENTYONE": "21", - "TWENTY-TWO": "22", - "TWENTYTWO": "22", - "TWENTY-THREE": "23", - "TWENTYTHREE": "23", - "TWENTY-FOUR": "24", - "TWENTYFOUR": "24", - "TWENTY-FIVE": "25", - "TWENTYFIVE": "25", - "TWENTY-SIX": "26", - "TWENTYSIX": "26", - "TWENTY-SEVEN": "27", - "TWENTYSEVEN": "27", - "TWENTY-EIGHT": "28", - "TWENTYEIGHT": "28", - "TWENTY-NINE": "29", - "TWENTYNINE": "29", - "THIRTY": "30", - "THIRTY-ONE": "31", - "THIRTYONE": "31", - "THIRTY-TWO": "32", - "THIRTYTWO": "32", - "THIRTY-THREE": "33", - "THIRTYTHREE": "33", - "THIRTY-FOUR": "34", - "THIRTYFOUR": "34", - "THIRTY-FIVE": "35", - "THIRTYFIVE": "35", - "THIRTY-SIX": "36", - "THIRTYSIX": "36", - "THIRTY-SEVEN": "37", - "THIRTYSEVEN": "37", - "THIRTY-EIGHT": "38", - "THIRTYEIGHT": "38", - "THIRTY-NINE": "39", - "THIRTYNINE": "39", - "FORTY": "40", - "FORTY-ONE": "41", - "FORTYONE": "41", - "FORTY-TWO": "42", - "FORTYTWO": "42", - "FORTY-THREE": "43", - "FORTYTHREE": "43", - "FORTY-FOUR": "44", - "FORTYFOUR": "44", - "FORTY-FIVE": "45", - "FORTYFIVE": "45", - "FORTY-SIX": "46", - "FORTYSIX": "46", - "FORTY-SEVEN": "47", - "FORTYSEVEN": "47", - "FORTY-EIGHT": "48", - "FORTYEIGHT": "48", - "FORTY-NINE": "49", - "FORTYNINE": "49", -} - -map_patterns = struct( - ep = MAP_EP, - g0 = MAP_G0, - g180 = MAP_G180, - na = MAP_NA, - ni = MAP_NI, - si = MAP_SI, - sp = MAP_SP, - wp = MAP_WP, -) - -sym_patterns = struct( - small = SYMBOL_PATTERNS["small"], - medium = SYMBOL_PATTERNS["medium"], - large = SYMBOL_PATTERNS["large"], -) diff --git a/apps/hurricanemap/hurricane_map.star b/apps/hurricanemap/hurricane_map.star deleted file mode 100644 index 7a09d3d2c..000000000 --- a/apps/hurricanemap/hurricane_map.star +++ /dev/null @@ -1,705 +0,0 @@ -""" -App: Hurricane Map -Summary: Show current hurricanes/cyclones -Desc: Displays current tropical depressions, storms, hurricanes, cyclones, and typhoons across the globe. Data from the NHC and JTWC. -Author: frame-shift -""" - -load("encoding/base64.star", "base64") -load("helper.star", "STR_TO_NUM", "map_patterns", "sym_patterns") -load("http.star", "http") -load("math.star", "math") -load("re.star", "re") -load("render.star", "canvas", "render") -load("schema.star", "schema") -load("xpath.star", "xpath") - -# Default settings -DEFAULT_HIDE = True -DEFAULT_NAMES = True -DEFAULT_MAP = "G0" -DEFAULT_SYM_SIZE = "medium" -DEFAULT_COLORS = { - "MAP": "#00436A", - "OCEAN": "#000C13", - "TD": "#6EC1EA", - "TS": "#4DFFFF", - 1: "#FFFFD9", - 2: "#FFD98C", - 3: "#FF9E59", - 4: "#FF738A", - 5: "#A188FC", -} - -# Rendering assists -BLANK_PX = render.Box(width = 1, height = 1, color = "#00000000") -MAP_BOUNDS = { - # These are the edges of each map; top/bottom = lat, left/right = lon - "G0": {"top": 66.5133, "left": -180.0, "bottom": -66.5133, "right": 180.0}, - "G180": {"top": 66.5133, "left": 0.0, "bottom": -66.5133, "right": 360.0}, - "EP": {"top": 60.0, "left": 162.0502, "bottom": 5.0, "right": -57.0502}, - "WP": {"top": 60.0, "left": 69.5502, "bottom": 5.0, "right": -149.5502}, - "SP": {"top": -5.0, "left": 117.0502, "bottom": -60.0, "right": -102.0502}, - "SI": {"top": -5.0, "left": 2.0502, "bottom": -60.0, "right": 142.9498}, - "NI": {"top": 60.0, "left": -5.4498, "bottom": 5.0, "right": 135.4498}, - "NA": {"top": 60.0, "left": -120.4498, "bottom": 5.0, "right": 20.4498}, -} - -# HTTP assists -URL_NHC = "https://www.nhc.noaa.gov/CurrentStorms.json" -URL_JTWC = "https://www.metoc.navy.mil/jtwc/rss/jtwc.rss" -HEADERS = {"Cache-Control": "no-cache", "User-Agent": "Tronbyt/hurricane_map"} -REFRESH_RATE = 3600 # 1 hour (seconds) - -# Text parsing assists -PATTERN_WEBTXT = r"(https?:\/\/[^\s'\"<>]+\d+web\.txt)(.*?)<\/a>" -PATTERN_POS = r"\d{6}Z.+?-+?\sNEAR\s(\d.+?[N|S])\s*?(\d.+?[E|W])" -PATTERN_WIND = r"MAX SUSTAINED WINDS.*?(\d+).*?KT" -PATTERN_NAME = r"SUBJ.+?\d([A-Z])\s\((.+?)\)" -TD_NHC_SUFFIX = ["-E", "-C"] # All possible NHC suffixes for TDs -TD_JTWC_SUFFIX = ["W", "E", "C", "A", "B", "S", "P", "L"] # All possible JTWC suffixes for TDs -NUM_STRS = list(STR_TO_NUM.keys()) - -def main(config): - """Render the selected hurricane map with active storm symbols. - - Args: - config: (config object) App schema containing map, display, and symbol options. - - Returns: - render.Root: (render.Root | None) The rendered hurricane map display, or None if hidden. - """ - map_choice = config.str("map_choice", DEFAULT_MAP) - hide_if_quiet = config.bool("hide_if_quiet", DEFAULT_HIDE) - show_names = config.bool("show_names", DEFAULT_NAMES) - sym_size = config.str("sym_size", DEFAULT_SYM_SIZE) - map_color = config.str("map_color", DEFAULT_COLORS["MAP"]) - ocean_color = config.str("ocean_color", DEFAULT_COLORS["OCEAN"]) - - # Build map and storms - map = build_map(map_choice, map_color) - #storm_data = get_nhc() + get_jtwc() #TK OFF FOR TESTING - - # REMOVE FOR TESTING TK --- - storm_data = [ - {"lat": 12.1, "lon": -161.7, "wind": 30, "name": format_name("Twenty-One-C")}, # Tropical depression (central Pacific) - {"lat": 15.2, "lon": 87.9, "wind": 40, "name": "Mala"}, # Tropical storm (Bay of Bengal) - {"lat": 14.8, "lon": -108.7, "wind": 50, "name": "Linda"}, # Tropical storm (eastern Pacific) - {"lat": 26.3, "lon": -68.5, "wind": 90, "name": "Dennis"}, # Category 2 hurricane (Atlantic) - {"lat": 17.4, "lon": 131.2, "wind": 140, "name": "Dujuan"}, # Category 5 (western Pacific super typhoon) - ] - # TK --- remove above - - if hide_if_quiet and not storm_data: # Hide if no storm data exists - return None - - storms = [build_storm(s["lat"], s["lon"], s["wind"], s["name"], sym_size, map_choice, config) for s in storm_data] - storms = [s for s in storms if s] - - if hide_if_quiet and not storms: # Hide if no storm data in selected basin - return None - - delay = 25 if canvas.is2x() else 50 - - if show_names: - name_banner = make_name_banner([(s["name"], s["intensity"], s["display_lon"]) for s in storms]) - else: - name_banner = BLANK_PX - - return render.Root( - show_full_animation = True, - delay = delay, - child = render.Stack( - # First child is bottom layer; last is top - children = [ - render.Box(color = ocean_color), - map, - render.Stack(children = [s["symbol"] for s in storms]), - name_banner, - ], - ), - ) - -def map_pattern_to_svg(map_choice, color): - """Build a 128x64 SVG map from the selected basin pattern. - - Args: - map_choice: (str) Basin code used to select the map pattern. - color: (str) Color value used for land pixels. - - Returns: - bytes: (bytes) Base64-decoded SVG image data ready for render.Image. - """ - if map_choice == "EP": - map = map_patterns.ep - elif map_choice == "NA": - map = map_patterns.na - elif map_choice == "NI": - map = map_patterns.ni - elif map_choice == "SI": - map = map_patterns.si - elif map_choice == "SP": - map = map_patterns.sp - elif map_choice == "WP": - map = map_patterns.wp - elif map_choice == "G180": - map = map_patterns.g180 - else: - map = map_patterns.g0 - - # Dynamically construct SVG of map using selected map_pattern and color - max_width, max_height = (128, 64) # Max dimensions of map - svg = "" % (max_width, max_height) - for y in range(max_height): - for x in range(max_width): - if x < len(map[y]) and map[y][x] == "1": - svg += "" % (x, y, color) - svg += "" - - return base64.decode(base64.encode(svg)) - -def build_map(map_choice, color): - """Build the selected basin map image. - - Args: - map_choice: (str) Basin code used to select the map pattern. - color: (str) Hexadecimal color for land pixels. - - Returns: - render.Image: (render.Image) The map rendered at the current display scale. - """ - scale = 2 if canvas.is2x() else 1 - - return render.Image( - src = map_pattern_to_svg(map_choice, color), - width = 64 * scale, - height = 32 * scale, - ) - -def calc_intensity(wind): - """Map wind speed to a Saffir-Simpson intensity label. - - Args: - wind: (int) Wind speed in knots. - - Returns: - intensity: (str | int) "TD", "TS", or a Saffir-Simpson category from 1 to 5. - """ - if wind <= 33: # Tropical Depression - return "TD" - elif wind >= 34 and wind <= 63: # Tropical Storm - return "TS" - elif wind >= 64 and wind <= 82: # Cat 1 - return 1 - elif wind >= 83 and wind <= 95: # Cat 2 - return 2 - elif wind >= 96 and wind <= 112: # Cat 3 - return 3 - elif wind >= 113 and wind <= 136: # Cat 4 - return 4 - else: # Cat 5 - return 5 - -def make_name_banner(storms): - """Build a storm name banner sorted by horizontal display position. - - Args: - storms: (list[tuple]) List of (name, intensity, location) tuples. - - Returns: - render.Padding: (render.Padding) A marquee of storm names with intensity labels. - """ - storm_names = [] - for s in storms: - name, intensity, loc = s - if type(intensity) == "int": - intensity = "H" + str(intensity) - storm_names.append((intensity + " " + name, loc)) - - # Sort names from left to right on the display - if len(storm_names) == 1: - names = storm_names[0][0] - else: - sorted_names = sorted(storm_names, key = lambda x: x[1]) - names = [n[0] for n in sorted_names] - names = " ".join(names) - - # Set render attributes based on scale - scale = 2 if canvas.is2x() else 1 - if scale == 2: - box_height = 12 - font = "terminus-14" - pad_top = -2 - else: - box_height = 5 - font = "CG-pixel-4x5-mono" # Use CG-pixel-4x5-mono, CG-pixel-3x5-mono, or tom-thumb - pad_top = 0 - - return render.Padding( - pad = (0, pad_top, 0, 0), - child = render.Stack( - children = [ - render.Box(height = box_height, color = "#000000A0"), - render.Marquee( - width = 64 * scale, - align = "center", - offset_start = int(64 * scale * 0.75), - child = render.Text( - content = names.upper(), - font = font, - color = "#FFFFFFAA", - ), - ), - ], - ), - ) - -def build_symbol(wind, sym_size, config): - """Build a storm symbol for a given wind speed. - - Args: - wind: (int) Wind speed in knots. - sym_size: (str) Symbol size as "small", "medium", or "large". - config: (config object) Configuration used to resolve color definitions. - - Returns: - render.Stack: (render.Stack) Rendered storm symbol. - """ - ss = calc_intensity(wind) - - # Set symbol pattern - if sym_size == "small": - patterns = sym_patterns.small - elif sym_size == "medium": - patterns = sym_patterns.medium - else: - patterns = sym_patterns.large - pattern = patterns["HU"] if type(ss) == "int" else patterns[ss] - pattern_size = len(pattern[0]) - - # Set symbol color - if type(ss) == "int": - color_key = "cat" + str(ss) + "_color" - else: - color_key = ss.lower() + "_color" - color = config.str(color_key, DEFAULT_COLORS[ss]) - - # Build symbol - filled_px = render.Box(width = 1, height = 1, color = color) - built_sym = [] - for row in range(pattern_size): - for col in range(pattern_size): - padding = (col, row, 0, 0) - pixel = filled_px if pattern[row][col] == "1" else BLANK_PX - built_sym.append(render.Padding(child = pixel, pad = padding)) - - return render.Stack(children = built_sym) - -def merc(lat): - """Convert a latitude coordinate to its Mercator projection value. - - Args: - lat: (float) Latitude in degrees. - - Returns: - mercator value: (float) Mercator projection value for the latitude. - """ - return math.log(math.tan(math.pi / 4 + math.radians(lat) / 2)) - -def lat_to_row(lat, lat_top, lat_bottom, height): - """Convert a latitude value to the corresponding map row. - - Args: - lat: (float) Latitude in degrees. - lat_top: (float) Latitude at the top edge of the map. - lat_bottom: (float) Latitude at the bottom edge of the map. - height: (int) Map height in pixels. - - Returns: - row: (int | None) Map row index, or None if the point is off the map. - """ - row = math.floor((merc(lat_top) - merc(lat)) / (merc(lat_top) - merc(lat_bottom)) * height) - - return row if 0 <= row and row < height else None - -def lon_to_col(lon, lon_left, lon_right, width): - """Convert a longitude value to the corresponding map column. - - Args: - lon: (float) Longitude in degrees. - lon_left: (float) Longitude at the left edge of the map. - lon_right: (float) Longitude at the right edge of the map. - width: (int) Map width in pixels. - - Returns: - column: (int | None) Map column index, or None if the point is off the map. - """ - span = (lon_right - lon_left) % 360 or 360 - col = math.floor(((lon - lon_left) % 360) / span * width) - - return col if 0 <= col and col < width else None - -def build_storm(lat, lon, wind, name, sym_size, map_choice, config): - """Build a storm marker and metadata for display on the selected map. - - Args: - lat: (float) Latitude of the storm center in degrees. - lon: (float) Longitude of the storm center in degrees. - wind: (int) Storm wind speed in knots. - name: (str) Storm name to display. - sym_size: (str) Symbol size as "small", "medium", or "large". - map_choice: (str) Name of the map to use. - config: (config object) Configuration used to render the storm symbol. - - Returns: - storm: (dict | None) Storm display metadata and rendered symbol, or None if the storm is off the map. - """ - symbol = build_symbol(wind, sym_size, config) - sym_size = math.sqrt(len(symbol.children)) # Width/height of symbol - pad_adj = int((sym_size - 1) // 2) # Ensures center of symbol at correct location on display - top = MAP_BOUNDS[map_choice]["top"] - bottom = MAP_BOUNDS[map_choice]["bottom"] - left = MAP_BOUNDS[map_choice]["left"] - right = MAP_BOUNDS[map_choice]["right"] - - # Set pixel locations on display - scale = 2 if canvas.is2x() else 1 - display_lat = lat_to_row(lat, top, bottom, 32 * scale) - display_lon = lon_to_col(lon, left, right, 64 * scale) - if not display_lat or not display_lon: # Returns None if storm off the map - return None - - pad_top = display_lat - pad_adj - pad_left = display_lon - pad_adj - storm = render.Padding( - child = symbol, - pad = (pad_left, pad_top, 0, 0), - ) - - return { - "symbol": storm, - "name": name, - "intensity": calc_intensity(wind), - "display_lon": pad_left, - } - -def format_name(name): - """Normalize a storm name for display. - - Args: - name: (str | tuple) Storm name from NHC or JTWC. - - Returns: - name: (str) Storm name formatted for the map. - """ - is_nhc = type(name) == "string" # NHC names always a string; JTWC names always a tuple - - if is_nhc: - # ----- NHC names ----- - name = name.upper() - for suffix in TD_NHC_SUFFIX: # If name ends in suffix, then it is a TD - if name.endswith(suffix): - return STR_TO_NUM[name[:-2]] + suffix[-1] - if name in NUM_STRS: # If name is a number, then it is still TD just with no suffix - return STR_TO_NUM[name] - else: # All other names are non-number - return name - - else: - # ----- JTWC names ----- - j_name = name[0][2].upper() - j_suffix = name[0][1].upper() - if j_name in NUM_STRS: # If name is a number, then it is TD - return STR_TO_NUM[j_name] + j_suffix - else: # For all other non-number storm names - return j_name - -def get_nhc(): - """Fetch active tropical cyclone data from the NHC. - - Returns: - storms: (list[dict] | None) Active storm metadata with name, latitude, longitude, - and wind speed for each storm in the NHC advisory feed. - """ - resp = http.get(url = URL_NHC, headers = HEADERS, ttl_seconds = REFRESH_RATE) - if resp.status_code != 200: - print("NHC request failed with status %s", str(resp.status_code)) - return None - - decoded = resp.json() - if "activeStorms" not in decoded: - return None - - nhc_storms = decoded["activeStorms"] - if len(nhc_storms) == 0: - return None - - storms = [] - for storm in nhc_storms: - storms.append( - { - "name": format_name(storm["name"]), - "lat": storm["latitudeNumeric"], - "lon": storm["longitudeNumeric"], - "wind": int(storm["intensity"]), - }, - ) - - return storms - -def parse_jtwc(url): - """Parse a single JTWC warning page into a normalized storm record. - - Args: - url: (str) URL for a JTWC warning text file. - - Returns: - storm: (dict | None) Parsed storm data with normalized name, latitude, longitude, - and wind speed, or None if the data cannot be parsed. - """ - resp = http.get(url = url, headers = HEADERS, ttl_seconds = REFRESH_RATE) - if resp.status_code != 200: - print("JTWC Warning request failed with status %s", str(resp.status_code)) - return None - - # Extract data - pos = re.match(PATTERN_POS, resp.body()) - winds = re.match(PATTERN_WIND, resp.body()) - name = re.match(PATTERN_NAME, resp.body()) - if not pos or not winds or not name: - return None - - # Parse latitude - lat = pos[0][1] - lat_dir = 1 if lat[-1].upper() == "N" else -1 - lat_float = float(lat.rstrip("NS")) - - # Parse longitude - lon = pos[0][2] - lon_dir = 1 if lon[-1].upper() == "E" else -1 - lon_float = float(lon.rstrip("EW")) - - return { - "name": format_name(name), - "lat": lat_float * lat_dir, - "lon": lon_float * lon_dir, - "wind": int(winds[0][1]), - } - -def get_jtwc(): - """Fetch active tropical cyclone warnings from the JTWC RSS feed. - - Returns: - storms: (list[dict] | None) JTWC storm records for active warnings that are not - already represented by NHC basins. - """ - resp = http.get(url = URL_JTWC, headers = HEADERS, ttl_seconds = REFRESH_RATE) - if resp.status_code != 200: - print("JTWC request failed with status %s", str(resp.status_code)) - return None - - xml = xpath.loads(resp.body()) - xml_storms = xml.query_all("/rss/channel/item/description") - if not xml_storms: - print("JTWC RSS cannot be loaded") - return None - - # Get web.txt URLs for storms; these are official JTWC warnings - storm_urls = [] - for storm in xml_storms: - results = re.match(PATTERN_WEBTXT, storm) - for match in results: - is_warning = re.search("Warning", match[0]) # Ensures only established storms - is_nhc_basin = re.search(r"(ep|cp)\d+?web", match[0]) # Removes storms already covered by NHC - if is_warning and not is_nhc_basin: - storm_urls.append(match[1]) - if not storm_urls: - return None - - # Set storm data from warning URLs - storms = [parse_jtwc(u) for u in storm_urls if storm_urls] - - return storms - -def get_schema(): - """Build the app configuration schema for the hurricane map. - - Returns: - schema.Schema: (schema.Schema) The configurable map UI including basin, symbol style, - and display settings. - """ - map_options = [ - schema.Option( - display = "Global (0° Centered)", - value = "G0", - ), - schema.Option( - display = "Global (180° Centered)", - value = "G180", - ), - schema.Option( - display = "Northern Atlantic", - value = "NA", - ), - schema.Option( - display = "Eastern Pacific", - value = "EP", - ), - schema.Option( - display = "Western Pacific", - value = "WP", - ), - schema.Option( - display = "Southern Pacific", - value = "SP", - ), - schema.Option( - display = "Northern Indian", - value = "NI", - ), - schema.Option( - display = "Southern Indian", - value = "SI", - ), - ] - - sym_size_options = [ - schema.Option( - display = "Small", - value = "small", - ), - schema.Option( - display = "Medium", - value = "medium", - ), - schema.Option( - display = "Large", - value = "large", - ), - ] - - return schema.Schema( - version = "1", - fields = [ - schema.Dropdown( - id = "map_choice", - name = "Basin map", - desc = "Select the hurricane basin to display", - icon = "map", - default = DEFAULT_MAP, - options = map_options, - ), - schema.Toggle( - id = "hide_if_quiet", - name = "Hide if quiet", - desc = "Hide this app if no storms exist in the selected basin", - icon = "eyeSlash", - default = DEFAULT_HIDE, - ), - schema.Toggle( - id = "show_names", - name = "Show names", - desc = "Show the names of displayed storms, sorted from left to right", - icon = "hurricane", - default = DEFAULT_NAMES, - ), - schema.Dropdown( - id = "sym_size", - name = "Symbol size", - desc = "Size of storm symbols", - icon = "maximize", - default = DEFAULT_SYM_SIZE, - options = sym_size_options, - ), - schema.Color( - id = "map_color", - name = "Land color", - desc = "Color of land on the map", - icon = "brush", - default = DEFAULT_COLORS["MAP"], - palette = [ - DEFAULT_COLORS["MAP"], - ], - ), - schema.Color( - id = "ocean_color", - name = "Ocean color", - desc = "Color of oceans on the map", - icon = "brush", - default = DEFAULT_COLORS["OCEAN"], - palette = [ - DEFAULT_COLORS["OCEAN"], - ], - ), - schema.Color( - id = "td_color", - name = "Tropical Depression color", - desc = "Symbol color for Tropical Depressions", - icon = "brush", - default = DEFAULT_COLORS["TD"], - palette = [ - DEFAULT_COLORS["TD"], - ], - ), - schema.Color( - id = "ts_color", - name = "Tropical Storm color", - desc = "Symbol color for Tropical Storms", - icon = "brush", - default = DEFAULT_COLORS["TS"], - palette = [ - DEFAULT_COLORS["TS"], - ], - ), - schema.Color( - id = "cat1_color", - name = "Category 1 color", - desc = "Symbol color for Category 1 storms", - icon = "brush", - default = DEFAULT_COLORS[1], - palette = [ - DEFAULT_COLORS[1], - ], - ), - schema.Color( - id = "cat2_color", - name = "Category 2 color", - desc = "Symbol color for Category 2 storms", - icon = "brush", - default = DEFAULT_COLORS[2], - palette = [ - DEFAULT_COLORS[2], - ], - ), - schema.Color( - id = "cat3_color", - name = "Category 3 color", - desc = "Symbol color for Category 3 storms", - icon = "brush", - default = DEFAULT_COLORS[3], - palette = [ - DEFAULT_COLORS[3], - ], - ), - schema.Color( - id = "cat4_color", - name = "Category 4 color", - desc = "Symbol color for Category 4 storms", - icon = "brush", - default = DEFAULT_COLORS[4], - palette = [ - DEFAULT_COLORS[4], - ], - ), - schema.Color( - id = "cat5_color", - name = "Category 5 color", - desc = "Symbol color for Category 5 storms", - icon = "brush", - default = DEFAULT_COLORS[5], - palette = [ - DEFAULT_COLORS[5], - ], - ), - ], - ) diff --git a/apps/hurricanemap/hurricane_map.webp b/apps/hurricanemap/hurricane_map.webp deleted file mode 100644 index a592d2804..000000000 Binary files a/apps/hurricanemap/hurricane_map.webp and /dev/null differ diff --git a/apps/hurricanemap/hurricane_map@2x.webp b/apps/hurricanemap/hurricane_map@2x.webp deleted file mode 100644 index 9c26315b9..000000000 Binary files a/apps/hurricanemap/hurricane_map@2x.webp and /dev/null differ diff --git a/apps/hurricanemap/images/icon_large_cat1.png b/apps/hurricanemap/images/icon_large_cat1.png deleted file mode 100644 index 541d5b858..000000000 Binary files a/apps/hurricanemap/images/icon_large_cat1.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_large_cat2.png b/apps/hurricanemap/images/icon_large_cat2.png deleted file mode 100644 index 3c7acc2c9..000000000 Binary files a/apps/hurricanemap/images/icon_large_cat2.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_large_cat3.png b/apps/hurricanemap/images/icon_large_cat3.png deleted file mode 100644 index 41e8007cb..000000000 Binary files a/apps/hurricanemap/images/icon_large_cat3.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_large_cat4.png b/apps/hurricanemap/images/icon_large_cat4.png deleted file mode 100644 index 800a3025c..000000000 Binary files a/apps/hurricanemap/images/icon_large_cat4.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_large_cat5.png b/apps/hurricanemap/images/icon_large_cat5.png deleted file mode 100644 index 701cc0cfd..000000000 Binary files a/apps/hurricanemap/images/icon_large_cat5.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_large_td.png b/apps/hurricanemap/images/icon_large_td.png deleted file mode 100644 index a447ccd8f..000000000 Binary files a/apps/hurricanemap/images/icon_large_td.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_large_ts.png b/apps/hurricanemap/images/icon_large_ts.png deleted file mode 100644 index f7c455829..000000000 Binary files a/apps/hurricanemap/images/icon_large_ts.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_medium_cat1.png b/apps/hurricanemap/images/icon_medium_cat1.png deleted file mode 100644 index 46ea3a892..000000000 Binary files a/apps/hurricanemap/images/icon_medium_cat1.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_medium_cat2.png b/apps/hurricanemap/images/icon_medium_cat2.png deleted file mode 100644 index 6bc686054..000000000 Binary files a/apps/hurricanemap/images/icon_medium_cat2.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_medium_cat3.png b/apps/hurricanemap/images/icon_medium_cat3.png deleted file mode 100644 index 7ab238c16..000000000 Binary files a/apps/hurricanemap/images/icon_medium_cat3.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_medium_cat4.png b/apps/hurricanemap/images/icon_medium_cat4.png deleted file mode 100644 index 3c7dd70a7..000000000 Binary files a/apps/hurricanemap/images/icon_medium_cat4.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_medium_cat5.png b/apps/hurricanemap/images/icon_medium_cat5.png deleted file mode 100644 index b678dd98a..000000000 Binary files a/apps/hurricanemap/images/icon_medium_cat5.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_medium_ts.png b/apps/hurricanemap/images/icon_medium_ts.png deleted file mode 100644 index 85c43eaf3..000000000 Binary files a/apps/hurricanemap/images/icon_medium_ts.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_s_m_td.png b/apps/hurricanemap/images/icon_s_m_td.png deleted file mode 100644 index 6e3672279..000000000 Binary files a/apps/hurricanemap/images/icon_s_m_td.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_small_cat1.png b/apps/hurricanemap/images/icon_small_cat1.png deleted file mode 100644 index f7b10f970..000000000 Binary files a/apps/hurricanemap/images/icon_small_cat1.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_small_cat2.png b/apps/hurricanemap/images/icon_small_cat2.png deleted file mode 100644 index 92b1e9fbc..000000000 Binary files a/apps/hurricanemap/images/icon_small_cat2.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_small_cat3.png b/apps/hurricanemap/images/icon_small_cat3.png deleted file mode 100644 index c122db722..000000000 Binary files a/apps/hurricanemap/images/icon_small_cat3.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_small_cat4.png b/apps/hurricanemap/images/icon_small_cat4.png deleted file mode 100644 index 72724bdac..000000000 Binary files a/apps/hurricanemap/images/icon_small_cat4.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_small_cat5.png b/apps/hurricanemap/images/icon_small_cat5.png deleted file mode 100644 index c94c36a6e..000000000 Binary files a/apps/hurricanemap/images/icon_small_cat5.png and /dev/null differ diff --git a/apps/hurricanemap/images/icon_small_ts.png b/apps/hurricanemap/images/icon_small_ts.png deleted file mode 100644 index d3a4d7d90..000000000 Binary files a/apps/hurricanemap/images/icon_small_ts.png and /dev/null differ diff --git a/apps/hurricanemap/images/map_basins.svg b/apps/hurricanemap/images/map_basins.svg deleted file mode 100644 index 86c15dabc..000000000 --- a/apps/hurricanemap/images/map_basins.svg +++ /dev/null @@ -1,943 +0,0 @@ - - - - - - image/svg+xml - - - World map in a Mercator projection - - - Eric Gaba (user Sting) for Wikipedia - - - U.S. NGDC World Coast Line data - World map in a Mercator projection showing Tissot's indicatrix of deformation -Central meridian : 0° -Origin latitude : 0° -Cropped at 85° of latitude -Scale : 1:5,000,000 - 09/2008 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -162.05°E -57.05°W -69.55°E -149.55°W -117.05°E -102.05°W -2.05°E -142.95°E -5.45°W -135.45°E -120.45°W -20.45°E - -EasternPacific - -WesternPacific - -SouthernPacific - -SouthernIndian - -NorthernIndian - -NorthernAtlantic - - - - - - - - - - -180° -180° -170°W -170°W -160°W -160°W -150°W -150°W -140°W -140°W -130°W -130°W -120°W -120°W -110°W -110°W -100°W -100°W -90°W -90°W -80°W -80°W -70°W -70°W -60°W -60°W -50°W -50°W -40°W -40°W -30°W -30°W -20°W -20°W -10°W -10°W -0° -0° -10°E -10°E -20°E -20°E -30°E -30°E -40°E -40°E -50°E -50°E -60°E -60°E -70°E -70°E -80°E -80°E -90°E -90°E -100°E -100°E -110°E -110°E -120°E -120°E -130°E -130°E -140°E -140°E -150°E -150°E -160°E -160°E -170°E -170°E -180° -180° -80°S -80°S -70°S -70°S -60°S -60°S -50°S -50°S -40°S -40°S -30°S -30°S -20°S -20°S -10°S -10°S -0° -0° -10°N -10°N -20°N -20°N -30°N -30°N -40°N -40°N -50°N -50°N -60°N -60°N -70°N -70°N -80°N -80°N - - diff --git a/apps/hurricanemap/manifest.yaml b/apps/hurricanemap/manifest.yaml deleted file mode 100644 index 5e92f3dec..000000000 --- a/apps/hurricanemap/manifest.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -id: hurricane-map -name: Hurricane Map -summary: Show current hurricanes/cyclones -desc: Displays current tropical depressions, storms, hurricanes, cyclones, and typhoons across the globe. Data from the NHC and JTWC. -author: frame-shift -fileName: hurricane_map.star -packageName: hurricanemap -recommendedInterval: 60 -supports2x: true -published: '2026-10-02T07:49:03Z' -updated: '2026-10-02T17:46:33Z' -category: weather -tags: - - weather - - hurricanes - - storms - - maps - - tropical - - wide 2x support