Author Topic: MBtag rain0total-count  (Read 151 times)

0 Members and 1 Guest are viewing this topic.

Offline hymrog

  • Senior Member
  • **
  • Posts: 56
    • Gahanna Weather
MBtag rain0total-count
« on: April 21, 2024, 10:44:26 AM »
Hi -

I am trying to implement a new Meteobridge template
Code: [Select]
rain0total-count the template is designed to count the number of rain days for a given period ie month/year   However, when adding the template to MBtags-template.txt file
Code: [Select]
wvar rain0total-mcount
wvar rain0total-ycount
  instead of getting the count it looks the it is returning inches of rain instead of the actual day count.  However, if you convert the returned amount in to millimeters the correct day count is returned(with slight rounding).

Example using the noted tags above. 

MBtags.php returns:

Code: [Select]
rain0total-mcount|0.35|// :|: for the current month when converted to mm is 8.9 when rounded to the nearest whole number matches the current rain days, 9, for the month April
Code: [Select]
rain0total-ycount|1.81| for the current year when converted to mm is 45.9 when rounded to the nearest whole number is 46 which is the count of rain days for 2024

I cant quite track down how the calculation is being made so of anyone has any insight it would be appreciated.

g



Offline Mattk

  • Forecaster
  • *****
  • Posts: 2160
Re: MBtag rain0total-count
« Reply #1 on: April 21, 2024, 02:53:39 PM »
Have you done a "reconstruct" command on the "Database - Administration" tab?

Offline hymrog

  • Senior Member
  • **
  • Posts: 56
    • Gahanna Weather
Re: MBtag rain0total-count
« Reply #2 on: April 21, 2024, 04:43:24 PM »
 I did a reconstruct when I added the templates to my NOAA reports when the new templates were first introduced as they were not supplying data.

I will give it a try and report back.

g

Offline hymrog

  • Senior Member
  • **
  • Posts: 56
    • Gahanna Weather
Re: MBtag rain0total-count
« Reply #3 on: April 21, 2024, 05:15:44 PM »
The reconstruct of the database did not solve the problem.

g
« Last Edit: Yesterday at 06:37:25 AM by hymrog »

Offline hymrog

  • Senior Member
  • **
  • Posts: 56
    • Gahanna Weather
Re: MBtag rain0total-count
« Reply #4 on: Today at 09:51:35 AM »
Had time to look at this a little further.  It looks like the rain0total-count template thinks it is actually rain being recorded when in fact it should be the count of rain days for the month.

If you set the Settings.php file to
Code: [Select]
$SITE['uomRain'] = 'mm' the correct day count is returned in the MBtags.php. 

Just curious if anyone knows what file has the rain conversion.  I am think a function could be written to look for the count/mcount/ycount/acount that would give the correct information for that particular template.

g