Hi guys,<br><br>I sometimes have particles in my sims and when i do I want to plot them. At the moment I have:<br>        if sp["ParticleMassMsun"].size > 0:<br>            p.modify["particles"](1.0, p_size=10.0, col='k')<br>
<br clear="all">but if there are no particles I get this error message:<br><br>yt         INFO       2010-04-16 11:58:29,408 Getting ParticleMassMsun using ParticleIO<br>Traceback (most recent call last):<br>  File "Density_movie.py", line 29, in <module><br>
    if sp["ParticleMassMsun"].size > 0:<br>  File "/scratch/YT-x86_64/lib/python2.5/site-packages/yt-2.0dev-py2.5-linux-x86_64.egg/yt/lagos/BaseDataTypes.py", line 249, in __getitem__<br>    self.get_data(key)<br>
  File "/scratch/YT-x86_64/lib/python2.5/site-packages/yt-2.0dev-py2.5-linux-x86_64.egg/yt/lagos/BaseDataTypes.py", line 1636, in get_data<br>    self[field] = self.particles[field]<br>  File "/scratch/YT-x86_64/lib/python2.5/site-packages/yt-2.0dev-py2.5-linux-x86_64.egg/yt/lagos/ParticleIO.py", line 45, in __getitem__<br>
    return self.get_data(key)<br>  File "/scratch/YT-x86_64/lib/python2.5/site-packages/yt-2.0dev-py2.5-linux-x86_64.egg/yt/lagos/ParticleIO.py", line 91, in get_data<br>    conv_factors)<br>  File "/scratch/YT-x86_64/lib/python2.5/site-packages/yt-2.0dev-py2.5-linux-x86_64.egg/yt/lagos/DataReadingFuncs.py", line 206, in _read_particles<br>
    filenames, ids, conv_factors = zip(*sorted(zip(filenames, ids, conv_factors)))<br>ValueError: need more than 0 values to unpack<br><br><br>Can anyone think of a better if statement to check if i have particles that doesn't crash YT if there isn't?<br>
<br>Many thanks,<br><br>Libby<br><br><br><br>-- <br>Elizabeth Harper-Clark MA MSci<br>PhD Candidate, Astrophysics, UofT<br><br><a href="http://www.astro.utoronto.ca/~h-clark">www.astro.utoronto.ca/~h-clark</a><br><a href="mailto:h-clark@cita.utoronto.ca">h-clark@cita.utoronto.ca</a><br>
AIM: edphc1<br>MSN: <a href="mailto:edphc1@hotmail.com">edphc1@hotmail.com</a><br>Skype: eharperclark<br>Office phone: 416-978-5759<br>