Can we just set up auto field generation for comoving density fields, similar to the way the species fraction fields are set up?  For every density field that exists, we can simply create Something_Density_Comoving, or something similar.<div>
<br></div><div>Britton<br><br><div class="gmail_quote">On Sun, Feb 21, 2010 at 11:35 AM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Geoffrey, Stephen,<br>
<br>
So there isn't currently a comoving density field.  I think it can be<br>
added like so:<br>
<br>
def _ComovingDensity(field, data):<br>
    ef = (1.0 + <a href="http://data.pf" target="_blank">data.pf</a>["CosmologyCurrentRedshift"])**3.0<br>
    return data["Density"]/ef<br>
add_field("ComovingDensity", function=_ComovingDensity)<br>
<br>
it won't need a conversion function because Density is already in CGS.<br>
<br>
Geoffrey, I think I'd prefer not to have a flag to swap things in and<br>
out -- globally turning on "comoving units" would likely end up having<br>
to add a lot of machinery to handle all of the comoving conversions.<br>
I think it's okay just to give them when requested.  (Which, for what<br>
it's worth, is what Enzo does in the parameter file output.)<br>
<br>
-Matt<br>
<div><div></div><div class="h5"><br>
On Sun, Feb 21, 2010 at 3:13 AM,  <<a href="mailto:gso@physics.ucsd.edu">gso@physics.ucsd.edu</a>> wrote:<br>
> Is it possible to leave the default in proper units, but add a new feature<br>
> using a flag that will set the data in either the co-moving, or proper<br>
> units?  (or is it much easier for the user to multiply it by the right<br>
> factors of 1+CurrentRedshift?)<br>
><br>
> From<br>
> G.S.<br>
><br>
>> Hi all,<br>
>><br>
>> I would like to make a phase plot that uses co-moving density, rather than<br>
>> proper density, something like this:<br>
>><br>
>> <a href="http://yt.enzotools.org/doc/cookbook/recipes.html#simple-phase" target="_blank">http://yt.enzotools.org/doc/cookbook/recipes.html#simple-phase</a><br>
>><br>
>> do I have to define a new field, or is there a built-in comoving density<br>
>> field (that I can't find)?<br>
>><br>
>> Thanks!<br>
>>  _______________________________________________________<br>
>> <a href="mailto:sskory@physics.ucsd.edu">sskory@physics.ucsd.edu</a>           o__  Stephen Skory<br>
>> <a href="http://physics.ucsd.edu/~sskory/" target="_blank">http://physics.ucsd.edu/~sskory/</a> _.>/ _Graduate Student<br>
>> ________________________________(_)_&#92;(_)_______________<br>
>><br>
>> _______________________________________________<br>
>> yt-users mailing list<br>
>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</div></div></blockquote></div><br></div>