Hi Thor,
You can achieve this with yt:
import yt # Load a sample dataset. You can load whatever dataset you want using yt.load instead ds = yt.load_sample("output_00080", "info_00080.txt") ad = ds.all_data() # Required to define DM as the above dataset doesn't use the new particle family @yt.particle_filter(name="DM") def DM_filter(pfilter, data): return data['io', 'particle_identity'] > 0 ds.add_particle_filter("DM") # Max ref. level of the cell containing each particle is given by ad['DM', 'particle_refinement_level'] # Ref. level of the AMR grids is given by ad['index', 'grid_level'] # NOTE: this is 0-indexed, i.e. the actual ref. level is levelmin + ad['index', 'grid_level'] # To make a l.o.s. plot p = yt.ProjectionPlot(ds, 'x', ('index', 'grid_level'), method='mip') p.set_log(('index', 'grid_level'), False) # deactivate log as it goes from 0 to N p.save("/tmp/") # Alternatively you can also project the particle's ref. level onto the grid using fname = ds.add_deposited_particle_field(('DM', 'particle_refinement_level'), method='nearest') fname == ('deposit', 'DM_nn_refinement_level') p = yt.ProjectionPlot(ds, 'x', ('deposit', 'DM_nn_refinement_level'), method='mip') p.set_log(('deposit', 'DM_nn_refinement_level'), False) # deactivate log as it goes from 0 to N p.set_zlim(('deposit', 'DM_nn_refinement_level'), ds.parameters['levelmin'], ds.parameters['levelmax']) # otherwise there will be "hole" in AMR cells with no DM particles p.save("/tmp/")
I attached the two plots I obtain from this to the email, hope this helps!
Cheers,
Corentin
--
You received this message because you are subscribed to the Google Groups "ramses_users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ramses_users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ramses_users/1a3b95c0-ba6b-4919-8aa8-84d290568d11n%40googlegroups.com.
-- Dr. Corentin Cadiou Post Doctoral Research Assistant Cosmoparticle Initiative Hub, desk 27 University College London (UCL) Gower St, Bloomsbury, London WC1E 6BT mobile: +33.6.43.18.66.83