awips2/cave/com.raytheon.uf.viz.derivparam.python/localization/derivedParameters/functions/LvlFgen.py
Steve Harris 39ff9954f8 12.5.1-15 baseline
Former-commit-id: 8552902906 [formerly b13cbb7e00] [formerly 8552902906 [formerly b13cbb7e00] [formerly 3904c4ccf5 [formerly 4909e0dd166e43c22a34d96aa744f51db8a7d6c0]]]
Former-commit-id: 3904c4ccf5
Former-commit-id: 97c4db937e [formerly 676ea3192f]
Former-commit-id: 9054c5ab6c
2012-06-08 13:39:48 -05:00

47 lines
1.5 KiB
Python

##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
#
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 01/19/12 DR14296 M. Huang Flipped result by applying -1
#
#
from numpy import power
from LvlQvec import calculate as lvlQvec
def execute(GHxSM, TxSM, P, dx, dy, coriolis):
slqx, slqy, dtdx, dtdy = lvlQvec(GHxSM, TxSM, P, dx, dy, coriolis)
# Compute the temperature to potential temperature ratio for this level.
t2th = power(1000/P, 0.286)
t2th *= 2
# Now calculate the QG frontogensis function for this level.
# Fgen = 2(Qx * d(theta)/dx + Qy * d(theta)/dy)
result = slqx * dtdx
result -= slqy * dtdy
result *= t2th
return result