<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey all,<div><br></div><div>I am trying to to have yt load up a data set, and then create phase plots with varying weighted fields like the script below.</div><div><br></div><div>The problem is that when reaches the 'for item in field' loop, after each image output, the loop starts over instead of continuing to the next field... for instance, the output for a series of numbers representing the images would look like this:</div><div><br></div><div>1</div><div>1</div><div>2</div><div>1</div><div>2</div><div>3</div><div>1</div><div>2</div><div>3</div><div>4</div><div>etc</div><div><br></div><div>I am not quite sure how to remedy this, so I'm hoping someone could point me in the right direction.</div><div><br></div><div>Thanks for your efforts!</div><div>Nicholas Earl</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">from yt.mods import * # set up our namespace</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">#field = ['Temperature','Cooling_Time']</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">field = ['Cooling_Time','Density','Electron_Fraction','Gas_Energy','H2II_Fraction','H2I_Fraction','HII_Fraction','HI_Fraction','HM_Fraction','HeIII_Fraction','HeII_Fraction','HeI_Fraction','Metal_Fraction','Temperature','Total_Energy','x-velocity','y-velocity']</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">for n in range(1,402):</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">        #for item in field:</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">        pf = load("DD%04i/DD%04i" % (n,n))</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">        # load dataset</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">        #for item in field:</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">        pc = PlotCollection(pf, center=[1.0, 0.5, 0.5]) # defaults to center at most dense point</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">        for item in field:</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">                #value, position = pf.h.find_max("Density")</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">                #print value, position</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">                pc.add_phase_sphere(10.0, "pc", # how many of which unit at pc.center</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">                        ["Density", "Temperature", "CellMassMsun"], # our fields: x, y, color</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">                        weight="%s" % (item))# don't take the average value in a cell, just sum them up</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">                #print item</span></font></div><div><font class="Apple-style-span" face="Menlo" size="2"><span class="Apple-style-span" style="font-size: 10px;">                pc.save('./denstemp_weighted/%s' % (pf))  # save all plots</span></font></div></div><div><br></div></blockquote></body></html>