[yt-users] Problems using Rockstar in yt

Britton Smith brittonsmith at gmail.com
Thu Aug 14 06:29:34 PDT 2014


Hi David,

I am not familiar with how particles are distinguished in RAMSES, so I
couldn't tell you exactly the criteria you could use for filtering.
 However, if you are asking specifically about how you add a filter to a
DatasetSeries object, then the key is the setup_function in the above
example.  You can create a function that accepts a Dataset object, and then
does whatever you want with it.  Above, this is the "setup_ds" function,
which is applying the dark matter filter.  You can pass this function
during the creation of a DatasetSeries object through the "setup_function"
keyword.  The above example uses a slight variant on the DatasetSeries
object that currently doesn't work for RAMSES, but you can use the regular
one:

timeseries = DatasetSeries(..., setup_function=setup_ds)

Britton


On Tue, Aug 12, 2014 at 10:53 PM, David Sullivan <D.Sullivan at sussex.ac.uk>
wrote:

> Hi Britton, all,
>
> That took care of my issues, now it’s run successfully. Just one more
> question: as I’m using RAMSES I create a DatasetSeries using:
>
> es = yt.load('../output_*/info_*.txt’)
> rh = RockstarHaloFinder(es, num_readers=1, num_writers=2)
>
> Is there a way for me to add a dark matter only filter as done here for an
> enzo dataset:
>
> # create a particle filter to remove star particles
> @yt.particle_filter("dark_matter", requires=["creation_time"])
> def _dm_filter(pfilter, data):
>         return data["creation_time"] < 0.0
>
> def setup_ds(ds):
>         ds.add_particle_filter("dark_matter”)
>
> es = yt.simulation("enzo_tiny_cosmology/32Mpc_32.enzo", "Enzo")
> es.get_time_series(setup_function=setup_ds, redshift_data=False)
>
> rh = RockstarHaloFinder(es, num_readers=1, num_writers=2,
>                         particle_type="dark_matter")
>
> I’ve looked at the docs on particle filtering but I can’t add filters to
> the DatasetSeries object I have.
>
> Many thanks for the help so far!
> David
>
> On 12 Aug 2014, at 12:44, yt-users-request at lists.spacepope.org wrote:
>
> Hi Cameron, David,
>
> Cameron, you are correct, on Mac systems you need to set DYLD_LIBRARY_PATH
> instead of LD_LIBRARY_PATH.  The fact that this causes vi and other things
> to fail is apparently an OS X bug (I found some discussions of it on the
> internet) and has nothing to do with yt.  I went through a similar thing
> and had to resort to having a separate terminal for running rockstar that I
> didn't try to do anything else in.  For what it's worth, this behavior
> seems to have been fixed.  I am on OS X 10.8.5 and no longer have the issue
> of things crashing in a terminal where I have edited DYLD_LIBRARY_PATH.
>
> On the second issue that you both reported, the problem is the way in which
> one tells yt to run in parallel depends on how you import yt.
>
> If you do "from yt.mods import *", the parallelism is enabled by adding the
> --parallel flag on the command line.  However, if you do "import yt", then
> parallelism is enabled by doing "yt.enable_parallelism()" directly below
> the import statement within your script.
>
> I looked at the latest documentation on parallelism (
> http://yt-project.org/doc/analyzing/parallel_computation.html) and is
> discusses the use of yt.enable_parallelism(), but not the old way that
> works with "from yt.mods import *".  There should probably be a short
> discussion added of how this has changed.  Additionally, let's make sure
> that the yt-rockstar docs get any needed additions there as well.
>
> Britton
>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140814/8f54e24f/attachment.html>


More information about the yt-users mailing list