Skip to main content

A Python package for simulating skylight polarization sensor recordings using advanced polarization models (including Pan, Berry, and Rayleigh). Designed for researchers and engineers, this tool enables the generation of synthetic datasets for biomimetic navigation, machine learning, computer vision, and atmospheric optics. Ideal for developing and testing bio-inspired sensors, building training data for AI models, and exploring applications in robotics, remote sensing, and environmental monitoring.

Project description

PySkyLumos

A Python package for simulating skylight polarization sensor recordings using advanced polarization models (including Pan, Berry, and Rayleigh). Designed for researchers and engineers, this tool enables the generation of synthetic datasets for biomimetic navigation, machine learning, computer vision, and atmospheric optics. Ideal for developing and testing bio-inspired sensors, building training data for AI models, and exploring applications in robotics, remote sensing, and environmental monitoring.

Quick start

Below is a minimal example that builds an Engine, generates a sky polarization field, and simulates a sensor measurement. Angles are in degrees unless otherwise stated, while AoP values are radians.

from astropy.time import Time
from astropy.coordinates import EarthLocation, SkyCoord, AltAz

from pyskylumos.engine import Engine
from pyskylumos.sensor import SlicingPattern

wire_grid_orientations_slicing = {
    0: SlicingPattern(start_row=0, start_column=0, step=2),
    45: SlicingPattern(start_row=0, start_column=1, step=2),
    90: SlicingPattern(start_row=1, start_column=0, step=2),
    135: SlicingPattern(start_row=1, start_column=1, step=2),
}

engine = Engine(
    sensor_pixel_size_square_micrometers=2.2,
    lens_conjugation_type="thin",
    number_pixels_vertical=64,
    number_pixels_horizontal=64,
    lens_focal_length_micrometers=3500,
    tolerance=0.0,
    extinction_ratio=0.99,
    pixel_saturation_ratio=0.9,
    adc_resolution=12,
    signal_to_noise_ratio=50,
    wire_grid_orientations_slicing=wire_grid_orientations_slicing,
)

azimuths, altitudes = engine.get_initial_azimuth_altitude(altitude_min_clip=0)
observation_location = EarthLocation(lat=53.4, lon=-2.96, height=50)

sky_parameters, names = engine.simulate_sky_polarization(
    sky_model="rayleigh",
    observation_location=observation_location,
    times=Time("2024-07-01T12:00:00"),
    cie_sky_type=4,
    altitudes=altitudes,
    azimuths=azimuths,
    # Optional: override the sun position (e.g., from an external ephemeris).
    # sun_position=SkyCoord(alt=45, az=120, unit="deg", frame=AltAz(obstime=Time("2024-07-01T12:00:00"), location=observation_location)),
)

sky = dict(zip(names, sky_parameters))
measurement = engine.simulate_measurement(
    degree_of_polarization=sky["degree of polarization"],
    angle_of_polarization=sky["angle of polarization"],
    radiance=sky["radiance"],
)

print(measurement["dop"].shape, measurement["aop"].shape)

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

pyskylumos-0.0.6.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyskylumos-0.0.6-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file pyskylumos-0.0.6.tar.gz.

File metadata

  • Download URL: pyskylumos-0.0.6.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for pyskylumos-0.0.6.tar.gz
Algorithm Hash digest
SHA256 5b8592effe3f64faf88094b6232971377e09da96fd074d648312792987a6ed26
MD5 94d0e80825febe6e7b86a5c638efcb3d
BLAKE2b-256 0a2172e106474ac7c815c939b7ac8c8f9321c623a3bf4dfae8ea9bd10c9b8e7d

See more details on using hashes here.

File details

Details for the file pyskylumos-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: pyskylumos-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for pyskylumos-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 68861a3899520100aa0c3f4801325ab646875dadd267ecb7a465b29df9990ff4
MD5 d0eff0f4e3e427b12fec1c58771b259b
BLAKE2b-256 93b12205a3ae794419bff17997fdb4bd9ab341ad576fd47c335af3472c395381

See more details on using hashes here.

Supported by

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