Skip to content

Commit

Permalink
Added frquencies and rates to datasets and tweacked component multiindex
Browse files Browse the repository at this point in the history
  • Loading branch information
joernweissenborn committed Aug 8, 2021
1 parent 5db98eb commit 2d0549c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion glotaran/builtin/megacomplexes/decay/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 2d0549c

Please sign in to comment.