-
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.
Made the x-limit determining code in ScalingRelation a little more ro…
…bust I hope - used nanargmax and nanargmin rather than just argmax and argmin
- Loading branch information
Showing
1 changed file
with
4 additions
and
4 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, 11:56. Copyright (c) The Contributors | ||
# Last modified by David J Turner ([email protected]) 28/01/2025, 12:07. Copyright (c) The Contributors | ||
|
||
import inspect | ||
import pickle | ||
|
@@ -935,12 +935,12 @@ def get_view(self, ax: Axes, x_lims: Quantity = None, log_scale: bool = True, pl | |
'scaling relation ({xr}).'.format(xl=x_lims.unit.to_string(), | ||
xr=self.x_unit.to_string())) | ||
elif x_lims is None and len(self._x_data) != 0: | ||
max_x_ind = np.argmax(self._x_data) | ||
min_x_ind = np.argmin(self._x_data) | ||
max_x_ind = np.nanargmax(self._x_data) | ||
min_x_ind = np.nanargmin(self._x_data) | ||
x_lims = [0.9 * (self._x_data[min_x_ind].value - self._x_err[min_x_ind].value), | ||
1.1 * (self._x_data[max_x_ind].value + self._x_err[max_x_ind].value)] | ||
elif x_lims is None and len(self._x_data) == 0: | ||
raise ValueError('There is no data available to infer suitable axis limits from, please pass x limits.') | ||
raise ValueError('There are no data available to infer suitable axis limits from, please pass x limits.') | ||
|
||
# Just grabs the model colour from the property if the user doesn't set a value for model_colour | ||
if model_colour is None: | ||
|