spectrochempy.log_transform๏
- log_transform(dataset, method='log1p', eps=1e-10, inplace=False)[source]๏
Apply a logarithmic transform.
- Parameters:
dataset (
NDDataset) โ The input data.method (
str, optional, default:โlog1pโ) โ Transform to apply:'log1p'โ computelog(1 + x)(stable for small or zero values).'log'โ computelog(x). If the data contain values \(\le 0\), a small offsetepsis added automatically.
eps (
float, optional, default:1e-10) โ Offset added whenmethod='log'and non-positive values are present.inplace (
bool, optional, default:False) โ IfTrue, the transform is performed in place.
- Returns:
NDDatasetโ The log-transformed dataset.
Examples
>>> dataset = scp.read("irdata/nh4y-activation.spg") >>> nd = dataset.log_transform(method="log1p")