Skip to content

Commit

Permalink
May have been using the wrong radii values for numerical derivative o…
Browse files Browse the repository at this point in the history
…f temp and dens non-interpolation mode in the new hydro mass implementation. For issue #1260
  • Loading branch information
DavidT3 committed Nov 21, 2024
1 parent 4d05376 commit 10b1e5c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xga/products/profile.py
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 (turne540@msu.edu) 21/11/2024, 09:57. Copyright (c) The Contributors
# Last modified by David J Turner (turne540@msu.edu) 21/11/2024, 10:03. Copyright (c) The Contributors

from copy import copy
from typing import Tuple, Union, List
Expand Down Expand Up @@ -2598,7 +2598,7 @@ def mass(self, radius: Quantity, conf_level: float = 68.2,
dens_data_real = self.density_profile.generate_data_realisations(self._num_samples)
dens = dens_data_real[:, d_inds].T
# Calculating density gradient # TODO DON'T KNOW IF THIS WILL WORK
dens_der = np.gradient(dens_data_real.T, self.radii, axis=0).T[:, d_inds].T
dens_der = np.gradient(dens_data_real, self.density_profile.radii, axis=0)[:, d_inds].T

# Finally, whatever way we got the densities, we make sure they are in the right unit (also their 1st
# derivatives).
Expand Down Expand Up @@ -2654,7 +2654,7 @@ def mass(self, radius: Quantity, conf_level: float = 68.2,
temp_data_real = self.temperature_profile.generate_data_realisations(self._num_samples)
temp = temp_data_real[:, t_inds].T
# Calculating temperature gradient # TODO DON'T KNOW IF THIS WILL WORK
temp_der = np.gradient(temp_data_real.T, self.radii, axis=0).T[:, t_inds].T
temp_der = np.gradient(temp_data_real, self.temperature_profile.radii, axis=0)[:, t_inds].T


# We ensure the temperatures are in the right unit - we want Kelvin for this, as compared to the entropy
Expand Down

0 comments on commit 10b1e5c

Please sign in to comment.