Skip to content

Commit

Permalink
fix deficiency and modified graph
Browse files Browse the repository at this point in the history
  • Loading branch information
bozzlab committed Apr 17, 2022
1 parent 243b214 commit c51ddd9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions pyacoustics_stc/sound_tranmission_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, stl: Dict[int, float]):

self._stc_point: int = None
self._stc_contour: Dict[int, float] = {}
self._defiency: int = None
self._deficiency: int = None
self._delta: Dict[int, float] = {}
self._stl_stc_delta_contours: Dict[int, float] = {}

Expand Down Expand Up @@ -48,7 +48,7 @@ def deficiency(self) -> float:
"""
Sum of delta values between STL and STC.
"""
return self._defiency
return self._deficiency

@property
def delta(self) -> Dict[int, float]:
Expand Down Expand Up @@ -89,6 +89,13 @@ def _plot(self) -> plt:
bbox=dict(facecolor="cyan", alpha=0.5),
xycoords="axes fraction",
)
plt.annotate(
f"Deficiency {self._deficiency}",
xy=(0.09, 0.960),
fontsize=10,
bbox=dict(facecolor="yellow", alpha=0.5),
xycoords="axes fraction",
)
plt.xticks(x_axis_index, x_axis_frequency, fontsize=12)
plt.yticks(fontsize=12)
plt.grid(linestyle="-", linewidth=0.5)
Expand Down Expand Up @@ -116,7 +123,7 @@ def _evaluate(self):
freq: round(value, MAX_DIGIT)
for freq, value in filtered_delta_contours[self._stc_point].items()
}
self._defiency = round(
self._deficiency = round(
sum(
[
stc_value
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyacoustics-stc"
version = "0.1.0"
version = "0.2.1"
description = "The Python library for Sound Transmission Class (STC) calculation"
authors = ["Peem Srinikorn (Bozzlab) <[email protected]>"]
keywords = ["Acoustics", "Sound Tranmission Class", "Sound Transmission Loss", "STC"]
Expand Down
Binary file modified stc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c51ddd9

Please sign in to comment.