lagrangian.reader.NetCDF

class lagrangian.reader.NetCDF

Bases: lagrangian.core.Reader

Grid NetCDF CF reader.

The grid must contain at least one variable and two vectors defining the axes of the longitudes and latitudes of the variable. For example :

dimensions:
  y = 915 ;
  x = 1080 ;
variables:
   double y(y) ;
       y:long_name = "Latitudes" ;
       y:units = "degrees_north" ;
   double x(x) ;
       x:long_name = "Longitudes" ;
       x:units = "degrees_east" ;
   float u(x, y) ;
       u:_FillValue = 999f ;
       u:long_name = "U" ;
       u:units = "cm/s" ;
       u:date = "2012-01-01 00:00:00.000000 UTC" ;
    float v(y, x) ;
       v:_FillValue = 999f ;
       v:long_name = "U" ;
       v:units = "cm/s" ;
       v:date = "2012-01-01 00:00:00.000000 UTC" ;

Note

The variable to be read must set an attribute named “date” that define the date of data contained in the variable.

__init__(self: lagrangian.core.reader.NetCDF) → None

Methods

NetCDF.date(self, name)

Returns the date of the grid

NetCDF.interpolate(self, lon, lat, …)

Computes the value of the grid point requested by bilinear interpolation

NetCDF.load(self, name, unit)

Load into memory grid data

NetCDF.open(self, path)

Opens a NetCDF grid in read-only.