<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Fourier Transforms of Images in Python</title>
	<atom:link href="http://www.astrobetter.com/fourier-transforms-of-images-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.astrobetter.com/fourier-transforms-of-images-in-python/</link>
	<description>Tips and Tricks for Professional Astronomers</description>
	<lastBuildDate>Mon, 06 Feb 2012 12:32:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Adam Ginsburg</title>
		<link>http://www.astrobetter.com/fourier-transforms-of-images-in-python/#comment-16442</link>
		<dc:creator>Adam Ginsburg</dc:creator>
		<pubDate>Mon, 08 Aug 2011 20:51:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.astrobetter.com/?p=1809#comment-16442</guid>
		<description>Omar: I looked into this, but apparently the process is to make a &quot;scikit&quot; first.  I&#039;ll look into doing that, but not immediately.

In the meantime, I&#039;ve split up agpy into some sub-packages.  You should now be able to access PSDs without any unnecessary dependencies from the module AG_fft_tools.</description>
		<content:encoded><![CDATA[<p>Omar: I looked into this, but apparently the process is to make a &#8220;scikit&#8221; first.  I&#8217;ll look into doing that, but not immediately.</p>
<p>In the meantime, I&#8217;ve split up agpy into some sub-packages.  You should now be able to access PSDs without any unnecessary dependencies from the module AG_fft_tools.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Omar</title>
		<link>http://www.astrobetter.com/fourier-transforms-of-images-in-python/#comment-16440</link>
		<dc:creator>Omar</dc:creator>
		<pubDate>Mon, 08 Aug 2011 20:32:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.astrobetter.com/?p=1809#comment-16440</guid>
		<description>@Adam: the problem was, when i import agpy.psds python would try to parse agpy.__init__ and that includes all the dependencies.

 if i might wish me a pony: scipy.fftpack might actually need a psd function, so i would say this is something you might want to suggest to scipy for inclusion!</description>
		<content:encoded><![CDATA[<p>@Adam: the problem was, when i import agpy.psds python would try to parse agpy.__init__ and that includes all the dependencies.</p>
<p> if i might wish me a pony: scipy.fftpack might actually need a psd function, so i would say this is something you might want to suggest to scipy for inclusion!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Ginsburg</title>
		<link>http://www.astrobetter.com/fourier-transforms-of-images-in-python/#comment-16436</link>
		<dc:creator>Adam Ginsburg</dc:creator>
		<pubDate>Mon, 08 Aug 2011 20:18:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.astrobetter.com/?p=1809#comment-16436</guid>
		<description>Omar - Yes, the agpy package has a lot of extra requirements... it&#039;s not really packaged for distribution at the moment.  However, the PSD and radialprofile codes should stand on their own.  Would it be helpful if I packaged them separately?  If so, I&#039;ll work on that.

One thing to note - the radial profile code included in the above post, and that I had previously used, is very slow for large images.  There are some nifty tricks using numpy.histogram to make it faster.  I&#039;ve implemented them here:
http://code.google.com/p/agpy/source/browse/trunk/agpy/radialprofile.py

but in short, the fast way to make the radial profile, once you&#039;ve made a &quot;radius&quot; array and determined the bin locatinos, is:
np.histogram(r, bins, weights=image)</description>
		<content:encoded><![CDATA[<p>Omar &#8211; Yes, the agpy package has a lot of extra requirements&#8230; it&#8217;s not really packaged for distribution at the moment.  However, the PSD and radialprofile codes should stand on their own.  Would it be helpful if I packaged them separately?  If so, I&#8217;ll work on that.</p>
<p>One thing to note &#8211; the radial profile code included in the above post, and that I had previously used, is very slow for large images.  There are some nifty tricks using numpy.histogram to make it faster.  I&#8217;ve implemented them here:<br />
<a href="http://code.google.com/p/agpy/source/browse/trunk/agpy/radialprofile.py" rel="nofollow">http://code.google.com/p/agpy/source/browse/trunk/agpy/radialprofile.py</a></p>
<p>but in short, the fast way to make the radial profile, once you&#8217;ve made a &#8220;radius&#8221; array and determined the bin locatinos, is:<br />
np.histogram(r, bins, weights=image)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Omar</title>
		<link>http://www.astrobetter.com/fourier-transforms-of-images-in-python/#comment-16435</link>
		<dc:creator>Omar</dc:creator>
		<pubDate>Mon, 08 Aug 2011 19:51:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.astrobetter.com/?p=1809#comment-16435</guid>
		<description>Thank you very much. In radialProfile.py line 17 instead of 

center = np.array([(x.max()-x.min())/2.0, (x.max()-x.min())/2.0])

should read

center = np.array([(x.max()-x.min())/2.0, (y.max()-y.min())/2.0])

in my opinion!
@Adam: i did try your code prior to this one, but it has many more dependencies (like pyfits), which aren&#039;t really necessary for psd, imho.</description>
		<content:encoded><![CDATA[<p>Thank you very much. In radialProfile.py line 17 instead of </p>
<p>center = np.array([(x.max()-x.min())/2.0, (x.max()-x.min())/2.0])</p>
<p>should read</p>
<p>center = np.array([(x.max()-x.min())/2.0, (y.max()-y.min())/2.0])</p>
<p>in my opinion!<br />
@Adam: i did try your code prior to this one, but it has many more dependencies (like pyfits), which aren&#8217;t really necessary for psd, imho.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Ginsburg</title>
		<link>http://www.astrobetter.com/fourier-transforms-of-images-in-python/#comment-2193</link>
		<dc:creator>Adam Ginsburg</dc:creator>
		<pubDate>Wed, 24 Mar 2010 03:30:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.astrobetter.com/?p=1809#comment-2193</guid>
		<description>The tricks you used in radialProfile.py are much faster than the not-so-clever tricks I used in my PSD code.  However, it excluded inner &amp; outer points, and I wanted the standard deviation too.... so modified code is posted at &lt;a href=&quot;http://www.astrobetter.com/wiki/tiki-index.php?page=python_radial_profiles&quot; rel=&quot;nofollow&quot;&gt; the wiki&lt;/a&gt; and &lt;a href=&quot;http://code.google.com/p/agpy/source/browse/trunk/agpy/radialprofile.py&quot; rel=&quot;nofollow&quot;&gt;agpy&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>The tricks you used in radialProfile.py are much faster than the not-so-clever tricks I used in my PSD code.  However, it excluded inner &amp; outer points, and I wanted the standard deviation too&#8230;. so modified code is posted at <a href="http://www.astrobetter.com/wiki/tiki-index.php?page=python_radial_profiles" rel="nofollow"> the wiki</a> and <a href="http://code.google.com/p/agpy/source/browse/trunk/agpy/radialprofile.py" rel="nofollow">agpy</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian J. Crossfield</title>
		<link>http://www.astrobetter.com/fourier-transforms-of-images-in-python/#comment-2089</link>
		<dc:creator>Ian J. Crossfield</dc:creator>
		<pubDate>Thu, 11 Mar 2010 05:52:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.astrobetter.com/?p=1809#comment-2089</guid>
		<description>A few years back I wrote a routine similar to your &quot;radialProfile&quot; that computes average, mean, min/max in annuli of an image, with the option to define the image coordinate system (and thus the center-of-interest). If anyone wants to take a look, I&#039;ve put it online &lt;a href=&quot;http://www.astro.ucla.edu/~ianc/files/radial_data.py&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.

For a centered image, the syntax is just:
&lt;code&gt;
import pylab as py
from radial_data import radial_data
data = radial_data(image, annulus_width=2, rmax=100)
py.plot(data.r, data.mean)
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>A few years back I wrote a routine similar to your &#8220;radialProfile&#8221; that computes average, mean, min/max in annuli of an image, with the option to define the image coordinate system (and thus the center-of-interest). If anyone wants to take a look, I&#8217;ve put it online <a href="http://www.astro.ucla.edu/~ianc/files/radial_data.py" rel="nofollow">here</a>.</p>
<p>For a centered image, the syntax is just:<br />
<code><br />
import pylab as py<br />
from radial_data import radial_data<br />
data = radial_data(image, annulus_width=2, rmax=100)<br />
py.plot(data.r, data.mean)<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Ginsburg</title>
		<link>http://www.astrobetter.com/fourier-transforms-of-images-in-python/#comment-2030</link>
		<dc:creator>Adam Ginsburg</dc:creator>
		<pubDate>Thu, 04 Mar 2010 20:48:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.astrobetter.com/?p=1809#comment-2030</guid>
		<description>Sure thing.  I have test code + a test image:
http://code.google.com/p/agpy/source/browse/trunk/tests/
http://code.google.com/p/agpy/source/browse/trunk/tests/example_psd.py
http://code.google.com/p/agpy/source/browse/trunk/tests/PSF.fits

The example shows the power spectrum of a non-Gaussian PSF with sidelobes that should approximately correspond to Airy rings.  I don&#039;t bother with the 2d PSD (even though the code is written for that) because I don&#039;t really use PSDs.

Ivan:  The autocorrelation (rather than the PSD) should contain information about the psf, I think.   Though when I tried it myself it looks like the autocorrelation^2 has ~the same FWHM... I&#039;m not sure exactly why that should be.</description>
		<content:encoded><![CDATA[<p>Sure thing.  I have test code + a test image:<br />
<a href="http://code.google.com/p/agpy/source/browse/trunk/tests/" rel="nofollow">http://code.google.com/p/agpy/source/browse/trunk/tests/</a><br />
<a href="http://code.google.com/p/agpy/source/browse/trunk/tests/example_psd.py" rel="nofollow">http://code.google.com/p/agpy/source/browse/trunk/tests/example_psd.py</a><br />
<a href="http://code.google.com/p/agpy/source/browse/trunk/tests/PSF.fits" rel="nofollow">http://code.google.com/p/agpy/source/browse/trunk/tests/PSF.fits</a></p>
<p>The example shows the power spectrum of a non-Gaussian PSF with sidelobes that should approximately correspond to Airy rings.  I don&#8217;t bother with the 2d PSD (even though the code is written for that) because I don&#8217;t really use PSDs.</p>
<p>Ivan:  The autocorrelation (rather than the PSD) should contain information about the psf, I think.   Though when I tried it myself it looks like the autocorrelation^2 has ~the same FWHM&#8230; I&#8217;m not sure exactly why that should be.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan Zolotukhin</title>
		<link>http://www.astrobetter.com/fourier-transforms-of-images-in-python/#comment-2029</link>
		<dc:creator>Ivan Zolotukhin</dc:creator>
		<pubDate>Thu, 04 Mar 2010 17:35:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.astrobetter.com/?p=1809#comment-2029</guid>
		<description>Roy, this is just a background noise causes the constant term, check e.g. eq. 6-7 in Sheehy et al. 2006.

Jessica, thanks for your comments. I&#039;m after another problem actually: very crowded field photometry. Seems that I have no chance to estimate PSF from the image itself, so I&#039;m exploring what FT can give here...</description>
		<content:encoded><![CDATA[<p>Roy, this is just a background noise causes the constant term, check e.g. eq. 6-7 in Sheehy et al. 2006.</p>
<p>Jessica, thanks for your comments. I&#8217;m after another problem actually: very crowded field photometry. Seems that I have no chance to estimate PSF from the image itself, so I&#8217;m exploring what FT can give here&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jessica</title>
		<link>http://www.astrobetter.com/fourier-transforms-of-images-in-python/#comment-2028</link>
		<dc:creator>Jessica</dc:creator>
		<pubDate>Thu, 04 Mar 2010 17:05:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.astrobetter.com/?p=1809#comment-2028</guid>
		<description>This is an adaptive optics image, so we have approximately a diffraction limited core + seeing halo. So at those intermediate frequencies, you are seeing the AO correction.</description>
		<content:encoded><![CDATA[<p>This is an adaptive optics image, so we have approximately a diffraction limited core + seeing halo. So at those intermediate frequencies, you are seeing the AO correction.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jessica</title>
		<link>http://www.astrobetter.com/fourier-transforms-of-images-in-python/#comment-2027</link>
		<dc:creator>Jessica</dc:creator>
		<pubDate>Thu, 04 Mar 2010 16:59:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.astrobetter.com/?p=1809#comment-2027</guid>
		<description>Adam, you hit the nail on the head. I know you can use fftfreq to construct the spatial frequencies, but I just haven&#039;t gotten around to constructing the proper 1D X and Y (or nu_x and nu_y) axes or a 2D meshgrid. Thanks for the example! Would you be interested in sharing your code (or a link to it) on the wiki and if so, can you give me a brief example of how you use it?

Ivan, right now I am applying the Sheehy et al. method to derive an aperture correction for crowded field adaptive optics photometery (1D PSF estimation from image + known positions of stars + model of atmosphere/AO system/telescope). Currently their code is in IDL, so I have been using python to call out to idl (via pIDLy). I wanted to explore whether it would be worth porting the code to python; especially since I was contemplating whether the code could be expanded to 2D. However, I think a more productive direction would be the methods/code in the papers by Matthew Britton (use empirical PSF from somewhere in an image + Cn2 profile of atmosphere to reconstruct the PSF at all other points in the image). I am using laser guide star AO with an off-axis tip-tilt star so this complicates things enormously.</description>
		<content:encoded><![CDATA[<p>Adam, you hit the nail on the head. I know you can use fftfreq to construct the spatial frequencies, but I just haven&#8217;t gotten around to constructing the proper 1D X and Y (or nu_x and nu_y) axes or a 2D meshgrid. Thanks for the example! Would you be interested in sharing your code (or a link to it) on the wiki and if so, can you give me a brief example of how you use it?</p>
<p>Ivan, right now I am applying the Sheehy et al. method to derive an aperture correction for crowded field adaptive optics photometery (1D PSF estimation from image + known positions of stars + model of atmosphere/AO system/telescope). Currently their code is in IDL, so I have been using python to call out to idl (via pIDLy). I wanted to explore whether it would be worth porting the code to python; especially since I was contemplating whether the code could be expanded to 2D. However, I think a more productive direction would be the methods/code in the papers by Matthew Britton (use empirical PSF from somewhere in an image + Cn2 profile of atmosphere to reconstruct the PSF at all other points in the image). I am using laser guide star AO with an off-axis tip-tilt star so this complicates things enormously.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

