From 8d29439ebc678b6e3a662ab1b9c48f21409f330c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20de=20la=20Pe=C3=B1a?= Date: Fri, 14 Jun 2024 12:05:33 +0200 Subject: [PATCH] Set FS coeff only if not already set --- exspy/models/eelsmodel.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exspy/models/eelsmodel.py b/exspy/models/eelsmodel.py index b6b6a8d8d..47597174b 100644 --- a/exspy/models/eelsmodel.py +++ b/exspy/models/eelsmodel.py @@ -335,7 +335,11 @@ def append(self, component): energy_scale=self.axis.scale, ) component.energy_scale = self.axis.scale - component._set_fine_structure_coeff() + # Only set the fine structure if it is not already set + # This is useful when adding components fitted with + # a model to a different model + if component.fine_structure_coeff.map is None: + component._set_fine_structure_coeff() self._classify_components() append.__doc__ = Model1D.append.__doc__