[null, null, null, null, {"document_url": "http://kaira.sgo.fi/2014/05/using-median-filters-in-quicklook-plots.html", "unformatted_src": "http://www.sgo.fi/~djm45/kmd/kaira_label.png", "src": "http://www.sgo.fi/~djm45/kmd/kaira_label.png", "formatted_filename": "kaira label", "alt_text": "Status", "rendered_width": 200, "rendered_height": 20}, null, null, {"document_url": "http://kaira.sgo.fi/2014/05/using-median-filters-in-quicklook-plots.html", "unformatted_src": "http://www.sgo.fi/~j/kaira_ks.png", "src": "http://www.sgo.fi/~j/kaira_ks.png", "formatted_filename": "kaira ks", "rendered_width": 200}, null, {"document_url": "http://kaira.sgo.fi/2014/05/using-median-filters-in-quicklook-plots.html", "unformatted_src": "http://www.sgo.fi/~djm45/kmd/kaira_allsky_0.png", "src": "http://www.sgo.fi/~djm45/kmd/kaira_allsky_0.png", "formatted_filename": "kaira allsky", "alt_text": "All-sky image", "rendered_width": 250, "rendered_height": 250}, null, null, null, null]

Using median filters in quicklook plots

When we make our plots of spectrum vs. time, we often use a median filter to improve the contrast. The reason for the median filter is that the amplifiers have a certain spectral response associated with them. What you are interested in is the proportional variation of the signal with respect to what it would be if there was no signal.

You can do this by really careful bandpass calibration, but for "quicklook" plots, dividing by the median works and it is very quick. So that's what I use for these plots that I put on the web.

The Python code fragment looks like this:

Here, "data" is a 2D array with the axes being subband and time.

If you didn't use a median filter, you would expect to see a strong band at about subband 300 (approx. 55-60 MHz). This is due to the peak response of the amplifiers at that region (EXAMPLE). By using the median filter, you remove this bias.

Of course, you still need to be careful. The median filter relies on their being a stable background and more background than signal. In the first plot above, there is a slight negative band around 55-60 MHz, as there was probably a bit too much signal, thus skewing the data. For the purposes of seeing the features, it is not too much of a problem though.

The only way to really do this is with a full bandpass calibration but, as mentioned, for a quicklook the median filter gives you a good, easy, high-contrast plot.

Posted by Derek McKay at 06:46