| |
- transform_AQobj(x, y)
- Return copy of x transformed onto the "domain" of y.
Calling Sequence: Result = transform_AQobj(x, y)
Both x and y are AtmQty objects. Returns a deep copy of x with all
atmospheric quantities in x.qty interpolated to the "domain" de-
scribed by y. Quantity-type attributes P_surf and T_surf are also
horizontally interpolated, if applicable. The returned object also
may have changed/added attributes as part of the transformation
from the x "domain" to the y "domain" (e.g. lon). Returned object
Result is of class AtmQty.
This function is used primarily for regridding x atmospheric quan-
tities, if x and y are different spatial domains. It can also be
used to create an object where the missing values in arrays in x
are set to y.missing.
The "domain" of an AtmQty object is described by 5 (or 6, if p0 is
applicable) attributes: lat, lon, lev, lev_type, and missing (and
p0, if applicable). All other attributes in y are ignored by this
function.
NB: Since the Result quantities dictionary (and boundary condition
attributes) are filled by interpolation and not recomputation,
though all the derived variables in x are consistent with one
another because they were all computed from the same given state
variables, all the derived variables in Result are only consistent
in the sense they were all interpolated from the same x counter-
parts.
Positional Input Arguments:
* x: AtmQty object. Not changed by function.
* y: AtmQty object. Not changed by function.
References:
* Drach, R., et al. (2002): Climate Data Management System, Version
3.3. Livermore, CA: Lawrence Livermore National Laboratory, UCRL-
JC-134897. See http://esg.llnl.gov/cdat/cdmsV3.3.pdf.
Example to create xnew, which has the fields in x interpolated to the
domain in y, and with the missing value value the same as in y (xnew,
x, y are all AtmQty objects):
from transform_AQobj import transform_AQobj
xnew = transform_AQobj(x, y)
Notes:
* Horizontal regridding: Latitude-longitude grid regridding is done
using the regrid method of CDAT transient variables. Information
on CDAT is available at http://esg.llnl.gov/cdat/.
* Vertical interpolation: For pressure, temperature, and potential
temperature, interpolation is done on a log-log basis (i.e. linear
interpolation between log(p) or log(theta) and log(quantity)).
For all other fields, interpolation is done on a log-linear basis
(i.e. linear interpolation between log(p) or log(theta) and the
quantity). Note that if there are missing values in quantities
p or theta (such as from data gaps in temperature), the interpol-
ation routine will ignore those points completely and assume that
interpolation using only the remaining points is legitimate.
* Output values at domain locations in y that are outside of the
data domain specified in x are set to y.missing. However, the
atmospheric quantity corresponding to lev_type is set from the
lev attribute, and so there are no missing values, Also, if the
quantity fc is in x, the transformed value of fc is recalculated
directly from the y domain information (so there are also no
missing values in fc).
|