
Hi, Everyone-- I'm trying to get code units from enzo for a cosmology run, but in_units('code_density') seems to do nothing. 'code_mass/code_length**3' seems to work. Is this a bug, or a feature?
ad['density'].in_units('code_mass/code_length**3') YTArray([ 0.9970247 , 0.99774731, 0.99854185, ..., 0.99993769, 0.99914176, 0.99841755]) code_mass/code_length**3 ad['density'].in_units('code_density') YTArray([ 1.87321000e-29, 1.87456764e-29, 1.87606042e-29, ..., 1.87868293e-29, 1.87718755e-29, 1.87582689e-29]) code_density
Thanks! d. -- -- Sent from a computer. _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Hi Dave, It's neither a bug nor a feature; "density" is represented as a "code_mass / code_length**3" primitive. -Matt On Fri, May 22, 2015 at 9:20 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Everyone--
I'm trying to get code units from enzo for a cosmology run, but in_units('code_density') seems to do nothing. 'code_mass/code_length**3' seems to work. Is this a bug, or a feature?
ad['density'].in_units('code_mass/code_length**3') YTArray([ 0.9970247 , 0.99774731, 0.99854185, ..., 0.99993769, 0.99914176, 0.99841755]) code_mass/code_length**3 ad['density'].in_units('code_density') YTArray([ 1.87321000e-29, 1.87456764e-29, 1.87606042e-29, ..., 1.87868293e-29, 1.87718755e-29, 1.87582689e-29]) code_density
Thanks! d.
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Hi, Matt-
It's neither a bug nor a feature; "density" is represented as a "code_mass / code_length**3" primitive.
So what does code_density do? Thanks a bunch! d.
-Matt
On Fri, May 22, 2015 at 9:20 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Everyone--
I'm trying to get code units from enzo for a cosmology run, but in_units('code_density') seems to do nothing. 'code_mass/code_length**3' seems to work. Is this a bug, or a feature?
ad['density'].in_units('code_mass/code_length**3') YTArray([ 0.9970247 , 0.99774731, 0.99854185, ..., 0.99993769, 0.99914176, 0.99841755]) code_mass/code_length**3 ad['density'].in_units('code_density') YTArray([ 1.87321000e-29, 1.87456764e-29, 1.87606042e-29, ..., 1.87868293e-29, 1.87718755e-29, 1.87582689e-29]) code_density
Thanks! d.
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer. _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

On Fri, May 22, 2015 at 7:25 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Matt-
It's neither a bug nor a feature; "density" is represented as a "code_mass / code_length**3" primitive.
So what does code_density do?
This is supposed to be set to code_mass/code_length**3, but you've actually spotted an oversight in the way we set up units in the Enzo frontend such that Enzo units turn out subtly different from units in the other frontends. I've gone ahead and issued a pull request to fix this: https://bitbucket.org/yt_analysis/yt/pull-request/1597/delegate-setting-enzo...
Thanks a bunch! d.
-Matt
On Fri, May 22, 2015 at 9:20 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Everyone--
I'm trying to get code units from enzo for a cosmology run, but in_units('code_density') seems to do nothing. 'code_mass/code_length**3' seems to work. Is this a bug, or a feature?
ad['density'].in_units('code_mass/code_length**3') YTArray([ 0.9970247 , 0.99774731, 0.99854185, ..., 0.99993769, 0.99914176, 0.99841755]) code_mass/code_length**3 ad['density'].in_units('code_density') YTArray([ 1.87321000e-29, 1.87456764e-29, 1.87606042e-29, ..., 1.87868293e-29, 1.87718755e-29, 1.87582689e-29]) code_density
Thanks! d.
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Thanks, Nathan. Let me know if I can help out. On Fri, May 22, 2015 at 12:28 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Fri, May 22, 2015 at 7:25 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Matt-
It's neither a bug nor a feature; "density" is represented as a "code_mass / code_length**3" primitive.
So what does code_density do?
This is supposed to be set to code_mass/code_length**3, but you've actually spotted an oversight in the way we set up units in the Enzo frontend such that Enzo units turn out subtly different from units in the other frontends.
I've gone ahead and issued a pull request to fix this:
https://bitbucket.org/yt_analysis/yt/pull-request/1597/delegate-setting-enzo...
Thanks a bunch! d.
-Matt
On Fri, May 22, 2015 at 9:20 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Everyone--
I'm trying to get code units from enzo for a cosmology run, but in_units('code_density') seems to do nothing. 'code_mass/code_length**3' seems to work. Is this a bug, or a feature?
> ad['density'].in_units('code_mass/code_length**3') YTArray([ 0.9970247 , 0.99774731, 0.99854185, ..., 0.99993769, 0.99914176, 0.99841755]) code_mass/code_length**3 > ad['density'].in_units('code_density') YTArray([ 1.87321000e-29, 1.87456764e-29, 1.87606042e-29, ..., 1.87868293e-29, 1.87718755e-29, 1.87582689e-29]) code_density
Thanks! d.
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer. _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (3)
-
David Collins
-
Matthew Turk
-
Nathan Goldbaum