iltpy.input

iltpy.input.loader

iltpy.input.loader.iltload(data=None, t=None, f=None, data_path=None)[source]

Load data from various formats and output an IltData object.

Parameters

data_pathstr, optional

Path to the directory containing text files, requires filenames in a valid format. If None then data and t should be provided. Default: None

datandarray, optional

1D or 2D data Data as a numpy array. If None then data_path must be provided. Default: None

tlist of arrays or ndarray, optional

Input Sampling array corresponding to each dimension e.g. in the case of NMR inversion recovery measurments, t could be the list of delays. If None then data_path must be provided. Default: None

flist of arrays or ndarray, only valid in case of impedance data

Sampling vector corresponding to each dimension in frequency units. If None then data_path must be provided. Default: None

Returns

iltdataIltData

An instance of IltData.

iltpy.input.parameters

iltpy.input.parameters.init_fit_dict(iltdata, parameters, kernel, tau, dim_ndim, sigma, g_guess, reinitialize)[source]

Gets the default fit dict and sets the fit parameters.

Parameters

iltdataIltData

An instance of IltData class.

parameters :str or dict, optional

User-defined parameters, provide as a dict or in case of str, it should be the file path to a parameter file containing a dict. Note that data, kernel, tau, dim_ndim or sigma can’t be provided as parameters.

tau :ndarray,optional

The tau vector used by the inversion,if None, a logarithmically spaced tau is generated.

kernelobject, parent class IltKernel

kernel function

dim_ndim :ndarray, optional

The array defining the n-th dimension of n-D data. If None, it is internally generated in case of inversions with 2D data where only the first dimension is inverted.

sigma :ndarray

Array used for weighted inversions.

g_guess :ndarray

User-defined guess for the initial g

iltpy.input.parameters.init_ndim(iltdata)[source]

Initializes data characteristics.

Parameters

iltdataIltData

An instance of IltData class.

iltpy.input.parameters.init_parameters(iltdata)[source]

Intialises the parameters by reshaping them and checks for shape inconsistencies. Required parameters, if not user-defined are generated.

Parameters

iltdataIltData

An instance of IltData class

Raises

ValueError

Raises ValueError if length of user-defined t along the non-inverted second dimension doesn’t match the data shape in case of 2D data.

ValueError

Raises ValueError if the kernel is the inverted dimension is not specified.

iltpy.input.parameters.set_parameters(iltdata, fit_dict)[source]

Sets all the parameters previously initialized in the fit dict as class attributes.

Parameters

iltdataIltData

An instance of IltData class.