From b8193494ccf741283a1a4612d6036b6d4e7aef83 Mon Sep 17 00:00:00 2001 From: Anne Heimes Date: Tue, 12 May 2026 10:46:44 +0200 Subject: [PATCH 1/3] add etc results to contribution guidelines --- .../contributing/contribute_method.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/source/includes/contributing/contribute_method.rst b/docs/source/includes/contributing/contribute_method.rst index 77dd47b..222b8d4 100644 --- a/docs/source/includes/contributing/contribute_method.rst +++ b/docs/source/includes/contributing/contribute_method.rst @@ -261,9 +261,27 @@ Extracting Source/Receiver Positions Writing Results ~~~~~~~~~~~~~~~ +For impulse responses, the sampling rate is fixed to 44.1kHz: + .. code-block:: python result_container["results"][0]["responses"][0]["receiverResults"] = results.tolist() with open(json_file_path, "w") as json_output: json_output.write(json.dumps(result_container, indent=4)) + + +for ETC results assuming the etc of shape (n_receiver, n_fbands, n_times) and +and the times being the time vector of shape (n_times): + +.. code-block:: python + for i_rec in range(n_receivers): + for i_frequency in range(n_bands): + result_container["results"][0]["responses"][i_rec]["receiverResults"].append( + { + "data": 10*np.log10(etc[i_rec, i_frequency]/1e-12).tolist(), + "t": times.tolist(), + "frequency": frequencies[i_frequency], + "type": "edc", + } + ) From 27cd4d337b67fd8fb1e85dff2a732a6257faf70f Mon Sep 17 00:00:00 2001 From: Anne Heimes <64446926+ahms5@users.noreply.github.com> Date: Wed, 13 May 2026 09:43:13 +0200 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Marco Berzborn --- docs/source/includes/contributing/contribute_method.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/includes/contributing/contribute_method.rst b/docs/source/includes/contributing/contribute_method.rst index 222b8d4..b63a4f6 100644 --- a/docs/source/includes/contributing/contribute_method.rst +++ b/docs/source/includes/contributing/contribute_method.rst @@ -271,7 +271,7 @@ For impulse responses, the sampling rate is fixed to 44.1kHz: json_output.write(json.dumps(result_container, indent=4)) -for ETC results assuming the etc of shape (n_receiver, n_fbands, n_times) and +for energy time curves - assuming the etc of shape (n_receiver, n_fbands, n_times) - and and the times being the time vector of shape (n_times): .. code-block:: python From 27750b28bfebe5f6bc0308034baad4525b822a98 Mon Sep 17 00:00:00 2001 From: Anne Heimes Date: Wed, 13 May 2026 09:50:28 +0200 Subject: [PATCH 3/3] apply review --- .../contributing/contribute_method.rst | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/docs/source/includes/contributing/contribute_method.rst b/docs/source/includes/contributing/contribute_method.rst index b63a4f6..8b75d90 100644 --- a/docs/source/includes/contributing/contribute_method.rst +++ b/docs/source/includes/contributing/contribute_method.rst @@ -261,7 +261,9 @@ Extracting Source/Receiver Positions Writing Results ~~~~~~~~~~~~~~~ -For impulse responses, the sampling rate is fixed to 44.1kHz: +For impulse responses, the sampling rate is defined by the frontend and can be +assessed by ``input_data["simulationSettings"]["sampling_rate"]``. The impulse +response is provided as follows: .. code-block:: python @@ -271,17 +273,16 @@ For impulse responses, the sampling rate is fixed to 44.1kHz: json_output.write(json.dumps(result_container, indent=4)) -for energy time curves - assuming the etc of shape (n_receiver, n_fbands, n_times) - and -and the times being the time vector of shape (n_times): +for energy time curves - The results are appended for each frequency band. +Here is an example for the ``energy_decay_curve`` for the 125 Hz frequency band +and its ``times_vector``: .. code-block:: python - for i_rec in range(n_receivers): - for i_frequency in range(n_bands): - result_container["results"][0]["responses"][i_rec]["receiverResults"].append( - { - "data": 10*np.log10(etc[i_rec, i_frequency]/1e-12).tolist(), - "t": times.tolist(), - "frequency": frequencies[i_frequency], - "type": "edc", - } - ) + result_container["results"][0]["responses"][i_rec]["receiverResults"].append( + { + "data": energy_decay_curve.tolist(), + "t": times_vector.tolist(), + "frequency": 125, + "type": "edc", + } + )