wolfiex f0bc98cdba Added example II: client side loading.
Updated example for use in client side computing over an node run server.
2016-12-22 17:16:11 +00:00
2016-11-03 13:07:20 +00:00
2016-11-03 14:09:40 +01:00
2016-11-03 14:09:40 +01:00
2016-10-24 10:24:40 +02:00
2016-10-24 10:24:40 +02:00
2016-10-24 10:24:40 +02:00
2016-10-31 10:47:51 +01:00
2016-10-24 10:24:40 +02:00
2016-11-03 13:07:20 +00:00

netcdfjs

NPM version build status Test coverage David deps npm download

Read and explore NetCDF files

Installation

$ npm install netcdfjs

API Documentation

For further information about the grammar you should go to this link.

Example

const fs = require('fs');
const NetCDFReader = require('netcdfjs');

// http://www.unidata.ucar.edu/software/netcdf/examples/files.html
const data = fs.readFileSync('madis-sao.nc');

var reader = new NetCDFReader(data); // read the header
reader.getDataVariable('wmoId'); // go to offset and read it

Example II: Load from URL (does not require node)

// First load the netcdfjs library as normal : <script src='./dist/netcdfjs.js'></script>

var urlpath =  "http://www.unidata.ucar.edu/software/netcdf/examples/madis-sao.nc"
var reader;

var oReq = new XMLHttpRequest();
oReq.open("GET", urlpath, true);
oReq.responseType = "blob";

oReq.onload = function(oEvent) {
  var blob = oReq.response;
  reader_url = new FileReader();
  
  reader_url.onload = function(e) {
       reader = new netcdfjs(this.result);
      }
      
  reader_url.readAsArrayBuffer(blob);
};
oReq.send(); //start process



reader.getDataVariable('wmoId'); // go to offset and read it



License

MIT

Description
Read and explore NetCDF files
Readme 5.8 MiB
Languages
nesC 63.4%
Mathematica 36.2%
JavaScript 0.4%