Skip to content

Commit

Permalink
removed cloud variables from parcel object
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff-Szkodzinski committed Nov 11, 2021
1 parent efb8bfc commit ffafa59
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 34 deletions.
25 changes: 0 additions & 25 deletions sharppy/sharptab/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,6 @@ class Parcel(object):
Buoyancy minimum (C)
bminpres : number
Pressure at the buoyancy minimum (mb)
ctf_low : number
Cloud top fraction: Low level (%)
ctf_high : number
Cloud top fraction: High level (%)
ctp_low : number
Cloud top pressure: Low level (mb)
ctp_high : number
Cloud top pressure - High level (mb)
'''
def __init__(self, **kwargs):
self.pres = ma.masked # Parcel beginning pressure (mb)
Expand Down Expand Up @@ -364,11 +356,6 @@ def __init__(self, **kwargs):
self.cappres = ma.masked # Cap strength pressure (mb)
self.bmin = ma.masked # Buoyancy minimum in profile (C)
self.bminpres = ma.masked # Buoyancy minimum pressure (mb)
# JTS
self.ctf_low = ma.masked # Cloud top fraction: Low level (%)
self.ctf_high = ma.masked # Cloud top fraction: High level (%)
self.ctp_low = ma.masked # Cloud top pressure: Low level (mb)
self.ctp_high = ma.masked # Cloud top pressure: High level (mb)
for kw in kwargs: setattr(self, kw, kwargs.get(kw))

def hgz(prof):
Expand Down Expand Up @@ -1891,18 +1878,6 @@ def parcelx(prof, pbot=None, ptop=None, dp=-1, **kwargs):
pcl.hghtm20c = hgtm20c
pcl.hghtm30c = hgtm30c

# JTS - Assign the cloud top values from the profile object to the parcel object.
if prof.ctf_low is not None:
pcl.ctf_low = prof.ctf_low
pcl.ctf_high = prof.ctf_high
pcl.ctp_low = prof.ctp_low
pcl.ctp_high = prof.ctp_high
else:
pcl.ctf_low = -99999
pcl.ctf_high = -99999
pcl.ctp_low = 3000
pcl.ctp_high = 3000

if pbot < prof.pres[-1]:
# Check for the case where the LCL is above the
# upper boundary of the data (e.g. a dropsonde)
Expand Down
24 changes: 15 additions & 9 deletions sharppy/viz/skew.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,8 +1043,9 @@ def plotData(self):

self.draw_parcel_levels(qp)

# JTS - Draw cloud top pressure levels for NUCAPS.
self.draw_cloud_top_pressure_levels(qp)
# JTS - Draw cloud top pressure levels for NUCAPS only.
if self.prof.ctf_low is not None:
self.draw_cloud_top_pressure_levels(qp)

qp.setRenderHint(qp.Antialiasing, False)
try:
Expand Down Expand Up @@ -1250,23 +1251,28 @@ def draw_cloud_top_pressure_levels(self, qp):
x = self.tmpc_to_pix(xbounds, [1000.,1000.])
qp.setFont(self.hght_font)

# Assign profile collection variables for NUCAPS.
ctf_low = str(self.prof.ctf_low)
ctf_high = str(self.prof.ctf_high)
ctp_low = int(self.prof.ctp_low)
ctp_high = int(self.prof.ctp_high)

# Plot CTP_High
if tab.utils.QC(self.pcl.ctp_high):
y = self.originy + self.pres_to_pix(self.pcl.ctp_high) / self.scale
if tab.utils.QC(ctp_high):
y = self.originy + self.pres_to_pix(ctp_high) / self.scale
pen = QtGui.QPen(QtCore.Qt.yellow, 2, QtCore.Qt.SolidLine)
qp.setPen(pen)
qp.drawLine(x[0], y, x[1], y)
rect2 = QtCore.QRectF(x[0], y-8, x[1] - x[0], 4)
qp.drawText(rect2, QtCore.Qt.TextDontClip | QtCore.Qt.AlignCenter, "CTF = " + str(self.pcl.ctf_high) + "%")
qp.drawText(rect2, QtCore.Qt.TextDontClip | QtCore.Qt.AlignCenter, "CTF = " + ctf_high + "%")
# Plot CTP_Low
if tab.utils.QC(self.pcl.ctp_low):
y = self.originy + self.pres_to_pix(self.pcl.ctp_low) / self.scale
if tab.utils.QC(ctp_low):
y = self.originy + self.pres_to_pix(ctp_low) / self.scale
pen = QtGui.QPen(QtCore.Qt.yellow, 2, QtCore.Qt.SolidLine)
qp.setPen(pen)
qp.drawLine(x[0], y, x[1], y)
rect1 = QtCore.QRectF(x[0], y+6, x[1] - x[0], 4)
qp.drawText(rect1, QtCore.Qt.TextDontClip | QtCore.Qt.AlignCenter, "CTF = " + str(self.pcl.ctf_low) + "%")

qp.drawText(rect1, QtCore.Qt.TextDontClip | QtCore.Qt.AlignCenter, "CTF = " + ctf_low + "%")

def omeg_to_pix(self, omeg):
plus10_bound = -49
Expand Down

0 comments on commit ffafa59

Please sign in to comment.