netsse.model.bathymetry
=======================

.. py:module:: netsse.model.bathymetry

.. autoapi-nested-parse::

   Retrieve and process **bathymetry** information.

   .. 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.2). Technical University of Denmark,
           GitLab. February 2026. https://doi.org/10.11583/DTU.26379811.

   *Last updated on 20-02-2026 by R.E.G. Mounet*



Functions
---------

.. autoapisummary::

   netsse.model.bathymetry.load_bathymetry


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

.. py:function:: load_bathymetry(lonmin, lonmax, latmin, latmax, zip_file_url=None)

   Retrieve, read, and process a zip file from Natural Earth containing bathymetry shapefiles.

   The function reads the shapefiles contained in the zip file using the `cartopy.io.shapereader` module. The shapefiles are sorted by depth, from the surface to the bottom. The function returns a dictionary containing the shapefiles and a list of the depths in the shapefiles.

   :param lonmin: Minimum longitude of the area of interest in degrees East.
   :type lonmin: float
   :param lonmax: Maximum longitude of the area of interest in degrees East.
   :type lonmax: float
   :param latmin: Minimum latitude of the area of interest in degrees North.
   :type latmin: float
   :param latmax: Maximum latitude of the area of interest in degrees North.
   :type latmax: float
   :param zip_file_url: URL of the zip file containing the shapefiles. By default, the function accesses the bathymetry data from Natural Earth through the Amazon Web Services (https://registry.opendata.aws/naturalearth).
   :type zip_file_url: str, optional

   :returns: * **depths** (*list*) -- List of the depths in the shapefiles for the specified area.
             * **shp_dict** (*dict*) -- Dictionary containing the shapefiles.

   .. seealso::

      :py:obj:`netsse.tools.viz.plot_bathymetry`
          Plot the bathymetry map.

   .. rubric:: References

   1. North American Cartographic Information Society. "AWS Marketplace: Natural Earth". Amazon
      Sustainability Data Initiative, https://registry.opendata.aws/naturalearth (accessed on 25-03-2025).
   2. Natural Earth (2009-2025). Free vector and raster map data.
      https://www.naturalearthdata.com/ (accessed on 25-03-2025).
   3. Met Office (2010-2015). Cartopy: a cartographic Python library with a Matplotlib interface.
      Exeter, Devon, UK. https://scitools.org.uk/cartopy (accessed on 25-03-2025).

   .. rubric:: Example

   >>> depths, shp_dict = load_bathymetry(lonmin=0, lonmax=10, latmin=50, latmax=60)


