Changed all references to PropsSI in python plotting

See https://github.com/CoolProp/CoolProp/issues/116

Not sure this fixes things entirely, but it goes some way towards it.  Need to think a bit more about axis units

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-08-26 14:16:40 +02:00
parent 3f6b6b4e35
commit 5cdb9c5d0e

View File

@@ -109,15 +109,12 @@ def InlineLabel(xv,yv,x = None, y= None, axis = None, fig = None):
else:
raise ValueError("You have to provide the same amount of x- and y-pairs with at least two entries each.")
if axis is None:
axis=matplotlib.pyplot.gca()
if fig is None:
fig=matplotlib.pyplot.gcf()
if y is None and x is not None:
trash=0
(xv,yv)=ToPixelCoords(xv,yv,axis,fig)
@@ -174,7 +171,7 @@ def drawLines(Ref,lines,axis,plt_kwargs=None):
plottedLines.extend([line])
# Do we need to test if this is T or p?
Tmax = min(bubble['kmax'],dew['kmax'])
if Tmax>CP.Props(Ref,'Tcrit')-2e-5:
if Tmax>CP.PropsSI(Ref,'Tcrit')-2e-5:
axis.plot(numpy.r_[bubble['x'][-1],dew['x'][-1]],numpy.r_[bubble['y'][-1],dew['y'][-1]],**bubble['opts'])
#axis.plot((bubble['x'][-1]+dew['x'][-1])/2.,(bubble['y'][-1]+dew['y'][-1])/2.,'o',color='Tomato')
else:
@@ -210,38 +207,38 @@ class IsoLines(BasePlot):
"""
# Get current axis limits, be sure to set those before drawing isolines
# if no limits are set, use triple point and critical conditions
X = [CP.Props(self.graph_type[1],
'T', 1.5*CP.Props(self.fluid_ref, 'Tcrit'),
'P', CP.Props(self.fluid_ref, 'ptriple'),
X = [CP.PropsSI(self.graph_type[1],
'T', 1.5*CP.PropsSI(self.fluid_ref, 'Tcrit'),
'P', CP.PropsSI(self.fluid_ref, 'ptriple'),
self.fluid_ref),
CP.Props(self.graph_type[1],
'T', 1.1*CP.Props(self.fluid_ref, 'Tmin'),
'P', 1.5*CP.Props(self.fluid_ref, 'pcrit'),
CP.PropsSI(self.graph_type[1],
'T', 1.1*CP.PropsSI(self.fluid_ref, 'Tmin'),
'P', 1.5*CP.PropsSI(self.fluid_ref, 'pcrit'),
self.fluid_ref),
CP.Props(self.graph_type[1],
'T', 1.5*CP.Props(self.fluid_ref, 'Tcrit'),
'P', 1.5*CP.Props(self.fluid_ref, 'pcrit'),
CP.PropsSI(self.graph_type[1],
'T', 1.5*CP.PropsSI(self.fluid_ref, 'Tcrit'),
'P', 1.5*CP.PropsSI(self.fluid_ref, 'pcrit'),
self.fluid_ref),
CP.Props(self.graph_type[1],
'T', 1.1*CP.Props(self.fluid_ref, 'Tmin'),
'P', CP.Props(self.fluid_ref, 'ptriple'),
CP.PropsSI(self.graph_type[1],
'T', 1.1*CP.PropsSI(self.fluid_ref, 'Tmin'),
'P', CP.PropsSI(self.fluid_ref, 'ptriple'),
self.fluid_ref)]
Y = [CP.Props(self.graph_type[0],
'T', 1.5*CP.Props(self.fluid_ref, 'Tcrit'),
'P', CP.Props(self.fluid_ref, 'ptriple'),
Y = [CP.PropsSI(self.graph_type[0],
'T', 1.5*CP.PropsSI(self.fluid_ref, 'Tcrit'),
'P', CP.PropsSI(self.fluid_ref, 'ptriple'),
self.fluid_ref),
CP.Props(self.graph_type[0],
'T', 1.1*CP.Props(self.fluid_ref, 'Tmin') ,
'P', 1.5*CP.Props(self.fluid_ref, 'pcrit'),
CP.PropsSI(self.graph_type[0],
'T', 1.1*CP.PropsSI(self.fluid_ref, 'Tmin') ,
'P', 1.5*CP.PropsSI(self.fluid_ref, 'pcrit'),
self.fluid_ref),
CP.Props(self.graph_type[0],
'T', 1.1*CP.Props(self.fluid_ref, 'Tcrit'),
'P', 1.5*CP.Props(self.fluid_ref, 'pcrit'),
CP.PropsSI(self.graph_type[0],
'T', 1.1*CP.PropsSI(self.fluid_ref, 'Tcrit'),
'P', 1.5*CP.PropsSI(self.fluid_ref, 'pcrit'),
self.fluid_ref),
CP.Props(self.graph_type[0],
'T', 1.5*CP.Props(self.fluid_ref, 'Tmin') ,
'P', CP.Props(self.fluid_ref, 'ptriple'),
CP.PropsSI(self.graph_type[0],
'T', 1.5*CP.PropsSI(self.fluid_ref, 'Tmin') ,
'P', CP.PropsSI(self.fluid_ref, 'ptriple'),
self.fluid_ref)]
limits = [[min(X), max(X)], [min(Y), max(Y)]]
@@ -323,7 +320,7 @@ class IsoLines(BasePlot):
#iso_range = plotRound(iso_range)
#else:
# TODO: Automatic interval detection
# iVal = [CP.Props(iName,'T',T_c[i],'D',rho_c[i],Ref) for i in range(len(T_c))]
# iVal = [CP.PropsSI(iName,'T',T_c[i],'D',rho_c[i],Ref) for i in range(len(T_c))]
# iVal = patterns[iName]([numpy.min(iVal),numpy.max(iVal),num])
if rounding: