Hi Guido,

I won't have time to look at this carefully for a little while, but one easy thing to try might be to redo your analysis, but use a version of yt built from source using the yt-4.0 branch. You'll need to clone the yt repository, checkout the yt-4.0 branch, and build from source by doing "python setup.py develop", after ensuring that numpy and cython are already installed.

yt 4.0 will move from using yt.units to a new unit library based on yt.units called unyt (github.com/yt-project/unyt). When we updated the yt.units codebase to become unyt, there were some issues with magnetic field units that were resolved and it's possible that you're hitting a bug in yt.units and simply using yt-4.0 will fix this issue. Worth a try anyway!

If that doesn't help one of us will hopefully be able to look at this more closely sometime soon.

-Nathan

On Thu, Nov 14, 2019 at 10:40 AM Guido Granda Muñoz <guidogranda@gmail.com> wrote:
Hello yt users,
I'm trying to understand magnetic field units used in yt Since I found something that looks strange to me. As stated on the yt website, it uses cgs units just like FLASH.
I'm sending the code bellow, and it does the following:
1) I use yt to  trace a ortho ray
2) using that ray I get the magnetic field a gas pressure
3) from the magnetic fiedl I get the magnetic pressure
4) I add gas pressure and magnetic field pressure
5) The answer is wrong, and I don't know why

The data file is here: http://use.yt/upload/a95035d4
The code is here: http://paste.yt-project.org/show/178/

Cheers,
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org