Giter Site home page Giter Site logo

nc_json's Introduction

nc_json

JSON parser for netCDF, netCDF to JSON generator

NCO-JSON/CF-JSON is a JSON format primarily intended for encoding climate and weather data. NCO-JSON is based on the NetCDF CF metadata conventions.
nc_json reads and validates a NCO-JSON file and optionally generates the corresponding netCDF file.
http://cf-json.org

Dependencies

CMake CMake build system

Optional
netCDF netCDF is a set of software libraries and self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data.

JSON parsing

https://github.com/vivkin/gason A C++ JSON parser (included).

Building from source

Install dependency packages: Debian-based systems (like Ubuntu)

sudo apt-get install cmake
sudo apt-get install libnetcdf-dev netcdf-bin netcdf-doc

Install dependency packages: For RPM-based systems (like Fedora and CentOS)

sudo yum install netcdf netcdf-devel
sudo yum install cmake

Get source:

git clone https://github.com/pedro-vicente/nc_json.git

Building with CMake in Unix

On most Unix systems, the Jansson, netCDF libraries and dependencies are found on the default location with

cd build
cmake ..

CMake build options

If the netCDF libraries and dependencies (HDF5, curl, zlib, szip) are not found on the default location, they can be set.

cmake .. \
-DNETCDF_INCLUDE:PATH=/your/netcdf/include/path \
-DNETCDF_LIBRARY=/your/netcdf/library/file/name \
-DCURL_LIBRARY=/your/curl/library/file/name \
-DHDF5_LIBRARY=/your/hdf5/library/file/name \
-DHDF5_HL_LIBRARY=/your/hdf5 high level/library/file/name \
-DZLIB_LIBRARY=/your/zlib/library/file/name \
-DSZIP_LIBRARY=/your/zlib/library/file/name

Examples

{
  "dimensions":{
    "lat":2,
    "lon":3
  },
  "variables":{
    "var_1":{
      "shape":["lat","lon"],
      "type":"float",
      "data":[[1,2,3],[4,5,6]],
      "attributes": {
        "char_att": "foo",
        "int_att": 37,
        "float_att": 73.0,
        "arr_int_att": [0, 1, 2],
        "arr_char_att": ["foo","bar"]
      }
    }
  },
  "attributes": {
    "char_att": "foo",
    "int_att": 37,
    "float_att": 73.0,
    "arr_int_att": [0, 1, 2],
    "arr_char_att": ["foo","bar"]
  },
  "groups":{
    "g1":{
      "groups":{
        "g11":{
        }
      }
    },
    "g2":{
      "dimensions":{
        "lat":2,
        "lon":3
      },
      "variables":{
        "var_1":{
          "shape":["lat","lon"],
          "type":"float",
          "data":[[1,null,3],[null,null,6]]
        }
        "var_2":{
          "shape":["lat"],
          "type":"float",
          "data":[1,2,3]
        }
      }
    }
  }
}

Documentation

http://cf-json.org/specification

nc_json's People

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.