epygram.geometries.SpectralGeometry — Spectral Geometry class

Contains the class that handles spectral parameters and spectral transforms.

epygram.geometries.SpectralGeometry.truncation_from_gridpoint_dims(dimensions, grid='linear', stretching_coef=1.0)[source]

Compute truncation from gridpoint dimensions, according to the kind of grid.

Parameters
  • dimensions – dict containing dimensions, among: {‘X’:…, ‘Y’:…} for LAM grids, {‘lat_number’:…, ‘max_lon_number’:…} for Gauss grids

  • grid – how to choose the truncation, among (‘linear’, ‘quadratic’, ‘cubic’)

  • stretching_coef – stretching or dilatation coefficient for stretched Gauss grids (has an impact on the gridpoint/spectral dimensions)

Formula taken from “Spectral transforms in the cycle 45 of ARPEGE/IFS”, http://www.umr-cnrm.fr/gmapdoc/IMG/pdf/ykts45.pdf


class epygram.geometries.SpectralGeometry.SpectralGeometry(space, truncation)[source]

Bases: epygram.util.RecursiveObject

Handles the spectral geometry and transforms for a H2DField.

Parameters
  • space – Name of spectral space. (among [‘legendre’, ‘bi-fourier’, ‘fourier’])

  • truncation – Handles the spectral truncation parameters.

compute_xy_spderivatives(data, gpdims, spectral_coeff_order='model')[source]

Compute the derivatives of the spectral data contained in data in spectral space (assumed this spectral geometry is that of data) and return it in gridpoint space, defined by its dimensions contained in gpdims.

Parameters
  • data – spectral data

  • gpdims (dict) – gridpoints dimensions

  • spectral_coeff_order – among ‘model’ or ‘FA’, cf. default and description in config.spectral_coeff_order

Returns: (dz/dx, dz/dy)

Input and output data are both 1D.

etrans_inq(gpdims)[source]

Wrapper to IAL’s ETRANS_INQ.

Parameters

gpdims (dict) – gridpoints dimensions

gp2sp(data, gpdims, spectral_coeff_order='model')[source]

Makes the transform of the gridpoint data contained in data to the spectral space and truncation of this object, and returns the spectral data.

Parameters
  • data – gridpoint data

  • gpdims (dict) – gridpoints dimensions

  • spectral_coeff_order – among ‘model’ or ‘FA’, cf. default and description in config.spectral_coeff_order

Input and output data are both 1D.

legendre_known_spectraldata_size()[source]

In order to avoid calling trans_inq for large truncations.

property needed_memory

Memory needed for transforms, in bytes.

sp2gp(data, gpdims, spectral_coeff_order='model')[source]

Makes the transform of the spectral data contained in data (assumed this spectral geometry is that of data) to gridpoint space, defined by its dimensions contained in gpdims, and returns the gridpoint data.

Parameters
  • data – spectral data

  • gpdims (dict) – gridpoints dimensions

  • spectral_coeff_order – among ‘model’ or ‘FA’, cf. default and description in config.spectral_coeff_order

Input and output data are both 1D.

trans_inq(gpdims)[source]

Wrapper to IAL’s TRANS_INQ.

Parameters

gpdims (dict) – gridpoints dimensions