Skip to content

Latest commit

 

History

History
78 lines (48 loc) · 2.36 KB

README.md

File metadata and controls

78 lines (48 loc) · 2.36 KB

Logo Logo

ocean-data-parser

Build documentation

ocean-data-parser - a Python package for parsing oceanographic proprietary data formats to xarray Datasets1.

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.

Footnotes

  1. Xarray package documentation