diff --git a/Folium-Basic.ipynb b/Folium-Basic.ipynb
index e1cde22..26b6f8c 100644
--- a/Folium-Basic.ipynb
+++ b/Folium-Basic.ipynb
@@ -9,6 +9,7 @@
"import folium\n",
"import matplotlib\n",
"import numpy as np\n",
+ "import branca\n",
"from matplotlib.pyplot import imread\n",
"from matplotlib.colors import Normalize\n",
"from matplotlib.colors import ListedColormap\n",
@@ -111,43 +112,89 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
- "# Choose colormap\n",
- "cmap = matplotlib.cm.cool\n",
+ "# # Choose colormap\n",
+ "# cmap = matplotlib.cm.cool\n",
"\n",
- "# Get the colormap colors\n",
- "my_cmap = cmap(np.arange(cmap.N))\n",
+ "# # Get the colormap colors\n",
+ "# my_cmap = cmap(np.arange(cmap.N))\n",
"\n",
"\n",
- "# Set alpha\n",
- "my_cmap[:,-1] = np.linspace(0, 1, cmap.N)\n",
+ "# # Set alpha\n",
+ "# my_cmap[:,-1] = np.linspace(0, 1, cmap.N)\n",
"\n",
- "# Create new colormap\n",
- "my_cmap = ListedColormap(my_cmap)"
+ "# # Create new colormap\n",
+ "# my_cmap = ListedColormap(my_cmap)"
]
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": 5,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# # Choose colormap\n",
+ "# cmap = matplotlib.cm.cool\n",
+ "\n",
+ "# min_x = 0\n",
+ "# max_x = 256\n",
+ "\n",
+ "# def my_cmap(x):\n",
+ "# x = np.clip((x - min_x)/(max_x - min_x), 0, 1)\n",
+ "# c = cmap(x)\n",
+ "# # multiplying alpha by 10 to make a sharper transition to the colors in the lower range\n",
+ "# return c[:3] + (np.clip(x*10, 0, 1),) "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "colormap = branca.colormap.StepColormap(\n",
+ " ['#64abb0','#9dd3a7', '#c7e9ad', '#edf8b9', '#ffedaa', '#fec980', '#f99e59', '#e85b3a', '#d7191c'],\n",
+ " vmin=0, vmax=10000,\n",
+ " index=[0, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000],\n",
+ " caption='step'\n",
+ ")\n",
+ "\n",
+ "my_cmap = colormap\n",
+ "\n",
+ "# # Get the colormap colors\n",
+ "# my_cmap = colormap(np.arange(colormap.N))\n",
+ "\n",
+ "\n",
+ "# # Set alpha\n",
+ "# my_cmap[:,-1] = np.linspace(0, 1, colormap.N)\n",
+ "\n",
+ "# # Create new colormap\n",
+ "# my_cmap = ListedColormap(my_cmap)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
"metadata": {
"scrolled": false
},
"outputs": [
{
- "data": {
- "text/html": [
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "execution_count": 14,
- "metadata": {},
- "output_type": "execute_result"
+ "ename": "IndexError",
+ "evalue": "tuple index out of range",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mIndexError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 15\u001b[0m \u001b[0;34m,\u001b[0m \u001b[0mbounds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mext\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mext\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 16\u001b[0m \u001b[0;34m,\u001b[0m \u001b[0mmercator_project\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 17\u001b[0;31m \u001b[0;34m,\u001b[0m \u001b[0mcolormap\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmy_cmap\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 18\u001b[0m )\n\u001b[1;32m 19\u001b[0m )\n",
+ "\u001b[0;32m/usr/local/lib/python3.5/dist-packages/folium/raster_layers.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, image, bounds, origin, colormap, mercator_project, pixelated, name, overlay, control, show, **kwargs)\u001b[0m\n\u001b[1;32m 274\u001b[0m origin=origin)\n\u001b[1;32m 275\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 276\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0murl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mimage_to_url\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0morigin\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0morigin\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcolormap\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcolormap\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 277\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 278\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbounds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mjson\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloads\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mjson\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdumps\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbounds\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.5/dist-packages/folium/utilities.py\u001b[0m in \u001b[0;36mimage_to_url\u001b[0;34m(image, colormap, origin)\u001b[0m\n\u001b[1;32m 109\u001b[0m \u001b[0murl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'data:image/{};base64,{}'\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfileformat\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mb64encoded\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 110\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0;34m'ndarray'\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mimage\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__name__\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 111\u001b[0;31m \u001b[0mimg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mwrite_png\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0morigin\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0morigin\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcolormap\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcolormap\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 112\u001b[0m \u001b[0mb64encoded\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mbase64\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mb64encode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdecode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'utf-8'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 113\u001b[0m \u001b[0murl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'data:image/png;base64,{}'\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb64encoded\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.5/dist-packages/folium/utilities.py\u001b[0m in \u001b[0;36mwrite_png\u001b[0;34m(data, origin, colormap)\u001b[0m\n\u001b[1;32m 172\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mnblayers\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 173\u001b[0m \u001b[0marr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmap\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcolormap\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0marr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mravel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 174\u001b[0;31m \u001b[0mnblayers\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0marr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 175\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mnblayers\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32min\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m4\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 176\u001b[0m raise ValueError('colormap must provide colors of r'\n",
+ "\u001b[0;31mIndexError\u001b[0m: tuple index out of range"
+ ]
}
],
"source": [
@@ -171,19 +218,6 @@
")\n",
" )\n",
"\n",
- "\n",
- "folium.Marker(\n",
- " ext[2]\n",
- " , popup = str(ext[2])\n",
- " , tooltip = str(ext[2])\n",
- ").add_to(m)\n",
- "\n",
- "folium.Marker(\n",
- " ext[0]\n",
- " , popup = str(ext[0])\n",
- " , tooltip = str(ext[0])\n",
- ").add_to(m)\n",
- "\n",
"m"
]
},
diff --git a/Folium_2.ipynb b/Folium_2.ipynb
index 2f6f91e..6f73ef3 100644
--- a/Folium_2.ipynb
+++ b/Folium_2.ipynb
@@ -11,7 +11,7 @@
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -23,13 +23,13 @@
"from matplotlib.colors import Normalize\n",
"from matplotlib.colors import ListedColormap\n",
"from folium import raster_layers\n",
- "# from folium import plugins\n",
- "# from folium import branca"
+ "from folium import plugins\n",
+ "from folium import branca"
]
},
{
"cell_type": "code",
- "execution_count": 2,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -38,22 +38,9 @@
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "10.0 -180.0\n",
- "-60.0 -180.0\n",
- "-60.0 -30.0\n",
- "10.0 -30.0\n",
- "ext = [[10.0, -180.0], [-60.0, -180.0], [-60.0, -30.0], [10.0, -30.0]]\n",
- "geo_ext = [[10.0, -180.0], [-60.0, -180.0], [-60.0, -30.0], [10.0, -30.0]]\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"from osgeo import gdal,ogr,osr\n",
"\n",
@@ -123,49 +110,9 @@
},
{
"cell_type": "code",
- "execution_count": 22,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Driver: GTiff/GeoTIFF\r\n",
- "Files: /notebooks/resources/gpm/gpm_1d.20190531.tif\r\n",
- "Size is 1500, 700\r\n",
- "Coordinate System is:\r\n",
- "GEOGCS[\"WGS 84\",\r\n",
- " DATUM[\"WGS_1984\",\r\n",
- " SPHEROID[\"WGS 84\",6378137,298.2572326660159,\r\n",
- " AUTHORITY[\"EPSG\",\"7030\"]],\r\n",
- " AUTHORITY[\"EPSG\",\"6326\"]],\r\n",
- " PRIMEM[\"Greenwich\",0],\r\n",
- " UNIT[\"degree\",0.0174532925199433],\r\n",
- " AUTHORITY[\"EPSG\",\"4326\"]]\r\n",
- "Origin = (-180.000000000000000,10.000000000000000)\r\n",
- "Pixel Size = (0.100000000000000,-0.100000000000000)\r\n",
- "Metadata:\r\n",
- " AREA_OR_POINT=Area\r\n",
- " TIFFTAG_DATETIME=2019:06:01 13:35:13\r\n",
- " TIFFTAG_DOCUMENTNAME=/NRTPUB/imerg/gis/2019/05/3B-HHR-L.MS.MRG.3IMERG.20190531-S233000-E235959.1410.V06B.1day.tif\r\n",
- " TIFFTAG_IMAGEDESCRIPTION=DOI=10.5067/GPM/IMERG/3B-HH-L/06 DOIauthority=http://dx.doi.org/ DOIshortName=3IMERGHH_LATE Unit=0.1(mm) ScaleFactor=10\r\n",
- " TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)\r\n",
- " TIFFTAG_SOFTWARE=IDL 8.7.2, Harris Geospatial Solutions, Inc.\r\n",
- " TIFFTAG_XRESOLUTION=100\r\n",
- " TIFFTAG_YRESOLUTION=100\r\n",
- "Image Structure Metadata:\r\n",
- " COMPRESSION=LZW\r\n",
- " INTERLEAVE=BAND\r\n",
- "Corner Coordinates:\r\n",
- "Upper Left (-180.0000000, 10.0000000) (180d 0' 0.00\"W, 10d 0' 0.00\"N)\r\n",
- "Lower Left (-180.0000000, -60.0000000) (180d 0' 0.00\"W, 60d 0' 0.00\"S)\r\n",
- "Upper Right ( -30.0000000, 10.0000000) ( 30d 0' 0.00\"W, 10d 0' 0.00\"N)\r\n",
- "Lower Right ( -30.0000000, -60.0000000) ( 30d 0' 0.00\"W, 60d 0' 0.00\"S)\r\n",
- "Center (-105.0000000, -25.0000000) (105d 0' 0.00\"W, 25d 0' 0.00\"S)\r\n",
- "Band 1 Block=1500x2 Type=UInt16, ColorInterp=Gray\r\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"!gdalinfo '/notebooks/resources/gpm/gpm_1d.20190531.tif'"
]
@@ -202,25 +149,11 @@
},
{
"cell_type": "code",
- "execution_count": 30,
+ "execution_count": null,
"metadata": {
"scrolled": false
},
- "outputs": [
- {
- "data": {
- "text/html": [
- ""
- ],
- "text/plain": [
- ""
- ]
- },
- "execution_count": 30,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": [
"m = folium.Map(\n",
" location = [-22, -114]\n",
@@ -399,7 +332,7 @@
},
{
"cell_type": "code",
- "execution_count": 31,
+ "execution_count": 22,
"metadata": {
"scrolled": false
},
@@ -407,594 +340,82 @@
{
"data": {
"text/html": [
- "\n",
- " \n",
- " \n",
- " | Set3_03 | |
\n",
- " \n",
- " | Pastel2_08 | |
\n",
- " \n",
- " | RdGy_06 | |
\n",
- " \n",
- " | BuGn_08 | |
\n",
- " \n",
- " | BuGn_09 | |
\n",
- " \n",
- " | Oranges_03 | |
\n",
- " \n",
- " | PuRd_03 | |
\n",
- " \n",
- " | RdBu_11 | |
\n",
- " \n",
- " | Blues_06 | |
\n",
- " \n",
- " | Pastel2_05 | |
\n",
- " \n",
- " | BrBG_08 | |
\n",
- " \n",
- " | Pastel1_06 | |
\n",
- " \n",
- " | PRGn_06 | |
\n",
- " \n",
- " | Set3_10 | |
\n",
- " \n",
- " | PuBuGn_07 | |
\n",
- " \n",
- " | PuOr_11 | |
\n",
- " \n",
- " | Reds_09 | |
\n",
- " \n",
- " | PuBuGn_09 | |
\n",
- " \n",
- " | PuBuGn_08 | |
\n",
- " \n",
- " | PuRd_04 | |
\n",
- " \n",
- " | GnBu_06 | |
\n",
- " \n",
- " | RdYlBu_07 | |
\n",
- " \n",
- " | PRGn_09 | |
\n",
- " \n",
- " | Paired_12 | |
\n",
- " \n",
- " | Spectral_06 | |
\n",
- " \n",
- " | BrBG_07 | |
\n",
- " \n",
- " | Accent_03 | |
\n",
- " \n",
- " | Spectral_09 | |
\n",
- " \n",
- " | Accent_04 | |
\n",
- " \n",
- " | Reds_06 | |
\n",
- " \n",
- " | YlOrBr_03 | |
\n",
- " \n",
- " | PuOr_07 | |
\n",
- " \n",
- " | Greys_07 | |
\n",
- " \n",
- " | YlGn_05 | |
\n",
- " \n",
- " | YlGnBu_09 | |
\n",
- " \n",
- " | RdGy_10 | |
\n",
- " \n",
- " | YlOrBr_06 | |
\n",
- " \n",
- " | RdYlGn_11 | |
\n",
- " \n",
- " | RdYlGn_09 | |
\n",
- " \n",
- " | PuRd_09 | |
\n",
- " \n",
- " | YlGnBu_06 | |
\n",
- " \n",
- " | Accent_06 | |
\n",
- " \n",
- " | BrBG_05 | |
\n",
- " \n",
- " | Dark2_04 | |
\n",
- " \n",
- " | Oranges_07 | |
\n",
- " \n",
- " | PiYG_08 | |
\n",
- " \n",
- " | RdYlBu_05 | |
\n",
- " \n",
- " | Oranges_06 | |
\n",
- " \n",
- " | Purples_03 | |
\n",
- " \n",
- " | YlGnBu_04 | |
\n",
- " \n",
- " | BuPu_07 | |
\n",
- " \n",
- " | Dark2_03 | |
\n",
- " \n",
- " | Purples_06 | |
\n",
- " \n",
- " | RdPu_07 | |
\n",
- " \n",
- " | PRGn_04 | |
\n",
- " \n",
- " | YlOrBr_04 | |
\n",
- " \n",
- " | BrBG_03 | |
\n",
- " \n",
- " | YlGn_03 | |
\n",
- " \n",
- " | Spectral_04 | |
\n",
- " \n",
- " | Accent_05 | |
\n",
- " \n",
- " | GnBu_03 | |
\n",
- " \n",
- " | YlOrBr_08 | |
\n",
- " \n",
- " | PuBuGn_05 | |
\n",
- " \n",
- " | RdGy_05 | |
\n",
- " \n",
- " | PuBuGn_04 | |
\n",
- " \n",
- " | PuBuGn_06 | |
\n",
- " \n",
- " | RdPu_03 | |
\n",
- " \n",
- " | OrRd_04 | |
\n",
- " \n",
- " | Set3_05 | |
\n",
- " \n",
- " | YlOrRd_09 | |
\n",
- " \n",
- " | Greens_07 | |
\n",
- " \n",
- " | PuBuGn_03 | |
\n",
- " \n",
- " | PuOr_08 | |
\n",
- " \n",
- " | Paired_04 | |
\n",
- " \n",
- " | Set3_08 | |
\n",
- " \n",
- " | Reds_07 | |
\n",
- " \n",
- " | BrBG_04 | |
\n",
- " \n",
- " | Set2_05 | |
\n",
- " \n",
- " | PuBu_08 | |
\n",
- " \n",
- " | PiYG_03 | |
\n",
- " \n",
- " | PuBu_07 | |
\n",
- " \n",
- " | Set2_07 | |
\n",
- " \n",
- " | Pastel1_08 | |
\n",
- " \n",
- " | BuPu_05 | |
\n",
- " \n",
- " | Oranges_08 | |
\n",
- " \n",
- " | PuOr_05 | |
\n",
- " \n",
- " | BuGn_03 | |
\n",
- " \n",
- " | Greens_09 | |
\n",
- " \n",
- " | YlOrRd_07 | |
\n",
- " \n",
- " | Purples_09 | |
\n",
- " \n",
- " | Greys_08 | |
\n",
- " \n",
- " | Pastel1_05 | |
\n",
- " \n",
- " | OrRd_05 | |
\n",
- " \n",
- " | Oranges_04 | |
\n",
- " \n",
- " | viridis | |
\n",
- " \n",
- " | Pastel1_03 | |
\n",
- " \n",
- " | YlOrRd_06 | |
\n",
- " \n",
- " | RdYlBu_04 | |
\n",
- " \n",
- " | Dark2_05 | |
\n",
- " \n",
- " | Set3_12 | |
\n",
- " \n",
- " | RdPu_08 | |
\n",
- " \n",
- " | Greens_06 | |
\n",
- " \n",
- " | PuRd_08 | |
\n",
- " \n",
- " | PRGn_05 | |
\n",
- " \n",
- " | YlGn_06 | |
\n",
- " \n",
- " | Blues_07 | |
\n",
- " \n",
- " | Set3_09 | |
\n",
- " \n",
- " | PuBu_05 | |
\n",
- " \n",
- " | PuBu_06 | |
\n",
- " \n",
- " | Pastel2_04 | |
\n",
- " \n",
- " | YlOrBr_09 | |
\n",
- " \n",
- " | OrRd_06 | |
\n",
- " \n",
- " | RdYlGn_05 | |
\n",
- " \n",
- " | PuRd_07 | |
\n",
- " \n",
- " | Pastel1_07 | |
\n",
- " \n",
- " | Purples_07 | |
\n",
- " \n",
- " | OrRd_07 | |
\n",
- " \n",
- " | Pastel2_03 | |
\n",
- " \n",
- " | YlOrBr_05 | |
\n",
- " \n",
- " | BrBG_06 | |
\n",
- " \n",
- " | Set1_08 | |
\n",
- " \n",
- " | Set3_07 | |
\n",
- " \n",
- " | YlGnBu_08 | |
\n",
- " \n",
- " | GnBu_05 | |
\n",
- " \n",
- " | Dark2_07 | |
\n",
- " \n",
- " | Pastel1_09 | |
\n",
- " \n",
- " | Set1_09 | |
\n",
- " \n",
- " | Greys_06 | |
\n",
- " \n",
- " | PuOr_03 | |
\n",
- " \n",
- " | RdGy_09 | |
\n",
- " \n",
- " | PuBu_03 | |
\n",
- " \n",
- " | Blues_09 | |
\n",
- " \n",
- " | Accent_08 | |
\n",
- " \n",
- " | YlGn_04 | |
\n",
- " \n",
- " | RdGy_07 | |
\n",
- " \n",
- " | Blues_03 | |
\n",
- " \n",
- " | YlOrRd_08 | |
\n",
- " \n",
- " | Greens_08 | |
\n",
- " \n",
- " | Paired_06 | |
\n",
- " \n",
- " | PiYG_04 | |
\n",
- " \n",
- " | Greys_04 | |
\n",
- " \n",
- " | Oranges_05 | |
\n",
- " \n",
- " | Set2_04 | |
\n",
- " \n",
- " | PuBu_04 | |
\n",
- " \n",
- " | Paired_03 | |
\n",
- " \n",
- " | Spectral_07 | |
\n",
- " \n",
- " | RdYlGn_07 | |
\n",
- " \n",
- " | RdGy_08 | |
\n",
- " \n",
- " | Paired_05 | |
\n",
- " \n",
- " | BrBG_11 | |
\n",
- " \n",
- " | YlGn_08 | |
\n",
- " \n",
- " | Set2_08 | |
\n",
- " \n",
- " | PRGn_03 | |
\n",
- " \n",
- " | Greens_05 | |
\n",
- " \n",
- " | Pastel2_06 | |
\n",
- " \n",
- " | Paired_10 | |
\n",
- " \n",
- " | PuOr_04 | |
\n",
- " \n",
- " | BuPu_06 | |
\n",
- " \n",
- " | Greys_09 | |
\n",
- " \n",
- " | Blues_04 | |
\n",
- " \n",
- " | Paired_09 | |
\n",
- " \n",
- " | PRGn_11 | |
\n",
- " \n",
- " | YlGnBu_05 | |
\n",
- " \n",
- " | RdBu_08 | |
\n",
- " \n",
- " | PiYG_06 | |
\n",
- " \n",
- " | BrBG_10 | |
\n",
- " \n",
- " | Dark2_08 | |
\n",
- " \n",
- " | RdPu_04 | |
\n",
- " \n",
- " | Spectral_08 | |
\n",
- " \n",
- " | YlOrRd_05 | |
\n",
- " \n",
- " | Paired_11 | |
\n",
- " \n",
- " | YlGnBu_03 | |
\n",
- " \n",
- " | YlOrBr_07 | |
\n",
- " \n",
- " | Dark2_06 | |
\n",
- " \n",
- " | RdYlGn_10 | |
\n",
- " \n",
- " | OrRd_03 | |
\n",
- " \n",
- " | Set1_05 | |
\n",
- " \n",
- " | Reds_03 | |
\n",
- " \n",
- " | Pastel1_04 | |
\n",
- " \n",
- " | Accent_07 | |
\n",
- " \n",
- " | Purples_05 | |
\n",
- " \n",
- " | Spectral_11 | |
\n",
- " \n",
- " | YlGn_09 | |
\n",
- " \n",
- " | BuPu_03 | |
\n",
- " \n",
- " | PiYG_07 | |
\n",
- " \n",
- " | PRGn_10 | |
\n",
- " \n",
- " | Set2_06 | |
\n",
- " \n",
- " | Set1_03 | |
\n",
- " \n",
- " | RdGy_04 | |
\n",
- " \n",
- " | Set1_07 | |
\n",
- " \n",
- " | BuGn_04 | |
\n",
- " \n",
- " | RdBu_04 | |
\n",
- " \n",
- " | RdYlGn_04 | |
\n",
- " \n",
- " | PuRd_05 | |
\n",
- " \n",
- " | BrBG_09 | |
\n",
- " \n",
- " | Set3_11 | |
\n",
- " \n",
- " | Blues_08 | |
\n",
- " \n",
- " | GnBu_08 | |
\n",
- " \n",
- " | RdYlGn_06 | |
\n",
- " \n",
- " | PuOr_09 | |
\n",
- " \n",
- " | GnBu_04 | |
\n",
- " \n",
- " | OrRd_09 | |
\n",
- " \n",
- " | RdYlBu_08 | |
\n",
- " \n",
- " | PuBu_09 | |
\n",
- " \n",
- " | RdPu_09 | |
\n",
- " \n",
- " | BuPu_08 | |
\n",
- " \n",
- " | Blues_05 | |
\n",
- " \n",
- " | Purples_04 | |
\n",
- " \n",
- " | RdBu_06 | |
\n",
- " \n",
- " | RdYlBu_10 | |
\n",
- " \n",
- " | BuPu_04 | |
\n",
- " \n",
- " | PuRd_06 | |
\n",
- " \n",
- " | PRGn_07 | |
\n",
- " \n",
- " | RdBu_03 | |
\n",
- " \n",
- " | BuPu_09 | |
\n",
- " \n",
- " | Set3_06 | |
\n",
- " \n",
- " | RdBu_10 | |
\n",
- " \n",
- " | YlGn_07 | |
\n",
- " \n",
- " | YlOrRd_03 | |
\n",
- " \n",
- " | BuGn_07 | |
\n",
- " \n",
- " | RdBu_09 | |
\n",
- " \n",
- " | RdBu_05 | |
\n",
- " \n",
- " | Pastel2_07 | |
\n",
- " \n",
- " | RdYlGn_03 | |
\n",
- " \n",
- " | PiYG_05 | |
\n",
- " \n",
- " | OrRd_08 | |
\n",
- " \n",
- " | Paired_08 | |
\n",
- " \n",
- " | Spectral_03 | |
\n",
- " \n",
- " | PuOr_10 | |
\n",
- " \n",
- " | YlGnBu_07 | |
\n",
- " \n",
- " | RdYlBu_11 | |
\n",
- " \n",
- " | BuGn_06 | |
\n",
- " \n",
- " | Oranges_09 | |
\n",
- " \n",
- " | Spectral_10 | |
\n",
- " \n",
- " | RdBu_07 | |
\n",
- " \n",
- " | Paired_07 | |
\n",
- " \n",
- " | RdYlBu_03 | |
\n",
- " \n",
- " | RdPu_06 | |
\n",
- " \n",
- " | RdYlGn_08 | |
\n",
- " \n",
- " | PRGn_08 | |
\n",
- " \n",
- " | GnBu_09 | |
\n",
- " \n",
- " | RdGy_11 | |
\n",
- " \n",
- " | Greens_03 | |
\n",
- " \n",
- " | Greens_04 | |
\n",
- " \n",
- " | Purples_08 | |
\n",
- " \n",
- " | Set1_04 | |
\n",
- " \n",
- " | Set2_03 | |
\n",
- " \n",
- " | RdGy_03 | |
\n",
- " \n",
- " | Reds_08 | |
\n",
- " \n",
- " | YlOrRd_04 | |
\n",
- " \n",
- " | Reds_05 | |
\n",
- " \n",
- " | Set3_04 | |
\n",
- " \n",
- " | BuGn_05 | |
\n",
- " \n",
- " | RdYlBu_09 | |
\n",
- " \n",
- " | Set1_06 | |
\n",
- " \n",
- " | PuOr_06 | |
\n",
- " \n",
- " | Greys_03 | |
\n",
- " \n",
- " | Greys_05 | |
\n",
- " \n",
- " | RdPu_05 | |
\n",
- " \n",
- " | PiYG_11 | |
\n",
- " \n",
- " | RdYlBu_06 | |
\n",
- " \n",
- " | GnBu_07 | |
\n",
- " \n",
- " | Reds_04 | |
\n",
- " \n",
- " | PiYG_09 | |
\n",
- " \n",
- " | Spectral_05 | |
\n",
- " \n",
- " | PiYG_10 | |
\n",
- "
\n",
- " "
+ ""
],
"text/plain": [
- ""
+ ""
]
},
- "execution_count": 31,
+ "execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "branca.colormap.linear"
+ "import branca\n",
+ "# branca.colormap.linear.Spectral_04\n",
+ "colormap = branca.colormap.linear.Spectral_04.scale(0, 10000)\n",
+ "colormap = colormap.to_step(index=[0, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000])\n",
+ "colormap.caption = 'mm'\n",
+ "colormap"
]
},
{
"cell_type": "code",
- "execution_count": 18,
+ "execution_count": 39,
"metadata": {},
"outputs": [
{
"data": {
+ "text/html": [
+ ""
+ ],
"text/plain": [
- "4699"
+ ""
]
},
- "execution_count": 18,
+ "execution_count": 39,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "np.max(data)"
+ "import branca\n",
+ "\n",
+ "\n",
+ "colormap = branca.colormap.StepColormap(\n",
+ " ['#64abb0','#9dd3a7', '#c7e9ad', '#edf8b9', '#ffedaa', '#fec980', '#f99e59', '#e85b3a', '#d7191c'],\n",
+ " vmin=0, vmax=10000,\n",
+ " index=[0, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000],\n",
+ " caption='step'\n",
+ ")\n",
+ "\n",
+ "colormap"
]
},
{
"cell_type": "code",
- "execution_count": 27,
- "metadata": {},
+ "execution_count": 32,
+ "metadata": {
+ "scrolled": false
+ },
"outputs": [
{
"data": {
+ "text/html": [
+ ""
+ ],
"text/plain": [
- "700"
+ ""
]
},
- "execution_count": 27,
+ "execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "len(data)"
+ "cm.StepColormap(['#64abb0'])"
]
},
{
@@ -1002,7 +423,9 @@
"execution_count": null,
"metadata": {},
"outputs": [],
- "source": []
+ "source": [
+ "ftp://jsimpson.pps.eosdis.nasa.gov/NRTPUB/imerg/gis/README.GIS.pdf"
+ ]
}
],
"metadata": {