<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Anthony Smith&#039;s Research Blog</title>
	<atom:link href="http://www.anthonysmith.me.uk/research/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anthonysmith.me.uk/research</link>
	<description>Surveying the Universe</description>
	<lastBuildDate>Mon, 06 Feb 2012 10:25:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>On Gaussian approximations</title>
		<link>http://www.anthonysmith.me.uk/research/2012/02/06/on-gaussian-approximations/</link>
		<comments>http://www.anthonysmith.me.uk/research/2012/02/06/on-gaussian-approximations/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 10:20:28 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=328</guid>
		<description><![CDATA[You have a function that you want to approximate as an N-dimensional (multivariate) Gaussian (normal) distribution. What do you do? If you are me, you spend a couple of weeks deriving stuff, and then finally figure out the easy way. But hopefully you are not me, so here is the easy way, to save you&#8230;]]></description>
			<content:encoded><![CDATA[<p>You have a function that you want to approximate as an N-dimensional (multivariate) Gaussian (normal) distribution. What do you do?</p>
<p>If you are me, you spend a couple of weeks deriving stuff, and then finally figure out the easy way.</p>
<p>But hopefully you are not me, so here is the easy way, to save you the bother.</p>
<p>First, find the peak of your function, and put a hat on the value(s) or the parameter(s) at this point. Now your (N-dimensional) function can be approximated as</p>
<p><span class='MathJax_Preview'>\(f(x) \simeq f(\hat{x})\exp \left[-\frac{1}{2} (x-\hat{x})^\mathrm{T} \Sigma^{-1} (x-\hat{x}) \right]\)</span></p>
<p>where <span class='MathJax_Preview'>\(\Sigma\)</span> is the covariance matrix, and our task it to figure out what it is.</p>
<p>But fear not, help is at hand. If we find the following <a href="http://en.wikipedia.org/wiki/Hessian_matrix">Hessian matrix</a>, and if we assume that the covariance matrix is symmetric, we have</p>
<p><span class='MathJax_Preview'>\(<br />
\begin{align} H_{ij} &\equiv \frac{\partial^2}{\partial x_i \partial x_j} \left( - \ln f(x) \right) \\ &\simeq \frac{\partial^2}{\partial x_i \partial x_j} \left( - \ln f(\hat{x}) + \frac{1}{2} (x-\hat{x})^\mathrm{T} \Sigma^{-1} (x-\hat{x}) \right) \\ &= \frac{1}{2} (\Sigma^{-1}_{ij} + \Sigma^{-1}_{ji}) \\ &= \Sigma^{-1}_{ij} \end{align}<br />
\)</span></p>
<p>That's it. Easy. Now you can even <a href="http://en.wikipedia.org/wiki/Multivariate_normal_distribution">integrate the function</a></p>
<p><span class='MathJax_Preview'>\(\int f(x) \, \mathrm{d}x = (2\pi)^{N/2} |\Sigma|^{1/2} f(\hat{x}) = (2\pi)^{N/2} |H|^{-1/2} f(\hat{x})\)</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2012/02/06/on-gaussian-approximations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HerMES point source catalogues</title>
		<link>http://www.anthonysmith.me.uk/research/2011/09/27/hermes-point-source-catalogues/</link>
		<comments>http://www.anthonysmith.me.uk/research/2011/09/27/hermes-point-source-catalogues/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 08:45:54 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[confusion]]></category>
		<category><![CDATA[HerMES]]></category>
		<category><![CDATA[Herschel Space Observatory]]></category>
		<category><![CDATA[point sources]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=316</guid>
		<description><![CDATA[Well, it's finally here: HerMES: point source catalogues from deep Herschel-SPIRE observations, by yours truly and lots of other people otherwise known as "Al". Some of the catalogues are available here, if you're interested. The biggest challenge was confusion (about which there is a great deal of confusion). For example, in this HerMES image, everything you&#8230;]]></description>
			<content:encoded><![CDATA[<p>Well, it's finally here: <a href="http://arxiv.org/abs/1109.5186">HerMES: point source catalogues from deep Herschel-SPIRE observations</a>, by yours truly and lots of other people otherwise known as "Al".</p>
<p>Some of the catalogues are available <a href="http://hedam.oamp.fr/HerMES/">here</a>, if you're interested.</p>
<p>The biggest challenge was <strong>confusion</strong> (about which there is a great deal of confusion). For example, in this <a href="http://hermes.sussex.ac.uk/content/bringing-home-goods">HerMES</a> image, everything you can see is light from galaxies, and each galaxy produces a small round blob in the image. The number of galaxies is so high, that light from any one galaxy is <strong>confused</strong> with light from numerous neighbouring galaxies.</p>
<p><a href="http://hermes.sussex.ac.uk/content/bringing-home-goods"><img class="alignnone size-full wp-image-320" title="HerMES GOODS-North" src="http://www.anthonysmith.me.uk/research/wp-content/uploads/2011/09/GOODSN.jpg" alt="" width="600" height="450" /></a></p>
<p>So when the computer looks at the image and spots a blob with brightness 30 mJy, what does that mean? Does it mean there is one galaxy there with brightness 30 mJy? Or perhaps there are 10 galaxies, with brightnesses of 15 mJy or lower?</p>
<p>It's difficult to tell. But what you can do (and what we did in the paper) is to stick fake galaxies (blobs) into the image, and see what difference that makes. So if we have a fake galaxy with brightness 30 mJy, and we put it in at a random position, what effect will that have, on average? What is the probability that it will be detected? (This is approaching what we mean by the <strong>completeness</strong> of the catalogue, although it is far from easy to know what is meant by those simple words "it" and "detected"!) What brightness will it be measured to have, on average? 20 mJy? 30 mJy? 40 mJy? 100 mJy?</p>
<p>For very bright galaxies, it's relatively straightforward. But for fainter things, it can do your head in...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2011/09/27/hermes-point-source-catalogues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generating LaTeX authors lists for MNRAS and A&amp;A</title>
		<link>http://www.anthonysmith.me.uk/research/2010/06/03/generating-latex-authors-lists-for-mnras-and-aa/</link>
		<comments>http://www.anthonysmith.me.uk/research/2010/06/03/generating-latex-authors-lists-for-mnras-and-aa/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 09:38:11 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[A&A]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[MNRAS]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=303</guid>
		<description><![CDATA[Okay, a bit boring, but as promised, here are some Python functions to generate LaTeX source for long authors lists for MNRAS and A&#38;A. First, a small utility: def getSortedInstituteCodes&#40;authorList, authorInstituteCodes&#41;: &#34;&#34;&#34;Return a list of institute codes, in the correct order for authorList. &#160; authorList = [&#34;J.~Bloggs&#34;, &#34;A.N.~Other&#34;] authorInstituteCodes = {&#34;J.~Bloggs&#34;:1, &#34;A.N.~Other&#34;:[1,&#34;Sussex&#34;]} &#34;&#34;&#34; instituteCodes =&#8230;]]></description>
			<content:encoded><![CDATA[<p>Okay, a bit boring, but as <a href="http://www.anthonysmith.me.uk/research/2010/05/07/mnras-line-wrapping-in-authors-lists/">promised</a>, here are some Python functions to generate LaTeX source for long authors lists for MNRAS and A&amp;A.</p>
<p><span id="more-303"></span>First, a small utility:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> getSortedInstituteCodes<span style="color: black;">&#40;</span>authorList, authorInstituteCodes<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;Return a list of institute codes, in the correct order for authorList.
&nbsp;
    authorList = [&quot;J.~Bloggs&quot;, &quot;A.N.~Other&quot;]
    authorInstituteCodes = {&quot;J.~Bloggs&quot;:1, &quot;A.N.~Other&quot;:[1,&quot;Sussex&quot;]}
    &quot;&quot;&quot;</span>
    instituteCodes = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> author <span style="color: #ff7700;font-weight:bold;">in</span> authorList:
        codes = authorInstituteCodes<span style="color: black;">&#91;</span>author<span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span>codes, <span style="color: #483d8b;">'__iter__'</span><span style="color: black;">&#41;</span>:
            codes = <span style="color: black;">&#91;</span>codes<span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> <span style="color: #dc143c;">code</span> <span style="color: #ff7700;font-weight:bold;">in</span> codes:
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #dc143c;">code</span> <span style="color: #ff7700;font-weight:bold;">in</span> instituteCodes:
                instituteCodes.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">code</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> instituteCodes</pre></div></div>

<p>then the function for MNRAS:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> getAuthorsStringMNRAS<span style="color: black;">&#40;</span>authorList, authorInstituteCodes, institutesTex,
                          authorEmails<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;Return a string containing LaTeX for MNRAS authors list.
&nbsp;
    authorList = [&quot;J.~Bloggs&quot;, &quot;A.N.~Other&quot;]
    authorInstituteCodes = {&quot;J.~Bloggs&quot;:1, &quot;A.N.~Other&quot;:[1,&quot;Sussex&quot;]}
    institutesTex = {1:&quot;Somewhere, Earth&quot;, &quot;Sussex&quot;:&quot;University of Sussex&quot;}
    authorEmails = {&quot;J.~Bloggs&quot;: &quot;j.bloggs@no.where&quot;}
    &quot;&quot;&quot;</span>
    instituteCodes = getSortedInstituteCodes<span style="color: black;">&#40;</span>authorList, authorInstituteCodes<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># Make a list of strings:</span>
    <span style="color: #808080; font-style: italic;"># &quot;Author Name$^{1,2}$\thanks{E-mail: \texttt{j.bloggs@no.where}}&quot;</span>
    authorInstituteList = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> author <span style="color: #ff7700;font-weight:bold;">in</span> authorList:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            codes = authorInstituteCodes<span style="color: black;">&#91;</span>author<span style="color: black;">&#93;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span>codes, <span style="color: #483d8b;">'__iter__'</span><span style="color: black;">&#41;</span>:
                codes = <span style="color: black;">&#91;</span>codes<span style="color: black;">&#93;</span>  <span style="color: #808080; font-style: italic;"># Only one institute code for this author</span>
            authorInstituteList.<span style="color: black;">append</span><span style="color: black;">&#40;</span>
                author
                + <span style="color: #483d8b;">',$^{'</span> + <span style="color: #483d8b;">','</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span>instituteCodes.<span style="color: black;">index</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">code</span><span style="color: black;">&#41;</span> + <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
                                     <span style="color: #ff7700;font-weight:bold;">for</span> <span style="color: #dc143c;">code</span> <span style="color: #ff7700;font-weight:bold;">in</span> codes<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
                + <span style="color: #483d8b;">'}$'</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">KeyError</span>:
            authorInstituteList.<span style="color: black;">append</span><span style="color: black;">&#40;</span>author + <span style="color: #483d8b;">','</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            <span style="color: #dc143c;">email</span> = authorEmails<span style="color: black;">&#91;</span>author<span style="color: black;">&#93;</span>
            authorInstituteList<span style="color: black;">&#91;</span>-<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span> += <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\\</span>thanks{E-mail: <span style="color: #000099; font-weight: bold;">\\</span>texttt{'</span>
            authorInstituteList<span style="color: black;">&#91;</span>-<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span> += <span style="color: #dc143c;">email</span> + <span style="color: #483d8b;">'}}'</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">KeyError</span>:
            <span style="color: #ff7700;font-weight:bold;">pass</span> <span style="color: #808080; font-style: italic;"># No email address for this author</span>
    <span style="color: #808080; font-style: italic;"># Sort out the punctuation (won't work if the penultimate or ultimate</span>
    <span style="color: #808080; font-style: italic;"># author has no institute)</span>
    authorInstituteList<span style="color: black;">&#91;</span>-<span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span> = authorInstituteList<span style="color: black;">&#91;</span>-<span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span>.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">',$'</span>, <span style="color: #483d8b;">'$'</span><span style="color: black;">&#41;</span>
    authorInstituteList<span style="color: black;">&#91;</span>-<span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span> += <span style="color: #483d8b;">' and'</span>
    authorInstituteList<span style="color: black;">&#91;</span>-<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span> = authorInstituteList<span style="color: black;">&#91;</span>-<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">',$'</span>, <span style="color: #483d8b;">'$'</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># Put it all together</span>
    authorsString = <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\\</span>author['</span> + authorList<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> + <span style="color: #483d8b;">' et al.]'</span>
    authorsString += <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>{<span style="color: #000099; font-weight: bold;">\\</span>parbox{<span style="color: #000099; font-weight: bold;">\\</span>textwidth}{'</span>
    authorsString += <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>authorInstituteList<span style="color: black;">&#41;</span>
    authorsString += <span style="color: #483d8b;">'}<span style="color: #000099; font-weight: bold;">\\</span>vspace{0.4cm}<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\n</span>'</span>
    authorsString += <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\\</span>parbox{<span style="color: #000099; font-weight: bold;">\\</span>textwidth}{'</span>
    authorsString += <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\n</span>'</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'$^{'</span> + <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>iInst + <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span> + <span style="color: #483d8b;">'}$'</span>
                                    + institutesTex<span style="color: black;">&#91;</span>instituteCodes<span style="color: black;">&#91;</span>iInst<span style="color: black;">&#93;</span><span style="color: black;">&#93;</span>
                                    <span style="color: #ff7700;font-weight:bold;">for</span> iInst <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>instituteCodes<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    authorsString += <span style="color: #483d8b;">'}}<span style="color: #000099; font-weight: bold;">\n</span>'</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> authorsString</pre></div></div>

<p>and the function for A&amp;A:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> getAuthorsStringAA<span style="color: black;">&#40;</span>authorList, authorInstituteCodes, institutesTex,
                       authorEmails<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;Return a string containing LaTeX for A&amp;amp;A authors list.
&nbsp;
    authorList = [&quot;J.~Bloggs&quot;, &quot;A.N.~Other&quot;]
    authorInstituteCodes = {&quot;J.~Bloggs&quot;:1, &quot;A.N.~Other&quot;:[1,&quot;Sussex&quot;]}
    institutesTex = {1:&quot;Somewhere, Earth&quot;, &quot;Sussex&quot;:&quot;University of Sussex&quot;}
    authorEmails = {&quot;J.~Bloggs&quot;: &quot;j.bloggs@no.where&quot;}
    &quot;&quot;&quot;</span>
    instituteCodes = getSortedInstituteCodes<span style="color: black;">&#40;</span>authorList, authorInstituteCodes<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># Associate institute numbers with authors and emails with institutes</span>
    authorInstituteList = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>  <span style="color: #808080; font-style: italic;"># A list of &quot;Author Name\inst{1,2}&quot; strings</span>
    instituteEmails = <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span>  <span style="color: #808080; font-style: italic;"># A dictionary of email addresses for each institute</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> author <span style="color: #ff7700;font-weight:bold;">in</span> authorList:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            codes = authorInstituteCodes<span style="color: black;">&#91;</span>author<span style="color: black;">&#93;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span>codes, <span style="color: #483d8b;">'__iter__'</span><span style="color: black;">&#41;</span>:
                codes = <span style="color: black;">&#91;</span>codes<span style="color: black;">&#93;</span>  <span style="color: #808080; font-style: italic;"># Only one institute code for this author</span>
            authorInstituteList.<span style="color: black;">append</span><span style="color: black;">&#40;</span>
                author + <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\i</span>nst{'</span>
                + <span style="color: #483d8b;">','</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span>instituteCodes.<span style="color: black;">index</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">code</span><span style="color: black;">&#41;</span> + <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
                            <span style="color: #ff7700;font-weight:bold;">for</span> <span style="color: #dc143c;">code</span> <span style="color: #ff7700;font-weight:bold;">in</span> codes<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
                + <span style="color: #483d8b;">'}'</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">try</span>:
                <span style="color: #dc143c;">email</span> = authorEmails<span style="color: black;">&#91;</span>author<span style="color: black;">&#93;</span>
                <span style="color: #ff7700;font-weight:bold;">try</span>:
                    instituteEmails<span style="color: black;">&#91;</span>codes<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span>.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">email</span><span style="color: black;">&#41;</span>
                <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">KeyError</span>:  <span style="color: #808080; font-style: italic;"># First email address for this institute</span>
                    instituteEmails<span style="color: black;">&#91;</span>codes<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span> = <span style="color: black;">&#91;</span><span style="color: #dc143c;">email</span><span style="color: black;">&#93;</span>
            <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">KeyError</span>:
                <span style="color: #ff7700;font-weight:bold;">pass</span> <span style="color: #808080; font-style: italic;"># No email address associated with author</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">KeyError</span>:
            authorInstituteList.<span style="color: black;">append</span><span style="color: black;">&#40;</span>author<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># Create a list of &quot;Institute Name, Address\\</span>
    <span style="color: #808080; font-style: italic;">#                   \email{j.bloggs@no.where}&quot; strings</span>
    instituteEmailList = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> instituteCode <span style="color: #ff7700;font-weight:bold;">in</span> instituteCodes:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            emails = instituteEmails<span style="color: black;">&#91;</span>instituteCode<span style="color: black;">&#93;</span>
            instituteEmailList.<span style="color: black;">append</span><span style="color: black;">&#40;</span>
                institutesTex<span style="color: black;">&#91;</span>instituteCode<span style="color: black;">&#93;</span>
                + <span style="color: #483d8b;">''</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\e</span>mail{'</span> + <span style="color: #dc143c;">email</span> + <span style="color: #483d8b;">'}'</span> <span style="color: #ff7700;font-weight:bold;">for</span> <span style="color: #dc143c;">email</span> <span style="color: #ff7700;font-weight:bold;">in</span> emails<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">KeyError</span>:
            instituteEmailList.<span style="color: black;">append</span><span style="color: black;">&#40;</span>institutesTex<span style="color: black;">&#91;</span>instituteCode<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># Put it all together</span>
    authorsString = <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\\</span>author{'</span>
    authorsString += <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\\</span>and '</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>authorInstituteList<span style="color: black;">&#41;</span>
    authorsString += <span style="color: #483d8b;">'}<span style="color: #000099; font-weight: bold;">\n</span>'</span>
    authorsString += <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\\</span>institute{'</span>
    authorsString += <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\\</span>and '</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>instituteEmailList<span style="color: black;">&#41;</span>
    authorsString += <span style="color: #483d8b;">'}<span style="color: #000099; font-weight: bold;">\n</span>'</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> authorsString</pre></div></div>

<p>Anyone still reading?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2010/06/03/generating-latex-authors-lists-for-mnras-and-aa/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>MNRAS line wrapping in authors lists</title>
		<link>http://www.anthonysmith.me.uk/research/2010/05/07/mnras-line-wrapping-in-authors-lists/</link>
		<comments>http://www.anthonysmith.me.uk/research/2010/05/07/mnras-line-wrapping-in-authors-lists/#comments</comments>
		<pubDate>Fri, 07 May 2010 11:08:29 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[MNRAS]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=290</guid>
		<description><![CDATA[In case anyone else using the MNRAS LaTeX class has been tearing their hair out inserting line breaks manually into long author (and institution) lists, using \newauthor, here's how I did it: \author[J.~Bloggs et al.] {\parbox{\textwidth}{J.~Bloggs,$^{1}$\thanks{E-mail: \texttt{j.bloggs@no.where}} J.~Bloggs,$^{2,3}$ J.~Bloggs,$^{3}$ J.~Bloggs,$^{4}$ J.~Bloggs,$^{5}$ J.~Bloggs,$^{6}$ %... J.~Bloggs$^{99}$ and J.~Bloggs$^{100}$}\vspace{0.4cm}\\ \parbox{\textwidth}{$^{1}$Department of Something, Somewhere\\ $^{2}$Department of Something, Somewhere\\ $^{3}$Department&#8230;]]></description>
			<content:encoded><![CDATA[<p>In case anyone else using the <a href="http://www.wiley.com/bw/static/mnras_latex.asp">MNRAS LaTeX class</a> has been tearing their hair out inserting line breaks manually into long author (and institution) lists, using <code>\newauthor</code>, here's how I did it:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #E02020; ">\</span><span style="color: #800000;">author</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">J.~Bloggs et al.</span><span style="color: #E02020; ">]</span>
<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">\<span style="color: #800000;">parbox</span><span style="color: #E02020; ">{\</span><span style="color: #800000;">textwidth</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">J.~Bloggs,<span style="color: #8020E0; font-weight: normal;">$^{1</span>}$</span><span style="color: #E02020; ">\</span><span style="color: #800000;">thanks</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">E-mail: \<span style="color: #800000;">texttt</span>{j.bloggs@no.where</span><span style="color: #E02020; ">}}</span>
J.~Bloggs,<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">2,3</span>}$</span>
J.~Bloggs,<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">3</span>}$</span>
J.~Bloggs,<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">4</span>}$</span>
J.~Bloggs,<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">5</span>}$</span>
J.~Bloggs,<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">6</span>}$</span>
<span style="color: #2C922C; font-style: italic;">%...</span>
J.~Bloggs<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">99</span>}$</span> and
J.~Bloggs<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">100</span>}$</span><span style="color: #E02020; ">}\</span><span style="color: #800000;">vspace</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">0.4cm</span><span style="color: #E02020; ">}\\</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">parbox</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">\<span style="color: #800000;">textwidth</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #8020E0; font-weight: normal;">$^{1</span>}$</span>Department of Something, Somewhere<span style="color: #E02020; ">\\</span>
<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">2</span>}$</span>Department of Something, Somewhere<span style="color: #E02020; ">\\</span>
<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">3</span>}$</span>Department of Something, Somewhere<span style="color: #E02020; ">\\</span>
<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">4</span>}$</span>Department of Something, Somewhere<span style="color: #E02020; ">\\</span>
<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">5</span>}$</span>Department of Something, Somewhere<span style="color: #E02020; ">\\</span>
<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">6</span>}$</span>Department of Something, Somewhere<span style="color: #E02020; ">\\</span>
<span style="color: #2C922C; font-style: italic;">%...</span>
<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">99</span>}$</span>Department of Something, Somewhere<span style="color: #E02020; ">\\</span>
<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;">100</span>}$</span>Department of Something, Somewhere<span style="color: #E02020; ">}}</span></pre></div></div>

<p>Next: a Python script to generate the above from a simple list of authors and affiliations.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2010/05/07/mnras-line-wrapping-in-authors-lists/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bayesian number counts</title>
		<link>http://www.anthonysmith.me.uk/research/2010/04/30/bayesian-number-counts/</link>
		<comments>http://www.anthonysmith.me.uk/research/2010/04/30/bayesian-number-counts/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 12:40:29 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Bayesianism]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=282</guid>
		<description><![CDATA[Here's a simple bit of statistics for a Friday lunchtime. You count the number of galaxies in a certain area on the sky (with the galaxies satisfying some specific properties, if you like). What is the true number density? Let the expected number be \(\lambda\) (the true number density multiplied by the area on the&#8230;]]></description>
			<content:encoded><![CDATA[<p>Here's a simple bit of statistics for a Friday lunchtime. You count the number of galaxies in a certain area on the sky (with the galaxies satisfying some specific properties, if you like). What is the <em>true</em> number density? Let the expected number be <span class='MathJax_Preview'>\(\lambda\)</span> (the true number density multiplied by the area on the sky) and the measured number be <span class='MathJax_Preview'>\(k\)</span>. Then, in true <a href="http://en.wikipedia.org/wiki/Bayes'_theorem">Bayesian</a> fashion, what we want is <p style='text-align:center;'><span class='MathJax_Preview'>\[P(\lambda|k) = \frac{P(k|\lambda)P(\lambda)}{P(k)}\]</span></p></p>
<p>Now, for the prior, <span class='MathJax_Preview'>\(P(\lambda)\)</span>, we assume a prior which is flat on a logarithmic scale. That is, we guess (before making the observation) that the expected number is as likely to lie between 1 and 10 as it is to lie between 1000 and 10,000. (The alternative, a flat prior on a <em>linear</em> scale, would mean that we guess the true density is just as likely to lie between 10,001 and 10,010 as it is to lie between 1 and 10, which is ridiculous.) So <span class='MathJax_Preview'>\(P(\lambda) \propto 1/\lambda\)</span>. The likelihood, <span class='MathJax_Preview'>\(P(k|\lambda)\)</span> is given by the <a href="http://en.wikipedia.org/wiki/Poisson_distribution">Poisson distribution</a>. So, ignoring the normalizing factor of <span class='MathJax_Preview'>\(P(k)\)</span>, <p style='text-align:center;'><span class='MathJax_Preview'>\[P(\lambda|k) \propto \frac{\lambda^k}{k!} e^{-\lambda} \frac{1}{\lambda}\]</span></p> <p style='text-align:center;'><span class='MathJax_Preview'>\[ \propto \lambda^{k-1}e^{-\lambda}\]</span></p></p>
<p>And this is the <a href="http://en.wikipedia.org/wiki/Gamma_distribution">Gamma distribution</a>. Easy peasy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2010/04/30/bayesian-number-counts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Herschel for everyone</title>
		<link>http://www.anthonysmith.me.uk/research/2010/03/09/herschel-for-everyone/</link>
		<comments>http://www.anthonysmith.me.uk/research/2010/03/09/herschel-for-everyone/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 15:37:52 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Herschel Space Observatory]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=279</guid>
		<description><![CDATA[I've just learned that the Herschel Science Archive has been opened up to the world, so any old Tom, Dick or Harry can download the data and start writing their own Nature papers. Well, okay, most of the data is (are) proprietary, but there's quite a bit of public data on there. Here are some&#8230;]]></description>
			<content:encoded><![CDATA[<p>I've just learned that the Herschel Science Archive has been opened up to the world, so any old Tom, Dick or Harry can download the data and start writing their own Nature papers. Well, okay, most of the data is (are) proprietary, but there's quite a bit of public data on there. Here are some links.</p>
<ul>
<li><a href="http://archives.esac.esa.int/hsa/hsa.html">Herschel Science Archive</a></li>
<li><a href="http://herschel.esac.esa.int/Data_Processing.shtml">Herschel Data Processing</a></li>
<li>HIPE software: <a href="http://herschel.esac.esa.int/HIPE_download.shtml">stable release</a>, or <a href="http://herschel.esac.esa.int/hcss/build.php">development builds</a> (<a href="http://herschel.esac.esa.int/hcss/install.php">installation instructions</a>)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2010/03/09/herschel-for-everyone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Astropython</title>
		<link>http://www.anthonysmith.me.uk/research/2010/01/19/astropython/</link>
		<comments>http://www.anthonysmith.me.uk/research/2010/01/19/astropython/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 10:48:25 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=276</guid>
		<description><![CDATA[You (both of you) might well be interested in the new Astropython site, which looks excellent. Here's the site's own description: Research in astronomy includes the analysis of astronomical images, parsing and manipulation of large catalogs, statistical yet often visual inference, and the creation of data visualizations for publication and dissemination of results. The purpose&#8230;]]></description>
			<content:encoded><![CDATA[<p>You (both of you) might well be interested in the new <a href="http://www.astropython.org/">Astropython</a> site, which looks excellent. Here's <a href="http://www.astropython.org/about">the site's own description</a>:</p>
<blockquote><p>Research in astronomy includes the analysis of astronomical images, parsing and manipulation of large catalogs, statistical yet often visual inference, and the creation of data visualizations for publication and dissemination of results.</p>
<p>The purpose of this web site is to act as a community knowledge base for performing this research with the open source Python language. It provides a forum for general discussion, advice, or relevant news items, collecting lists of useful resources, users' code snippets or scripts, and longer tutorials on specific topics. The topics within these pages are presented in a list view with the ability to sort by date or topic. A traditional "blog" view of the most recently posted topics is visible from the site Home page.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2010/01/19/astropython/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Astroinformatics</title>
		<link>http://www.anthonysmith.me.uk/research/2009/09/23/astroinformatics/</link>
		<comments>http://www.anthonysmith.me.uk/research/2009/09/23/astroinformatics/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 09:41:11 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[astroinformatics]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=269</guid>
		<description><![CDATA[Data volumes from multiple sky surveys have grown from gigabytes into terabytes during the past decade, and will grow from terabytes into tens (or hundreds) of petabytes in the next decade. ... For astronomy to effectively cope with and reap the maximum scientific return from existing and future large sky surveys, facilities, and data-producing projects,&#8230;]]></description>
			<content:encoded><![CDATA[<blockquote><p>Data volumes from multiple sky surveys have grown from gigabytes into terabytes during the past decade, and will grow from terabytes into tens (or hundreds) of petabytes in the next decade. ... For astronomy to effectively cope with and reap the maximum scientific return from existing and future large sky surveys, facilities, and data-producing projects, we need our own information science specialists. We therefore recommend the formal creation, recognition, and support of a major new discipline, which we call Astroinformatics. ... Now is the time for the recognition of Astroinformatics as an essential methodology of astronomical research. The future of astronomy depends on it.<a href="http://arxiv.org/abs/0909.3892"></a></p></blockquote>
<p><a href="http://arxiv.org/abs/0909.3892">Astroinformatics: A 21st Century Approach to Astronomy</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2009/09/23/astroinformatics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pixelating a 2-D Gaussian with Python</title>
		<link>http://www.anthonysmith.me.uk/research/2009/09/04/pixelating-a-2-d-gaussian-with-python/</link>
		<comments>http://www.anthonysmith.me.uk/research/2009/09/04/pixelating-a-2-d-gaussian-with-python/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 11:20:00 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[photometry]]></category>
		<category><![CDATA[point sources]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=253</guid>
		<description><![CDATA[They're coming thick and fast now. Here's a Python function to accompany the previous post. It's not maximally efficient, but should make sense... from scipy import stats def gaussian_pixel&#40;minxy, maxxy, sigma, meanxy=&#40;0.,0.&#41;, norm=None&#41;: &#34;&#34;&#34;Return the value of a pixel sampling a 2D Gaussian, normalized such that the area under the Gaussian is 1 (default) or&#8230;]]></description>
			<content:encoded><![CDATA[<p>They're coming thick and fast now.</p>
<p>Here's a Python function to accompany the <a href="http://www.anthonysmith.me.uk/research/2009/09/04/on-the-normalization-of-prfs/">previous post</a>. It's not maximally efficient, but should make sense...</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> scipy <span style="color: #ff7700;font-weight:bold;">import</span> stats
<span style="color: #ff7700;font-weight:bold;">def</span> gaussian_pixel<span style="color: black;">&#40;</span>minxy, maxxy, sigma, meanxy=<span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>.,<span style="color: #ff4500;">0</span>.<span style="color: black;">&#41;</span>, norm=<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;Return the value of a pixel sampling a 2D Gaussian,
    normalized such that the area under the Gaussian is 1
    (default) or such that the peak is given by norm.&quot;&quot;&quot;</span>
    x1, y1 = minxy
    x2, y2 = maxxy
    x0, y0 = meanxy
    <span style="color: #ff7700;font-weight:bold;">if</span> norm <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #008000;">None</span>:
        norm = <span style="color: #ff4500;">1</span>. / <span style="color: #ff4500;">2</span> / <span style="color: #dc143c;">math</span>.<span style="color: black;">pi</span> / sigma <span style="color: #66cc66;">**</span> <span style="color: #ff4500;">2</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> norm <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">2</span> <span style="color: #66cc66;">*</span> <span style="color: #dc143c;">math</span>.<span style="color: black;">pi</span> <span style="color: #66cc66;">*</span> sigma <span style="color: #66cc66;">**</span> <span style="color: #ff4500;">2</span> / <span style="color: black;">&#40;</span>x2 - x1<span style="color: black;">&#41;</span> / <span style="color: black;">&#40;</span>y2 - y1<span style="color: black;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: black;">&#40;</span>
        <span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span> - stats.<span style="color: black;">erfc</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>x2 - x0<span style="color: black;">&#41;</span> / <span style="color: #dc143c;">math</span>.<span style="color: black;">sqrt</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span> / sigma<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> / <span style="color: #ff4500;">2</span>.
        - <span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span> - stats.<span style="color: black;">erfc</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>x1 - x0<span style="color: black;">&#41;</span> / <span style="color: #dc143c;">math</span>.<span style="color: black;">sqrt</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span> / sigma<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> / <span style="color: #ff4500;">2</span>.<span style="color: black;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: black;">&#40;</span>
        <span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span> - stats.<span style="color: black;">erfc</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>y2 - y0<span style="color: black;">&#41;</span> / <span style="color: #dc143c;">math</span>.<span style="color: black;">sqrt</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span> / sigma<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> / <span style="color: #ff4500;">2</span>.
        - <span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span> - stats.<span style="color: black;">erfc</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>y1 - y0<span style="color: black;">&#41;</span> / <span style="color: #dc143c;">math</span>.<span style="color: black;">sqrt</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span> / sigma<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> / <span style="color: #ff4500;">2</span>.<span style="color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2009/09/04/pixelating-a-2-d-gaussian-with-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On the normalization of PRFs</title>
		<link>http://www.anthonysmith.me.uk/research/2009/09/04/on-the-normalization-of-prfs/</link>
		<comments>http://www.anthonysmith.me.uk/research/2009/09/04/on-the-normalization-of-prfs/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 10:59:31 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[photometry]]></category>
		<category><![CDATA[point sources]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=227</guid>
		<description><![CDATA[Yesterday I said that the PRF for a map in Jy/beam (or similar) should be normalized so that that peak is 1. But this is true only for an idealised (not pixelated) PRF, or if the map has infinitesimally small pixels. If the pixels are larger than infinitesimal, as is generally the case, then the&#8230;]]></description>
			<content:encoded><![CDATA[<p>Yesterday I said that the PRF for a map in Jy/beam (or similar) should be normalized so that that peak is 1. But this is true only for an idealised (not pixelated) PRF, or if the map has infinitesimally small pixels.</p>
<p>If the pixels are larger than infinitesimal, as is generally the case, then the maximum value of the pixelated PRF will be the average value over the pixel, which will be less than 1.</p>
<p>For example, if the PRF is a two-dimensional Gaussian, centred on <span class='MathJax_Preview'>\((x_0, y_0)\)</span>, with standard deviation <span class='MathJax_Preview'>\(\sigma\)</span>, then the value in a pixel with <span class='MathJax_Preview'>\(x_1 < x < x_2\)</span> and <span class='MathJax_Preview'>\(y_1 < y < y_2\)</span> will be <p style='text-align:center;'><span class='MathJax_Preview'>\[A = \frac{1}{(x_2 - x_1)(y_2 - y_1)} \int_{x_1}^{x_2} \int_{y_1}^{y_2} e^{- \left( \frac{(x-x_0)^2 + (y-y_0)^2}{2\sigma^2} \right)} \mathrm{d}x \mathrm{d}y.\]</span></p> which is <p style='text-align:center;'><span class='MathJax_Preview'>\[A = \frac{2 \pi \sigma^2}{(x_2 - x_1)(y_2 - y_1)} \left( \frac{1}{2} \mathrm{erf} \left( \frac{x_2 - x_0}{\sqrt{2}\sigma} \right) - \frac{1}{2} \mathrm{erf} \left( \frac{x_1 - x_0}{\sqrt{2}\sigma} \right) \right)\]</span></p> <p style='text-align:center;'><span class='MathJax_Preview'>\[ \times \left( \frac{1}{2} \mathrm{erf} \left( \frac{y_2 - y_0}{\sqrt{2}\sigma} \right) - \frac{1}{2} \mathrm{erf} \left( \frac{y_1 - y_0}{\sqrt{2}\sigma} \right) \right).\]</span></p></p>
<p>Ugh. Let's make that simpler. For a PRF centred on <span class='MathJax_Preview'>\((0,0)\)</span>, and a pixel <span class='MathJax_Preview'>\((\pm r, \pm r)\)</span>, this is <p style='text-align:center;'><span class='MathJax_Preview'>\[A = \frac{\pi \sigma^2}{2 r^2} \left( \mathrm{erf} \left( \frac{r}{\sqrt{2}\sigma} \right) \right)^2.\]</span></p></p>
<p>As an example, the fairly-Gaussian beam for the Herschel Space Observatory SPIRE instrument has an FWHM of around 18", which corresponds to a standard deviation of around <span class='MathJax_Preview'>\(18"/2\sqrt{2 \ln 2} = 7.64"\)</span>. If we make a Jy/beam map with pixel size 6", then the peak value for a 1 Jy point source in the centre of a pixel will be <p style='text-align:center;'><span class='MathJax_Preview'>\[A = \frac{\pi (7.64")^2}{2 (3")^2} \left( \mathrm{erf} \left( \frac{3"}{\sqrt{2}(7.64")} \right) \right)^2 = 0.950 \,\text{Jy/beam}.\]</span></p><br />
No big deal really...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2009/09/04/on-the-normalization-of-prfs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Estimating the flux of a point source</title>
		<link>http://www.anthonysmith.me.uk/research/2009/09/03/estimating-the-flux-of-a-point-source/</link>
		<comments>http://www.anthonysmith.me.uk/research/2009/09/03/estimating-the-flux-of-a-point-source/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 16:30:33 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[photometry]]></category>
		<category><![CDATA[point sources]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=208</guid>
		<description><![CDATA[You have a map and you know what a point source looks like. How do you filter the map so that the value of each pixel is now the most likely flux of a point source centred on that pixel? (An isolated point source, to be more precise.) Easy. First, find \(P_i\), which is the&#8230;]]></description>
			<content:encoded><![CDATA[<p>You have a map and you know what a point source looks like. How do you filter the map so that the value of each pixel is now the most likely flux of a point source centred on that pixel? (An isolated point source, to be more precise.)</p>
<p>Easy. </p>
<p>First, find <span class='MathJax_Preview'>\(P_i\)</span>, which is the <strong>point response function</strong> (PRF), telling you what a point source of flux 1 will look like in the map. This may be normalized so that the peak is 1 (if your map is in Jy/beam or similar), or so that <span class='MathJax_Preview'>\(\sum P_i = 1\)</span> (if your map is in Jy/pixel or similar). If your map is in MJy/sr ... well, figure it out and add a comment below. Basically, if you normalize your PRF correctly, you won't need to worry about the map units in what follows. Phew.</p>
<p>Now the measured value of each pixel around the point source, <span class='MathJax_Preview'>\(d_i\)</span>, will be <p style='text-align:center;'><span class='MathJax_Preview'>\[d_i = f P_i + n_i,\]</span></p> where <span class='MathJax_Preview'>\(f\)</span> is the flux of the source and <span class='MathJax_Preview'>\(n_i\)</span> is the noise, drawn from a normal distribution with mean zero and standard deviation <span class='MathJax_Preview'>\(\sigma_i\)</span>.</p>
<p>Now the badness of the fit is measured by the <span class='MathJax_Preview'>\(\chi^2\)</span>, which is given by <p style='text-align:center;'><span class='MathJax_Preview'>\[\chi^2 = \sum_i \left( \frac{d_i - fP_i}{\sigma_i} \right)^2.\]</span></p> At the maximum likelihood value of the flux, <span class='MathJax_Preview'>\(f\)</span>, <span class='MathJax_Preview'>\(\chi^2\)</span> will be at a minimum, so <p style='text-align:center;'><span class='MathJax_Preview'>\[\frac{\mathrm{d}\chi^2}{\mathrm{d}f} = 0.\]</span></p> Hence <p style='text-align:center;'><span class='MathJax_Preview'>\[\sum_i (-2d_i + 2 f P_i^2) / \sigma_i^2 = 0.\]</span></p> Solving this for <span class='MathJax_Preview'>\(f\)</span>, we find the maximum likelihood solution <p style='text-align:center;'><span class='MathJax_Preview'>\[f = \frac{\sum_i d_i P_i / \sigma_i^2}{\sum_i P_i^2 / \sigma_i^2}.\]</span></p></p>
<p>Now just do this for each pixel in the map (corresponding to a point source centred on each pixel) and you're done.</p>
<p><strong>Worked example</strong>. <span class='MathJax_Preview'>\(P_i\)</span> is 0.5, 1.0 and 0.5, for three adjacent pixels (you'll have realised that the map is in Jy/beam or similar), and <span class='MathJax_Preview'>\(d_i\)</span> is 1, 2 and 1 Jy/beam, for three adjacent pixels, with the same (tiny!) value of <span class='MathJax_Preview'>\(\sigma_i\)</span> for each pixel (in this case, we can ignore the value of <span class='MathJax_Preview'>\(\sigma_i\)</span> in what follows). So the flux at the central pixel is estimated to be <p style='text-align:center;'><span class='MathJax_Preview'>\[f = (0.5 \times 1 + 1.0 \times 2 + 0.5 \times 1) / (0.5^2 + 1.0^2 + 0.5^2) = 2 \,\mathrm{Jy},\]</span></p> which is no surprise, since the maximum value of the map in Jy/beam is 2 at that position.</p>
<p>This is an example of a <a href="http://en.wikipedia.org/wiki/Matched_filter">matched filter</a> (I haven't read the page, but hopefully including the link will make me look clever). And, given that point sources are under no particular obligation to align themselves with the centres of the pixels of your map, <span class='MathJax_Preview'>\(P_i\)</span> can easily be re-estimated for a source with a certain offset from the pixel centre.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2009/09/03/estimating-the-flux-of-a-point-source/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Visualizing noisy images</title>
		<link>http://www.anthonysmith.me.uk/research/2009/05/13/visualizing-noisy-images/</link>
		<comments>http://www.anthonysmith.me.uk/research/2009/05/13/visualizing-noisy-images/#comments</comments>
		<pubDate>Wed, 13 May 2009 11:51:43 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[photometry]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=196</guid>
		<description><![CDATA[You have an image. Each pixel has a value with some uncertainty. How do you visualize the uncertainty in each pixel? Like this: Here's the Python code import numpy as np from matplotlib import pyplot as plt &#160; class FlickerImage&#40;object&#41;: def __init__&#40;self, im, err&#41;: self.im = im.copy&#40;&#41; self.err = err.copy&#40;&#41; finite = np.isfinite&#40;self.im + self.err&#41;&#8230;]]></description>
			<content:encoded><![CDATA[<p>You have an image. Each pixel has a value with some uncertainty. How do you visualize the uncertainty in each pixel? Like this:</p>
<p><a href="http://www.anthonysmith.me.uk/research/wp-content/uploads/2009/05/flicker_image.gif"><img class="alignnone size-full wp-image-197" title="flicker_image" src="http://www.anthonysmith.me.uk/research/wp-content/uploads/2009/05/flicker_image.gif" alt="flicker_image" width="100%" /></a></p>
<p>Here's the Python code</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> numpy <span style="color: #ff7700;font-weight:bold;">as</span> np
<span style="color: #ff7700;font-weight:bold;">from</span> matplotlib <span style="color: #ff7700;font-weight:bold;">import</span> pyplot <span style="color: #ff7700;font-weight:bold;">as</span> plt
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> FlickerImage<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, im, err<span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">im</span> = im.<span style="color: #dc143c;">copy</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">err</span> = err.<span style="color: #dc143c;">copy</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        finite = np.<span style="color: black;">isfinite</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">im</span> + <span style="color: #008000;">self</span>.<span style="color: black;">err</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">vmin</span> = <span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">im</span> - <span style="color: #ff4500;">2</span> <span style="color: #66cc66;">*</span> <span style="color: #008000;">self</span>.<span style="color: black;">err</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span>finite<span style="color: black;">&#93;</span>.<span style="color: #008000;">min</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">vmax</span> = <span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">im</span> + <span style="color: #ff4500;">2</span> <span style="color: #66cc66;">*</span> <span style="color: #008000;">self</span>.<span style="color: black;">err</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span>finite<span style="color: black;">&#93;</span>.<span style="color: #008000;">max</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">im</span><span style="color: black;">&#91;</span>np.<span style="color: black;">invert</span><span style="color: black;">&#40;</span>finite<span style="color: black;">&#41;</span><span style="color: black;">&#93;</span> = <span style="color: #008000;">self</span>.<span style="color: black;">vmax</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">err</span><span style="color: black;">&#91;</span>np.<span style="color: black;">invert</span><span style="color: black;">&#40;</span>finite<span style="color: black;">&#41;</span><span style="color: black;">&#93;</span> = <span style="color: #ff4500;">0</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> flicker<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        fg = plt.<span style="color: black;">imshow</span><span style="color: black;">&#40;</span>np.<span style="color: black;">zeros</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">im</span>.<span style="color: black;">shape</span><span style="color: black;">&#41;</span>,
                        interpolation=<span style="color: #483d8b;">'nearest'</span>,
                        vmin=<span style="color: #008000;">self</span>.<span style="color: black;">vmin</span>,
                        vmax=<span style="color: #008000;">self</span>.<span style="color: black;">vmax</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #008000;">True</span>:
            ran = np.<span style="color: #dc143c;">random</span>.<span style="color: black;">normal</span><span style="color: black;">&#40;</span>size=im.<span style="color: black;">shape</span><span style="color: black;">&#41;</span>
            fg.<span style="color: black;">set_data</span><span style="color: black;">&#40;</span>im + err <span style="color: #66cc66;">*</span> ran<span style="color: black;">&#41;</span>
            plt.<span style="color: black;">draw</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>And here's an example script:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> pyfits
f = pyfits.<span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'file.fits'</span><span style="color: black;">&#41;</span>
im = f<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;IMAGE&quot;</span><span style="color: black;">&#93;</span>.<span style="color: black;">data</span>
err = f<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;ERROR&quot;</span><span style="color: black;">&#93;</span>.<span style="color: black;">data</span>
flicker_image = FlickerImage<span style="color: black;">&#40;</span>im, err<span style="color: black;">&#41;</span>
flicker_image.<span style="color: black;">flicker</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2009/05/13/visualizing-noisy-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python, FITS and DS9</title>
		<link>http://www.anthonysmith.me.uk/research/2009/04/01/python-fits-and-ds9/</link>
		<comments>http://www.anthonysmith.me.uk/research/2009/04/01/python-fits-and-ds9/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 13:06:34 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[DS9]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=188</guid>
		<description><![CDATA[Here's an easy way to display FITS images (or any array) in DS9 using Python (with PyFITS, NumPy and Numdisplay, which is part of stsci_python). First launch DS9, then in Python: import numdisplay import pyfits arr = pyfits.getdata&#40;'file.fits'&#41; numdisplay.display&#40;arr&#41; Easy! Alternatively, the Kapteyn package seems excellent, and uses Python's matplotlib for displaying images. It requires&#8230;]]></description>
			<content:encoded><![CDATA[<p>Here's an easy way to display <a href="http://heasarc.gsfc.nasa.gov/docs/heasarc/fits.html">FITS</a> images (or any array) in <a href="http://hea-www.harvard.edu/RD/ds9/">DS9</a> using <a href="http://python.org/">Python</a> (with <a href="http://www.stsci.edu/resources/software_hardware/pyfits">PyFITS</a>, <a href="http://numpy.scipy.org/">NumPy</a> and <a href="http://stsdas.stsci.edu/numdisplay/">Numdisplay</a>, which is part of <a href="http://www.stsci.edu/resources/software_hardware/pyraf/stsci_python/">stsci_python</a>). First launch DS9, then in Python:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> numdisplay
<span style="color: #ff7700;font-weight:bold;">import</span> pyfits
arr = pyfits.<span style="color: black;">getdata</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'file.fits'</span><span style="color: black;">&#41;</span>
numdisplay.<span style="color: black;">display</span><span style="color: black;">&#40;</span>arr<span style="color: black;">&#41;</span></pre></div></div>

<p>Easy!</p>
<p>Alternatively, the <a href="http://www.astro.rug.nl/software/kapteyn/">Kapteyn package</a> seems excellent, and uses Python's <a href="http://matplotlib.sourceforge.net/">matplotlib</a> for displaying images. <del>It requires <a href="http://www.atnf.csiro.au/people/mcalabre/WCS/">WCSLIB</a> to run, though, so the installation process is a bit longer</del> [update: apparently that bit is no longer true - 17 Oct 2011].</p>
<p>A third option is to use <a href="http://code.google.com/p/python-sao/">python-sao</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> pysao
<span style="color: #ff7700;font-weight:bold;">import</span> pyfits
ds9 = pysao.<span style="color: black;">ds9</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
f = pyfits.<span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'file.fits'</span><span style="color: black;">&#41;</span>
ds9.<span style="color: black;">view</span><span style="color: black;">&#40;</span>f<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Easy again! And the WCS information is preserved, which doesn't seem to be the case with Numdisplay.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2009/04/01/python-fits-and-ds9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PSFs in IDL</title>
		<link>http://www.anthonysmith.me.uk/research/2009/03/18/psfs-in-idl/</link>
		<comments>http://www.anthonysmith.me.uk/research/2009/03/18/psfs-in-idl/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 15:14:52 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[IDL]]></category>
		<category><![CDATA[point sources]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=175</guid>
		<description><![CDATA[Two methods of approximating a point-spread function in IDL: 1. StarFinder seems to do a great job at finding point sources in crowded fields. It includes a routine for generating the Airy pattern. For a 51 x 51 array, with the peak at [25, 25], and an FWHM of 8.0 pixels, this is the command:&#8230;]]></description>
			<content:encoded><![CDATA[<p>Two methods of approximating a <a href="http://en.wikipedia.org/wiki/Point_spread_function">point-spread function</a> in IDL:</p>
<p>1. <a href="http://www.bo.astro.it/~giangi/StarFinder/">StarFinder</a> seems to do a great job at finding point sources in crowded fields. It includes a routine for generating the <a href="http://en.wikipedia.org/wiki/Airy_pattern">Airy pattern</a>. For a 51 x 51 array, with the peak at [25, 25], and an FWHM of 8.0 pixels, this is the command:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">psf = airy_pattern(51, 51, 25, 25, 2./8.0)
isurface, psf</pre></div></div>

<p>The output looks something like this:</p>
<p><img class="alignnone size-full wp-image-179" title="PSF Airy pattern (StarFinder/IDL)" src="http://www.anthonysmith.me.uk/research/wp-content/uploads/2009/03/psf_airy.png" alt="PSF Airy pattern (StarFinder/IDL)" width="480" height="321" /></p>
<p>2. The <a href="http://idlastro.gsfc.nasa.gov/">IDL Astronomy User's Library</a> contains a routine, psf_gaussian, that produces a Gaussian PSF. To produce the same as above, the command would be:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">psf = psf_gaussian(npix=51, fwhm=8.0, /double)
isurface, psf</pre></div></div>

<p>... which produces something like this:</p>
<p><img class="alignnone size-full wp-image-180" title="PSF Gaussian (IDL Astronomy User's Library)" src="http://www.anthonysmith.me.uk/research/wp-content/uploads/2009/03/psf_gaussian.png" alt="PSF Gaussian (IDL Astronomy User's Library)" width="479" height="324" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2009/03/18/psfs-in-idl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The eclipse of IDL 7</title>
		<link>http://www.anthonysmith.me.uk/research/2009/03/03/the-eclipse-of-idl-7/</link>
		<comments>http://www.anthonysmith.me.uk/research/2009/03/03/the-eclipse-of-idl-7/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 18:54:32 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[IDL]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=168</guid>
		<description><![CDATA[I've finally made the transition from IDL 6.4 to IDL 7. Here are my handy hints... IDL Workbench rocks! (This is because it is basically Eclipse, which is a proper development environment, unlike that hideous old IDLDE.) Another reason for using IDL Workbench (for me at least, and for now) is that IDL help doesn't&#8230;]]></description>
			<content:encoded><![CDATA[<p>I've finally made the transition from <a href="http://www.ittvis.com/idl/">IDL</a> 6.4 to IDL 7. Here are my handy hints...</p>
<ul>
<li>IDL Workbench rocks! (This is because it is basically <a href="http://www.eclipse.org/">Eclipse</a>, which is a proper development environment, unlike that hideous old IDLDE.)</li>
<li>Another reason for using IDL Workbench (for me at least, and for now) is that IDL help doesn't seem to work if Java 6 is the default (as it is on my Mac), but the help <em>does</em> work if launched through the IDL Workbench.</li>
</ul>
<p>To transition to IDL Workbench:</p>
<ol>
<li>Import your code as described on <a href="http://www.dfanning.com/workbench/setup_projects.html">David Fanning's page</a> - fret not, it's easy and harmless</li>
<li>Preferences -&gt; IDL -&gt; Startup file, if you have one, and</li>
<li>Preferences -&gt; IDL -&gt; Paths -&gt; Insert... for me it was just my idl folder, including all sub-folders, to mimic my $IDL_PATH environment variable.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2009/03/03/the-eclipse-of-idl-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The science of galaxy formation...</title>
		<link>http://www.anthonysmith.me.uk/research/2008/08/26/the-science-of-galaxy-formation/</link>
		<comments>http://www.anthonysmith.me.uk/research/2008/08/26/the-science-of-galaxy-formation/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 14:49:26 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[galaxy formation]]></category>
		<category><![CDATA[Gerry Gilmore]]></category>
		<category><![CDATA[scientific method]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/research/?p=151</guid>
		<description><![CDATA[...is the title of a provocative article by Gerry Gilmore(*) on today's astro-ph. There's a bit about the scientific method, such as: The appropriate scientific methodology with which to address such questions is itself problematic: how does one apply what many consider the “traditional scientific method”, involving objective analysis of independent repeated experiments as a&#8230;]]></description>
			<content:encoded><![CDATA[<p>...is the title of a <a href="http://arxiv.org/abs/0808.3188v1">provocative article</a> by <a href="http://www.ast.cam.ac.uk/~gil/">Gerry Gilmore</a>(*) on today's <a href="http://arxiv.org/archive/astro-ph">astro-ph</a>. There's a bit about the scientific method, such as:</p>
<blockquote><p>The appropriate scientific methodology with which to address such questions is itself problematic: how does one apply what many consider the “traditional scientific method”, involving objective analysis of independent repeated experiments as a test of theory, when the Universe does not allow us to experiment, in the traditional laboratory physics sense; when we have no useful predictive theory for much of astrophysics; and when the nature of the Universe may restrict our observation to only a very small part of an unobservable larger whole? More specifically, is the observational test of prediction how science actually operates? Is that how astrophysics operates?</p></blockquote>
<p>Good stuff. But the most cutting remarks come in his assessment of the current approach to modelling galaxy formation:</p>
<blockquote><p>Such a long list of observations all inconsistent with apparently fundamental features of galaxy formation models suggests two approaches. In one approach, new complex physics (“feedback”) must be added, to “improve” agreement with observation. The appearances are to be saved. In another, common assumptions in the galaxy simulations could be examined further.</p></blockquote>
<p>With the reference to the saving of appearances, the allusion is to Ptolemy's epicycles: making a misguided model seem more plausible by making it more contrived.</p>
<p>The specific problem Gilmore sees with cosmological simulations is the suppression of the "ultraviolet divergence", i.e., small-scale perturbations, by "numerical smoothing (‘finite resolution')": "It is unlikely that Nature does it that way." He suggests that many of the inconsistencies between galaxy formation models and observations could be a result of this poor handling of the small-scale power spectrum.</p>
<p>(*) Disclaimer: I will not be held responsible for any damage sustained to your eyes as a result of following links on this page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2008/08/26/the-science-of-galaxy-formation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Papers: your personal library of science</title>
		<link>http://www.anthonysmith.me.uk/research/2008/07/22/papers-your-personal-library-of-science/</link>
		<comments>http://www.anthonysmith.me.uk/research/2008/07/22/papers-your-personal-library-of-science/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 13:40:51 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[BibTeX]]></category>
		<category><![CDATA[Macs]]></category>
		<category><![CDATA[mekentosj.com]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/?p=182</guid>
		<description><![CDATA[Looking for a piece of software for your Mac that will allow you to: keep track of PDFs of academic papers, search for papers using Google Scholar, ADS, arXiv, ..., search your personal library in an instant, read papers full-screen, add notes to papers, organise the papers using collections and smart collections, interact with BibTeX&#8230;]]></description>
			<content:encoded><![CDATA[<p>Looking for a piece of software for your Mac that will allow you to:</p>
<ul>
<li>keep track of PDFs of academic papers,</li>
<li>search for papers using Google Scholar, ADS, arXiv, ...,</li>
<li>search your personal library in an instant,</li>
<li>read papers full-screen,</li>
<li>add notes to papers,</li>
<li>organise the papers using collections and smart collections,</li>
<li>interact with BibTeX databases and citation keys,</li>
<li>and do all the above in something that looks and feels like iTunes?</li>
</ul>
<p>Here it is: <a href="http://mekentosj.com/papers/">Papers by mekentosj.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2008/07/22/papers-your-personal-library-of-science/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Galaxy Zoo: the independence of morphology and colour</title>
		<link>http://www.anthonysmith.me.uk/research/2008/06/03/galaxy-zoo-the-independence-of-morphology-and-colour/</link>
		<comments>http://www.anthonysmith.me.uk/research/2008/06/03/galaxy-zoo-the-independence-of-morphology-and-colour/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 09:42:24 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[galaxy demography]]></category>
		<category><![CDATA[Galaxy Zoo]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/2008/06/03/galaxy-zoo-the-independence-of-morphology-and-colour/</guid>
		<description><![CDATA[Galaxies come in two types: red, elliptical galaxies that reside in high-density regions, and blue, spiral galaxies that reside in low-density regions. Right? Actually, no. At least, not according to this Galaxy Zoo paper, on the independence of morphology and colour (or here). First of all, there's a sizeable population of galaxies that blatantly refuse&#8230;]]></description>
			<content:encoded><![CDATA[<p>Galaxies come in two types: red, elliptical galaxies that reside in high-density regions, and blue, spiral galaxies that reside in low-density regions.  Right?</p>
<p>Actually, no.</p>
<p>At least, not according to this <a href="http://www.galaxyzoo.org/">Galaxy Zoo</a> paper, on <a href="http://adsabs.harvard.edu/abs/2008arXiv0805.2612B">the independence of morphology and colour</a> (or <a href="http://arxiv.org/abs/0805.2612">here</a>).</p>
<p>First of all, there's a sizeable population of galaxies that blatantly refuse to allow their colour to determine what shape they should be. There are red galaxies with beautiful spiral morphology and blue galaxies with plain old elliptical morphology.</p>
<p>Okay, but we know that red galaxies like to hang out in crowded places, and that elliptical galaxies are similarly gregarious, so clearly there's some connection between being red and being well-rounded?</p>
<p>Nope, wrong again!</p>
<p>The main reason that we see more red galaxies in dense environments is that the fraction of spiral galaxies that are red changes, and the fraction of elliptical galaxies that are blue changes. So in sparsely populated bits of the universe, most of the spiral galaxies are blue, but in densely populated regions, most of the spiral galaxies are red. It's similar for elliptical galaxies. In low-density regions, a large fraction (not quite half) of the elliptical galaxies are blue, whereas in dense environments the vast majority of elliptical galaxies are red.</p>
<p>So the morphology-density relation has really very little (directly) to do with the colour-density relation.</p>
<p>Moral: "elliptical/spiral" doesn't mean "red/blue"!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2008/06/03/galaxy-zoo-the-independence-of-morphology-and-colour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UKIDSS paper submitted</title>
		<link>http://www.anthonysmith.me.uk/research/2008/06/03/ukidss-paper-submitted/</link>
		<comments>http://www.anthonysmith.me.uk/research/2008/06/03/ukidss-paper-submitted/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 08:54:33 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[UKIDSS]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/2008/06/03/ukidss-paper-submitted/</guid>
		<description><![CDATA[Well, the deed has been done, and the paper has finally been submitted to MNRAS and to astro-ph. You can read it if you really want to: Luminosity and surface brightness distribution of K-band galaxies from the UKIDSS Large Area Survey. Here's a picture from the paper: This is the K-band luminosity function: the number&#8230;]]></description>
			<content:encoded><![CDATA[<p>Well, the deed has been done, and the paper has finally been submitted to <a href="http://www.blackwellpublishing.com/journals/mnr/">MNRAS</a> and to <a href="http://arxiv.org/archive/astro-ph">astro-ph</a>. You can read it if you really want to: <a href="http://arxiv.org/abs/0806.0343">Luminosity and surface brightness distribution of K-band galaxies from the UKIDSS Large Area Survey</a>. Here's a picture from the paper:</p>
<p><a title="UKIDSS K-band Luminosity Function" href="http://www.anthonysmith.me.uk/research/wp-content/uploads/2008/06/lf.png"><img title="UKIDSS K-band Luminosity Function" src="http://www.anthonysmith.me.uk/research/wp-content/uploads/2008/06/lf.png" alt="UKIDSS K-band Luminosity Function" width="100%" /></a></p>
<p>This is the K-band luminosity function: the number of galaxies per volume as a function of their luminosity, with low luminosity at the left and high luminosity at the right. It's far from perfect, but hopefully a step in the right direction. There's quite a bit of incompleteness (missing galaxies) and uncertainty (due to small numbers of galaxies and large-scale structure) at the faint end (left-hand side of the plot). But perhaps more interesting is the disagreement at the bright end (right-hand side). All of the previous results shown on the plot used 2MASS imaging, so this might explain the different results we have found. Specifically, it could be that (1) we use Petrosian magnitudes rather than Kron or total magnitudes, (2) UKIDSS photometry is better than 2MASS photometry, (3) the evolution corrections are different, (4) something else or (5) any combination of the above.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2008/06/03/ukidss-paper-submitted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Evolution of Schechter function ... so?</title>
		<link>http://www.anthonysmith.me.uk/research/2008/04/04/evolution-of-schechter-function-so/</link>
		<comments>http://www.anthonysmith.me.uk/research/2008/04/04/evolution-of-schechter-function-so/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 14:35:04 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[UKIDSS]]></category>

		<guid isPermaLink="false">http://www.anthonysmith.me.uk/2008/04/04/evolution-of-schechter-function-so/</guid>
		<description><![CDATA[This is some work in progress: K-band luminosity function from the UKIDSS Large Area Survey (LAS, black dots), showing the number of galaxies per unit volume depending on the luminosity of the galaxies, from faint (left) to bright (right). I.e., there are lots more small galaxies than big galaxies. I've fit several Schechter functions to&#8230;]]></description>
			<content:encoded><![CDATA[<p><a title="Schechter function" href="http://www.anthonysmith.me.uk/research/wp-content/uploads/2008/04/schechter.png"><img title="Schechter function" src="http://www.anthonysmith.me.uk/research/wp-content/uploads/2008/04/schechter.png" alt="Schechter function" width="100%" /></a></p>
<p>This is some work in progress: K-band luminosity function from the <a href="http://www.ukidss.org/">UKIDSS</a> Large Area Survey (LAS, black dots), showing the number of galaxies per unit volume depending on the luminosity of the galaxies, from faint (left) to bright (right). I.e., there are lots more small galaxies than big galaxies.</p>
<p>I've fit several Schechter functions to the data. This is a convenient way of describing the luminosity function in terms of three numbers: the slope of the faint end (alpha), the luminosity brighter than which the number of galaxies drops off rapidly (M-star) and the number of galaxies per unit volume at M-star (phi-star).  To fit the Schechter functions I've used only a portion of the data, as shown in the figure. For example, for the green curve, I've used only the black points brighter than (to the right of) absolute magnitude -21.</p>
<p>Now here's the point. At high redshift, it is possible to see only the brightest galaxies. So we would be able to plot only the black points towards the right-hand side of the figure. But what effect would this have on the Schechter function? Even if we assume the luminosity function does not vary with redshift, our Schechter function fits <em>would!</em> In fact, if we relied on the Schechter function fit to tell us how the galaxy population varied with redshift (a silly thing to do, but people do it all the time), we would infer that the high-redshift galaxy population was (1) brighter (2) more dominated by small galaxies and (3) less abundant than the low-redshift galaxy population.</p>
<p>(Now (1) and (3) are probably true, but we don't need the Schechter function to tell us. Not so sure about (2).)</p>
<p>Moral: don't rely on the Schechter function!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonysmith.me.uk/research/2008/04/04/evolution-of-schechter-function-so/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

