Project

General

Profile

CLIPC - Visualize NetCDF files using OpenDAP and WMS

This manual describes how to visualize netcdf files in the CLIPC environment at climate4impact.
In short:
  1. Get a netcdf file to visualize, must comply to CF-Conventions or CMOR conventions
  2. Upload the file to the CLIPC environment using FTP
  3. The NetCDF file is now available in a THREDDS dataserver and accessible via OpenDAP
  4. The OpenDAP url can be visualized using the ADAGUC WMS running at climate4impact.
  5. The ADAGUC WMS can be used in OpenLayers 3, example code given below

host: opendap.knmi.nl
user: clipcstorylinedata
password: ** ask plieger at knmi.nl
hostname: bhlnmis
internaldir: /data/nmis03/CLIPC/storyline_urbanheat/clipcstorylinedata
catalogurl: http://opendap.knmi.nl/knmi/thredds/catalog/CLIPC/storyline_urbanheat/clipcstorylinedata/catalog.html
opendapprefix: http://opendap.knmi.nl/knmi/thredds/dodsC/CLIPC/storyline_urbanheat/clipcstorylinedata/

Example, put a netcdf file using FTP and make a visualization using Opendap+WMS:

Put a netcdf file (RADNL_OPER_R___25PCPRR_L3__20120827T171000_20120827T171500_0001.nc) using FTP:

$ ftp opendap.knmi.nl
ftp> ls
ftp> mkdir test
ftp> cd  test
ftp> put RADNL_OPER_R___25PCPRR_L3__20120827T171000_20120827T171500_0001.nc

The directory test is just used for this example.

The relative file location is test/RADNL_OPER_R___25PCPRR_L3__20120827T171000_20120827T171500_0001.nc
The Opendap url is http://opendap.knmi.nl/knmi/thredds/dodsC/CLIPC/storyline_urbanheat/clipcstorylinedata/test/RADNL_OPER_R___25PCPRR_L3__20120827T171000_20120827T171500_0001.nc
This URL can be entered manually in http://climate4impact.eu/impactportal/data/customcatalog.jsp, under browse an opendap file.

To create a visualization on the opendap url, we can use the ADAGUC WMS at climate4impact:
OpenDAPURL: http://opendap.knmi.nl/knmi/thredds/dodsC/CLIPC/storyline_urbanheat/clipcstorylinedata/test/RADNL_OPER_R___25PCPRR_L3__20120827T171000_20120827T171500_0001.nc
WMSendpoint: http://climate4impact.eu/impactportal/ImpactService?

To pass the OpenDAP URL you can do http://climate4impact.eu/impactportal/ImpactService?source=<urlencoded opendapURL>&service=WMS& etc...

The WMS GetCapabilities URL becomes:
http://climate4impact.eu/impactportal/ImpactService?source=http%3A%2F%2Fopendap.knmi.nl%2Fknmi%2Fthredds%2FdodsC%2FCLIPC%2Fstoryline_urbanheat%2Fclipcstorylinedata%2Ftest%2FRADNL_OPER_R___25PCPRR_L3__20120827T171000_20120827T171500_0001.nc&service=WMS&request=GetCapabilities

The name of the WMS Layer is the same as the variablename in the netcdf file, in this case it is precipitation.
A sample getmap request is:
http://climate4impact.eu/impactportal/ImpactService?%26source%3Dhttp:%2F%2Fopendap.knmi.nl%2Fknmi%2Fthredds%2FdodsC%2FCLIPC%2Fstoryline_urbanheat%2Fclipcstorylinedata%2Ftest%2FRADNL_OPER_R___25PCPRR_L3__20120827T171000_20120827T171500_0001.nc%26SERVICE=WMS&&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=precipitation&WIDTH=1635&HEIGHT=1075&CRS=EPSG%3A4326&BBOX=48.79406961100918,-0.10856428,56.07484838899083,10.964992279999999&STYLES=auto%2Fnearest&FORMAT=image/png&TRANSPARENT=TRUE&&time=2012-08-27T17%3A10%3A00Z

In openlayers3 this resource can be added as a layer in the following way:


var opendaptest = new ol.layer.Image({
  source: new ol.source.ImageWMS(({
    url: 'http://climate4impact.eu/impactportal/ImpactService?',
    params: {
      'LAYERS': 'precipitation', 
      'source': 'http://opendap.knmi.nl/knmi/thredds/dodsC/CLIPC/storyline_urbanheat/clipcstorylinedata/test/RADNL_OPER_R___25PCPRR_L3__20120827T171000_20120827T171500_0001.nc'
    },
    serverType: 'geoserver',
    ratio:1
  }))
})