Metadata-Version: 2.1
Name: micropolarray
Version: 1.2.1
Summary: micropolarizer array data utilities
Home-page: https://github.com/Hevil33/micropolarray_master
Author: Hervé Haudemand
Author-email: Herve Haudemand <herve.haudemand@inaf.it>
License: BSD 3-Clause License
        
        Copyright (c) 2023, Hevil33
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: Homepage, https://github.com/Hevil33/micropolarray_master
Project-URL: Source code, https://github.com/Hevil33/micropolarray_master
Project-URL: Documentation, https://micropolarray.readthedocs.io/en/latest/
Keywords: micropolarizer,polarcam,polarization,astronomy
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy<1.24.0
Requires-Dist: pandas
Requires-Dist: numba
Requires-Dist: dataclasses
Requires-Dist: astropy
Requires-Dist: matplotlib
Requires-Dist: scipy
Requires-Dist: wheel
Requires-Dist: tqdm
Requires-Dist: pytest
Requires-Dist: sphinx-rtd-theme
Requires-Dist: opencv-python-headless
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: bumpver; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: pip-tools; extra == "dev"

# micropolarray

Python open-source module for loading and using micropolarizer array and PolarCam images.


## Installation 

Run one of the following commands in your terminal:

```
pip install micropolarray
```

OR

```
pip install git+https://github.com/Hevil33/micropolarray_master
```

If an error message about wheels appear, launch it again.
You can run the `test.py` script to verify the correct installation of the micopolarray package.

## Features

- Automatic polarization calculation
- Fast and optimized operations on the micropolarizer array
- Basic image cleaning (dark/flat subtraction)


## Documentation

Get the simple [jupyter tutorial](https://github.com/Hevil33/micropolarray_master/blob/main/TUTORIAL.ipynb) for a brief introduction.

Documentation is hosted at ReadTheDocs and can be found [HERE](https://micropolarray.readthedocs.io/en/latest/) (html format).



## Usage

```
import micropolarray as ml
```

The main class is `MicropolImage()`, which can be initialized from

1. A `numpy` 2D array 
2. A list of .fits filenames
3. Another `MicropolImage()`


Some useful member functions are :

MicropolImage()
- .show()
- .show_with_pol_params()
- .rebin()
- .demosaic()

Information on polarization is automatically calculated and stored in the class members as `numpy` arrays

MicropolImage()
- .data
- single_pol_subimages
- .Stokes_vec
- .I.data
- .Q.data
- .U.data
- pB.data (polarized brightness)
- AoLP.data (angle of linear polarization)
- DoLP.data (degree of linear polarization)


## Additional modules

micropolarray:

- .processing
  - .congrid (_experimental_) : fast congrid operations
  - .convert : raw (binary) files to fits conversion
  - .new_demodulation : image demodulation and demodulation tensor calculation
  - .demosaic : fast image demosaicing
  - .nrgf : occulter finding and roi selection, nrgf filter
  - .rebin : fast image binning
  - .shift : image shifting
- .cameras (_experimental_) : classes for sensor informations
- .image : general image handling
- .utils 
