Git Product home page Git Product logo

ncdump-json's Introduction

Ncdump output in json (and CDL)

Modified version of ncdump (netcdf 4.1.1)

Example:

$ ncdump-json -h -j tests/socib-buoy.nc
{"dimensions":{"time":3169},"variables":{"time":{"type":"double","dimensions":["time"],"attributes":{"standard_name":"time","units":"seconds since 1970-01-01 00:00:00","long_name":"time","_FillValue":-99999.9000000000,"axis":"T","calendar":"gregorian"}},"AIRT":{"type":"double","dimensions":["time"],"attributes":{"standard_name":"air_temperature","units":"C","long_name":"air temperature","_FillValue":-99999.9000000000,"coordinates":"time","valid_min":-15.0000000000000,"valid_max":45.0000000000000,"original_units":"C","observation_type":"measured","precision":"0.01"}},"QC_AIRT":{"type":"byte","dimensions":["time"],"attributes":{"long_name":"quality flag for air_temperature","quality_control_convention":"SOCIB Quality control Data Protocol","valid_min":0,"valid_max":9,"_FillValue":10,"flag_values":[0,1,4,9],"flag_meanings":"no_qc_performed good_data bad_data
...
$ ncdump-json -v AIRT -j tests/socib-buoy.nc
{"AIRT":[17.06,null,17.43,16.51,15.22,16.51,15.22,15.32,14.49,16.88,15.96,16.14,15.77,16.6,15.78,16.6,16.05,15.96,16.51,16.97,17.06,15.41,14.95,14.58,14.95,14.03,14.31,14.03,13.21,13.02,13.21,13.02,12.75,12.48,12.29,12.2,11.84,11.75,11.93,11.75,11.2,11.02,11.02,11.02,10.65,10.47,10.65,10.47,10.2,10.02,10.02,9.93,9.75,9.65,9.56,9.65,9.47,9.2,9.11,9.11,9.11,9.29,9.29,9.2,9.11,9.11,8.57,8.84,8.75,8.57,8.66,8.57,9.02,8.75,9.02,9.29,9.11,9.47,9.11,8.93,8.57,8.48,8.3,8.39,8.3,8.21,7.93,8.21,7.93,8.39,7.93,8.39,8.57,8.39,8.48,8.57,8.3,8.3,8.21,8.39,8.21,8.75,9.2,9.47,9.75,9.47,9.56,9.65,9.56,9.56,9.47,9.56
...

It behaves exactly like the original ncdump if you omit the command-line option -j


Run it with Docker (NEW!)

  • No need to compile anything
  • Run from any Linux, OSX, Win10 machine

Steps:

  • Install Docker on your computer (https://docs.docker.com/get-docker/)
  • Download this repository (download as zip or clone)
  • CD to repository directory
  • Build the image: docker build -t ncdump-json .
  • Test the container: docker run -it --rm ncdump-json -j tests/socib-buoy.nc
  • Run the container using your own netcdf file: docker run -it --rm -v "${PWD}/myfile.nc:/data/myfile.nc" ncdump-json -j /data/myfile.nc

Note: To build the image, you must be in the same directory as the Dockerfile. To run the container, the -v argument (-v "host path:container path") allows the container to access the .nc file that is on your filesystem. On Win10, it is slightly different because win paths are different from unix paths, google a bit and find more info.


Installation

  • Download latest release from https://github.com/jllodra/ncdump-json/releases, unzip.
  • Install cmake, libnetcdf-dev and pkg-config
  • cd ncdump-json directory
  • $cmake .
  • $make (you might get some warnings, it is ok).
  • At this point, the binary ncdump-json is available.
  • #make install to place the binary in /usr/local/bin
  • You can run the tests included and add more: cd tests; ./run_tests.sh

Problems? It works (it's tested) on both Linux and OSX. Read the Issues before asking.


Debian and Ubuntu users might find this comment interesting: jllodra#16 (comment)

FreeBSD users: jllodra#17


A note from the developer

I keep receiving emails and issues from users, those are welcome and I appreciate you all and always try to reply :) but this software is no longer actively being maintained because I left my former company Socib in 2012. If you rely on this program and need help, you're welcome to poke me through my company Atlantis of Code and we'll talk about it:

Josep Llodrà – [email protected]


Special thanks to all who contributed to this software filling Issues or sending Pull Requests.

http://www.unidata.ucar.edu/software/netcdf/copyright.html

ncdump-json's People

Contributors

jllodra avatar jeppefrandsen avatar lilianjap avatar tidbitsoftware avatar vmx avatar

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.