Hi yt users,<div><br></div><div>I'm still very new at python syntax so please forgive me =)</div><div><br></div><div>I've ran a few n-body simulations and I'd like to simply calculate the pairwise velocity between the halo pairs.  I simply need to read in the x,y,z positions & vx,vy,vz velocities from the halo finder output, do some calculations, and output the result.  I've done this in C but I'd love to learn how to do this in yt.  Here's my calculation in C:</div>
<div><br></div><div><div>  for(i=0; i<NUM; i++)</div><div>    {</div><div>        </div><div>    for(j=i+1; j<NUM; j++)</div><div>        { </div><div>          dXctr = periodic(Xctr[i] - Xctr[j]) / 1000.; /* in Mpc/h */</div>
<div>          dYctr = periodic(Yctr[i] - Yctr[j]) / 1000.;</div><div>          dZctr = periodic(Zctr[i] - Zctr[j]) / 1000.;</div><div>          </div><div>          d = sqrt(dXctr*dXctr + dYctr*dYctr + dZctr*dZctr); /* in Mpc/h */</div>
<div>                                </div><div>          if(d < 10.)  /* less than 10 Mpc/h */</div><div>            {     </div><div>              dvx = vx[i] - vx[j];</div><div>              dvy = vy[i] - vy[j];</div>
<div>              dvz = vz[i] - vz[j];</div><div>              </div><div>              vrel = sqrt(dvx*dvx + dvy*dvy + dvz*dvz);</div><div>            }</div><div>        }</div></div><div><br></div><div>How would I go about doing this in yt given the halo finder outputs.  Thanks for the assistance!</div>
<div><br></div><div>-Robert Thompson</div>