Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions SO_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ def gas_xraylum(self):
def Xraylum(self):
if self.Ngas == 0:
return None
return self.gas_xraylum.sum()
return self.gas_xraylum.sum(axis=0)

@lazy_property
def gas_xrayphlum(self):
Expand All @@ -707,7 +707,7 @@ def gas_xrayphlum(self):
def Xrayphlum(self):
if self.Ngas == 0:
return None
return self.gas_xrayphlum.sum()
return self.gas_xrayphlum.sum(axis=0)

@lazy_property
def gas_compY(self):
Expand Down Expand Up @@ -746,13 +746,13 @@ def gas_no_agn(self):
def Xraylum_no_agn(self):
if self.Ngas == 0:
return None
return self.gas_xraylum[self.gas_no_agn].sum()
return self.gas_xraylum[self.gas_no_agn].sum(axis=0)

@lazy_property
def Xrayphlum_no_agn(self):
if self.Ngas == 0:
return None
return self.gas_xrayphlum[self.gas_no_agn].sum()
return self.gas_xrayphlum[self.gas_no_agn].sum(axis=0)

@lazy_property
def compY_no_agn(self):
Expand Down Expand Up @@ -1292,6 +1292,7 @@ def calculate(self, input_halo, search_radius, data, halo_result):
if do_calculation[category]:
val = getattr(part_props, name)
if val is not None:
assert SO[name].shape == val.shape, f"Attempting to store {name} with wrong dimensions"
if unit == "dimensionless":
SO[name] = unyt.unyt_array(
val.astype(dtype),
Expand Down
1 change: 1 addition & 0 deletions aperture_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@ def calculate(self, input_halo, search_radius, data, halo_result):
if do_calculation[category]:
val = getattr(part_props, name)
if val is not None:
assert aperture_sphere[name].shape == val.shape, f"Attempting to store {name} with wrong dimensions"
if unit == "dimensionless":
aperture_sphere[name] = unyt.unyt_array(
val.astype(dtype),
Expand Down
1 change: 1 addition & 0 deletions projected_aperture_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ def calculate(self, input_halo, search_radius, data, halo_result):
if do_calculation[category]:
val = getattr(proj_part_props, name)
if val is not None:
assert projected_aperture[name].shape == val.shape, f"Attempting to store {name} with wrong dimensions"
if unit == "dimensionless":
projected_aperture[name] = unyt.unyt_array(
val.astype(dtype),
Expand Down
3 changes: 2 additions & 1 deletion subhalo_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,9 @@ def calculate(self, input_halo, search_radius, data, halo_result):
val, dtype=dtype, units=unit, registry=registry
)
if do_calculation[category]:
val = getattr(part_props, name)
val = getattr(part_props, name)
if val is not None:
assert subhalo[name].shape == val.shape, f"Attempting to store {name} with wrong dimensions"
if unit == "dimensionless":
subhalo[name] = unyt.unyt_array(
val.astype(dtype),
Expand Down