Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

RTMC & Montly Averages


willh Jul 26, 2011 03:44 AM

Hello everyone,

I'm recently knew to the RTMC software and am having a little difficulty making a few functions for my professor that has me working on our local mesonet here at texas a&m.

What he would like me to show using our data is:

Monthly Rainfall Totals
Year to Date Rainfall Totals
Monthly Max/Min Temp.
Average Monthly Max/Min Temp.

I know there is a few average functions available but I'm not sure what are the arguments for it since the manual is not really helpful. If you could write one of the functions out and tell me how to edit it to get the others or just get them all that would be very helpful.

Thanks,
William Hatheway
senior meteorology student
Texas A&M University

* Last updated by: willh on 7/25/2011 @ 9:46 PM *


jtrauntvein Jul 26, 2011 05:04 PM

I have put together an expression to calculate monthly rainfall totals for the past year. This expression also converts from millimetres to inches:

StartRelativeToNewest(52 * nsecPerWeek, orderCollected); alias(rain, "LoggerNet:logan-nw-ip.OneDay.Rain_Tot"); TotalOverTimeWithReset(rain * 0.03937, Timestamp(rain), RESET_MONTHLY)

This same expression can be changed to yield the year to date total by replacing RESET_MONTHLY with RESET_YEARLY. The alias merely serves to simplify the expression somewhat.

The AvgRunOverTimeWithReset(), MaxRunOverTimeWithReset() and MinRunOverTimeWithReset() functions expect the same arguments (value, time stamp, reset_option) and will yield the values of the average, maximum, and minimum values over the specified time periods.


nkruger Nov 15, 2011 12:26 PM

Dear clever people

I am not sure if William's issue has been solved. I have a similar problem that I need assistance with.

I have a table of daily data (say Temp_Max) downloaded with LoggerNet and stored with LNDB. I process the data with RTMC and post a PNG to an external web.

My client requires us to display the monthly average for this value for the current partial month, as well as the previous 5 months either as values or as a bargraph. This implies there should be the following 6 values after the calculations.
[avg for current partial month:Nov],[avg for month-1:Oct],[avg for month-2:Sept],..,[avg for month-5:xxx]

Advice/tips/recipe will be greatly appreciated.

Neels


newtoLoggernet4 Jan 18, 2012 12:45 PM

Can some one answer this post please?


smh Aug 9, 2012 02:36 PM

Not sure if anyone wants this any more but I've been playing with the above.
To get the daily total using the TotalOverTimeWithReset() function I have found that as the function returns >1 value you need to use something like a Time Series Chart with appropriately dimensioned time axis/range. Using just a digital display will get the right numbers but they will overwrite eachother as the more recent values get calculated !

So in the Select Data text box of the Chart I entered

Alias(N,"Server:CR1000.Table1.Rain_mm_Tot");
StartAtTime(FormatTime(SystemTime() - (3 * nSecPerDay),$"%n 00:00:00"),OrderCollected);
TotalOverTimeWithReset(N,TimeStamp(N),RESET_DAILY)

Explanation - I have only 3 day's worth of data but this should give the idea. The StartAtTime modifier takes off 3 days from the current time and uses just the date part and "hard codes" midnight (as"00:00:00"). The alias just makes it easier to see (hopefully)

The other Avg, Min, Max functions should all work in the same way. Of course the "monthly" thing might be difficlut as you can't just take off 28/30/31 days from SystemDate()


AMK Aug 9, 2012 03:09 PM

I don't think anyone will ever get tired of RTMC code. Thanks for posting!

AMK


AMK Nov 4, 2012 04:14 AM

Sorry to bump this post up, but is there a way to specify when the "year" in RESET_YEARLY starts? Ie. The water year in the Western US starts Oct 1, and it would ideal to be able to specify that as the start date. Is that possible?

Thanks

Log in or register to post/reply in the forum.