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.

Accumulate Precipitation in RTMC


jeremy Feb 6, 2013 04:45 PM

I am attempting to plot an event-based accumulation of 10-min precipitation data. I have a CR1000 datalogger with current firmware, Loggernet, and RTMC Pro.
Basically, I would like to plot on a time series, cumulative rainfall totals for a given event. Where an event is comprised of a variable period of measurable precip, preceded AND followed by a period of no precip, or 0.0 values.

I am unsure as to how to write a function which can accurately assess a variable length of time in RTMC, while still accounting for the fact that a precipitation event could have >1 record (10 min. time period) with 0 measured precipitation within the bounds of an event.

Thank you in advance for your help!


jeremy Feb 27, 2013 12:28 AM

Ideas? Thank you in advance!!!


Grant Feb 28, 2013 11:40 PM

Jeremy

I would use a conditional statement to write to a variable within the program of the CR1000 and get RTMC to plot that.

Cheers

Grant


Britt Mar 20, 2013 03:22 PM

Jeremy,

I'm currently looking to do the same. Any break-through in your endeavor?

---Britt


jeremy Mar 25, 2013 07:17 PM

Britt,
No such breakthrough yet. I have accepted that I may have to include a new variable in the datalogger program. It is difficult to accumulate any type of variable in the RTMC front end.

I have a colleague who will be attending a Campbell Sci. coding bootcamp next month. I am hoping he will find a solution while he is there. I will pass on what I find out!

-Jeremy


tmecham Mar 27, 2013 02:56 AM

Have you looked at the TotalOverTimeWithReset function?


Britt Mar 27, 2013 05:39 PM

Yes, I've worked with the TotalOverTimeWithReset function in Shortcut. Currently, I have it running a 24 hr rain total for each day's weather summary.

The break-down in my understanding of ShortCut / RTMC Pro is in setting up this data collection as an event. Here is the criteria for a storm event (this may not be exactly as Jeremy has stated but it's along the same ideas):

1. Start collecting when rain measurement > 0
2. Perform and collect rain totals at an interval of 5 minutes
3. Stop collecting when the 5 min rain totals = 0 for 24 hrs.
4. Data collected in (2) must be >= 0.25" to be considered a significant storm event.


jeremy Mar 27, 2013 08:35 PM

I just took a look at this function - TotalOverTimeWithReset. All I get is the most recent value, not a total for the past day. Here is my test code, straight from RTMC's documentation.

TotalOverTimeWithReset("Variable",TimeStamp("Variable"),Reset_Daily)

Tmecham: If you have any insight as to why this is not working, I would love to hear it!

-Jeremy


jra Mar 27, 2013 08:45 PM

This is a programming solution, not RTMC. Use the DataEvent() instruction in your event driven DataTable. See https://www.campbellsci.com/tips-dataevent

Be sure to specify a fixed Table Size in your DataTable() instruction.

Janet

* Last updated by: Janet on 4/9/2013 @ 2:49 PM *


Britt Mar 28, 2013 04:47 PM

Okay. I think I've figured it out. As Janet was saying, you definitely have to program this into ShortCut or CRBasicEditor. I used ShortCut to create a new table which I named Storms. I selected the check box that reads "Advanced Outputs" under the selected sensors table. In the section that shows up as a result, "Store Based On: ", I have two requirements:

1. Time - 5 seconds into a 300 second (5 min) interval
2. Data Event - Records Before: 0,
Trigger: Rain_in > 0
Stop Trigger: Rain_in = 0
Records After: 17280 (---> 24 hours if records are taken in 5 minute intervals)

Please feel free to correct my programming - CSci programming is VERY new to me. I'll post results of testing this table as well.


jra Mar 28, 2013 05:46 PM

re: 1. Time - most people use 0 into the interval. That writes the record at the top of the 5 minutes.
The way you have it the interval would go from say 1:00:05 to 1:05:05 in hh:mm:ss format.

re: Records After - A record is a line of data written to your DataTable. In your example records are written every 5 minutes. 24 hours worth of 5 minute data is 288 records (24*60/5).

Let us know how it works out.
Janet


Britt Mar 29, 2013 03:20 PM

Thanks for the corrections!


IslandMan Apr 2, 2013 03:08 PM

Try this:
StartRelativeToNewest(nsecPerDay*1,OrderCollected);
TotalOverTimeWithReset("AdamsEnv_Table60:Table60.Rain",
Timestamp("AdamsEnv_Table60:Table60.Rain"),RESET_DAILY)

You have to point to the data in your table name using this example "AdamsEnv_Table60:Table60.Rain"

Good Luck

* Last updated by: IslandMan on 4/2/2013 @ 9:09 AM *


Britt Apr 3, 2013 04:29 PM

Almost got it working perfectly. The only problem is that it records 288 records after the first nonzero record regardless of whether there is nonzero numbers after the first.

EXAMPLE:
Record #1: 0.01"
Record #2: 0"
Record #3: 0.02"
Record #4: 0"
Record #5: 0"
....Record #288: 0"
(STOP RECORDING)

Instead, I'd like it to reset its 288 counter after the last nonzero record. So, in the example it should go to Record #291 instead of #288.

Any suggestions? (Also note that I'm using Shortcut and not CRBASIC. I've already written 95% of the other calculations within Shortcut - So I'd really prefer not to switch over to CRBASIC unless absolutely necessary)


Thanks for all the help from everyone!
-Britt


jra Apr 9, 2013 09:02 PM

Britt,
It looks like you're using the DataEvent under Advanced Outputs in ShortCut. Once the StopTrigger condition is met the datalogger goes does not again look for the StartTrigger until all the records after have been written. So, you'll need to specify a different StopTrigger that is controlled in the program, which means you'll need to do this part in the CRBasic editor.

This is what I came up with:
DataTable (RainEvent,True,1000)
DataEvent (2,RainEvent=true,RainEvent=false,2)
DataInterval (0,1,Min,10)
Totalize (1,Rain,FP2,False)
EndTable

BeginProg
Scan (1,Sec,0,0)

...measurement instructions including rain gauge

If Rain>0 Then
RainEvent = true
counter = 0 'reset counter each time there is new rain
EndIf
If RainEvent = true
counter = counter + 1
EndIf
If counter >=300 Then RainEvent = false ' 300 = 5 minutes of 1 second measurements

CallTable (RainEvent)
NextScan
EndProg

You can send me an email off list (jalbers at campbellsci dot com) and I'll help you work that into your program.

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