Skip to content
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

We lost OpenDAP support for Windows users since RNetCDF version 2.7-1! #140

Closed
khaled-alshamaa opened this issue Feb 11, 2024 · 5 comments
Closed

Comments

@khaled-alshamaa
Copy link

It looks like we lost the OpenDAP support for Windows users since version 2.7-1!
Are you sure that you update Windows binary packages to the latest netcdf with OpenDAP?

The following code snippet works perfectly fine on RNetCDF version 2.6-2 but not version 2.7-1 onward :-(

nc_url <- 'http://thredds.northwestknowledge.net:8080/thredds/dodsC/agg_terraclimate_tmax_1958_CurrentYear_GLOBE.nc'
nc_metadata <- RNetCDF::open.nc(nc_url)
@mdsumner
Copy link
Contributor

works for me

Package: RNetCDF
Version: 2.9-1
Date: 2023-12-30

??

@mjwoods
Copy link
Owner

mjwoods commented Feb 15, 2024

Works for me too. Please provide additional details about your system, and/or check network, firewall, and anti-virus settings.

> R.version
               _                                
platform       x86_64-w64-mingw32               
arch           x86_64                           
os             mingw32                          
crt            ucrt                             
system         x86_64, mingw32                  
status                                          
major          4                                
minor          3.2                              
year           2023                             
month          10                               
day            31                               
svn rev        85441                            
language       R                                
version.string R version 4.3.2 (2023-10-31 ucrt)
nickname       Eye Holes             
> packageVersion("RNetCDF")
[1] ‘2.9.1’
> osVersion
[1] "Windows 10 x64 (build 19045)"
> nc_url <- 'http://thredds.northwestknowledge.net:8080/thredds/dodsC/agg_terraclimate_tmax_1958_CurrentYear_GLOBE.nc'
> nc_metadata <- RNetCDF::open.nc(nc_url)
> RNetCDF::print.nc(nc_metadata)
netcdf classic {
dimensions:
        crs = 1 ;
        lat = 4320 ;
        lon = 8640 ;
        time = 780 ;
variables:
        NC_SHORT crs(crs) ;
                NC_CHAR crs:grid_mapping_name = "latitude_longitude" ;
                NC_DOUBLE crs:longitude_of_prime_meridian = 0 ;
                NC_DOUBLE crs:semi_major_axis = 6378137 ;
                NC_DOUBLE crs:inverse_flattening = 298.257223563 ;
                NC_CHAR crs:long_name = "crs" ;
                NC_INT crs:_ChunkSizes = 1 ;
...

@khaled-alshamaa
Copy link
Author

Here is additional information about my system:

> R.version
               _                                
platform       x86_64-w64-mingw32               
arch           x86_64                           
os             mingw32                          
crt            ucrt                             
system         x86_64, mingw32                  
status                                          
major          4                                
minor          2.2                              
year           2022                             
month          10                               
day            31                               
svn rev        83211                            
language       R                                
version.string R version 4.2.2 (2022-10-31 ucrt)
nickname       Innocent and Trusting            

> packageVersion("RNetCDF")
[1] ‘2.9.1’

> osVersion
[1] "Windows 10 x64 (build 19044)"

> library(RNetCDF)
Warning message:
package ‘RNetCDF’ was built under R version 4.2.3 

> nc_url <- 'http://thredds.northwestknowledge.net:8080/thredds/dodsC/agg_terraclimate_tmax_1958_CurrentYear_GLOBE.nc'
> nc_metadata <- RNetCDF::open.nc(nc_url)

The last command (i.e., open.nc() function call) takes ages with no response at all! Well, I don't expect that it is something related to the network, firewall, or anti-virus settings because the following lines of code works perfectly fine!

> remove.packages("RNetCDF")
Removing package from ‘C:/Users/Kel-shamaa/AppData/Local/Programs/R/R-4.2.2/library’
(as ‘lib’ is unspecified)

Restarting R session...

> install.packages("https://packagemanager.posit.co/cran/2023-09-01/bin/windows/contrib/4.2/RNetCDF_2.6-2.zip")
inferring 'repos = NULL' from 'pkgs'
trying URL 'https://packagemanager.posit.co/cran/2023-09-01/bin/windows/contrib/4.2/RNetCDF_2.6-2.zip'
Content type 'binary/octet-stream' length 5060094 bytes (4.8 MB)
downloaded 4.8 MB

package ‘RNetCDF’ successfully unpacked and MD5 sums checked

> nc_url <- 'http://thredds.northwestknowledge.net:8080/thredds/dodsC/agg_terraclimate_tmax_1958_CurrentYear_GLOBE.nc'
> nc_metadata <- RNetCDF::open.nc(nc_url)
> RNetCDF::print.nc(nc_metadata)
netcdf classic {
dimensions:
	crs = 1 ;
	lat = 4320 ;
	lon = 8640 ;
	time = 792 ;
variables:
	NC_SHORT crs(crs) ;
		NC_CHAR crs:grid_mapping_name = "latitude_longitude" ;
		NC_DOUBLE crs:longitude_of_prime_meridian = 0 ;
		NC_DOUBLE crs:semi_major_axis = 6378137 ;
		NC_DOUBLE crs:inverse_flattening = 298.257223563 ;
		NC_CHAR crs:long_name = "crs" ;
		NC_INT crs:_ChunkSizes = 1 ;
...

@khaled-alshamaa
Copy link
Author

Interestingly, the latest RNetCDF version 2.9.1 functioned perfectly fine when I updated my R version to 4.3.3 ;-)

> R.version
               _                                
platform       x86_64-w64-mingw32               
arch           x86_64                           
os             mingw32                          
crt            ucrt                             
system         x86_64, mingw32                  
status                                          
major          4                                
minor          3.3                              
year           2024                             
month          02                               
day            29                               
svn rev        86002                            
language       R                                
version.string R version 4.3.3 (2024-02-29 ucrt)
nickname       Angel Food Cake                  

> packageVersion("RNetCDF")
[1] ‘2.9.1’

> nc_url <- 'http://thredds.northwestknowledge.net:8080/thredds/dodsC/agg_terraclimate_tmax_1958_CurrentYear_GLOBE.nc'
> nc_metadata <- RNetCDF::open.nc(nc_url)
> RNetCDF::print.nc(nc_metadata)
netcdf classic {
dimensions:
	crs = 1 ;
	lat = 4320 ;
	lon = 8640 ;
	time = 792 ;
variables:
	NC_SHORT crs(crs) ;
		NC_CHAR crs:grid_mapping_name = "latitude_longitude" ;
		NC_DOUBLE crs:longitude_of_prime_meridian = 0 ;
		NC_DOUBLE crs:semi_major_axis = 6378137 ;
		NC_DOUBLE crs:inverse_flattening = 298.257223563 ;
		NC_CHAR crs:long_name = "crs" ;
		NC_INT crs:_ChunkSizes = 1 ;

So, the bottom line advice is to make sure that our system is up-to-date :D

@mjwoods
Copy link
Owner

mjwoods commented Mar 4, 2024

Thanks @khaled-alshamaa . R-4.2.3 used an older version of Rtools, so this may explain the incompatibility with the RNetCDF_2.9-1 binary package on Windows. As new versions of Rtools are released, we may have similar problems with older R versions, so I will keep this issue in mind.

@mjwoods mjwoods closed this as completed Mar 4, 2024
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

No branches or pull requests

3 participants