.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/timeseries.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_gallery_timeseries.py: Timeseries ============================================================================= .. GENERATED FROM PYTHON SOURCE LINES 7-8 This notebook will give examples on how to use data from the Norkyst v3 ocean model to make timeseries. Data is accessed through the Norwegian Meteorological Insitute's THREDDS server: https://thredds.met.no/thredds/catalog.html. .. GENERATED FROM PYTHON SOURCE LINES 10-11 Importing useful Python packages .. GENERATED FROM PYTHON SOURCE LINES 11-15 .. code-block:: Python import numpy as np import matplotlib.pyplot as plt import xarray as xr .. GENERATED FROM PYTHON SOURCE LINES 16-17 Reading in the path from thredds.met.no, using an OPENDAP url .. GENERATED FROM PYTHON SOURCE LINES 17-22 .. code-block:: Python path = 'https://thredds.met.no/thredds/dodsC/fou-hi/norkystv3_800m_m00_be' # Opening a netCDF file as xarray dataset ds = xr.open_dataset(path) .. GENERATED FROM PYTHON SOURCE LINES 23-24 Example from an arbitrary grid point. .. GENERATED FROM PYTHON SOURCE LINES 24-27 .. code-block:: Python ds.temperature.isel(time=slice(0,100) ,X=1000, Y=1000, depth=0).plot() plt.show() .. _sphx_glr_download_gallery_timeseries.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: timeseries.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: timeseries.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: timeseries.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_