
Hello, I am trying to become familiar with yt halo finding. I have already created halo catalog and with Jupiter notebook I could see what was the number of halos (when it creates halo catalog it also writes what is the number of halos). I am trying to plot number of halos dependence on their masses and for this I need to have number of halos (with certain masses) as an output. I was trying to use callbacks and quantities but failed. Do you know what will be the best solution to get number of halos as an output? Thanks, Salome

Hello Salome, It may help you a bit... halo_ds = yt.load('../halo_catalogs_default/catalog/catalog.0.h5')) hc = HaloCatalog(data_ds=data_ds, halos_ds = halo_ds) halo = hc.halos_ds.all_data() mass = halo['particle_mass'][:] Number_of_halos = len(mass) In *mass* variable you have the list of mass of all halos but in c.g.s units. Now you can find any number of halos in any range you want. Hope it will help you. Regards -Prateek On Fri, Mar 8, 2019 at 7:29 PM Salome Mtchedlidze < salome.mtchedlidze.1@iliauni.edu.ge> wrote:
Hello,
I am trying to become familiar with yt halo finding. I have already created halo catalog and with Jupiter notebook I could see what was the number of halos (when it creates halo catalog it also writes what is the number of halos). I am trying to plot number of halos dependence on their masses and for this I need to have number of halos (with certain masses) as an output. I was trying to use callbacks and quantities but failed. Do you know what will be the best solution to get number of halos as an output?
Thanks, Salome _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org

Hi Prateek again, I have one question, when you said - "In *mass* variable you have the list of mass of all halos but in c.g.s units. Now you can find any number of halos in any range you want", what did you mean, saying "in any range"? Can i just directly write mass ranges in the code you provided? (I am asking this because I am doing that in a very complicated way). Thanks, Salome

Hello Salome, With that I mean to say, suppose you want to find the number of halos within the mass range 10^14 - 10^15 Msun (say). Then you can count it with just using a loop and if condition. Even if you want to list out the halos within the said mass range, just do little tricks of basic python you can extract out the list with the other properties also, say, centers, radius etc. It will be more helpful for me if you can discuss the exact task you want to perform and also if possible please share "what is your complicated way.!" Regards -Prateek On Mon, Mar 11, 2019 at 10:05 PM Salome Mtchedlidze < salomchedlidze@gmail.com> wrote:
Hi Prateek again,
I have one question, when you said - "In *mass* variable you have the list of mass of all halos but in c.g.s units. Now you can find any number of halos in any range you want", what did you mean, saying "in any range"? Can i just directly write mass ranges in the code you provided? (I am asking this because I am doing that in a very complicated way).
Thanks, Salome _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org

Hi Prateek, My purpose is just to plot halo number dependence on mass of the halos (i.e halo abundances). For finding the halos I was using HOP and after that I filtered halo masses (following these instructions: http://yt-project.org/doc/analyzing/analysis_modules/halo_catalogs.html <http://yt-project.org/doc/analyzing/analysis_modules/halo_catalogs.html> ); then I could see what was the number of these halos e.g above 10^6 M_sun. Then I created separate halo catalogs using that filters. Now I can find how many halos are in each catalog which are above the certain mass (using the code you wrote here). I was just trying to write the python cycle for that, not to do separately for each halo catalog. Thanks, Salome
On Mar 11, 2019, at 10:12 PM, Prateek Gupta <prateekgidolia@gmail.com <mailto:prateekgidolia@gmail.com>> wrote:
Hello Salome,
With that I mean to say, suppose you want to find the number of halos within the mass range 10^14 - 10^15 Msun (say). Then you can count it with just using a loop and if condition. Even if you want to list out the halos within the said mass range, just do little tricks of basic python you can extract out the list with the other properties also, say, centers, radius etc.
It will be more helpful for me if you can discuss the exact task you want to perform and also if possible please share "what is your complicated way.!"
Regards -Prateek
On Mon, Mar 11, 2019 at 10:05 PM Salome Mtchedlidze <salomchedlidze@gmail.com <mailto:salomchedlidze@gmail.com>> wrote: Hi Prateek again,
I have one question, when you said - "In *mass* variable you have the list of mass of all halos but in c.g.s units. Now you can find any number of halos in any range you want", what did you mean, saying "in any range"? Can i just directly write mass ranges in the code you provided? (I am asking this because I am doing that in a very complicated way).
Thanks, Salome _______________________________________________ yt-users mailing list -- yt-users@python.org <mailto:yt-users@python.org> To unsubscribe send an email to yt-users-leave@python.org <mailto:yt-users-leave@python.org> _______________________________________________ yt-users mailing list -- yt-users@python.org <mailto:yt-users@python.org> To unsubscribe send an email to yt-users-leave@python.org <mailto:yt-users-leave@python.org>

Hi Salome As much as I understood your task, I think you can do it as follows: - Find the halos using HOP (only once), it will give the catalog of all halos. - Now load the catalog, as we discussed previously, and get the mass of all halos in the list variable name "Mass" (say) - As this Halo catalog has all the halos and its corresponding attributes (Mass, positions, virial radius.), the variable "Mass" contains the list of all halos. - Now instead of filtering every time above 10^6 M_sun or 10^7 M_sun (say) and create the separate halo catalog each time you can bin the number of halos on Mass with if loop. *For example:* Suppose you have to count number of halos between 10^6 to 5*10^6 M_sun and 5*10^6 to 10^7 M_sun: binsize = 5e6 for i in range(2): count = 0 lower = 1e6 + i*binsize upper = lower + binsize for j in range(len(Mass)): if ( (Mass[j] >= lower) and (Mass[j] < upper) ): count = count + 1 print("In mass Range", lower, "-", upper, "the number of halos:", count) Note: Mass should be first converted into M_sun and also according to your convenience save the number of counts in a file or so in a way you want. I wish, I am on the right track and perhaps discuss the task you want to perform, otherwise, do let me know. Regards -Prateek On Tue, Mar 12, 2019 at 7:04 PM Salome Mtchedlidze < salome.mtchedlidze.1@iliauni.edu.ge> wrote:
Hi Prateek,
My purpose is just to plot halo number dependence on mass of the halos (i.e halo abundances).
For finding the halos I was using HOP and after that I filtered halo masses (following these instructions: http://yt-project.org/doc/analyzing/analysis_modules/halo_catalogs.html ); then I could see what was the number of these halos e.g above 10^6 M_sun. Then I created separate halo catalogs using that filters. Now I can find how many halos are in each catalog which are above the certain mass (using the code you wrote here). I was just trying to write the python cycle for that, not to do separately for each halo catalog.
Thanks, Salome
On Mar 11, 2019, at 10:12 PM, Prateek Gupta <prateekgidolia@gmail.com> wrote:
Hello Salome,
With that I mean to say, suppose you want to find the number of halos within the mass range 10^14 - 10^15 Msun (say). Then you can count it with just using a loop and if condition. Even if you want to list out the halos within the said mass range, just do little tricks of basic python you can extract out the list with the other properties also, say, centers, radius etc.
It will be more helpful for me if you can discuss the exact task you want to perform and also if possible please share "what is your complicated way.!"
Regards -Prateek
On Mon, Mar 11, 2019 at 10:05 PM Salome Mtchedlidze < salomchedlidze@gmail.com> wrote:
Hi Prateek again,
I have one question, when you said - "In *mass* variable you have the list of mass of all halos but in c.g.s units. Now you can find any number of halos in any range you want", what did you mean, saying "in any range"? Can i just directly write mass ranges in the code you provided? (I am asking this because I am doing that in a very complicated way).
Thanks, Salome _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org

Hi Prateek, Thank you very much; I started using your code and then I also find it useful to use histogram method, which is directly giving me halo number distribution (but as you advised me I only use HOP once and then working on “Mass” variable). Thanks, Salome
On Mar 12, 2019, at 7:47 PM, Prateek Gupta <prateekgidolia@gmail.com> wrote:
Hi Salome
As much as I understood your task, I think you can do it as follows: Find the halos using HOP (only once), it will give the catalog of all halos. Now load the catalog, as we discussed previously, and get the mass of all halos in the list variable name "Mass" (say) As this Halo catalog has all the halos and its corresponding attributes (Mass, positions, virial radius.), the variable "Mass" contains the list of all halos. Now instead of filtering every time above 10^6 M_sun or 10^7 M_sun (say) and create the separate halo catalog each time you can bin the number of halos on Mass with if loop. For example: Suppose you have to count number of halos between 10^6 to 5*10^6 M_sun and 5*10^6 to 10^7 M_sun: binsize = 5e6 for i in range(2): count = 0 lower = 1e6 + i*binsize upper = lower + binsize for j in range(len(Mass)): if ( (Mass[j] >= lower) and (Mass[j] < upper) ): count = count + 1 print("In mass Range", lower, "-", upper, "the number of halos:", count)
Note: Mass should be first converted into M_sun and also according to your convenience save the number of counts in a file or so in a way you want.
I wish, I am on the right track and perhaps discuss the task you want to perform, otherwise, do let me know.
Regards -Prateek
On Tue, Mar 12, 2019 at 7:04 PM Salome Mtchedlidze <salome.mtchedlidze.1@iliauni.edu.ge> wrote: Hi Prateek,
My purpose is just to plot halo number dependence on mass of the halos (i.e halo abundances).
For finding the halos I was using HOP and after that I filtered halo masses (following these instructions: http://yt-project.org/doc/analyzing/analysis_modules/halo_catalogs.html ); then I could see what was the number of these halos e.g above 10^6 M_sun. Then I created separate halo catalogs using that filters. Now I can find how many halos are in each catalog which are above the certain mass (using the code you wrote here). I was just trying to write the python cycle for that, not to do separately for each halo catalog.
Thanks, Salome
On Mar 11, 2019, at 10:12 PM, Prateek Gupta <prateekgidolia@gmail.com> wrote:
Hello Salome,
With that I mean to say, suppose you want to find the number of halos within the mass range 10^14 - 10^15 Msun (say). Then you can count it with just using a loop and if condition. Even if you want to list out the halos within the said mass range, just do little tricks of basic python you can extract out the list with the other properties also, say, centers, radius etc.
It will be more helpful for me if you can discuss the exact task you want to perform and also if possible please share "what is your complicated way.!"
Regards -Prateek
On Mon, Mar 11, 2019 at 10:05 PM Salome Mtchedlidze <salomchedlidze@gmail.com> wrote: Hi Prateek again,
I have one question, when you said - "In *mass* variable you have the list of mass of all halos but in c.g.s units. Now you can find any number of halos in any range you want", what did you mean, saying "in any range"? Can i just directly write mass ranges in the code you provided? (I am asking this because I am doing that in a very complicated way).
Thanks, Salome _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
participants (4)
-
Prateek Gupta
-
salomchedlidze@gmail.com
-
Salome Mtchedlidze
-
Salome Mtchedlidze