netsse.dataset
==============

.. py:module:: netsse.dataset

.. autoapi-nested-parse::

   Functions for handling **example datasets** that are used in the example scripts included in the NetSSE documentation for illustration purposes.

   .. dropdown:: Copyright (C) 2023-2026 Technical University of Denmark, R.E.G. Mounet
       :color: primary
       :icon: law

       *This code is part of the NetSSE software.*

       NetSSE is free software: you can redistribute it and/or modify it under
       the terms of the GNU General Public License as published by the Free
       Software Foundation, either version 3 of the License, or (at your
       option) any later version.

       NetSSE is distributed in the hope that it will be useful, but WITHOUT
       ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       for more details.

       You should have received a copy of the GNU General Public License along
       with this program.  If not, see https://www.gnu.org/licenses/.

       To credit the author, users are encouraged to use below reference:

       .. code-block:: text

           Mounet, R. E. G., & Nielsen, U. D. NetSSE: An open-source Python package
           for network-based sea state estimation from ships, buoys, and other
           observation platforms (version 2.3). Technical University of Denmark,
           GitLab. July 2026. https://doi.org/10.11583/DTU.26379811.

   *Last updated on 04-06-2026 by R.E.G. Mounet*



Functions
---------

.. autoapisummary::

   netsse.dataset.load_example_data


Module Contents
---------------

.. py:function:: load_example_data(name, **kwargs)

   Load an example dataset from the NetSSE package's data directory.

   :param name: Name of the dataset file, including the extension (e.g., ``"example_WP_meas.csv"``).
   :type name: str
   :param \*\*kwargs: Additional keyword arguments to pass to the data loading function (e.g., ``index_col=0`` for ``pd.read_csv``).

   :returns: The loaded dataset as a pandas DataFrame (for CSV files) or a NumPy array (for TXT files).
   :rtype: pd.DataFrame or np.ndarray

   :raises ValueError: If the file format is unsupported (not CSV or TXT).

   .. rubric:: Examples

   Load a CSV dataset as a pandas DataFrame:

   >>> df = load_example_data("example_WP_meas.csv", index_col=0)

   Load a TXT dataset as a NumPy array:

   >>> arr = load_example_data("example_spectrum.txt", delimiter="\t")


