Are subhalo IDs available in illustris_python searches?

Kevin Andrade
  • 1 Dec '22

I'm trying to adapt some Python code from using the Illustris web api to using illustris_python in the Lab. When using the web api, I was able to search subhalos and return a list of the subhalo IDs that match my desired criteria. However, I can't see a similar way to do this using illustris_python. Am I missing it?

Dylan Nelson
  • 2 Dec '22

Yes, a "search" over catalog properties in the Lab (or if you downloaded the data to your own system) really means:

(1) load the properties of interest from the catalog
(2) use np.where

For example, to search for subhalos with star formation rates between 5 and 8 Msun/yr, then

sfr = il.groupcat.loadSubhalos(basePath,99,fields=['SubhaloSFR'])
subhalo_ids = np.where( (sfr>5) & (sfr<8) )[0]
Kevin Andrade
  • 2 Dec '22

I see, so the ids correspond one-to-one with the positions of the values returned from the search. Thanks!

  • Page 1 of 1