<div dir="ltr"><div><div><div><div><div>Hi Sam, <br><br></div>Thanks for looking at this. <br></div>c does change at every time step as I want the densest point to always be at the centre. <br></div>What I think might be happening and I'm running a run now to check is that the north vector is messing things up. What should that be? I've set it to L for this run while before I just set it to something arbitrary. <br>
<br></div>The script is:<br><br>ts = TimeSeriesData.from_filenames("/wrk/regan/Stats/Halo8/HighRes/HighRes_Ref26_Reg1_All/DMSplit/MovieOutputs/DD*/*.hierarchy", parallel = True)<br>comm = MPI.COMM_WORLD<br><br>FileNames = glob.glob("/wrk/regan/Stats/Halo8/HighRes/HighRes_Ref26_Reg1_All/DMSplit/MovieOutputs/DD*/*.hierarchy")<br>
FileNames.sort() <br>firstoutputnum = GetSubString(FileNames[0], '\d\d\d\d+')<br>firstoutputnum = int(firstoutputnum[-1])<br></div>#Pre-calculated L<br><div>L = [-0.808823, -0.58630473, -0.04530025]<br>Lperp = []<br>
if comm.rank == 0:<br> Lperp = CalcPerpen(L)<br>comm.barrier()<br>Lperp = comm.bcast(Lperp, root=0)<br>print "Lperp = ", Lperp<br># W is the width of the plot in enzo boxsize units<br># 1 would be the whole domain<br>
# <br>SphereSize = 10000 #pc<br>W = 0.05 #domain units<br>N = 1024 # Pixels (512^2)<br>up = [1.,0.,0.]<br><br>#And zoom each time. <br>startW = W<br>endW = 1e-7<br>deltaW = (startW - endW)/70<br>rotation = 2*na.pi/70.0<br>
<br><br>for pf in ts.piter():<br> rank = comm.Get_rank()<br> result_id = int(pf.parameter_filename[-4::])<br> if(result_id > 70):<br> continue<br><br> filenum = result_id - firstoutputnum<br> sp = pf.h.sphere("max", (SphereSize, "pc"))<br>
MaxDen, c = pf.h.find_max('Density')<br> W = startW - filenum*deltaW<br> le = c - W<br> re = c + W<br> rmi, rma = sp.quantities['Extrema']('Density')[0]<br> rmi, rma = na.log10(rmi), na.log10(rma)<br>
print "File %s: Real min and max = (%f, %f)" % (pf.parameter_filename, rmi, rma)<br> ma = rma - 2<br> mi = rmi + 2.5<br> <br> # Construct transfer function, pad the TF space by a bit so that<br> # gaussians sampling the data range don't hit the edge.<br>
tf = ColorTransferFunction((mi, ma))<br> tf.add_layers(6, w=0.01, colormap="spectral")<br> # Create the camera object<br> cam = pf.h.camera(c, L, W, (N,N), transfer_function=tf, north_vector=L, <br>
no_ghost=True, steady_north=True)<br> #Rotate about the "Lperp" vector<br> theta = rotation*filenum<br> cam.rotate(theta, rot_vector=Lperp)<br> <br><br><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On 18 November 2013 20:10, Sam Skillman <span dir="ltr"><<a href="mailto:samskillman@gmail.com" target="_blank">samskillman@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">Hi John,<div><br></div><div>I'm a bit confused how this could be happening. Is it at all possible that either c or Lperp are calculated differently for different timesteps? My only other thought would be that somehow Lperp is very close to the north_vector, and some dot products over time are building up some sort of error. </div>
<div><br></div><div>If c isn't changing as a function of timestep, could you paste more/all of your script just in case there's another piece that's messing around with things?</div><div><br></div><div>Best,</div>
<div>Sam</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Mon, Nov 18, 2013 at 7:13 AM, John Regan <span dir="ltr"><<a href="mailto:johnanthonyregan@gmail.com" target="_blank">johnanthonyregan@gmail.com</a>></span> wrote:<br>
</div></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><div>Hi All, <br><br></div>Just a quick question on rotation of the camera object. When I rotate the camera I notice that the <br>
</div>center no longer stays at the focus. I'm running a script which zooms and rotates an object in a timeseries fashion. <br>
<br></div># Code snippet<br><div> cam = pf.h.camera(c, L, W, (N,N), transfer_function=tf, north_vector=up, <br> no_ghost=True, steady_north=True)<br> #Rotate about the "Lperp" vector<br>
theta = rotation*filenum<br>
cam.rotate(theta, rot_vector=Lperp)<br> <br><br></div><div>This pretty much works as I want but after a while a get an output like the one attached with the central density no longer at the center. Is there a way to keep the focus at "c". <br>
<br></div><div>Cheers,<br></div><div>John<br></div></div>
<br></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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></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></div>