[yt-dev] Issue #1037: Units system has problems in comparing between cosmological datasets with different scale factors (yt_analysis/yt)

Cameron Hummels issues-reply at bitbucket.org
Thu Jun 25 11:24:22 PDT 2015


New issue 1037: Units system has problems in comparing between cosmological datasets with different scale factors
https://bitbucket.org/yt_analysis/yt/issue/1037/units-system-has-problems-in-comparing

Cameron Hummels:

At present, when you try to compare/combine quantities from two separate datasets, yt defaults to internally converting those quantities to non-comoving physical units before making the comparison/operation.  I think this *should* be the default behavior as it covers the bulk of the use cases, but it would be good to allow for comparisons/combinations using comoving units (of different scale factors) as well.  

I recently ran into this issue in trying to compare two separate datasets at different redshifts (ie scale factors) from a cosmological simulation where the units were enzo's `code_length`, which is in comoving units.  In the end, I had to just grab the `.v` values out of the `YTArray` in order manually subtract them because subtracting using the `YTArray` yielded incorrect answers.

Here is an example demonstrating this problem.  Let's say a galaxy sits at the center of this box at both z=99 and z=0. we can see how far it has moved in comoving units by subtracting off it's position at z=0 from it's position at z=99. 

http://paste.yt-project.org/show/5655/

and its output:

http://paste.yt-project.org/show/5656/

I think this could be addressed by just creating an additional attribute on `YTArrays` for  converting to comoving units when making comparisons/operations with other `YTArrays`.







More information about the yt-dev mailing list