Giter Club home page Giter Club logo

gutils's Introduction

Glider Utilities (GUTILS)

Build Status

A set of Python utilities for reading, merging, and post processing Teledyne Webb Slocum Glider data.

Installation

Available through conda. This library requires Python 3.5 or above.

$ conda create -n sgs python=3.5
$ source activate sgs
$ conda install -c axiom-data-science gutils

Configuration

Example configuration files from the University of South Florida Glider Group can be found in the test resources. Use these files as a basis for your institution, possible datatypes, and gliders. Do not delete any parameters from these files, only adjust their values for your institution. Otherwise, your NetCDF files will not pass the check_glider_netcdf.py script.

A brief overview of each file and folder follows:

  • your-glider-name-here/global_attributes.json contains parameters that are specific to the glider institution.
  • your-glider-name-here/deployment.json describes the current deployment for a given glider. Includes global attribute details that change between deployments and information about the glider/platform deployed.
  • your-glider-name-here/instruments.json provides details about instruments deployed with a single glider. instrument_ctd is the only required instrument in this file.
  • your-glider-name-here/datatypes.json maps between glider generated types (e.g., m_depth-m) and types to be output to a NetCDF file (e.g., depth). This file is optional and will fallback to the defaults if not present in the configuration directory. You will only need to edit this file if you need to add datatypes to the NetCDF files. Types in here that are not produced by your glider will NOT cause errors. Hopefully, through collaboration, we will be able to produce a complete mapping of glider types to NetCDF variables and keep the default updated. Please submit a PR if you are using a custom datatypes.json!

Basic Usage

CLI

Create NetCDF File
$ create_glider_netcdf.py -h
$ create_glider_netcdf.py \
    -f <path to flight file> \
    -s <path to science file> \
    <glider config directory> \
    <NetCDF output directory>

Outputs a set of profiles from a merged flight and science dataset NetCDF files to the output directory. Can also specify only a flight (-f) or science (-s) file without the corresponding file.

For the example above, the glider config directory would be something like this. Point directly at a glider configuration directory.

Check NetCDF File
$ check_glider_netcdf.py -h
$ check_glider_netcdf.py <path to NetCDF file>

Prints errors and returns number of errors. Prints PASS and returns 0 on success.

Python

from gutils.gbdr import (
    GliderBDReader,
    MergedGliderBDReader
)
from gutils.nc import open_glider_netcdf

flightReader = GliderBDReader(
    ['/some/path/to/file.sbd']
)
scienceReader = GliderBDReader(
    ['/some/path/to/file.tbd']
)
reader = MergedGliderBDReader(flightReader, scienceReader)

with open_glider_netcdf(self.test_path, self.mode) as glider_nc:
    for line in reader:
        glider_nc.stream_dict_insert(line)

See a larger example in tests.py

SECOORA Glider System (SGS)

This package is part of the SECOORA Glider System (SGS) and was originally developed by the CMS Ocean Technology Group at the University of South Florida. It is now maintained by SECOORA and Axiom Data Science.

  • GUTILS: A set of Python utilities for post processing glider data.
  • GSPS: Watches a directory for new *db flight/science files and publishes the data to a ZeroMQ socket.
  • GDAM: Watches a directory for new *db flight/science files, inserts the data into a MongoDB instance, and publishes the data to a ZeroMQ socket.

gutils's People

Contributors

kwilcox avatar mlindemu avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.