.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/G2/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_G2_bootstrap.py: ================== Bootstraping error ================== Simple example of bootstrap on G2 dataset from the N2CLS GTO. .. GENERATED FROM PYTHON SOURCE LINES 11-12 First import the :class:`nikamap.analysis.Bootstrap` class .. GENERATED FROM PYTHON SOURCE LINES 12-16 .. code-block:: Python from pathlib import Path from nikamap import Bootstrap .. GENERATED FROM PYTHON SOURCE LINES 17-18 This define the root directory where all the data ... .. GENERATED FROM PYTHON SOURCE LINES 18-21 .. code-block:: Python DATA_DIR = Path("/data/NIKA/Reduced/G2_COMMON_MODE_ONE_BLOCK/v_1") .. GENERATED FROM PYTHON SOURCE LINES 22-23 can be retrieved using a simple regular expression .. GENERATED FROM PYTHON SOURCE LINES 23-28 .. code-block:: Python filenames = list(DATA_DIR.glob("*/map.fits")) filenames .. GENERATED FROM PYTHON SOURCE LINES 29-33 Generate a bootstrap dataset for all the maps. .. note:: At the moment, this is very memory demanding as we use ```map_size * (len(filenames) + n_bootstrap))``` .. GENERATED FROM PYTHON SOURCE LINES 33-38 .. code-block:: Python nm = Bootstrap(filenames, n_bootstrap=200, ipython_widget=True) .. GENERATED FROM PYTHON SOURCE LINES 39-42 In the resulting :class:`nikamap.NikaMap` object, the uncertainty as been computed using the bootstrap technique. .. warning:: The resulting uncertainty map could still be biased, see https://gitlab.lam.fr/N2CLS/NikaMap/issues/4 .. GENERATED FROM PYTHON SOURCE LINES 42-44 .. code-block:: Python _ = nm.plot_SNR(cbar=True) .. _sphx_glr_download_auto_examples_G2_bootstrap.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: bootstrap.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: bootstrap.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: bootstrap.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_