gnome.environment.gridcur

code to work with the “old” gridcur format

Examples:

A single cell, values on the cell:

[GRIDCURTIME] KNOTS
NUMROWS 1
NUMCOLS 1
LOLAT 44
HILAT 46
LOLONG 12
HILONG 15
[TIME]   30 1 2002 1 0
1 1 .092388 -.0382683

Two by two grid, values on the nodes:

[GRIDCURTIME] KNOTS
NUMROWS 2
NUMCOLS 2
STARTLAT 44
STARTLONG 12
DLAT 2
DLONG 3
[TIME]   30 1 2002 1 0
1 1 .092388 -.0382683
1 2 .092388 -.0382683
2 1 .092388 -.0382683
2 2 .092388 -.0382683

Module Contents

Functions

from_gridcur(filename[, extrapolation_is_allowed])

factory function to make a GridCurrent from a gridcur file

init_from_gridcur(gc, filename[, extrapolation_is_allowed])

utility function to initialize a GridCurrent

read_file(filename)

write_gridcur(filename, data_type, units, times, lon, ...)

write a gridcur file -- used for making tests, etc.

make_grid_arrays(grid_info)

Build the arrays for the grid and data

Attributes

data_types

data_type_tags

gnome.environment.gridcur.data_types
gnome.environment.gridcur.data_type_tags
exception gnome.environment.gridcur.GridCurReadError

Bases: Exception

custom class so that we canknow the error was in reading GridCur file

Initialize self. See help(type(self)) for accurate signature.

gnome.environment.gridcur.from_gridcur(filename, extrapolation_is_allowed=False, **kwargs)

factory function to make a GridCurrent from a gridcur file

Parameters:
  • filename – name (full path) of the gridcur file to load

  • extrapolation_is_allowed=False

passes other keyword arguments on to GridCurrent initilizer

gnome.environment.gridcur.init_from_gridcur(gc, filename, extrapolation_is_allowed=False, **kwargs)

utility function to initialize a GridCurrent

Parameters:
  • gc=None – the GridCur object to be initialized if None, then a new one will be created.

  • filename – name (full path) of the gridcur file to load

  • extrapolation_is_allowed=False

passes other keyword arguments on to GridCurrent initilizer

gnome.environment.gridcur.read_file(filename)
gnome.environment.gridcur.write_gridcur(filename, data_type, units, times, lon, lat, data_u, data_v)

write a gridcur file – used for making tests, etc.

gnome.environment.gridcur.make_grid_arrays(grid_info)

Build the arrays for the grid and data

Parameters:

grid_info – a dict of the grid information from the header