Skip to content

Commit

Permalink
applly black formatting to notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
blaylockbk committed Feb 2, 2023
1 parent a42b725 commit c089b32
Show file tree
Hide file tree
Showing 21 changed files with 14,155 additions and 13,816 deletions.
14 changes: 9 additions & 5 deletions docs/user_guide/notebooks/DEMO_derived_motion_winds.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"execution_count": 2,
"source": [
"# Download Level-2 derived motion wind ABI product\n",
"gwnd = goes_nearesttime('2021-09-16 18:00', product='ABI-L2-DMWVC')"
"gwnd = goes_nearesttime(\"2021-09-16 18:00\", product=\"ABI-L2-DMWVC\")"
],
"outputs": [
{
Expand Down Expand Up @@ -91,7 +91,7 @@
" gwnd.wind_speed,\n",
" **cm_wind().cmap_kwargs,\n",
" length=5,\n",
")\n"
")"
],
"outputs": [
{
Expand Down Expand Up @@ -134,7 +134,7 @@
" **cm_wind().cmap_kwargs,\n",
" length=5,\n",
" transform=pc,\n",
")\n"
")"
],
"outputs": [
{
Expand Down Expand Up @@ -166,7 +166,7 @@
"cell_type": "code",
"execution_count": 7,
"source": [
"# Plot on Geostationary map with NaturalColor RGB product \n",
"# Plot on Geostationary map with NaturalColor RGB product\n",
"\n",
"ax = common_features(\"10m\", dark=True, figsize=[15, 10], STATES=True, crs=g.FOV.crs)\n",
"ax.barbs(\n",
Expand All @@ -182,7 +182,11 @@
"\n",
"ax.imshow(g.rgb.NaturalColor(), **g.FOV.imshow_kwargs)\n",
"\n",
"ax.set_title(f\"{g.orbital_slot} Natural Color and Derived Motion Winds\", loc='left', fontweight='bold')\n",
"ax.set_title(\n",
" f\"{g.orbital_slot} Natural Color and Derived Motion Winds\",\n",
" loc=\"left\",\n",
" fontweight=\"bold\",\n",
")\n",
"ax.set_title(f\"{g.t.dt.strftime('%H:%M UTC %d-%b-%Y').item()}\", loc=\"right\")"
],
"outputs": [
Expand Down
14 changes: 6 additions & 8 deletions docs/user_guide/notebooks/DEMO_download_goes_latest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@
}
],
"source": [
"g = goes_nearesttime(datetime(2020, 12, 25, 10),\n",
" satellite='goes16',\n",
" product='ABI',\n",
" return_as='xarray')"
"g = goes_nearesttime(\n",
" datetime(2020, 12, 25, 10), satellite=\"goes16\", product=\"ABI\", return_as=\"xarray\"\n",
")"
]
},
{
Expand Down Expand Up @@ -859,10 +858,9 @@
}
],
"source": [
"g = goes_nearesttime('2021-01-01 12:00',\n",
" satellite='goes17',\n",
" product='GLM',\n",
" return_as='filelist')"
"g = goes_nearesttime(\n",
" \"2021-01-01 12:00\", satellite=\"goes17\", product=\"GLM\", return_as=\"filelist\"\n",
")"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
}
],
"source": [
"g = goes_latest(satellite='goes16',\n",
" product='ABI',\n",
" return_as='xarray')"
"g = goes_latest(satellite=\"goes16\", product=\"ABI\", return_as=\"xarray\")"
]
},
{
Expand Down Expand Up @@ -847,9 +845,7 @@
}
],
"source": [
"g = goes_latest(satellite='goes17',\n",
" product='GLM',\n",
" return_as='filelist')"
"g = goes_latest(satellite=\"goes17\", product=\"GLM\", return_as=\"filelist\")"
]
},
{
Expand Down
13 changes: 5 additions & 8 deletions docs/user_guide/notebooks/DEMO_download_goes_timerange.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,14 @@
"## that pandas can interpret.\n",
"\n",
"## Specify start/end time with datetime object\n",
"#start = datetime(2021, 1, 1, 0, 30)\n",
"#end = datetime(2021, 1, 1, 1, 30)\n",
"# start = datetime(2021, 1, 1, 0, 30)\n",
"# end = datetime(2021, 1, 1, 1, 30)\n",
"\n",
"## Specify start/end time as a panda-parsable string\n",
"start = '2021-01-01 00:30'\n",
"end = '2021-01-01 01:30'\n",
"start = \"2021-01-01 00:30\"\n",
"end = \"2021-01-01 01:30\"\n",
"\n",
"g = goes_timerange(start, end,\n",
" satellite='goes16',\n",
" product='ABI',\n",
" return_as='filelist')"
"g = goes_timerange(start, end, satellite=\"goes16\", product=\"ABI\", return_as=\"filelist\")"
]
},
{
Expand Down
25 changes: 12 additions & 13 deletions docs/user_guide/notebooks/DEMO_rgb_Color-IR_Overlay.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
],
"source": [
"# Obtain a GOES ABI multichannel image\n",
"g = goes_nearesttime('2020-12-21 12:00',\n",
" satellite=16, product='ABI', domain='F')"
"g = goes_nearesttime(\"2020-12-21 12:00\", satellite=16, product=\"ABI\", domain=\"F\")"
]
},
{
Expand All @@ -64,28 +63,28 @@
}
],
"source": [
"# I only thin it to plot the image a little quicker because the full \n",
"# I only thin it to plot the image a little quicker because the full\n",
"# resolution of the data isn't distinguishable at the image resolution\n",
"nc = NaturalColor(g.thin(5))\n",
"ncIR = NaturalColor(g.thin(5), night_IR=True)\n",
"\n",
"fig, axes = plt.subplots(1, 2, figsize=[15,8], dpi=100)\n",
"fig, axes = plt.subplots(1, 2, figsize=[15, 8], dpi=100)\n",
"\n",
"text = g.t.dt.strftime('%H:%M UTC %d %B %Y').item()\n",
"text = g.t.dt.strftime(\"%H:%M UTC %d %B %Y\").item()\n",
"\n",
"axes[0].axis('off')\n",
"axes[0].axis(\"off\")\n",
"axes[0].imshow(nc.NaturalColor)\n",
"axes[0].set_title('Natural Color')\n",
"axes[0].text(0.01, .97, text, color='w', transform=axes[0].transAxes)\n",
"axes[0].set_title(\"Natural Color\")\n",
"axes[0].text(0.01, 0.97, text, color=\"w\", transform=axes[0].transAxes)\n",
"\n",
"axes[1].axis('off')\n",
"axes[1].axis(\"off\")\n",
"axes[1].imshow(ncIR.NaturalColor)\n",
"axes[1].set_title('Natural Color with Clean IR Overlay')\n",
"axes[1].text(0.01, .97, text, color='w', transform=axes[1].transAxes)\n",
"axes[1].set_title(\"Natural Color with Clean IR Overlay\")\n",
"axes[1].text(0.01, 0.97, text, color=\"w\", transform=axes[1].transAxes)\n",
"\n",
"plt.subplots_adjust(wspace=.01)\n",
"plt.subplots_adjust(wspace=0.01)\n",
"\n",
"plt.savefig(f'../docs/_static/Color-IR_demo', bbox_inches='tight')"
"plt.savefig(f\"../docs/_static/Color-IR_demo\", bbox_inches=\"tight\")"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
],
"source": [
"# Obtain a GOES ABI multichannel image\n",
"g = goes_nearesttime('2020-12-13 18:00',\n",
" satellite=16, product='ABI', domain='F')"
"g = goes_nearesttime(\"2020-12-13 18:00\", satellite=16, product=\"ABI\", domain=\"F\")"
]
},
{
Expand Down Expand Up @@ -83,19 +82,19 @@
}
],
"source": [
"gammas = [.5, .8, 1, 1.2, 1.5]\n",
"gammas = [0.5, 0.8, 1, 1.2, 1.5]\n",
"\n",
"fig, axes = plt.subplots(1,len(gammas), figsize=[15,3.5], dpi=100)\n",
"fig, axes = plt.subplots(1, len(gammas), figsize=[15, 3.5], dpi=100)\n",
"for gamma, ax in zip(gammas, axes):\n",
" nc = NaturalColor(g.thin(5), gamma)\n",
" ax.imshow(nc.NaturalColor)\n",
" ax.axis('off')\n",
" ax.set_title(f'gamma={gamma:.1f}')\n",
" print('finished gamma=', gamma)\n",
"plt.subplots_adjust(wspace=.01)\n",
"plt.suptitle('Pseudo Green (pseudoGreen=True)', fontweight='bold')\n",
" ax.axis(\"off\")\n",
" ax.set_title(f\"gamma={gamma:.1f}\")\n",
" print(\"finished gamma=\", gamma)\n",
"plt.subplots_adjust(wspace=0.01)\n",
"plt.suptitle(\"Pseudo Green (pseudoGreen=True)\", fontweight=\"bold\")\n",
"\n",
"plt.savefig(f'../docs/_static/gamma_demo_NaturalColor-PsuedoGreen', bbox_inches='tight')"
"plt.savefig(f\"../docs/_static/gamma_demo_NaturalColor-PsuedoGreen\", bbox_inches=\"tight\")"
]
},
{
Expand Down Expand Up @@ -128,19 +127,19 @@
}
],
"source": [
"gammas = [.5, .8, 1, 1.2, 1.5]\n",
"gammas = [0.5, 0.8, 1, 1.2, 1.5]\n",
"\n",
"fig, axes = plt.subplots(1,len(gammas), figsize=[15,3.5], dpi=100)\n",
"fig, axes = plt.subplots(1, len(gammas), figsize=[15, 3.5], dpi=100)\n",
"for gamma, ax in zip(gammas, axes):\n",
" nc = NaturalColor(g.thin(5), gamma, pseudoGreen=False)\n",
" ax.imshow(nc.NaturalColor)\n",
" ax.axis('off')\n",
" ax.set_title(f'gamma={gamma:.1f}')\n",
" print('finished gamma=', gamma)\n",
"plt.subplots_adjust(wspace=.01)\n",
"plt.suptitle('\"Veggie\" Green (pseudoGreen=False)', fontweight='bold')\n",
" ax.axis(\"off\")\n",
" ax.set_title(f\"gamma={gamma:.1f}\")\n",
" print(\"finished gamma=\", gamma)\n",
"plt.subplots_adjust(wspace=0.01)\n",
"plt.suptitle('\"Veggie\" Green (pseudoGreen=False)', fontweight=\"bold\")\n",
"\n",
"plt.savefig(f'../docs/_static/gamma_demo_NaturalColor-VeggieGreen', bbox_inches='tight')"
"plt.savefig(f\"../docs/_static/gamma_demo_NaturalColor-VeggieGreen\", bbox_inches=\"tight\")"
]
},
{
Expand Down
Loading

0 comments on commit c089b32

Please sign in to comment.