[yt-users] yt.extensions.EnzoSimulation gorne

Elizabeth Tasker taskere at mcmaster.ca
Wed Nov 3 10:10:10 PDT 2010


Actually, it turns out this is still giving me problems. I'm now using 
yt 2.0 and have:

from yt.analysis_modules.api import EnzoSimulation
es = EnzoSimulation("SedovBlastAMR.enzo", initial_time=0.0, final_time=0.1)

ETot = []

for output in es.allOutputs:
pf = load(output['filename'])
data = pf.h.all_data()
ETot.append(data.quantities["TotalQuantity"]("TotalEnergy")[0])
.
.
.

But I get:

IndexError                                Traceback (most recent call last)

/saw_sfs/work/taskere/yt-2/scripts/iyt in <module>()
     15     # calculate total energy for the simulation volume
     16     data = pf.h.all_data()
---> 17     ETot.append(data.quantities["TotalQuantity"]("TotalEnergy")[0])
     18
     19     # calculate the time of output
.
.
.
IndexError: index (100) out of range (0<=index<99) in dimension 0
WARNING: Failure executing file: <total_energy.py>



What did I do wrong?

Elizabeth






Elizabeth Tasker wrote:
> Hi Jeff,
>
> I think it might be enzo 1.7, but inspired by your comment I 
> controversially checked the code and found
>
> import yt.extensions.enzo_simulation as ES
>
> works.
>
> Thanks, Elizabeth
>
>
> j s oishi wrote:
>> Hi Elizabeth,
>>
>> Are you on yt-2.0? If so, then it should be
>>
>> from yt.analysis_modules.api import EnzoSimulation as ES
>>
>> j




More information about the yt-users mailing list