3 Sep 2009
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.)
First, find , which is the point response function (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 (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.
Now the measured value of each pixel around the point source, , will be
where is the flux of the source and is the noise, drawn from a normal distribution with mean zero and standard deviation .
Now the badness of the fit is measured by the , which is given by
At the maximum likelihood value of the flux, , will be at a minimum, so
Solving this for , we find the maximum likelihood solution
Now just do this for each pixel in the map (corresponding to a point source centred on each pixel) and you're done.
Worked example. 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 is 1, 2 and 1 Jy/beam, for three adjacent pixels, with the same (tiny!) value of for each pixel (in this case, we can ignore the value of in what follows). So the flux at the central pixel is estimated to be
which is no surprise, since the maximum value of the map in Jy/beam is 2 at that position.
This is an example of a matched filter (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, can easily be re-estimated for a source with a certain offset from the pixel centre.
13 May 2009
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 class FlickerImage(object): def __init__(self, im, err): self.im = im.copy() self.err = err.copy() finite = np.isfinite(self.im + self.err) self.vmin = (self.im - 2 * self.err)[finite].min() self.vmax = (self.im + 2 * self.err)[finite].max() self.im[np.invert(finite)] = self.vmax self.err[np.invert(finite)] = 0 def flicker(self): fg = plt.imshow(np.zeros(self.im.shape), interpolation='nearest', vmin=self.vmin, vmax=self.vmax) while True: ran = np.random.normal(size=im.shape) fg.set_data(im + err * ran) plt.draw()
And here's an example script:
import pyfits f = pyfits.open('file.fits') im = f["IMAGE"].data err = f["ERROR"].data flicker_image = FlickerImage(im, err) flicker_image.flicker()
1 Apr 2009
import numdisplay import pyfits arr = pyfits.getdata('file.fits') numdisplay.display(arr)
Alternatively, the Kapteyn package seems excellent, and uses Python's matplotlib for displaying images.
It requires WCSLIB to run, though, so the installation process is a bit longer [update: apparently that bit is no longer true - 17 Oct 2011].
A third option is to use python-sao:
import pysao import pyfits ds9 = pysao.ds9() f = pyfits.open('file.fits') ds9.view(f)
Easy again! And the WCS information is preserved, which doesn't seem to be the case with Numdisplay.
18 Mar 2009
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:
psf = airy_pattern(51, 51, 25, 25, 2./8.0) isurface, psf
The output looks something like this:
2. The IDL Astronomy User's Library contains a routine, psf_gaussian, that produces a Gaussian PSF. To produce the same as above, the command would be:
psf = psf_gaussian(npix=51, fwhm=8.0, /double) isurface, psf
... which produces something like this:
3 Mar 2009
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 seem to work if Java 6 is the default (as it is on my Mac), but the help does work if launched through the IDL Workbench.
To transition to IDL Workbench:
- Import your code as described on David Fanning's page - fret not, it's easy and harmless
- Preferences -> IDL -> Startup file, if you have one, and
- Preferences -> IDL -> Paths -> Insert... for me it was just my idl folder, including all sub-folders, to mimic my $IDL_PATH environment variable.
26 Aug 2008
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?
Good stuff. But the most cutting remarks come in his assessment of the current approach to modelling galaxy formation:
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.
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.
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.
(*) Disclaimer: I will not be held responsible for any damage sustained to your eyes as a result of following links on this page.
22 Jul 2008
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 databases and citation keys,
- and do all the above in something that looks and feels like iTunes?
Here it is: Papers by mekentosj.com.
3 Jun 2008
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?
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.
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?
Nope, wrong again!
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.
So the morphology-density relation has really very little (directly) to do with the colour-density relation.
Moral: "elliptical/spiral" doesn't mean "red/blue"!
3 Jun 2008
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 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.
4 Apr 2008
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 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.
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 would! 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.
(Now (1) and (3) are probably true, but we don't need the Schechter function to tell us. Not so sure about (2).)
Moral: don't rely on the Schechter function!
28 Feb 2008
Why is the universe so crowded? This kind of thing is really messing up my data!
Makes me want to work with simulations...
31 Jan 2008
Now Python and IDL can talk to each other (okay, Python talks to IDL and IDL does what it's told), using pIDLy (pronounce as you please). I experimented with a few other solutions available online but couldn't get them to work. So I cobbled this one together with surprisingly little trouble, thanks largely to pexpect.
28 Jan 2008
20 Dec 2007
Here's the gist of it. Lots of good results already, lots of work in progress, and a sense that UKIDSS has come of age: the needle-in-a-haystack hunters now have enough hay (they hope!) to find some record-breaking needles (the smallest, nearest or furthest known luminiferous objects in the Universe) and the (Galactic or extra-Galactic) Gallup pollers have now canvassed enough individuals (stars or galaxies) to be reasonably confident about the views of the whole population.
I'm one of the extra-Galactic Gallup pollers. Some slides from the talk I gave on the final morning are on my (small but growing!) publications page.
- Investigate the problem with deblending of large galaxies
- Write paper
- Write thesis
- Get job
14 Dec 2007
After creating an account on CosmoCoffee, you will need to edit the keywords in your profile to reflect your interests (well, I did!). Then click on Arxiv new filter and you're off!
Here are my settings:
- Arxives in order of interest: astro-ph
- Arxiv New search key strings: galaxy (redshift )?survey, luminosity (function|density), surface brightness, UKIDSS, UKIRT, VISTA, SDSS, Sloan, WFCAM, near infrared, stellar mass, star formation (rate|history), galax, Bayes, redshift, astro-ph, ADS, extragalactic
And here are the results:
- Monday: 54 new on astro-ph, of which 21 made it through the filter. These were not only filtered but also sorted by CosmoCoffee so the most relevant were listed first. Very useful.
- Tuesday: 76 on astro-ph; 27 on CosmoCoffee. It missed The Future of Cosmology by George Efstathiou, which was a fun read. But I can't think of any way to adjust the CosmoCoffee filter to catch papers like this, without catching loads of other cosmology papers. But in the full astro-ph listings I skimmed over the paper on globular clusters and their host galaxies, which was ranked highly by CosmoCoffee.
- Wednesday: 42 on astro-ph; 14 on CosmoCoffee, filtered and sorted just right.
- Thursday: 52 on astro-ph; 22 on CosmoCoffee. Hmm, wish I knew more about dwarf galaxies.
- Friday: 30 on astro-ph; 7 on CosmoCoffee (must be getting near Christmas). Glad I skimmed through astro-ph, as my filter settings excluded this fascinating article on the history of dark energy. Apparently Newton thought of it (or something like it) 320 years ago!
Conclusion: based on this week's experience, I'm likely to miss interesting and relevant papers if I use either astro-ph or CosmoCoffee ... so I'll use both! Start each day adagio on CosmoCoffee, accelerando poco a poco, then prestissimo through astro-ph.
10 Dec 2007
Last Friday was the RAS Young Astronomers Meeting up in Edinburgh. I presented a poster, A census of K-band galaxies from the UKIDSS Large Area Survey, which I've just put online on my (very short!) publications page.
9 Dec 2007
This is the first entry in the new Research Blog, reserved for posts of a tedious, technical or boring nature related to my research in astronomy. See www.anthonysmith.me.uk for (slightly) more exciting posts. None of the information in this post is of any interest.