Plot a timeseries of sounding data#

This is a simple example for how to plot a timeseries of sounding data from the ARM SGP site.

Author: Robert Jackson

sgpmetE13.b1 wspd_vec_mean on 20190101, sgpmetE13.b1 temp_mean on 20190101, sgpmetE13.b1 rh_mean on 20190101
<xarray.Dataset>
Dimensions:                       (time: 10080)
Coordinates:
  * time                          (time) datetime64[ns] 2019-01-01 ... 2019-0...
Data variables: (12/50)
    base_time                     (time) datetime64[ns] 2019-01-01 ... 2019-0...
    time_offset                   (time) datetime64[ns] 2019-01-01 ... 2019-0...
    atmos_pressure                (time) float32 dask.array<chunksize=(1440,), meta=np.ndarray>
    qc_atmos_pressure             (time) int32 dask.array<chunksize=(1440,), meta=np.ndarray>
    temp_mean                     (time) float32 dask.array<chunksize=(1440,), meta=np.ndarray>
    qc_temp_mean                  (time) int32 dask.array<chunksize=(1440,), meta=np.ndarray>
    ...                            ...
    qc_logger_volt                (time) int32 dask.array<chunksize=(1440,), meta=np.ndarray>
    logger_temp                   (time) float32 dask.array<chunksize=(1440,), meta=np.ndarray>
    qc_logger_temp                (time) int32 dask.array<chunksize=(1440,), meta=np.ndarray>
    lat                           (time) float32 36.6 36.6 36.6 ... 36.6 36.6
    lon                           (time) float32 -97.49 -97.49 ... -97.49 -97.49
    alt                           (time) float32 318.0 318.0 ... 318.0 318.0
Attributes: (12/33)
    command_line:                met_ingest -s sgp -f E13
    process_version:             ingest-met-4.39-0.el6
    dod_version:                 met-b1-7.3
    input_source:                /data/collection/sgp/sgpmetE13.00/Table1.201...
    site_id:                     sgp
    platform_id:                 met
    ...                          ...
    qc_bit_4_assessment:         Indeterminate
    history:                     created by user dsmgr on machine ruby at 201...
    _file_dates:                 ['20190101', '20190102', '20190103', '201901...
    _file_times:                 ['000000', '000000', '000000', '000000', '00...
    _datastream:                 sgpmetE13.b1
    _arm_standards_flag:         1

from matplotlib import pyplot as plt

import act

files = act.tests.sample_files.EXAMPLE_MET_WILDCARD
met = act.io.armfiles.read_netcdf(files)
print(met)
met_temp = met.temp_mean
met_rh = met.rh_mean
met_lcl = (20.0 + met_temp / 5.0) * (100.0 - met_rh) / 1000.0
met['met_lcl'] = met_lcl * 1000.0
met['met_lcl'].attrs['units'] = 'm'
met['met_lcl'].attrs['long_name'] = 'LCL Calculated from SGP MET E13'

# Plot data
display = act.plotting.TimeSeriesDisplay(met)
display.add_subplots((3,), figsize=(15, 10))
display.plot('wspd_vec_mean', subplot_index=(0,))
display.plot('temp_mean', subplot_index=(1,))
display.plot('rh_mean', subplot_index=(2,))
plt.show()

Total running time of the script: ( 0 minutes 0.771 seconds)

Gallery generated by Sphinx-Gallery