-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Altered the ScalingRelation class so that the name of a relation can …
…be none, and that is what would trigger the view method making its own label
- Loading branch information
Showing
1 changed file
with
6 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# This code is a part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS). | ||
# Last modified by David J Turner ([email protected]) 28/01/2025, 13:14. Copyright (c) The Contributors | ||
# Last modified by David J Turner ([email protected]) 30/01/2025, 22:03. Copyright (c) The Contributors | ||
|
||
import inspect | ||
import pickle | ||
|
@@ -217,11 +217,9 @@ def __init__(self, fit_pars: np.ndarray, fit_par_errs: np.ndarray, model_func, x | |
else: | ||
self._chains = chains | ||
|
||
# If the user hasn't passed the name of the relation then I'll generate one from what I know so far | ||
if relation_name is None: | ||
self._name = self._y_name + '-' + self._x_name + ' ' + self.fit_method | ||
else: | ||
self._name = relation_name | ||
# If the user hasn't passed the name of the relation then the view method will generate one for itself, which | ||
# is the main place that it is used | ||
self._name = relation_name | ||
|
||
# For relations from literature especially I need to give credit the author, and the original paper | ||
self._author = relation_author | ||
|
@@ -1586,10 +1584,11 @@ def get_view(self, ax: Axes, x_lims: Quantity = None, log_scale: bool = True, pl | |
for m_name in MODEL_PUBLICATION_NAMES: | ||
mod_name = mod_name.replace(m_name, MODEL_PUBLICATION_NAMES[m_name]) | ||
|
||
if rel.author != 'XGA': | ||
if rel.name is None: | ||
relation_label = " ".join([rel.author, rel.year]) | ||
else: | ||
relation_label = rel.name + ' Scaling Relation' | ||
|
||
plt.plot(model_x * rel.x_norm.value, model_median, color=m_colour, label=relation_label) | ||
|
||
plt.plot(model_x * rel.x_norm.value, model_upper, color=m_colour, linestyle="--") | ||
|