{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Plot AERIoe data with cloud base height from ceilometer\n\nExample to download and plot AERIoe\ntemperature and water vapor overlaying\nceilometer cloud base height(cbh).\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import os\n\nimport matplotlib.pyplot as plt\n\nimport act\n\n# Place your username and token here\nusername = os.getenv('ARM_USERNAME')\ntoken = os.getenv('ARM_PASSWORD')\n\n# Download and read AERIoe and ceilometer data\nif username is None or token is None or len(username) == 0 or len(token) == 0:\n pass\nelse:\n results = act.discovery.download_arm_data(\n username, token, 'sgpaerioe1turnC1.c1', '2022-02-11', '2022-02-11'\n )\n aerioe_ds = act.io.arm.read_arm_netcdf(results)\n results = act.discovery.download_arm_data(\n username, token, 'sgpceilC1.b1', '2022-02-11', '2022-02-11'\n )\n ceil_ds = act.io.arm.read_arm_netcdf(results)\n\n # There isn't information content from the AERI above 3 km\n # Remove data with a height above 3 km\n aerioe_ds = aerioe_ds.sel(height=aerioe_ds.coords['height'] <= 3)\n\n # Convert Ceilometer cloud base height to km\n ceil_ds.utils.change_units(variables='first_cbh', desired_unit='km')\n\n # Remove first_cbh if it is higher than 3 km\n ceil_ds['first_cbh'] = ceil_ds['first_cbh'][~(ceil_ds['first_cbh'] > 3)]\n\n # Create a TimeSeriesDisplay object\n display = act.plotting.TimeSeriesDisplay(\n {'AERIoe': aerioe_ds, 'Ceilometer': ceil_ds}, subplot_shape=(2,), figsize=(20, 10)\n )\n\n # Plot data\n display.plot(\n 'first_cbh',\n dsname='Ceilometer',\n marker='+',\n color='black',\n markeredgewidth=3,\n linewidth=0,\n subplot_index=(0,),\n label='cbh',\n )\n display.plot(\n 'temperature',\n dsname='AERIoe',\n cmap='viridis',\n set_shading='nearest',\n add_nan=True,\n subplot_index=(0,),\n )\n\n display.plot(\n 'first_cbh',\n dsname='Ceilometer',\n marker='+',\n color='black',\n markeredgewidth=3,\n linewidth=0,\n subplot_index=(1,),\n label='cbh',\n )\n display.plot(\n 'waterVapor',\n dsname='AERIoe',\n cmap='HomeyerRainbow',\n set_shading='nearest',\n add_nan=True,\n subplot_index=(1,),\n )\n\n # If you want to save it you can\n # plt.savefig('sgpaerioe1turnC1.c1.20220211.png')\n plt.show()\n\n aerioe_ds.close()\n ceil_ds.close()" ] } ], "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 }