[Thread Prev][Thread Next][Index]

[ferret_users] daily average from hourly data


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, daily

The 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!


Attachment: test1.cdf
Description: Cdf file

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement