Calculate and plot daily daytime temperature averagesΒΆ

Example of how to read in MET data and plot up daytime temperature averages using the add_solar_variable function

Author: Adam Theisen

sgpmetE13.b1 temp_mean on 20190101
from arm_test_data import DATASETS
import matplotlib.pyplot as plt

import act

# Read in the sample MET data
met_wildcard_list = [
met_filenames = [DATASETS.fetch(file) for file in met_wildcard_list]
ds =

# Add the solar variable, including dawn/dusk to variable
ds = act.utils.geo_utils.add_solar_variable(ds)

# Using the sun variable, only analyze daytime data
ds = ds.where(ds['sun_variable'] == 1)

# Take daily mean using xarray features
ds = ds.resample(time='1d', skipna=True).mean()

# Creat Plot Display
display = act.plotting.TimeSeriesDisplay(ds, figsize=(15, 10))
display.plot('temp_mean', linestyle='solid')


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

Gallery generated by Sphinx-Gallery