Comments (6)
You should check this function written by Blaise : https://github.com/Ouranosinc/flyingpigeon/blob/master/flyingpigeon/utils.py#L59
from finch.
The problem with doing a try/except is that when the url is not an Opendap url, it takes a second or 2 to raise an IOError. Also, I tried it a while ago and when it's not an opendap url it crashed the interpreter without raising an error... It may have had to do with my installation of netcdf, I'm not sure.
But the netCDF4 library doesn't seem to support constraint expressions, as pointed out by #20.
Knowing the structure of a constraint expression, (it seems to be located only in query parameters) we can still use the technique of appending any standard opendap suffix to the url (.dds, .das, .ver, ...) by removing the query string. But that url will still be passed to xarray or netcdf4, and it won't work unless we implement #20. So these 2 issues are related.
from finch.
Got bit by this recently. Can it be dealt with client-side ? The client could then pass the mimetype of the input, and then we would not have to guess server-side.
from finch.
What was the url you sent to the server?
from finch.
I did a quick research, and I think that if we make a HEAD request to the url, the Content-Description
header should always start with dods
if it's an opendap url.
Check the section 7.1.1 at: https://www.opendap.org/pdf/ESE-RFC-004v1.2.pdf
Edit: I also found this:
Theres an ambiguity as to whether http://server/something is an OPeNDAP or an HTTP remote file using range requests. There will be more ambiguities in the future, as other HTTP based protocols are added. Currently we do a HEAD request on http://server/something.dds, and if it succeeds, and returns a header Content-Description="dods-dds" or "dods_dds", then we open as OPeNDAP, and if it fails we try opening as an HTTP file.
https://www.unidata.ucar.edu/software/netcdf-java/current/reference/DatasetUrls.html
So I think this is the way to go.
from finch.
It was a THREDDS DAP url but starting with http. I had to write href=http... for pywps to recognize it as URL and not as data, but that may be a quirk of pywps.
from finch.
Related Issues (20)
- Adapt dataset extraction for CanDCS-U6
- Finch 0.9.1 docker image fails to run HOT 3
- subset_bbox_dataset fails with output_format=csv HOT 2
- dap_subset.ipynb broken with upcoming Jupyter env on PAVICS HOT 1
- Validate changes in available processes HOT 4
- Non-resampling xclim indicators wrapped into ensemble processes HOT 1
- Use flask for the development server HOT 1
- csv_precision not working as expected HOT 4
- Allow ensemble processes to return the dataset with individual realizations HOT 4
- Implement Humidex days over thresh calculation
- Add CCCS humidex ensemble to dataset options
- candcs-u6 "26 model" model list not finding 26
- What kind of bird is Finch? HOT 3
- Humidex optional arguments have minOccurs set to 1 HOT 3
- Duplicate `AllowedValues` entries in `ensemble_grid_point_wetdays` process
- Reorder csv output columns
- Distinct models should have distinct columns in CSV output HOT 1
- Incorrect output in `finch-usage` notebook HOT 3
- Migrate `master` branch to `main` HOT 1
- `unidecode` is under GPLv2 HOT 3
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 finch.