#! /usr/bin/env python
#
# A module for working with HydroTrend.
#
# Mark Piper (mark.piper@colorado.edu)

from subprocess import call
import numpy as np


def load(output_file):
    '''
    Reads a column of text containing HydroTrend output. Returns a numpy array,
    or None on an error.
    '''
    try:
        series = np.loadtxt(output_file, skiprows=2)
    except (IOError, StopIteration):
        pass
    else:
        return(series)


def call(input_dir, output_dir):
    '''
    Invokes HydroTrend through the shell.
    '''
    call(['hydrotrend', '--in-dir', input_dir, '--out-dir', output_dir])

@@ -104,12 +104,14 @@
 u)%0A%0A
-from
+import
  sub
@@ -121,20 +121,8 @@
 cess
- import call
 %0Aimp
@@ -430,16 +430,247 @@
 ries)%0A%0A%0A
+def is_in_path():%0A    '''%0A    Returns True if the HydroTrend executable is in the path.%0A    '''%0A    try:%0A        subprocess.call(%5B'hydrotrend', '--version'%5D)%0A    except OSError:%0A        return False%0A    else:%0A        return True%0A%0A%0A
 def call

Add is_in_path() function