Skip to content

Commit a1c1bc9

Browse files
committed
Fix ordering of halo
1 parent fd5ae92 commit a1c1bc9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

swiftpipeline/imaging.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,14 @@ def haloes_to_visualise(config: ImageConfig, catalogue_path: Path) -> List[Halo]
165165
# Modify our original mask with our new changes
166166
mask[mask] = mass_mask
167167

168-
# Now build the list of halo objects from valid objects.
168+
# Now build the list of halo objects from valid objects, starting
169+
# with the most massive.
169170

170171
haloes = []
172+
halo_id_order = np.argsort(mass_200crit[mask])[::-1]
173+
halo_ids_valid = np.arange(len(mass_200crit))[mask][halo_id_order]
171174

172-
for unique_id in np.arange(len(mass_200crit))[mask]:
175+
for unique_id in halo_ids_valid:
173176
haloes.append(
174177
Halo(
175178
mass_200_crit=catalogue.masses.mass_200crit[unique_id],

0 commit comments

Comments
 (0)