<br><br>On Wednesday, April 16, 2014, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br>On Wednesday, April 16, 2014, John ZuHone <<a href="javascript:_e(%7B%7D,'cvml','jzuhone@gmail.com');" target="_blank">jzuhone@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word">Hi Mike,<div><br></div><div><div><blockquote type="cite"><div dir="ltr">I am interested in using yt to do power spectra for analyzing turbulence in our simulations.  I quickly coded up a script to do this (warning: I haven't verified this, so some of the normalization may be wrong, but it doesn't assume a cubic domain, and it looked ok by eye):</div>

</blockquote><div><br></div><div>I think this is a very good idea. I have coded up something similar myself recently:</div><div><br></div><div><a href="http://paste.yt-project.org/show/4529/" target="_blank">http://paste.yt-project.org/show/4529/</a></div>

<div><br></div><div>It creates a "FourierSpace" class that can be used to create power spectra and potentially other useful things from FFTs. It needs some work. </div><div><br></div><blockquote type="cite"><div dir="ltr">

<div>The caveat is that we need to put this onto a uniform grid to do the FFT, but then we can use the numpy FFT routines.</div></div></blockquote><div><br></div>Or you could use pyFFTW, which is probably faster: </div><div>

<br></div><div><a href="http://hgomersall.github.io/pyFFTW/" target="_blank">http://hgomersall.github.io/pyFFTW/</a></div></div></div></blockquote><div><br></div><div>Linking to FFTW is tempting since ostensibly it allows Fourier transforms of arbitrarily huge arrays, while numpy will fall over once you run out of memory on one node.</div>

<div><br></div><div>That said, it would require a new dependency.  We do have analysis modules that require separate dependencies from the rest of yt, but it's not optimal and adds some friction to new users who want to use the analysis module.<span></span></div>
</blockquote><div><br></div><div>Although that said it looks like pyfftw currently has no MPI support, so this is probably a moot point.</div><div><br></div><div><a href="https://github.com/hgomersall/pyFFTW/issues/38">https://github.com/hgomersall/pyFFTW/issues/38</a><br>
</div><div><span></span> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><br></div><div><blockquote type="cite"><div dir="ltr">
<div><div>The other thing is what sort of interface and where should this live in yt?  Ideally we'd compute some other properties (integral scales, etc.), but it would be nice to have some discussion about what people use and then we can start woth some basic functionality.</div>

</div></div></blockquote><div><br></div><div>I think something like this should live in yt/analysis_modules. </div></div></div></div></blockquote><div><br></div><div>Agreed.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word"><div><div><div><br></div><div>Best,</div><div><br></div><div>John</div></div></div></div></blockquote>
</blockquote>