micropolarizer array data utilities
Project description
micropolarray
Python module for loading and using micropolarizer array and polarcam images.
Installation
Run the following command inside a terminal. If an error message about wheels appear, launch it again.
pip install git+https://github.com/Hevil33/micropolarray_master
You can run the test.py
script to verify the correct installation of the micopolarray package.
Usage
import micropolarray
import numpy as np
# Can initialize images from np arrays or fitsfilenames.
# If multiple filenames are used then the average is taken
micropolimage_from_file = micropolarray.MicroPolarizerArrayImage("test_data/image.fits.fits")
micropolimage_from_nparray = micropolarray.MicroPolarizerArrayImage(np.ones(shape=(30,30)))
image = micropolarray.MicroPolarizerArrayImage(image)
Multiple useful members can be used to get polarization parameters
angle_of_linear_polarization = image.AoLP.data # Get the angle of linear polarization
Stokes_I, Stokes_Q, Stokes_U = self.Stokes_vec # Get the stokes vector components as np.ndarray
pol_0_image = image.single_pol_subimages[image.angle_dic[0]]
demosaiced_image = image.demosaic()
binned_image = image.rebin(binning=4) # binned 4x4 image
If demodulation matrices are available, it is easy to get demodulated images
demodulator = ml.Demodulator(demodulation_tensor_path)
demo_image = image.demodulate(demodulator) # This image is now demodulated
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
micropolarray-1.0.1.tar.gz
(42.0 kB
view hashes)
Built Distribution
Close
Hashes for micropolarray-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f7485c3f3b00d29e3f6bf083414b4d8f935cd63eb85d5b7db121ce40e450feb |
|
MD5 | 6f37dd33c61740454e7d8a2239db0741 |
|
BLAKE2b-256 | b291db84a9d4021ff349b07cd64e16f2ac2ae25f93c10a63e936a9400566e5d2 |