Git Product home page Git Product logo

ion-functions's Introduction

ION Functions

Functions for utilization in the ION Parameter Function framework

Reference Information: add link

#Prerequisites

This assumes basic development environment setup (git, directory structure). Please follow the "New Developers Tutorial" for basic steps.

Install the following if not yet present:

Install git 1.7.7: Download the Mac or Linux installer and run it

OS Packages and package management: For Mac, use homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
  • python 2.7

Install python, hdf5 and netcdf with Homebrew

brew install python

You can even reinstall git using brew to clean up your /usr/local directory Be sure to read the pyon README for platform specific guidance to installing dependent libraries and packages. Linux: Note that many installs have much older versions installed by default. You will need to upgrade couchdb to at least 1.1.0.

##libgswteos Dependency

A very important component is the libgswteos-10 library. Installation is quite straightforward on Mac OSX and a little more hairy on Linux.

On OSX

The libgswteos dependency is brew installable:

brew tap lukecampbell/homebrew-libgswteos
brew install libgswteos-10
brew test -v libgswteos-10

On Linux

The dependencies for building/installing the library are: autoconf, automake, & libtool

  1. Obtain the tarball from: https://github.com/lukecampbell/gsw-teos/tarball/v3.0r4

    • sha1: 6ae190b7da78d6aff7859e7d1a3bb027ce6cc5f3
  2. Build Procedure

     bash ./autogen.sh  
     ./configure --prefix=/usr/local/libgswteos-10  
     make  
     sudo make install  
    
  3. Linking Procedure:

     sudo ln -s /usr/local/libgswteos-10/lib/libgswteos-10.la /usr/local/lib/  
     sudo ln -s /usr/local/libgswteos-10/lib/libgswteos-10.so.3 /usr/local/lib/  
     sudo ln -s /usr/local/libgswteos-10/lib/libgswteos-10.so.3.0.0 /usr/local/lib/  
     sudo ln -s /usr/local/libgswteos-10/lib/libgswteos-10.so /usr/local/lib/  
     sudo ln -s /usr/local/libgswteos-10/include/gswteos-10.h /usr/local/include/  
    
  4. Ensure that the global C_INCLUDE_PATH and LD_LIBRARY_PATH includes /usr/local/lib in all profiles otherwise python won't run correctly:

     export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib  
     export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/include  
    

Python packages and environment management:

Install pip

easy_install pip

Install virtualenv and virtualenvwrapper modules for your python 2.7 installation Note: This may require Mac's XCode (use XCode 3.3 free version

easy_install --upgrade virtualenv
easy_install --upgrade virtualenvwrapper

Setup a virtualenv to run ion-functions (use any name you like):

mkvirtualenv --python=python2.7 ion_functions
workon ion_functions
pip install numpy==1.6.2

#Source

To obtain the ion-functions project, begin by forking the GitHub repository. Next, clone your fork of the repository to your local machine (replace your_name with the name of your github account:

git clone [email protected]:your_name/ion-functions.git
cd ion-functions

#Installation Ensure you are in a virtualenv prior to running the steps below

From the ion-functions directory, run the following commands:

python bootstrap.py -v 1.7
bin/buildout

Once those steps complete, you should be able to run the unit tests

#Running unit tests (via nose)

From the coverage-model directory, run the following command:

bin/nosetests -v

This will run all tests in the ion-functions repository. The -v flag denotes verbose output (the name of each test prints as it runs). For more nose options, refer to the nose documentation

Running C-Extension Unit Tests

From the ion-functions directory, run the following command:

make

This will compile the C-extension unit tests. To run the tests:

extensions/test

You should see something of the like:

test_spike_simple... ok
test_spike_l simple... ok
test_spike_long... ok

#Libraries Currently Included

  • Numpy – array manipulation
    • import numpy as np
  • Numexpr – relatively trivial "one line" expressions
    • import numexpr
      • vals = umexpr.evaluate('sin(x)**10 – y', local_dict={'x': x_vals, 'y': y_vals})
  • Gibbs Seawater equations – from TEOS-10 (Contact Luke Campbell if you notice something's missing)
    • from pygsw import vectors as gsw
      • vals = gsw.sp_from_sa(input_1, …)
  • GeoMag python library

ion-functions's People

Contributors

ateranishi avatar chrisfortin avatar cwingard avatar desiderr avatar lukecampbell avatar petercable avatar r-ataylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ion-functions's Issues

WMM model coefficients time range

The World Magnetic Model (WMM) that was added to calculate magnetic declination for other functions relies on a coefficients file WMM.COF that is only valid for a 5 year period following the publication of WMM.COF. As of right now there appears to be no checks in the code to make sure that WMM.COF is up to date, or that the measurements fall within the 5 yr range that a WMM.COF is valid.

Perhaps the code should raise an exception if either values do not fall within the 5 yr range, or the current coefficients are out of date.

Additionally, either there is a need to support and maintain old WMM.COF files for magnetic declination from any OOI time range, or there needs to be the ability to store calculated magnetic declination values in the coverage model.

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.