Rename SkewTGraph.pressure_y() to pressure_to_y()
This commit is contained in:
parent
0157437cb5
commit
a1d22f68fa
1 changed files with 3 additions and 3 deletions
|
@ -40,7 +40,7 @@ class SkewTGraph():
|
|||
def graph_to_screen(self, x, y) -> tuple:
|
||||
return (self.width / 2) + x, self.height - y
|
||||
|
||||
def pressure_y(self, pressure: float) -> float:
|
||||
def pressure_to_y(self, pressure: float) -> float:
|
||||
log_p = math.log(clamp(pressure, PRESSURE_MIN, PRESSURE_MAX))
|
||||
factor = (PRESSURE_LOG_MAX - log_p) / PRESSURE_LOG_RANGE
|
||||
|
||||
|
@ -51,7 +51,7 @@ class SkewTGraph():
|
|||
|
||||
for pressure in range(PRESSURE_MIN, PRESSURE_MAX+1, PRESSURE_STEP):
|
||||
coord = self.graph_to_screen(-self.width / 2,
|
||||
self.pressure_y(pressure))
|
||||
self.pressure_to_y(pressure))
|
||||
|
||||
cr.set_source_rgba(0, 0, 0, 0.5)
|
||||
cr.move_to(x + coord[0], y + coord[1])
|
||||
|
@ -63,7 +63,7 @@ class SkewTGraph():
|
|||
|
||||
def sample_to_graph(self, temp: float, pressure: float):
|
||||
x = (temp / TEMP_STEP) * self.temp_step_width
|
||||
y = self.pressure_y(pressure)
|
||||
y = self.pressure_to_y(pressure)
|
||||
|
||||
return self.skew_t_to_graph(x, y)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue