atmqty
Manual: AtmQty
qty
Quantities Data StructureAll atmospheric quantitites are stored in the attribute
qty
. (Note that boundary condition attributes,
like p0
and T_surf
, are not considered
an "atmospheric quantity" and are thus not stored in qty
.)
By using only the methods defined in the AtmQty
object
to manipulate object attributes, it's easier to write more robust
and portable code. Thus, by manipulating the quantities data
structure qty
with methods designed for that purpose
(e.g. add_qty
), you'll write better code. I've tried
to do this in all the components I've written for this package.
That being
said, currently the qty
data structure is a plain-old
Python dictionary. Thus, the lines:
>>> T_pot = x.qty['theta']
and
>>> T_pot = x.get_qty('theta')
are identical.
Each atmospheric quantity is input, stored, and accessed as
a rank 3 Numeric
array where the first index
cycles through latitude, the second index through longitude,
and the third index through level. This is similar to how
MATLAB would index such a rank 3 data structure.
Note that in Python, however,
commonly you'll find rank 3
latitude-longitude-level data structures
(for instance as directly read in from a netCDF dataset)
will index first through level, second through latitude,
and finally through longitude.