项目作者: so-wise

项目描述 :
Full scripts to generate figures for "Defining Southern Ocean fronts using unsupervised classification"
高级语言: Python
项目地址: git://github.com/so-wise/so-fronts.git
创建时间: 2020-12-04T14:29:10Z
项目社区:https://github.com/so-wise/so-fronts

开源协议:MIT License

下载


Defining Southern Ocean fronts using unsupervised classification

License: MIT
Python version 3.8.8 used
Python code style: black
Documentation Status / link to documentation
Most recent Zenodo release

Paper: https://doi.org/10.5194/os-17-1545-2021

Preprint: https://doi.org/10.5194/os-2021-40

Presentation at AGU2021: https://doi.org/10.1002/essoar.10507114.1

Short description

In the Southern Ocean, fronts delineate water masses, which correspond to upwelling
and downwelling branches of the overturning circulation. Classically, oceanographers
define Southern Ocean fronts as a small number of continuous linear features that
encircle Antarctica. However, modern observational and theoretical developments are
challenging this traditional framework to accommodate more localized views of fronts
[Chapman et al. 2020].

Here we present code for implementing two related methods for calculating fronts from
oceanographic data. The first method uses unsupervised classification (specifically,
Gaussian Mixture Modeling or GMM) and a novel interclass metric to define fronts.
This approach produces a discontinuous, probabilistic view of front location,
emphasising the fact that the boundaries between water masses are not uniformly sharp
across the entire Southern Ocean.

The second method uses Sobel edge detection to highlight
rapid changes [Hjelmervik & Hjelmervik, 2019].
This approach produces a more local view of fronts,
with the advantage that it can highlight the movement
of individual eddy-like features (such as the Agulhas rings).

  1. Chapman, C. C., Lea, M.-A., Meyer, A., Sallee, J.-B. & Hindell, M.
    Defining Southern Ocean fronts and their influence on biological and
    physical processes in a changing climate. Nature Climate Change (2020).
    https://doi.org/10.1038/s41558-020-0705-4

  2. Maze, G. et al. Coherent heat patterns revealed by unsupervised
    classification of Argo temperature profiles in the North Atlantic Ocean.
    Progress in Oceanography (2017).
    https://doi.org/10.1016/j.pocean.2016.12.008,
    https://doi.org/10.5281/zenodo.3906236

  3. Hjelmervik, K. B. & Hjelmervik, K. T. Detection of oceanographic fronts
    on variable water depths using empirical orthogonal functions.
    IEEE Journal of Oceanic Engineering (2019).
    https://doi.org/10.1109/JOE.2019.2917456

I metric for K=5

I metric for K=5

Getting started

  • Make the environment:

    1. make env
  • Activate the environment in conda:

    1. conda activate ./env
  • Change the settings in src.constants to set download location etc.

  • Download data (get_zip: 1694.64639 s):

    1. python3 src/data_loading/bsose_download.py
  • Make I-metric:

    1. python3 src/models/batch_i_metric.py
  • Make figures:

    1. python3 main.py

Project Organization

  1. ├── LICENSE
  2. ├── Makefile <- Makefile with commands like `make env` or `make `
  3. ├── README.md <- The top-level README for developers using this project.
  4. ├── main.py <- The main python script to run.
  5. |
  6. ├── figures <- .png images with non-enumerated names.
  7. ├── requirements <- Directory containing the requirement files.
  8. ├── setup.py <- makes project pip installable (pip install -e .) so src can be imported from jupyter notebooks etc.
  9. |
  10. ├── src <- Source code for use in this project.
  11. | |
  12. ├── __init__.py <- Makes src a Python module
  13. | |
  14. ├── data <- KO fronts to plot, other data.
  15. ├── data_loading <- Scripts to download and name data.
  16. ├── models <- Make I-metric and Sobel edge detection directory.
  17. ├── plot <- plotting functions directory
  18. | |
  19. ├── plot_utils <- plotting utilities directory
  20. | |
  21. ├── preprocessing <- preprocessing scripts (to transform to density etc.).
  22. | |
  23. | ├── tests <- Scripts for unit tests of your functions
  24. | |
  25. | ├── animate.py <- animate i-metric.
  26. | ├── constants.py <- contains majority of run parameters that can be changed.
  27. | ├── make_figures.py <- make all figures in one long script.
  28. | ├── move_figures.py <- Move figures script (now unnecessary).
  29. | | Changes figure names to Figure-X.png etc.
  30. | └── time_wrapper.py <- time wrapper to time parts of the program.
  31. └── setup.cfg <- setup configuration file for linting rules

Requirements

  • Anaconda, with conda working in shell.
  • make in shell.
  • Python 3.6+ (final run for paper used python==3.8.8)

Project template created by the
Cambridge AI4ER Cookiecutter.