Hi JC,<div><br></div><div>Are the hierarchies identical between pf1 and pf2? If not, I think that could be a problem. It could be that with the slice you passed only through root grids where the hierarchy is identical. Doing a projection that acts upon the entire domain would expose this issue. If this is the case, you may need to create a constant resolution data container for use in the comparison.</div>
<div><br></div><div>Britton<br><br><div class="gmail_quote">On Tue, May 1, 2012 at 3:58 PM, Jean-Claude Passy <span dir="ltr"><<a href="mailto:jcpassy@gmail.com" target="_blank">jcpassy@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 bgcolor="#FFFFFF" text="#000000">
Oops, I spoke too fast. <br>
I can make a slice but if I try a projection, the same kind of error
occurs: <a href="http://paste.yt-project.org/show/7QiwjVoYXKYxCn3Iu2u9/" target="_blank">http://paste.yt-project.org/show/7QiwjVoYXKYxCn3Iu2u9/</a><br>
<br>
This is the script I am using:<br>
<br>
<address>-------------------------------------------------------------------------</address>
<address>def pf_compare(pf1, pf2):</address>
<address> def _NewField(field, data):</address>
<address> data2 = pf2.h.grids[<a href="http://data.id" target="_blank">data.id</a> - data._id_offset]</address>
<address> return
abs(data2["TotalEnergy"]-data["TotalEnergy"])/data["TotalEnergy"]</address>
<address> pf1.field_info.add_field("CompareEnergy", function =
_NewField, validators = [ValidateGridType()])</address>
<address><br>
pf1 = load('helix/DD0000/CE0000')</address>
<address>pf2 = load('parallel/DD0000/CE0000')</address>
<address><br>
#
Comparison
</address>
<address>pf_compare(pf1, pf2)</address>
<address>region = pf1.h.region([0.5, 0.5, 0.5], [0.0, 0.0, 0.0],
[1.0, 1.0, 1.0])</address>
<address>compare_energy = region["CompareEnergy"]</address>
<address><br>
pc = PlotCollection(pf1)</address>
<address>pc.add_slice("CompareEnergy",2,center=[0.5, 0.5, 0.5])</address>
<address>pc.add_projection("CompareEnergy",2)</address>
<address>pc.set_lim((0.4, 0.6, 0.4, 0.6))</address>
<address>pc.save()</address>
<address>-------------------------------------------------------------------------</address>
<br>
Any idea?<br>
Cheers,<br>
<br>
JC<div class="im"><br>
<br>
On 5/1/12 3:35 PM, Jean-Claude Passy wrote:
<blockquote type="cite">
Thanks Britton, it works perfectly.<br>
<br>
Cheers,<br>
<br>
JC</blockquote>
</div></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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>