GithubHelp home page GithubHelp logo

npolar / argos-ruby Goto Github PK

View Code? Open in Web Editor NEW
1.0 7.0 0.0 241 KB

Argos satellite tracking data tools

License: GNU General Public License v3.0

Ruby 47.66% Shell 0.07% HTML 49.02% XSLT 3.24%
argos

argos-ruby's Introduction

argos-ruby

argos-ruby contains tools for working with Argos satellite tracking data and services:

  • Parsers for Argos ASCII files (DS/DAT and DIAG/DIA files)
  • SOAP web service client
  • Web service download tool
  • Sensor data decoders

argos-ruby is developed by staff at the Norwegian Polar Data Centre.

The library is fully unit tested and used in production in various Tracking APIsthe Tracking APIs.

Code Climate

Argos ASCII to JSON

The command-line tool argos-ascii converts DS or DIAG files to JSON using the ruby classes Argos::Ds and Argos::Diag. The data conversion in mostly Regexp-based so could easily be ported to other programming languages.

Examples

$ argos-ascii spec/argos/_ds/*.DAT
$ argos-ascii --action=source "spec/argos/_d*"
$ argos-ascii --filter='lambda {|d| d[:program] == 9660 and d[:platform] == 2189 }' spec/argos/_ds/990660_A.DAT

The source action provides a metadata summary, list of programs, platforms, etc.

See argos-ascii or run argos-ascii for documentation.

SOAP webservice client

The command-line tool argos-soap provides access to all operations (as of v1.4) in the Argos SOAP webservice.

See argos-soap or run argos-soapfor command-help.

Examples

$ argos-soap -o getXsd # does not require authentication
$ argos-soap -o getXml --username=USERNAME --password=PASSWORD
$ argos-soap -o getPlatformList --username=USERNAME --password=PASSWORD

Download tool

The argos-soap command also contains a convient download tool, that runs the getXml operation for each platform for each of the last 20 days. The download tool creates one XML data file per platform per day, stored in a file structure like

  • /path/to/tracking/archive/argos/xml/$year/program-$program/platform-$platform/argos-$year-$mm-$dd-platform-$platform.xml
  • /path/to/tracking/archive/argos/xml/2015/program-9660/platform-2180/argos-2015-03-06-platform-2180.xml
$ argos-soap --download /path/to/tracking/archive/argos/xml --username=USERNAME --password=PASSWORD --debug

Argos XML to JSON

$ ./bin/argos-json-xslt /path/to/argos-data.xml
$ xsltproc lib/argos/_xslt/argos-json.xslt spec/argos/_soap/getXml.xml

Sensor data decoding

Install

$ gem install argos-ruby
$ cd `gem environment gemdir`/gems/argos-ruby-1.6.0
$ bundle install

Note: The extra step is a bug

Links

argos-ruby's People

Contributors

cnrdh avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

argos-ruby's Issues

Missing latitude2 breaks JSON

About to POST /mnt/datasets/Tracking/ARGOS/ws-argos.cls.fr/2014/program-11660/platform-113907/argos-2014-12-02-platform-113907.xml to https://api.npolar.no/tracking

parse error: unallowed token at this point in JSON text
          lc_index": 0,   "latitude2": ,   "longitude2": ,   "altitude
                     (right here) ------^
/home/external/.rvm/gems/ruby-2.1.3/gems/yajl-ruby-1.2.1/lib/yajl/json_gem/parsing.rb:15:in `rescue in parse'

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.