KineticSpectrumModel

class glotaran.builtin.models.kinetic_spectrum.kinetic_spectrum_model.KineticSpectrumModel[source]

Bases: glotaran.builtin.models.kinetic_image.kinetic_image_model.KineticImageModel

Attributes Summary

dataset

equal_area_penalties

global_dimension

index_dependent_matrix

initial_concentration

irf

k_matrix

megacomplex

model_dimension

model_type

The type of the model as human readable string.

shape

spectral_constraints

spectral_relations

weights

Methods Summary

add_equal_area_penalties

add_spectral_constraints

add_spectral_relations

add_weights

additional_penalty_function

constrain_matrix_function

finalize_data

from_dict

Creates a model from a dictionary.

get_dataset

get_initial_concentration

get_irf

get_k_matrix

get_megacomplex

get_shape

global_matrix

Calculates the matrix.

grouped

has_additional_penalty_function

has_matrix_constraints_function

index_dependent

markdown

Formats the model as Markdown string.

matrix

problem_list

Returns a list with all problems in the model and missing parameters if specified.

retrieve_clp_function

set_dataset

set_initial_concentration

set_irf

set_k_matrix

set_megacomplex

set_shape

simulate

Simulates the model.

valid

Returns True if the number problems in the model is 0, else False

validate

Returns a string listing all problems in the model and missing parameters if specified.

Methods Documentation

add_equal_area_penalties(item: glotaran.builtin.models.kinetic_spectrum.spectral_penalties.EqualAreaPenalty)
add_spectral_constraints(item: glotaran.builtin.models.kinetic_spectrum.spectral_constraints.SpectralConstraint)
add_spectral_relations(item: glotaran.builtin.models.kinetic_spectrum.spectral_relations.SpectralRelation)
add_weights(item: glotaran.model.weight.Weight)
additional_penalty_function(parameters: ParameterGroup, clp_labels: dict[str, list[str] | list[list[str]]], clps: dict[str, list[np.ndarray]], matrices: dict[str, np.ndarray | list[np.ndarray]], data: dict[str, xr.Dataset], group_tolerance: float)np.ndarray
constrain_matrix_function(dataset: str, parameters: ParameterGroup, clp_labels: list[str], matrix: np.ndarray, index: float)tuple[list[str], np.ndarray]
property dataset
property equal_area_penalties
finalize_data(problem: Problem, data: dict[str, xr.Dataset])
classmethod from_dict(model_dict_ref: dict)glotaran.model.base_model.Model

Creates a model from a dictionary.

Parameters

model_dict – Dictionary containing the model.

get_dataset(label: str)glotaran.builtin.models.kinetic_spectrum.kinetic_spectrum_dataset_descriptor.KineticSpectrumDatasetDescriptor
get_initial_concentration(label: str)glotaran.builtin.models.kinetic_image.initial_concentration.InitialConcentration
get_irf(label: str)glotaran.builtin.models.kinetic_image.irf.Irf
get_k_matrix(label: str)glotaran.builtin.models.kinetic_image.k_matrix.KMatrix
get_megacomplex(label: str)glotaran.builtin.models.kinetic_image.kinetic_image_megacomplex.KineticImageMegacomplex
get_shape(label: str)glotaran.builtin.models.kinetic_spectrum.spectral_shape.SpectralShape
global_dimension = 'spectral'
static global_matrix(dataset, axis)

Calculates the matrix.

Parameters
  • matrix (np.array) – The preallocated matrix.

  • compartment_order (list(str)) – A list of compartment labels to map compartments to indices in the matrix.

  • parameter (glotaran.model.ParameterGroup) –

grouped()
has_additional_penalty_function()bool
has_matrix_constraints_function()bool
index_dependent()bool
property index_dependent_matrix
property initial_concentration
property irf
property k_matrix
markdown(parameters: Optional[glotaran.parameter.parameter_group.ParameterGroup] = None, initial_parameters: Optional[glotaran.parameter.parameter_group.ParameterGroup] = None)str

Formats the model as Markdown string.

Parameters will be included if specified.

Parameters
  • parameter – Parameter to include.

  • initial – Initial values for the parameters.

static matrix(dataset_descriptor=None, axis=None, index=None, irf=None)
property megacomplex
model_dimension = 'time'
property model_type

The type of the model as human readable string.

problem_list(parameters: ParameterGroup = None)list[str]

Returns a list with all problems in the model and missing parameters if specified.

Parameters

parameter – The parameter to validate.

retrieve_clp_function(parameters: ParameterGroup, clp_labels: dict[str, list[str] | list[list[str]]], reduced_clp_labels: dict[str, list[str] | list[list[str]]], reduced_clps: dict[str, list[np.ndarray]], data: dict[str, xr.Dataset])dict[str, list[np.ndarray]]
set_dataset(label: str, item: glotaran.builtin.models.kinetic_spectrum.kinetic_spectrum_dataset_descriptor.KineticSpectrumDatasetDescriptor)
set_initial_concentration(label: str, item: glotaran.builtin.models.kinetic_image.initial_concentration.InitialConcentration)
set_irf(label: str, item: glotaran.builtin.models.kinetic_image.irf.Irf)
set_k_matrix(label: str, item: glotaran.builtin.models.kinetic_image.k_matrix.KMatrix)
set_megacomplex(label: str, item: glotaran.builtin.models.kinetic_image.kinetic_image_megacomplex.KineticImageMegacomplex)
set_shape(label: str, item: glotaran.builtin.models.kinetic_spectrum.spectral_shape.SpectralShape)
property shape
simulate(dataset: str, parameters: ParameterGroup, axes: dict[str, np.ndarray] = None, clp: np.ndarray | xr.DataArray = None, noise: bool = False, noise_std_dev: float = 1.0, noise_seed: int = None)xr.Dataset

Simulates the model.

Parameters
  • dataset – Label of the dataset to simulate.

  • parameter – The parameters for the simulation.

  • axes – A dictionary with axes for simulation.

  • clp – Conditionally linear parameters. Used instead of model.global_matrix if provided.

  • noise – If True noise is added to the simulated data.

  • noise_std_dev – The standard deviation of the noise.

  • noise_seed – Seed for the noise.

property spectral_constraints
property spectral_relations
valid(parameters: Optional[glotaran.parameter.parameter_group.ParameterGroup] = None)bool

Returns True if the number problems in the model is 0, else False

Parameters

parameter – The parameter to validate.

validate(parameters: Optional[glotaran.parameter.parameter_group.ParameterGroup] = None)str

Returns a string listing all problems in the model and missing parameters if specified.

Parameters

parameter – The parameter to validate.

property weights