<div dir="ltr">This doesn't quite answer your question, but to get the max val/location of the baryon overdensity I generally just do<div><br></div><div>ad = ds.all_data()</div><div>ad.set_field_parameter('omega_baryon', 0.44)</div><div><br></div><div>max_loc = ad.quantities.max_location('baryon_overdensity')</div><div>extrema  = ad.quantities.extrema('baryon_overdensity')<br></div><div><br></div><div>-Hilary</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 17, 2015 at 6:24 AM, Brian O'Shea <span dir="ltr"><<a href="mailto:bwoshea@gmail.com" target="_blank">bwoshea@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi folks,<div><br></div><div>I'm doing some analysis on an Enzo simulation using the tip of yt-3, and would like to find the maximum and minimum of the field "baryon_overdensity", which is a derived field.  If I were to make a projection or slice of this field, I'd have to feed in omega_baryon so that baryon_overdensity can be created on the fly, e.g.,</div><div><br></div><div><div>plot1 = yt.ProjectionPlot(ds,'z',"baryon_overdensity",weight_field="baryon_overdensity",</div><div>                              center=c,data_source=my_region, field_parameters = {'omega_baryon': 0.046})</div></div><div><br></div><div>However, if I try to run find_max("baryon_overdensity") on my dataset, it complains that the derived field needs omega_baryon, with an error message ending in this:</div><div><br></div><div><div>/Users/bwoshea/Desktop/yt-3/src/yt-hg/yt/fields/derived_field.pyc in __call__(self, data)</div><div>    237                 doesnt_have.append(p)</div><div>    238         if len(doesnt_have) > 0:</div><div>--> 239             raise NeedsParameter(doesnt_have)</div><div>    240         return True</div><div>    241 </div><div><br></div><div>NeedsParameter: (['omega_baryon'])</div></div><div><br></div><div><br></div><div>This makes sense; however, I can't feed omega_baryon to find_max() in the same way that I can feed field_parameters into ProjectionPlot.  Is there a way to either (1) force yt to generate the baryon_overdensity field prior to calling find_max(), or (2) feed omega_baryon into find_max()?  I think that option #2 is not trivial, since the source code for find_max (in src/yt-hg/yt/data_objects/static_objects.py) only takes the name of the field.  I suspect that #1 is possible, though I can't find anything in the documentation about it.</div><div><br></div><div>Any suggestions would be greatly appreciated.  Thanks!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>--Brian</div><div><br></div></font></span></div>
<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" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>