Hi,I am trying to calculate daily averages from hourly data with data gaps. A sample data is attached as test1.cdf. I tried the following script to get the daily mean. It only works well for a timeseries without missing data.
use test1.cdf def axis/t="31-jul-2010:23:30":"6-aug-2010:00:30":24/unit=hour/edges mytd set var/bad=1e35 RD_495 let daily=RD_495[gt=mytd@ave] plot RD_495, dailyThe daily mean is defined as the average of 00 to 23 hours of each day. We should have missing values for the daily mean if any hour in that particular day has missing data. The above script simply averages all available data in each day as the mean, which is wrong. Is there a way to count how many good data points in each day so that they can be used as a mask? Or is there a better way to get daily means?
Thanks for any suggestions! Dongxiao
Description: Cdf file