Welcome to iconarray’s documentation!#

The iconarray python package contains various modules to facilitate working with ICON data with xarray or other xarray based tools (such as psyplot - a plotting package). iconarray was developed together with icon-vis.

Getting started

New to iconarray? Check out the getting started guide. This instructs you how to create your conda environment, and using iconarray at CSCS.

API reference#

This page provides an auto-generated summary of iconarray’s API.

Core functions#

crop

functionality to crop both ICON grids and datasets on any grid location.

crop.Crop(grid, lon_bnds, lat_bnds[, ...])

Cut the domain of an ICON grid and data to a region specified by a lat/lon retangle.

latlonhash

Functionality to locate ICON grid indices associated to lat/lon grid coordinates via hashing the indices in a Cartesian grid.

latlonhash.Icon2latlon(grid[, scale_factor])

Creates a field in a Cartesian lat/lon grid whose elements contain the ICON grid indices of the element whose lat/lon coordinates are contained within the cartesian element.

utilities

The utilities.py module contains various functions useful for analysing or plotting (ICON) data using xarray.

utilities.ind_from_latlon(lon_array, ...[, ...])

Find the indices of the n closest cells in a grid, relative to a given latitude/longitude point.

utilities.show_data_vars(ds)

Print a table with variables in dataset.

interpolate

The functions in interpolate.py are used to facilitate the interpolation of ICON vector data to a regular grid, or a coarser ICON grid, for the purpose of vectorplots, e.g., wind plots.

interpolate.remap_ICON_to_regulargrid(...[, ...])

REMAP ICON data to regular grid using Fieldextra.

interpolate.remap_ICON_to_ICON(data_file, ...)

Remap ICON data to another ICON grid using Fieldextra.

Backend functions#

grid

The grid module contains functions relating to the grid information for ICON data, such as merging ICON data with the grid data to provide one merged dataset.

grid.combine_grid_information(file, grid_file)

Combine grid information.

grid.get_cell_dim_name(ds, grid)

Get name of dimension in ICON data xarray dataset which identifies the cell dimension.

grid.get_edge_dim_name(ds, grid)

Get name of dimension in ICON data xarray dataset which identifies the edge dimension.

grid.get_time_coord_name(ds)

Get name of time coordinate in xarray dataset which has attribute standard_name = 'time' and datatype of datetime.

grid.add_cell_data(ds, grid)

Add clon, clat, clon_bnds, and clat_bnds coordinates from the grid file to the dataset.

grid.add_edge_data(ds, grid)

Add elon, elat, elon_bnds, and elat_bnds and other edge related coordinates from the grid file to the dataset.

grid.open_dataset(file[, variable, ...])

Open either NETCDF or GRIB file.

Plotting functions#

formatoptions

formatoptions.borders

Formatoption that adds internal land borders on mapplot, mapvector, and mapcombined plots created by psyplot.

formatoptions.lakes

Formatoption that adds lakes to mapplot, mapvector, and mapcombined plots created by psyplot.

formatoptions.rivers

Formatoption that adds rivers to mapplot, mapvector, and mapcombined plots created by psyplot.

config

This module config.py contains the public function read_config which parses configuration file for plotting scripts in icon-vis.

Utility functions#

get_data

This script/module contains the function get_example_data which downloads example ICON data from FTP server (NETCDF, GRIB and Grid files).

get_data.get_example_data()

Download example ICON data from FTP server (NETCDF, GRIB and Grid files) to current directory.

Indices and tables#