Skip to content

Commit

Permalink
Restructure docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceyron committed Sep 5, 2024
1 parent da40239 commit bd1eb67
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions exponax/_spectral.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,10 +868,6 @@ def get_spectrum(
The returned array will always have two axes, no matter how many spatial
axes the input has.
!!! info
If it is applied to a vorticity field with `power=True` (default), it
produces the enstrophy spectrum.
**Arguments:**
- `state`: The state to compute the spectrum of. The state must follow the
Expand All @@ -884,6 +880,17 @@ def get_spectrum(
- `spectrum`: The spectrum of the state, shape `(C, (N//2)+1)`.
!!! tip
The spectrum is usually best presented with a logarithmic y-axis, either
as `plt.semiology` or `plt.loglog`. Sometimes it can be helpful to set
the spectrum below a threshold to zero to better visualize the relevant
parts of the spectrum. This can be done with `jnp.maximum(spectrum,
1e-10)` for example.
!!! info
If it is applied to a vorticity field with `power=True` (default), it
produces the enstrophy spectrum.
!!! note
The binning in higher dimensions can sometimes be counterintuitive. For
example, on a 2D grid if mode `[2, 2]` is populated, this is not
Expand Down

0 comments on commit bd1eb67

Please sign in to comment.