Hello Reju, I think you are using yt2.x, then you can do it like that, create a field h=0.702 Box_size_Simulation = 128 * 1000 * (1+z) * h # if box size of simulation is 128Mpccm/h @derived_field(name = "Know_cell_size", take_log=False, units='') def _Name(field, data): temp = data["mach_number"].copy() temp.fill(0) ind = np.where(data['dx']*Box_size_Simulation*h < 100) temp[ind]= 1.0 return temp Now you can find the number of cells less than 100 kpc by taking the total of the created field ("Know_cell_size") within the specific region you want. Something like sp.quantities.total_quantity("Know_cell_size") in yt3.x Regards -Prateek On Thu, Nov 1, 2018 at 3:30 PM Reju Sam John <rejusamjohn@gmail.com> wrote:
Dear all,
I have the following derived field: h=0.702 @derived_field(name = "Name", take_log=False, units='g/s**3') def _Name(field, data): temp = data["Mach"].copy() temp.fill(0) ind = np.where(((data['dx']*128*1000)*(1+z)*h<100)) temp[ind]= 0.5*data["Density"][ind]*(data["Mach"][ind]*data["SoundSpeed"][ind])**3
return temp How to check that, how many cells with cell size less than 100 kpc ( data['dx']*128*1000)*(1+z)*h<100) ?
thankyou -- Reju Sam John _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org