.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_auto_examples/multisensors_cube.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_multisensors_cube.py: Create a multisensor cube ================================================================= With Sentinel-2 and Landsat, using Sentinel-2 spatial resolution. .. GENERATED FROM PYTHON SOURCE LINES 9-11 Import librairies ------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 11-16 .. code-block:: Python from matplotlib import pyplot as plt from earthdaily import EarthDataStore, datasets .. GENERATED FROM PYTHON SOURCE LINES 17-19 Set parameters ------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 21-23 Init earthdatastore with environment variables or default credentials ---------------------------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 23-35 .. code-block:: Python eds = EarthDataStore() collections = ["sentinel-2-l2a", "landsat-c2l2-sr"] datetime = ["2022-07-20", "2022-09-01"] intersects = datasets.load_pivot_corumba() assets = ["blue", "green", "red", "nir"] mask_with = "native" clear_cover = 50 resampling = "cubic" cross_calibration_collection = "sentinel-2-l2a" .. GENERATED FROM PYTHON SOURCE LINES 36-38 Create the multisensors datacube ------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 38-55 .. code-block:: Python datacube = eds.datacube( collections, assets=assets, datetime=datetime, intersects=intersects, mask_with=mask_with, clear_cover=clear_cover, cross_calibration_collection=cross_calibration_collection, ) # Add the NDVI datacube = datacube.ed.add_indices(["NDVI"]) # Load in memory datacube = datacube.load() .. GENERATED FROM PYTHON SOURCE LINES 56-58 See the evolution in RGB ------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 58-62 .. code-block:: Python datacube.ed.plot_rgb(col_wrap=3) plt.show() .. image-sg:: /_auto_examples/images/sphx_glr_multisensors_cube_001.png :alt: time = 2022-07-21, time = 2022-07-26, time = 2022-07-31, time = 2022-08-05, time = 2022-08-15, time = 2022-08-20, time = 2022-08-25, time = 2022-08-30 :srcset: /_auto_examples/images/sphx_glr_multisensors_cube_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 63-65 See the NDVI evolution ------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 65-69 .. code-block:: Python datacube["NDVI"].ed.plot_band(col_wrap=3, vmin=0, vmax=0.8, cmap="Greens") plt.show() .. image-sg:: /_auto_examples/images/sphx_glr_multisensors_cube_002.png :alt: time = 2022-07-21, time = 2022-07-26, time = 2022-07-31, time = 2022-08-05, time = 2022-08-15, time = 2022-08-20, time = 2022-08-25, time = 2022-08-30 :srcset: /_auto_examples/images/sphx_glr_multisensors_cube_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 70-72 See the NDVI mean evolution ------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 72-76 .. code-block:: Python datacube["NDVI"].groupby("time").mean(...).plot.line(x="time") plt.title("NDVI evolution") plt.show() .. image-sg:: /_auto_examples/images/sphx_glr_multisensors_cube_003.png :alt: NDVI evolution :srcset: /_auto_examples/images/sphx_glr_multisensors_cube_003.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 16.545 seconds) .. _sphx_glr_download__auto_examples_multisensors_cube.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: multisensors_cube.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: multisensors_cube.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: multisensors_cube.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_