diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_003.png b/docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_003.png deleted file mode 100644 index dd415ed2..00000000 Binary files a/docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_003.png and /dev/null differ diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_004.png b/docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_004.png deleted file mode 100644 index 26e1d783..00000000 Binary files a/docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_004.png and /dev/null differ diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_eeof_002.png b/docs/auto_examples/1single/images/sphx_glr_plot_eeof_002.png deleted file mode 100644 index 8080e895..00000000 Binary files a/docs/auto_examples/1single/images/sphx_glr_plot_eeof_002.png and /dev/null differ diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_eeof_003.png b/docs/auto_examples/1single/images/sphx_glr_plot_eeof_003.png deleted file mode 100644 index a43b108f..00000000 Binary files a/docs/auto_examples/1single/images/sphx_glr_plot_eeof_003.png and /dev/null differ diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_eeof_trend_002.png b/docs/auto_examples/1single/images/sphx_glr_plot_eeof_trend_002.png deleted file mode 100644 index 7fb77f55..00000000 Binary files a/docs/auto_examples/1single/images/sphx_glr_plot_eeof_trend_002.png and /dev/null differ diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_eeof_trend_003.png b/docs/auto_examples/1single/images/sphx_glr_plot_eeof_trend_003.png deleted file mode 100644 index 3ca36fdd..00000000 Binary files a/docs/auto_examples/1single/images/sphx_glr_plot_eeof_trend_003.png and /dev/null differ diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png b/docs/auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png deleted file mode 100644 index fe0814bf..00000000 Binary files a/docs/auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png and /dev/null differ diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_mreof_001.png b/docs/auto_examples/1single/images/sphx_glr_plot_mreof_001.png deleted file mode 100644 index 96c346c3..00000000 Binary files a/docs/auto_examples/1single/images/sphx_glr_plot_mreof_001.png and /dev/null differ diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_rotated_eof_001.png b/docs/auto_examples/1single/images/sphx_glr_plot_rotated_eof_001.png deleted file mode 100644 index 8489241a..00000000 Binary files a/docs/auto_examples/1single/images/sphx_glr_plot_rotated_eof_001.png and /dev/null differ diff --git a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eeof trend_thumb.png b/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eeof trend_thumb.png deleted file mode 100644 index b06c4e6a..00000000 Binary files a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eeof trend_thumb.png and /dev/null differ diff --git a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eof-smode_thumb.png b/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eof-smode_thumb.png deleted file mode 100644 index 0677f04a..00000000 Binary files a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eof-smode_thumb.png and /dev/null differ diff --git a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_mreof_thumb.png b/docs/auto_examples/1single/images/thumb/sphx_glr_plot_mreof_thumb.png deleted file mode 100644 index 8a1c9666..00000000 Binary files a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_mreof_thumb.png and /dev/null differ diff --git a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_rotated_eof_thumb.png b/docs/auto_examples/1single/images/thumb/sphx_glr_plot_rotated_eof_thumb.png deleted file mode 100644 index 0416fc09..00000000 Binary files a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_rotated_eof_thumb.png and /dev/null differ diff --git a/docs/auto_examples/1single/plot_complex_eof_codeobj.pickle b/docs/auto_examples/1single/plot_complex_eof_codeobj.pickle deleted file mode 100644 index e927b2a4..00000000 Binary files a/docs/auto_examples/1single/plot_complex_eof_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/1single/plot_eeof_codeobj.pickle b/docs/auto_examples/1single/plot_eeof_codeobj.pickle deleted file mode 100644 index e272407f..00000000 Binary files a/docs/auto_examples/1single/plot_eeof_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/1single/plot_eeof_trend_codeobj.pickle b/docs/auto_examples/1single/plot_eeof_trend_codeobj.pickle deleted file mode 100644 index f2098a18..00000000 Binary files a/docs/auto_examples/1single/plot_eeof_trend_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/1single/plot_eof-smode_codeobj.pickle b/docs/auto_examples/1single/plot_eof-smode_codeobj.pickle deleted file mode 100644 index f93d16e6..00000000 Binary files a/docs/auto_examples/1single/plot_eof-smode_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/1single/plot_eof-tmode_codeobj.pickle b/docs/auto_examples/1single/plot_eof-tmode_codeobj.pickle deleted file mode 100644 index 34517ab3..00000000 Binary files a/docs/auto_examples/1single/plot_eof-tmode_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/1single/plot_gwpca_codeobj.pickle b/docs/auto_examples/1single/plot_gwpca_codeobj.pickle deleted file mode 100644 index bd8fd2fe..00000000 Binary files a/docs/auto_examples/1single/plot_gwpca_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/1single/plot_hilbert_eof_codeobj.pickle b/docs/auto_examples/1single/plot_hilbert_eof_codeobj.pickle deleted file mode 100644 index cc488e64..00000000 Binary files a/docs/auto_examples/1single/plot_hilbert_eof_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/1single/plot_mreof_codeobj.pickle b/docs/auto_examples/1single/plot_mreof_codeobj.pickle deleted file mode 100644 index 778fef67..00000000 Binary files a/docs/auto_examples/1single/plot_mreof_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/1single/plot_multivariate-eof_codeobj.pickle b/docs/auto_examples/1single/plot_multivariate-eof_codeobj.pickle deleted file mode 100644 index e3afdbd9..00000000 Binary files a/docs/auto_examples/1single/plot_multivariate-eof_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/1single/plot_rotated_eof_codeobj.pickle b/docs/auto_examples/1single/plot_rotated_eof_codeobj.pickle deleted file mode 100644 index 4df019f7..00000000 Binary files a/docs/auto_examples/1single/plot_rotated_eof_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/1single/plot_weighted-eof_codeobj.pickle b/docs/auto_examples/1single/plot_weighted-eof_codeobj.pickle deleted file mode 100644 index 63a2501d..00000000 Binary files a/docs/auto_examples/1single/plot_weighted-eof_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/1single/sg_execution_times.rst b/docs/auto_examples/1single/sg_execution_times.rst deleted file mode 100644 index 996f063c..00000000 --- a/docs/auto_examples/1single/sg_execution_times.rst +++ /dev/null @@ -1,33 +0,0 @@ - -:orphan: - -.. _sphx_glr_auto_examples_1single_sg_execution_times: - - -Computation times -================= -**00:07.526** total execution time for **auto_examples_1single** files: - -+-----------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_1single_plot_eeof_trend.py` (``plot_eeof_trend.py``) | 00:07.526 | 0.0 MB | -+-----------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_1single_plot_complex_eof.py` (``plot_complex_eof.py``) | 00:00.000 | 0.0 MB | -+-----------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_1single_plot_eeof.py` (``plot_eeof.py``) | 00:00.000 | 0.0 MB | -+-----------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_1single_plot_eof-smode.py` (``plot_eof-smode.py``) | 00:00.000 | 0.0 MB | -+-----------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_1single_plot_eof-tmode.py` (``plot_eof-tmode.py``) | 00:00.000 | 0.0 MB | -+-----------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_1single_plot_gwpca.py` (``plot_gwpca.py``) | 00:00.000 | 0.0 MB | -+-----------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_1single_plot_hilbert_eof.py` (``plot_hilbert_eof.py``) | 00:00.000 | 0.0 MB | -+-----------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_1single_plot_mreof.py` (``plot_mreof.py``) | 00:00.000 | 0.0 MB | -+-----------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_1single_plot_multivariate-eof.py` (``plot_multivariate-eof.py``) | 00:00.000 | 0.0 MB | -+-----------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_1single_plot_rotated_eof.py` (``plot_rotated_eof.py``) | 00:00.000 | 0.0 MB | -+-----------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_1single_plot_weighted-eof.py` (``plot_weighted-eof.py``) | 00:00.000 | 0.0 MB | -+-----------------------------------------------------------------------------------------------+-----------+--------+ diff --git a/docs/auto_examples/2cross/plot_mca.rst b/docs/auto_examples/2cross/plot_mca.rst deleted file mode 100644 index 8f072e19..00000000 --- a/docs/auto_examples/2cross/plot_mca.rst +++ /dev/null @@ -1,740 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/2cross/plot_mca.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_2cross_plot_mca.py: - - -Maximum Covariance Analysis -=========================== - -Maximum Covariance Analysis (MCA) between two data sets. - -.. GENERATED FROM PYTHON SOURCE LINES 7-18 - -.. code-block:: default - - - # Load packages and data: - import matplotlib.pyplot as plt - import numpy as np - import xarray as xr - from cartopy.crs import Orthographic, PlateCarree - from cartopy.feature import LAND - from matplotlib.gridspec import GridSpec - - import xeofs as xe - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 19-20 - -Create 2 different DataArrays - -.. GENERATED FROM PYTHON SOURCE LINES 20-25 - -.. code-block:: default - - - t2m = xr.tutorial.load_dataset("air_temperature")["air"] - da1 = t2m.isel(lon=slice(0, 26)) - da2 = t2m.isel(lon=slice(27, None)) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 26-27 - -Perform MCA - -.. GENERATED FROM PYTHON SOURCE LINES 27-31 - -.. code-block:: default - - - mca = xe.cross.MCA(n_modes=20, standardize=False, use_coslat=True) - mca.fit(da1, da2, dim="time") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 32-34 - -Get singular vectors, projections (PCs), homogeneous and heterogeneous -patterns: - -.. GENERATED FROM PYTHON SOURCE LINES 34-40 - -.. code-block:: default - - - singular_vectors = mca.components() - scores = mca.scores() - hom_pats, pvals_hom = mca.homogeneous_patterns() - het_pats, pvals_het = mca.heterogeneous_patterns() - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 41-45 - -When two fields are expected, the output of the above methods is a list of -length 2, with the first and second entry containing the relevant object for -``X`` and ``Y``. For example, the p-values obtained from the two-sided t-test -for the homogeneous patterns of ``X`` are: - -.. GENERATED FROM PYTHON SOURCE LINES 45-48 - -.. code-block:: default - - - pvals_hom[0] - - - - - - -.. raw:: html - -
-
- - - - - - - - - - - - - - -
<xarray.DataArray 'pvalues_of_left_homogeneous_patterns' (mode: 20, lat: 25,
-                                                              lon: 26)>
-    array([[[0.00000000e+000, 3.32602740e-290, 2.86712051e-286, ...,
-             1.32392878e-119, 9.37036267e-186, 0.00000000e+000],
-            [0.00000000e+000, 0.00000000e+000, 2.87964095e-272, ...,
-             8.56508898e-140, 4.38532320e-131, 6.54040862e-156],
-            [0.00000000e+000, 0.00000000e+000, 0.00000000e+000, ...,
-             6.15522890e-039, 9.85389342e-095, 4.88663208e-307],
-            ...,
-            [0.00000000e+000, 0.00000000e+000, 0.00000000e+000, ...,
-             0.00000000e+000, 0.00000000e+000, 0.00000000e+000],
-            [0.00000000e+000, 0.00000000e+000, 0.00000000e+000, ...,
-             0.00000000e+000, 0.00000000e+000, 0.00000000e+000],
-            [0.00000000e+000, 0.00000000e+000, 0.00000000e+000, ...,
-             0.00000000e+000, 0.00000000e+000, 0.00000000e+000]],
-
-           [[1.47816130e-058, 9.59629629e-069, 2.49426225e-077, ...,
-             4.04710709e-067, 1.68530273e-001, 1.57942472e-054],
-            [5.21001151e-051, 1.96182008e-055, 4.53391465e-063, ...,
-             8.23812362e-066, 5.60289947e-142, 3.17052995e-126],
-            [4.26755773e-027, 2.16865183e-023, 5.55666292e-044, ...,
-             2.57077253e-302, 7.17664416e-212, 1.99383130e-056],
-    ...
-            [3.76773409e-015, 3.63595418e-016, 8.16407667e-016, ...,
-             7.94237942e-001, 5.61772548e-001, 4.05805498e-001],
-            [1.34077306e-010, 2.27353460e-010, 1.17695930e-009, ...,
-             2.36922957e-001, 1.51587935e-001, 1.10342500e-001],
-            [1.25888311e-009, 3.73287601e-009, 1.96403692e-008, ...,
-             1.74507572e-001, 1.55251763e-001, 1.57874323e-001]],
-
-           [[3.23043237e-001, 1.34846412e-002, 1.49786437e-002, ...,
-             8.59230128e-001, 9.39956204e-005, 7.73160479e-010],
-            [3.30997229e-001, 1.89803851e-001, 1.63645931e-001, ...,
-             1.15188423e-003, 1.70856527e-004, 3.80119477e-006],
-            [4.80410883e-001, 3.58267371e-001, 1.05572199e-001, ...,
-             1.33882929e-007, 8.22926072e-005, 3.56634908e-004],
-            ...,
-            [9.48231125e-019, 3.95379639e-018, 4.27550070e-017, ...,
-             6.62164515e-001, 6.17150180e-001, 5.85772391e-001],
-            [1.19130038e-006, 4.18324319e-006, 1.51748129e-005, ...,
-             8.09046665e-001, 9.15065924e-001, 9.75206621e-001],
-            [4.03876714e-002, 7.52746031e-002, 1.39540472e-001, ...,
-             8.48692484e-002, 1.65380473e-001, 2.84566826e-001]]])
-    Coordinates:
-      * lat      (lat) float32 15.0 17.5 20.0 22.5 25.0 ... 65.0 67.5 70.0 72.5 75.0
-      * lon      (lon) float32 200.0 202.5 205.0 207.5 ... 255.0 257.5 260.0 262.5
-      * mode     (mode) int64 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-    Attributes: (12/18)
-        model:                    Maximum Covariance Analysis
-        software:                 xeofs
-        version:                  1.2.0
-        date:                     2024-09-02 02:52:38
-        n_modes:                  20
-        center:                   ['True', 'True']
-        ...                       ...
-        alpha:                    [1.0, 1.0]
-        sample_name:              sample
-        feature_name:             ['feature1', 'feature2']
-        random_state:             None
-        compute:                  True
-        solver:                   auto
-
-
-
- -.. GENERATED FROM PYTHON SOURCE LINES 49-50 - -Create a mask to identifiy where p-values are below 0.05 - -.. GENERATED FROM PYTHON SOURCE LINES 50-55 - -.. code-block:: default - - - hom_mask = [values < 0.05 for values in pvals_hom] - het_mask = [values < 0.05 for values in pvals_het] - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 56-57 - -Plot some relevant quantities of mode 2. - -.. GENERATED FROM PYTHON SOURCE LINES 57-113 - -.. code-block:: default - - - lonlats = [ - np.meshgrid(pvals_hom[0].lon.values, pvals_hom[0].lat.values), - np.meshgrid(pvals_hom[1].lon.values, pvals_hom[1].lat.values), - ] - proj = [ - Orthographic(central_latitude=30, central_longitude=-120), - Orthographic(central_latitude=30, central_longitude=-60), - ] - kwargs1 = {"cmap": "BrBG", "vmin": -0.05, "vmax": 0.05, "transform": PlateCarree()} - kwargs2 = {"cmap": "RdBu", "vmin": -1, "vmax": 1, "transform": PlateCarree()} - - mode = 2 - - fig = plt.figure(figsize=(7, 14)) - gs = GridSpec(5, 2) - ax1 = [fig.add_subplot(gs[0, i], projection=proj[i]) for i in range(2)] - ax2 = [fig.add_subplot(gs[1, i], projection=proj[i]) for i in range(2)] - ax3 = [fig.add_subplot(gs[2, i], projection=proj[i]) for i in range(2)] - ax4 = [fig.add_subplot(gs[3, i]) for i in range(2)] - - for i, a in enumerate(ax1): - singular_vectors[i].sel(mode=mode).plot(ax=a, **kwargs1) - - for i, a in enumerate(ax2): - hom_pats[i].sel(mode=mode).plot(ax=a, **kwargs2) - a.scatter( - lonlats[i][0], - lonlats[i][1], - hom_mask[i].sel(mode=mode).values * 0.5, - color="k", - alpha=0.5, - transform=PlateCarree(), - ) - for i, a in enumerate(ax3): - het_pats[i].sel(mode=mode).plot(ax=a, **kwargs2) - a.scatter( - lonlats[i][0], - lonlats[i][1], - het_mask[i].sel(mode=mode).values * 0.5, - color="k", - alpha=0.5, - transform=PlateCarree(), - ) - - for i, a in enumerate(ax4): - scores[i].sel(mode=mode).plot(ax=a) - a.set_xlabel("") - - - for a in np.ravel([ax1, ax2, ax3]): - a.coastlines(color=".5") - a.add_feature(LAND) - - plt.tight_layout() - plt.savefig("mca.jpg") - - - -.. image-sg:: /auto_examples/2cross/images/sphx_glr_plot_mca_001.png - :alt: mode = 2, mode = 2, mode = 2, mode = 2, mode = 2, mode = 2, mode = 2, mode = 2 - :srcset: /auto_examples/2cross/images/sphx_glr_plot_mca_001.png - :class: sphx-glr-single-img - - - - - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 10.270 seconds) - - -.. _sphx_glr_download_auto_examples_2cross_plot_mca.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - - - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: plot_mca.py ` - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: plot_mca.ipynb ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/auto_examples/2cross/plot_mca_codeobj.pickle b/docs/auto_examples/2cross/plot_mca_codeobj.pickle deleted file mode 100644 index 8013a6f4..00000000 Binary files a/docs/auto_examples/2cross/plot_mca_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/2cross/plot_rotated_mca.rst b/docs/auto_examples/2cross/plot_rotated_mca.rst deleted file mode 100644 index a58d6b97..00000000 --- a/docs/auto_examples/2cross/plot_rotated_mca.rst +++ /dev/null @@ -1,760 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/2cross/plot_rotated_mca.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_2cross_plot_rotated_mca.py: - - -Rotated Maximum Covariance Analysis -=================================== - -Rotated Maximum Covariance Analysis (MCA) between two data sets. - -.. GENERATED FROM PYTHON SOURCE LINES 7-18 - -.. code-block:: default - - - # Load packages and data: - import matplotlib.pyplot as plt - import numpy as np - import xarray as xr - from cartopy.crs import Orthographic, PlateCarree - from cartopy.feature import LAND - from matplotlib.gridspec import GridSpec - - import xeofs as xe - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 19-20 - -Create 2 different DataArrays - -.. GENERATED FROM PYTHON SOURCE LINES 20-25 - -.. code-block:: default - - - t2m = xr.tutorial.load_dataset("air_temperature")["air"] - da1 = t2m.isel(lon=slice(0, 26)) - da2 = t2m.isel(lon=slice(27, None)) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 26-27 - -Perform MCA - -.. GENERATED FROM PYTHON SOURCE LINES 27-31 - -.. code-block:: default - - - mca = xe.cross.MCA(n_modes=20, standardize=False, use_coslat=True) - mca.fit(da1, da2, dim="time") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 32-33 - -Apply Varimax-rotation to MCA solution - -.. GENERATED FROM PYTHON SOURCE LINES 33-37 - -.. code-block:: default - - - rot = xe.cross.MCARotator(n_modes=10) - rot.fit(mca) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 38-40 - -Get rotated singular vectors, projections (PCs), homogeneous and heterogeneous -patterns: - -.. GENERATED FROM PYTHON SOURCE LINES 40-46 - -.. code-block:: default - - - singular_vectors = rot.components() - scores = rot.scores() - hom_pats, pvals_hom = rot.homogeneous_patterns() - het_pats, pvals_het = rot.heterogeneous_patterns() - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 47-51 - -When two fields are expected, the output of the above methods is a list of -length 2, with the first and second entry containing the relevant object for -``X`` and ``Y``. For example, the p-values obtained from the two-sided t-test -for the homogeneous patterns of ``X`` are: - -.. GENERATED FROM PYTHON SOURCE LINES 51-54 - -.. code-block:: default - - - pvals_hom[0] - - - - - - -.. raw:: html - -
-
- - - - - - - - - - - - - - -
<xarray.DataArray 'pvalues_of_left_homogeneous_patterns' (mode: 10, lat: 25,
-                                                              lon: 26)>
-    array([[[1.55655258e-089, 1.55392044e-068, 7.80119302e-062, ...,
-             2.23581515e-050, 8.33308320e-120, 6.00836750e-251],
-            [2.11872977e-114, 9.49780753e-082, 3.11167453e-056, ...,
-             6.65183702e-085, 1.64000665e-088, 1.04300755e-106],
-            [7.79953584e-175, 1.21595072e-154, 4.65953803e-091, ...,
-             1.38541944e-037, 4.80775593e-072, 1.33473247e-185],
-            ...,
-            [0.00000000e+000, 0.00000000e+000, 0.00000000e+000, ...,
-             0.00000000e+000, 0.00000000e+000, 0.00000000e+000],
-            [0.00000000e+000, 0.00000000e+000, 0.00000000e+000, ...,
-             0.00000000e+000, 0.00000000e+000, 0.00000000e+000],
-            [0.00000000e+000, 0.00000000e+000, 0.00000000e+000, ...,
-             0.00000000e+000, 0.00000000e+000, 0.00000000e+000]],
-
-           [[0.00000000e+000, 0.00000000e+000, 0.00000000e+000, ...,
-             4.94162415e-127, 8.44446124e-042, 1.03146716e-010],
-            [0.00000000e+000, 0.00000000e+000, 0.00000000e+000, ...,
-             1.73955755e-006, 4.63745686e-001, 7.64186484e-001],
-            [2.33739357e-315, 5.08908579e-295, 0.00000000e+000, ...,
-             3.29248281e-031, 3.24235210e-009, 2.47163748e-013],
-    ...
-            [1.08624311e-031, 4.60559037e-034, 3.62929634e-035, ...,
-             7.70733680e-008, 1.69130069e-007, 8.67958275e-007],
-            [1.51071779e-017, 3.36574156e-018, 3.12910697e-018, ...,
-             1.32355292e-002, 2.10073640e-002, 3.66735430e-002],
-            [1.51780815e-012, 1.69354791e-013, 4.50343023e-014, ...,
-             7.46501624e-001, 7.70929744e-001, 8.17168088e-001]],
-
-           [[1.24025980e-001, 3.39107580e-002, 1.79221922e-003, ...,
-             6.87092234e-001, 7.72235373e-001, 5.05983136e-001],
-            [2.50157622e-002, 1.60428304e-002, 9.88481378e-004, ...,
-             8.65538505e-001, 2.93513835e-001, 5.20600556e-002],
-            [9.83552316e-003, 8.72086401e-002, 1.50031876e-001, ...,
-             2.52774242e-001, 9.58005017e-003, 8.41498523e-005],
-            ...,
-            [3.04190682e-009, 5.42503823e-010, 1.40613929e-010, ...,
-             2.01063167e-004, 2.26427972e-003, 2.14215655e-002],
-            [2.50500607e-002, 2.25942528e-002, 2.38626492e-002, ...,
-             3.52630729e-004, 2.33815544e-003, 1.47774024e-002],
-            [9.70026611e-001, 9.87391731e-001, 9.61937720e-001, ...,
-             5.70511628e-003, 1.52611723e-002, 3.62942940e-002]]])
-    Coordinates:
-      * lat      (lat) float32 15.0 17.5 20.0 22.5 25.0 ... 65.0 67.5 70.0 72.5 75.0
-      * lon      (lon) float32 200.0 202.5 205.0 207.5 ... 255.0 257.5 260.0 262.5
-      * mode     (mode) int64 1 2 3 4 5 6 7 8 9 10
-    Attributes:
-        model:     Rotated MCA
-        software:  xeofs
-        version:   1.2.0
-        date:      2024-09-02 02:52:51
-        n_modes:   10
-        power:     1
-        max_iter:  1000
-        rtol:      1e-08
-        compute:   True
-
-
-
- -.. GENERATED FROM PYTHON SOURCE LINES 55-56 - -Create a mask to identifiy where p-values are below 0.05 - -.. GENERATED FROM PYTHON SOURCE LINES 56-61 - -.. code-block:: default - - - hom_mask = [values < 0.05 for values in pvals_hom] - het_mask = [values < 0.05 for values in pvals_het] - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 62-63 - -Plot some relevant quantities of mode 2. - -.. GENERATED FROM PYTHON SOURCE LINES 63-119 - -.. code-block:: default - - - lonlats = [ - np.meshgrid(pvals_hom[0].lon.values, pvals_hom[0].lat.values), - np.meshgrid(pvals_hom[1].lon.values, pvals_hom[1].lat.values), - ] - proj = [ - Orthographic(central_latitude=30, central_longitude=-120), - Orthographic(central_latitude=30, central_longitude=-60), - ] - kwargs1 = {"cmap": "BrBG", "vmin": -0.05, "vmax": 0.05, "transform": PlateCarree()} - kwargs2 = {"cmap": "RdBu", "vmin": -1, "vmax": 1, "transform": PlateCarree()} - - mode = 2 - - fig = plt.figure(figsize=(7, 14)) - gs = GridSpec(5, 2) - ax1 = [fig.add_subplot(gs[0, i], projection=proj[i]) for i in range(2)] - ax2 = [fig.add_subplot(gs[1, i], projection=proj[i]) for i in range(2)] - ax3 = [fig.add_subplot(gs[2, i], projection=proj[i]) for i in range(2)] - ax4 = [fig.add_subplot(gs[3, i]) for i in range(2)] - - for i, a in enumerate(ax1): - singular_vectors[i].sel(mode=mode).plot(ax=a, **kwargs1) - - for i, a in enumerate(ax2): - hom_pats[i].sel(mode=mode).plot(ax=a, **kwargs2) - a.scatter( - lonlats[i][0], - lonlats[i][1], - hom_mask[i].sel(mode=mode).values * 0.5, - color="k", - alpha=0.5, - transform=PlateCarree(), - ) - for i, a in enumerate(ax3): - het_pats[i].sel(mode=mode).plot(ax=a, **kwargs2) - a.scatter( - lonlats[i][0], - lonlats[i][1], - het_mask[i].sel(mode=mode).values * 0.5, - color="k", - alpha=0.5, - transform=PlateCarree(), - ) - - for i, a in enumerate(ax4): - scores[i].sel(mode=mode).plot(ax=a) - a.set_xlabel("") - - - for a in np.ravel([ax1, ax2, ax3]): - a.coastlines(color=".5") - a.add_feature(LAND) - - plt.tight_layout() - plt.savefig("rotated_mca.jpg") - - - -.. image-sg:: /auto_examples/2cross/images/sphx_glr_plot_rotated_mca_001.png - :alt: mode = 2, mode = 2, mode = 2, mode = 2, mode = 2, mode = 2, mode = 2, mode = 2 - :srcset: /auto_examples/2cross/images/sphx_glr_plot_rotated_mca_001.png - :class: sphx-glr-single-img - - - - - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 6.533 seconds) - - -.. _sphx_glr_download_auto_examples_2cross_plot_rotated_mca.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - - - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: plot_rotated_mca.py ` - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: plot_rotated_mca.ipynb ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/auto_examples/2cross/plot_rotated_mca_codeobj.pickle b/docs/auto_examples/2cross/plot_rotated_mca_codeobj.pickle deleted file mode 100644 index 0442f632..00000000 Binary files a/docs/auto_examples/2cross/plot_rotated_mca_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/2cross/sg_execution_times.rst b/docs/auto_examples/2cross/sg_execution_times.rst deleted file mode 100644 index f92421a8..00000000 --- a/docs/auto_examples/2cross/sg_execution_times.rst +++ /dev/null @@ -1,15 +0,0 @@ - -:orphan: - -.. _sphx_glr_auto_examples_2cross_sg_execution_times: - - -Computation times -================= -**00:16.803** total execution time for **auto_examples_2cross** files: - -+------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_2cross_plot_mca.py` (``plot_mca.py``) | 00:10.270 | 0.0 MB | -+------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_2cross_plot_rotated_mca.py` (``plot_rotated_mca.py``) | 00:06.533 | 0.0 MB | -+------------------------------------------------------------------------------------+-----------+--------+ diff --git a/docs/auto_examples/2multi/images/sphx_glr_plot_mca_001.png b/docs/auto_examples/2multi/images/sphx_glr_plot_mca_001.png deleted file mode 100644 index 3883e3f3..00000000 Binary files a/docs/auto_examples/2multi/images/sphx_glr_plot_mca_001.png and /dev/null differ diff --git a/docs/auto_examples/2multi/images/sphx_glr_plot_rotated_mca_001.png b/docs/auto_examples/2multi/images/sphx_glr_plot_rotated_mca_001.png deleted file mode 100644 index ef2ea0ac..00000000 Binary files a/docs/auto_examples/2multi/images/sphx_glr_plot_rotated_mca_001.png and /dev/null differ diff --git a/docs/auto_examples/2multi/images/thumb/sphx_glr_plot_mca_thumb.png b/docs/auto_examples/2multi/images/thumb/sphx_glr_plot_mca_thumb.png deleted file mode 100644 index 7949e785..00000000 Binary files a/docs/auto_examples/2multi/images/thumb/sphx_glr_plot_mca_thumb.png and /dev/null differ diff --git a/docs/auto_examples/2multi/images/thumb/sphx_glr_plot_rotated_mca_thumb.png b/docs/auto_examples/2multi/images/thumb/sphx_glr_plot_rotated_mca_thumb.png deleted file mode 100644 index a3ed60a4..00000000 Binary files a/docs/auto_examples/2multi/images/thumb/sphx_glr_plot_rotated_mca_thumb.png and /dev/null differ diff --git a/docs/auto_examples/2multi/index.rst b/docs/auto_examples/2multi/index.rst deleted file mode 100644 index bd745d1e..00000000 --- a/docs/auto_examples/2multi/index.rst +++ /dev/null @@ -1,77 +0,0 @@ - - -.. _sphx_glr_auto_examples_2multi: - -2 | Multi-Set Analysis -======================== - - - -.. raw:: html - -
- - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/2multi/images/thumb/sphx_glr_plot_cca_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_2multi_plot_cca.py` - -.. raw:: html - -
Canonical Correlation Analysis
-
- - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/2multi/images/thumb/sphx_glr_plot_mca_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_2multi_plot_mca.py` - -.. raw:: html - -
Maximum Covariance Analysis
-
- - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/2multi/images/thumb/sphx_glr_plot_rotated_mca_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_2multi_plot_rotated_mca.py` - -.. raw:: html - -
Rotated Maximum Covariance Analysis
-
- - -.. raw:: html - -
- - -.. toctree:: - :hidden: - - /auto_examples/2multi/plot_cca - /auto_examples/2multi/plot_mca - /auto_examples/2multi/plot_rotated_mca - diff --git a/docs/auto_examples/2multi/plot_cca_codeobj.pickle b/docs/auto_examples/2multi/plot_cca_codeobj.pickle deleted file mode 100644 index 05060618..00000000 Binary files a/docs/auto_examples/2multi/plot_cca_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/2multi/plot_mca.ipynb b/docs/auto_examples/2multi/plot_mca.ipynb deleted file mode 100644 index 16d73cb7..00000000 --- a/docs/auto_examples/2multi/plot_mca.ipynb +++ /dev/null @@ -1,219 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "# Maximum Covariance Analysis\n", - "\n", - "Maximum Covariance Analysis (MCA) between two data sets.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Load packages and data:\n", - "import matplotlib.pyplot as plt\n", - "import numpy as np\n", - "import xarray as xr\n", - "from cartopy.crs import Orthographic, PlateCarree\n", - "from cartopy.feature import LAND\n", - "from matplotlib.gridspec import GridSpec\n", - "\n", - "import xeofs as xe" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Create 2 different DataArrays\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "t2m = xr.tutorial.load_dataset(\"air_temperature\")[\"air\"]\n", - "da1 = t2m.isel(lon=slice(0, 26))\n", - "da2 = t2m.isel(lon=slice(27, None))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Perform MCA\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "mca = xe.cross.MCA(n_modes=20, standardize=False, use_coslat=True)\n", - "mca.fit(da1, da2, dim=\"time\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Get singular vectors, projections (PCs), homogeneous and heterogeneous\n", - "patterns:\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "singular_vectors = mca.components()\n", - "scores = mca.scores()\n", - "hom_pats, pvals_hom = mca.homogeneous_patterns()\n", - "het_pats, pvals_het = mca.heterogeneous_patterns()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "When two fields are expected, the output of the above methods is a list of\n", - "length 2, with the first and second entry containing the relevant object for\n", - "``X`` and ``Y``. For example, the p-values obtained from the two-sided t-test\n", - "for the homogeneous patterns of ``X`` are:\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "pvals_hom[0]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Create a mask to identifiy where p-values are below 0.05\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "hom_mask = [values < 0.05 for values in pvals_hom]\n", - "het_mask = [values < 0.05 for values in pvals_het]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Plot some relevant quantities of mode 2.\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "lonlats = [\n", - " np.meshgrid(pvals_hom[0].lon.values, pvals_hom[0].lat.values),\n", - " np.meshgrid(pvals_hom[1].lon.values, pvals_hom[1].lat.values),\n", - "]\n", - "proj = [\n", - " Orthographic(central_latitude=30, central_longitude=-120),\n", - " Orthographic(central_latitude=30, central_longitude=-60),\n", - "]\n", - "kwargs1 = {\"cmap\": \"BrBG\", \"vmin\": -0.05, \"vmax\": 0.05, \"transform\": PlateCarree()}\n", - "kwargs2 = {\"cmap\": \"RdBu\", \"vmin\": -1, \"vmax\": 1, \"transform\": PlateCarree()}\n", - "\n", - "mode = 2\n", - "\n", - "fig = plt.figure(figsize=(7, 14))\n", - "gs = GridSpec(5, 2)\n", - "ax1 = [fig.add_subplot(gs[0, i], projection=proj[i]) for i in range(2)]\n", - "ax2 = [fig.add_subplot(gs[1, i], projection=proj[i]) for i in range(2)]\n", - "ax3 = [fig.add_subplot(gs[2, i], projection=proj[i]) for i in range(2)]\n", - "ax4 = [fig.add_subplot(gs[3, i]) for i in range(2)]\n", - "\n", - "for i, a in enumerate(ax1):\n", - " singular_vectors[i].sel(mode=mode).plot(ax=a, **kwargs1)\n", - "\n", - "for i, a in enumerate(ax2):\n", - " hom_pats[i].sel(mode=mode).plot(ax=a, **kwargs2)\n", - " a.scatter(\n", - " lonlats[i][0],\n", - " lonlats[i][1],\n", - " hom_mask[i].sel(mode=mode).values * 0.5,\n", - " color=\"k\",\n", - " alpha=0.5,\n", - " transform=PlateCarree(),\n", - " )\n", - "for i, a in enumerate(ax3):\n", - " het_pats[i].sel(mode=mode).plot(ax=a, **kwargs2)\n", - " a.scatter(\n", - " lonlats[i][0],\n", - " lonlats[i][1],\n", - " het_mask[i].sel(mode=mode).values * 0.5,\n", - " color=\"k\",\n", - " alpha=0.5,\n", - " transform=PlateCarree(),\n", - " )\n", - "\n", - "for i, a in enumerate(ax4):\n", - " scores[i].sel(mode=mode).plot(ax=a)\n", - " a.set_xlabel(\"\")\n", - "\n", - "\n", - "for a in np.ravel([ax1, ax2, ax3]):\n", - " a.coastlines(color=\".5\")\n", - " a.add_feature(LAND)\n", - "\n", - "plt.tight_layout()\n", - "plt.savefig(\"mca.jpg\")" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.4" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/docs/auto_examples/2multi/plot_mca.py.md5 b/docs/auto_examples/2multi/plot_mca.py.md5 deleted file mode 100644 index d980cde7..00000000 --- a/docs/auto_examples/2multi/plot_mca.py.md5 +++ /dev/null @@ -1 +0,0 @@ -e696fb777ef84ec447201ca9c01d1dfe \ No newline at end of file diff --git a/docs/auto_examples/2multi/plot_mca_codeobj.pickle b/docs/auto_examples/2multi/plot_mca_codeobj.pickle deleted file mode 100644 index ec889c42..00000000 Binary files a/docs/auto_examples/2multi/plot_mca_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/2multi/plot_rotated_mca.ipynb b/docs/auto_examples/2multi/plot_rotated_mca.ipynb deleted file mode 100644 index e69caebc..00000000 --- a/docs/auto_examples/2multi/plot_rotated_mca.ipynb +++ /dev/null @@ -1,237 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "# Rotated Maximum Covariance Analysis\n", - "\n", - "Rotated Maximum Covariance Analysis (MCA) between two data sets.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Load packages and data:\n", - "import matplotlib.pyplot as plt\n", - "import numpy as np\n", - "import xarray as xr\n", - "from cartopy.crs import Orthographic, PlateCarree\n", - "from cartopy.feature import LAND\n", - "from matplotlib.gridspec import GridSpec\n", - "\n", - "import xeofs as xe" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Create 2 different DataArrays\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "t2m = xr.tutorial.load_dataset(\"air_temperature\")[\"air\"]\n", - "da1 = t2m.isel(lon=slice(0, 26))\n", - "da2 = t2m.isel(lon=slice(27, None))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Perform MCA\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "mca = xe.cross.MCA(n_modes=20, standardize=False, use_coslat=True)\n", - "mca.fit(da1, da2, dim=\"time\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Apply Varimax-rotation to MCA solution\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "rot = xe.cross.MCARotator(n_modes=10)\n", - "rot.fit(mca)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Get rotated singular vectors, projections (PCs), homogeneous and heterogeneous\n", - "patterns:\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "singular_vectors = rot.components()\n", - "scores = rot.scores()\n", - "hom_pats, pvals_hom = rot.homogeneous_patterns()\n", - "het_pats, pvals_het = rot.heterogeneous_patterns()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "When two fields are expected, the output of the above methods is a list of\n", - "length 2, with the first and second entry containing the relevant object for\n", - "``X`` and ``Y``. For example, the p-values obtained from the two-sided t-test\n", - "for the homogeneous patterns of ``X`` are:\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "pvals_hom[0]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Create a mask to identifiy where p-values are below 0.05\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "hom_mask = [values < 0.05 for values in pvals_hom]\n", - "het_mask = [values < 0.05 for values in pvals_het]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Plot some relevant quantities of mode 2.\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "lonlats = [\n", - " np.meshgrid(pvals_hom[0].lon.values, pvals_hom[0].lat.values),\n", - " np.meshgrid(pvals_hom[1].lon.values, pvals_hom[1].lat.values),\n", - "]\n", - "proj = [\n", - " Orthographic(central_latitude=30, central_longitude=-120),\n", - " Orthographic(central_latitude=30, central_longitude=-60),\n", - "]\n", - "kwargs1 = {\"cmap\": \"BrBG\", \"vmin\": -0.05, \"vmax\": 0.05, \"transform\": PlateCarree()}\n", - "kwargs2 = {\"cmap\": \"RdBu\", \"vmin\": -1, \"vmax\": 1, \"transform\": PlateCarree()}\n", - "\n", - "mode = 2\n", - "\n", - "fig = plt.figure(figsize=(7, 14))\n", - "gs = GridSpec(5, 2)\n", - "ax1 = [fig.add_subplot(gs[0, i], projection=proj[i]) for i in range(2)]\n", - "ax2 = [fig.add_subplot(gs[1, i], projection=proj[i]) for i in range(2)]\n", - "ax3 = [fig.add_subplot(gs[2, i], projection=proj[i]) for i in range(2)]\n", - "ax4 = [fig.add_subplot(gs[3, i]) for i in range(2)]\n", - "\n", - "for i, a in enumerate(ax1):\n", - " singular_vectors[i].sel(mode=mode).plot(ax=a, **kwargs1)\n", - "\n", - "for i, a in enumerate(ax2):\n", - " hom_pats[i].sel(mode=mode).plot(ax=a, **kwargs2)\n", - " a.scatter(\n", - " lonlats[i][0],\n", - " lonlats[i][1],\n", - " hom_mask[i].sel(mode=mode).values * 0.5,\n", - " color=\"k\",\n", - " alpha=0.5,\n", - " transform=PlateCarree(),\n", - " )\n", - "for i, a in enumerate(ax3):\n", - " het_pats[i].sel(mode=mode).plot(ax=a, **kwargs2)\n", - " a.scatter(\n", - " lonlats[i][0],\n", - " lonlats[i][1],\n", - " het_mask[i].sel(mode=mode).values * 0.5,\n", - " color=\"k\",\n", - " alpha=0.5,\n", - " transform=PlateCarree(),\n", - " )\n", - "\n", - "for i, a in enumerate(ax4):\n", - " scores[i].sel(mode=mode).plot(ax=a)\n", - " a.set_xlabel(\"\")\n", - "\n", - "\n", - "for a in np.ravel([ax1, ax2, ax3]):\n", - " a.coastlines(color=\".5\")\n", - " a.add_feature(LAND)\n", - "\n", - "plt.tight_layout()\n", - "plt.savefig(\"rotated_mca.jpg\")" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.4" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/docs/auto_examples/2multi/plot_rotated_mca.py.md5 b/docs/auto_examples/2multi/plot_rotated_mca.py.md5 deleted file mode 100644 index deea9105..00000000 --- a/docs/auto_examples/2multi/plot_rotated_mca.py.md5 +++ /dev/null @@ -1 +0,0 @@ -00a21b73b61a542faad2eabd27cfcdf8 \ No newline at end of file diff --git a/docs/auto_examples/2multi/plot_rotated_mca_codeobj.pickle b/docs/auto_examples/2multi/plot_rotated_mca_codeobj.pickle deleted file mode 100644 index 1d2dc827..00000000 Binary files a/docs/auto_examples/2multi/plot_rotated_mca_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/2multi/sg_execution_times.rst b/docs/auto_examples/2multi/sg_execution_times.rst deleted file mode 100644 index 99753050..00000000 --- a/docs/auto_examples/2multi/sg_execution_times.rst +++ /dev/null @@ -1,17 +0,0 @@ - -:orphan: - -.. _sphx_glr_auto_examples_2multi_sg_execution_times: - - -Computation times -================= -**00:02.798** total execution time for **auto_examples_2multi** files: - -+------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_2multi_plot_cca.py` (``plot_cca.py``) | 00:02.798 | 0.0 MB | -+------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_2multi_plot_mca.py` (``plot_mca.py``) | 00:00.000 | 0.0 MB | -+------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_2multi_plot_rotated_mca.py` (``plot_rotated_mca.py``) | 00:00.000 | 0.0 MB | -+------------------------------------------------------------------------------------+-----------+--------+ diff --git a/docs/auto_examples/3multi/images/sphx_glr_plot_cca_001.png b/docs/auto_examples/3multi/images/sphx_glr_plot_cca_001.png deleted file mode 100644 index 10c26abb..00000000 Binary files a/docs/auto_examples/3multi/images/sphx_glr_plot_cca_001.png and /dev/null differ diff --git a/docs/auto_examples/3multi/images/sphx_glr_plot_cca_002.png b/docs/auto_examples/3multi/images/sphx_glr_plot_cca_002.png deleted file mode 100644 index 89687459..00000000 Binary files a/docs/auto_examples/3multi/images/sphx_glr_plot_cca_002.png and /dev/null differ diff --git a/docs/auto_examples/3multi/images/thumb/sphx_glr_plot_cca_thumb.png b/docs/auto_examples/3multi/images/thumb/sphx_glr_plot_cca_thumb.png deleted file mode 100644 index 2e99a4d0..00000000 Binary files a/docs/auto_examples/3multi/images/thumb/sphx_glr_plot_cca_thumb.png and /dev/null differ diff --git a/docs/auto_examples/3multi/plot_cca.ipynb b/docs/auto_examples/3multi/plot_cca.ipynb deleted file mode 100644 index f8e3b7f4..00000000 --- a/docs/auto_examples/3multi/plot_cca.ipynb +++ /dev/null @@ -1,197 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "# Canonical Correlation Analysis\n", - "\n", - "In this example, we're going to perform a Canonical Correlation Analysis (CCA)\n", - "on three datasets using the ERSSTv5 monthly sea surface temperature (SST) data\n", - "from 1970 to 2022. We divide this data into three areas: the Indian Ocean,\n", - "the Pacific Ocean, and the Atlantic Ocean. Our goal is to perform CCA on these\n", - "regions.\n", - "\n", - "First, we'll import the necessary modules.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import cartopy.crs as ccrs\n", - "import matplotlib.pyplot as plt\n", - "import xarray as xr\n", - "from matplotlib.gridspec import GridSpec\n", - "\n", - "import xeofs as xe" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Next, we load the data and compute the SST anomalies. This removes the\n", - "monthly climatologies, so the seasonal cycle doesn't impact our CCA.\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "sst = xr.tutorial.load_dataset(\"ersstv5\").sst\n", - "sst = sst.groupby(\"time.month\") - sst.groupby(\"time.month\").mean(\"time\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now, we define the three regions of interest and store them in a list.\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "indian = sst.sel(lon=slice(35, 115), lat=slice(30, -30))\n", - "pacific = sst.sel(lon=slice(130, 290), lat=slice(30, -30))\n", - "atlantic = sst.sel(lon=slice(320, 360), lat=slice(70, 10))\n", - "\n", - "data_list = [indian, pacific, atlantic]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We now perform CCA. Since we are dealing with a high-dimensional feature space, we first\n", - "perform PCA to reduce the dimensionality (this is kind of a regularized CCA) by setting\n", - "``pca=True``. By setting the ``variance_fraction`` keyword argument, we specify that we\n", - "want to keep the number of PCA modes that explain 90% of the variance in each of the\n", - "three data sets.\n", - "\n", - "An important parameter is ``init_pca_modes``. It specifies the number\n", - "of PCA modes that are initially compute before truncating them to account for 90 %. If this\n", - "number is small enough, randomized PCAs will be performed instead of the full SVD decomposition\n", - "which is much faster. We can also specify ``init_pca_modes`` as a float (0 < x <= 1),\n", - "in which case the number of PCA modes is given by the fraction of the data matrix's rank\n", - "The default is set to 0.75 which will ensure that randomized PCAs are performed.\n", - "\n", - "Given the nature of SST data, we might lower it to something like 0.3, since\n", - "we expect that most of the variance in the data will be explained by a small\n", - "number of PC modes.\n", - "\n", - "Note that if our initial PCA modes don't hit the 90% variance target, ``xeofs``\n", - "will give a warning.\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "model = xe.multi.CCA(\n", - " n_modes=2,\n", - " use_coslat=True,\n", - " pca=True,\n", - " variance_fraction=0.9,\n", - " init_pca_modes=0.30,\n", - ")\n", - "model.fit(data_list, dim=\"time\")\n", - "components = model.components()\n", - "scores = model.scores()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let's look at the canonical loadings (components) of the first mode.\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "mode = 1\n", - "\n", - "central_longitudes = [\n", - " indian.lon.median().item(),\n", - " pacific.lon.median().item(),\n", - " pacific.lon.median().item(),\n", - "]\n", - "projections = [ccrs.PlateCarree(central_longitude=lon) for lon in central_longitudes]\n", - "\n", - "fig = plt.figure(figsize=(12, 2.5))\n", - "gs = GridSpec(1, 4, figure=fig, width_ratios=[2, 4, 1, 0.2])\n", - "axes = [fig.add_subplot(gs[0, i], projection=projections[i]) for i in range(3)]\n", - "cax = fig.add_subplot(1, 4, 4)\n", - "kwargs = dict(transform=ccrs.PlateCarree(), vmin=-1, vmax=1, cmap=\"RdBu_r\", cbar_ax=cax)\n", - "components[0].sel(mode=mode).plot(ax=axes[0], **kwargs)\n", - "components[1].sel(mode=mode).plot(ax=axes[1], **kwargs)\n", - "im = components[2].sel(mode=mode).plot(ax=axes[2], **kwargs)\n", - "fig.colorbar(im, cax=cax, orientation=\"vertical\")\n", - "for ax in axes:\n", - " ax.coastlines()\n", - " ax.set_title(\"\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "And lastly, we'll check out the canonical variates (scores) of the first mode.\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "fig, ax = plt.subplots(figsize=(12, 4))\n", - "scores[0].sel(mode=mode).plot(ax=ax, label=\"Indian Ocean\")\n", - "scores[1].sel(mode=mode).plot(ax=ax, label=\"Central Pacific\")\n", - "scores[2].sel(mode=mode).plot(ax=ax, label=\"North Atlantic\")\n", - "ax.legend()" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.4" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/docs/auto_examples/3multi/plot_cca.py.md5 b/docs/auto_examples/3multi/plot_cca.py.md5 deleted file mode 100644 index 40b748fb..00000000 --- a/docs/auto_examples/3multi/plot_cca.py.md5 +++ /dev/null @@ -1 +0,0 @@ -ccd6cf17e9ee3ea88ba470a3180fe224 \ No newline at end of file diff --git a/docs/auto_examples/3multi/plot_cca.rst b/docs/auto_examples/3multi/plot_cca.rst deleted file mode 100644 index 7c7b6fce..00000000 --- a/docs/auto_examples/3multi/plot_cca.rst +++ /dev/null @@ -1,242 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/3multi/plot_cca.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_3multi_plot_cca.py: - - -Canonical Correlation Analysis -============================== - -In this example, we're going to perform a Canonical Correlation Analysis (CCA) -on three datasets using the ERSSTv5 monthly sea surface temperature (SST) data -from 1970 to 2022. We divide this data into three areas: the Indian Ocean, -the Pacific Ocean, and the Atlantic Ocean. Our goal is to perform CCA on these -regions. - -First, we'll import the necessary modules. - -.. GENERATED FROM PYTHON SOURCE LINES 13-21 - -.. code-block:: default - - - import cartopy.crs as ccrs - import matplotlib.pyplot as plt - import xarray as xr - from matplotlib.gridspec import GridSpec - - import xeofs as xe - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 22-24 - -Next, we load the data and compute the SST anomalies. This removes the -monthly climatologies, so the seasonal cycle doesn't impact our CCA. - -.. GENERATED FROM PYTHON SOURCE LINES 24-29 - -.. code-block:: default - - - sst = xr.tutorial.load_dataset("ersstv5").sst - sst = sst.groupby("time.month") - sst.groupby("time.month").mean("time") - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 30-31 - -Now, we define the three regions of interest and store them in a list. - -.. GENERATED FROM PYTHON SOURCE LINES 31-38 - -.. code-block:: default - - - indian = sst.sel(lon=slice(35, 115), lat=slice(30, -30)) - pacific = sst.sel(lon=slice(130, 290), lat=slice(30, -30)) - atlantic = sst.sel(lon=slice(320, 360), lat=slice(70, 10)) - - data_list = [indian, pacific, atlantic] - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 39-58 - -We now perform CCA. Since we are dealing with a high-dimensional feature space, we first -perform PCA to reduce the dimensionality (this is kind of a regularized CCA) by setting -``pca=True``. By setting the ``variance_fraction`` keyword argument, we specify that we -want to keep the number of PCA modes that explain 90% of the variance in each of the -three data sets. - -An important parameter is ``init_pca_modes``. It specifies the number -of PCA modes that are initially compute before truncating them to account for 90 %. If this -number is small enough, randomized PCAs will be performed instead of the full SVD decomposition -which is much faster. We can also specify ``init_pca_modes`` as a float (0 < x <= 1), -in which case the number of PCA modes is given by the fraction of the data matrix's rank -The default is set to 0.75 which will ensure that randomized PCAs are performed. - -Given the nature of SST data, we might lower it to something like 0.3, since -we expect that most of the variance in the data will be explained by a small -number of PC modes. - -Note that if our initial PCA modes don't hit the 90% variance target, ``xeofs`` -will give a warning. - -.. GENERATED FROM PYTHON SOURCE LINES 58-70 - -.. code-block:: default - - - model = xe.multi.CCA( - n_modes=2, - use_coslat=True, - pca=True, - variance_fraction=0.9, - init_pca_modes=0.30, - ) - model.fit(data_list, dim="time") - components = model.components() - scores = model.scores() - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 71-72 - -Let's look at the canonical loadings (components) of the first mode. - -.. GENERATED FROM PYTHON SOURCE LINES 72-95 - -.. code-block:: default - - - mode = 1 - - central_longitudes = [ - indian.lon.median().item(), - pacific.lon.median().item(), - pacific.lon.median().item(), - ] - projections = [ccrs.PlateCarree(central_longitude=lon) for lon in central_longitudes] - - fig = plt.figure(figsize=(12, 2.5)) - gs = GridSpec(1, 4, figure=fig, width_ratios=[2, 4, 1, 0.2]) - axes = [fig.add_subplot(gs[0, i], projection=projections[i]) for i in range(3)] - cax = fig.add_subplot(1, 4, 4) - kwargs = dict(transform=ccrs.PlateCarree(), vmin=-1, vmax=1, cmap="RdBu_r", cbar_ax=cax) - components[0].sel(mode=mode).plot(ax=axes[0], **kwargs) - components[1].sel(mode=mode).plot(ax=axes[1], **kwargs) - im = components[2].sel(mode=mode).plot(ax=axes[2], **kwargs) - fig.colorbar(im, cax=cax, orientation="vertical") - for ax in axes: - ax.coastlines() - ax.set_title("") - - - - -.. image-sg:: /auto_examples/3multi/images/sphx_glr_plot_cca_001.png - :alt: plot cca - :srcset: /auto_examples/3multi/images/sphx_glr_plot_cca_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 96-97 - -And lastly, we'll check out the canonical variates (scores) of the first mode. - -.. GENERATED FROM PYTHON SOURCE LINES 97-103 - -.. code-block:: default - - - fig, ax = plt.subplots(figsize=(12, 4)) - scores[0].sel(mode=mode).plot(ax=ax, label="Indian Ocean") - scores[1].sel(mode=mode).plot(ax=ax, label="Central Pacific") - scores[2].sel(mode=mode).plot(ax=ax, label="North Atlantic") - ax.legend() - - - -.. image-sg:: /auto_examples/3multi/images/sphx_glr_plot_cca_002.png - :alt: mode = 1 - :srcset: /auto_examples/3multi/images/sphx_glr_plot_cca_002.png - :class: sphx-glr-single-img - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - - - - - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 6.563 seconds) - - -.. _sphx_glr_download_auto_examples_3multi_plot_cca.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - - - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: plot_cca.py ` - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: plot_cca.ipynb ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/auto_examples/3multi/plot_cca_codeobj.pickle b/docs/auto_examples/3multi/plot_cca_codeobj.pickle deleted file mode 100644 index 006138e1..00000000 Binary files a/docs/auto_examples/3multi/plot_cca_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/3multi/sg_execution_times.rst b/docs/auto_examples/3multi/sg_execution_times.rst deleted file mode 100644 index 6befdc8e..00000000 --- a/docs/auto_examples/3multi/sg_execution_times.rst +++ /dev/null @@ -1,13 +0,0 @@ - -:orphan: - -.. _sphx_glr_auto_examples_3multi_sg_execution_times: - - -Computation times -================= -**00:06.563** total execution time for **auto_examples_3multi** files: - -+--------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_3multi_plot_cca.py` (``plot_cca.py``) | 00:06.563 | 0.0 MB | -+--------------------------------------------------------------------+-----------+--------+ diff --git a/docs/auto_examples/3validation/images/sphx_glr_plot_bootstrap_001.png b/docs/auto_examples/3validation/images/sphx_glr_plot_bootstrap_001.png deleted file mode 100644 index 4c38317d..00000000 Binary files a/docs/auto_examples/3validation/images/sphx_glr_plot_bootstrap_001.png and /dev/null differ diff --git a/docs/auto_examples/3validation/images/thumb/sphx_glr_plot_bootstrap_thumb.png b/docs/auto_examples/3validation/images/thumb/sphx_glr_plot_bootstrap_thumb.png deleted file mode 100644 index 2ca76422..00000000 Binary files a/docs/auto_examples/3validation/images/thumb/sphx_glr_plot_bootstrap_thumb.png and /dev/null differ diff --git a/docs/auto_examples/3validation/index.rst b/docs/auto_examples/3validation/index.rst deleted file mode 100644 index fae1819e..00000000 --- a/docs/auto_examples/3validation/index.rst +++ /dev/null @@ -1,40 +0,0 @@ - - -.. _sphx_glr_auto_examples_3validation: - -3 | Validation -=============== - - -.. raw:: html - -
- - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/3validation/images/thumb/sphx_glr_plot_bootstrap_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_3validation_plot_bootstrap.py` - -.. raw:: html - -
Significance testing of EOF analysis via bootstrap
-
- - -.. raw:: html - -
- - -.. toctree:: - :hidden: - - /auto_examples/3validation/plot_bootstrap - diff --git a/docs/auto_examples/3validation/plot_bootstrap.rst b/docs/auto_examples/3validation/plot_bootstrap.rst deleted file mode 100644 index 03348627..00000000 --- a/docs/auto_examples/3validation/plot_bootstrap.rst +++ /dev/null @@ -1,228 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/3validation/plot_bootstrap.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_3validation_plot_bootstrap.py: - - -Significance testing of EOF analysis via bootstrap -=================================================== - -Test the significance of individual modes and obtain confidence intervals -for both EOFs and PCs. - -.. GENERATED FROM PYTHON SOURCE LINES 8-18 - -.. code-block:: default - - - # Load packages and data: - import matplotlib.pyplot as plt - import numpy as np - import xarray as xr - from cartopy.crs import Orthographic, PlateCarree - from matplotlib.gridspec import GridSpec - - import xeofs as xe - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 19-22 - -.. code-block:: default - - - t2m = xr.tutorial.load_dataset("air_temperature")["air"] - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 23-24 - -Perform EOF analysis - -.. GENERATED FROM PYTHON SOURCE LINES 24-32 - -.. code-block:: default - - - model = xe.single.EOF(n_modes=5, standardize=False) - model.fit(t2m, dim="time") - expvar = model.explained_variance_ratio() - components = model.components() - scores = model.scores() - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 33-37 - -Perform bootstrapping of the model to identy the number of significant modes. -We perform 50 bootstraps. -Note - if computationallly feasible - you typically want to choose higher -numbers of bootstraps e.g. 1000. - -.. GENERATED FROM PYTHON SOURCE LINES 37-54 - -.. code-block:: default - - - n_boot = 50 - - bs = xe.validation.EOFBootstrapper(n_bootstraps=n_boot) - bs.fit(model) - bs_expvar = bs.explained_variance() - ci_expvar = bs_expvar.quantile([0.025, 0.975], "n") # 95% confidence intervals - - q025 = ci_expvar.sel(quantile=0.025) - q975 = ci_expvar.sel(quantile=0.975) - - is_significant = q025 - q975.shift({"mode": -1}) > 0 - n_significant_modes = ( - is_significant.where(is_significant is True).cumsum(skipna=False).max().fillna(0) - ) - print("{:} modes are significant at alpha=0.05".format(n_significant_modes.values)) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 0%| | 0/50 [00:00 0 - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 66-67 - -Summarize the results in a figure. - -.. GENERATED FROM PYTHON SOURCE LINES 67-96 - -.. code-block:: default - - - - lons, lats = np.meshgrid(is_sig_comps.lon.values, is_sig_comps.lat.values) - proj = Orthographic(central_latitude=30, central_longitude=-80) - kwargs = {"cmap": "RdBu", "vmin": -0.05, "vmax": 0.05, "transform": PlateCarree()} - - fig = plt.figure(figsize=(10, 16)) - gs = GridSpec(5, 2) - ax1 = [fig.add_subplot(gs[i, 0], projection=proj) for i in range(5)] - ax2 = [fig.add_subplot(gs[i, 1]) for i in range(5)] - - for i, (a1, a2) in enumerate(zip(ax1, ax2)): - a1.coastlines(color=".5") - components.isel(mode=i).plot(ax=a1, **kwargs) - a1.scatter( - lons, - lats, - is_sig_comps.isel(mode=i).values * 0.5, - color="k", - alpha=0.5, - transform=PlateCarree(), - ) - ci_scores.isel(mode=i, quantile=0).plot(ax=a2, color=".3", lw=".5", label="2.5%") - ci_scores.isel(mode=i, quantile=1).plot(ax=a2, color=".3", lw=".5", label="97.5%") - scores.isel(mode=i).plot(ax=a2, lw=".5", alpha=0.5, label="PC") - a2.legend(loc=2) - - plt.tight_layout() - plt.savefig("bootstrap.jpg") - - - -.. image-sg:: /auto_examples/3validation/images/sphx_glr_plot_bootstrap_001.png - :alt: mode = 1, mode = 2, mode = 3, mode = 4, mode = 5, mode = 1, mode = 2, mode = 3, mode = 4, mode = 5 - :srcset: /auto_examples/3validation/images/sphx_glr_plot_bootstrap_001.png - :class: sphx-glr-single-img - - - - - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 46.918 seconds) - - -.. _sphx_glr_download_auto_examples_3validation_plot_bootstrap.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - - - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: plot_bootstrap.py ` - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: plot_bootstrap.ipynb ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/auto_examples/3validation/plot_bootstrap_codeobj.pickle b/docs/auto_examples/3validation/plot_bootstrap_codeobj.pickle deleted file mode 100644 index 106ffc34..00000000 Binary files a/docs/auto_examples/3validation/plot_bootstrap_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/3validation/sg_execution_times.rst b/docs/auto_examples/3validation/sg_execution_times.rst deleted file mode 100644 index 428a3ef4..00000000 --- a/docs/auto_examples/3validation/sg_execution_times.rst +++ /dev/null @@ -1,13 +0,0 @@ - -:orphan: - -.. _sphx_glr_auto_examples_3validation_sg_execution_times: - - -Computation times -================= -**00:46.918** total execution time for **auto_examples_3validation** files: - -+-------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_3validation_plot_bootstrap.py` (``plot_bootstrap.py``) | 00:46.918 | 0.0 MB | -+-------------------------------------------------------------------------------------+-----------+--------+ diff --git a/docs/auto_examples/4validation/images/sphx_glr_plot_bootstrap_001.png b/docs/auto_examples/4validation/images/sphx_glr_plot_bootstrap_001.png deleted file mode 100644 index 598a4f1a..00000000 Binary files a/docs/auto_examples/4validation/images/sphx_glr_plot_bootstrap_001.png and /dev/null differ diff --git a/docs/auto_examples/4validation/images/thumb/sphx_glr_plot_bootstrap_thumb.png b/docs/auto_examples/4validation/images/thumb/sphx_glr_plot_bootstrap_thumb.png deleted file mode 100644 index 35eae974..00000000 Binary files a/docs/auto_examples/4validation/images/thumb/sphx_glr_plot_bootstrap_thumb.png and /dev/null differ diff --git a/docs/auto_examples/4validation/plot_bootstrap.ipynb b/docs/auto_examples/4validation/plot_bootstrap.ipynb deleted file mode 100644 index 8312c300..00000000 --- a/docs/auto_examples/4validation/plot_bootstrap.ipynb +++ /dev/null @@ -1,181 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "# Significance testing of EOF analysis via bootstrap\n", - "\n", - "Test the significance of individual modes and obtain confidence intervals\n", - "for both EOFs and PCs.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Load packages and data:\n", - "import matplotlib.pyplot as plt\n", - "import numpy as np\n", - "import xarray as xr\n", - "from cartopy.crs import Orthographic, PlateCarree\n", - "from matplotlib.gridspec import GridSpec\n", - "\n", - "import xeofs as xe" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "t2m = xr.tutorial.load_dataset(\"air_temperature\")[\"air\"]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Perform EOF analysis\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "model = xe.single.EOF(n_modes=5, standardize=False)\n", - "model.fit(t2m, dim=\"time\")\n", - "expvar = model.explained_variance_ratio()\n", - "components = model.components()\n", - "scores = model.scores()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Perform bootstrapping of the model to identy the number of significant modes.\n", - "We perform 50 bootstraps.\n", - "Note - if computationallly feasible - you typically want to choose higher\n", - "numbers of bootstraps e.g. 1000.\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "n_boot = 50\n", - "\n", - "bs = xe.validation.EOFBootstrapper(n_bootstraps=n_boot)\n", - "bs.fit(model)\n", - "bs_expvar = bs.explained_variance()\n", - "ci_expvar = bs_expvar.quantile([0.025, 0.975], \"n\") # 95% confidence intervals\n", - "\n", - "q025 = ci_expvar.sel(quantile=0.025)\n", - "q975 = ci_expvar.sel(quantile=0.975)\n", - "\n", - "is_significant = q025 - q975.shift({\"mode\": -1}) > 0\n", - "n_significant_modes = (\n", - " is_significant.where(is_significant is True).cumsum(skipna=False).max().fillna(0)\n", - ")\n", - "print(\"{:} modes are significant at alpha=0.05\".format(n_significant_modes.values))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The bootstrapping procedure identifies 3 significant modes. We can also\n", - "compute the 95 % confidence intervals of the EOFs/PCs and mask out\n", - "insignificant elements of the obtained EOFs.\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ci_components = bs.components().quantile([0.025, 0.975], \"n\")\n", - "ci_scores = bs.scores().quantile([0.025, 0.975], \"n\")\n", - "\n", - "is_sig_comps = np.sign(ci_components).prod(\"quantile\") > 0" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Summarize the results in a figure.\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "lons, lats = np.meshgrid(is_sig_comps.lon.values, is_sig_comps.lat.values)\n", - "proj = Orthographic(central_latitude=30, central_longitude=-80)\n", - "kwargs = {\"cmap\": \"RdBu\", \"vmin\": -0.05, \"vmax\": 0.05, \"transform\": PlateCarree()}\n", - "\n", - "fig = plt.figure(figsize=(10, 16))\n", - "gs = GridSpec(5, 2)\n", - "ax1 = [fig.add_subplot(gs[i, 0], projection=proj) for i in range(5)]\n", - "ax2 = [fig.add_subplot(gs[i, 1]) for i in range(5)]\n", - "\n", - "for i, (a1, a2) in enumerate(zip(ax1, ax2)):\n", - " a1.coastlines(color=\".5\")\n", - " components.isel(mode=i).plot(ax=a1, **kwargs)\n", - " a1.scatter(\n", - " lons,\n", - " lats,\n", - " is_sig_comps.isel(mode=i).values * 0.5,\n", - " color=\"k\",\n", - " alpha=0.5,\n", - " transform=PlateCarree(),\n", - " )\n", - " ci_scores.isel(mode=i, quantile=0).plot(ax=a2, color=\".3\", lw=\".5\", label=\"2.5%\")\n", - " ci_scores.isel(mode=i, quantile=1).plot(ax=a2, color=\".3\", lw=\".5\", label=\"97.5%\")\n", - " scores.isel(mode=i).plot(ax=a2, lw=\".5\", alpha=0.5, label=\"PC\")\n", - " a2.legend(loc=2)\n", - "\n", - "plt.tight_layout()\n", - "plt.savefig(\"bootstrap.jpg\")" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.4" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/docs/auto_examples/4validation/plot_bootstrap.py.md5 b/docs/auto_examples/4validation/plot_bootstrap.py.md5 deleted file mode 100644 index c683ebe5..00000000 --- a/docs/auto_examples/4validation/plot_bootstrap.py.md5 +++ /dev/null @@ -1 +0,0 @@ -dcdf2653c5cb47f1d8828948c6fdda17 \ No newline at end of file diff --git a/docs/auto_examples/4validation/plot_bootstrap_codeobj.pickle b/docs/auto_examples/4validation/plot_bootstrap_codeobj.pickle deleted file mode 100644 index a89e7116..00000000 Binary files a/docs/auto_examples/4validation/plot_bootstrap_codeobj.pickle and /dev/null differ diff --git a/docs/auto_examples/4validation/sg_execution_times.rst b/docs/auto_examples/4validation/sg_execution_times.rst deleted file mode 100644 index ef197d4f..00000000 --- a/docs/auto_examples/4validation/sg_execution_times.rst +++ /dev/null @@ -1,13 +0,0 @@ - -:orphan: - -.. _sphx_glr_auto_examples_4validation_sg_execution_times: - - -Computation times -================= -**00:32.065** total execution time for **auto_examples_4validation** files: - -+-------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_4validation_plot_bootstrap.py` (``plot_bootstrap.py``) | 00:32.065 | 0.0 MB | -+-------------------------------------------------------------------------------------+-----------+--------+ diff --git a/docs/auto_examples/auto_examples_jupyter.zip b/docs/auto_examples/auto_examples_jupyter.zip deleted file mode 100644 index fbfeb644..00000000 Binary files a/docs/auto_examples/auto_examples_jupyter.zip and /dev/null differ diff --git a/docs/conf.py b/docs/conf.py index 24f9ae73..02229686 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -67,8 +67,8 @@ # Sphinx-gallery stuff sphinx_gallery_conf = { - "examples_dirs": "../examples", # path to your example scripts - "gallery_dirs": "auto_examples", # path to where to save gallery generated output + "examples_dirs": "content/user_guide/examples", # path to your example scripts + "gallery_dirs": "content/user_guide/auto_examples", # path to where to save gallery generated output } # Add any paths that contain templates here, relative to this directory. @@ -81,7 +81,7 @@ source_suffix = ".rst" # The master toctree document. -master_doc = "index" +master_doc = "content/index" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -99,8 +99,8 @@ ".DS_Store", # exclude .py and .ipynb files in auto_examples generated by sphinx-gallery # this is to prevent sphinx from complaining about duplicate source files - "auto_examples/**/*.py", - "auto_examples/**/*.ipynb", + "content/user_guide/auto_examples/**/*.py", + "content/user_guide/auto_examples/**/*.ipynb", ] # The name of the Pygments (syntax highlighting) style to use. @@ -258,7 +258,9 @@ def crawl_source_shorten_titles(path): with open(file_path, "w") as file: file.writelines(lines) - path = os.path.join(os.path.abspath(".."), "docs/api_reference/_autosummary") + path = os.path.join( + os.path.abspath(".."), "docs/content/api_reference/_autosummary" + ) crawl_source_shorten_titles(path) diff --git a/docs/api_reference/_autosummary/xeofs.RotatorFactory.rst b/docs/content/api_reference/_autosummary/xeofs.RotatorFactory.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.RotatorFactory.rst rename to docs/content/api_reference/_autosummary/xeofs.RotatorFactory.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.CCA.rst b/docs/content/api_reference/_autosummary/xeofs.cross.CCA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.CCA.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.CCA.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.CPCCA.rst b/docs/content/api_reference/_autosummary/xeofs.cross.CPCCA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.CPCCA.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.CPCCA.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.CPCCARotator.rst b/docs/content/api_reference/_autosummary/xeofs.cross.CPCCARotator.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.CPCCARotator.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.CPCCARotator.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.ComplexCCA.rst b/docs/content/api_reference/_autosummary/xeofs.cross.ComplexCCA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.ComplexCCA.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.ComplexCCA.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.ComplexCPCCA.rst b/docs/content/api_reference/_autosummary/xeofs.cross.ComplexCPCCA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.ComplexCPCCA.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.ComplexCPCCA.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.ComplexCPCCARotator.rst b/docs/content/api_reference/_autosummary/xeofs.cross.ComplexCPCCARotator.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.ComplexCPCCARotator.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.ComplexCPCCARotator.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.ComplexMCA.rst b/docs/content/api_reference/_autosummary/xeofs.cross.ComplexMCA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.ComplexMCA.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.ComplexMCA.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.ComplexMCARotator.rst b/docs/content/api_reference/_autosummary/xeofs.cross.ComplexMCARotator.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.ComplexMCARotator.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.ComplexMCARotator.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.ComplexRDA.rst b/docs/content/api_reference/_autosummary/xeofs.cross.ComplexRDA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.ComplexRDA.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.ComplexRDA.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.HilbertCCA.rst b/docs/content/api_reference/_autosummary/xeofs.cross.HilbertCCA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.HilbertCCA.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.HilbertCCA.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.HilbertCPCCA.rst b/docs/content/api_reference/_autosummary/xeofs.cross.HilbertCPCCA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.HilbertCPCCA.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.HilbertCPCCA.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.HilbertCPCCARotator.rst b/docs/content/api_reference/_autosummary/xeofs.cross.HilbertCPCCARotator.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.HilbertCPCCARotator.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.HilbertCPCCARotator.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.HilbertMCA.rst b/docs/content/api_reference/_autosummary/xeofs.cross.HilbertMCA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.HilbertMCA.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.HilbertMCA.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.HilbertMCARotator.rst b/docs/content/api_reference/_autosummary/xeofs.cross.HilbertMCARotator.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.HilbertMCARotator.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.HilbertMCARotator.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.HilbertRDA.rst b/docs/content/api_reference/_autosummary/xeofs.cross.HilbertRDA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.HilbertRDA.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.HilbertRDA.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.MCA.rst b/docs/content/api_reference/_autosummary/xeofs.cross.MCA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.MCA.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.MCA.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.MCARotator.rst b/docs/content/api_reference/_autosummary/xeofs.cross.MCARotator.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.MCARotator.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.MCARotator.rst diff --git a/docs/api_reference/_autosummary/xeofs.cross.RDA.rst b/docs/content/api_reference/_autosummary/xeofs.cross.RDA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.cross.RDA.rst rename to docs/content/api_reference/_autosummary/xeofs.cross.RDA.rst diff --git a/docs/api_reference/_autosummary/xeofs.multi.CCA.rst b/docs/content/api_reference/_autosummary/xeofs.multi.CCA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.multi.CCA.rst rename to docs/content/api_reference/_autosummary/xeofs.multi.CCA.rst diff --git a/docs/api_reference/_autosummary/xeofs.single.ComplexEOF.rst b/docs/content/api_reference/_autosummary/xeofs.single.ComplexEOF.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.single.ComplexEOF.rst rename to docs/content/api_reference/_autosummary/xeofs.single.ComplexEOF.rst diff --git a/docs/api_reference/_autosummary/xeofs.single.ComplexEOFRotator.rst b/docs/content/api_reference/_autosummary/xeofs.single.ComplexEOFRotator.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.single.ComplexEOFRotator.rst rename to docs/content/api_reference/_autosummary/xeofs.single.ComplexEOFRotator.rst diff --git a/docs/api_reference/_autosummary/xeofs.single.EOF.rst b/docs/content/api_reference/_autosummary/xeofs.single.EOF.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.single.EOF.rst rename to docs/content/api_reference/_autosummary/xeofs.single.EOF.rst diff --git a/docs/api_reference/_autosummary/xeofs.single.EOFRotator.rst b/docs/content/api_reference/_autosummary/xeofs.single.EOFRotator.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.single.EOFRotator.rst rename to docs/content/api_reference/_autosummary/xeofs.single.EOFRotator.rst diff --git a/docs/api_reference/_autosummary/xeofs.single.ExtendedEOF.rst b/docs/content/api_reference/_autosummary/xeofs.single.ExtendedEOF.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.single.ExtendedEOF.rst rename to docs/content/api_reference/_autosummary/xeofs.single.ExtendedEOF.rst diff --git a/docs/api_reference/_autosummary/xeofs.single.GWPCA.rst b/docs/content/api_reference/_autosummary/xeofs.single.GWPCA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.single.GWPCA.rst rename to docs/content/api_reference/_autosummary/xeofs.single.GWPCA.rst diff --git a/docs/api_reference/_autosummary/xeofs.single.HilbertEOF.rst b/docs/content/api_reference/_autosummary/xeofs.single.HilbertEOF.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.single.HilbertEOF.rst rename to docs/content/api_reference/_autosummary/xeofs.single.HilbertEOF.rst diff --git a/docs/api_reference/_autosummary/xeofs.single.HilbertEOFRotator.rst b/docs/content/api_reference/_autosummary/xeofs.single.HilbertEOFRotator.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.single.HilbertEOFRotator.rst rename to docs/content/api_reference/_autosummary/xeofs.single.HilbertEOFRotator.rst diff --git a/docs/api_reference/_autosummary/xeofs.single.OPA.rst b/docs/content/api_reference/_autosummary/xeofs.single.OPA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.single.OPA.rst rename to docs/content/api_reference/_autosummary/xeofs.single.OPA.rst diff --git a/docs/api_reference/_autosummary/xeofs.single.POP.rst b/docs/content/api_reference/_autosummary/xeofs.single.POP.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.single.POP.rst rename to docs/content/api_reference/_autosummary/xeofs.single.POP.rst diff --git a/docs/api_reference/_autosummary/xeofs.single.SparsePCA.rst b/docs/content/api_reference/_autosummary/xeofs.single.SparsePCA.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.single.SparsePCA.rst rename to docs/content/api_reference/_autosummary/xeofs.single.SparsePCA.rst diff --git a/docs/api_reference/_autosummary/xeofs.validation.EOFBootstrapper.rst b/docs/content/api_reference/_autosummary/xeofs.validation.EOFBootstrapper.rst similarity index 100% rename from docs/api_reference/_autosummary/xeofs.validation.EOFBootstrapper.rst rename to docs/content/api_reference/_autosummary/xeofs.validation.EOFBootstrapper.rst diff --git a/docs/api_reference/cross_set_analysis.rst b/docs/content/api_reference/cross_set_analysis.rst similarity index 100% rename from docs/api_reference/cross_set_analysis.rst rename to docs/content/api_reference/cross_set_analysis.rst diff --git a/docs/api_reference/index.rst b/docs/content/api_reference/index.rst similarity index 98% rename from docs/api_reference/index.rst rename to docs/content/api_reference/index.rst index c74ab81d..85ab204b 100644 --- a/docs/api_reference/index.rst +++ b/docs/content/api_reference/index.rst @@ -1,3 +1,5 @@ +.. _api_reference: + ====================== API Reference ====================== diff --git a/docs/api_reference/model_evaluation.rst b/docs/content/api_reference/model_evaluation.rst similarity index 100% rename from docs/api_reference/model_evaluation.rst rename to docs/content/api_reference/model_evaluation.rst diff --git a/docs/api_reference/multi_set_analysis.rst b/docs/content/api_reference/multi_set_analysis.rst similarity index 100% rename from docs/api_reference/multi_set_analysis.rst rename to docs/content/api_reference/multi_set_analysis.rst diff --git a/docs/api_reference/single_set_analysis.rst b/docs/content/api_reference/single_set_analysis.rst similarity index 100% rename from docs/api_reference/single_set_analysis.rst rename to docs/content/api_reference/single_set_analysis.rst diff --git a/docs/api_reference/utilities.rst b/docs/content/api_reference/utilities.rst similarity index 100% rename from docs/api_reference/utilities.rst rename to docs/content/api_reference/utilities.rst diff --git a/docs/contributing_guide.rst b/docs/content/contributing.rst similarity index 99% rename from docs/contributing_guide.rst rename to docs/content/contributing.rst index 3cf44aa4..785c6e55 100644 --- a/docs/contributing_guide.rst +++ b/docs/content/contributing.rst @@ -1,5 +1,5 @@ -Contributing Guide -================== +Contributing +============ Introduction ------------ diff --git a/docs/index.rst b/docs/content/index.rst similarity index 83% rename from docs/index.rst rename to docs/content/index.rst index bd44b71e..a5f4c1a0 100644 --- a/docs/index.rst +++ b/docs/content/index.rst @@ -1,18 +1,18 @@ -.. image:: logos/xeofs_logo_dark.png +.. image:: ../logos/xeofs_logo_dark.png :class: only-dark :align: center :width: 1000 :alt: logo of xeofs -| -.. image:: logos/xeofs_logo_light.png + +.. image:: ../logos/xeofs_logo_light.png :class: only-light :align: center :width: 1000 :alt: logo of xeofs -| + .. rst-class:: center @@ -25,10 +25,10 @@ Extracting Patterns from Climate Data :hidden: user_guide/index - installation + user_guide/installation api_reference/index whats_new/CHANGELOG - contributing_guide + contributing @@ -48,7 +48,7 @@ xeofs is a specialized Python package designed for dimensionality reduction in c .. grid-item-card:: :octicon:`gear;10em` - :link: installation + :link: user_guide/installation :link-type: doc :text-align: center @@ -71,7 +71,7 @@ xeofs is a specialized Python package designed for dimensionality reduction in c .. grid-item-card:: :octicon:`people;10em` - :link: contributing_guide + :link: contributing :link-type: doc :text-align: center @@ -85,6 +85,10 @@ xeofs is a specialized Python package designed for dimensionality reduction in c xeofs is currently in the early stages of development. We welcome contributions and feedback from the community. +.. note:: + + Version 3 has been released! Check out the :doc:`CHANGELOG` for more details. For users of previous versions, see the :doc:`migration guide`. + .. _xarray: https://docs.xarray.dev/en/stable/index.html .. _Dask: https://dask.org/ diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_001.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_complex_eof_001.png similarity index 100% rename from docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_001.png rename to docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_complex_eof_001.png diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_002.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_complex_eof_002.png similarity index 100% rename from docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_002.png rename to docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_complex_eof_002.png diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_eeof_001.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_001.png similarity index 100% rename from docs/auto_examples/1single/images/sphx_glr_plot_eeof_001.png rename to docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_001.png diff --git a/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_002.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_002.png new file mode 100644 index 00000000..ce6c5f24 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_002.png differ diff --git a/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_003.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_003.png new file mode 100644 index 00000000..401297d8 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_003.png differ diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_eeof_trend_001.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_001.png similarity index 100% rename from docs/auto_examples/1single/images/sphx_glr_plot_eeof_trend_001.png rename to docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_001.png diff --git a/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_002.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_002.png new file mode 100644 index 00000000..7a4b90c6 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_002.png differ diff --git a/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_003.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_003.png new file mode 100644 index 00000000..a58fe254 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_003.png differ diff --git a/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png new file mode 100644 index 00000000..05e6575f Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png differ diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_eof-tmode_001.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eof-tmode_001.png similarity index 100% rename from docs/auto_examples/1single/images/sphx_glr_plot_eof-tmode_001.png rename to docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_eof-tmode_001.png diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_gwpca_001.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_gwpca_001.png similarity index 100% rename from docs/auto_examples/1single/images/sphx_glr_plot_gwpca_001.png rename to docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_gwpca_001.png diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_gwpca_002.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_gwpca_002.png similarity index 100% rename from docs/auto_examples/1single/images/sphx_glr_plot_gwpca_002.png rename to docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_gwpca_002.png diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_001.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_001.png similarity index 100% rename from docs/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_001.png rename to docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_001.png diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_002.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_002.png similarity index 100% rename from docs/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_002.png rename to docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_002.png diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_003.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_003.png similarity index 100% rename from docs/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_003.png rename to docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_003.png diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_004.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_004.png similarity index 100% rename from docs/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_004.png rename to docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_004.png diff --git a/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_mreof_001.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_mreof_001.png new file mode 100644 index 00000000..2586cb8f Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_mreof_001.png differ diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_multivariate-eof_001.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_multivariate-eof_001.png similarity index 100% rename from docs/auto_examples/1single/images/sphx_glr_plot_multivariate-eof_001.png rename to docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_multivariate-eof_001.png diff --git a/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_rotated_eof_001.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_rotated_eof_001.png new file mode 100644 index 00000000..4f994eb0 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_rotated_eof_001.png differ diff --git a/docs/auto_examples/1single/images/sphx_glr_plot_weighted-eof_001.png b/docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_weighted-eof_001.png similarity index 100% rename from docs/auto_examples/1single/images/sphx_glr_plot_weighted-eof_001.png rename to docs/content/user_guide/auto_examples/1single/images/sphx_glr_plot_weighted-eof_001.png diff --git a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_complex_eof_thumb.png b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_complex_eof_thumb.png similarity index 100% rename from docs/auto_examples/1single/images/thumb/sphx_glr_plot_complex_eof_thumb.png rename to docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_complex_eof_thumb.png diff --git a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eeof_thumb.png b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_eeof_thumb.png similarity index 100% rename from docs/auto_examples/1single/images/thumb/sphx_glr_plot_eeof_thumb.png rename to docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_eeof_thumb.png diff --git a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eeof_trend_thumb.png b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_eeof_trend_thumb.png similarity index 100% rename from docs/auto_examples/1single/images/thumb/sphx_glr_plot_eeof_trend_thumb.png rename to docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_eeof_trend_thumb.png diff --git a/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_eof-smode_thumb.png b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_eof-smode_thumb.png new file mode 100644 index 00000000..05a9ff0f Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_eof-smode_thumb.png differ diff --git a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eof-tmode_thumb.png b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_eof-tmode_thumb.png similarity index 100% rename from docs/auto_examples/1single/images/thumb/sphx_glr_plot_eof-tmode_thumb.png rename to docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_eof-tmode_thumb.png diff --git a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_gwpca_thumb.png b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_gwpca_thumb.png similarity index 100% rename from docs/auto_examples/1single/images/thumb/sphx_glr_plot_gwpca_thumb.png rename to docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_gwpca_thumb.png diff --git a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_hilbert_eof_thumb.png b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_hilbert_eof_thumb.png similarity index 100% rename from docs/auto_examples/1single/images/thumb/sphx_glr_plot_hilbert_eof_thumb.png rename to docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_hilbert_eof_thumb.png diff --git a/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_mreof_thumb.png b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_mreof_thumb.png new file mode 100644 index 00000000..ff78c967 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_mreof_thumb.png differ diff --git a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_multivariate-eof_thumb.png b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_multivariate-eof_thumb.png similarity index 100% rename from docs/auto_examples/1single/images/thumb/sphx_glr_plot_multivariate-eof_thumb.png rename to docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_multivariate-eof_thumb.png diff --git a/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_rotated_eof_thumb.png b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_rotated_eof_thumb.png new file mode 100644 index 00000000..1fce006b Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_rotated_eof_thumb.png differ diff --git a/docs/auto_examples/1single/images/thumb/sphx_glr_plot_weighted-eof_thumb.png b/docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_weighted-eof_thumb.png similarity index 100% rename from docs/auto_examples/1single/images/thumb/sphx_glr_plot_weighted-eof_thumb.png rename to docs/content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_weighted-eof_thumb.png diff --git a/docs/auto_examples/1single/index.rst b/docs/content/user_guide/auto_examples/1single/index.rst similarity index 55% rename from docs/auto_examples/1single/index.rst rename to docs/content/user_guide/auto_examples/1single/index.rst index 536b6aa5..63ef848a 100644 --- a/docs/auto_examples/1single/index.rst +++ b/docs/content/user_guide/auto_examples/1single/index.rst @@ -1,6 +1,6 @@ -.. _sphx_glr_auto_examples_1single: +.. _sphx_glr_content_user_guide_auto_examples_1single: 1 | Single-Set Analysis ======================= @@ -18,10 +18,10 @@ .. only:: html - .. image:: /auto_examples/1single/images/thumb/sphx_glr_plot_eeof_thumb.png + .. image:: /content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_eeof_thumb.png :alt: - :ref:`sphx_glr_auto_examples_1single_plot_eeof.py` + :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_eeof.py` .. raw:: html @@ -35,10 +35,10 @@ .. only:: html - .. image:: /auto_examples/1single/images/thumb/sphx_glr_plot_complex_eof_thumb.png + .. image:: /content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_complex_eof_thumb.png :alt: - :ref:`sphx_glr_auto_examples_1single_plot_complex_eof.py` + :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_complex_eof.py` .. raw:: html @@ -52,10 +52,10 @@ .. only:: html - .. image:: /auto_examples/1single/images/thumb/sphx_glr_plot_eof-tmode_thumb.png + .. image:: /content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_eof-tmode_thumb.png :alt: - :ref:`sphx_glr_auto_examples_1single_plot_eof-tmode.py` + :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_eof-tmode.py` .. raw:: html @@ -69,10 +69,10 @@ .. only:: html - .. image:: /auto_examples/1single/images/thumb/sphx_glr_plot_hilbert_eof_thumb.png + .. image:: /content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_hilbert_eof_thumb.png :alt: - :ref:`sphx_glr_auto_examples_1single_plot_hilbert_eof.py` + :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_hilbert_eof.py` .. raw:: html @@ -86,10 +86,10 @@ .. only:: html - .. image:: /auto_examples/1single/images/thumb/sphx_glr_plot_eof-smode_thumb.png + .. image:: /content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_eof-smode_thumb.png :alt: - :ref:`sphx_glr_auto_examples_1single_plot_eof-smode.py` + :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_eof-smode.py` .. raw:: html @@ -103,10 +103,10 @@ .. only:: html - .. image:: /auto_examples/1single/images/thumb/sphx_glr_plot_eeof_trend_thumb.png + .. image:: /content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_eeof_trend_thumb.png :alt: - :ref:`sphx_glr_auto_examples_1single_plot_eeof_trend.py` + :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_eeof_trend.py` .. raw:: html @@ -120,10 +120,10 @@ .. only:: html - .. image:: /auto_examples/1single/images/thumb/sphx_glr_plot_multivariate-eof_thumb.png + .. image:: /content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_multivariate-eof_thumb.png :alt: - :ref:`sphx_glr_auto_examples_1single_plot_multivariate-eof.py` + :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_multivariate-eof.py` .. raw:: html @@ -137,10 +137,10 @@ .. only:: html - .. image:: /auto_examples/1single/images/thumb/sphx_glr_plot_mreof_thumb.png + .. image:: /content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_mreof_thumb.png :alt: - :ref:`sphx_glr_auto_examples_1single_plot_mreof.py` + :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_mreof.py` .. raw:: html @@ -154,10 +154,10 @@ .. only:: html - .. image:: /auto_examples/1single/images/thumb/sphx_glr_plot_rotated_eof_thumb.png + .. image:: /content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_rotated_eof_thumb.png :alt: - :ref:`sphx_glr_auto_examples_1single_plot_rotated_eof.py` + :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_rotated_eof.py` .. raw:: html @@ -171,10 +171,10 @@ .. only:: html - .. image:: /auto_examples/1single/images/thumb/sphx_glr_plot_weighted-eof_thumb.png + .. image:: /content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_weighted-eof_thumb.png :alt: - :ref:`sphx_glr_auto_examples_1single_plot_weighted-eof.py` + :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_weighted-eof.py` .. raw:: html @@ -188,10 +188,10 @@ .. only:: html - .. image:: /auto_examples/1single/images/thumb/sphx_glr_plot_gwpca_thumb.png + .. image:: /content/user_guide/auto_examples/1single/images/thumb/sphx_glr_plot_gwpca_thumb.png :alt: - :ref:`sphx_glr_auto_examples_1single_plot_gwpca.py` + :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_gwpca.py` .. raw:: html @@ -207,15 +207,15 @@ .. toctree:: :hidden: - /auto_examples/1single/plot_eeof - /auto_examples/1single/plot_complex_eof - /auto_examples/1single/plot_eof-tmode - /auto_examples/1single/plot_hilbert_eof - /auto_examples/1single/plot_eof-smode - /auto_examples/1single/plot_eeof_trend - /auto_examples/1single/plot_multivariate-eof - /auto_examples/1single/plot_mreof - /auto_examples/1single/plot_rotated_eof - /auto_examples/1single/plot_weighted-eof - /auto_examples/1single/plot_gwpca + /content/user_guide/auto_examples/1single/plot_eeof + /content/user_guide/auto_examples/1single/plot_complex_eof + /content/user_guide/auto_examples/1single/plot_eof-tmode + /content/user_guide/auto_examples/1single/plot_hilbert_eof + /content/user_guide/auto_examples/1single/plot_eof-smode + /content/user_guide/auto_examples/1single/plot_eeof_trend + /content/user_guide/auto_examples/1single/plot_multivariate-eof + /content/user_guide/auto_examples/1single/plot_mreof + /content/user_guide/auto_examples/1single/plot_rotated_eof + /content/user_guide/auto_examples/1single/plot_weighted-eof + /content/user_guide/auto_examples/1single/plot_gwpca diff --git a/docs/auto_examples/1single/plot_complex_eof.ipynb b/docs/content/user_guide/auto_examples/1single/plot_complex_eof.ipynb similarity index 100% rename from docs/auto_examples/1single/plot_complex_eof.ipynb rename to docs/content/user_guide/auto_examples/1single/plot_complex_eof.ipynb diff --git a/docs/auto_examples/1single/plot_complex_eof.py b/docs/content/user_guide/auto_examples/1single/plot_complex_eof.py similarity index 100% rename from docs/auto_examples/1single/plot_complex_eof.py rename to docs/content/user_guide/auto_examples/1single/plot_complex_eof.py diff --git a/docs/auto_examples/1single/plot_complex_eof.py.md5 b/docs/content/user_guide/auto_examples/1single/plot_complex_eof.py.md5 similarity index 100% rename from docs/auto_examples/1single/plot_complex_eof.py.md5 rename to docs/content/user_guide/auto_examples/1single/plot_complex_eof.py.md5 diff --git a/docs/auto_examples/1single/plot_complex_eof.rst b/docs/content/user_guide/auto_examples/1single/plot_complex_eof.rst similarity index 80% rename from docs/auto_examples/1single/plot_complex_eof.rst rename to docs/content/user_guide/auto_examples/1single/plot_complex_eof.rst index 5f973424..c58a81bd 100644 --- a/docs/auto_examples/1single/plot_complex_eof.rst +++ b/docs/content/user_guide/auto_examples/1single/plot_complex_eof.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/1single/plot_complex_eof.py" +.. "content/user_guide/auto_examples/1single/plot_complex_eof.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_1single_plot_complex_eof.py: +.. _sphx_glr_content_user_guide_auto_examples_1single_plot_complex_eof.py: Complex EOF analysis @@ -46,7 +46,7 @@ Let's start by importing the necessary packages and loading the data: .. code-block:: none - + @@ -444,18 +444,18 @@ For this example, we'll use the ERA-Interim tutorial dataset ``eraint_uvz``: z (month, level, latitude, longitude) float64 ... u (month, level, latitude, longitude) float64 ... v (month, level, latitude, longitude) float64 ... - Attributes: (2)
  • Conventions :
    CF-1.0
    Info :
    Monthly ERA-Interim data. Downloaded and edited by fabien.maussion@uibk.ac.at


  • @@ -511,7 +511,7 @@ each grid cell by the square root of the cosine of the latitude /home/nrieger/miniconda3/envs/xeofs/lib/python3.11/site-packages/scipy/sparse/linalg/_eigen/_svds.py:483: UserWarning: The problem size 2 minus the constraints size 0 is too small relative to the block size 1. Using a dense eigensolver instead of LOBPCG iterations.No output of the history of the iterations. _, eigvec = lobpcg(XH_X, X, tol=tol ** 2, maxiter=maxiter, - + @@ -536,9 +536,9 @@ amplitude of the first mode: -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_complex_eof_001.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_complex_eof_001.png :alt: level = 200, level = 500, level = 850 - :srcset: /auto_examples/1single/images/sphx_glr_plot_complex_eof_001.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_complex_eof_001.png :class: sphx-glr-single-img @@ -565,9 +565,9 @@ where the amplitude is above a certain threshold (e.g., 0.004): -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_complex_eof_002.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_complex_eof_002.png :alt: level = 200, level = 500, level = 850 - :srcset: /auto_examples/1single/images/sphx_glr_plot_complex_eof_002.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_complex_eof_002.png :class: sphx-glr-single-img @@ -577,10 +577,10 @@ where the amplitude is above a certain threshold (e.g., 0.004): .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 1.162 seconds) + **Total running time of the script:** (0 minutes 1.180 seconds) -.. _sphx_glr_download_auto_examples_1single_plot_complex_eof.py: +.. _sphx_glr_download_content_user_guide_auto_examples_1single_plot_complex_eof.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/1single/plot_complex_eof_codeobj.pickle b/docs/content/user_guide/auto_examples/1single/plot_complex_eof_codeobj.pickle new file mode 100644 index 00000000..0f30e7cc Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/plot_complex_eof_codeobj.pickle differ diff --git a/docs/auto_examples/1single/plot_eeof.ipynb b/docs/content/user_guide/auto_examples/1single/plot_eeof.ipynb similarity index 100% rename from docs/auto_examples/1single/plot_eeof.ipynb rename to docs/content/user_guide/auto_examples/1single/plot_eeof.ipynb diff --git a/docs/auto_examples/1single/plot_eeof.py b/docs/content/user_guide/auto_examples/1single/plot_eeof.py similarity index 100% rename from docs/auto_examples/1single/plot_eeof.py rename to docs/content/user_guide/auto_examples/1single/plot_eeof.py diff --git a/docs/auto_examples/1single/plot_eeof.py.md5 b/docs/content/user_guide/auto_examples/1single/plot_eeof.py.md5 similarity index 100% rename from docs/auto_examples/1single/plot_eeof.py.md5 rename to docs/content/user_guide/auto_examples/1single/plot_eeof.py.md5 diff --git a/docs/auto_examples/1single/plot_eeof.rst b/docs/content/user_guide/auto_examples/1single/plot_eeof.rst similarity index 76% rename from docs/auto_examples/1single/plot_eeof.rst rename to docs/content/user_guide/auto_examples/1single/plot_eeof.rst index 4d381907..c1e3136b 100644 --- a/docs/auto_examples/1single/plot_eeof.rst +++ b/docs/content/user_guide/auto_examples/1single/plot_eeof.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/1single/plot_eeof.py" +.. "content/user_guide/auto_examples/1single/plot_eeof.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_1single_plot_eeof.py: +.. _sphx_glr_content_user_guide_auto_examples_1single_plot_eeof.py: Extented EOF analysis @@ -52,7 +52,7 @@ Let's begin by setting up the required packages and fetching the data: .. code-block:: none - + @@ -506,7 +506,7 @@ model and fit our data. fill: currentColor; }
    <xarray.DataArray 'components' (mode: 10, embedding: 40, lat: 25, lon: 53)>
    -    0.0003855 0.0003648 0.0003573 0.0003565 ... -0.001427 -0.001012 -0.0006065
    +    0.0003856 0.0003647 0.0003572 0.0003564 ... -0.001401 -0.0009889 -0.0005825
         Coordinates:
           * lat        (lat) float32 15.0 17.5 20.0 22.5 25.0 ... 67.5 70.0 72.5 75.0
           * lon        (lon) float32 200.0 202.5 205.0 207.5 ... 322.5 325.0 327.5 330.0
    @@ -516,7 +516,7 @@ model and fit our data.
             model:          Extended EOF Analysis
             software:       xeofs
             version:        1.2.0
    -        date:           2024-09-02 02:16:24
    +        date:           2024-09-04 15:05:13
             n_modes:        10
             center:         True
             ...             ...
    @@ -525,68 +525,68 @@ model and fit our data.
             random_state:   None
             compute:        True
             solver:         auto
    -        solver_kwargs:  {}
  • model :
    Extended EOF Analysis
    software :
    xeofs
    version :
    1.2.0
    date :
    2024-09-04 15:05:13
    n_modes :
    10
    center :
    True
    standardize :
    False
    use_coslat :
    True
    check_nans :
    True
    sample_name :
    sample
    feature_name :
    feature
    random_state :
    None
    compute :
    True
    solver :
    auto
    solver_kwargs :
    {}


  • @@ -609,9 +609,9 @@ for instance, can be assessed by examining the explained variance ratio. -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_eeof_001.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_001.png :alt: plot eeof - :srcset: /auto_examples/1single/images/sphx_glr_plot_eeof_001.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_001.png :class: sphx-glr-single-img @@ -633,9 +633,9 @@ Additionally, we can look into the scores; let's spotlight mode 4. -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_eeof_002.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_002.png :alt: mode = 4 - :srcset: /auto_examples/1single/images/sphx_glr_plot_eeof_002.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_002.png :class: sphx-glr-single-img @@ -658,9 +658,9 @@ latitude, in this instance, 60 degrees north. -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_eeof_003.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_003.png :alt: lat = 60.0, mode = 4 - :srcset: /auto_examples/1single/images/sphx_glr_plot_eeof_003.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_003.png :class: sphx-glr-single-img @@ -670,10 +670,10 @@ latitude, in this instance, 60 degrees north. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 5.099 seconds) + **Total running time of the script:** (0 minutes 2.568 seconds) -.. _sphx_glr_download_auto_examples_1single_plot_eeof.py: +.. _sphx_glr_download_content_user_guide_auto_examples_1single_plot_eeof.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/1single/plot_eeof_codeobj.pickle b/docs/content/user_guide/auto_examples/1single/plot_eeof_codeobj.pickle new file mode 100644 index 00000000..3205c564 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/plot_eeof_codeobj.pickle differ diff --git a/docs/auto_examples/1single/plot_eeof_trend.ipynb b/docs/content/user_guide/auto_examples/1single/plot_eeof_trend.ipynb similarity index 100% rename from docs/auto_examples/1single/plot_eeof_trend.ipynb rename to docs/content/user_guide/auto_examples/1single/plot_eeof_trend.ipynb diff --git a/docs/auto_examples/1single/plot_eeof_trend.py b/docs/content/user_guide/auto_examples/1single/plot_eeof_trend.py similarity index 100% rename from docs/auto_examples/1single/plot_eeof_trend.py rename to docs/content/user_guide/auto_examples/1single/plot_eeof_trend.py diff --git a/docs/auto_examples/1single/plot_eeof_trend.py.md5 b/docs/content/user_guide/auto_examples/1single/plot_eeof_trend.py.md5 similarity index 100% rename from docs/auto_examples/1single/plot_eeof_trend.py.md5 rename to docs/content/user_guide/auto_examples/1single/plot_eeof_trend.py.md5 diff --git a/docs/auto_examples/1single/plot_eeof_trend.rst b/docs/content/user_guide/auto_examples/1single/plot_eeof_trend.rst similarity index 81% rename from docs/auto_examples/1single/plot_eeof_trend.rst rename to docs/content/user_guide/auto_examples/1single/plot_eeof_trend.rst index b273263c..8da3de15 100644 --- a/docs/auto_examples/1single/plot_eeof_trend.rst +++ b/docs/content/user_guide/auto_examples/1single/plot_eeof_trend.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/1single/plot_eeof_trend.py" +.. "content/user_guide/auto_examples/1single/plot_eeof_trend.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_1single_plot_eeof_trend.py: +.. _sphx_glr_content_user_guide_auto_examples_1single_plot_eeof_trend.py: Removing nonlinear trends with EEOF analysis @@ -47,7 +47,7 @@ Let's begin by setting up the required packages and fetching the data. .. code-block:: none - + @@ -114,9 +114,9 @@ ENSO signatures into this mode. -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_eeof_trend_001.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_001.png :alt: mode = 1, mode = 1 - :srcset: /auto_examples/1single/images/sphx_glr_plot_eeof_trend_001.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_001.png :class: sphx-glr-single-img @@ -125,7 +125,7 @@ ENSO signatures into this mode. .. code-block:: none - + @@ -170,9 +170,9 @@ The first mode now represents the global warming trend much more clearly. -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_eeof_trend_002.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_002.png :alt: mode = 1, embedding = 0, mode = 1 - :srcset: /auto_examples/1single/images/sphx_glr_plot_eeof_trend_002.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_002.png :class: sphx-glr-single-img @@ -181,7 +181,7 @@ The first mode now represents the global warming trend much more clearly. .. code-block:: none - + @@ -244,9 +244,9 @@ The first mode now represents ENSO without any trend component. -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_eeof_trend_003.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_003.png :alt: mode = 1, mode = 1 - :srcset: /auto_examples/1single/images/sphx_glr_plot_eeof_trend_003.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eeof_trend_003.png :class: sphx-glr-single-img @@ -255,17 +255,17 @@ The first mode now represents ENSO without any trend component. .. code-block:: none - + .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 7.526 seconds) + **Total running time of the script:** (0 minutes 5.427 seconds) -.. _sphx_glr_download_auto_examples_1single_plot_eeof_trend.py: +.. _sphx_glr_download_content_user_guide_auto_examples_1single_plot_eeof_trend.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/1single/plot_eeof_trend_codeobj.pickle b/docs/content/user_guide/auto_examples/1single/plot_eeof_trend_codeobj.pickle new file mode 100644 index 00000000..3db904da Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/plot_eeof_trend_codeobj.pickle differ diff --git a/docs/auto_examples/1single/plot_eof-smode.ipynb b/docs/content/user_guide/auto_examples/1single/plot_eof-smode.ipynb similarity index 100% rename from docs/auto_examples/1single/plot_eof-smode.ipynb rename to docs/content/user_guide/auto_examples/1single/plot_eof-smode.ipynb diff --git a/docs/auto_examples/1single/plot_eof-smode.py b/docs/content/user_guide/auto_examples/1single/plot_eof-smode.py similarity index 100% rename from docs/auto_examples/1single/plot_eof-smode.py rename to docs/content/user_guide/auto_examples/1single/plot_eof-smode.py diff --git a/docs/auto_examples/1single/plot_eof-smode.py.md5 b/docs/content/user_guide/auto_examples/1single/plot_eof-smode.py.md5 similarity index 100% rename from docs/auto_examples/1single/plot_eof-smode.py.md5 rename to docs/content/user_guide/auto_examples/1single/plot_eof-smode.py.md5 diff --git a/docs/auto_examples/1single/plot_eof-smode.rst b/docs/content/user_guide/auto_examples/1single/plot_eof-smode.rst similarity index 87% rename from docs/auto_examples/1single/plot_eof-smode.rst rename to docs/content/user_guide/auto_examples/1single/plot_eof-smode.rst index c8012335..5d3c9b03 100644 --- a/docs/auto_examples/1single/plot_eof-smode.rst +++ b/docs/content/user_guide/auto_examples/1single/plot_eof-smode.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/1single/plot_eof-smode.py" +.. "content/user_guide/auto_examples/1single/plot_eof-smode.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_1single_plot_eof-smode.py: +.. _sphx_glr_content_user_guide_auto_examples_1single_plot_eof-smode.py: Sparse PCA @@ -111,7 +111,7 @@ The explained variance fraction confirms that the fourth mode explains about 1% .. code-block:: none - Explained variance: [34060. 1252. 963. 405.] + Explained variance: [34060. 1252. 963. 402.] Relative: [86. 3.2 2.4 1. ] @@ -147,9 +147,9 @@ Examining the first four modes, we clearly identify ENSO as the fourth mode. -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png :alt: mode = 1, mode = 2, mode = 3, mode = 4, mode = 1, mode = 2, mode = 3, mode = 4 - :srcset: /auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png :class: sphx-glr-single-img @@ -159,10 +159,10 @@ Examining the first four modes, we clearly identify ENSO as the fourth mode. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 7.551 seconds) + **Total running time of the script:** (0 minutes 7.744 seconds) -.. _sphx_glr_download_auto_examples_1single_plot_eof-smode.py: +.. _sphx_glr_download_content_user_guide_auto_examples_1single_plot_eof-smode.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/1single/plot_eof-smode_codeobj.pickle b/docs/content/user_guide/auto_examples/1single/plot_eof-smode_codeobj.pickle new file mode 100644 index 00000000..41229097 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/plot_eof-smode_codeobj.pickle differ diff --git a/docs/auto_examples/1single/plot_eof-tmode.ipynb b/docs/content/user_guide/auto_examples/1single/plot_eof-tmode.ipynb similarity index 100% rename from docs/auto_examples/1single/plot_eof-tmode.ipynb rename to docs/content/user_guide/auto_examples/1single/plot_eof-tmode.ipynb diff --git a/docs/auto_examples/1single/plot_eof-tmode.py b/docs/content/user_guide/auto_examples/1single/plot_eof-tmode.py similarity index 100% rename from docs/auto_examples/1single/plot_eof-tmode.py rename to docs/content/user_guide/auto_examples/1single/plot_eof-tmode.py diff --git a/docs/auto_examples/1single/plot_eof-tmode.py.md5 b/docs/content/user_guide/auto_examples/1single/plot_eof-tmode.py.md5 similarity index 100% rename from docs/auto_examples/1single/plot_eof-tmode.py.md5 rename to docs/content/user_guide/auto_examples/1single/plot_eof-tmode.py.md5 diff --git a/docs/auto_examples/1single/plot_eof-tmode.rst b/docs/content/user_guide/auto_examples/1single/plot_eof-tmode.rst similarity index 81% rename from docs/auto_examples/1single/plot_eof-tmode.rst rename to docs/content/user_guide/auto_examples/1single/plot_eof-tmode.rst index b0857bf6..e10b565c 100644 --- a/docs/auto_examples/1single/plot_eof-tmode.rst +++ b/docs/content/user_guide/auto_examples/1single/plot_eof-tmode.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/1single/plot_eof-tmode.py" +.. "content/user_guide/auto_examples/1single/plot_eof-tmode.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_1single_plot_eof-tmode.py: +.. _sphx_glr_content_user_guide_auto_examples_1single_plot_eof-tmode.py: EOF analysis (T-mode) @@ -97,9 +97,9 @@ Create figure showing the first two modes -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_eof-tmode_001.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eof-tmode_001.png :alt: mode = 1, mode = 2, mode = 3, mode = 1, mode = 2, mode = 3 - :srcset: /auto_examples/1single/images/sphx_glr_plot_eof-tmode_001.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_eof-tmode_001.png :class: sphx-glr-single-img @@ -109,10 +109,10 @@ Create figure showing the first two modes .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 3.854 seconds) + **Total running time of the script:** (0 minutes 3.533 seconds) -.. _sphx_glr_download_auto_examples_1single_plot_eof-tmode.py: +.. _sphx_glr_download_content_user_guide_auto_examples_1single_plot_eof-tmode.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/1single/plot_eof-tmode_codeobj.pickle b/docs/content/user_guide/auto_examples/1single/plot_eof-tmode_codeobj.pickle new file mode 100644 index 00000000..1661c979 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/plot_eof-tmode_codeobj.pickle differ diff --git a/docs/auto_examples/1single/plot_gwpca.ipynb b/docs/content/user_guide/auto_examples/1single/plot_gwpca.ipynb similarity index 100% rename from docs/auto_examples/1single/plot_gwpca.ipynb rename to docs/content/user_guide/auto_examples/1single/plot_gwpca.ipynb diff --git a/docs/auto_examples/1single/plot_gwpca.py b/docs/content/user_guide/auto_examples/1single/plot_gwpca.py similarity index 100% rename from docs/auto_examples/1single/plot_gwpca.py rename to docs/content/user_guide/auto_examples/1single/plot_gwpca.py diff --git a/docs/auto_examples/1single/plot_gwpca.py.md5 b/docs/content/user_guide/auto_examples/1single/plot_gwpca.py.md5 similarity index 100% rename from docs/auto_examples/1single/plot_gwpca.py.md5 rename to docs/content/user_guide/auto_examples/1single/plot_gwpca.py.md5 diff --git a/docs/auto_examples/1single/plot_gwpca.rst b/docs/content/user_guide/auto_examples/1single/plot_gwpca.rst similarity index 87% rename from docs/auto_examples/1single/plot_gwpca.rst rename to docs/content/user_guide/auto_examples/1single/plot_gwpca.rst index 35913c3a..c67fd258 100644 --- a/docs/auto_examples/1single/plot_gwpca.rst +++ b/docs/content/user_guide/auto_examples/1single/plot_gwpca.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/1single/plot_gwpca.py" +.. "content/user_guide/auto_examples/1single/plot_gwpca.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_1single_plot_gwpca.py: +.. _sphx_glr_content_user_guide_auto_examples_1single_plot_gwpca.py: Geographically weighted PCA @@ -162,7 +162,7 @@ using the `rpy2 `_ package. R[write to console]: R[write to console]: The downloaded source packages are in - ‘/tmp/RtmpRG5HUi/downloaded_packages’ + ‘/tmp/RtmpHyr0o2/downloaded_packages’ R[write to console]: R[write to console]: @@ -172,7 +172,7 @@ using the `rpy2 `_ package. R[write to console]: done - [0] + [0] @@ -738,16 +738,16 @@ Since ``xeofs`` uses ``xarray``, we convert the data into an ``xarray.DataArray` * station (station) object MultiIndex * x (station) float64 -6.197e+05 2.147e+05 ... -2.82e+05 -1.273e+05 * y (station) float64 6.805e+06 7.746e+06 ... 5.796e+06 6.523e+06 - * element (element) object 'SiO2_T' 'TiO2_T' 'Al2O3_T' ... 'K2O_T' 'P2O5_T'


  • @@ -1184,7 +1184,7 @@ for the chemical elements. * station (station) object MultiIndex * x (station) float64 -6.197e+05 2.147e+05 ... -2.82e+05 -1.273e+05 * y (station) float64 6.805e+06 7.746e+06 ... 5.796e+06 6.523e+06 - Attributes: (15)
  • model :
    GWPCA
    software :
    xeofs
    version :
    1.2.0
    date :
    2024-09-04 15:06:08
    n_modes :
    5
    center :
    True
    standardize :
    True
    use_coslat :
    False
    check_nans :
    True
    sample_name :
    sample
    feature_name :
    feature
    random_state :
    None
    compute :
    True
    solver :
    auto
    solver_kwargs :
    {}


  • @@ -1648,14 +1648,14 @@ dominate the local PCAs. * mode (mode) int64 1 2 3 4 5 * station (station) object MultiIndex * x (station) float64 -6.197e+05 2.147e+05 ... -2.82e+05 -1.273e+05 - * y (station) float64 6.805e+06 7.746e+06 ... 5.796e+06 6.523e+06


  • @@ -1727,9 +1727,9 @@ For demonstation, we'll concentrate on the first mode: -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_gwpca_001.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_gwpca_001.png :alt: Largest locally weighted element - :srcset: /auto_examples/1single/images/sphx_glr_plot_gwpca_001.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_gwpca_001.png :class: sphx-glr-single-img @@ -1764,9 +1764,9 @@ roughly 40% to 70%. -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_gwpca_002.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_gwpca_002.png :alt: Fraction of locally explained variance - :srcset: /auto_examples/1single/images/sphx_glr_plot_gwpca_002.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_gwpca_002.png :class: sphx-glr-single-img @@ -1776,10 +1776,10 @@ roughly 40% to 70%. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 39.918 seconds) + **Total running time of the script:** (0 minutes 27.897 seconds) -.. _sphx_glr_download_auto_examples_1single_plot_gwpca.py: +.. _sphx_glr_download_content_user_guide_auto_examples_1single_plot_gwpca.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/1single/plot_gwpca_codeobj.pickle b/docs/content/user_guide/auto_examples/1single/plot_gwpca_codeobj.pickle new file mode 100644 index 00000000..e18ce91b Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/plot_gwpca_codeobj.pickle differ diff --git a/docs/auto_examples/1single/plot_hilbert_eof.ipynb b/docs/content/user_guide/auto_examples/1single/plot_hilbert_eof.ipynb similarity index 100% rename from docs/auto_examples/1single/plot_hilbert_eof.ipynb rename to docs/content/user_guide/auto_examples/1single/plot_hilbert_eof.ipynb diff --git a/docs/auto_examples/1single/plot_hilbert_eof.py b/docs/content/user_guide/auto_examples/1single/plot_hilbert_eof.py similarity index 100% rename from docs/auto_examples/1single/plot_hilbert_eof.py rename to docs/content/user_guide/auto_examples/1single/plot_hilbert_eof.py diff --git a/docs/auto_examples/1single/plot_hilbert_eof.py.md5 b/docs/content/user_guide/auto_examples/1single/plot_hilbert_eof.py.md5 similarity index 100% rename from docs/auto_examples/1single/plot_hilbert_eof.py.md5 rename to docs/content/user_guide/auto_examples/1single/plot_hilbert_eof.py.md5 diff --git a/docs/auto_examples/1single/plot_hilbert_eof.rst b/docs/content/user_guide/auto_examples/1single/plot_hilbert_eof.rst similarity index 88% rename from docs/auto_examples/1single/plot_hilbert_eof.rst rename to docs/content/user_guide/auto_examples/1single/plot_hilbert_eof.rst index ddcf5a25..157a0609 100644 --- a/docs/auto_examples/1single/plot_hilbert_eof.rst +++ b/docs/content/user_guide/auto_examples/1single/plot_hilbert_eof.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/1single/plot_hilbert_eof.py" +.. "content/user_guide/auto_examples/1single/plot_hilbert_eof.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_1single_plot_hilbert_eof.py: +.. _sphx_glr_content_user_guide_auto_examples_1single_plot_hilbert_eof.py: Hilbert EOF analysis @@ -435,14 +435,14 @@ Let's start by importing the necessary packages and loading the data: * lat (lat) float32 88.0 86.0 84.0 82.0 80.0 ... -82.0 -84.0 -86.0 -88.0 * lon (lon) float32 0.0 2.0 4.0 6.0 8.0 ... 350.0 352.0 354.0 356.0 358.0 * time (time) datetime64[ns] 1970-01-01 1970-02-01 ... 2021-12-01 - Attributes: (9)
  • long_name :
    Monthly Means of Sea Surface Temperature
    units :
    degC
    var_desc :
    Sea Surface Temperature
    level_desc :
    Surface
    statistic :
    Mean
    dataset :
    NOAA Extended Reconstructed SST V5
    parent_stat :
    Individual Values
    actual_range :
    [-1.8 42.32636]
    valid_range :
    [-1.8 45. ]


  • @@ -914,7 +914,7 @@ Let's have a look at the explained variance of the first five modes: 5.069e+04 1.705e+03 1.105e+03 519.0 Coordinates: * mode (mode) int64 1 2 3 4 - Attributes: (15) + Attributes: (15)

    @@ -1307,7 +1307,7 @@ variance, we see that the first mode explains about 88.8 %. 88.8 3.0 1.9 0.9 Coordinates: * mode (mode) int64 1 2 3 4 - Attributes: (15) + Attributes: (15)

    @@ -1334,9 +1334,9 @@ hypothesis by looking at the real part the complex-valued scores: -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_hilbert_eof_001.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_001.png :alt: mode = 1, mode = 2, mode = 3, mode = 4 - :srcset: /auto_examples/1single/images/sphx_glr_plot_hilbert_eof_001.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_001.png :class: sphx-glr-single-img @@ -1374,9 +1374,9 @@ the time series length. Let's see how the decay parameter impacts the results: -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_hilbert_eof_002.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_002.png :alt: mode = 1, mode = 2, mode = 3, mode = 4 - :srcset: /auto_examples/1single/images/sphx_glr_plot_hilbert_eof_002.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_002.png :class: sphx-glr-single-img @@ -1400,9 +1400,9 @@ boundaries. Lastly, we examine the complex component amplitudes and phases. -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_hilbert_eof_003.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_003.png :alt: mode = 1, mode = 2, mode = 3, mode = 4 - :srcset: /auto_examples/1single/images/sphx_glr_plot_hilbert_eof_003.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_003.png :class: sphx-glr-single-img @@ -1429,9 +1429,9 @@ This is in agreement with mode 3 of the standard EOF analysis. -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_hilbert_eof_004.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_004.png :alt: mode = 1, mode = 2, mode = 3, mode = 4 - :srcset: /auto_examples/1single/images/sphx_glr_plot_hilbert_eof_004.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_hilbert_eof_004.png :class: sphx-glr-single-img @@ -1441,10 +1441,10 @@ This is in agreement with mode 3 of the standard EOF analysis. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 8.098 seconds) + **Total running time of the script:** (0 minutes 5.033 seconds) -.. _sphx_glr_download_auto_examples_1single_plot_hilbert_eof.py: +.. _sphx_glr_download_content_user_guide_auto_examples_1single_plot_hilbert_eof.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/1single/plot_hilbert_eof_codeobj.pickle b/docs/content/user_guide/auto_examples/1single/plot_hilbert_eof_codeobj.pickle new file mode 100644 index 00000000..735204c5 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/plot_hilbert_eof_codeobj.pickle differ diff --git a/docs/auto_examples/1single/plot_mreof.ipynb b/docs/content/user_guide/auto_examples/1single/plot_mreof.ipynb similarity index 100% rename from docs/auto_examples/1single/plot_mreof.ipynb rename to docs/content/user_guide/auto_examples/1single/plot_mreof.ipynb diff --git a/docs/auto_examples/1single/plot_mreof.py b/docs/content/user_guide/auto_examples/1single/plot_mreof.py similarity index 100% rename from docs/auto_examples/1single/plot_mreof.py rename to docs/content/user_guide/auto_examples/1single/plot_mreof.py diff --git a/docs/auto_examples/1single/plot_mreof.py.md5 b/docs/content/user_guide/auto_examples/1single/plot_mreof.py.md5 similarity index 100% rename from docs/auto_examples/1single/plot_mreof.py.md5 rename to docs/content/user_guide/auto_examples/1single/plot_mreof.py.md5 diff --git a/docs/auto_examples/1single/plot_mreof.rst b/docs/content/user_guide/auto_examples/1single/plot_mreof.rst similarity index 85% rename from docs/auto_examples/1single/plot_mreof.rst rename to docs/content/user_guide/auto_examples/1single/plot_mreof.rst index f8dcd602..b8839f69 100644 --- a/docs/auto_examples/1single/plot_mreof.rst +++ b/docs/content/user_guide/auto_examples/1single/plot_mreof.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/1single/plot_mreof.py" +.. "content/user_guide/auto_examples/1single/plot_mreof.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_1single_plot_mreof.py: +.. _sphx_glr_content_user_guide_auto_examples_1single_plot_mreof.py: Varimax-rotated Multivariate EOF analysis @@ -133,9 +133,9 @@ Plot mode 1 -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_mreof_001.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_mreof_001.png :alt: Mode 5, Subset 1, Subset 2, Subset 3, Subset 4 - :srcset: /auto_examples/1single/images/sphx_glr_plot_mreof_001.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_mreof_001.png :class: sphx-glr-single-img @@ -145,10 +145,10 @@ Plot mode 1 .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 3.255 seconds) + **Total running time of the script:** (0 minutes 3.133 seconds) -.. _sphx_glr_download_auto_examples_1single_plot_mreof.py: +.. _sphx_glr_download_content_user_guide_auto_examples_1single_plot_mreof.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/1single/plot_mreof_codeobj.pickle b/docs/content/user_guide/auto_examples/1single/plot_mreof_codeobj.pickle new file mode 100644 index 00000000..5ad43673 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/plot_mreof_codeobj.pickle differ diff --git a/docs/auto_examples/1single/plot_multivariate-eof.ipynb b/docs/content/user_guide/auto_examples/1single/plot_multivariate-eof.ipynb similarity index 100% rename from docs/auto_examples/1single/plot_multivariate-eof.ipynb rename to docs/content/user_guide/auto_examples/1single/plot_multivariate-eof.ipynb diff --git a/docs/auto_examples/1single/plot_multivariate-eof.py b/docs/content/user_guide/auto_examples/1single/plot_multivariate-eof.py similarity index 100% rename from docs/auto_examples/1single/plot_multivariate-eof.py rename to docs/content/user_guide/auto_examples/1single/plot_multivariate-eof.py diff --git a/docs/auto_examples/1single/plot_multivariate-eof.py.md5 b/docs/content/user_guide/auto_examples/1single/plot_multivariate-eof.py.md5 similarity index 100% rename from docs/auto_examples/1single/plot_multivariate-eof.py.md5 rename to docs/content/user_guide/auto_examples/1single/plot_multivariate-eof.py.md5 diff --git a/docs/auto_examples/1single/plot_multivariate-eof.rst b/docs/content/user_guide/auto_examples/1single/plot_multivariate-eof.rst similarity index 83% rename from docs/auto_examples/1single/plot_multivariate-eof.rst rename to docs/content/user_guide/auto_examples/1single/plot_multivariate-eof.rst index 0af5e513..9f1681e1 100644 --- a/docs/auto_examples/1single/plot_multivariate-eof.rst +++ b/docs/content/user_guide/auto_examples/1single/plot_multivariate-eof.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/1single/plot_multivariate-eof.py" +.. "content/user_guide/auto_examples/1single/plot_multivariate-eof.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_1single_plot_multivariate-eof.py: +.. _sphx_glr_content_user_guide_auto_examples_1single_plot_multivariate-eof.py: Multivariate EOF analysis @@ -117,9 +117,9 @@ Plot mode 1 -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_multivariate-eof_001.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_multivariate-eof_001.png :alt: Mode 5, Subset 1, Subset 2, Subset 3, Subset 4 - :srcset: /auto_examples/1single/images/sphx_glr_plot_multivariate-eof_001.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_multivariate-eof_001.png :class: sphx-glr-single-img @@ -129,10 +129,10 @@ Plot mode 1 .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 2.083 seconds) + **Total running time of the script:** (0 minutes 1.944 seconds) -.. _sphx_glr_download_auto_examples_1single_plot_multivariate-eof.py: +.. _sphx_glr_download_content_user_guide_auto_examples_1single_plot_multivariate-eof.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/1single/plot_multivariate-eof_codeobj.pickle b/docs/content/user_guide/auto_examples/1single/plot_multivariate-eof_codeobj.pickle new file mode 100644 index 00000000..6ee03494 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/plot_multivariate-eof_codeobj.pickle differ diff --git a/docs/auto_examples/1single/plot_rotated_eof.ipynb b/docs/content/user_guide/auto_examples/1single/plot_rotated_eof.ipynb similarity index 100% rename from docs/auto_examples/1single/plot_rotated_eof.ipynb rename to docs/content/user_guide/auto_examples/1single/plot_rotated_eof.ipynb diff --git a/docs/auto_examples/1single/plot_rotated_eof.py b/docs/content/user_guide/auto_examples/1single/plot_rotated_eof.py similarity index 100% rename from docs/auto_examples/1single/plot_rotated_eof.py rename to docs/content/user_guide/auto_examples/1single/plot_rotated_eof.py diff --git a/docs/auto_examples/1single/plot_rotated_eof.py.md5 b/docs/content/user_guide/auto_examples/1single/plot_rotated_eof.py.md5 similarity index 100% rename from docs/auto_examples/1single/plot_rotated_eof.py.md5 rename to docs/content/user_guide/auto_examples/1single/plot_rotated_eof.py.md5 diff --git a/docs/auto_examples/1single/plot_rotated_eof.rst b/docs/content/user_guide/auto_examples/1single/plot_rotated_eof.rst similarity index 89% rename from docs/auto_examples/1single/plot_rotated_eof.rst rename to docs/content/user_guide/auto_examples/1single/plot_rotated_eof.rst index 89024f93..63f9f531 100644 --- a/docs/auto_examples/1single/plot_rotated_eof.rst +++ b/docs/content/user_guide/auto_examples/1single/plot_rotated_eof.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/1single/plot_rotated_eof.py" +.. "content/user_guide/auto_examples/1single/plot_rotated_eof.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_1single_plot_rotated_eof.py: +.. _sphx_glr_content_user_guide_auto_examples_1single_plot_rotated_eof.py: Rotated EOF analysis @@ -147,9 +147,9 @@ were mere artifacts due to the orthogonality. -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_rotated_eof_001.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_rotated_eof_001.png :alt: mode = 1, mode = 2, mode = 3, mode = 4, mode = 1, mode = 2, mode = 3, mode = 4, mode = 1, mode = 2, mode = 3, mode = 4 - :srcset: /auto_examples/1single/images/sphx_glr_plot_rotated_eof_001.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_rotated_eof_001.png :class: sphx-glr-single-img @@ -159,10 +159,10 @@ were mere artifacts due to the orthogonality. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 11.973 seconds) + **Total running time of the script:** (0 minutes 13.936 seconds) -.. _sphx_glr_download_auto_examples_1single_plot_rotated_eof.py: +.. _sphx_glr_download_content_user_guide_auto_examples_1single_plot_rotated_eof.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/1single/plot_rotated_eof_codeobj.pickle b/docs/content/user_guide/auto_examples/1single/plot_rotated_eof_codeobj.pickle new file mode 100644 index 00000000..8b5743a2 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/plot_rotated_eof_codeobj.pickle differ diff --git a/docs/auto_examples/1single/plot_weighted-eof.ipynb b/docs/content/user_guide/auto_examples/1single/plot_weighted-eof.ipynb similarity index 100% rename from docs/auto_examples/1single/plot_weighted-eof.ipynb rename to docs/content/user_guide/auto_examples/1single/plot_weighted-eof.ipynb diff --git a/docs/auto_examples/1single/plot_weighted-eof.py b/docs/content/user_guide/auto_examples/1single/plot_weighted-eof.py similarity index 100% rename from docs/auto_examples/1single/plot_weighted-eof.py rename to docs/content/user_guide/auto_examples/1single/plot_weighted-eof.py diff --git a/docs/auto_examples/1single/plot_weighted-eof.py.md5 b/docs/content/user_guide/auto_examples/1single/plot_weighted-eof.py.md5 similarity index 100% rename from docs/auto_examples/1single/plot_weighted-eof.py.md5 rename to docs/content/user_guide/auto_examples/1single/plot_weighted-eof.py.md5 diff --git a/docs/auto_examples/1single/plot_weighted-eof.rst b/docs/content/user_guide/auto_examples/1single/plot_weighted-eof.rst similarity index 87% rename from docs/auto_examples/1single/plot_weighted-eof.rst rename to docs/content/user_guide/auto_examples/1single/plot_weighted-eof.rst index 0cb3b794..844e8b51 100644 --- a/docs/auto_examples/1single/plot_weighted-eof.rst +++ b/docs/content/user_guide/auto_examples/1single/plot_weighted-eof.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/1single/plot_weighted-eof.py" +.. "content/user_guide/auto_examples/1single/plot_weighted-eof.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_1single_plot_weighted-eof.py: +.. _sphx_glr_content_user_guide_auto_examples_1single_plot_weighted-eof.py: Weighted EOF analysis @@ -138,9 +138,9 @@ Create figure showing the first mode for all 4 cases -.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_weighted-eof_001.png +.. image-sg:: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_weighted-eof_001.png :alt: (1) Covariances, (2) Covariances + coslat, (3) Correlation, (4) Correlation + coslat - :srcset: /auto_examples/1single/images/sphx_glr_plot_weighted-eof_001.png + :srcset: /content/user_guide/auto_examples/1single/images/sphx_glr_plot_weighted-eof_001.png :class: sphx-glr-single-img @@ -150,10 +150,10 @@ Create figure showing the first mode for all 4 cases .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 2.990 seconds) + **Total running time of the script:** (0 minutes 3.451 seconds) -.. _sphx_glr_download_auto_examples_1single_plot_weighted-eof.py: +.. _sphx_glr_download_content_user_guide_auto_examples_1single_plot_weighted-eof.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/1single/plot_weighted-eof_codeobj.pickle b/docs/content/user_guide/auto_examples/1single/plot_weighted-eof_codeobj.pickle new file mode 100644 index 00000000..0ccb93d3 Binary files /dev/null and b/docs/content/user_guide/auto_examples/1single/plot_weighted-eof_codeobj.pickle differ diff --git a/docs/content/user_guide/auto_examples/1single/sg_execution_times.rst b/docs/content/user_guide/auto_examples/1single/sg_execution_times.rst new file mode 100644 index 00000000..fae3f27e --- /dev/null +++ b/docs/content/user_guide/auto_examples/1single/sg_execution_times.rst @@ -0,0 +1,33 @@ + +:orphan: + +.. _sphx_glr_content_user_guide_auto_examples_1single_sg_execution_times: + + +Computation times +================= +**01:15.845** total execution time for **content_user_guide_auto_examples_1single** files: + ++------------------------------------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_gwpca.py` (``plot_gwpca.py``) | 00:27.897 | 0.0 MB | ++------------------------------------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_rotated_eof.py` (``plot_rotated_eof.py``) | 00:13.936 | 0.0 MB | ++------------------------------------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_eof-smode.py` (``plot_eof-smode.py``) | 00:07.744 | 0.0 MB | ++------------------------------------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_eeof_trend.py` (``plot_eeof_trend.py``) | 00:05.427 | 0.0 MB | ++------------------------------------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_hilbert_eof.py` (``plot_hilbert_eof.py``) | 00:05.033 | 0.0 MB | ++------------------------------------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_eof-tmode.py` (``plot_eof-tmode.py``) | 00:03.533 | 0.0 MB | ++------------------------------------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_weighted-eof.py` (``plot_weighted-eof.py``) | 00:03.451 | 0.0 MB | ++------------------------------------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_mreof.py` (``plot_mreof.py``) | 00:03.133 | 0.0 MB | ++------------------------------------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_eeof.py` (``plot_eeof.py``) | 00:02.568 | 0.0 MB | ++------------------------------------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_multivariate-eof.py` (``plot_multivariate-eof.py``) | 00:01.944 | 0.0 MB | ++------------------------------------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_1single_plot_complex_eof.py` (``plot_complex_eof.py``) | 00:01.180 | 0.0 MB | ++------------------------------------------------------------------------------------------------------------------+-----------+--------+ diff --git a/docs/auto_examples/2cross/images/sphx_glr_plot_mca_001.png b/docs/content/user_guide/auto_examples/2cross/images/sphx_glr_plot_mca_001.png similarity index 90% rename from docs/auto_examples/2cross/images/sphx_glr_plot_mca_001.png rename to docs/content/user_guide/auto_examples/2cross/images/sphx_glr_plot_mca_001.png index 2c5ee20e..064d5ff4 100644 Binary files a/docs/auto_examples/2cross/images/sphx_glr_plot_mca_001.png and b/docs/content/user_guide/auto_examples/2cross/images/sphx_glr_plot_mca_001.png differ diff --git a/docs/auto_examples/2cross/images/sphx_glr_plot_rotated_mca_001.png b/docs/content/user_guide/auto_examples/2cross/images/sphx_glr_plot_rotated_mca_001.png similarity index 90% rename from docs/auto_examples/2cross/images/sphx_glr_plot_rotated_mca_001.png rename to docs/content/user_guide/auto_examples/2cross/images/sphx_glr_plot_rotated_mca_001.png index e7ea9017..d93eb229 100644 Binary files a/docs/auto_examples/2cross/images/sphx_glr_plot_rotated_mca_001.png and b/docs/content/user_guide/auto_examples/2cross/images/sphx_glr_plot_rotated_mca_001.png differ diff --git a/docs/auto_examples/2cross/images/thumb/sphx_glr_plot_mca_thumb.png b/docs/content/user_guide/auto_examples/2cross/images/thumb/sphx_glr_plot_mca_thumb.png similarity index 100% rename from docs/auto_examples/2cross/images/thumb/sphx_glr_plot_mca_thumb.png rename to docs/content/user_guide/auto_examples/2cross/images/thumb/sphx_glr_plot_mca_thumb.png diff --git a/docs/auto_examples/2cross/images/thumb/sphx_glr_plot_rotated_mca_thumb.png b/docs/content/user_guide/auto_examples/2cross/images/thumb/sphx_glr_plot_rotated_mca_thumb.png similarity index 82% rename from docs/auto_examples/2cross/images/thumb/sphx_glr_plot_rotated_mca_thumb.png rename to docs/content/user_guide/auto_examples/2cross/images/thumb/sphx_glr_plot_rotated_mca_thumb.png index 8d6dc8db..aad95014 100644 Binary files a/docs/auto_examples/2cross/images/thumb/sphx_glr_plot_rotated_mca_thumb.png and b/docs/content/user_guide/auto_examples/2cross/images/thumb/sphx_glr_plot_rotated_mca_thumb.png differ diff --git a/docs/auto_examples/2cross/index.rst b/docs/content/user_guide/auto_examples/2cross/index.rst similarity index 57% rename from docs/auto_examples/2cross/index.rst rename to docs/content/user_guide/auto_examples/2cross/index.rst index 7400c8e6..17d782de 100644 --- a/docs/auto_examples/2cross/index.rst +++ b/docs/content/user_guide/auto_examples/2cross/index.rst @@ -1,6 +1,6 @@ -.. _sphx_glr_auto_examples_2cross: +.. _sphx_glr_content_user_guide_auto_examples_2cross: 2 | Cross-Set Analysis ======================== @@ -18,10 +18,10 @@ .. only:: html - .. image:: /auto_examples/2cross/images/thumb/sphx_glr_plot_mca_thumb.png + .. image:: /content/user_guide/auto_examples/2cross/images/thumb/sphx_glr_plot_mca_thumb.png :alt: - :ref:`sphx_glr_auto_examples_2cross_plot_mca.py` + :ref:`sphx_glr_content_user_guide_auto_examples_2cross_plot_mca.py` .. raw:: html @@ -35,10 +35,10 @@ .. only:: html - .. image:: /auto_examples/2cross/images/thumb/sphx_glr_plot_rotated_mca_thumb.png + .. image:: /content/user_guide/auto_examples/2cross/images/thumb/sphx_glr_plot_rotated_mca_thumb.png :alt: - :ref:`sphx_glr_auto_examples_2cross_plot_rotated_mca.py` + :ref:`sphx_glr_content_user_guide_auto_examples_2cross_plot_rotated_mca.py` .. raw:: html @@ -54,6 +54,6 @@ .. toctree:: :hidden: - /auto_examples/2cross/plot_mca - /auto_examples/2cross/plot_rotated_mca + /content/user_guide/auto_examples/2cross/plot_mca + /content/user_guide/auto_examples/2cross/plot_rotated_mca diff --git a/docs/auto_examples/2cross/plot_mca.ipynb b/docs/content/user_guide/auto_examples/2cross/plot_mca.ipynb similarity index 100% rename from docs/auto_examples/2cross/plot_mca.ipynb rename to docs/content/user_guide/auto_examples/2cross/plot_mca.ipynb diff --git a/docs/auto_examples/2cross/plot_mca.py b/docs/content/user_guide/auto_examples/2cross/plot_mca.py similarity index 100% rename from docs/auto_examples/2cross/plot_mca.py rename to docs/content/user_guide/auto_examples/2cross/plot_mca.py diff --git a/docs/auto_examples/2cross/plot_mca.py.md5 b/docs/content/user_guide/auto_examples/2cross/plot_mca.py.md5 similarity index 100% rename from docs/auto_examples/2cross/plot_mca.py.md5 rename to docs/content/user_guide/auto_examples/2cross/plot_mca.py.md5 diff --git a/docs/auto_examples/2multi/plot_mca.rst b/docs/content/user_guide/auto_examples/2cross/plot_mca.rst similarity index 76% rename from docs/auto_examples/2multi/plot_mca.rst rename to docs/content/user_guide/auto_examples/2cross/plot_mca.rst index ec378a1f..c1f1c88b 100644 --- a/docs/auto_examples/2multi/plot_mca.rst +++ b/docs/content/user_guide/auto_examples/2cross/plot_mca.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/2multi/plot_mca.py" +.. "content/user_guide/auto_examples/2cross/plot_mca.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_2multi_plot_mca.py: +.. _sphx_glr_content_user_guide_auto_examples_2cross_plot_mca.py: Maximum Covariance Analysis @@ -86,7 +86,7 @@ Perform MCA .. code-block:: none - + @@ -499,30 +499,17 @@ for the homogeneous patterns of ``X`` are: }
    <xarray.DataArray 'pvalues_of_left_homogeneous_patterns' (mode: 20, lat: 25,
                                                                   lon: 26)>
    -    0.0 3.288e-290 2.871e-286 1.598e-271 ... 0.04189 0.08527 0.1659 0.2852
    +    0.0 3.277e-290 2.858e-286 1.574e-271 ... 0.04195 0.08527 0.1658 0.2847
         Coordinates:
           * lat      (lat) float32 15.0 17.5 20.0 22.5 25.0 ... 65.0 67.5 70.0 72.5 75.0
           * lon      (lon) float32 200.0 202.5 205.0 207.5 ... 255.0 257.5 260.0 262.5
           * mode     (mode) int64 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
    -    Attributes: (12/18)
    -        model:                    Maximum Covariance Analysis
    -        software:                 xeofs
    -        version:                  1.2.0
    -        date:                     2024-09-02 02:30:55
    -        n_modes:                  20
    -        center:                   ['True', 'True']
    -        ...                       ...
    -        alpha:                    [1.0, 1.0]
    -        sample_name:              sample
    -        feature_name:             ['feature1', 'feature2']
    -        random_state:             None
    -        compute:                  True
    -        solver:                   auto
  • model :
    Maximum Covariance Analysis
    software :
    xeofs
    version :
    1.2.0
    date :
    2024-09-04 15:06:30
    n_modes :
    20
    center :
    ['True', 'True']
    standardize :
    ['False', 'False']
    use_coslat :
    ['True', 'True']
    check_nans :
    ['True', 'True']
    use_pca :
    ['True', 'True']
    n_pca_modes :
    [0.999, 0.999]
    pca_init_rank_reduction :
    [0.3, 0.3]
    alpha :
    [1.0, 1.0]
    sample_name :
    sample
    feature_name :
    ['feature1', 'feature2']
    random_state :
    None
    compute :
    True
    solver :
    auto


  • @@ -660,9 +647,9 @@ Plot some relevant quantities of mode 2. -.. image-sg:: /auto_examples/2multi/images/sphx_glr_plot_mca_001.png +.. image-sg:: /content/user_guide/auto_examples/2cross/images/sphx_glr_plot_mca_001.png :alt: mode = 2, mode = 2, mode = 2, mode = 2, mode = 2, mode = 2, mode = 2, mode = 2 - :srcset: /auto_examples/2multi/images/sphx_glr_plot_mca_001.png + :srcset: /content/user_guide/auto_examples/2cross/images/sphx_glr_plot_mca_001.png :class: sphx-glr-single-img @@ -672,10 +659,10 @@ Plot some relevant quantities of mode 2. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 8.251 seconds) + **Total running time of the script:** (0 minutes 6.057 seconds) -.. _sphx_glr_download_auto_examples_2multi_plot_mca.py: +.. _sphx_glr_download_content_user_guide_auto_examples_2cross_plot_mca.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/2cross/plot_mca_codeobj.pickle b/docs/content/user_guide/auto_examples/2cross/plot_mca_codeobj.pickle new file mode 100644 index 00000000..7eccb3b0 Binary files /dev/null and b/docs/content/user_guide/auto_examples/2cross/plot_mca_codeobj.pickle differ diff --git a/docs/auto_examples/2cross/plot_rotated_mca.ipynb b/docs/content/user_guide/auto_examples/2cross/plot_rotated_mca.ipynb similarity index 100% rename from docs/auto_examples/2cross/plot_rotated_mca.ipynb rename to docs/content/user_guide/auto_examples/2cross/plot_rotated_mca.ipynb diff --git a/docs/auto_examples/2cross/plot_rotated_mca.py b/docs/content/user_guide/auto_examples/2cross/plot_rotated_mca.py similarity index 100% rename from docs/auto_examples/2cross/plot_rotated_mca.py rename to docs/content/user_guide/auto_examples/2cross/plot_rotated_mca.py diff --git a/docs/auto_examples/2cross/plot_rotated_mca.py.md5 b/docs/content/user_guide/auto_examples/2cross/plot_rotated_mca.py.md5 similarity index 100% rename from docs/auto_examples/2cross/plot_rotated_mca.py.md5 rename to docs/content/user_guide/auto_examples/2cross/plot_rotated_mca.py.md5 diff --git a/docs/auto_examples/2multi/plot_rotated_mca.rst b/docs/content/user_guide/auto_examples/2cross/plot_rotated_mca.rst similarity index 74% rename from docs/auto_examples/2multi/plot_rotated_mca.rst rename to docs/content/user_guide/auto_examples/2cross/plot_rotated_mca.rst index 8036b097..88382c29 100644 --- a/docs/auto_examples/2multi/plot_rotated_mca.rst +++ b/docs/content/user_guide/auto_examples/2cross/plot_rotated_mca.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/2multi/plot_rotated_mca.py" +.. "content/user_guide/auto_examples/2cross/plot_rotated_mca.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_2multi_plot_rotated_mca.py: +.. _sphx_glr_content_user_guide_auto_examples_2cross_plot_rotated_mca.py: Rotated Maximum Covariance Analysis @@ -86,7 +86,7 @@ Perform MCA .. code-block:: none - + @@ -111,7 +111,7 @@ Apply Varimax-rotation to MCA solution .. code-block:: none - + @@ -524,26 +524,17 @@ for the homogeneous patterns of ``X`` are: }
    <xarray.DataArray 'pvalues_of_left_homogeneous_patterns' (mode: 10, lat: 25,
                                                                   lon: 26)>
    -    1.551e-89 1.547e-68 7.776e-62 2.972e-52 ... 0.002105 0.005704 0.01526 0.03629
    +    1.562e-89 1.552e-68 7.788e-62 2.969e-52 ... 0.002105 0.005704 0.01526 0.03629
         Coordinates:
           * lat      (lat) float32 15.0 17.5 20.0 22.5 25.0 ... 65.0 67.5 70.0 72.5 75.0
           * lon      (lon) float32 200.0 202.5 205.0 207.5 ... 255.0 257.5 260.0 262.5
           * mode     (mode) int64 1 2 3 4 5 6 7 8 9 10
    -    Attributes:
    -        model:     Rotated MCA
    -        software:  xeofs
    -        version:   1.2.0
    -        date:      2024-09-02 02:31:13
    -        n_modes:   10
    -        power:     1
    -        max_iter:  1000
    -        rtol:      1e-08
    -        compute:   True
  • model :
    Rotated MCA
    software :
    xeofs
    version :
    1.2.0
    date :
    2024-09-04 15:06:39
    n_modes :
    10
    power :
    1
    max_iter :
    1000
    rtol :
    1e-08
    compute :
    True


  • @@ -680,9 +671,9 @@ Plot some relevant quantities of mode 2. -.. image-sg:: /auto_examples/2multi/images/sphx_glr_plot_rotated_mca_001.png +.. image-sg:: /content/user_guide/auto_examples/2cross/images/sphx_glr_plot_rotated_mca_001.png :alt: mode = 2, mode = 2, mode = 2, mode = 2, mode = 2, mode = 2, mode = 2, mode = 2 - :srcset: /auto_examples/2multi/images/sphx_glr_plot_rotated_mca_001.png + :srcset: /content/user_guide/auto_examples/2cross/images/sphx_glr_plot_rotated_mca_001.png :class: sphx-glr-single-img @@ -692,10 +683,10 @@ Plot some relevant quantities of mode 2. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 13.021 seconds) + **Total running time of the script:** (0 minutes 4.585 seconds) -.. _sphx_glr_download_auto_examples_2multi_plot_rotated_mca.py: +.. _sphx_glr_download_content_user_guide_auto_examples_2cross_plot_rotated_mca.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/2cross/plot_rotated_mca_codeobj.pickle b/docs/content/user_guide/auto_examples/2cross/plot_rotated_mca_codeobj.pickle new file mode 100644 index 00000000..6261a9b1 Binary files /dev/null and b/docs/content/user_guide/auto_examples/2cross/plot_rotated_mca_codeobj.pickle differ diff --git a/docs/content/user_guide/auto_examples/2cross/sg_execution_times.rst b/docs/content/user_guide/auto_examples/2cross/sg_execution_times.rst new file mode 100644 index 00000000..48450b06 --- /dev/null +++ b/docs/content/user_guide/auto_examples/2cross/sg_execution_times.rst @@ -0,0 +1,15 @@ + +:orphan: + +.. _sphx_glr_content_user_guide_auto_examples_2cross_sg_execution_times: + + +Computation times +================= +**00:10.643** total execution time for **content_user_guide_auto_examples_2cross** files: + ++-------------------------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_2cross_plot_mca.py` (``plot_mca.py``) | 00:06.057 | 0.0 MB | ++-------------------------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_2cross_plot_rotated_mca.py` (``plot_rotated_mca.py``) | 00:04.585 | 0.0 MB | ++-------------------------------------------------------------------------------------------------------+-----------+--------+ diff --git a/docs/auto_examples/2multi/images/sphx_glr_plot_cca_001.png b/docs/content/user_guide/auto_examples/3multi/images/sphx_glr_plot_cca_001.png similarity index 100% rename from docs/auto_examples/2multi/images/sphx_glr_plot_cca_001.png rename to docs/content/user_guide/auto_examples/3multi/images/sphx_glr_plot_cca_001.png diff --git a/docs/auto_examples/2multi/images/sphx_glr_plot_cca_002.png b/docs/content/user_guide/auto_examples/3multi/images/sphx_glr_plot_cca_002.png similarity index 100% rename from docs/auto_examples/2multi/images/sphx_glr_plot_cca_002.png rename to docs/content/user_guide/auto_examples/3multi/images/sphx_glr_plot_cca_002.png diff --git a/docs/auto_examples/2multi/images/thumb/sphx_glr_plot_cca_thumb.png b/docs/content/user_guide/auto_examples/3multi/images/thumb/sphx_glr_plot_cca_thumb.png similarity index 100% rename from docs/auto_examples/2multi/images/thumb/sphx_glr_plot_cca_thumb.png rename to docs/content/user_guide/auto_examples/3multi/images/thumb/sphx_glr_plot_cca_thumb.png diff --git a/docs/auto_examples/3multi/index.rst b/docs/content/user_guide/auto_examples/3multi/index.rst similarity index 63% rename from docs/auto_examples/3multi/index.rst rename to docs/content/user_guide/auto_examples/3multi/index.rst index 30f52aef..a37a3263 100644 --- a/docs/auto_examples/3multi/index.rst +++ b/docs/content/user_guide/auto_examples/3multi/index.rst @@ -1,6 +1,6 @@ -.. _sphx_glr_auto_examples_3multi: +.. _sphx_glr_content_user_guide_auto_examples_3multi: 3 | Multi-Set Analysis ======================== @@ -18,10 +18,10 @@ .. only:: html - .. image:: /auto_examples/3multi/images/thumb/sphx_glr_plot_cca_thumb.png + .. image:: /content/user_guide/auto_examples/3multi/images/thumb/sphx_glr_plot_cca_thumb.png :alt: - :ref:`sphx_glr_auto_examples_3multi_plot_cca.py` + :ref:`sphx_glr_content_user_guide_auto_examples_3multi_plot_cca.py` .. raw:: html @@ -37,5 +37,5 @@ .. toctree:: :hidden: - /auto_examples/3multi/plot_cca + /content/user_guide/auto_examples/3multi/plot_cca diff --git a/docs/auto_examples/2multi/plot_cca.ipynb b/docs/content/user_guide/auto_examples/3multi/plot_cca.ipynb similarity index 100% rename from docs/auto_examples/2multi/plot_cca.ipynb rename to docs/content/user_guide/auto_examples/3multi/plot_cca.ipynb diff --git a/docs/auto_examples/2multi/plot_cca.py b/docs/content/user_guide/auto_examples/3multi/plot_cca.py similarity index 100% rename from docs/auto_examples/2multi/plot_cca.py rename to docs/content/user_guide/auto_examples/3multi/plot_cca.py diff --git a/docs/auto_examples/2multi/plot_cca.py.md5 b/docs/content/user_guide/auto_examples/3multi/plot_cca.py.md5 similarity index 100% rename from docs/auto_examples/2multi/plot_cca.py.md5 rename to docs/content/user_guide/auto_examples/3multi/plot_cca.py.md5 diff --git a/docs/auto_examples/2multi/plot_cca.rst b/docs/content/user_guide/auto_examples/3multi/plot_cca.rst similarity index 87% rename from docs/auto_examples/2multi/plot_cca.rst rename to docs/content/user_guide/auto_examples/3multi/plot_cca.rst index 466135c9..80b786f2 100644 --- a/docs/auto_examples/2multi/plot_cca.rst +++ b/docs/content/user_guide/auto_examples/3multi/plot_cca.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/2multi/plot_cca.py" +.. "content/user_guide/auto_examples/3multi/plot_cca.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_2multi_plot_cca.py: +.. _sphx_glr_content_user_guide_auto_examples_3multi_plot_cca.py: Canonical Correlation Analysis @@ -170,9 +170,9 @@ Let's look at the canonical loadings (components) of the first mode. -.. image-sg:: /auto_examples/2multi/images/sphx_glr_plot_cca_001.png +.. image-sg:: /content/user_guide/auto_examples/3multi/images/sphx_glr_plot_cca_001.png :alt: plot cca - :srcset: /auto_examples/2multi/images/sphx_glr_plot_cca_001.png + :srcset: /content/user_guide/auto_examples/3multi/images/sphx_glr_plot_cca_001.png :class: sphx-glr-single-img @@ -196,9 +196,9 @@ And lastly, we'll check out the canonical variates (scores) of the first mode. -.. image-sg:: /auto_examples/2multi/images/sphx_glr_plot_cca_002.png +.. image-sg:: /content/user_guide/auto_examples/3multi/images/sphx_glr_plot_cca_002.png :alt: mode = 1 - :srcset: /auto_examples/2multi/images/sphx_glr_plot_cca_002.png + :srcset: /content/user_guide/auto_examples/3multi/images/sphx_glr_plot_cca_002.png :class: sphx-glr-single-img @@ -207,17 +207,17 @@ And lastly, we'll check out the canonical variates (scores) of the first mode. .. code-block:: none - + .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 2.798 seconds) + **Total running time of the script:** (0 minutes 3.436 seconds) -.. _sphx_glr_download_auto_examples_2multi_plot_cca.py: +.. _sphx_glr_download_content_user_guide_auto_examples_3multi_plot_cca.py: .. only:: html diff --git a/docs/content/user_guide/auto_examples/3multi/plot_cca_codeobj.pickle b/docs/content/user_guide/auto_examples/3multi/plot_cca_codeobj.pickle new file mode 100644 index 00000000..5669eedd Binary files /dev/null and b/docs/content/user_guide/auto_examples/3multi/plot_cca_codeobj.pickle differ diff --git a/docs/content/user_guide/auto_examples/3multi/sg_execution_times.rst b/docs/content/user_guide/auto_examples/3multi/sg_execution_times.rst new file mode 100644 index 00000000..60ba459c --- /dev/null +++ b/docs/content/user_guide/auto_examples/3multi/sg_execution_times.rst @@ -0,0 +1,13 @@ + +:orphan: + +.. _sphx_glr_content_user_guide_auto_examples_3multi_sg_execution_times: + + +Computation times +================= +**00:03.436** total execution time for **content_user_guide_auto_examples_3multi** files: + ++---------------------------------------------------------------------------------------+-----------+--------+ +| :ref:`sphx_glr_content_user_guide_auto_examples_3multi_plot_cca.py` (``plot_cca.py``) | 00:03.436 | 0.0 MB | ++---------------------------------------------------------------------------------------+-----------+--------+ diff --git a/docs/content/user_guide/auto_examples/4validation/images/sphx_glr_plot_bootstrap_001.png b/docs/content/user_guide/auto_examples/4validation/images/sphx_glr_plot_bootstrap_001.png new file mode 100644 index 00000000..11c62345 Binary files /dev/null and b/docs/content/user_guide/auto_examples/4validation/images/sphx_glr_plot_bootstrap_001.png differ diff --git a/docs/content/user_guide/auto_examples/4validation/images/thumb/sphx_glr_plot_bootstrap_thumb.png b/docs/content/user_guide/auto_examples/4validation/images/thumb/sphx_glr_plot_bootstrap_thumb.png new file mode 100644 index 00000000..475ae573 Binary files /dev/null and b/docs/content/user_guide/auto_examples/4validation/images/thumb/sphx_glr_plot_bootstrap_thumb.png differ diff --git a/docs/auto_examples/4validation/index.rst b/docs/content/user_guide/auto_examples/4validation/index.rst similarity index 60% rename from docs/auto_examples/4validation/index.rst rename to docs/content/user_guide/auto_examples/4validation/index.rst index 39e779b7..f3f94a03 100644 --- a/docs/auto_examples/4validation/index.rst +++ b/docs/content/user_guide/auto_examples/4validation/index.rst @@ -1,6 +1,6 @@ -.. _sphx_glr_auto_examples_4validation: +.. _sphx_glr_content_user_guide_auto_examples_4validation: 4 | Validation =============== @@ -17,10 +17,10 @@ .. only:: html - .. image:: /auto_examples/4validation/images/thumb/sphx_glr_plot_bootstrap_thumb.png + .. image:: /content/user_guide/auto_examples/4validation/images/thumb/sphx_glr_plot_bootstrap_thumb.png :alt: - :ref:`sphx_glr_auto_examples_4validation_plot_bootstrap.py` + :ref:`sphx_glr_content_user_guide_auto_examples_4validation_plot_bootstrap.py` .. raw:: html @@ -36,5 +36,5 @@ .. toctree:: :hidden: - /auto_examples/4validation/plot_bootstrap + /content/user_guide/auto_examples/4validation/plot_bootstrap diff --git a/docs/auto_examples/3validation/plot_bootstrap.ipynb b/docs/content/user_guide/auto_examples/4validation/plot_bootstrap.ipynb similarity index 100% rename from docs/auto_examples/3validation/plot_bootstrap.ipynb rename to docs/content/user_guide/auto_examples/4validation/plot_bootstrap.ipynb diff --git a/docs/auto_examples/3validation/plot_bootstrap.py b/docs/content/user_guide/auto_examples/4validation/plot_bootstrap.py similarity index 100% rename from docs/auto_examples/3validation/plot_bootstrap.py rename to docs/content/user_guide/auto_examples/4validation/plot_bootstrap.py diff --git a/docs/auto_examples/3validation/plot_bootstrap.py.md5 b/docs/content/user_guide/auto_examples/4validation/plot_bootstrap.py.md5 similarity index 100% rename from docs/auto_examples/3validation/plot_bootstrap.py.md5 rename to docs/content/user_guide/auto_examples/4validation/plot_bootstrap.py.md5 diff --git a/docs/auto_examples/4validation/plot_bootstrap.rst b/docs/content/user_guide/auto_examples/4validation/plot_bootstrap.rst similarity index 56% rename from docs/auto_examples/4validation/plot_bootstrap.rst rename to docs/content/user_guide/auto_examples/4validation/plot_bootstrap.rst index 6c7208f1..b88bb241 100644 --- a/docs/auto_examples/4validation/plot_bootstrap.rst +++ b/docs/content/user_guide/auto_examples/4validation/plot_bootstrap.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/4validation/plot_bootstrap.py" +.. "content/user_guide/auto_examples/4validation/plot_bootstrap.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_4validation_plot_bootstrap.py: +.. _sphx_glr_content_user_guide_auto_examples_4validation_plot_bootstrap.py: Significance testing of EOF analysis via bootstrap @@ -118,7 +118,7 @@ numbers of bootstraps e.g. 1000. .. code-block:: none - 0%| | 0/50 [00:00` + :download:`Download all examples in Python source code: auto_examples_python.zip ` .. container:: sphx-glr-download sphx-glr-download-jupyter - :download:`Download all examples in Jupyter notebooks: auto_examples_jupyter.zip ` + :download:`Download all examples in Jupyter notebooks: auto_examples_jupyter.zip ` .. only:: html diff --git a/docs/user_guide/core_functionalities/dask_support.rst b/docs/content/user_guide/core_functionalities/dask_support.rst similarity index 100% rename from docs/user_guide/core_functionalities/dask_support.rst rename to docs/content/user_guide/core_functionalities/dask_support.rst diff --git a/docs/user_guide/core_functionalities/efficient.rst b/docs/content/user_guide/core_functionalities/efficient.rst similarity index 74% rename from docs/user_guide/core_functionalities/efficient.rst rename to docs/content/user_guide/core_functionalities/efficient.rst index d0881cc2..02de42dc 100644 --- a/docs/user_guide/core_functionalities/efficient.rst +++ b/docs/content/user_guide/core_functionalities/efficient.rst @@ -10,11 +10,19 @@ A comparative analysis demonstrates the performance of xeofs against eofs_ on a Comparison of computational times between xeofs and eofs for data sets of varying sizes -.. image:: ../../perf/timings_dark.png - :height: 300px - :width: 750px - :alt: Comparison of computational times between xeofs and eofs for data sets of varying sizes - :align: center +.. image:: ../../../perf/timings_dark.png + :height: 300px + :width: 750px + :alt: Comparison of computational times between xeofs and eofs for data sets of varying sizes + :align: center + :class: only-dark + +.. image:: ../../../perf/timings_light.png + :height: 300px + :width: 750px + :alt: Comparison of computational times between xeofs and eofs for data sets of varying sizes + :align: center + :class: only-light .. note:: diff --git a/docs/user_guide/core_functionalities/index.rst b/docs/content/user_guide/core_functionalities/index.rst similarity index 100% rename from docs/user_guide/core_functionalities/index.rst rename to docs/content/user_guide/core_functionalities/index.rst diff --git a/docs/user_guide/core_functionalities/labeled_data.rst b/docs/content/user_guide/core_functionalities/labeled_data.rst similarity index 100% rename from docs/user_guide/core_functionalities/labeled_data.rst rename to docs/content/user_guide/core_functionalities/labeled_data.rst diff --git a/docs/user_guide/core_functionalities/missing_values.rst b/docs/content/user_guide/core_functionalities/missing_values.rst similarity index 100% rename from docs/user_guide/core_functionalities/missing_values.rst rename to docs/content/user_guide/core_functionalities/missing_values.rst diff --git a/docs/user_guide/core_functionalities/model_evaluation.rst b/docs/content/user_guide/core_functionalities/model_evaluation.rst similarity index 73% rename from docs/user_guide/core_functionalities/model_evaluation.rst rename to docs/content/user_guide/core_functionalities/model_evaluation.rst index 581d0975..06af38d2 100644 --- a/docs/user_guide/core_functionalities/model_evaluation.rst +++ b/docs/content/user_guide/core_functionalities/model_evaluation.rst @@ -4,4 +4,4 @@ Model Evaluation ============================================= xeofs is dedicated to providing a user-friendly interface for model evaluations using bootstrapping. Currently, it supports bootstrapping for PCA/EOF analysis. -For a practical example, see the :doc:`validation example <../../auto_examples/3validation/index>`. \ No newline at end of file +For a practical example, see the :doc:`validation example <../auto_examples/3validation/index>`. \ No newline at end of file diff --git a/docs/user_guide/core_functionalities/model_serialization.rst b/docs/content/user_guide/core_functionalities/model_serialization.rst similarity index 100% rename from docs/user_guide/core_functionalities/model_serialization.rst rename to docs/content/user_guide/core_functionalities/model_serialization.rst diff --git a/examples/1single/README.rst b/docs/content/user_guide/examples/1single/README.rst similarity index 100% rename from examples/1single/README.rst rename to docs/content/user_guide/examples/1single/README.rst diff --git a/examples/1single/eof-smode.jpg b/docs/content/user_guide/examples/1single/eof-smode.jpg similarity index 100% rename from examples/1single/eof-smode.jpg rename to docs/content/user_guide/examples/1single/eof-smode.jpg diff --git a/examples/1single/eof-tmode.jpg b/docs/content/user_guide/examples/1single/eof-tmode.jpg similarity index 100% rename from examples/1single/eof-tmode.jpg rename to docs/content/user_guide/examples/1single/eof-tmode.jpg diff --git a/docs/content/user_guide/examples/1single/mreof-analysis.jpg b/docs/content/user_guide/examples/1single/mreof-analysis.jpg new file mode 100644 index 00000000..7f5f9087 Binary files /dev/null and b/docs/content/user_guide/examples/1single/mreof-analysis.jpg differ diff --git a/examples/1single/multivariate-eof-analysis.jpg b/docs/content/user_guide/examples/1single/multivariate-eof-analysis.jpg similarity index 100% rename from examples/1single/multivariate-eof-analysis.jpg rename to docs/content/user_guide/examples/1single/multivariate-eof-analysis.jpg diff --git a/examples/1single/plot_complex_eof.py b/docs/content/user_guide/examples/1single/plot_complex_eof.py similarity index 100% rename from examples/1single/plot_complex_eof.py rename to docs/content/user_guide/examples/1single/plot_complex_eof.py diff --git a/examples/1single/plot_eeof.png b/docs/content/user_guide/examples/1single/plot_eeof.png similarity index 100% rename from examples/1single/plot_eeof.png rename to docs/content/user_guide/examples/1single/plot_eeof.png diff --git a/examples/1single/plot_eeof.py b/docs/content/user_guide/examples/1single/plot_eeof.py similarity index 100% rename from examples/1single/plot_eeof.py rename to docs/content/user_guide/examples/1single/plot_eeof.py diff --git a/examples/1single/plot_eeof_trend.py b/docs/content/user_guide/examples/1single/plot_eeof_trend.py similarity index 100% rename from examples/1single/plot_eeof_trend.py rename to docs/content/user_guide/examples/1single/plot_eeof_trend.py diff --git a/examples/1single/plot_eof-smode.py b/docs/content/user_guide/examples/1single/plot_eof-smode.py similarity index 100% rename from examples/1single/plot_eof-smode.py rename to docs/content/user_guide/examples/1single/plot_eof-smode.py diff --git a/examples/1single/plot_eof-tmode.py b/docs/content/user_guide/examples/1single/plot_eof-tmode.py similarity index 100% rename from examples/1single/plot_eof-tmode.py rename to docs/content/user_guide/examples/1single/plot_eof-tmode.py diff --git a/examples/1single/plot_gwpca.py b/docs/content/user_guide/examples/1single/plot_gwpca.py similarity index 100% rename from examples/1single/plot_gwpca.py rename to docs/content/user_guide/examples/1single/plot_gwpca.py diff --git a/examples/1single/plot_hilbert_eof.py b/docs/content/user_guide/examples/1single/plot_hilbert_eof.py similarity index 100% rename from examples/1single/plot_hilbert_eof.py rename to docs/content/user_guide/examples/1single/plot_hilbert_eof.py diff --git a/examples/1single/plot_mreof.py b/docs/content/user_guide/examples/1single/plot_mreof.py similarity index 100% rename from examples/1single/plot_mreof.py rename to docs/content/user_guide/examples/1single/plot_mreof.py diff --git a/examples/1single/plot_multivariate-eof.py b/docs/content/user_guide/examples/1single/plot_multivariate-eof.py similarity index 100% rename from examples/1single/plot_multivariate-eof.py rename to docs/content/user_guide/examples/1single/plot_multivariate-eof.py diff --git a/examples/1single/plot_rotated_eof.py b/docs/content/user_guide/examples/1single/plot_rotated_eof.py similarity index 100% rename from examples/1single/plot_rotated_eof.py rename to docs/content/user_guide/examples/1single/plot_rotated_eof.py diff --git a/examples/1single/plot_weighted-eof.py b/docs/content/user_guide/examples/1single/plot_weighted-eof.py similarity index 100% rename from examples/1single/plot_weighted-eof.py rename to docs/content/user_guide/examples/1single/plot_weighted-eof.py diff --git a/docs/content/user_guide/examples/1single/rotated_eof.jpg b/docs/content/user_guide/examples/1single/rotated_eof.jpg new file mode 100644 index 00000000..9700bab5 Binary files /dev/null and b/docs/content/user_guide/examples/1single/rotated_eof.jpg differ diff --git a/docs/content/user_guide/examples/1single/sparse_pca.jpg b/docs/content/user_guide/examples/1single/sparse_pca.jpg new file mode 100644 index 00000000..eaafed90 Binary files /dev/null and b/docs/content/user_guide/examples/1single/sparse_pca.jpg differ diff --git a/examples/1single/weighted_eof.jpg b/docs/content/user_guide/examples/1single/weighted_eof.jpg similarity index 100% rename from examples/1single/weighted_eof.jpg rename to docs/content/user_guide/examples/1single/weighted_eof.jpg diff --git a/examples/2cross/README.rst b/docs/content/user_guide/examples/2cross/README.rst similarity index 100% rename from examples/2cross/README.rst rename to docs/content/user_guide/examples/2cross/README.rst diff --git a/examples/2cross/mca.jpg b/docs/content/user_guide/examples/2cross/mca.jpg similarity index 78% rename from examples/2cross/mca.jpg rename to docs/content/user_guide/examples/2cross/mca.jpg index 6a3fcd53..3ef012ef 100644 Binary files a/examples/2cross/mca.jpg and b/docs/content/user_guide/examples/2cross/mca.jpg differ diff --git a/docs/auto_examples/2multi/plot_mca.py b/docs/content/user_guide/examples/2cross/plot_mca.py similarity index 100% rename from docs/auto_examples/2multi/plot_mca.py rename to docs/content/user_guide/examples/2cross/plot_mca.py diff --git a/docs/auto_examples/2multi/plot_rotated_mca.py b/docs/content/user_guide/examples/2cross/plot_rotated_mca.py similarity index 100% rename from docs/auto_examples/2multi/plot_rotated_mca.py rename to docs/content/user_guide/examples/2cross/plot_rotated_mca.py diff --git a/examples/2cross/rotated_mca.jpg b/docs/content/user_guide/examples/2cross/rotated_mca.jpg similarity index 79% rename from examples/2cross/rotated_mca.jpg rename to docs/content/user_guide/examples/2cross/rotated_mca.jpg index 1e9748a2..2312be84 100644 Binary files a/examples/2cross/rotated_mca.jpg and b/docs/content/user_guide/examples/2cross/rotated_mca.jpg differ diff --git a/examples/3multi/README.rst b/docs/content/user_guide/examples/3multi/README.rst similarity index 100% rename from examples/3multi/README.rst rename to docs/content/user_guide/examples/3multi/README.rst diff --git a/docs/auto_examples/3multi/plot_cca.py b/docs/content/user_guide/examples/3multi/plot_cca.py similarity index 100% rename from docs/auto_examples/3multi/plot_cca.py rename to docs/content/user_guide/examples/3multi/plot_cca.py diff --git a/examples/4validation/README.rst b/docs/content/user_guide/examples/4validation/README.rst similarity index 100% rename from examples/4validation/README.rst rename to docs/content/user_guide/examples/4validation/README.rst diff --git a/docs/content/user_guide/examples/4validation/bootstrap.jpg b/docs/content/user_guide/examples/4validation/bootstrap.jpg new file mode 100644 index 00000000..4d6f60fb Binary files /dev/null and b/docs/content/user_guide/examples/4validation/bootstrap.jpg differ diff --git a/docs/auto_examples/4validation/plot_bootstrap.py b/docs/content/user_guide/examples/4validation/plot_bootstrap.py similarity index 100% rename from docs/auto_examples/4validation/plot_bootstrap.py rename to docs/content/user_guide/examples/4validation/plot_bootstrap.py diff --git a/examples/README.rst b/docs/content/user_guide/examples/README.rst similarity index 100% rename from examples/README.rst rename to docs/content/user_guide/examples/README.rst diff --git a/docs/user_guide/how_to_cite.rst b/docs/content/user_guide/how_to_cite.rst similarity index 100% rename from docs/user_guide/how_to_cite.rst rename to docs/content/user_guide/how_to_cite.rst diff --git a/docs/user_guide/index.rst b/docs/content/user_guide/index.rst similarity index 83% rename from docs/user_guide/index.rst rename to docs/content/user_guide/index.rst index d255c588..44cc4b6b 100644 --- a/docs/user_guide/index.rst +++ b/docs/content/user_guide/index.rst @@ -1,7 +1,7 @@ -.. image:: ../img/example_sst_rotated_pca_dark.png +.. image:: ../..//img/example_sst_rotated_pca_dark.png :class: only-dark -.. image:: ../img/example_sst_rotated_pca_light.png +.. image:: ../../img/example_sst_rotated_pca_light.png :class: only-light @@ -21,22 +21,38 @@ Advantages of using xeofs: - :doc:`Bootstrapping `: Provides a user-friendly interface for model evaluation using bootstrapping. - :doc:`Modular `: Allows users to implement and incorporate new dimensionality reduction methods. -If you're eager to see it in action, check out the :doc:`basic example` to get started quickly. For more comprehensive demonstrations, explore our :doc:`example gallery<../auto_examples/index>`. +If you're eager to see it in action, check out the :doc:`basic example` to get started quickly. For more comprehensive demonstrations, explore our :doc:`example gallery`. Finally, if you're using xeofs in your academic work, please consider citing the software. For more information, see :doc:`how to cite`. .. toctree:: :maxdepth: 3 :hidden: + :caption: Getting Started why + is_this_for_me + installation quickstart + +.. toctree:: + :maxdepth: 3 + :hidden: + :caption: Learning More + core_functionalities/index model_implementation - xeofs_comparison - ../auto_examples/index + auto_examples/index + +.. toctree:: + :maxdepth: 3 + :hidden: + :caption: FAQs + + migration_v3 how_to_cite + .. _xarray: https://docs.xarray.dev/en/stable/index.html .. _dask: https://dask.org/ diff --git a/docs/installation.rst b/docs/content/user_guide/installation.rst similarity index 100% rename from docs/installation.rst rename to docs/content/user_guide/installation.rst diff --git a/docs/content/user_guide/is_this_for_me.rst b/docs/content/user_guide/is_this_for_me.rst new file mode 100644 index 00000000..b95219b2 --- /dev/null +++ b/docs/content/user_guide/is_this_for_me.rst @@ -0,0 +1,91 @@ +=================== +Right Tool for You? +=================== + +**Short answer**: It depends. + +You may not need to use xeofs if: + +- The method you need is already available in another package. +- Your data is naturally 2D and unlabeled. + +For example, `scikit-learn`_ offers a wide variety of well-established models for 2D data, `cca-zoo`_ provides multiple CCA options, and `pyeof`_ supports Varimax-rotated PCA. + +For multi-dimensional data in xarray_ and dask_, popular tools like eofs_ (for PCA/EOF analysis) and xMCA_ (for Maximum Covariance Analysis) might already cover your needs. Specifically, eofs by Andrew Dawson offers basic support for xarray and dask, but only for single 1D sample dimensions. + +However, consider using xeofs if: + +- You need :doc:`efficient computation` in Python using randomized linear algebra (~10x faster than eofs for medium to large datasets). +- Your data :doc:`exceeds memory limits` and requires dask for processing. +- You prefer to work within the familiar ecosystem of xarray DataArrays and Datasets. +- Your data is naturally :doc:`N-dimensional` (e.g., time, longitude, latitude, steps, sensors, variables). +- You want to perform analysis along an N-dimensional sample dimension such as in :doc:`T-mode EOF analysis`. +- You need specialized dimensionality reduction methods for climate science (e.g. Hilbert PCA, POP analysis :doc:`and more<../api_reference/index>`). + +Below is an overview of some features where xeofs stands out compared to other packages: + +.. list-table:: + :header-rows: 1 + + * - + - **xeofs** + - **eofs** + - **pyEOF** + - **xMCA** + * - xarray Interface + - ✅ + - ✅ + - ❌ + - ✅ + * - Dask Support + - ✅ + - ✅ + - ❌ + - ❌ + * - Multi-Dimensional + - ✅ + - Only 1D sample dim + - 2D input only + - Only 1D sample dim + * - Missing Values + - ✅ + - ✅ + - ❌ + - ✅ + * - Support for ``xr.Dataset`` + - ✅ + - ❌ + - ❌ + - ❌ + * - Algorithm\ :sup:`1`\ + - Randomized SVD + - Full SVD + - Randomized SVD + - Full SVD + * - Extensible Code Structure + - ✅ + - ❌ + - ❌ + - ❌ + * - **Validation** + - + - + - + - + * - Bootstrapping + - ✅ + - ❌ + - ❌ + - ❌ + +\ :sup:`1`\ **Note on the algorithm:** The computational burden of a full SVD decomposition for an m x n matrix is O(min(mn², m²n)). owever, the randomized SVD, which identifies only the initial k singular values, notably curtails this complexity to O(m n log(k)), making the randomized SVD, as utilized by xeofs, more suitable for expansive datasets. For an in-depth exploration, refer to the `sklearn docs on PCA `_. + + +.. _pyEOF: https://github.com/zhonghua-zheng/pyEOF +.. _xMCA: https://github.com/Yefee/xMCA +.. _eofs: https://github.com/ajdawson/eofs +.. _`GitHub`: https://github.com/xarray-contrib/xeofs/issues +.. _xarray: https://docs.xarray.dev/en/stable/index.html +.. _Dask: https://dask.org/ +.. _`scikit-learn`: https://scikit-learn.org/ +.. _`cca-zoo`: https://cca-zoo.readthedocs.io/en/latest/ \ No newline at end of file diff --git a/docs/content/user_guide/migration_v3.rst b/docs/content/user_guide/migration_v3.rst new file mode 100644 index 00000000..d74b497e --- /dev/null +++ b/docs/content/user_guide/migration_v3.rst @@ -0,0 +1,66 @@ +=================== +Migrating to ``v3`` +=================== + +This short guide outlines the key changes in version 3 of ``xeofs`` and provides instructions for updating your code from version 2. + +----------------------------- +Updated Namespaces for Models +----------------------------- + +To improve organization and future scalability, :doc:`new namespaces <../api_reference/index>` have been introduced for the models. This is a breaking change, but updating your code is straightforward. You'll need to adjust the import statements and method access in your v2 code. The new namespaces are as follows: + +- ``xeofs.single``: Contains all single-field models (e.g. EOF analysis) +- ``xeofs.cross``: Contains all cross-field models (e.g. MCA) +- ``xeofs.multi``: Contains all multi-field models + +Previously, methods were accessed like this: + +.. code-block:: python + + eof = xe.models.EOF() + +In ``v3``, they are now accessed as follows: + +.. code-block:: python + + eof = xe.single.EOF() + mca = xe.cross.MCA() + +-------------------------------- +Complex/Hilbert Classes Reanming +-------------------------------- +In ``v2``, Hilbert methods were mistakenly named as Complex methods. This has been corrected in ``v3``. If you were using Complex methods in ``v2``, you should now use Hilbert methods in ``v3``. + + +.. code-block:: python + + # v2 + ceof = xe.models.ComplexEOF() + + # v3 + ceof = xe.single.HilbertEOF() + + +Complex methods still exist but now follow the standard convention of analyzing pre-existing complex fields (e.g., wind field components ``u`` and ``v``). Hilbert methods, on the other hand, are used for analyzing real physical fields, where the Hilbert transform is applied to convert the real field into a complex field. + +------------------------------------ +Normalization of ``score()`` Methods +------------------------------------ +To align with the scikit-learn API, the default value for the ``normalize`` parameter in the ``score()`` methods has been changed from ``True`` to ``False``. In EOF analysis, this means that the raw principal components (PCs) will now be returned, with each PC weighted by its respective mode's importance (singular value). If you prefer the previous behavior, you can explicitly set ``normalize=True``. + +The ``components()`` method remains unchanged, with normalization still set to ``True`` by default. + +------------------ +Dropped Parameters +------------------ +Several parameters have been removed in ``v3``: + +- ``verbose``: This parameter has been removed from all methods, as it was deemed unnecessary +- ``squared_loadings`` (specific to ``MCARotator`` classes): This parameter has been removed because, although it preserved the squared covariance fraction after rotation, it invalidated the ``inverse_transform`` method for reconstructing the original fields. Its removal helps avoid confusion and misuse. + +-------------------------- +Standardize Variable Names +-------------------------- +In ``v3``, variable names have been standardized to ``X`` and ``Y`` for input data. In ``v2``, input data was often referred to as ``data``, ``data1``, or ``data2``. This change improves code readability and aligns with the scikit-learn API for consistency. + diff --git a/docs/user_guide/model_implementation.rst b/docs/content/user_guide/model_implementation.rst similarity index 100% rename from docs/user_guide/model_implementation.rst rename to docs/content/user_guide/model_implementation.rst diff --git a/docs/user_guide/quickstart.ipynb b/docs/content/user_guide/quickstart.ipynb similarity index 100% rename from docs/user_guide/quickstart.ipynb rename to docs/content/user_guide/quickstart.ipynb diff --git a/docs/user_guide/why.rst b/docs/content/user_guide/why.rst similarity index 100% rename from docs/user_guide/why.rst rename to docs/content/user_guide/why.rst diff --git a/docs/whats_new/CHANGELOG.md b/docs/content/whats_new/CHANGELOG.md similarity index 100% rename from docs/whats_new/CHANGELOG.md rename to docs/content/whats_new/CHANGELOG.md diff --git a/docs/model_pca.html b/docs/model_pca.html deleted file mode 100644 index 7f592c5f..00000000 --- a/docs/model_pca.html +++ /dev/null @@ -1,7583 +0,0 @@ - - - - - -model_pca - - - - - - - - - - - - -
    - - - - -
    - - diff --git a/docs/model_pca.ipynb b/docs/model_pca.ipynb deleted file mode 100644 index 10a7854c..00000000 --- a/docs/model_pca.ipynb +++ /dev/null @@ -1,133 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### EOF Analysis" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Empirical Orthogonal Function (EOF) analysis, also known as Principal Component Analysis (PCA), has become an invaluable tool in climate science since its popularization by Lorenz in 1956. This method provides significant benefits, including the simplification of complex multivariate datasets, identification of major variability patterns, and reduction of data dimensionality.\n", - "\n", - "#### How Does It Work?\n", - "\n", - "EOF analysis works by decomposing a dataset's covariance (or correlation) matrix into eigenvalues and eigenvectors. The eigenvectors, or Empirical Orthogonal Functions (EOFs), portray spatial patterns (the *components* in `xeofs`), while the eigenvalues indicate the variance that each pattern explains. Correspondingly, Principal Components (PCs) act as the time coefficients for the EOF patterns (the *scores* in `xeofs`). In essence, EOFs and PCs offer a new set of orthogonal basis vectors that describe the dataset's variability optimally.\n", - "\n", - "#### An Example: North American Air Temperatures between 2013-2014\n", - "In this section, we'll conduct an EOF analysis of two-year temperature records across North America using the `xeofs` package. We'll load all required packages, retrieve the data, and perform the analysis." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import xarray as xr\n", - "import matplotlib.pyplot as plt\n", - "from matplotlib.gridspec import GridSpec\n", - "import cartopy.feature as cfeature\n", - "from cartopy.crs import LambertAzimuthalEqualArea, PlateCarree\n", - "import xeofs as xe\n", - "\n", - "t2m = xr.tutorial.load_dataset(\"air_temperature\")[\"air\"]\n", - "\n", - "model = xe.single.EOF(n_modes=20, standardize=True, use_coslat=True)\n", - "model.fit(t2m, dim=\"time\")\n", - "\n", - "expvar = model.explained_variance_ratio()\n", - "compontents = model.components()\n", - "scores = model.scores()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let's create a plot visualising the results of the EOF analysis." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "def plot_pca_results(mode):\n", - " proj = LambertAzimuthalEqualArea(central_latitude=50, central_longitude=-90)\n", - " proj_data = PlateCarree()\n", - "\n", - " fig = plt.figure(figsize=(9, 3))\n", - " gs = GridSpec(1, 2, width_ratios=[1, 2], wspace=0.05)\n", - " ax1 = fig.add_subplot(gs[0, 0])\n", - " ax2 = fig.add_subplot(gs[0, 1], projection=proj)\n", - "\n", - " scores.sel(mode=mode).plot(ax=ax1)\n", - "\n", - " ax2.add_feature(cfeature.LAND, facecolor=\".9\")\n", - " ax2.add_feature(cfeature.OCEAN, facecolor=\".9\")\n", - " ax2.coastlines(color=\".5\", lw=0.5)\n", - "\n", - " kwargs = dict(vmin=-0.15, vmax=0.15, cmap=\"RdBu_r\", transform=proj_data)\n", - " compontents.sel(mode=mode).plot(ax=ax2, **kwargs)\n", - "\n", - " ax1.set_title(\"Mode {}\".format(mode))\n", - " ax2.set_title(\n", - " \"Explained variance: {:.1f}%\".format(expvar.sel(mode=mode).values * 100)\n", - " )\n", - "\n", - " plt.show()\n", - "\n", - "\n", - "plot_pca_results(1)\n", - "plot_pca_results(2)\n", - "plot_pca_results(3)\n", - "plot_pca_results(4)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Challenge: Interpretability\n", - "\n", - "Despite its popularity for tasks like image processing where its orthogonality property aids in efficient data compression, EOF analysis can pose some interpretive challenges.\n", - "\n", - "In climate science, researchers often deal with enormous datasets with high redundancy levels. While EOF analysis can effectively condense these datasets into their most critical modes of variability, thereby enhancing our understanding of the climate system's patterns, dynamics, and variability, it's not without issues. Notably, EOF analysis tends to produce **dense matrices** - where most entries are non-zero - which can make interpretation difficult.\n", - "\n", - "Additionally, the imposed **orthogonality** often leads to recognized spatial patterns, like the **Buell patterns** (named after Buell in the 1980s), which manifest as a unipolar first component, bipolar second and third components, and then tripoles, quadrupoles, etc. Misinterpretation often arises here, as these patterns might be misconstrued as geophysical phenomena, when in fact they are more likely mathematical artifacts.\n", - "\n", - "The example above illustrates these interpretive challenges. As you navigate through the different modes, you'll observe that each mode is dense, with very few zero values. You'll also detect the Buell patterns present in these modes. Although one could argue that the first mode signifies a domain-wide feature, such as the seasonal cycle, and the second mode captures the difference in the seasonal cycle between the continental and oceanic regions, wouldn't it be more straightforward to have two separate modes representing the seasonal cycles for each region? To tackle this, we can use a technique known as Varimax/Promax rotation, which we'll explain in the following section.\n", - "\n", - "\n", - "\n", - "\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "xeofs", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.4" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/docs/model_pca.md b/docs/model_pca.md deleted file mode 100644 index cb8e6175..00000000 --- a/docs/model_pca.md +++ /dev/null @@ -1,99 +0,0 @@ -# EOF analysis - -Empirical Orthogonal Function (EOF) analysis, more known as Principal Component Analysis (PCA), has a long history in climate science since having popularied by [AUTHORS] et al in [YEAR]. [list some of its benefits and why it is so useful.] - - -### How does it work? - -[Describe in one paragraph what EOF analysis does mathematically. Specifically, explain what the components (EOFs), the scores (PCs) and the eigenvalues (explained variance) mean.] - - -### An example: North American air temperatures between 2013-2014 -In the following we perform EOF analysis of 2-year temperature records over the North American continent using ``xeofs``. The following cell loads all necessary packages, retrieves the data and performs the analysis. - - -```python -import xarray as xr -import matplotlib.pyplot as plt -from matplotlib.gridspec import GridSpec -import cartopy.feature as cfeature -import ipywidgets as widgets -from IPython.display import display -from cartopy.crs import LambertAzimuthalEqualArea, PlateCarree -from xeofs.single import EOF - -t2m = xr.tutorial.load_dataset('air_temperature')['air'] - -model = EOF(n_modes=20, standardize=True, use_coslat=True) -model.fit(t2m, dim='time') - -expvar = model.explained_variance_ratio() -compontents = model.components() -scores = model.scores() -``` - -Let's create a plot visualising the results of EOF analysis. - - -```python -def plot_pca_results(mode): - proj = LambertAzimuthalEqualArea(central_latitude=50, central_longitude=-90) - proj_data = PlateCarree() - - fig = plt.figure(figsize=(9, 3)) - gs = GridSpec(1, 2, width_ratios=[1, 2], wspace=0.05) - ax1 = fig.add_subplot(gs[0, 0]) - ax2 = fig.add_subplot(gs[0, 1], projection=proj) - - scores.sel(mode=mode).plot(ax=ax1) - - ax2.add_feature(cfeature.LAND, facecolor='.9') - ax2.add_feature(cfeature.OCEAN, facecolor='.9') - ax2.coastlines(color='.5', lw=0.5) - - kwargs = dict(vmin=-0.15, vmax=0.15, cmap='RdBu_r', transform=proj_data) - compontents.sel(mode=mode).plot(ax=ax2, **kwargs) - - ax1.set_title('Explained variance: {:.1f}%'.format(expvar.sel(mode=mode).values * 100)) - ax2.set_title('') - - plt.show() - -mode_slider = widgets.IntSlider( - value=1, - min=1, - max=10, - step=1, - description='Mode:', - continuous_update=False -) - -widgets.interactive(plot_pca_results, mode=mode_slider) -``` - - - - - interactive(children=(IntSlider(value=1, continuous_update=False, description='Mode:', max=10, min=1), Output(… - - - -### Challenge: interpretability -There are good reasons why EOF analysis is used so often in data compression taks e.g. for images. Its mathematical property of producing components which are orthogonal are one of the reasons why it is such an efficient technique in compressing information. - -In climate science, we often deal with huge data sets which would be too cumbersome to analyze time series by time series and which also inlcude often a high degree of redundancy. Therefore, compressing data sets in their most important modes of variability can help scientist to better understand the underlying patterns, dynamics and variability within the climate system. One of the prime examples of this is the El Nino Southern Oscillation (ENSO) and its associated teleconnections, where EOF analysis has played a crucial role in defining and shaping our first understanding back in [YEAR]. Until today, some of the indices representing the state of ENSO (and other well known climate patterns) are based on EOF analysis. - -However, while climate scientist are mostly concernced with understanding the the data, the EOF analysis' main goal is to compress the data as efficient as possible. One result of that is that the patterns obey the orthogonal property. While handy mathematically, there is no reason to believe that the components (apart from the first mode) bear much meaning. At the end, they are mathematical artifacts which condense the data most efficiently. This has two important implications from that: - -1. Efficiently compressing means that the resulting components are **dense matrices**, i.e. the individual entries are mostly non-zero. This can make interpretation challenging because every pattern is based on the entire field. -2. When applied to climate data, the orthogonal constrain often leads to a well known spatial pattern, known as the **Buell patterns** ([AUTHOR] et al. [YEAR]). These Buell patterns often consist of a unipolar first component, a bipolar second and third component, then tripoles, quadrupoles etc. All too often these patterns are interpreted as a South-North dipole or similar, although the chances are much higher that they represent a mere mathematical artifact. - -You can see both implications play out in the example above. Just scroll through the different modes and you can see that the individual modes are all dense with almost no zero values. You can also clearly spot the Buell patterns in these modes, with mode 1 being unipolar and mode 2 and 3 being bipolar. One could argue that the first mode shows a feature important in the entire domain (e.g. the seasonal cycle) and the second mode represent the difference between the continental and oceanic parts in the seasonal cycle. But wouldn't it be simpler to just have two modes which represent the continental and oceanic seasonal cycle serparately ? - -And indeed we can come closer to such a solution by applying a technique that is called Varimax/Promax rotation. This is explained the following section. - - - - - - diff --git a/docs/sphinx_custom_filters.py b/docs/sphinx_custom_filters.py deleted file mode 100644 index 76c96012..00000000 --- a/docs/sphinx_custom_filters.py +++ /dev/null @@ -1,7 +0,0 @@ -def basename(fullname): - """Extract the basename from a full class path.""" - return fullname.split(".")[-1] - - -def setup(app): - app.builder.templates.environment.filters["basename"] = basename diff --git a/docs/user_guide/faq.rst b/docs/user_guide/faq.rst deleted file mode 100644 index 4ca390ec..00000000 --- a/docs/user_guide/faq.rst +++ /dev/null @@ -1,4 +0,0 @@ -==================================== -Frequently Asked Questions (FAQ) -==================================== - diff --git a/docs/user_guide/xeofs_comparison.rst b/docs/user_guide/xeofs_comparison.rst deleted file mode 100644 index 76ff9c72..00000000 --- a/docs/user_guide/xeofs_comparison.rst +++ /dev/null @@ -1,78 +0,0 @@ - -============================================= -Comparison With Other Packages -============================================= - -xeofs is part of a suite of Python packages dedicated to dimensionality reduction. Its development has been influenced by several notable packages, each with unique and robust features. - -For instance: - -* eofs_, crafted by Andrew Dawson, is known for its compatibility with Dask and xarray, offering an intuitive EOF analysis interface with a 1D sample dimension. -* xMCA_ provides an interface for Maximum Covariance Analysis in xarray. -* pyEOF_ is tailored for Varimax-rotated EOF analysis but is limited to 2D (pandas) input data. - -While all these tools are valuable in their specific realms, they possess certain limitations. xeofs aims to offer a more general toolkit for dimensionality reduction techniques, providing greater flexibility and broader applicability. - - -.. list-table:: - :header-rows: 1 - - * - - - **xeofs** - - **eofs** - - **pyEOF** - - **xMCA** - * - xarray Interface - - ✅ - - ✅ - - ❌ - - ✅ - * - Dask Support - - ✅ - - ✅ - - ❌ - - ❌ - * - Multi-Dimensional - - ✅ - - Only 1D sample dim - - 2D input only - - Only 1D sample dim - * - Missing Values - - ✅ - - ✅ - - ❌ - - ✅ - * - Support for ``xr.Dataset`` - - ✅ - - ❌ - - ❌ - - ❌ - * - Algorithm\ :sup:`1`\ - - Randomized SVD - - Full SVD - - Randomized SVD - - Full SVD - * - Extensible Code Structure - - ✅ - - ❌ - - ❌ - - ❌ - * - **Validation** - - - - - - - - - * - Bootstrapping - - ✅ - - ❌ - - ❌ - - ❌ - -\ :sup:`1`\ **Note on the algorithm:** The computational burden of a full SVD decomposition for an m x n matrix is O(min(mn², m²n)). owever, the randomized SVD, which identifies only the initial k singular values, notably curtails this complexity to O(m n log(k)), making the randomized SVD, as utilized by xeofs, more suitable for expansive datasets. For an in-depth exploration, refer to the `sklearn docs on PCA `_. - - -.. _pyEOF: https://github.com/zhonghua-zheng/pyEOF -.. _xMCA: https://github.com/Yefee/xMCA -.. _eofs: https://github.com/ajdawson/eofs -.. _`GitHub`: https://github.com/xarray-contrib/xeofs/issues - diff --git a/examples/1single/mreof-analysis.jpg b/examples/1single/mreof-analysis.jpg deleted file mode 100644 index 712e17dd..00000000 Binary files a/examples/1single/mreof-analysis.jpg and /dev/null differ diff --git a/examples/1single/rotated_eof.jpg b/examples/1single/rotated_eof.jpg deleted file mode 100644 index 606374db..00000000 Binary files a/examples/1single/rotated_eof.jpg and /dev/null differ diff --git a/examples/1single/sparse_pca.jpg b/examples/1single/sparse_pca.jpg deleted file mode 100644 index fcf8dada..00000000 Binary files a/examples/1single/sparse_pca.jpg and /dev/null differ diff --git a/examples/2cross/plot_mca.py b/examples/2cross/plot_mca.py deleted file mode 100644 index a93d5546..00000000 --- a/examples/2cross/plot_mca.py +++ /dev/null @@ -1,112 +0,0 @@ -""" -Maximum Covariance Analysis -=========================== - -Maximum Covariance Analysis (MCA) between two data sets. -""" - -# Load packages and data: -import matplotlib.pyplot as plt -import numpy as np -import xarray as xr -from cartopy.crs import Orthographic, PlateCarree -from cartopy.feature import LAND -from matplotlib.gridspec import GridSpec - -import xeofs as xe - -# %% -# Create 2 different DataArrays - -t2m = xr.tutorial.load_dataset("air_temperature")["air"] -da1 = t2m.isel(lon=slice(0, 26)) -da2 = t2m.isel(lon=slice(27, None)) - -# %% -# Perform MCA - -mca = xe.cross.MCA(n_modes=20, standardize=False, use_coslat=True) -mca.fit(da1, da2, dim="time") - -# %% -# Get singular vectors, projections (PCs), homogeneous and heterogeneous -# patterns: - -singular_vectors = mca.components() -scores = mca.scores() -hom_pats, pvals_hom = mca.homogeneous_patterns() -het_pats, pvals_het = mca.heterogeneous_patterns() - -# %% -# When two fields are expected, the output of the above methods is a list of -# length 2, with the first and second entry containing the relevant object for -# ``X`` and ``Y``. For example, the p-values obtained from the two-sided t-test -# for the homogeneous patterns of ``X`` are: - -pvals_hom[0] - -# %% -# Create a mask to identifiy where p-values are below 0.05 - -hom_mask = [values < 0.05 for values in pvals_hom] -het_mask = [values < 0.05 for values in pvals_het] - - -# %% -# Plot some relevant quantities of mode 2. - -lonlats = [ - np.meshgrid(pvals_hom[0].lon.values, pvals_hom[0].lat.values), - np.meshgrid(pvals_hom[1].lon.values, pvals_hom[1].lat.values), -] -proj = [ - Orthographic(central_latitude=30, central_longitude=-120), - Orthographic(central_latitude=30, central_longitude=-60), -] -kwargs1 = {"cmap": "BrBG", "vmin": -0.05, "vmax": 0.05, "transform": PlateCarree()} -kwargs2 = {"cmap": "RdBu", "vmin": -1, "vmax": 1, "transform": PlateCarree()} - -mode = 2 - -fig = plt.figure(figsize=(7, 14)) -gs = GridSpec(5, 2) -ax1 = [fig.add_subplot(gs[0, i], projection=proj[i]) for i in range(2)] -ax2 = [fig.add_subplot(gs[1, i], projection=proj[i]) for i in range(2)] -ax3 = [fig.add_subplot(gs[2, i], projection=proj[i]) for i in range(2)] -ax4 = [fig.add_subplot(gs[3, i]) for i in range(2)] - -for i, a in enumerate(ax1): - singular_vectors[i].sel(mode=mode).plot(ax=a, **kwargs1) - -for i, a in enumerate(ax2): - hom_pats[i].sel(mode=mode).plot(ax=a, **kwargs2) - a.scatter( - lonlats[i][0], - lonlats[i][1], - hom_mask[i].sel(mode=mode).values * 0.5, - color="k", - alpha=0.5, - transform=PlateCarree(), - ) -for i, a in enumerate(ax3): - het_pats[i].sel(mode=mode).plot(ax=a, **kwargs2) - a.scatter( - lonlats[i][0], - lonlats[i][1], - het_mask[i].sel(mode=mode).values * 0.5, - color="k", - alpha=0.5, - transform=PlateCarree(), - ) - -for i, a in enumerate(ax4): - scores[i].sel(mode=mode).plot(ax=a) - a.set_xlabel("") - - -for a in np.ravel([ax1, ax2, ax3]): - a.coastlines(color=".5") - a.add_feature(LAND) - -plt.tight_layout() -plt.savefig("mca.jpg") diff --git a/examples/2cross/plot_rotated_mca.py b/examples/2cross/plot_rotated_mca.py deleted file mode 100644 index 2ae0c501..00000000 --- a/examples/2cross/plot_rotated_mca.py +++ /dev/null @@ -1,118 +0,0 @@ -""" -Rotated Maximum Covariance Analysis -=================================== - -Rotated Maximum Covariance Analysis (MCA) between two data sets. -""" - -# Load packages and data: -import matplotlib.pyplot as plt -import numpy as np -import xarray as xr -from cartopy.crs import Orthographic, PlateCarree -from cartopy.feature import LAND -from matplotlib.gridspec import GridSpec - -import xeofs as xe - -# %% -# Create 2 different DataArrays - -t2m = xr.tutorial.load_dataset("air_temperature")["air"] -da1 = t2m.isel(lon=slice(0, 26)) -da2 = t2m.isel(lon=slice(27, None)) - -# %% -# Perform MCA - -mca = xe.cross.MCA(n_modes=20, standardize=False, use_coslat=True) -mca.fit(da1, da2, dim="time") - -# %% -# Apply Varimax-rotation to MCA solution - -rot = xe.cross.MCARotator(n_modes=10) -rot.fit(mca) - -# %% -# Get rotated singular vectors, projections (PCs), homogeneous and heterogeneous -# patterns: - -singular_vectors = rot.components() -scores = rot.scores() -hom_pats, pvals_hom = rot.homogeneous_patterns() -het_pats, pvals_het = rot.heterogeneous_patterns() - -# %% -# When two fields are expected, the output of the above methods is a list of -# length 2, with the first and second entry containing the relevant object for -# ``X`` and ``Y``. For example, the p-values obtained from the two-sided t-test -# for the homogeneous patterns of ``X`` are: - -pvals_hom[0] - -# %% -# Create a mask to identifiy where p-values are below 0.05 - -hom_mask = [values < 0.05 for values in pvals_hom] -het_mask = [values < 0.05 for values in pvals_het] - - -# %% -# Plot some relevant quantities of mode 2. - -lonlats = [ - np.meshgrid(pvals_hom[0].lon.values, pvals_hom[0].lat.values), - np.meshgrid(pvals_hom[1].lon.values, pvals_hom[1].lat.values), -] -proj = [ - Orthographic(central_latitude=30, central_longitude=-120), - Orthographic(central_latitude=30, central_longitude=-60), -] -kwargs1 = {"cmap": "BrBG", "vmin": -0.05, "vmax": 0.05, "transform": PlateCarree()} -kwargs2 = {"cmap": "RdBu", "vmin": -1, "vmax": 1, "transform": PlateCarree()} - -mode = 2 - -fig = plt.figure(figsize=(7, 14)) -gs = GridSpec(5, 2) -ax1 = [fig.add_subplot(gs[0, i], projection=proj[i]) for i in range(2)] -ax2 = [fig.add_subplot(gs[1, i], projection=proj[i]) for i in range(2)] -ax3 = [fig.add_subplot(gs[2, i], projection=proj[i]) for i in range(2)] -ax4 = [fig.add_subplot(gs[3, i]) for i in range(2)] - -for i, a in enumerate(ax1): - singular_vectors[i].sel(mode=mode).plot(ax=a, **kwargs1) - -for i, a in enumerate(ax2): - hom_pats[i].sel(mode=mode).plot(ax=a, **kwargs2) - a.scatter( - lonlats[i][0], - lonlats[i][1], - hom_mask[i].sel(mode=mode).values * 0.5, - color="k", - alpha=0.5, - transform=PlateCarree(), - ) -for i, a in enumerate(ax3): - het_pats[i].sel(mode=mode).plot(ax=a, **kwargs2) - a.scatter( - lonlats[i][0], - lonlats[i][1], - het_mask[i].sel(mode=mode).values * 0.5, - color="k", - alpha=0.5, - transform=PlateCarree(), - ) - -for i, a in enumerate(ax4): - scores[i].sel(mode=mode).plot(ax=a) - a.set_xlabel("") - - -for a in np.ravel([ax1, ax2, ax3]): - a.coastlines(color=".5") - a.add_feature(LAND) - -plt.tight_layout() -plt.savefig("rotated_mca.jpg") diff --git a/examples/3multi/plot_cca.py b/examples/3multi/plot_cca.py deleted file mode 100644 index 70f6a68e..00000000 --- a/examples/3multi/plot_cca.py +++ /dev/null @@ -1,102 +0,0 @@ -""" -Canonical Correlation Analysis -============================== - -In this example, we're going to perform a Canonical Correlation Analysis (CCA) -on three datasets using the ERSSTv5 monthly sea surface temperature (SST) data -from 1970 to 2022. We divide this data into three areas: the Indian Ocean, -the Pacific Ocean, and the Atlantic Ocean. Our goal is to perform CCA on these -regions. - -First, we'll import the necessary modules. -""" - -import cartopy.crs as ccrs -import matplotlib.pyplot as plt -import xarray as xr -from matplotlib.gridspec import GridSpec - -import xeofs as xe - -# %% -# Next, we load the data and compute the SST anomalies. This removes the -# monthly climatologies, so the seasonal cycle doesn't impact our CCA. - -sst = xr.tutorial.load_dataset("ersstv5").sst -sst = sst.groupby("time.month") - sst.groupby("time.month").mean("time") - - -# %% -# Now, we define the three regions of interest and store them in a list. - -indian = sst.sel(lon=slice(35, 115), lat=slice(30, -30)) -pacific = sst.sel(lon=slice(130, 290), lat=slice(30, -30)) -atlantic = sst.sel(lon=slice(320, 360), lat=slice(70, 10)) - -data_list = [indian, pacific, atlantic] - -# %% -# We now perform CCA. Since we are dealing with a high-dimensional feature space, we first -# perform PCA to reduce the dimensionality (this is kind of a regularized CCA) by setting -# ``pca=True``. By setting the ``variance_fraction`` keyword argument, we specify that we -# want to keep the number of PCA modes that explain 90% of the variance in each of the -# three data sets. -# -# An important parameter is ``init_pca_modes``. It specifies the number -# of PCA modes that are initially compute before truncating them to account for 90 %. If this -# number is small enough, randomized PCAs will be performed instead of the full SVD decomposition -# which is much faster. We can also specify ``init_pca_modes`` as a float (0 < x <= 1), -# in which case the number of PCA modes is given by the fraction of the data matrix's rank -# The default is set to 0.75 which will ensure that randomized PCAs are performed. -# -# Given the nature of SST data, we might lower it to something like 0.3, since -# we expect that most of the variance in the data will be explained by a small -# number of PC modes. -# -# Note that if our initial PCA modes don't hit the 90% variance target, ``xeofs`` -# will give a warning. - -model = xe.multi.CCA( - n_modes=2, - use_coslat=True, - pca=True, - variance_fraction=0.9, - init_pca_modes=0.30, -) -model.fit(data_list, dim="time") -components = model.components() -scores = model.scores() - -# %% -# Let's look at the canonical loadings (components) of the first mode. - -mode = 1 - -central_longitudes = [ - indian.lon.median().item(), - pacific.lon.median().item(), - pacific.lon.median().item(), -] -projections = [ccrs.PlateCarree(central_longitude=lon) for lon in central_longitudes] - -fig = plt.figure(figsize=(12, 2.5)) -gs = GridSpec(1, 4, figure=fig, width_ratios=[2, 4, 1, 0.2]) -axes = [fig.add_subplot(gs[0, i], projection=projections[i]) for i in range(3)] -cax = fig.add_subplot(1, 4, 4) -kwargs = dict(transform=ccrs.PlateCarree(), vmin=-1, vmax=1, cmap="RdBu_r", cbar_ax=cax) -components[0].sel(mode=mode).plot(ax=axes[0], **kwargs) -components[1].sel(mode=mode).plot(ax=axes[1], **kwargs) -im = components[2].sel(mode=mode).plot(ax=axes[2], **kwargs) -fig.colorbar(im, cax=cax, orientation="vertical") -for ax in axes: - ax.coastlines() - ax.set_title("") - -# %% -# And lastly, we'll check out the canonical variates (scores) of the first mode. - -fig, ax = plt.subplots(figsize=(12, 4)) -scores[0].sel(mode=mode).plot(ax=ax, label="Indian Ocean") -scores[1].sel(mode=mode).plot(ax=ax, label="Central Pacific") -scores[2].sel(mode=mode).plot(ax=ax, label="North Atlantic") -ax.legend() diff --git a/examples/4validation/bootstrap.jpg b/examples/4validation/bootstrap.jpg deleted file mode 100644 index 9d36cd14..00000000 Binary files a/examples/4validation/bootstrap.jpg and /dev/null differ diff --git a/examples/4validation/plot_bootstrap.py b/examples/4validation/plot_bootstrap.py deleted file mode 100644 index 1cce033c..00000000 --- a/examples/4validation/plot_bootstrap.py +++ /dev/null @@ -1,95 +0,0 @@ -""" -Significance testing of EOF analysis via bootstrap -=================================================== - -Test the significance of individual modes and obtain confidence intervals -for both EOFs and PCs. -""" - -# Load packages and data: -import matplotlib.pyplot as plt -import numpy as np -import xarray as xr -from cartopy.crs import Orthographic, PlateCarree -from matplotlib.gridspec import GridSpec - -import xeofs as xe - -# %% - -t2m = xr.tutorial.load_dataset("air_temperature")["air"] - -# %% -# Perform EOF analysis - -model = xe.single.EOF(n_modes=5, standardize=False) -model.fit(t2m, dim="time") -expvar = model.explained_variance_ratio() -components = model.components() -scores = model.scores() - - -# %% -# Perform bootstrapping of the model to identy the number of significant modes. -# We perform 50 bootstraps. -# Note - if computationallly feasible - you typically want to choose higher -# numbers of bootstraps e.g. 1000. - -n_boot = 50 - -bs = xe.validation.EOFBootstrapper(n_bootstraps=n_boot) -bs.fit(model) -bs_expvar = bs.explained_variance() -ci_expvar = bs_expvar.quantile([0.025, 0.975], "n") # 95% confidence intervals - -q025 = ci_expvar.sel(quantile=0.025) -q975 = ci_expvar.sel(quantile=0.975) - -is_significant = q025 - q975.shift({"mode": -1}) > 0 -n_significant_modes = ( - is_significant.where(is_significant is True).cumsum(skipna=False).max().fillna(0) -) -print("{:} modes are significant at alpha=0.05".format(n_significant_modes.values)) - -# %% -# The bootstrapping procedure identifies 3 significant modes. We can also -# compute the 95 % confidence intervals of the EOFs/PCs and mask out -# insignificant elements of the obtained EOFs. - -ci_components = bs.components().quantile([0.025, 0.975], "n") -ci_scores = bs.scores().quantile([0.025, 0.975], "n") - -is_sig_comps = np.sign(ci_components).prod("quantile") > 0 - - -# %% -# Summarize the results in a figure. - - -lons, lats = np.meshgrid(is_sig_comps.lon.values, is_sig_comps.lat.values) -proj = Orthographic(central_latitude=30, central_longitude=-80) -kwargs = {"cmap": "RdBu", "vmin": -0.05, "vmax": 0.05, "transform": PlateCarree()} - -fig = plt.figure(figsize=(10, 16)) -gs = GridSpec(5, 2) -ax1 = [fig.add_subplot(gs[i, 0], projection=proj) for i in range(5)] -ax2 = [fig.add_subplot(gs[i, 1]) for i in range(5)] - -for i, (a1, a2) in enumerate(zip(ax1, ax2)): - a1.coastlines(color=".5") - components.isel(mode=i).plot(ax=a1, **kwargs) - a1.scatter( - lons, - lats, - is_sig_comps.isel(mode=i).values * 0.5, - color="k", - alpha=0.5, - transform=PlateCarree(), - ) - ci_scores.isel(mode=i, quantile=0).plot(ax=a2, color=".3", lw=".5", label="2.5%") - ci_scores.isel(mode=i, quantile=1).plot(ax=a2, color=".3", lw=".5", label="97.5%") - scores.isel(mode=i).plot(ax=a2, lw=".5", alpha=0.5, label="PC") - a2.legend(loc=2) - -plt.tight_layout() -plt.savefig("bootstrap.jpg")