Hello Reju,I think you are using yt2.x, then you can do it like that, create a fieldh=0.702@derived_field(name = "Know_cell_size", take_log=False, units='')
Box_size_Simulation = 128 * 1000 * (1+z) * h # if box size of simulation is 128Mpccm/h
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 tempNow 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.xRegards-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 tempHow 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
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org