Skip to content

Commit

Permalink
More up-to-date examples in documentation (#140)
Browse files Browse the repository at this point in the history
* More up-to-date examples in documentation

* one cell was markdown by mistake

* dx

* fixing up typos

* further typos

* make html works locally

* black reformatting

* Acknowledge Dougie's contribution

* Updating Parseval's example

* Recovering windows cell

* Updating Parseval noteboom

* grammar

* adding numpy example

* first bullet point

* redundant period
  • Loading branch information
Takaya Uchida authored Mar 15, 2021
1 parent 0129649 commit 2bb85b3
Show file tree
Hide file tree
Showing 9 changed files with 794 additions and 30 deletions.
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ It is:
.. _dask API of FFT: http://docs.dask.org/en/latest/array-api.html?highlight=fft#fast-fourier-transforms
.. _map_blocks: http://docs.dask.org/en/latest/array-api.html?highlight=map_blocks#dask.array.core.map_blocks

Please cite the `doi <https://doi.org/10.5281/zenodo.1402635>`_ if you find this
package useful in order to support its continuous development.

Get in touch
------------

Expand Down
402 changes: 402 additions & 0 deletions doc/DFT-iDFT_example.ipynb

Large diffs are not rendered by default.

27 changes: 13 additions & 14 deletions doc/MITgcm_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Realistic example using outputs from MITgcm\n",
"This example requires the understanding of [xgcm.grid](https://xgcm.readthedocs.io/en/latest/api.html#grid) and [xmitgcm.open_mdsdataset](https://xmitgcm.readthedocs.io/en/latest/usage.html)."
]
},
Expand Down Expand Up @@ -138,7 +139,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Discrete Fourier Transform\n",
"**Discrete Fourier Transform**\n",
"\n",
"We chunk the data along the `time` and `Z` axes to allow parallelized computation and detrend and window the data before taking the DFT along the horizontal axes."
]
},
Expand Down Expand Up @@ -218,17 +220,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Power spectrum\n",
"**Power spectrum**\n",
"\n",
"We compute the surface eddy kinetic energy spectrum."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Horizontal wavenumber spectrum"
]
},
{
"cell_type": "code",
"execution_count": 8,
Expand Down Expand Up @@ -306,7 +302,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Isotropic wavenumber spectrum"
"**Isotropic wavenumber spectrum**\n",
"\n",
"We now isotropize the spectrum:"
]
},
{
Expand Down Expand Up @@ -429,8 +427,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Cross Spectrum\n",
"We calculate the cross correlation between vertical velocity ($w$) and buoyancy ($b$)."
"**Cross Spectrum**\n",
"\n",
"We calculate the cross correlation between vertical velocity ($w$) and buoyancy ($b$):"
]
},
{
Expand Down Expand Up @@ -573,9 +572,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.2"
"version": "3.8.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
354 changes: 354 additions & 0 deletions doc/Parseval_example.ipynb

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"sphinxcontrib.apidoc",
"numpydoc",
"nbsphinx",
"IPython.sphinxext.ipython_directive",
"IPython.sphinxext.ipython_console_highlighting",
]

Expand Down
4 changes: 3 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ Documentation
:maxdepth: 1
:caption: Examples

MITgcm_example
DFT-iDFT_example
Parseval_example
chunk_example
MITgcm_example

.. toctree::
:maxdepth: 1
Expand Down
12 changes: 0 additions & 12 deletions doc/limitations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,8 @@ Current limitations

.. _limitations-label:

Windowing
---------

xrft currently only supports the Hanning window.

Discrete sinusoid transform
---------------------------

xrft currently only supports discrete fourier transforms. We plan to implement
discrete sinusoid tranforms in the near future.

Parallel isotropic spectrum
---------------------------

Isotropic spectral calculations in xrft currently only run in serial along the axes
that are not being transformed.
Parallel options are being investigated.
20 changes: 18 additions & 2 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
What's New
==========

.. _whats-new.0.3.0:

v0.3.0 (18 February 2021)
----------------------

Enhancements
~~~~~~~~~~~~

- Implemented the inverse discrete Fourier transform ``idft``. By `Frederic Nouguier <https://github.com/lanougue>`_

- Allowed windowing other than the Hann function. By `Takaya Uchida <https://github.com/roxyboy>`_

- Allowed parallelization of isotropizing the spectrum via ``numpy_groupies``.
By `Takaya Uchida <https://github.com/roxyboy>`_

- Implemented proper amplitude correction for real Fourier transform and windowed data. By `Dougie Squire <https://github.com/dougiesquire>`_

.. _whats-new.0.2.0:

v0.2.0 (10 April 2019)
Expand All @@ -23,8 +40,7 @@ Enhancements

.. warning::

This is the last xrft release that will support Python 2.7. Future releases
will be Python 3 only. For the more details, see:
Python 2.7 is no longer supported in ``xrft``. For the more details, see:

- `Python 3 Statement <http://www.python3statement.org/>`__
- `Tips on porting to Python 3 <https://docs.python.org/3/howto/pyporting.html>`__
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Scientific/Engineering",
]

Expand Down

0 comments on commit 2bb85b3

Please sign in to comment.