<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Matt:<br>
<br>
    Here are my outputs in 1.5 and trunk iyt:<br>
<br>
<br>
-----------------------------------------------------------<br>
<br>
In [1]: pf = load("L20S2D9H26S_0050")<br>
<br>
In [2]: pf["kpccm"]<br>
---------------------------------------------------------------------------<br>
KeyError                                  Traceback (most recent call
last)<br>
<br>
/u/ac/chummels/source/yt-x86_64/src/yt-1.5/scripts/iyt in
<module>()<br>
----> 1 <br>
      2 <br>
      3 <br>
      4 <br>
      5 <br>
<br>
/u/ac/chummels/source/yt-x86_64/src/yt-1.5/yt/lagos/OutputTypes.pyc in
__getitem__(self, key)<br>
    104                   self.conversion_factors]:<br>
    105             if key in d: return d[key]<br>
--> 106         raise KeyError(key)<br>
    107 <br>
    108     def keys(self):<br>
<br>
KeyError: 'kpccm'<br>
<br>
In [3]: pf["ComovingCoordinates"]<br>
Out[3]: 1<br>
<br>
----------------------------------------------------------------------<br>
<br>
<br>
My enzo parameter file also has the comoving coordinates flag set as
yours does.  Weird...<br>
<br>
<pre wrap="">ComovingCoordinates                   = 1</pre>
<br>
Cameron<br>
<br>
<br>
Matthew Turk wrote:
<blockquote
 cite="mid:a998fef10911231105n4f2623aet1880a05df58122f3@mail.gmail.com"
 type="cite">
  <pre wrap="">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:

<a class="moz-txt-link-freetext" href="http://yt.enzotools.org/browser/trunk/yt/lagos/OutputTypes.py#L323">http://yt.enzotools.org/browser/trunk/yt/lagos/OutputTypes.py#L323</a>

and then if it is, this routine gets called:

<a class="moz-txt-link-freetext" href="http://yt.enzotools.org/browser/trunk/yt/lagos/OutputTypes.py#L340">http://yt.enzotools.org/browser/trunk/yt/lagos/OutputTypes.py#L340</a>

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
<a class="moz-txt-link-rfc2396E" href="mailto:chummels@astro.columbia.edu"><chummels@astro.columbia.edu></a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">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
<a class="moz-txt-link-freetext" href="http://outreach.astro.columbia.edu">http://outreach.astro.columbia.edu</a>

_______________________________________________
yt-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>
<a class="moz-txt-link-freetext" href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a>

    </pre>
  </blockquote>
  <pre wrap=""><!---->_______________________________________________
yt-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>
<a class="moz-txt-link-freetext" href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a>

  </pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">-- 
Cameron Hummels
PhD Candidate, Astronomy Department of Columbia University
Public Outreach Director, Astronomy Department of Columbia University
NASA IYA New York State Student Ambassador
<a class="moz-txt-link-freetext" href="http://outreach.astro.columbia.edu">http://outreach.astro.columbia.edu</a>
</pre>
</body>
</html>