Tips and Examples¶
Functions with arguments that represent longitude and latitude (coordinates, etc.) will always take them in this order (first lon, then lat), following the order used e.g. in plotting contexts or vector components (e.g. [X°N, Y°E] or [u, v]). Note that this is order is the reverse of the axis order in the underlying arrays, where latitude comes before longitude.
To ensure numerically robust and accurate results,
Grid.quad()andGrid.quad_meridional()as well as functions relying on these routines, such asGrid.zonalize()anddiagnostics.falwa(), use the sptrapz integration scheme by default. Consider using the boxcount scheme to accelerate computations where highest accuracy is not required.Use the convenience constants
ZONALandMERIDIONALfrom the top-level namespace to address field dimensions.Use the convenience factors
MIN,HOUR,DAY,WEEKto create time intervals in a readable manner. Alternatively, bothStateandBarotropicModelcan handledatetime.timedeltaanddatetime.datetimeobjects as input.
Example Notebooks¶
Jupyter notebooks utilizing barotropic:
Transition from 2.x to 3.x¶
In the transition from version 2.x to 3.x, many methods, attributes, function arguments, etc. have been moved or renamed. Some significant changes include:
The lat, lon, etc. properties of
Gridhave been renamed.The former diagnostic module is now called diagnostics.
Quadrature, derivatives and interpolation on
Gridhave been restructured.scipy is now a mandatory dependency.
Longitude now appears consistently before latitude in argument lists (except for direct array access, where lat is the zeroth dimension).
Thus, it is very unlikely that code from version 2.x still works after upgrading to version 3.x.
Version 2.x continues to be available on the master branch, development of 3.x has moved to a new main branch (which is the default branch of the repository now).