MARIS companion package and tutorials
Project description
MARISCO
The IAEA Marine Radioactivity Information System (MARIS) provides open access to radioactivity measurements in marine environments. Developed by the IAEA Marine Environmental Laboratories in Monaco, MARIS offers data on seawater, biota, sediment, and suspended matter.
This Python package includes command-line tools to convert MARIS
datasets into NetCDF
or .csv formats, enhancing compatibility with various scientific and
data analysis software.
Core Concept: Handlers
marisco is built around the concept of handlers - specialized
modules designed to convert MARIS datasets into NetCDF format. Each
handler is tailored to a specific data provider and implemented as a
dedicated Jupyter notebook.
Literate Programming Approach
We’ve adopted a Literate Programming approach, which means:
- Documentation: Each handler serves as comprehensive documentation.
- Code Reference: The notebooks contain the actual implementation code.
- Communication Tool: They facilitate discussions with data providers about discrepancies or inconsistencies.
Powered by nbdev
To achieve this, we leverage nbdev, a powerful tool that allows us to:
- Write code within Jupyter notebooks
- Automatically export relevant parts as dedicated Python modules
This approach bridges the gap between documentation and implementation, ensuring they remain in sync.
See It in Action
For a concrete example of this approach, check out our OSPAR dataset handler implementation.
List of currently available handlers
MARISCO includes a suite of specialized data handlers designed to:
- Convert provider-specific data formats into standardized MARIS NetCDF files
- Ensure data quality and consistency across providers
- Facilitate integration with the MARIS marine radioactivity database
- Support automated data processing workflows
The following handlers are currently implemented:
| Handler | Description | Link to Data Source |
|---|---|---|
| MARIS Legacy | All legacy MARIS datasets from the MARIS Master Database | - |
| HELCOM | HELCOM marine environment protection datasets | HELCOM |
| OSPAR | OSPAR marine environment datasets | ODIMS OSPAR |
| TEPCO | TEPCO Fukushima monitoring data | TEPCO Monitoring |
| GEOTRACES | BODC GEOTRACES oceanographic data | GEOTRACES IDP2021 |
Install
Now, to install marisco simply run
pip install marisco
Once successfully installed, run the following command:
maris_init
This command:
- creates a
.marisco/directory containing various configuration/configurable files ((below)) in your/homedirectory; - creates a
configs.tomlfile containing default but configurable settings (default paths, …); - downloads several MARIS DB nomenclature/lookup table into
.marisco/lut/directory; - downloads
maris-template.nc, the MARIS NetCDF4 template.
Zotero API key
Upon conversion, marisco will automatically retrieve the bibliographic
metadata of each MARIS dataset from Zotero.
To do so, you need to define the following environment variable
ZOTERO_API_KEY containing the MARIS Zotero API key. Please contact the
MARIS team to get your API key.
Getting started
Command line utilities
All commands accept a -h argument to get access to its documentation.
maris_init
Download configuration file, NetCDF MARIS template and required lookup tables (nomenclatures).
maris_to_nc
Convert helcom, geotraces, tepco or ospar marine radioactivity
datasets to MARIS NetCDF4 format.
usage: maris_to_nc [-h] [--src SRC] ds dest
positional arguments:
ds Name of the dataset to encode as NetCDF4
dest Output path for NetCDF file
options:
-h, --help show this help message and exit
--src SRC Optional input data path only required for the 'GEOTRACES' dataset
For instance: maris_to_nc ospar 191-OSPAR-2024.nc
maris_db_to_nc
The MARIS Master Database integrates two types of datasets:
- Historical datasets retrieved from published scientific papers
- Ongoing monitoring data from international programs like
HELCOM,OSPAR,TEPCO, andGEOTRACES
This command-line utility converts MARIS datasets from their legacy format to NetCDF4, making them more accessible for modern data analysis workflows. Users can either convert the entire database or specify particular datasets by their reference IDs for selective conversion.
usage: maris_db_to_nc [-h] [--ref_ids REF_IDS] src dest
Convert MARIS legacy database to NetCDF4 format. If ref_ids is provided as comma-separated values, only encodes those subsets.
positional arguments:
src Path to MARIS database dump as `.txt` file
dest Output path for NetCDF file(s)
options:
-h, --help show this help message and exit
--ref_ids REF_IDS Optional comma-separated reference IDs (e.g., "123,456,789") (default: )
For instance:
maris_db_to_nc "~/pro/data/maris/2024-11-20 MARIS_QA_shapetype_id=1.txt" ~/pro/tmp/output- or
maris_db_to_nc "~/pro/data/maris/2024-11-20 MARIS_QA_shapetype_id=1.txt" ~/pro/tmp/output --ref_ids="16,30"for a subset of the MARIS Master Database.
Development
The MARIS NetCDF template is generated from nbs/files/cdl/maris.cdl
Common Data Language (CDL) file as defined by
Unidata. To generate the MARIS NetCDF
template nbs/files/nc/maris-template.nc, install the
NetCDF-C
utilities, once in Marisco home directory, run:
ncgen -4 -o nc/maris-template.nc cdl/maris.cdl
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file marisco-0.9.5.tar.gz.
File metadata
- Download URL: marisco-0.9.5.tar.gz
- Upload date:
- Size: 63.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26e9fd41123839ef0c51666df54d9cbef87a4f11858dbc03e228d2cd1608d653
|
|
| MD5 |
d6d73dbe2b0aeab89430cfe39e2d8560
|
|
| BLAKE2b-256 |
0a814b3d5322c6e17a942b63303a3da69131b9218ec5927ea2caa712c3678265
|
File details
Details for the file marisco-0.9.5-py3-none-any.whl.
File metadata
- Download URL: marisco-0.9.5-py3-none-any.whl
- Upload date:
- Size: 69.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10b95f8014c454a56d217de1a327b28167551e7c3381bd93d48c4411db5283e9
|
|
| MD5 |
0611e6d6c62a00b811d5d5b93f541f1d
|
|
| BLAKE2b-256 |
4ea476e90c11e3a39c869729fd71a9d917a6de1a62002af03e628b2e35a6c31d
|