Open Elcook opened 1 year ago
It looks like a recent bug in netcdf, maybe you can downgrade that package.
I also get the same problem when updating my environment, and so that netCDF version is 1.6.3 I tried then to downgrade to netCDF 1.6.2 (working on another machine), but same problem. Also downgrading Xarray to 2022.12.0 (working on another machine) did not work. Then not sure how to fix this?
Would it be possible that the problem comes from the netCDF library, and not from the netCDF4 python module?
I'm assuming that because ncdump works outside the conda environment ( netcdf library version 4.7.0 ) but fails inside it (netcdf library version 4.9.2).
Anyway, I will try to test this and report here
I can make this work for me with conda and netcdf4=1.6.1
I can make this work for me with conda and netcdf4=1.6.1
You are correct, it worked for me too, even with netcdf library version 4.9.2.
Ok, I have now temporarily locked netcdf4 to <=1.6.1 in opendrift environment.yml, until bug is hopefully solved and backported by someone. https://github.com/OpenDrift/opendrift/commit/4626d20ba1fc07b21c71257624f5dd0beaf5f396
How do you downgrade to netcd4 1.6.1
If you update to latest, environment.yml
contains netcdf4<=1.6.1
You can then do
conda env create -f environment.yml --force
followed by
pip install -e .
to reinstall dependencies
Is it possible to define the directory where the .dodsrc is present? I want to change the directory where these files are present but the opendrift always will try on HOME dir. We can change this behavior?
.dodsrc
and .netrc
authentication are general, and not a part of OpenDrift.
You can see specifications here: https://docs.unidata.ucar.edu/nug/current/dap2.html
Hi,
I installed opendrift folowing instructions you provide. When using a conda environment I am not able to reach CMEMS source, no mather where I add my .dodsrc and .netrc file.
I have no problems using
ncdump -h 'https://nrt.cmems-du.eu/thredds/dodsC/cmems_mod_glo_phy_anfc_merged-uv_PT1H-i'
outside of conda environment but after doing:conda activate opendrift
and(opendrift) [root@opendrift-poc ~]# ncdump -h 'https://nrt.cmems-du.eu/thredds/dodsC/cmems_mod_glo_phy_anfc_merged-uv_PT1H-i'
I get the following error message:
syntax error, unexpected WORD_WORD, expecting SCAN_ATTR or SCAN_DATASET or SCAN_ERROR context: <!DOCTYPE^ html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <head> <title>Login</title> <link href="http://marine.copernicus.eu/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <!-- link rel="icon" type="image/png" href="http://myo-wp.techworks.ie/devel/templates/myocean/favicon.png" /-->> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="/cas/newCss/css/myocean/screen/content.css" media="all" /> <link rel="stylesheet" type="text/css" href="/cas/newCss/css/myocean/screen/content_cc.css" media="all" /> <link rel="stylesheet" type="text/css" href="/cas/newCss/css/myocean/screen/patch_content_cc.css" media="all" /> <link rel="stylesheet" type="text/css" href="/cas/newCss/css/cssmanager.php?version=4.0.2-1288885946&files=/cas/newCss/css/myocean/print/print_003.css" media="print" /> <!--[if gte IE 6]><style type="text/css" media="screen">@import 'css/ie_cas.css';</style><![endif]--> <script type="text/javascript" src="js/common_rosters.js"></script> <style type="text/css">input.submit{cursor:pointer}</style> </head> <body id="cas" class="claro" onload="init();" > <div id="white_background_inner_page" style="height:105px;"></div> <div id="col3_content" class="clearfix"> <img src="/css/myocean/print/images/logo_myocean_print.png" width="1" height="1" align="left" id="logoPrint" alt="" /> <div id="breadcrumb"> <a href="http://marine.copernicus.eu/">Home</a> > Login </div> <h1>Welcome to the CMEMS Data Access Portal</h1> <br/> <p>Fill your login/password and click on <strong>Login</strong> to download data. If you are not registred yet click on <a href="http://marine.copernicus.eu/web/56-user-registration-form.php" target="_parent">Register</a></p> <p>If you have trouble logging in, make sure your browser is set to accept cookies.</p> <br/> <form id="authentification" name="com-login" class="fm-v clearfix" action="/cas/login;jsessionid=BA9435DA67876D405E6490F3DFC023A9?service=http://localhost:8080/thredds/dodsC/cmems_mod_glo_phy_anfc_merged-uv_PT1H-i.dds" method="post"> <fieldset class="input"> <label for="username">Username</label> <input id="username" name="username" class="required" tabindex="1" accesskey="i" type="text" value="" size="25" autocomplete="false"/><br /> <label for="password">Password</label> <input id="password" name="password" class="required" tabindex="2" accesskey="m" type="password" value="" size="25" autocomplete="off"/><br /> <input type="hidden" name="lt" value="_c4793F86B-451F-2DD7-ECFA-D395B0B99CF4_k3D0FA0E2-B51A-ACF8-EF1A-B307A76D684E" /> <input type="hidden" name="_eventId" value="submit" /> <div class="authentification_retrait_right"> <a href="http://marine.copernicus.eu/web/56-user-registration-form.php" target="_parent"><img src="/cas/newCss/css/myocean/screen/images/bt_register.gif" alt="Register" /></a> <input class="submit" name="submit" accesskey="l" value=" " type="submit" alt="Login" /> </div> </fieldset> <p> <br/><br/> <i>- You are registered but have forgotten your login/password?</i><br/> <i>- Any question?</i><br/> <b>⇒ CMEMS Service Desk : </b><A HREF="mailto:servicedesk.cmems@mercator-ocean.eu"><b>servicedesk.cmems@mercator-ocean.eu</b></A> </p> </form> <h3>Thank you for using CMEMS products</h3> <br/> <div id="sidebar"> <i>For security reasons, please Exit your web browser when you quit services requiring authentication!</i> </div> </div> </body></html> ncdump: https://nrt.cmems-du.eu/thredds/dodsC/cmems_mod_glo_phy_anfc_merged-uv_PT1H-i: NetCDF: Access failure
Of course, using python's modules inside the env yields similar results
from opendrift.readers import reader_netCDF_CF_generic
reader_netCDF_CF_generic.Reader('https://nrt.cmems-du.eu/thredds/dodsC/cmems_mod_glo_phy_anfc_merged-uv_PT1H-i')
results in
The only instalation that worked is the one via a docker file, but it doesn't suit my needs.
my conda environments is as follows:
Any help would be greatly appreciated, I have run out of ideas already.
Thank you very much