<div><div dir="auto">Hi Cynthia,</div><div dir="auto"><br></div><div dir="auto">To load Enzo data you need both the HDF5 library and the H5py python wrappers installed.</div><div dir="auto"><br></div><div dir="auto">Nathan</div><br><div class="gmail_quote"><div>On Sun, Jul 16, 2017 at 3:17 AM Cynthia Saad (Student) <<a href="mailto:crs07@mail.aub.edu">crs07@mail.aub.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div id="m_-6186122891620315119divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif">
<p>dear all</p>
<p>i am using yt for enzo. my script reads:</p>
<p><br>
</p>
<p></p>
<div>import yt<br>
<br>
# Load the dataset.<br>
ds = yt.load("~/enzo/run/CosmologySimulation/AMRCosmology/DD0001/DD0001")<br>
<br>
# Create a 1 Mpc radius sphere, centered on the max density.<br>
sp = ds.sphere("max", (0.1, "Mpc"))<br>
<br>
# Use the total_quantity derived quantity to sum up the<br>
# values of the cell_mass and particle_mass fields<br>
# within the sphere.<br>
baryon_mass, particle_mass = sp.quantities.total_quantity(["cell_mass", "particle_mass"])<br>
<br>
print("Total mass in sphere is %0.3e Msun (gas = %0.3e Msun, particles = %0.3e Msun)" % \<br>
      ((baryon_mass + particle_mass).in_units('Msun'), \<br>
       baryon_mass.in_units('Msun'), particle_mass.in_units('Msun')))</div>
<p></p>
<p>-----------<br>
</p>
<p>the error i am getting is:</p>
<p></p>
<div>~/enzo/run/CosmologySimulation/AMRCosmology$ python trial.py <br>
Traceback (most recent call last):<br>
  File "trial.py", line 4, in <module><br>
    ds = yt.load("~/enzo/run/CosmologySimulation/AMRCosmology/DD0001/DD0001")<br>
  File "/usr/local/lib/python2.7/dist-packages/yt/convenience.py", line 79, in load<br>
    if c._is_valid(*args, **kwargs): candidates.append(n)<br>
  File "/usr/local/lib/python2.7/dist-packages/yt/frontends/flash/data_structures.py", line 493, in _is_valid<br>
    fileh = HDF5FileHandler(args[0])<br>
  File "/usr/local/lib/python2.7/dist-packages/yt/utilities/file_handler.py", line 22, in __init__<br>
    self.handle = h5py.File(filename, 'r')<br>
  File "/usr/local/lib/python2.7/dist-packages/yt/utilities/on_demand_imports.py", line 31, in __call__<br>
    raise self.error<br>
ImportError: This functionality requires the h5py package to be installed.<br>
</div>
<p></p>
<p>----------------<br>
</p>
<p><br>
</p>
<p>is my script outdated, there is something wrong with my installation or deficiencies in the python libraries?</p>
<p><br>
</p>
<p>thank you</p>
<p>cynthia<br>
</p>
</div>
</div>

_______________________________________________<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" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div></div>