{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Planetary Boundary Layer Height Gradient Method Retrievals\n\nThis example shows how to estimate the planetary boundary layer\nheight via a gradient method retrieval\n\nAuthor: Joe O'Brien\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from arm_test_data import DATASETS\n\nimport act\n\n# Read Ceilometer data for an example\nfilename_ceil = DATASETS.fetch('sgpceilC1.b1.20190101.000000.nc')\nds = act.io.arm.read_arm_netcdf(filename_ceil)\n\n# Apply corrections to the dataset\nds = act.corrections.correct_ceil(ds, var_name='backscatter')\n\n# Estimate PBL Height via a gradient method\nds = act.retrievals.pbl_lidar.calculate_gradient_pbl(ds, parm=\"backscatter\", smooth_dis=3)\n\n# Estimate PBL Height via a modified gradient method\nds = act.retrievals.pbl_lidar.calculate_modified_gradient_pbl(\n ds, parm=\"backscatter\", threshold=1e-4, smooth_dis=3\n)\n\n# Plot the pbl height estimates\ndisplay = act.plotting.TimeSeriesDisplay(ds, subplot_shape=(2,), figsize=(10, 8))\n\n# plot the CL backscatter before overlaying the Gradient Method PBL Height\ndisplay.plot(\n 'backscatter',\n subplot_index=(0,),\n cmap='ChaseSpectral',\n vmin=-6,\n vmax=6,\n set_title='SGP Ceilometer PBL Height Estimate via Gradient Method',\n)\n\n# overlay the PBL Height estimate, compute ~10min temporal averages\ndisplay.axes[0].plot(\n ds['time'].values,\n ds['pbl_gradient'].rolling(time=38, min_periods=3, center=True).mean().values,\n color='k',\n)\n# shorten the range\ndisplay.set_yrng([0, 2000], subplot_index=(0,))\n\n# plot the CL backscatter before overlaying the Modified Gradient PBL Height\ndisplay.plot(\n 'backscatter',\n subplot_index=(1,),\n cmap='ChaseSpectral',\n vmin=-6,\n vmax=6,\n set_title='SGP Ceilometer PBL Height Estimate via Modified Gradient Method',\n)\n\n# overlay the PBL Height estimate, compute ~10min temporal averages\ndisplay.axes[1].plot(\n ds['time'].values,\n ds['pbl_mod_gradient'].rolling(time=38, min_periods=3, center=True).mean().values,\n color='k',\n)\n# shorten the range\ndisplay.set_yrng([0, 2000], subplot_index=(1,))" ] } ], "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.14.3" } }, "nbformat": 4, "nbformat_minor": 0 }