From 2d0549c424f3698d738b60dac7b11ad9bf98037d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Wei=C3=9Fenborn?= Date: Sun, 8 Aug 2021 17:25:42 +0200 Subject: [PATCH] Added frquencies and rates to datasets and tweacked component multiindex --- .../damped_oscillation/damped_oscillation_megacomplex.py | 4 +++- glotaran/builtin/megacomplexes/decay/util.py | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/glotaran/builtin/megacomplexes/damped_oscillation/damped_oscillation_megacomplex.py b/glotaran/builtin/megacomplexes/damped_oscillation/damped_oscillation_megacomplex.py index adb213388..7953df643 100644 --- a/glotaran/builtin/megacomplexes/damped_oscillation/damped_oscillation_megacomplex.py +++ b/glotaran/builtin/megacomplexes/damped_oscillation/damped_oscillation_megacomplex.py @@ -113,7 +113,9 @@ def finalize_data( prefix = "damped_oscillation" if unique else f"{self.label}_damped_oscillation" - dataset.coords[prefix] = self.labels + dataset.coords[f"{prefix}"] = self.labels + dataset.coords[f"{prefix}_frequency"] = (prefix, self.frequencies) + dataset.coords[f"{prefix}_rate"] = (prefix, self.rates) dim1 = dataset_model.get_global_axis().size dim2 = len(self.labels) diff --git a/glotaran/builtin/megacomplexes/decay/util.py b/glotaran/builtin/megacomplexes/decay/util.py index b984fe4cd..c51a3ce67 100644 --- a/glotaran/builtin/megacomplexes/decay/util.py +++ b/glotaran/builtin/megacomplexes/decay/util.py @@ -173,7 +173,11 @@ def retrieve_decay_associated_data( das = dataset[f"species_associated_{name}"].sel(species=species).values @ a_matrix.T - component_coords = {"rate": ("component", rates), "lifetime": ("component", lifetimes)} + component_coords = { + "component": np.arange(rates.size), + "rate": ("component", rates), + "lifetime": ("component", lifetimes), + } das_coords = component_coords.copy() das_coords[global_dimension] = dataset.coords[global_dimension] das_name = f"decay_associated_{name}"