r_util¶
- stistools.r_util.expandFileName(filename)¶
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:
- filenamestr
A file name, possibly including an environment variable.
- Returns:
- fullnamestr
The file name with environment variable expanded.
- stistools.r_util.interpolate(x, values, xp)¶
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:
- xa sequence object, e.g. an array, int or float
Array of independent variable values.
- valuesa sequence object, e.g. an array (not character)
Array of dependent variable values.
- xpint or float
Independent variable value at which to interpolate.
- Returns:
- interp_valsthe same type as one element of values
Linearly interpolated value.