<div dir="ltr"><div>Where does isolated galaxy come from?<br><br>I think the problem is in my magnetic field name, but I don't get why. The magnetic field in that dataset is called MagneticField_C_1, but I'm not even able to do a weighted average of that quantity.<br>
<br></div>d.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 23, 2013 at 12:25 PM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@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">Hey Dave,<div><br></div><div>I'm unable to reproduce the error using the following script:</div><div>
<br></div><div><div>from yt.mods import *</div><div>pf = load('IsolatedGalaxy/galaxy0030/galaxy0030')</div>
<div>q = pf.h.all_data().quantities['WeightedAverageQuantity']('MagneticEnergy','CellVolume')</div><div>print q</div></div><div><br></div><div>I executed it with the following command:</div><div><br>
</div><div>mpirun -np 2 python test.py --parallel<br></div><div><br></div><div>this was run on 683e4ea8530e. </div><div><br></div><div>IsolatedGalaxy is probably very different from your dataset. Does my script fail with the trivial modification to load your file instead of IsolatedGalaxy? If not, can you modify the script to reproduce the error you're seeing?</div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>-Nathan</div></font></span></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Tue, Jul 23, 2013 at 10:58 AM, David Collins <span dir="ltr"><<a href="mailto:dcollins4096@gmail.com" target="_blank">dcollins4096@gmail.com</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div>Hi, all--<br><br></div>I have an odd error trying to get some averaged quantities in parallel. I'm trying to do <br>
<br>pf.h.all_data().quantities['WeightedAverageQuantity']('MagneticEnergy','CellVolume')<br>
<br></div>on two processors, and I get the following error:<br><div><br>File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 396, in __call__<br>dd *= self._convert_function(data)<br>
TypeError: unsupported operand type(s) for *=: 'NoneType' and 'int'<br><br></div><div>It works fine in serial, and it works fine if I use "VelocityMagnitude" instead of "MagneticEnergy"<br>
<br></div><div>Does anyone have an idea about what I'm doing wrong?<br></div><div><br>I run it as <br>> mpirun -np 2 python p23_go.py --parallel<br><br></div><div>and the full trace back is:<br></div><div><br>Traceback (most recent call last):<br>
File "ptmp.py", line 5, in <module><br>
bavg = ad.quantities['WeightedAverageQuantity']('MagneticEnergy','CellVolume')<br> File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/derived_quantities.py", line 87, in __call__<br>
Traceback (most recent call last):<br> File "ptmp.py", line 5, in <module><br> bavg = ad.quantities['WeightedAverageQuantity']('MagneticEnergy','CellVolume')<br> File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/derived_quantities.py", line 87, in __call__<br>
self.func(e, *args, **kwargs)<br> self.func(e, *args, **kwargs)<br> File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/derived_quantities.py", line 203, in _WeightedAverageQuantity<br>
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/derived_quantities.py", line 203, in _WeightedAverageQuantity<br> num = (data[field] * data[weight]).sum()<br> File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 257, in __missing__<br>
num = (data[field] * data[weight]).sum()<br> File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 257, in __missing__<br> vv = FI[item](self)<br> vv = FI[item](self)<br>
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 395, in __call__<br> File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 395, in __call__<br>
dd = self._function(self, data)<br> File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/universal_fields.py", line 1016, in _MagneticEnergy<br> dd = self._function(self, data)<br> File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/universal_fields.py", line 1016, in _MagneticEnergy<br>
return (data["Bx"]**2 + data["By"]**2 + data["Bz"]**2)/(8*np.pi)<br> return (data["Bx"]**2 + data["By"]**2 + data["Bz"]**2)/(8*np.pi)<br> File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 257, in __missing__<br>
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 257, in __missing__<br> vv = FI[item](self)<br> File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 396, in __call__<br>
vv = FI[item](self)<br> File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 396, in __call__<br> dd *= self._convert_function(data)<br>TypeError: unsupported operand type(s) for *=: 'NoneType' and 'int'<br>
dd *= self._convert_function(data)<br>TypeError: unsupported operand type(s) for *=: 'NoneType' and 'int'<br><br></div><div>Thanks a ton!<span><font color="#888888"><br></font></span></div>
<span><font color="#888888"><div><br clear="all"><div><div><br>-- <br><div dir="ltr">
-- Sent from a computer.<br></div>
</div></div></div></font></span></div>
<br></div></div><div class="im">_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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></div></blockquote></div><br></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><br clear="all"><br>-- <br><div dir="ltr">-- Sent from a computer.<br></div>
</div>