Skip to content

Commit

Permalink
Review round 2 (#3)
Browse files Browse the repository at this point in the history
* Updated fig 5

* updated gitignore

* Made figures 7-9 larger

* Added pyrams to environment
  • Loading branch information
lsterzinger authored May 31, 2022
1 parent f846480 commit 5c8af35
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 39 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*.cdf
._*
temp/
data/model/
data/obs/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ dependencies:
- pandas
- jupyterlab
- metpy
- dask
- dask
- pyrams
32 changes: 24 additions & 8 deletions figure-notebooks/05-2d-cloud-contours.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,27 @@
"source": [
"oli_lims = (datetime(2017,5,12,3), datetime(2017,5,12,18), 0, 1000)\n",
"ascos_lims = (datetime(2008,8,31,0), datetime(2008,8,31,15), 0, 1200)\n",
"smt_lims = (datetime(2019,7,2,0), datetime(2019,7,2,12), 0, 1700)\n"
"smt_lims = (datetime(2019,7,2,0), datetime(2019,7,2,15), 0, 1700)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "50d18e3b",
"id": "3b3a1cb0-94df-40f5-92ac-fd365f4a78f4",
"metadata": {},
"outputs": [],
"source": [
"np.arange(np.datetime64(oli_lims[0]), np.datetime64(oli_lims[1]), np.timedelta64(1,'h'))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "50d18e3b",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"fig, axs = plt.subplots(3, 1, figsize=(6,10), constrained_layout=True)\n",
"\n",
Expand Down Expand Up @@ -141,9 +153,13 @@
" i.collections[0].set_label('Ice [g kg$^{-1}$]')\n",
" \n",
"\n",
" # ob = cbh.plot(ax=ax, color='C0', label='CBH Obs')\n",
"\n",
" # ax.clabel(c, c.levels, inline=True)\n",
" # Set hourly time ticks\n",
" dt1 = np.datetime64(t1)\n",
" dt2 = np.datetime64(t2)\n",
" dt = np.timedelta64(1,'h')\n",
" time_ticks = np.arange(dt1, dt2+dt, dt) \n",
" ax.set_xticks(time_ticks)\n",
" \n",
" axb = ax.twiny()\n",
" \n",
" ax.set_xlim(t1, t2)\n",
Expand All @@ -152,8 +168,8 @@
" time_ticks = ax.get_xticks()\n",
" major_tickalabels = (np.asarray(mdates.num2date(time_ticks)) - aero_time).astype('timedelta64[h]').astype(int)\n",
"\n",
" axb.set_xticks(ax.get_xticks()[::2])\n",
" axb.set_xticklabels([i.strftime('%H') for i in mdates.num2date(time_ticks[::2])])\n",
" axb.set_xticks(ax.get_xticks()[::3])\n",
" axb.set_xticklabels([i.strftime('%H') for i in mdates.num2date(time_ticks[::3])])\n",
" if xlabel2:\n",
" axb.set_xlabel(\"Hour (UTC)\")\n",
" ax.set_xticklabels(major_tickalabels, rotation=0, horizontalalignment='center')\n",
Expand Down Expand Up @@ -209,7 +225,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.9.12"
}
},
"nbformat": 4,
Expand Down
14 changes: 9 additions & 5 deletions figure-notebooks/07-budget-oli.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"from glob import glob\n",
"import matplotlib.dates as mdates\n",
"from datetime import datetime, timezone\n",
"from ramslibs.data_tools import flist_to_times, create_xr_metadata"
"from pyrams.data_tools import flist_to_times, create_xr_metadata"
]
},
{
Expand All @@ -34,7 +34,7 @@
"plt.rc('axes', labelsize=SMALL_SIZE) # fontsize of the x and y labels\n",
"plt.rc('xtick', labelsize=SMALL_SIZE) # fontsize of the tick labels\n",
"plt.rc('ytick', labelsize=SMALL_SIZE) # fontsize of the tick labels\n",
"plt.rc('legend', fontsize=10) # legend fontsize\n",
"plt.rc('legend', fontsize=12) # legend fontsize\n",
"# plt.rc('colorbar', fontsize=12)\n",
"plt.rc('figure', titlesize=BIGGER_SIZE) # fontsize of the figure title"
]
Expand Down Expand Up @@ -202,7 +202,7 @@
"metadata": {},
"outputs": [],
"source": [
"fig, ((ax1, ax2, ax3), (ax4, ax5, ax6)) = plt.subplots(2,3, figsize=(10,6), sharex='col', \n",
"fig, ((ax1, ax2, ax3), (ax4, ax5, ax6)) = plt.subplots(2,3, figsize=(13,8), sharex='col', \n",
" constrained_layout=True)\n",
"# Liquid Budget\n",
"raincond[2:].plot(label='Rain', color='C0', ax=ax1)\n",
Expand Down Expand Up @@ -244,10 +244,12 @@
"ax3.set_ylim(0, 800)\n",
"\n",
"# Liquid 2D\n",
"liqgrow.plot.pcolormesh('time', 'z', ax=ax4, cbar_kwargs=dict(label='g m$^{-3}$ min$^{-1}$', orientation='horizontal'),\n",
"p4 = liqgrow.plot.pcolormesh('time', 'z', ax=ax4, cbar_kwargs=dict(label='g m$^{-3}$ min$^{-1}$', orientation='horizontal'),\n",
" vmin=-0.01, vmax=0.01, cmap='RdBu_r')\n",
"ax4.set_xlabel(\"\")\n",
"ax4.set_title(\"(d) OLI Liquid Growth\")\n",
"cb = p4.colorbar\n",
"cb.formatter.set_powerlimits((0, 0))\n",
"\n",
"ax4.set_xlim(t1, t2)\n",
"ax4.set_ylim(0, 800)\n",
Expand All @@ -261,6 +263,8 @@
"# cbar5.formatter.set_powerlimits((0,0))\n",
"ax5.set_xlabel(\"\")\n",
"ax5.set_title(\"(e) OLI Ice Growth\")\n",
"cb = p5.colorbar\n",
"cb.formatter.set_powerlimits((0, 0))\n",
"\n",
"ax5.set_xlim(t1, t2)\n",
"ax5.set_ylim(0, 800)\n",
Expand Down Expand Up @@ -314,7 +318,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.4"
}
},
"nbformat": 4,
Expand Down
28 changes: 8 additions & 20 deletions figure-notebooks/08-budget-ascos.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"plt.rc('axes', labelsize=SMALL_SIZE) # fontsize of the x and y labels\n",
"plt.rc('xtick', labelsize=SMALL_SIZE) # fontsize of the tick labels\n",
"plt.rc('ytick', labelsize=SMALL_SIZE) # fontsize of the tick labels\n",
"plt.rc('legend', fontsize=10) # legend fontsize\n",
"plt.rc('legend', fontsize=12) # legend fontsize\n",
"# plt.rc('colorbar', fontsize=12)\n",
"plt.rc('figure', titlesize=BIGGER_SIZE) # fontsize of the figure title"
]
Expand All @@ -118,7 +118,7 @@
"metadata": {},
"outputs": [],
"source": [
"fig, ((ax1, ax2, ax3), (ax4, ax5, ax6)) = plt.subplots(2,3, figsize=(10,6), sharex='col', \n",
"fig, ((ax1, ax2, ax3), (ax4, ax5, ax6)) = plt.subplots(2,3, figsize=(13,8), sharex='col', \n",
" constrained_layout=True)\n",
"# Liquid Budget\n",
"raincond[2:].plot(label='Rain', color='C0', ax=ax1)\n",
Expand Down Expand Up @@ -160,9 +160,11 @@
"ax3.set_ylim(0, 1000)\n",
"\n",
"# Liquid 2D\n",
"liqgrow.plot.pcolormesh('time', 'z', ax=ax4, cbar_kwargs=dict(label='g m$^{-3}$ min$^{-1}$', orientation='horizontal'))\n",
"p4 = liqgrow.plot.pcolormesh('time', 'z', ax=ax4, cbar_kwargs=dict(label='g m$^{-3}$ min$^{-1}$', orientation='horizontal'))\n",
"ax4.set_xlabel(\"\")\n",
"ax4.set_title(\"(d) ASCOS Liquid Growth\")\n",
"cb = p4.colorbar\n",
"cb.formatter.set_powerlimits((0, 0))\n",
"\n",
"ax4.set_xlim(t1, t2)\n",
"ax4.set_ylim(0, 1000)\n",
Expand All @@ -177,6 +179,8 @@
"# cbar5.formatter.set_powerlimits((0,0))\n",
"ax5.set_xlabel(\"\")\n",
"ax5.set_title(\"(e) ASCOS Ice Growth\")\n",
"cb = p5.colorbar\n",
"cb.formatter.set_powerlimits((0, 0))\n",
"\n",
"ax5.set_xlim(t1, t2)\n",
"ax5.set_ylim(0, 1000)\n",
Expand All @@ -203,22 +207,6 @@
"\n",
"plt.savefig('fig08.png', facecolor='w', dpi=300)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0b4a2f9f-0c23-48f7-9677-feffc0d4de0a",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "00801539-087a-40ef-a86a-0d47778f0576",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -237,7 +225,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.4"
}
},
"nbformat": 4,
Expand Down
14 changes: 9 additions & 5 deletions figure-notebooks/09-budget-summit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"liqsed = (data.ACCPR + data.ACCPD).diff('time').load() * 1e3 / 5.0\n",
"icesed = (data.ACCPP + data.ACCPS + data.ACCPA + data.ACCPG + data.ACCPH).diff('time').load() * 1e3 / 5.0\n",
"radheat = data.FTHRD[2:,:].load() * 3600\n",
"turb = xr.open_dataset('../data/model/smt_vert_momentum_flux.nc')[\"WSQUARED\"][2:,:]"
"turb = xr.open_dataset('../data/model/smt_vert_momentum_flux.nc')[\"WC\"][2:,:]"
]
},
{
Expand Down Expand Up @@ -93,7 +93,7 @@
"plt.rc('axes', labelsize=SMALL_SIZE) # fontsize of the x and y labels\n",
"plt.rc('xtick', labelsize=SMALL_SIZE) # fontsize of the tick labels\n",
"plt.rc('ytick', labelsize=SMALL_SIZE) # fontsize of the tick labels\n",
"plt.rc('legend', fontsize=10) # legend fontsize\n",
"plt.rc('legend', fontsize=12) # legend fontsize\n",
"# plt.rc('colorbar', fontsize=12)\n",
"plt.rc('figure', titlesize=BIGGER_SIZE) # fontsize of the figure title"
]
Expand All @@ -115,7 +115,7 @@
"metadata": {},
"outputs": [],
"source": [
"fig, ((ax1, ax2, ax3), (ax4, ax5, ax6)) = plt.subplots(2,3, figsize=(10,6), sharex='col', \n",
"fig, ((ax1, ax2, ax3), (ax4, ax5, ax6)) = plt.subplots(2,3, figsize=(13,8), sharex='col', \n",
" constrained_layout=True)\n",
"# Liquid Budget\n",
"raincond[2:].plot(label='Rain', color='C0', ax=ax1)\n",
Expand Down Expand Up @@ -156,12 +156,14 @@
"ax3.set_xlim(t1, t2)\n",
"\n",
"# Liquid 2D\n",
"liqgrow.plot.pcolormesh('time', 'z', ax=ax4, \n",
"p4 = liqgrow.plot.pcolormesh('time', 'z', ax=ax4, \n",
" cbar_kwargs=dict(label='g m$^{-3}$ min$^{-1}$', orientation='horizontal'),\n",
" vmin=-.007, vmax=0.007, cmap='RdBu_r'\n",
")\n",
"ax4.set_xlabel(\"\")\n",
"ax4.set_title(\"(d) SMT Liquid Growth\")\n",
"cb = p4.colorbar\n",
"cb.formatter.set_powerlimits((0, 0))\n",
"\n",
"ax4.set_xlim(t1, t2)\n",
"\n",
Expand All @@ -176,6 +178,8 @@
"# cbar5.formatter.set_powerlimits((0,0))\n",
"ax5.set_xlabel(\"\")\n",
"ax5.set_title(\"(e) SMT Ice Growth\")\n",
"cb = p5.colorbar\n",
"cb.formatter.set_powerlimits((0, 0))\n",
"\n",
"ax5.set_xlim(t1, t2)\n",
"\n",
Expand Down Expand Up @@ -226,7 +230,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 5c8af35

Please sign in to comment.