/mrf

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

Primary LanguagePythonMIT LicenseMIT

MRF: Multi-Resolution Filtering

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

Documentation

Please read the documentation and tutorial at https://mrfiltering.readthedocs.io/en/latest/.

Applications

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

Examples

This example shows the tidal feature of NGC 5907, described in van Dokkum et al. (2019). The images presented there just 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! 🚀

MRF on NGC 5907

This example shows how powerful MRF is in extracting 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. (in prep). 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 mrf-task.py n5907_df_g.fits ngc5907_cfht_g.fits ngc5907_cfht_r.fits ngc5907-task.yaml --galcat='gal_cat_n5907.txt' --output='n5907_g'

Installation

mkdir <install dir>
cd <install dir>
git clone git@github.com:AstroJacobLi/mrf.git
cd mrf
python setup.py install

If you don't have git configured, you can also download the zip file directly from https://github.com/AstroJacobLi/mrf/archive/master.zip, then unzip it and install in the same way.

You need to export the path of mrf as an environment variable, so open ~/.bash_profile (or ~/.bashrc), and write export PYTHONPATH=$PYTHONPATH:"<install dir>" to it. Don't forget to validate it by . ~/.bash_profile.

Then import mrf in Python:

import mrf
print(mrf.__file__.rstrip('__init__.py') + 'iraf/macosx/') 
# It should be "<install dir>/mrf/mrf/iraf/macosx/"
# otherwise the environmental variable is not set correctly.

Python>=3 is needed, but you can try whether mrf still works under python2. Check out the dependence of mrf depends from requirements.txt.

TODO

  • Analyze color terms between Dragonfly, CFHT, DES, HSC, etc.

Acknowledgement

Many scripts and snippets are from kungpao (written by Song Huang and Jiaxuan Li). Johnny Greco kindly shared his idea of the code structure. Here we acknowledge them for their help!

Citation

If you use this code, please reference the doi below, and make sure to cite the dependencies as listed in requirements.

mrf is a free software made available under MIT License. For details see the LICENSE file.

Copyright 2019 Pieter van Dokkum and Jiaxuan Li.