A package to detect the boundaries of the active mesopelagic zone
Project description
RUBALIZ
RUBALIZ stands for RUpture-Based detection method for the Active mesopeLagIc Zone. It determines the active mesopelagic zone boundaries from CTD casts, using five variables:
- Fluorescence
- [02]
- Potential temperature
- Salinity
- Density
RUBALIZ was introduced in Fuchs, Baumas et al. (2022).
Installation
The package can be installed using pip or conda. If you do not have python installed, the simplest is to install Anaconda3 on the host machine. During the installation: Please make sure to tick the "Add Anaconda3 to my Path" box, even if Anaconda displays a red message (see screenshot below). If you did not, please uninstall and reinstall Anaconda3.
Then, open a command-line console (e.g. cmd, prompt, bash, etc.) and please copy-paste the corresponding line in it: Using pip:
pip install rubaliz
or alternatively using conda (from Anaconda3):
conda install -c robee rubaliz
Getting started
The metadata have to be filled in a dictionary as shown below:
from rubaliz import rubaliz
# Define CTD files info
info_dict = {'cruise_name': 'DY032',
'station_name': 'PAP',
'ub_range': [280, 320],
'lb_range': [1000, 1300],
'pres_col': 'PRES',
'Fluorescence': 'flC',
'Oxygen': 'oxygen',
'Pot. temp.': 'potemperature',
'Salinity': 'PSAL',
'Density': 'sigma-00',
'files_format': '.cnv',
'sep': None,
'data_folder': 'your_path_to_data'}
The cruise and station names are optional, one can set them to None if not wanted. The maximum depth ranges to look for the upper bound and lower boundaries of the active mesopelagic zone, ub_range and lb_range, are set to [280, 320] and [1000, 1300] by default, respectively. These values have been chosen as the mesopelagic layer is classically assumed to lie between 200 and 1000 meters. These maximum ranges take into account this a priori knowledge with a security margin (max. 280m deep instead of 200m for the upper boundary.)
The pres_col is the name of the column containing the pressure data in the CTD cast. Similarly, the Fluorescence, Oxygen, Pot. temp., Salinity and Density stand for the column names of the fluorescence, oxygen, potential temperature, salinity data, and density, respectively. If one of these five signals is missing, please set it to None. Please ensure that your files contain only CTD downward casts (no upward casts) to avoid potential unexpected behaviors.
The data_folder contains all the CTD casts for a given (cruise, station) couple. An example of such a cast is given in the data folder. Be careful on Windows machines, you will have to replace "\" in the path with the standard "/".
RUBALIZ can handle '.cnv', '.txt' and '.csv' raw files (please do not use pre-processed files such as bodc-processed files). For '.csv' and '.txt' files, a separator (sep) has to be set (e.g. "," or ";" or "\s+" or "\t"). CTD casts present a significant format variety and this package has tried to handle most of them. Yet, it might be the case that you need to pre-process your CTD casts a bit to make things work. Besides, please be careful to have the same column names in info_dict as in your raw files (many errors stem from the encoding of special characters).
The model can be run in the following way in Spyder/via the console, etc.:
ruba = rubaliz(info_dict) # Fetch the pieces of information
ruba.fit() # Adjust the mode
Then the results are accessible in this way:
print(ruba.boundaries) # Upper and lower boundaries estimates and standard deviations.
print(ruba.nb_ctd_ub) # The number of ctd used for the upper boundary determination
print(ruba.nb_ctd_lb) # The number of ctd used for the lower boundary determination
As we are using the example file given in the data_folder, there is only one CTD cast to determine the upper and lower boundaries.
To graphically analyze the boundaries found:
ruba.display_boundaries()
To make an estimation of the sensibility of the boundaries to each input variable:
ruba.sensitivity_analysis()
Finally, users interested in only determining the upper bound of the active mesopelagic layer (i.e. the limit of the upper ocean zone) can do it by running:
ruba = rubaliz(info_dict)
ruba.fit()
upper_data = ruba.format_data([0, ruba.ub_range[1]])
upper_bound= ruba.rupture_confidence_interval(ruba.ub_data, 1, [ruba.ub_range[0], ruba.ub_range[1]])
print(upper_bound)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rubaliz-0.1.11.tar.gz
.
File metadata
- Download URL: rubaliz-0.1.11.tar.gz
- Upload date:
- Size: 34.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5122e42333b3450592c5712ea9aeb5aff215113981859cb92ce99eda09d246cf |
|
MD5 | 71afceacd5cea19d5ec50d29e305a636 |
|
BLAKE2b-256 | 1663987ed3e48735ab52786bd4d4031fa78289526303c886cb0f75ad24147a63 |
File details
Details for the file rubaliz-0.1.11-py3-none-any.whl
.
File metadata
- Download URL: rubaliz-0.1.11-py3-none-any.whl
- Upload date:
- Size: 39.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14a744bef2ac79a3375f49872c0af1da3ae3313bf68c033a9993884db4e4505f |
|
MD5 | 74911a77ce62b7acc8e965ec5d4b463d |
|
BLAKE2b-256 | 903bae02ac1e20d6a32bed48ca9ea7595e3339b433ebd6a475ef4a2642d97894 |