<meta charset="utf-8">Hi Christine,<div><br></div><div>In addition to Stephen's answer, in the past I have done:</div><div><br></div><div>pf = load('data0005')</div><div>max_loc = pf.h.find_max_cell_location('Density')</div>

<div>temperature_at_max_den = max_loc[0].get_data('Temperature')[max_loc[1]]</div><div><br></div><div>I'm not sure which is faster, but two methods are better than one!</div><div>Sam</div><div><br></div><div>
p.s. I just saw matt's email come through, and mine looks like the last option he gave..</div>
<br><div class="gmail_quote">On Mon, Dec 6, 2010 at 3:38 PM, Stephen Skory <span dir="ltr"><<a href="mailto:stephenskory@yahoo.com">stephenskory@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Christine,<br>
<div class="im"><br>
<br>
>This is a pretty simple issue and probably has a simple solution,<br>
> but<br>
>I'm not sure how to do it.  I want to access the value of a field at<br>
> a<br>
>given location.  For example, say I have the location of the peak<br>
> gas<br>
>density and I want to find the value of the metallicity at that<br>
> point.<br>
>How would I do<br>
> that?<br>
<br>
<br>
<br>
<br>
<br>
</div>you'll want to use numpy's argmax(), which gives the index of the maximum value in an array. Here's an example:<br>
<br>
In [1]: pf = load("data0005")<br>
<br>
In [2]: dd = pf.h.all_data()<br>
yt         INFO       2010-12-06 15:36:30,714 Getting the binary hierarchy<br>
yt         INFO       2010-12-06 15:36:30,725 Finished with binary hierarchy reading<br>
<br>
In [3]: D = dd['Density']<br>
yt         INFO       2010-12-06 15:36:39,620 Getting field Density from 32<br>
<br>
In [4]: max = na.argmax(D)<br>
<br>
In [5]: max<br>
Out[5]: 911803<br>
<br>
In [6]: D[max]<br>
Out[6]: 5.2503087194967203e-26<br>
<br>
In [7]: T = dd['Temperature']<br>
yt         INFO       2010-12-06 15:36:58,377 Getting field Temperature from 32<br>
<br>
In [8]: T[max]<br>
Out[8]: 10597.077292396227<br>
<br>
Let me know if that's not clear enough!<br>
<font color="#888888"><br>
<br>
Stephen Skory<br>
<a href="mailto:stephenskory@yahoo.com">stephenskory@yahoo.com</a><br>
<a href="http://stephenskory.com/" target="_blank">http://stephenskory.com/</a><br>
510.621.3687 (google voice)<br>
</font><div><div></div><div class="h5">_______________________________________________<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>