Giter Site home page Giter Site logo

netcdf.jl's Introduction

NetCDF.jl

Documentation Build Status

NetCDF support for the julia programming language, there is a high-level and a medium-level interface for writing and reading netcdf files.

Installation

Pkg.add("NetCDF")

Quickstart

First, load the library:

using NetCDF

The high-level interface is quite similar to the Matlab NetCDF interface, reading files is done by:

x = ncread("myfile.nc", "Radiation")

which will read the variable called "Radiation" from the file "myfile.nc". General information can be gained by using

ncinfo(filename)

which gives an overview of the dimensions, variables and attributes stored in the file.

filename = "myfile.nc"
varname  = "var1"
attribs  = Dict("units"   => "mm/d",
                "data_min" => 0.0,
                "data_max" => 87.0)

Creating variables and files is done by using the nccreate command:

nccreate(filename, varname, "x1", collect(11:20), "t", 20, Dict("units"=>"s"), atts=attribs)

This will create the variable called var1 in the file myfile.nc. The attributes defined in the Dict attribs are written to the file and are associated with the newly created variable. The dimensions "x1" and "t" of the variable are called "x1" and "t" in this example. If the dimensions do not exist yet in the file, they will be created. The dimension "x1" will be of length 10 and have the values 11..20, and the dimension "t" will have length 20 and the attribute "units" with the value "s".

Now we can write data to the file:

d = rand(10, 20)
ncwrite(d, filename, varname)

The full documentation can be found here

An alternative interface for reading NetCDF files can be found here: https://github.com/Alexander-Barth/NCDatasets.jl

Credits

This package was originally started and is mostly maintained by Fabian Gans ([email protected]). The automatic C wrapper generator was contributed by Martijn Visser (https://github.com/visr). Many thanks to several people who contributed bug fixes and enhancements.

netcdf.jl's People

Contributors

meggart avatar visr avatar jarlela avatar kouketsu avatar luthaf avatar metjmart avatar jgoldfar avatar squaregoldfish avatar ikselven avatar felixcremer avatar femtocleaner[bot] avatar aramirezreyes avatar wenjiany avatar tkelman avatar stevengj avatar dronir avatar koldunovn avatar 0xshipthecode avatar mvhulten avatar quinnj avatar ivarne avatar fredrikekre avatar staticfloat avatar alexander-barth avatar

Watchers

 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.