Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API says it's cloudy when it's sunny #72

Closed
DonaldDuck313 opened this issue Jul 21, 2022 · 8 comments
Closed

API says it's cloudy when it's sunny #72

DonaldDuck313 opened this issue Jul 21, 2022 · 8 comments

Comments

@DonaldDuck313
Copy link

DonaldDuck313 commented Jul 21, 2022

The API says that it's cloudy right now (July 21st 2022 at 13.00) in Lund, Sweden (latitude 55.42N, longitude 13.11E), but in reality it's sunny. If I make a request to https://api.open-meteo.com/v1/forecast?latitude=55.42&longitude=13.11&timezone=Europe/Stockholm&current_weather=true&hourly=cloudcover,weathercode, it says that the weathercode is 3 which means it's cloudy and that the cloudcover is 100%. But in reality, it's sunny and there are hardly any clouds at all. If I look out the window, it looks like the weathercode should be 0 and the cloudcover should be less than 5%.

This is the JSON it returns:

{"latitude":55.42,"longitude":13.119999,"generationtime_ms":2.655029296875,"utc_offset_seconds":7200,"elevation":27.0,"current_weather":{"temperature":26.6,"windspeed":22.1,"winddirection":164.0,"weathercode":3.0,"time":"2022-07-21T13:00"},"hourly_units":{"time":"iso8601","cloudcover":"%","weathercode":"wmo code"},"hourly":{"time":["2022-07-21T00:00","2022-07-21T01:00","2022-07-21T02:00","2022-07-21T03:00","2022-07-21T04:00","2022-07-21T05:00","2022-07-21T06:00","2022-07-21T07:00","2022-07-21T08:00","2022-07-21T09:00","2022-07-21T10:00","2022-07-21T11:00","2022-07-21T12:00","2022-07-21T13:00","2022-07-21T14:00","2022-07-21T15:00","2022-07-21T16:00","2022-07-21T17:00","2022-07-21T18:00","2022-07-21T19:00","2022-07-21T20:00","2022-07-21T21:00","2022-07-21T22:00","2022-07-21T23:00","2022-07-22T00:00","2022-07-22T01:00","2022-07-22T02:00","2022-07-22T03:00","2022-07-22T04:00","2022-07-22T05:00","2022-07-22T06:00","2022-07-22T07:00","2022-07-22T08:00","2022-07-22T09:00","2022-07-22T10:00","2022-07-22T11:00","2022-07-22T12:00","2022-07-22T13:00","2022-07-22T14:00","2022-07-22T15:00","2022-07-22T16:00","2022-07-22T17:00","2022-07-22T18:00","2022-07-22T19:00","2022-07-22T20:00","2022-07-22T21:00","2022-07-22T22:00","2022-07-22T23:00","2022-07-23T00:00","2022-07-23T01:00","2022-07-23T02:00","2022-07-23T03:00","2022-07-23T04:00","2022-07-23T05:00","2022-07-23T06:00","2022-07-23T07:00","2022-07-23T08:00","2022-07-23T09:00","2022-07-23T10:00","2022-07-23T11:00","2022-07-23T12:00","2022-07-23T13:00","2022-07-23T14:00","2022-07-23T15:00","2022-07-23T16:00","2022-07-23T17:00","2022-07-23T18:00","2022-07-23T19:00","2022-07-23T20:00","2022-07-23T21:00","2022-07-23T22:00","2022-07-23T23:00","2022-07-24T00:00","2022-07-24T01:00","2022-07-24T02:00","2022-07-24T03:00","2022-07-24T04:00","2022-07-24T05:00","2022-07-24T06:00","2022-07-24T07:00","2022-07-24T08:00","2022-07-24T09:00","2022-07-24T10:00","2022-07-24T11:00","2022-07-24T12:00","2022-07-24T13:00","2022-07-24T14:00","2022-07-24T15:00","2022-07-24T16:00","2022-07-24T17:00","2022-07-24T18:00","2022-07-24T19:00","2022-07-24T20:00","2022-07-24T21:00","2022-07-24T22:00","2022-07-24T23:00","2022-07-25T00:00","2022-07-25T01:00","2022-07-25T02:00","2022-07-25T03:00","2022-07-25T04:00","2022-07-25T05:00","2022-07-25T06:00","2022-07-25T07:00","2022-07-25T08:00","2022-07-25T09:00","2022-07-25T10:00","2022-07-25T11:00","2022-07-25T12:00","2022-07-25T13:00","2022-07-25T14:00","2022-07-25T15:00","2022-07-25T16:00","2022-07-25T17:00","2022-07-25T18:00","2022-07-25T19:00","2022-07-25T20:00","2022-07-25T21:00","2022-07-25T22:00","2022-07-25T23:00","2022-07-26T00:00","2022-07-26T01:00","2022-07-26T02:00","2022-07-26T03:00","2022-07-26T04:00","2022-07-26T05:00","2022-07-26T06:00","2022-07-26T07:00","2022-07-26T08:00","2022-07-26T09:00","2022-07-26T10:00","2022-07-26T11:00","2022-07-26T12:00","2022-07-26T13:00","2022-07-26T14:00","2022-07-26T15:00","2022-07-26T16:00","2022-07-26T17:00","2022-07-26T18:00","2022-07-26T19:00","2022-07-26T20:00","2022-07-26T21:00","2022-07-26T22:00","2022-07-26T23:00","2022-07-27T00:00","2022-07-27T01:00","2022-07-27T02:00","2022-07-27T03:00","2022-07-27T04:00","2022-07-27T05:00","2022-07-27T06:00","2022-07-27T07:00","2022-07-27T08:00","2022-07-27T09:00","2022-07-27T10:00","2022-07-27T11:00","2022-07-27T12:00","2022-07-27T13:00","2022-07-27T14:00","2022-07-27T15:00","2022-07-27T16:00","2022-07-27T17:00","2022-07-27T18:00","2022-07-27T19:00","2022-07-27T20:00","2022-07-27T21:00","2022-07-27T22:00","2022-07-27T23:00"],"cloudcover":[7.0,15.0,55.0,13.0,27.0,50.0,2.0,5.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,85.0,100.0,100.0,0.0,67.0,86.0,35.0,68.0,76.0,94.0,90.0,96.0,100.0,94.0,95.0,83.0,90.0,92.0,85.0,88.0,84.0,95.0,95.0,100.0,100.0,98.0,99.0,100.0,100.0,45.0,26.0,68.0,72.0,98.0,100.0,100.0,100.0,100.0,96.0,95.0,100.0,97.0,99.0,96.0,96.0,91.0,93.0,94.0,95.0,99.0,100.0,94.0,100.0,91.0,76.0,69.0,70.0,93.0,85.0,76.0,62.0,70.0,64.0,100.0,100.0,59.0,36.0,43.0,30.0,13.0,41.0,70.0,98.0,97.0,95.0,94.0,92.0,91.0,89.0,76.0,62.0,48.0,42.0,37.0,31.0,45.0,59.0,74.0,62.0,51.0,40.0,28.0,16.0,4.0,32.0,59.0,87.0,91.0,96.0,100.0,97.0,95.0,92.0,90.0,89.0,88.0,91.0,94.0,97.0,97.0,98.0,98.0,100.0,100.0,99.0,100.0,100.0,100.0,100.0,100.0,100.0,91.0,82.0,74.0,74.0,75.0,75.0,75.0,75.0,75.0,59.0,44.0,29.0,48.0,67.0,86.0,79.0,73.0,66.0,57.0,48.0,39.0,38.0,38.0,37.0,34.0,30.0,27.0,20.0,13.0,6.0],"weathercode":[0.0,1.0,1.0,1.0,1.0,2.0,0.0,0.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,1.0,2.0,3.0,1.0,2.0,2.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,2.0,1.0,2.0,2.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,2.0,2.0,2.0,3.0,3.0,2.0,2.0,2.0,2.0,3.0,3.0,2.0,1.0,1.0,1.0,1.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,2.0,2.0,2.0,1.0,1.0,1.0,2.0,2.0,2.0,1.0,1.0,1.0,0.0,0.0,0.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,80.0,80.0,80.0,3.0,3.0,3.0,3.0,3.0,3.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,1.0,1.0,1.0,3.0,3.0,3.0,2.0,2.0,2.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0]}}

This is not the first time this happens, it's happened before that it said it's cloudy when it's sunny, both at this location and at other locations.

@open-meteo
Copy link
Collaborator

Hi @DonaldDuck313,

my first guess was as well, that there might be something wrong with the data. As I looked closer to the coordinates, I spotted a common mistake.

Lund is at 55° 42' N, 13° 11' E. This is a DMS coordinate in minutes and seconds. The API is using the decimal DD format. The correct decimal coordinate would be 55.70 N, 13.191 E.

32 kilometers difference could explain the wrong weather forecast.

MSP423516ddeh68cg1588f5000044f76hh31f31c7hc

Could you check, if the forecast is getting better with the correct decimal coordinate?

I will also think about improving the API documentation, as this is a quickly overlooked error.

Best, Jeff

@DonaldDuck313
Copy link
Author

The app I'm making uses Android's Location.getLatitude() and Location.getLongitude() methods which seem to return the correct format (they return a double so that's the only thing that would make sense). So even though the link I sent you was incorrect, I'm quite sure the coordinates my app was using were correct.

Also at the same time as it sends a request to the API, my app also sends a request to Google's API to get the town name which says "Lund", so I'm quite sure there was nothing wrong with the location.

@cmetz
Copy link

cmetz commented Aug 11, 2022

I also have trouble with the WMO code. I also receive a 3 for cloudy, but it's sunny outside, maybe some high thin clouds, but not really cloudy. so maybe this codes just means it gets cloudier as described in:

https://artefacts.ceda.ac.uk/badc_datadocs/surface/code.html

code 4677 / 4680:

00 - Cloud development not observed or not observable
01 - Cloud generally dissolving or becoming less developed
02 - State of sky on the whole unchanged
03 - Clouds generally forming or developing

but i don't know how to determine the current cloud level.

maybe we need code 2700 for this:

WMO code 2700: Cloud cover / amount

/ - cloud is indiscernible for reasons other than fog or other meteorological
phenomena, or observation is not made.
0 - sky clear
1 - 1 okta : 1/10 - 2/10
2 - 2 oktas : 2/10 - 3/10
3 - 3 oktas : 4/10
4 - 4 oktas : 5/10
5 - 5 oktas : 6/10
6 - 6 oktas : 7/10 - 8/10
7 - 7 oktas or more, but not 8 oktas : 9/10 or more, but not 10/10
8 - 8 oktas : 10/10
9 - sky obscured by fog or other meteorological phenomena

update

it seems that you can get this values by using this options, for the hourly weather, but they are note included in the current weather option:

cloudcover         Instant 	% 	Total cloud cover as an area fraction
cloudcover_low     Instant 	% 	Low level clouds and fog up to 3 km altitude
cloudcover_mid     Instant 	% 	Mid level clouds from 3 to 8 km altitude
cloudcover_high    Instant 	% 	High level clouds from 8 km altitude

also the overall cloudcover is very "aggressive", i get nearly 100% but the mid and lower clouds are nearly at 0%, so maybe just using the cloudcover_low seems to correspond better to the impression of a person. But I am not a metrologist. :)

@patrick-zippenfenig
Copy link
Member

The weathercode is supposed to be an instantaneous value. Of course there are forecast inaccuracies. @cmetz for which coordinates did you observe this?

While it is sunny and the weather code was indicating cloudy, did you see also high cloud cover values in low, mid and. high cloud cover values?

In the next months there will be additional weather forecast domains from more national weather services implemented. Depending on your area of interest, they can improve forecasts.

@cmetz
Copy link

cmetz commented Aug 12, 2022

@patrick-zippenfenig Yesterday i used Magdeburg (GER) as location. the current weathercode from the api was 3 and the forecast weather was reporting 100% high clouds and 0% for the others at this point in time. there were some high clouds, but all other weather sites reported the current weather as sunny e.g. https://wttr.in/

i currently use this API call, to only fetched the current_weather, but I'm not sure if this is only returning the least current forecast, or the last reported actual weather:
https://api.open-meteo.com/v1/forecast?latitude=52.12773&longitude=11.62916&current_weather=true&timeformat=unixtime

here are some screenshots from yesterday:

open-meteo api:
image

https://www.timeanddate.de/wetter/deutschland/magdeburg/rueckblick
image

@patrick-zippenfenig
Copy link
Member

Right now, it is only returning the least recent forecast hour. In Germany updates happen every 3 hours (Data from Germany weather service DWD, model ICON-D2). I am a bit surprised that it is showing that many high clouds while it is sunny. Were there still scattered cirrus clouds?

Arguably, even at full high cloud cover it could still be fair weather. In case of ICON-D2 the weather code is directly supplied by DWD as-well. I could modify the weather code in those conditions, but I am not sure if this is worsening forecast for other locations.

There are some improvements coming in the next months:

  • DWD MOSMIX for 1h updates for larger cities
  • Additional weather models from other national weather services

Could you compare the weather forecast for the next couple of days and report back? So far I do not see a systematic error other than the forecast just being wrong from the German weather service

@cmetz
Copy link

cmetz commented Aug 15, 2022

Ah, now I understand. I thought current_weather was not a forecast, but the last current weather conditions. Is there currently a possibility to query the actual current weather e.g. every 3 hours and are then "outdated" values still the forecast at that time, or are they replaced by the actual weather conditions?

It just surprised me that values in the past just significantly deviate from the weather conditions at that time, but if they are just the old forecast values then that's totally fine. :)

@patrick-zippenfenig
Copy link
Member

Closing for cleanup. Feel free to reopen if you have more questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants