Sounding Methods
makeNumericSounding
(numeric only)
interpolateValues
linear
extrapolate
interpolateScalarValues
interpolateVectorValues
getLevels
getSoundingValue
(point-based
only)
getValueFromSounding
(point-based only)
makeSounding (point-based
only)
getNumericMeanValue
(numeric only)
getMeanValue (point-based
only)
makeNumericSounding (numeric only)
def makeNumericSounding(self, model, element, levels, timeRange,
noDataError=1,
mostRecentModel=0):
# Make a numeric sounding for the given
model, element, and levels
# Example:
# levels =
["MB850","MB800","MB750","MB700","MB650","MB600"]
# gh_Cube, rh_Cube =
self.makeNumericSounding(
# model, "rh", levels, GridTimeRange)
#
# Arguments:
#
# The "levels" argument is a Python
list of levels INCREASING
# in height.
# This method returns two numeric cubes:
# ghCube of geopotential heights for
the given levels
# valueCube of values for the given
levels
interpolateValues
def interpolateValues(self, height, (h1, v1), (h2, v2)):
# Interpolate between the height and
values
linear
def linear(self, xmin, xmax, ymin, ymax, we):
extrapolate
def extrapolate(self, height, (h1, v1),(h2, v2)):
# Extrapolate from the height and values
interpolateScalarValues
def interpolateScalarValues(self, height, (h1, v1), (h2, v2)):
# Interpolate between the height and
values
interpolateVectorValues
def interpolateVectorValues(self, height, (h1, v1), (h2, v2)):
# Interpolate between the height and
values
getLevels
def getLevels(self, level1, level2, noDataError=1):
# Return a list of levels between and
including level1 and level2
# Will do ascending or descending
depending
on order of arguments
# levels = self.getLevels("MB900",
"MB500")
# descending
# levels = self.getLevels("MB600",
"MB1000")
# ascending
getSoundingValue (point-based only)
def getSoundingValue(self, model, element, levels, x, y, timeRange,
height,
method=None, noDataError=1, mostRecentModel=0):
# Make a sounding for the given model,
element, and levels at
# the x,y coordinates for the given
timeRange.
# Then get the value of the sounding
for the given height.
# Use the given method for calculating
a value between two heights
# in the sounding.
# The levels MUST be increasing in
height.
# Height needs to be in the same units
as the sounding.
# The default method if None is
specified,
is "interpolateValues"
#
# Example:
# topo_M = convertFtToM(Topo)
# levels =
["MB850","MB800","MB750","MB700","MB650","MB600"]
# surfaceRH =
self.getSoundingValue(model,
"rh", levels, x, y,
# GridTimeRange, topo_M)
# Arguments:
#
# The "levels" argument is a Python
list of levels INCREASING
# in height.
# The other argument descriptions are
the same as for
# "getValue" (see above)
# Find bounding levels (lowerLevel and
upperLevel)
# for the given height
makeSounding (point-based only)
def makeSounding(self, model, element, levels, x, y, timeRange,
noDataError=1,
mostRecentModel=0):
# Make a sounding for the given model,
element, and levels
# Example:
# levels =
["MB850","MB800","MB750","MB700","MB650","MB600"]
# sounding = self.makeSounding(model,
"rh", levels, x, y,
# GridTimeRange)
#
# Arguments:
#
# The "levels" argument is a Python
list of levels INCREASING
# in height.
# The other argument descriptions are
the same as for
# "getValue" (see above)
# This method returns a tuple of height,
value tuples.
# In general, you will not need to
access
the sounding directly,
# but will simply pass it to the
"getValueFromSounding"
method
# (see below)
getValueFromSounding
(point-based only)
def getValueFromSounding(self, sounding, height, method=None):
# Get the value of the sounding for
the given
# height. Use the given method for
calculating
a value
# between two heights in the sounding.
# The default method if None is
specified,
is "interpolateValues"
#
# Example:
# levels =
["MB850","MB800","MB750","MB700","MB650","MB600"]
# sounding = self.makeSounding(model,
"rh", levels, x, y,
# GridTimeRange)
# topo_M = convertFtToM(Topo)
# surfaceRH =
self.getValueFromSounding(sounding,
topo_M)
#
#
# Height needs to be in the same units
as the sounding
# The sounding is assumed to be
increasing
in height
getNumericMeanValue (numeric only)
def getNumericMeanValue(self, model, element, levels, timeRange,
noDataError=1):
# Return a numeric array of mean values
for the given element between and including
# the given levels
getMeanValue (point-based only)
def getMeanValue(self, model, element, levels, x, y, timeRange,
noDataError=1):
# Get a mean value for the given element
between and including
# the given levels