Nettle Pie Market

    netcdf4-node

    1.11.0 • Public • Published

    Read hdf5、netCDF4 files base on netCDF4-python

    中文说明

    Install

    • nodejs
    • python 2.7 or later
    • netCDF4-python
    • HDF4,if you want to be able to read HDF4 "Scientific Dataset" (SD) files.

    example

    javascript:

     
    (async function () {
        var netCDF4 = require('./index')
        var path = require('path')
        var ds = new netCDF4.Dataset()
        var ncOrHdf5FileName = path.join(__dirname, 'sampleData/FY4A-_AGRI--_N_REGC_1047E_L2-_CTT-_MULT_NOM_20190210073834_20190210074250_4000M_V0001.NC')
        await ds.readFile(ncOrHdf5FileName).catch((err) => {
            console.error(err)
            throw err
        })
        var subDatasets = ds.subDatasets();
        var variable = await ds.readVariable(subDatasets[0]);
        console.log(variable) 
        console.log(variable.get(0, 10)) 
        console.log(variable.minMax); //variable.attributes['valid_range'] 
        ds.close();//Close dataset,exit python process,delete temporary  files
    })()

    print:

    Variable {name: "CTT", attributes: Object, dataType: "float32", shape: Array(2), data: Float32Array(3044784), }
    index.js:29
    65535
    index.js:30
    Array(2[180, 311.4605712890625]

    Install

    npm i netcdf4-node

    DownloadsWeekly Downloads

    2

    Version

    1.11.0

    License

    MIT

    Unpacked Size

    22.1 kB

    Total Files

    11

    Last publish

    Collaborators

    • weixiuyong