日照时数/分钟从天气API获取

huangapple go评论63阅读模式
英文:

daily sunshine hours/ minutes from weather API

问题

I am currently using the meteostat weather API and extracting data, but I see that sunshine minutes are NaN for mostly all the countries. Am I doing something wrong? Should I look for a Paid weather API? My major focus is Sunshine minutes or hours per day for the last 3 years.

I'm using the below code snippet:

!pip install meteostat

# Import Meteostat library and dependencies
from datetime import datetime
import matplotlib.pyplot as plt
from meteostat import Stations, Daily

# Set time period
start = datetime(2016, 1, 1)
end = datetime(2022, 12, 31)

# Get daily data
data = Daily('06660', start, end)
data = data.fetch()

data

Where '06660' is the weather station WMO code for Switzerland. Thank you in advance.

英文:

I am currently using meteostat weather API and extracting data, but I see that sunshine minutes is NaN for mostly all the countries. Am I doing something wrong? Should I look for a Paid weather API? my major focus is Sunshine minutes or hours per day for last 3 years.

I m using the below code snippet

!pip install meteostat

# Import Meteostat library and dependencies
from datetime import datetime
import matplotlib.pyplot as plt
from meteostat import Stations, Daily

# Set time period
start = datetime(2016, 1, 1)
end = datetime(2022, 12, 31)

# Get daily data
data = Daily('06660', start, end)
data = data.fetch()

data

where 06660 is the weather station WMO code for Switzerland. Thank you in advance.

答案1

得分: 1

我在meteostat文档和GitHub上的问题中进行了一些调查。如果你将天气站从你正在使用的更改为文档中提供的天气站示例tsun的值不会是NaN。你可以看到正确的数据。所以这可能不是你的代码的问题,而只是你所使用的天气站的tsun数据不可用。在他们的GitHub 仓库上的这个问题中,meteostat的创始人评论

不幸的是,我们无法做太多事情。 tsun是大多数天气站覆盖不好的参数之一。我们只能尝试在未来融入更多数据源。但可能是这个地区的天气站简单地没有这些数据可用。

英文:

I did some digging in the meteostat documentation and issues on github. If you change the weather station from the one you're using to the one given in the documentation example, values of tsun aren't NaN. You are able to see proper data. So it's probably not an issue with your code but simple the tsun data for your weather station isn't available. In this issue on their Githib repo, the Founder of meteostat has commented saying

> Unfortunately, there isn't much we can do about it. tsun is one of the parameters which isn't well covered by most weather stations. We can only try to incorporate more data sources moving forward. But it might be the data simply isn't available for the weather stations in this area.

huangapple
  • 本文由 发表于 2023年4月11日 15:24:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/75983384.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定