ParamReader¶
- class lsst.ts.wep.ParamReader(filePath=None)¶
Bases:
object
Initialization of parameter reader of yaml format class.
- Parameters:
- filePathstr, optional
File path. (the default is None.)
Methods Summary
getAbsPath
(filePath, rootPath)Get the absolute file path based on the root.
Get the content.
Get the parameter file path.
Get the matrix content.
getSetting
(param)Get the setting value.
saveSetting
([filePath])Save the setting.
setFilePath
(filePath)Set the file path and load the setting.
updateSetting
(param, value)Update the setting.
updateSettingSeries
(settingSeries)Update the settings based on a serious of setting.
writeMatToFile
(matrix, filePath)Write the matrix data to file.
Methods Documentation
- static getAbsPath(filePath, rootPath)¶
Get the absolute file path based on the root.
- Parameters:
- filePathstr
File path.
- rootPathstr
Root path.
- Returns:
- str
Absolute file path based on the root if the input file path is not absolute.
- Raises:
- ValueError
Input file does not exist.
- getContent()¶
Get the content.
- Returns:
- list or dict
Content.
- getFilePath()¶
Get the parameter file path.
- Returns:
- str
Get the file path.
- getMatContent()¶
Get the matrix content.
- Returns:
- numpy.ndarray
Matrix content.
- getSetting(param)¶
Get the setting value.
- Parameters:
- paramstr
Parameter name.
- Returns:
- int, float, list, or dict
Parameter value.
- Raises:
- ValueError
The parameter does not exist.
- saveSetting(filePath=None)¶
Save the setting.
- Parameters:
- filePathstr, optional
File path. If None, the loaded file path will be used. (the default is None.)
- setFilePath(filePath)¶
Set the file path and load the setting.
- Parameters:
- filePathstr
File path.
- updateSetting(param, value)¶
Update the setting.
- Parameters:
- paramstr
Parameter name.
- valueint, float, list, or dict
Updated value.
- updateSettingSeries(settingSeries)¶
Update the settings based on a serious of setting.
- Parameters:
- settingSeriesdict
A serious of setting to update.
- static writeMatToFile(matrix, filePath)¶
Write the matrix data to file.
- Parameters:
- matrixnumpy.ndarray
Matrix data.
- filePathstr
Yaml file path.