Skip to main content

Python interface for calling Seabird CTD processing commands

Project description

Seabird-Processing

Python bindings for executing Seabird SBE processing tools.

Description

This library contains an API for executing seabird SBE processing modules on Seabird data files (hex and cnv). The modules all accept text as input which allows for more convenient access to the command line functions which would normally require a file path as input. Under the hood, this library simply saves temporary files which are then processed through SBE, read into memory, and returned as in-memory text.

Installation

Pre-requisites

An installation of the Seabird Processing Suite is required to run these modules since they simply provide an abstraction of the command line tools provided by Seabird.

Install with pip

To install this tool in your current python environment do:

pip install seabird-processing

Configure the tool with the location of your Seabird Processing Suite installation by setting the SBE_PROCESSING_PATH environment variable. For example, if you installed the software to C:\Program Files (x86)\Seabird\SBEDataProcessing-Win32 then you would set the environment variable SBE_PROCESSING_PATH=C:\Program Files (x86)\Seabird\SBEDataProcessing-Win32\. By default, it is assumed that the software is installed to C:\Program Files (x86)\Seabird\SBEDataProcessing-Win32.

Usage

There are two ways to use this library. The first is to use individual functions which correspond one-to-one with the SBE processing modules. The second is to use the Pipeline class which allows you to chain together multiple processing modules.

Command line functions

from seabird_processing import dat_cnv, filter_

xmlcon = './xmlcon/19-7467.xmlcon'

cnvfile = dat_cnv('./seabird_data_file.hex', './output/dir', xmlcon, './psa/DatCnv.psa')
# "filter" is a reserved keyword, so this function is called "filter_"
filtered = filter_(cnvfile, './output/dir', xmlcon, './psa/AlignCTD.psa')
# ...

Pipeline processing

from seabird_processing import Batch, configs

xmlcon = './path/to/xmlcon/12-3456.xmlcon'

# Create a pipeline with some config files
batch = Batch([
    configs.DatCnvConfig(
        # `output_file_suffix` is optional
        output_dir="./datcnv", output_file_suffix="_datcnv",
        xmlcon=xmlcon, psa='./path/to/DatCnv.psa'),
    configs.FilterConfig(
        output_dir="./filter", output_file_suffix="_filter",
        xmlcon=xmlcon, psa='./path/to/Filter.psa'),
    configs.AlignCTDConfig(
        output_dir="./alignctd", output_file_suffix="_alignctd",
        xmlcon=xmlcon, psa='./path/to/AlignCTD.psa'),
    configs.CellTMConfig(
        output_dir="./celltm", output_file_suffix="_celltm",
        xmlcon=xmlcon, psa='./path/to/CellTM.psa'),
    configs.LoopEditConfig(
        output_dir="./loopedit", output_file_suffix="_loopedit",
        xmlcon=xmlcon, psa='./path/to/LoopEdit.psa'),
    configs.DeriveConfig(
        output_dir="./derive", output_file_suffix="_derive",
        xmlcon=xmlcon, psa='./path/to/Derive.psa'),
    configs.DeriveTEOS10Config(
        output_dir="./deriveteos10", output_file_suffix="_deriveteos10",
        xmlcon=xmlcon, psa='./path/to/DeriveTEOS_10.psa'),
    configs.BinAvgConfig(
        output_dir="./binavg", output_file_suffix="_binavg",
        xmlcon=xmlcon, psa='./path/to/BinAvg.psa'),
])

batch.run("./*.hex")

# You may also run an individual Config object
converter = configs.DatCnvConfig(
    output_dir="./datcnv", output_file_suffix="_datcnv",
    xmlcon=xmlcon, psa='./path/to/DatCnv.psa'
)
converter.run("./some/file.hex")

Copyright and Licensing Information

See LICENSE for details.

Bugs / Feature requests

Please file bug reports and feature requests on GitHub. We also welcome pull requests to add functionality or fix bugs!

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

seabird_processing-0.2.0b3.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

seabird_processing-0.2.0b3-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file seabird_processing-0.2.0b3.tar.gz.

File metadata

  • Download URL: seabird_processing-0.2.0b3.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.12 Linux/5.15.0-1042-azure

File hashes

Hashes for seabird_processing-0.2.0b3.tar.gz
Algorithm Hash digest
SHA256 f38eb9ed1d92eb3b5471c1bbbe4331c8e421b8ee94f3af3cb9f36c296732e847
MD5 214929c114dfa45e17b0b0b8af825346
BLAKE2b-256 07e7066f6e8991a246eba0a28b896bd36d4bdfde66c3129e1c3b6f182f0681a4

See more details on using hashes here.

File details

Details for the file seabird_processing-0.2.0b3-py3-none-any.whl.

File metadata

File hashes

Hashes for seabird_processing-0.2.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 c05266e9bb65abc76aa86a954d6c0109574566580f148c14ef38eae53b9c26a7
MD5 648fbdbb84a4f5b01622be5576240607
BLAKE2b-256 a65727c0c5293fc87a69fad933fba686f81481e47528d3df478cabc6c42e4d52

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page