Skip to content

Commit

Permalink
Passes test on my mac
Browse files Browse the repository at this point in the history
  • Loading branch information
doutriaux1 committed Aug 20, 2019
1 parent a81c7e5 commit a1984d0
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions Lib/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,19 +826,19 @@ def plot_pseudo(self, template, bg):
"""
levs = self.pseudoadiabats.level
levels = []
for l in levs:
levels.append(l[0])
for l_tmp in levs:
levels.append(l_tmp[0])
# Ok we now have the required levels
xs = []
ys = []
xstxt = []
ystxt = []
txt = []
for il in range(len(levels)):
l = levels[il]
l_tmp = levels[il]
tmpxs = []
tmpys = []
t, p = LiftWet(l + 273.15, self.datawc_y1 * 100.,
t, p = LiftWet(l_tmp + 273.15, self.datawc_y1 * 100.,
self.Pmaxmixingratio * 100., 25000. / self.detail)
nt = len(t)
if il % 3 == 0:
Expand All @@ -857,22 +857,22 @@ def plot_pseudo(self, template, bg):
if ((i - 1.) / nt < crit1 < i / float(nt)) or ((i - 1.) / nt < crit2 < i / float(nt)):
xstxt.append(tx)
ystxt.append(ty)
txt.append(str(l))
txt.append(str(l_tmp))
xs.append(tmpxs)
ys.append(tmpys)
l = self.x.createline()
l.color = [self.pseudoadiabats.linecolors[0], ]
l.viewport = [template.data.x1, template.data.x2,
template.data.y1, template.data.y2]
l.worldcoordinate = [self.xmin, self.xmax, self.ymin, self.ymax]
l.x = xs
l.y = ys
self.displays.append(self.x.plot(l, bg=bg))
l_tmp = self.x.createline()
l_tmp.color = [self.pseudoadiabats.linecolors[0], ]
l_tmp.viewport = [template.data.x1, template.data.x2,
template.data.y1, template.data.y2]
l_tmp.worldcoordinate = [self.xmin, self.xmax, self.ymin, self.ymax]
l_tmp.x = xs
l_tmp.y = ys
self.displays.append(self.x.plot(l_tmp, bg=bg))
t = self.x.createtext()
t.viewport = [template.data.x1, template.data.x2,
template.data.y1, template.data.y2]
t.worldcoordinate = [self.xmin, self.xmax, self.ymin, self.ymax]
t.color = l.color[0]
t.color = l_tmp.color[0]
t.x = xstxt
t.y = ystxt
t.string = txt
Expand Down Expand Up @@ -1262,7 +1262,7 @@ def make_barb(self, n, d, n1, n2, n3, ydeformation, yoff):
barbs angle is 60 degrees
barb depth is .1
"""
""" # noqa
# Intitalize the Drawing, head is at zero
xs = [0]
ys = [0]
Expand All @@ -1278,30 +1278,30 @@ def make_barb(self, n, d, n1, n2, n3, ydeformation, yoff):
# Drawing of big barbs
for i in range(n1):
# summit
l = hinit - bwidth # legth to the middle of big barb
h = numpy.sqrt(bdepth ** 2 + l ** 2)
mu = numpy.arctan(bdepth / l)
l_tmp = hinit - bwidth # legth to the middle of big barb
h = numpy.sqrt(bdepth ** 2 + l_tmp ** 2)
mu = numpy.arctan(bdepth / l_tmp)
ys.append(h * numpy.sin(d + mu))
xs.append(h * numpy.cos(d + mu))

# End of barb
ys.append((l - bwidth) * numpy.sin(d))
xs.append((l - bwidth) * numpy.cos(d))
ys.append((l_tmp - bwidth) * numpy.sin(d))
xs.append((l_tmp - bwidth) * numpy.cos(d))
hinit = hinit - 2 * bwidth
if n1 != 0:
hinit = hinit + bwidth / 2.

# Ok now the long sticks
for i in range(n2):
l = hinit - bwidth
l_tmp = hinit - bwidth
# Move to begining of next one
ys.append(l * numpy.sin(d))
xs.append(l * numpy.cos(d))
ys.append(l_tmp * numpy.sin(d))
xs.append(l_tmp * numpy.cos(d))

# Go to the top one
l = hinit
h = numpy.sqrt(bdepth ** 2 + l ** 2)
mu = numpy.arctan(bdepth / l)
l_tmp = hinit
h = numpy.sqrt(bdepth ** 2 + l_tmp ** 2)
mu = numpy.arctan(bdepth / l_tmp)
ys.append(h * numpy.sin(d + mu))
xs.append(h * numpy.cos(d + mu))

Expand All @@ -1316,15 +1316,15 @@ def make_barb(self, n, d, n1, n2, n3, ydeformation, yoff):
bwidth = bwidth / 2.
bdepth = bdepth / 2.
for i in range(n3):
l = hinit - bwidth
l_tmp = hinit - bwidth
# Move to begining of next one
ys.append(l * numpy.sin(d))
xs.append(l * numpy.cos(d))
ys.append(l_tmp * numpy.sin(d))
xs.append(l_tmp * numpy.cos(d))

# Go to the top one
l = hinit
h = numpy.sqrt(bdepth ** 2 + l ** 2)
mu = numpy.arctan(bdepth / l)
l_tmp = hinit
h = numpy.sqrt(bdepth ** 2 + l_tmp ** 2)
mu = numpy.arctan(bdepth / l_tmp)
ys.append(h * numpy.sin(d + mu))
xs.append(h * numpy.cos(d + mu))
# Back to begining
Expand Down

0 comments on commit a1984d0

Please sign in to comment.