Skip to main content

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


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)

Uploaded Source

Built Distribution

micropolarray-1.0.1-py3-none-any.whl (48.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page