Comments (3)
I think a better approach is to not try to do anything fancy and since I'm letting ncdf4
do all the reading, just let it tell me if it works or not. I'll just remove the checks and add some error trapping so it's clear that the error came from ReadNetCDF()
.
from metr.
It seems that RCurl is not recognising it as a valid URL. If I navigate to that URL I get
Error {
code = 400;
message = "Unrecognized request";
};
So something might be going on. It seems that RCurl is not as robust as one hopes to detect if something is a URL.
from metr.
Adding .dds
at the end of the filename (i.e., https://psl.noaa.gov/thredds/dodsC/Datasets/ncep.reanalysis2/Monthlies/LTMs/gaussian_grid/air.2m.mon.ltm.nc.dds) gives:
Dataset {
Float32 level[level = 1];
Float32 lat[lat = 94];
Float32 lon[lon = 192];
Float64 time[time = 12];
Float64 climatology_bounds[time = 12][nbnds = 2];
Grid {
ARRAY:
Float32 air[time = 12][level = 1][lat = 94][lon = 192];
MAPS:
Float64 time[time = 12];
Float32 level[level = 1];
Float32 lat[lat = 94];
Float32 lon[lon = 192];
} air;
Grid {
ARRAY:
Int16 valid_yr_count[time = 12][level = 1][lat = 94][lon = 192];
MAPS:
Float64 time[time = 12];
Float32 level[level = 1];
Float32 lat[lat = 94];
Float32 lon[lon = 192];
} valid_yr_count;
} Datasets/ncep.reanalysis2/Monthlies/LTMs/gaussian_grid/air.2m.mon.ltm.nc;
And
f <- "https://psl.noaa.gov/thredds/dodsC/Datasets/ncep.reanalysis2/Monthlies/LTMs/gaussian_grid/air.2m.mon.ltm.nc.dds"
unname(file.access(f, 4) == 0 | RCurl::url.exists(f))
[1] TRUE
So maybe a two-step test is possible. First with the .nc
extension only. If FALSE
, adding .dds
extension and test again. If TRUE
, ncdf4::nc_open()
can read the .nc
file, as showed in the first post.
from metr.
Related Issues (20)
- Is Laplacian function working as expected? HOT 2
- Release metR 0.14.0
- geom_text_contour with geom_density_2d HOT 2
- error processing netcdf file HOT 8
- compute vorticity with metR HOT 3
- contour over a map HOT 2
- waveflux.r different lists for psi.dxy HOT 1
- Stream Function and Velocity Potential HOT 4
- rgdal archived HOT 2
- Release metR 0.14.1
- argumento clip en geom_contour_fill() no anda HOT 2
- `geom_text_contour` did not show labels as expected
- Description is incomplete for "waves" functions HOT 1
- Suggestion for `geom_vector()` key glyphs HOT 5
- Release metR 0.15.0 HOT 1
- guide_colorsteps() doesn't work as expected HOT 4
- the background of the arrow legend turns black HOT 1
- add a function gg_barbs to plot wind barbs HOT 1
- pkgdown action not updating website HOT 1
- plot question HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metr.