Skip to main content

Parser for Sea-Bird's CTD and TSG.

Project description

https://zenodo.org/badge/4645/castelao/seabird.svg https://readthedocs.org/projects/seabird/badge/?version=latest https://img.shields.io/travis/castelao/seabird.svg https://codecov.io/github/castelao/seabird/coverage.svg?branch=master https://img.shields.io/pypi/v/seabird.svg https://mybinder.org/badge_logo.svg

This is a parser for Sea Bird CTD and TSG output files.

The Sea Bird CTD post processed data usually uses the .cnv extention. The purpose of the PySeabird is to parse this type of files, considering the different versions along the time, as well as different setups.

At this point my goal is to have an object with the attributes parsed from the header, and the data as Masked Arrays, so that the user doesn’t need to loose time evaluating the version and details of that cnv, but have it in a standard pattern, ready to use.

ATENTION, this is not an official package, so if you have trouble with it, do not complain to Sea-Bird. Open an issue at GitHub (https://github.com/castelao/seabird/issues), and I’ll try to help you.

Support and Documentation

The documentation is available at seabird.readthedocs.org.

The Seasoft manual might be the best reference for the format used.

If PySeabird doesn’t work with your .cnv files, send me a sample (just one .cnv) and I’ll fix to run it. The SeaBird changed the format several times along the time, so I need to see what do you have, to adjust PySeabird to work with it.

Quick howto use

To install:

pip install seabird

One way to use is running on the shell the cnvdump. Independent of the historical version of the cnv file, it will return a default structure:

seabird cnvdump your_file.cnv

To convert a .cnv (CTD output) into a NetCDF file, run:

seabird cnv2nc your_file.cnv

In a python script, one can use like this:

from seabird.cnv import fCNV

profile = fCNV(‘your_file.cnv’)

profile.attrs # It will return the header, as a dictionary.

profile.keys() # It will list the available variables.

profile[‘TEMP2’] # If TEMP2 was on the .keys(), this is how you get the data. It will be a masked array.

Check the example notebooks: http://nbviewer.ipython.org/github/castelao/seabird/tree/master/docs/notebooks/

License

seabird is licensed under a 3-clause BSD style license - see LICENSE.rst

Authors

Guilherme Castelão <guilherme@castelao.net> and Luiz Irber <luiz.irber@gmail.com>

History

0.11.x

  • Migrating QC resources from CoTeDe to here. Until now CoTeDe would use PySeabird to understand CTD & TSG data files to QC, but now it is PySeabird that imports CoTeDe, as a plugin, to apply those same QC procedures.

0.10.x

  • Data variables split by position. Rare cases use 11 characters thus not leaving any space between fields.

  • Improved bottle dataset

0.9.x

  • This release is a dirty solution for some issues that I would like to address before refactor the whole package.

  • Reads CTD bottle files (.btl)

0.8.x

  • Removed dependency on YAML, in favor to JSON.

  • Added support to read binary file type.

0.7.x

  • Python 2.6 is no long supported.

0.6.x

  • CF vocabulary for variables names (PRES, TEMP, PSAL, LONGITUDE …)

  • Reorganizing the package. Removed src, and added several supporting files.

  • Moving CNVError into seabird.exceptions

  • Updated status for Production.

  • Bugfix to md5hash a file with special latin1 characters.

0.5.9

  • New attributes, sbe_model and instrument_type.

  • Sorry, lost track of updates.

0.5.3

  • Found a bug on load_data. Zeros could be mistaken by a bad_flag lower than 1e-8.

  • The new rule accepts no notes on the header.

  • Thanks to Laurynas for the .cnv file example that trigged the items above.

0.5.1

  • Testing structure

  • Some minor improvements in the core.

0.4.4

  • Carolina Nobre provided some .cnv files without any time variable, i.e. no timeS, timeJ or timeQ. The CNV() will not fail anymore if lacks a time record.

0.4

  • The oficial package name now is seabird. I realized that my goal here goes beyond to just parse the .cnv files, so the name seabird covers it better.

0.3

  • cnv2nc, a script to convert the cnv into a netCDF file.

0.2

  • First public release

0.1.8

  • Refactoring. Parsed text is saved in self.parsed, preparing to output

    everything that wasn’t specifically parsed.

  • XML is extracted into self.attrs[‘awkward_xml’]

0.1.7

  • Now it calculate and include the hex md5sum.

  • Bugfix, now handle well when timeJ has masked values.

  • Bugfix converting timeJ, it was one day longer.

  • I’ll run on the whole PIRATA dataset to check against different formats

    and after that it will be ready for 0.2 as Beta version

0.1.6

  • When position available in the header.intro as NMEA, load this instead of

    try to parse from the header.notes.

  • Load default values from a yaml file, like attributes{cruise, project,

    shipname …}

  • Using a recommended variable names list

0.1.5

  • Initial prototype of the cnvdump

0.1.1

  • Rules are now inside the package, and loaded with pkg_resources.

0.1

Release date: 3-Jul-2012

  • Initial import.

  • It’s able to load the variables into Masked Array, but it’s not the best way to do it.

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-0.11.3.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

seabird-0.11.3-py2.py3-none-any.whl (25.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file seabird-0.11.3.tar.gz.

File metadata

  • Download URL: seabird-0.11.3.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3

File hashes

Hashes for seabird-0.11.3.tar.gz
Algorithm Hash digest
SHA256 011b55c2c2888d9023399fa0021a84a01cdf3b311cbe5e88aca8183f794fd188
MD5 4f2ef5169833d4c1591b311b427e56e6
BLAKE2b-256 6655a743e303a30ac27f58b4ca56a6fce615cd1ee5d62451919d42abbd4eb806

See more details on using hashes here.

File details

Details for the file seabird-0.11.3-py2.py3-none-any.whl.

File metadata

  • Download URL: seabird-0.11.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3

File hashes

Hashes for seabird-0.11.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d23175de6e3bad6570cf512beae73c1255574f8d4251fc4572e5dfb242f9ed7f
MD5 8a07fbbf36c899f55271eab86f9bf802
BLAKE2b-256 5c5a8e697aa2e2fe993938457de237af1809b52e95deeafdc3f5b2ef7710e533

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