• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    Julia
  • License
    MIT License
  • Created about 9 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NetCDF support for the julia programming language

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

DiskArray interface

As of version 0.9 we provide an interface to DiskArrays.jl, which lets you treat NetCDF variables as Julia AbstractArrays. Special methods for accessing, reading slices and reductions and broadcasting are implemented, so that working with the arrays should be efficient.

So the following returns a lazy AbstractArray container referencing the data in the variable.

v = NetCDF.open(filename, varname)

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.

More Repositories

1

Geodesy.jl

Work with points defined in various coordinate systems.
Julia
109
star
2

GDAL.jl

Thin Julia wrapper for GDAL - Geospatial Data Abstraction Library
Julia
90
star
3

GeoInterface.jl

A Julia Protocol for Geospatial Data
Julia
88
star
4

Shapefile.jl

Parsing .shp files in Julia
Julia
81
star
5

LibGEOS.jl

Julia package for manipulation and analysis of planar geometric objects
Julia
69
star
6

GeoJSON.jl

Utilities for working with GeoJSON data in Julia
Julia
66
star
7

Proj.jl

Julia wrapper for the PROJ cartographic projections library
Julia
48
star
8

GADM.jl

A Julia package for obtaining geographical data from the GADM dataset
Julia
38
star
9

GeometryOps.jl

GeoInterface-based geometry operations
Julia
28
star
10

MapTiles.jl

Work with tiled web maps in Julia
Julia
24
star
11

Leaflet.jl

LeafletJS mapping library from Julia
Julia
20
star
12

TileProviders.jl

Shared collection of map tile providers
Julia
14
star
13

GeoDatasets.jl

Common geographic data sets
Julia
14
star
14

GRIBDatasets.jl

A high level interface to GRIB encoded files.
Julia
12
star
15

GeoParquet.jl

Geospatial data in Parquet files
Julia
11
star
16

LibSpatialIndex.jl

A library for spatially indexing kD bounding box data (based on libspatialindex)
Julia
10
star
17

NaturalEarth.jl

Julia interface to Natural Earth data
Julia
10
star
18

CommonDataModel.jl

CommonDataModel.jl is a module that defines types common to NetCDF and GRIB data
Julia
8
star
19

DimensionalArrayTraits.jl

Abstract base package for dimensional arrays and their specific traits
Julia
8
star
20

juliageo.github.io

Website for the JuliaGeo organization
HTML
6
star
21

CFTime.jl

Julia library for decoding time units conforming to the Climate and Forecasting (CF) netCDF conventions.
Julia
6
star
22

meta

For discussion centered around the JuliaGeo organization
6
star
23

GeoFormatTypes.jl

Wrapper types for spatial data formats like well known text, KML, Proj4 strings.
Julia
6
star
24

ASCIIrasters.jl

Tiny package for reading/writing ASCII raster files
Julia
5
star
25

ZarrDatasets.jl

An high-level interface for Zarr datasets
Julia
5
star
26

GeoInterfaceRFC.jl

Julia
4
star
27

AreaInterpolation.jl

Interpolation between areas (polygons) in Julia
Julia
4
star
28

GeoPackage.jl

A Julia reader and writer for `.gpkg` files
Julia
3
star
29

GEOSBuilder

BinaryBuilder.jl repository for GEOS
Julia
3
star
30

JuliaGeoTutorials

Tutorials which show the usage of Julia for geospatial analysis
Jupyter Notebook
3
star
31

TigerLine.jl

A Julia package to retrieve TIGER/LINE shapefile data from the US Census.
Julia
2
star
32

GDALBuilder

Julia
2
star
33

PROJBuilder

BinaryBuilder.jl repository for PROJ
Julia
2
star
34

LibSpatialIndexBuilder

Julia
1
star
35

JuliaGeo.jl

Meta package to load all composable packages in the ecosystem
Julia
1
star