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
orlref$name_dqi.fits
respectively), this routine expands the variable and returns a complete path name for the file.- Parameters:
- filename: str
A file name, possibly including an environment variable.
- Returns:
- fullname: str
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:
- 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:
- interp_vals: the same type as one element of values
Linearly interpolated value.