11# This code is a part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS).
2- # Last modified by David J Turner (turne540@msu.edu) 26/03 /2025, 19:57 . Copyright (c) The Contributors
2+ # Last modified by David J Turner (turne540@msu.edu) 04/06 /2025, 13:31 . Copyright (c) The Contributors
33
44from typing import List
55
@@ -418,7 +418,7 @@ def _get_overdens_rad_checks(self, rad_name: str) -> Quantity:
418418 rad = gcs .get_radius (rad_name , 'kpc' )
419419 # Result could be None, if the radius wasn't set for that clusters, have to account for that
420420 if rad is None :
421- rads .append (np .NaN )
421+ rads .append (np .nan )
422422 else :
423423 rads .append (rad )
424424
@@ -651,24 +651,24 @@ def Tx(self, outer_radius: Union[str, Quantity] = 'r500', model: str = 'constant
651651 # If the measured temperature is 64keV I know that's a failure condition of the XSPEC fit,
652652 # so its set to NaN
653653 if quality_checks and gcs_temp [0 ] > 25 :
654- gcs_temp = np .array ([np .NaN , np .NaN , np .NaN ])
654+ gcs_temp = np .array ([np .nan , np .nan , np .nan ])
655655 warn ("A temperature of {m}keV was measured for {s}, anything over 30keV considered a failed "
656656 "fit by XGA" .format (s = gcs .name , m = gcs_temp ), stacklevel = 2 )
657657 elif quality_checks and gcs_temp .min () < 0 :
658- gcs_temp = np .array ([np .NaN , np .NaN , np .NaN ])
658+ gcs_temp = np .array ([np .nan , np .nan , np .nan ])
659659 warn ("A negative value was detected in the temperature array for {s}, this is considered a failed "
660660 "measurement" .format (s = gcs .name ), stacklevel = 2 )
661661 elif quality_checks and ((gcs_temp [0 ] - gcs_temp [1 ]) <= 0 ):
662- gcs_temp = np .array ([np .NaN , np .NaN , np .NaN ])
662+ gcs_temp = np .array ([np .nan , np .nan , np .nan ])
663663 warn ("The temperature value - the lower error goes below zero for {s}, this makes the temperature"
664664 " hard to use for scaling relations as values are often logged." .format (s = gcs .name ),
665665 stacklevel = 2 )
666666 elif quality_checks and ((gcs_temp [1 ] / gcs_temp [2 ]) > 3 or (gcs_temp [1 ] / gcs_temp [2 ]) < 0.33 ):
667- gcs_temp = np .array ([np .NaN , np .NaN , np .NaN ])
667+ gcs_temp = np .array ([np .nan , np .nan , np .nan ])
668668 warn ("One of the temperature uncertainty values for {s} is more than three times larger than "
669669 "the other, this means the fit quality is suspect." .format (s = gcs .name ), stacklevel = 2 )
670670 elif quality_checks and ((gcs_temp [0 ] - gcs_temp [1 :].mean ()) < 0 ):
671- gcs_temp = np .array ([np .NaN , np .NaN , np .NaN ])
671+ gcs_temp = np .array ([np .nan , np .nan , np .nan ])
672672 warn ("The temperature value - the average error goes below zero for {s}, this makes the "
673673 "temperature hard to use for scaling relations as values are often "
674674 "logged" .format (s = gcs .name ), stacklevel = 2 )
@@ -678,7 +678,7 @@ def Tx(self, outer_radius: Union[str, Quantity] = 'r500', model: str = 'constant
678678 # If any of the possible errors are thrown, we print the error as a warning and replace
679679 # that entry with a NaN
680680 warn (str (err ), stacklevel = 2 )
681- temps .append (np .array ([np .NaN , np .NaN , np .NaN ]))
681+ temps .append (np .array ([np .nan , np .nan , np .nan ]))
682682
683683 # Turn the list of 3 element arrays into an Nx3 array which is then turned into an astropy Quantity
684684 temps = Quantity (np .array (temps ), 'keV' )
@@ -774,29 +774,29 @@ def gas_mass(self, rad_name: str, dens_model: str, method: str, prof_outer_rad:
774774 try :
775775 cur_gmass = dens_profs .gas_mass (dens_model , gas_mass_rad )[0 ]
776776 if quality_checks and (cur_gmass [1 ] > cur_gmass [0 ] or cur_gmass [2 ] > cur_gmass [0 ]):
777- gms .append ([np .NaN , np .NaN , np .NaN ])
777+ gms .append ([np .nan , np .nan , np .nan ])
778778 elif quality_checks and cur_gmass [0 ] < Quantity (1e+9 , 'Msun' ):
779- gms .append ([np .NaN , np .NaN , np .NaN ])
779+ gms .append ([np .nan , np .nan , np .nan ])
780780 warn ("{s}'s gas mass is less than 1e+12 solar masses" )
781781 elif quality_checks and cur_gmass [0 ] > Quantity (1e+16 , 'Msun' ):
782- gms .append ([np .NaN , np .NaN , np .NaN ])
782+ gms .append ([np .nan , np .nan , np .nan ])
783783 warn ("{s}'s gas mass is greater than 1e+16 solar masses" )
784784 else :
785785 gms .append (cur_gmass .value )
786786 except ModelNotAssociatedError :
787- gms .append ([np .NaN , np .NaN , np .NaN ])
787+ gms .append ([np .nan , np .nan , np .nan ])
788788 except ValueError :
789- gms .append ([np .NaN , np .NaN , np .NaN ])
789+ gms .append ([np .nan , np .nan , np .nan ])
790790 warn ("{s}'s gas mass is negative" )
791791
792792 else :
793793 warn ("Somehow there multiple matches for {s}'s density profile, this is the developer's "
794794 "fault." .format (s = gcs .name ))
795- gms .append ([np .NaN , np .NaN , np .NaN ])
795+ gms .append ([np .nan , np .nan , np .nan ])
796796
797797 except NoProductAvailableError :
798798 # If no dens_prof has been run or something goes wrong then NaNs are added
799- gms .append ([np .NaN , np .NaN , np .NaN ])
799+ gms .append ([np .nan , np .nan , np .nan ])
800800 warn ("{s} doesn't have a density profile associated, please look at "
801801 "sourcetools.density." .format (s = gcs .name ))
802802
@@ -850,23 +850,23 @@ def hydrostatic_mass(self, rad_name: str, temp_model_name: str = None, dens_mode
850850 try :
851851 cur_mass = mass_profs .mass (actual_rad )[0 ]
852852 if quality_checks and (cur_mass [1 ] > cur_mass [0 ] or cur_mass [2 ] > cur_mass [0 ]):
853- ms .append ([np .NaN , np .NaN , np .NaN ])
853+ ms .append ([np .nan , np .nan , np .nan ])
854854 warn ("{s}'s mass uncertainties are larger than the mass value." )
855855 elif quality_checks and cur_mass [0 ] < Quantity (1e+12 , 'Msun' ):
856- ms .append ([np .NaN , np .NaN , np .NaN ])
856+ ms .append ([np .nan , np .nan , np .nan ])
857857 warn ("{s}'s mass is less than 1e+12 solar masses" )
858858 elif quality_checks and cur_mass [0 ] > Quantity (1e+16 , 'Msun' ):
859- ms .append ([np .NaN , np .NaN , np .NaN ])
859+ ms .append ([np .nan , np .nan , np .nan ])
860860 warn ("{s}'s mass is greater than 1e+16 solar masses" )
861861 else :
862862 ms .append (cur_mass .value )
863863 except ValueError :
864864 warn ("{s}'s mass is negative" )
865- ms .append ([np .NaN , np .NaN , np .NaN ])
865+ ms .append ([np .nan , np .nan , np .nan ])
866866
867867 except NoProductAvailableError :
868868 # If no dens_prof has been run or something goes wrong then NaNs are added
869- ms .append ([np .NaN , np .NaN , np .NaN ])
869+ ms .append ([np .nan , np .nan , np .nan ])
870870 warn ("{s} doesn't have a matching hydrostatic mass profile associated" .format (s = gcs .name ))
871871
872872 ms = np .array (ms )
@@ -927,11 +927,11 @@ def calc_overdensity_radii(self, delta: int, temp_model_name: str = None, dens_m
927927 "didn't bracket the requested overdensity radius. See the docs of overdensity_radius "
928928 "method of HydrostaticMass for more info." .format (s = gcs .name ))
929929
930- rs .append (np .NaN )
930+ rs .append (np .nan )
931931
932932 except NoProductAvailableError :
933933 # If no dens_prof has been run or something goes wrong then NaNs are added
934- rs .append (np .NaN )
934+ rs .append (np .nan )
935935 warn ("{s} doesn't have a matching hydrostatic mass profile associated" .format (s = gcs .name ))
936936
937937 # Turn the radii list into a quantity and return it
0 commit comments