Skip to content
/ rubaliz Public

Determines the active mesopelagic zone boundaries from CTD signals

License

Notifications You must be signed in to change notification settings

RobeeF/rubaliz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RUBALIZ

RUBALIZ_logo


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.

conda_install
conda_install2

Open a command-line console (e.g. cmd, prompt, bash, etc.), create and activate a new Python environment:

conda create --name rubaliz-env python=3.7 # Activate an environment called rubaliz-env
conda rubaliz-env extract # Activate your environment

Then, install the rubaliz package. Using pip:

pip install rubaliz

or alternatively using conda (from Anaconda3):

conda install -c robee rubaliz

Getting started

Note: If you are using Spyder to run your code, please change your running environment to rubaliz-env

The first step is to get the variable names according to your specific CTD file format. If your files are in seabird format, please run the following commands to get the column names:

from seabird.cnv import fCNV
profile = fCNV('C:/your_path_to_data')
profile.keys()

Then, using these variable names, 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 may 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 model

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
README_cmd1

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()
README_cmd2

To make an estimation of the sensibility of the boundaries to each input variable:

ruba.sensitivity_analysis()
README_cmd3

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)
README_cmd4

Current caveats

  • The package works for Python 3.7, support for newer version is for the moment not planned
  • In Spyder, do not forget to change your environment for the newly create "rubaliz-env" environment

About

Determines the active mesopelagic zone boundaries from CTD signals

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages