[yt-users] Comoving units
Cameron Hummels
chummels at astro.columbia.edu
Mon Nov 23 12:07:56 PST 2009
Hi Matt:
Here are my outputs in 1.5 and trunk iyt:
-----------------------------------------------------------
In [1]: pf = load("L20S2D9H26S_0050")
In [2]: pf["kpccm"]
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/u/ac/chummels/source/yt-x86_64/src/yt-1.5/scripts/iyt in <module>()
----> 1
2
3
4
5
/u/ac/chummels/source/yt-x86_64/src/yt-1.5/yt/lagos/OutputTypes.pyc in
__getitem__(self, key)
104 self.conversion_factors]:
105 if key in d: return d[key]
--> 106 raise KeyError(key)
107
108 def keys(self):
KeyError: 'kpccm'
In [3]: pf["ComovingCoordinates"]
Out[3]: 1
----------------------------------------------------------------------
My enzo parameter file also has the comoving coordinates flag set as
yours does. Weird...
ComovingCoordinates = 1
Cameron
Matthew Turk wrote:
> Hi Cameron,
>
> Over here it's working for me with 1.5 and trunk:
>
> In [2]: pf = load("RD0005-mine/RedshiftOutput0005")
>
> In [3]: pf["kpccm"]
> Out[3]: 7692.3076923076915
>
> Looking at the source, which I am now officially putting on my "clean
> this up" list, it looks like the comoving units only get set up if the
> parameter "ComovingCoordinates" is set in the enzo parameter file:
>
> http://yt.enzotools.org/browser/trunk/yt/lagos/OutputTypes.py#L323
>
> and then if it is, this routine gets called:
>
> http://yt.enzotools.org/browser/trunk/yt/lagos/OutputTypes.py#L340
>
> which sets up all the /h and comoving stuff. I guess the question now
> is, is yt skipping over the line where it sets those units up, or is
> it misunderstanding the ComovingCoordinates line in the parameter
> file? Could you let me know what the value of "
> pf['ComovingCoordinates'] " is, and what the line in the Enzo
> parameter file is as well? For me, it looks like:
>
> In [5]: pf["ComovingCoordinates"]
> Out[5]: 1
>
> and the line in the file is:
>
> ComovingCoordinates = 1
>
> Thanks, Cameron!
>
> -Matt
>
> On Mon, Nov 23, 2009 at 10:58 AM, Cameron Hummels
> <chummels at astro.columbia.edu> wrote:
>
>> Hello everyone:
>>
>> I upgraded to the new version of yt, and I noticed there was a change in
>> unit designation. I used to be able to specify units in comoving units of
>> kpc as: "kpccm", but that functionality now appears to be broken. Does
>> anyone know what the new syntax is for using comoving units?
>> Here is a code example that used to work, but it no longer does in the new
>> version:
>>
>> pf = EnzoStaticOutput(filename)
>> thick_faceon = 10.0/pf['kpccm']
>>
>> Thanks!
>> Cameron
>>
>>
>> --
>> Cameron Hummels
>> PhD Candidate, Astronomy Department of Columbia University
>> Public Outreach Director, Astronomy Department of Columbia University
>> NASA IYA New York State Student Ambassador
>> http://outreach.astro.columbia.edu
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
--
Cameron Hummels
PhD Candidate, Astronomy Department of Columbia University
Public Outreach Director, Astronomy Department of Columbia University
NASA IYA New York State Student Ambassador
http://outreach.astro.columbia.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20091123/fefda074/attachment.html>
More information about the yt-users
mailing list