blaizot / ramses-tutorials

Check out the read-the-docs version at the link below
https://ramses-tutorials.readthedocs.io/en/latest
8 stars 3 forks source link

annotate_streamlines fails #5

Closed blaizot closed 1 week ago

blaizot commented 3 months ago

In the tutorial Cosmological Volume, the display of the gravitational potential map does not work very well. The line "q1.annotate_strealines(...)" plainly crashes for me.

Some discussion of what we see would be nice as well (what stands out in the potential map are the voids, i guess, which is perhaps counterintuitive ?).

cspotz commented 2 months ago

managed to get this on my laptop, I let you cross check it and place it in a new section or where it should be coucou I added some words on voids, maybe simpler to say it orally also during the course

blaizot commented 1 month ago

This does not seem to work, does it ? The streamlines neatly ignore the halo ... If you can make it work, let me know.

mtrebitsch commented 1 month ago

I am not sure that this is an error, actually. I played around a bit and I think it's because the halo itself is moving across the box. One solution to isolate the "converging flows" around the halo would be to create a derived field of "velocity - halo velocity", and use that.

See below my tests:

image

As we can see, the velocity along x neatly matches the streamlines.

Now, luckily, yt has a way of removing the "bulk velocity" from a region. In a given region (which could be all_data or a sphere as I did), you can define a field parameter called bulk_velocity to be, for example, the velocity of the halo of interest. Then, if you deposit the "relative" velocities on a grid, you get essentially velocity - bulk_velocity, which you can nicely plot. See below for an example.

image

blaizot commented 1 month ago

Awesome !! Thanks ! Can you commit that into the tutorial ? 🙏