diff options
-rw-r--r-- | lib/model.py | 24 | ||||
-rw-r--r-- | lib/pelt.py | 1 |
2 files changed, 13 insertions, 12 deletions
diff --git a/lib/model.py b/lib/model.py index f0b0624..bfe0a3c 100644 --- a/lib/model.py +++ b/lib/model.py @@ -970,18 +970,18 @@ class PTAModel: states = self.states() substates_by_param = dict() for k in self.by_param.keys(): - if k[0] in states: - state_name = k[0] - if self.pelt.needs_refinement(self.by_param[k]["power_traces"]): - substates_by_param[k] = self.pelt_refine(k) - else: - substate_counts = [1 for i in self.by_param[k]["param"]] - substate_data = { - "duration": self.by_param[k]["duration"], - "power": self.by_param[k]["power"], - "power_std": self.by_param[k]["power_std"], - } - substates_by_param[k] = (substate_counts, substate_data) + if ( + self.pelt.name_filter is None or k[0] == self.pelt.name_filter + ) and self.pelt.needs_refinement(self.by_param[k]["power_traces"]): + substates_by_param[k] = self.pelt_refine(k) + else: + substate_counts = [1 for i in self.by_param[k]["param"]] + substate_data = { + "duration": self.by_param[k]["duration"], + "power": self.by_param[k]["power"], + "power_std": self.by_param[k]["power_std"], + } + substates_by_param[k] = (substate_counts, substate_data) # suitable for AEMR modeling sc_by_param = dict() diff --git a/lib/pelt.py b/lib/pelt.py index 1cff971..2f533a5 100644 --- a/lib/pelt.py +++ b/lib/pelt.py @@ -39,6 +39,7 @@ class PELT: self.jump = 1 self.min_dist = 10 self.num_samples = None + self.name_filter = None self.refinement_threshold = 200e-6 # 200 µW self.range_min = 0 self.range_max = 100 |