atmqty Manual: How To Use The Package

There are three ways of using this package: (1) for its central definition of atmospheric constants, (2) as a suite of procedures to calculate selected atmospheric quantities using Numeric arrays as input, and (3) for the AtmQty object, which manages the calculation of a self-consistent set of atmospheric quantities.

The first use is pretty obvious. The second and third uses deserve a little elaboration.

One of the strengths of Python is its flexibility. Thus, even though it is an object-oriented language, it can also be used as a procedural language. While objects enable software engineers to write more portable and robust code (at least for industrial applications), many climate scientists both think and program procedurally. Often in climate science you have a bunch of data in memory you just want to do stuff to. There is also some cognitive science research that suggests procedural expressions more closely map the cognition framework used by experts to solve physical science problems.

Thus, because atmqty is written for climate scientists (and not computer scientists) to use, it made sense to make as much of the functionality procedural as well as object-oriented. Thus, a number of the methods provided in class AtmQty to calculate atmospheric quantities actually call procedural functions that perform the task on generic Numeric arrays (e.g. the theta method and function). Besides being called by the AtmQty methods, these procedural functions have a number of other uses:

  • Because many of them operate on Numeric arrays of arbitrary shape and size, the procedures can be used on problems where the data is not already formatted on a latitude-longitude-level domain (as is assumed in AtmQty).
  • Since the procedures are invoked using standard function syntax, they are useful for debugging.

A summary list of these procedural functions is found here.

For some types of calculations, however, objects really provide a powerful organizing tool, by binding methods and attributes together, and enable more robust coding. This is particularly true if there is some structure to the problem domain. The AtmQty class provides a more robust framework for managing interrelated atmospheric quantities, within a fixed latitude-longitude-level domain. As a result, some of the methods in AtmQty are not available procedurally in the atmqty package, as those methods make use of the linking of methods and attributes. An example is vort_rel which calculates relative vorticity: this method requires the data be embedded in a structure that can be broken down into horizontal rectilinear grids, something that AtmQty automatically provides.

In summary, this package is quite easily adapted to the needs of your problem. Pick, choose, and combine the features as you need. The package description on the package home page provides a quick summary of the features. This manual provides more details. Happy computing!

Return to atmqty Manual Index.
Return to atmqty Home Page.

Valid HTML 4.01! Valid CSS! Updated: May 7, 2004 by Johnny Lin <email address>. License.