Closed astronerdF closed 1 year ago
This is going to be hard without another spatial ordering, i.e. using scipy's KDTree. However that means you are leaving the dask framework.
Why specifically masking with Rvir200? If you would be okay with masking "non-halo" particles (i.e. those not associated with any halo), then this task would be done immediately as the particle ordering allows for that.
How to mask with the non-halo particles? Right now, I need the average metallicity of the IGM gas, but in the future I need the mass inflow rate of gas particles within the Rvir200.
At the same time, what defines whether a particle belongs to a halo or not?
Could you update the repository and try data = ds.return_data(unbound=True)
to obtain all unbound particles?
This should be the most efficient way because it only reads memory that holds unbound particles. I recommend using this method (if it works). In theory, you could also use masking with d["PartType0"]["GroupID"] == 9223372036854775807
. (The groupID is set to max_int64_val for unbound gas).
TBD further offline.
This should be the most efficient way because it only reads memory that holds unbound particles. I recommend using this method (if it works). In theory, you could also use masking with d["PartType0"]["GroupID"] == 9223372036854775807. (The groupID is set to max_int64_val for unbound gas).
Note: max_int64_val is set for unbound gas right now due to an issue with dask, it might eventually change back to -1 in the future. Use "ds.misc['unboundID']" for the ID of unbound gas to stay consistent in the future.
Hi! This is not a bug in the code. I have a task for which I have prepared a code to the best of my abilities. I want to know if there is any way to make it run faster.
I want to get the data of gas particles within a simulation snapshot that exists outside the R200_crit distance from the center of each halo. In other words, I want to separate the gas that exists outside the halo vs inside the halo. The code that I am using to do that for 1 halo is:
On the vera cluster, it took roughly 4.4 seconds for the first halo. For all the halos in the simulation, it could take a very long time.
This is my code to remove the halo gas:
I tried parallelizing the code as well as turning some of the arrays into numpy arrays, but it did not work and somehow was slower.