Metadata-Version: 2.1
Name: raw2fits
Version: 1.0.2
Summary: Convert raw images to fits
Home-page: https://github.com/jamiechang917/raw2fits
Author: Jamie Chang
Author-email: jamiechang917@gmail.com
License: MIT
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# raw2fits
A Python package to convert camera raw images to astronomical fits files.

## Installation
```bash
pip install raw2fits
```

## Usage

### To convert a raw image to a fits file.

```python
from raw2fits.image import Image
img = Image(path='path/to/raw/image', debayer_method="VNG")
img.save_fits(image_type="LIGHT", path='path/to/save/fits/image')
```
where `debayer_method` can be one of the following: "VNG", "Bilinear". We recommend using "VNG" for better results.

### Comparsion between different debayer methods
  
The following images are the result of converting a raw image to a fits file using different debayer methods.

|     Debayer Method      |                             Image                             |
| :---------------------: | :-----------------------------------------------------------: |
|      **Bilinear**       |   <img width=250px  src=tests/debayer_examples/full/BL.jpg>   |
|         **VNG**         |  <img width=250px  src=tests/debayer_examples/full/VNG.jpg>   |
| **VNG (by Pixinsight)** | <img width=250px  src=tests/debayer_examples/full/VNG_PI.jpg> |

---

|     Debayer Method      |                              Image                               |
| :---------------------: | :--------------------------------------------------------------: |
|      **Bilinear**       |   <img width=250px  src=tests/debayer_examples/cropped/BL.png>   |
|         **VNG**         |  <img width=250px  src=tests/debayer_examples/cropped/VNG.png>   |
| **VNG (by Pixinsight)** | <img width=250px  src=tests/debayer_examples/cropped/VNG_PI.png> |
---

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)

## Acknowledgements
This extraction of the bayer image is based on the [rawpy](https://github.com/letmaik/rawpy).

