angeldhs00 Posted November 13, 2023 Posted November 13, 2023 Hi, I am trying to download data through the OpenDap service without success. I am making the request in anaconda python 3.11 in spyder environment using wget request package and I am getting the following URLError: <urlopen error [SSL: TLSV1_ALERT_INTERNAL_ERROR] tlsv1 alert internal error (_ssl.c:1002)>. I'm not sure why this is because I haven't had any problems before. I'm trying to make any simple API request.
Neil Davis Posted November 13, 2023 Posted November 13, 2023 What is the URL you are trying to access? The OpenDap service has been removed, about a year ago, after we restructured our data on the backend. You should now use the daTap interfaces explained in the forum post below for accessing the data.
angeldhs00 Posted November 13, 2023 Author Posted November 13, 2023 Yes, I am trying with that service. My request is wget('https://wps.neweuropeanwindatlas.eu/api/mesoscale-ts/v1/get-data-point?latitude=53.800651&longitude=3.955078&variable=WD10&variable=WS10&dt_start=2018-12-20T00:00:00&dt_stop=2018 -12-31T23:30:00') I am coding this link to be able to make different downloads in an application.
Neil Davis Posted November 13, 2023 Posted November 13, 2023 I think the issue is that the library you are using is quite old and only supports TLSv1. We have recently disabled TLSv1 and TLSv2. There is also a space between 2018 and -12 in the dt_stop variable of the URL you pasted above. Here is a script using python3 that I used to download and save the file to a named temporary file. from urllib.request import urlopen from shutil import copyfileobj from tempfile import NamedTemporaryFile url = 'https://wps.neweuropeanwindatlas.eu/api/mesoscale-ts/v1/get-data-point?latitude=53.800651&longitude=3.955078&variable=WD10&variable=WS10&dt_start=2018-12-20T00:00:00&dt_stop=2018-12-31T23:30:00' with urlopen(url) as fsrc, NamedTemporaryFile(delete=False) as fdst: copyfileobj(fsrc, fdst)
angeldhs00 Posted November 13, 2023 Author Posted November 13, 2023 Yes, you are right, the problem was the wget module, with urlretrive I haven't had any problems, thank you!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now