GithubHelp home page GithubHelp logo

gher-uliege / emodnet-chemistry Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 4.0 28.2 MB

Utilities (plotting, computing, merging products) related EMODnet-Chemistry.

License: GNU Lesser General Public License v3.0

Jupyter Notebook 91.76% Shell 2.22% Python 1.07% Julia 4.96%
oceanography ocean-data wms opendap netcdf data-analytics datavisualization emodnet-chemistry divand spatial-interpolation

emodnet-chemistry's Introduction

Data product visualisation

Web Map Service

The analysed field generated by DIVA (Data-Interpolating Variational Analysis) can be visualised using the WMS protocol which supports the following requests:

GetCapabilities

This request is used to provide all layers of the map server. To every parameter and to every region corresponds a different WMS layer. An example of such a request would be:

http://ec.oceanbrowser.net/emodnet/Python/web/wms?request=GetCapabilities&service=WMS&version=1.3.0

GetMap

This request allows the extraction of a horizontal section of the 4D netCDF file at the specified depth and time (Example URL).

WMS

By default, the axis are not displayed on a map. This can be activated by setting the parameter DECORATED to true (Example URL).

Example URL

The GetMap can also be used to extract a vertical section (Example URL). The path of the section is encoded in the SECTION parameter: the longitude and latitude are separated by a comma and the coordinates by the pipe-symbol (|). The x-axis corresponds to the distance in arc degrees along the section (the first point is the origin) and the y-axis in the depth in meters. The parameter RATIO defines the aspect ratio of the vertical section.

Example URL

Images can be returned in raster (PNG) or vector image formats (SVG, EPS, PDF). They can also be saved as a KML file so that the current layer can be visualized in programs like Google Earth and combined with other information imported in such programs. By providing multiple time instances, the web map server can also return animation in the WebM or MP4 formats using this GetMap request (Example URL. As the animations are generated dynamically, it usually takes a couple of minutes to create them. The frame rate of the animation is controlled through the parameter rate.

GetFeatureInfo

This request returns a simple XML file with the underlying value of the analysed field (Example URL).

However, the WMS standards (in version 1.1.1 and 1.3.0) are not completely adequate for ocean analyses. A WMS allows one to represent a data set according to a list of different styles. A legend is attributed to each style which for scalar is colorbar. The legend for a given style is represented by a link to an image.

A single legend is used for the entire data set (for all depth layers and time instances in particular). However the ocean is strongly stratified and a unique legend does not provide sufficient contrast because the ocean properties at depth are often very different from the properties near the surface. The solution is to make the legend dynamic so that it can be adjusted based on a range of values at a specified depth and time.

OPeNDAP

OPeNDAP allows one to download and subset gridded datasets. The OPeNDAP product is nowadays included in the netCDF library so that most programs able to read netCDF files can also access remote datasets over OPeNDAP and download only the actual required data subset.

A Jupyter notebook illustrates the use of an EMODNET-Chemistry product using OPeNDAP. To run this example, it is necessary to install the following (free) software packages:

Pkg.add("NCDatasets.jl")
Pkg.add("PyPlot")
Pkg.add("IJulia")

emodnet-chemistry's People

Contributors

alexander-barth avatar ctroupin avatar qcazenave avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

emodnet-chemistry's Issues

Compressing the product netCDF files?

Shall we apply compression on the netCDF files?

Example

ncks -7 -L 1 --baa=4 --ppc default=3 Water_body_chlorophyll-a.4Danl.nc Water_body_chlorophyll-a.4Danl_compressed.nc 

Initial size: 4.0G
Final size: 237M

Command explanation

  • -7 (equivalent to --fl_fmt=netcdf4_classic): format to netCDF4 (probably not required in our case)
  • -L 1: set deflation level to 1 (should be between 1 and 9).
  • --baa=4: Bit Adjustment Algorithms is set to Granular BitRound
  • --ppc: Precision Preserving Compression: preserve three significant digits (value should be adapted)

New products not properly rendered in OceanBrowser

Problem

The new products (v2023) cannot be viewer on OceanBrowser. Example here with chlorophyll-a.
Screenshot from 2023-08-14 11-55-26

Origin of the problem

Possibly linked to Unidata/netcdf-c#2591.

root@ddb75bc7a870:/var/www/data/Tests/By_sea_regions/Arctic_Ocean# python3
Python 3.6.9 (default, Oct  8 2020, 12:12:24)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import netCDF4
>>> ds = netCDF4.Dataset("Water_body_dissolved_oxygen_concentration.4Danl.nc")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "netCDF4/_netCDF4.pyx", line 2015, in netCDF4._netCDF4.Dataset.__init__
  File "netCDF4/_netCDF4.pyx", line 1636, in netCDF4._netCDF4._ensure_nc_success
OSError: [Errno -101] NetCDF: HDF error: b'Water_body_dissolved_oxygen_concentration.4Danl.nc'
>>> netCDF4.__version__
'1.3.1'

So could be due to "checksum" / flectcher32 in the files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.