Skip to main content

Multi-Resolution Filtering (MRF) is a method for isolating faint, extended emission in low-resolution images.

Project description

MRF: Multi-Resolution Filtering

Multi-Resolution Filtering: a method for isolating faint, extended emission in Dragonfly data and other low resolution images.


Please read the documentation and tutorial at


  • Subtract compact objects from low-resolution images (such as Dragonfly) to reveal low surface brightness features.
  • Characterize and subtract stellar halos in Dragonfly image.
  • Download corresponding high resolution image (HSC, CFHT) of given Dragonfly image.


This example shows the tidal feature of NGC 5907, described in van Dokkum et al. (2019). The images presented there used this algorithm. Full resolution Dragonfly images and MRF results can be found here. Check this notebook for more details in how to do MRF using this Python package! :rocket:

MRF on NGC 5907

This example shows how powerful MRF is in revealing low surface brightness features. The ultra-diffuse galaxy M101-DF3 is revealed by MRF after subtracting compact objects and bright star halos according to van Dokkum et al. (2019). Check this notebook for more details.

MRF on M101-DF3

You can also use this script to run the MRF task. Take NGC 5907 as an example:

python n5907_df_g.fits ngc5907_cfht_g.fits ngc5907_cfht_r.fits ngc5907-task.yaml --galcat='gal_cat_n5907.txt' --output='n5907_g'


mkdir <install dir>
cd <install dir>
git clone
cd mrf
python install

If you don't have git configured, you can also download the zip file directly from, then unzip it and install in the same way.

To test whether mrf is installed successfully, import mrf in Python:

import mrf, os
print(os.path.isfile(os.path.join(mrf.__path__[0], 'iraf/macosx/x_images.e')))

True means you have installed mrf successfully! Bravo!

If you need to use lanczos or cubic interpolation, you must have galsim installed. You will also need unagi to download HSC images. Python>=3 is needed, but you can try whether mrf still works under python2. Check out the dependence of mrf depends from requirements.txt.


mrf is a free software made available under the MIT License by Pieter van Dokkum (initial development) and Jiaxuan Li (implementation, maintenance, and documentation). If you use this package in your work, please cite van Dokkum et al. (2019).


Many scripts and snippets are from kungpao (written by Song Huang). Johnny Greco kindly shared his idea of the code structure. Roberto Abraham found the first few bugs of this package and provided useful solutions. Here we appreciate their help!

Copyright 2019 Pieter van Dokkum and Jiaxuan Li.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mrf, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size mrf-1.0.4-py3-none-any.whl (8.1 MB) File type Wheel Python version py3 Upload date Hashes View
Filename, size mrf-1.0.4.tar.gz (14.7 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page