Package stistools :: Module r_util
[hide private]
[frames] | no frames]

Module r_util

source code

Functions [hide private]
string
expandFileName(filename)
Expand environment variable in a file name.
source code
the same type as one element of values
interpolate(x, values, xp)
Interpolate.
source code
Variables [hide private]
  __package__ = 'stistools'

Imports: os, copy


Function Details [hide private]

expandFileName(filename)

source code 

Expand environment variable in a file name.

If the input file name begins with either a Unix-style or IRAF-style environment variable (e.g. $lref/name_dqi.fits or lref$name_dqi.fits respectively), this routine expands the variable and returns a complete path name for the file.

Parameters:
  • filename (string) - a file name, possibly including an environment variable
Returns: string
the file name with environment variable expanded

interpolate(x, values, xp)

source code 

Interpolate.

Linear interpolation is used. If the specified indpendent variable value xp is outside the range of the array x, the first (or last) value in values will be returned.

Parameters:
  • x (a sequence object, e.g. an array, int or float) - array of independent variable values
  • values (a sequence object, e.g. an array (not character)) - array of dependent variable values
  • xp (int or float) - independent variable value at which to interpolate
Returns: the same type as one element of values
linearly interpolated value