forked from 3rdparty/wrf-python
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1002 B
33 lines
1002 B
from __future__ import (absolute_import, division, print_function, |
|
unicode_literals) |
|
|
|
from .constants import Constants |
|
from .destag import destagger |
|
from .extension import _omega, _tk |
|
from .util import extract_vars |
|
from .metadecorators import copy_and_set_metadata |
|
|
|
|
|
@copy_and_set_metadata(copy_varname="T", name="omega", |
|
description="omega", |
|
units="Pa s-1") |
|
def get_omega(wrfnc, timeidx=0, method="cat", squeeze=True, cache=None, |
|
meta=True, _key=None): |
|
varnames=("T", "P", "W", "PB", "QVAPOR") |
|
ncvars = extract_vars(wrfnc, timeidx, varnames, method, squeeze, cache, |
|
meta=False, _key=_key) |
|
t = ncvars["T"] |
|
p = ncvars["P"] |
|
w = ncvars["W"] |
|
pb = ncvars["PB"] |
|
qv = ncvars["QVAPOR"] |
|
|
|
wa = destagger(w, -3) |
|
full_t = t + Constants.T_BASE |
|
full_p = p + pb |
|
tk = _tk(full_p, full_t) |
|
|
|
omega = _omega(qv, tk, wa, full_p) |
|
|
|
return omega |
|
|