Closed jeppoo1 closed 3 years ago
@pnuu For the record, the following Python program seems to be working:
from fmiopendata.wfs import download_stored_query
model_data = download_stored_query("fmi::forecast::hirlam::surface::obsstations::multipointcoverage",
args=["starttime=2020-07-06T18:00:00Z",
"endtime=2020-07-06T20:00:00Z",
"bbox=18,55,35,75"])
but to my knowledge it is only able to download forecast data for the following 48 hours or so. Is this a limitation of the FMI open data servers, or can it be set in the Python program to download more future forecast data (for example, the next two weeks)?
Sorry for the late reply. The description of the StoredQuery in your second message says that the default query (without start/end times) returns 36 hours, but it doesn't state how long forecasts are available. I'd expect it to be around a week, or probably less than that. In any case, the limitation is at the FMI side.
I'm having problems with downloading FMI forecast data with python (3.9).
The exception shows that the script is trying to use Python 3.8 (32-bit version?). Are you had the correct Python environment in use for the script?
@pnuu Thank you, I didn't notice I had Python 3.8 selected! Now that I selected Python 3.9 and ran your ::harmonie:: code example, I got the following error:
... in <module>
model_data = download_stored_query("fmi::forecast::harmonie::surface::grid",
File "C:\Python39\lib\site-packages\fmiopendata\wfs.py", line 120, in download_stored_query
from fmiopendata.grid import download_and_parse
File "C:\Python39\lib\site-packages\fmiopendata\grid.py", line 31, in <module>
import eccodes
File "C:\Python39\lib\site-packages\eccodes\__init__.py", line 15, in <module>
from .eccodes import *
File "C:\Python39\lib\site-packages\eccodes\eccodes.py", line 12, in <module>
from gribapi import __version__
File "C:\Python39\lib\site-packages\gribapi\__init__.py", line 13, in <module>
from .gribapi import * # noqa
File "C:\Python39\lib\site-packages\gribapi\gribapi.py", line 2228, in <module>
__version__ = grib_get_api_version()
File "C:\Python39\lib\site-packages\gribapi\gribapi.py", line 2218, in grib_get_api_version
raise RuntimeError("Could not load the ecCodes library!")
RuntimeError: Could not load the ecCodes library!
I have confirmed I have both fmiopendata and eccodes installed in Python 3.9 also.
I get same error with python 3.8. Is there any plans to fix this error?
Sorry, haven't had time to do anything with fmiopendata
for months so haven't checked the issues either.
From the error messages I guess you are either missing eccodes
the library, or the Python wrapper for the library. The library can be installed with conda install eccodes
or via your operating systems package manager. The latter can be installed with conda install python-eccodes
or pip install eccodes
. In any case, not related to fmiopendata
, so closing this issue.
Hello, I'm having problems with downloading FMI forecast data with python (3.9).
I'm using your code example from github:
and getting the following error message:
I have eccodes installed, here are the messages for pip install eccodes: