Metar page error in png file (not exists)

Post Reply
agallardo1980

Metar page error in png file (not exists)

Post by agallardo1980 » Tue Mar 05, 2019 8:17 am

Hi all,
Today I see an error in METAR default page (i suppose with current conditions). The icon "icons/clouds9.png" does not exists (error 404). My current METAR condition is: "2019/03/05 07:00 LEBZ 050700Z 00000KT 8000 NSC 10/09 Q1019"
I attach a screenshot:
Captura2.PNG
Captura2.PNG (9.86 KiB) Viewed 5242 times
Captura.PNG
Captura.PNG (12.97 KiB) Viewed 5242 times
I look for this clouds9.png in Meteotemplate DEMO page but it does not exist either. It's a problem with getCloud function with NSC code (Not Significant Clouds):

Code: Select all

<td style="width:40px">
		<img src="<?php echo $pageURL.$path?>icons/clouds<?php echo $clouds[$i]['cov1']?>.png" style="height: 30px"> 
</td>

Code: Select all

  } else if ($first3 == "NSC") {
                      $returner["cov1"] = "9";
                      $returner["cov2"] = "9";
                      $returner["sky"] = "no significant clouds below 5,000 ft\n";
                      $returner["cumulus"] = "no";
Exists this clouds9.png file in somewhere place? :? Could anybody attach this file?
Thank you very much.

User avatar
dmgould
Forecaster
Forecaster
Posts: 173
Joined: Sat Aug 26, 2017 2:43 am
Location: Divide, Colorado, USA
Station model: Davis Pro 2 Plus Wireless
Software: Meteobridge
Contact:

Re: Metar page error in png file (not exists)

Post by dmgould » Tue Mar 05, 2019 8:19 pm

Metar has no cloud coverage 9. It stops with completely overcast as coverage 8 I believe. I think it must be an error by the meteorologist that typed in the coverage condition.
Dave G
Image

andyk1
Professional
Professional
Posts: 433
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: Metar page error in png file (not exists)

Post by andyk1 » Wed Mar 06, 2019 10:11 am

dmgould wrote: Tue Mar 05, 2019 8:19 pm Metar has no cloud coverage 9. It stops with completely overcast as coverage 8 I believe. I think it must be an error by the meteorologist that typed in the coverage condition.
Yes correct or a url has changed and would need to be updated. Without a good url to your site it's hard to see what is going on or if it's been solved.

Andy

P.S. I think I accidently hit the "report this post" by mistake instead of the quote. Sorry dmgould and Jachym please disregard the error.
Image

agallardo1980

Re: Metar page error in png file (not exists)

Post by agallardo1980 » Wed Mar 06, 2019 7:23 pm

Sorry, but I disagree. If you see the php code, it is assigned to the METAR code "NSC" (which exists and is valid), the number "9" in icons/clouds<? Php echo $clouds[$i]['cov1']?>.png, that is, search for clouds9.png. Therefore, it is an error in the Meteotemplate PHP code, which does not have the valid file clouds9.png in icons folder when the METAR reports "NSC".

andyk1
Professional
Professional
Posts: 433
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: Metar page error in png file (not exists)

Post by andyk1 » Fri Mar 08, 2019 1:55 am

I see you posted your link which makes it easier to look at what you mean but as of now I do not see which metar block you are referring to and will take a guess that it is metarWeather block? is that correct?

Again I agree with dngould "Metar has no cloud coverage 9. It stops with completely overcast as coverage 8 I believe. I think it must be an error by the meteorologist that typed in the coverage condition".

There is no cloud9 in the icons fold and just goes to 8. If you look at my page I added it to bottom center block for you to see. As you can see.... it is working for me. I hope we are both talking about the same block.

Andy
Image

agallardo1980

Re: Metar page error in png file (not exists)

Post by agallardo1980 » Fri Mar 08, 2019 7:18 pm

Hi.
In this moment all is correct because my near METAR station is not reporting this "NSC" code. I agree with 8/8 is the max cloud coverage (100%), so that 9 value in Meteotemplate code is a bug:

Look for in this file for see the bug i referer:
/template/pages/metar/metarAjax.php (line 480):

Code: Select all

<img src="<?php echo $pageURL.$path?>icons/clouds<?php echo $clouds[$i]['cov1']?>.png" style="height: 30px"> 
Refer a img html tag with .png file depends of $clouds[$i]['cov1'] variable. Look for this variable in the next file:
/template/pages/metar/phpmyeasyweather.inc (lines 988-1018):

Code: Select all

                   switch ($first3) {
                          case "FEW":
                               $returner["cov1"] = "1";
                               $returner["cov2"] = "2";
                               $returner["sky"] = "few clouds at ";
                               break;
                          case "SCT":
                               $returner["cov1"] = "3";
                               $returner["cov2"] = "4";
                               $returner["sky"] = "partly cloudy at ";
                               break;
                          case "BKN":
                               $returner["cov1"] = "5";
                               $returner["cov2"] = "7";
                               $returner["sky"] = "mostly cloudy at ";
                               break;
                          case "OVC":
                               $returner["cov1"] = "8";
                               $returner["cov2"] = "8";
                               $returner["sky"] = "sky overcast at ";
                               break;
                   }
                   if (($first3 == "SKC") || ($first3 == "CLR")) {
                      $returner["cov1"] = "0";
                      $returner["cov2"] = "0";           // they hadn´t an option in switch
                      $returner["sky"] = "sky clear";    // oh my god think about that construction!
                      $returner["cumulus"] = "no";
                   } else if ($first3 == "NSC") {
                      $returner["cov1"] = "9";
                      $returner["cov2"] = "9";
                      $returner["sky"] = "no significant clouds below 5,000 ft\n";
                      $returner["cumulus"] = "no";
If you can see, the variable number depends of code METAR, OVC (Overcast) is 8, BKN (Broken) is 5 to 7, etc. but later (last lines) in "NSC" code (Not significant clouds) the variable is equal to 9 in the code
this is $returner[cov1] = 9 in this code when METAR report "NSC" code. If you find any METAR station that in that moment reports this NSC code you can reproduce this error with clouds9.png 404 error file not found.

P.D. Sorry for my bad english :D maybe I did not explain myself very well the first time

andyk1
Professional
Professional
Posts: 433
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: Metar page error in png file (not exists)

Post by andyk1 » Fri Mar 08, 2019 7:59 pm

Yes I see what you mean now. I also could not find "9" serching through all the icon folders. I am guessing this is an error at cloud9 being added by mistake. Not exactly sure what the intended icon is supposed to point to. Send Jachym a message.

Andy.
Image

Post Reply