Skip to content

Instantly share code, notes, and snippets.

@douglatornell
Created June 9, 2020 19:37
Show Gist options
  • Save douglatornell/3a71dcc619840989186936f244ff943f to your computer and use it in GitHub Desktop.
Save douglatornell/3a71dcc619840989186936f244ff943f to your computer and use it in GitHub Desktop.
Effect of SalishSeaCast NEMO water mask for GeoTIFFs on calculation of monthly VTE probability
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Water Mask & VTE Probability\n",
"\n",
"Effect of SalishSeaCast NEMO water mask for GeoTIFFs on calculation of monthly VTE probability."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from pathlib import Path\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy\n",
"import rasterio"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"def calc_vte_probability_no_mask(geotiffs_dir):\n",
" total_vte_by_month = numpy.empty(12)\n",
"\n",
" for month in range(1, 13):\n",
" # The filenames are formatted as \"all_2018_MM.tif\"\n",
" f_name = geotiffs_dir / f\"all_2018_{month:02d}.tif\"\n",
"\n",
" with rasterio.open(f_name) as dataset:\n",
" total_vte_by_month[month - 1] = dataset.read(1, boundless=True, fill_value=0).sum()\n",
"\n",
" # calculate VTE probability by month based on total traffic for each month\n",
" vte_probability = total_vte_by_month / total_vte_by_month.sum()\n",
"\n",
" return vte_probability"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"def calc_vte_probability_masked(geotiffs_dir, geotiff_watermask):\n",
" total_vte_by_month = numpy.empty(12)\n",
"\n",
" for month in range(1, 13):\n",
" # The filenames are formatted as \"all_2018_MM.tif\"\n",
" f_name = geotiffs_dir / f\"all_2018_{month:02d}.tif\"\n",
"\n",
" with rasterio.open(f_name) as dataset:\n",
" total_vte_by_month[month - 1] = dataset.read(1, boundless=True, fill_value=0).sum(where=geotiff_watermask)\n",
"\n",
" # calculate VTE probability by month based on total traffic for each month\n",
" vte_probability = total_vte_by_month / total_vte_by_month.sum()\n",
"\n",
" return vte_probability"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"geotiffs_dir = Path(\"/media/doug/warehouse/MIDOSS/ShipTrackDensityGeoTIFFs/\")\n",
"geotiff_watermask = numpy.load(Path(\"/media/doug/warehouse/MIDOSS/ShipTrackDensityGeoTIFFs/geotiff-watermask.npy\"))"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"vte_probability_no_mask = calc_vte_probability_no_mask(geotiffs_dir)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"vte_probability_masked = calc_vte_probability_masked(geotiffs_dir, geotiff_watermask)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x7fb1350c4d60>"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3deXRV5dn38e9lggaRScFHBQS0gDInRiDBWim1gqXghEIHH7SWUus8NW191SJ1waulSGFJFRV9yiMtFoUqrSO+rQYEFMosMihErQIVBAFluN4/zuZ4ctg5OSQ5Q5LfZ62snL3vPVwnhPPLvvfe9zZ3R0REJN5RmS5ARESykwJCRERCKSBERCSUAkJEREIpIEREJFRupguoSS1atPB27dplugwRkVrjrbfe2uruLcPa6lRAtGvXjsWLF2e6DBGRWsPM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o0YN++faHbKy4uZsGCBWzZsoUTTzwRM6Nly5bMnj07egSxc+dOTj75ZPbt21fupHZszU2aNKF9+/bMnDkTiATZv/71ryR/WhGjR49m3Lhxhx1pVLT/9evX07t3b0aPHk2LFi3YvDlyn2Xbtm2ZNWsWV155JStX1srrHEQypt51MWXiio1u3bqxdetWvve975Wbt2vXLlq0aHHY8sOGDePHP/4xEydO5Omnn65wu9deey2jRo2iW7du5ObmMm3aNI455hj69u1L+/bt6datG127dqWgoCC6zsiRI+nevTsFBQXlPmABmjdvTsuWLenSpUt0XlFREW+88Ub0SqJ7772X3r1707ZtW7p16xYNhfiap0+fzk9/+lPGjBnDvn37GDZs2BFdjVRR11tF+7/99tt59913cXf69+9Pjx49oudaOnXqxPTp0xk6dCh//etfOf3005OuQ6Q+s4q6KWqjwsJCj39g0OrVqznzzDMzVJFku0z9fqTr8tOk9pOXxC1GOgdRZ5nZW+4eepOVuphERCSUAkJEREIpIEREJFS9O0ktkkhWDU2h+xMkwxQQUissK9te6TLdWzdLQyUSJquCVWqMuphERCRU/QuIe5rW7Fclbr755ugQ2hAZ7vuaa66JTt96662MHz+eOXPmMHbsWCAyMuqqVV89XfW8884j/vLdeBdffDHPPvtsdLpTp06MGTMmOn3ppZcya9asCtefMGFCdOC7qrrnnnswM9atWxed97vf/Q4zq7T+MCNGjEh4H4iIpFb9C4g0OzR8BRAd7jv2jt5Dw1gMHjyYkpIS4PCAONL9bNu2jeOOO4758+dH2+fPn59w3KeqBMSBAwcOm9etWzdmzJgRnX766adTMmy5iKSeAiLFUjncd0X7KS0tZdCgQWzZsgV3Z+PGjTRs2JCTTjqJn/70pxQWFtKlSxfuvvtuACZOnMiHH35Iv3796NevHwAvvvgiRUVFFBQUMHToUHbt2gVAu3btGD16NOecc050KI1YF110EbNnzwZgw4YNNG3alNhHwYbtH6CkpITOnTvTvXv30AcDTbr/N/yfm68tN8bUYT5cUvlXTaiBI0uR2kAnqVMslcN9xzrrrLNYsWIFX375JaWlpXzjG99g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bl8HY/YVP1aOE3lvL7n78ArK+byiOkViqYtJ6rrHgNHuvjxu/j+A70PkXACwtZLnb+wkMmBadfwGuC1m+n2gs5kdExy99K/CNnuZWfvg3MMVRI5gFgB9zexrAMGIrR2rWbvUQwoIqdPcvczdHwxpugcoDEZlHctXw0NXtJ1tRLpsVsScpD7SWlYSGT310PRm4M/AMiIPgVlShc3OJ1L/CmAj8Iy7bwFGAE8F728BkfMqIkdEo7mKiEgoHUGIiEgoBYSIiIRSQIiISCgFhIiIhFJAiIhIKAWEiIiEUkCIiEio/w9EfeO0R8nveAAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"month_numbers = numpy.array(list(range(vte_probability_no_mask.size + 1))[1:])\n",
"fig, ax = plt.subplots(1, 1)\n",
"bar_width = 0.35\n",
"ax.bar(month_numbers - bar_width/2, vte_probability_no_mask, bar_width, label=\"Without Water Mask\")\n",
"ax.bar(month_numbers + bar_width/2, vte_probability_masked, bar_width, label=\"With Water Mask\")\n",
"ax.set_ylabel(\"VTE Probability\")\n",
"ax.set_xlabel(\"Month Number\")\n",
"ax.legend()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment