Skip to content

ocean-data-parser parses manufacturer or organizations proprietary file format into an xarray datasets.

License

Notifications You must be signed in to change notification settings

cioos-siooc/ocean-data-parser

Repository files navigation

Logo Logo

ocean-data-parser

Build documentation

ocean-data-parser - a Python package for parsing oceanographic proprietary data formats to xarray Dataset. Documentation here.

Installation

Install the package with the following command, ideally within a virtual environment:

pip install git+https://github.com/cioos-siooc/ocean-data-parser.git

How to

odpy cli

Once installed, the package is usable via the command line interface:

odpy --help

To batch convert a series of files to NetCDF:

odpy convert -i '**/*.cnv' -p 'seabird.cnv'

Format auto-detection

Load a compatible file with the automated parser detection method:

import ocean_data_parser.read

# Load a file to an xarray object
ds = ocean_data_parser.read.file('Path to file')

# Save to netcdf
ds.to_netcdf('save-path.nc')

!!!warning The parser detection method relies on the file extension and the first few lines present within the given file.

Or specify the specific parser to use for this file format:

from ocean_data_parser.parsers import seabird

# Load a seabird cnv file as an xarray dataset
ds = seabird.cnv('Path to seabird cnv file')

# Save to netcdf
ds.to_netcdf('save-path.nc')

The ocean-data-parser can then be used within either a Python package, script or jupyter notebook. See the documentation Notebook section for examples of how to use the package within a jupyter notebook.

Contributions

All contributions are welcome!

Please create a new discussion or issue within the GitHub repository for any questions, ideas and suggestions.

About

ocean-data-parser parses manufacturer or organizations proprietary file format into an xarray datasets.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published