Skip to content

fix hycom download #1048

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

Closed
veenstrajelmer opened this issue Jan 8, 2025 · 1 comment · Fixed by #1077
Closed

fix hycom download #1048

veenstrajelmer opened this issue Jan 8, 2025 · 1 comment · Fixed by #1077

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Jan 8, 2025

test_download_hycom fails for newer python versions, with "RuntimeError: NetCDF: file not found"

Warning messages from test_download_hycom:

xarray opening opendap dataset like: https://tds.hycom.org/thredds/dodsC/GLBu0.08/expt_19.1/2010.html (1 urls/years)
oc_open: server error retrieving url: code=? message="Error {
    code = 500;
    message = "-1008324796";
}"xarray subsetting data (variable 'surf_el' and lon/lat extents)
available time range in dataset from 2010-01-01 00:00:00 to 2010-12-31 00:00:00
xarray subsetting data per <Day>: 2010-01-01
xarray writing netcdf file: hycom_surf_el_2010-01-01.nc
oc_open: server error retrieving url: code=? message="Error {
    code = 500;
    message = "-1008324796";
}

Reproducible code:

import dfm_tools as dfmt
import pandas as pd

longitude_min, longitude_max, latitude_min, latitude_max =    2,   3,  51, 52 #test domain
date_min = '2010-01-01'
date_max = '2010-01-02'
year = pd.Timestamp(date_min).year
dataset_url = [f'https://tds.hycom.org/thredds/dodsC/GLBu0.08/expt_19.1/{year}']
varkey = 'surf_el'
dfmt.download_OPeNDAP(dataset_url=dataset_url,
                      varkey=varkey,
                      longitude_min=longitude_min, longitude_max=longitude_max, latitude_min=latitude_min, latitude_max=latitude_max,
                      date_min=date_min, date_max=date_max,
                      dir_output=".", overwrite=True)

Interestingly enough, this issue does not occur when passing dataset_url as a string instead of a list of one string.

Some different versions (py39 vs py311):

  • dask 2024.8.0 vs 2024.12.1
  • erddapy 2.2.0 vs 2.2.3
  • pydap 3.5 vs 3.5.3
  • pystac 1.10.1 vs 1.11.0
  • scipy 1.13.1 vs 1.15.0
  • urllib3 1.26.20 vs 2.3.0
  • xarray 2024.7.0 vs 2025.1.0
  • zarr 2.18.2 vs 2.18.4

py39_success.txt
py311_fail.txt

@veenstrajelmer veenstrajelmer linked a pull request Jan 22, 2025 that will close this issue
@veenstrajelmer
Copy link
Collaborator Author

veenstrajelmer commented Jan 22, 2025

Was suddenly resolved with fresh environment created on 21-1-2025, changes:

  • dask 2025.01
  • scipy 1.15.1
  • xarray 2025.1.1

Not sure what the cause was, but if it works it works

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

Successfully merging a pull request may close this issue.

1 participant