Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/source/includes/contributing/contribute_method.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,28 @@ Extracting Source/Receiver Positions
Writing Results
~~~~~~~~~~~~~~~

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

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 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
result_container["results"][0]["responses"][i_rec]["receiverResults"].append(
{
"data": energy_decay_curve.tolist(),
"t": times_vector.tolist(),
"frequency": 125,
"type": "edc",
}
)