Skip to content

Commit

Permalink
docs: add docstring sound calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
RDWimmers committed Dec 7, 2023
1 parent 5c56f9d commit d80ee93
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/pyvibracore/results/sound_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@
def _sound_prediction(
power: float, k2: float, period: float, levels: List[float]
) -> NDArray:
"""
Based on the 'Handleiding meten en rekenen industrielawaai' 2004 methode l.
More information: https://open.overheid.nl/Details/ronl-15eb5528-d835-4f6a-b3a1-fc0851b334f9/1
Parameters
----------
power:
source power [dB]
k2:
Correction term [dB]
period:
Operating period of the building code [hours]
levels: list
Array of floats to calculate the distance
Returns
-------
distance: NDArray
"""
distance = np.arange(1e-5, 500, step=0.2)
noise = (
power
Expand Down Expand Up @@ -166,7 +185,9 @@ def map_sound(
if building.empty:
raise ValueError(f"No buildings with name {building_name}.")

building.plot(ax=axes, zorder=2, color="gray", aspect=1)
building.where(buildings["name"] == building_name).plot(
ax=axes, zorder=2, color="gray", aspect=1
)
buildings.where(buildings["name"] != building_name).plot(
ax=axes, zorder=2, color="lightgray", aspect=1
)
Expand Down

0 comments on commit d80ee93

Please sign in to comment.