Metadata-Version: 2.1
Name: mrf
Version: 1.0.2
Summary: Multi-Resolution Filtering (MRF) is a method for isolating faint, extended emission in low-resolution images.
Home-page: https://github.com/AstroJacobLi/mrf
Author: Jiaxuan Li, Pieter van Dokkum
Author-email: jiaxuan_li@pku.edu.cn, pieter.vandokkum@yale.edu
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Requires-Python: >=2.7
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: astropy (>=3.0)
Requires-Dist: matplotlib (>=2.0)
Requires-Dist: sep
Requires-Dist: photutils
Requires-Dist: palettable
Requires-Dist: shapely
Requires-Dist: reproject (>=0.5.1)
Requires-Dist: tqdm
Requires-Dist: PyYAML
Requires-Dist: GalSim

# MRF: Multi-Resolution Filtering
Multi-Resolution Filtering: a method for isolating faint, extended emission in [Dragonfly](http://dragonflytelescope.org) data and other low resolution images.

<p align="center">
  <img src="https://github.com/AstroJacobLi/mrf/blob/master/df-logo.png" width="40%">
</p>

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)](https://ui.adsabs.harvard.edu/abs/2019arXiv190611260V/abstract). The images presented there just used this algorithm. Full resolution Dragonfly images and MRF results can be found [here](https://www.pietervandokkum.com/ngc5907). Check [this notebook](https://github.com/AstroJacobLi/mrf/blob/master/examples/mrfTask-n5907.ipynb) for more details in how to do MRF using this Python package! :rocket: 

![MRF on NGC 5907](https://github.com/AstroJacobLi/mrf/raw/master/examples/n5907-demo.png)

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)](https://www.pietervandokkum.com). Check [this notebook](https://github.com/AstroJacobLi/mrf/blob/master/examples/mrfTask-m101df3.ipynb) for more details.

![MRF on M101-DF3](https://github.com/AstroJacobLi/mrf/raw/master/examples/m101-df3-demo.png)

You can also use [this script](https://github.com/AstroJacobLi/mrf/blob/master/examples/mrf-task.py) to run the MRF task. Take NGC 5907 as an example:

```bash
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
------------

```bash
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. 

To test if `mrf` is installed successfully, import `mrf` in Python:

```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!

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

Acknowledgement
---------------
Many scripts and snippets are from [`kungpao`](https://github.com/dr-guangtou/kungpao) (written by [Song Huang](http://dr-guangtou.github.io) and [Jiaxuan Li](http://astrojacobli.github.io)). [Johnny Greco](http://johnnygreco.github.io) kindly shared his idea of the code structure. [Roberto Abraham](http://www.astro.utoronto.ca/~abraham/Web/Welcome.html) found the first few bugs of this package and provided useful solutions. Here we appreciate their help!

Citation
-------
If you use this code, please reference the `doi` below, and make sure to cite the dependencies as listed in [requirements](https://github.com/AstroJacobLi/mrf/blob/master/requirements.txt). 

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

Copyright 2019 [Jiaxuan Li](http://astrojacobli.github.io) and [Pieter van Dokkum](http://pietervandokkum.com). 

