Skip to main content

Simulate UVIT-like photon event lists from astrophysical source models

Project description

Simulit

Simulit is a Python package for simulating UVIT-like photon event lists from astrophysical source models.

It is designed for developing, testing, and validating software for source detection, photometry, variability analysis, PSF improvement, and other UVIT data analysis applications.

Current source models include:

  • Gaussian point sources
  • Elliptical exponential galaxies
  • Uniform circular sources

Simulit can also:

  • Generate detector images from simulated event lists
  • Create truth catalogues for validation and benchmarking
  • Inject simulated events into existing UVIT Level-2 event lists

Installation

pip install simulit

Quick start

import numpy as np
import simulit as sm

rng = np.random.default_rng(42)

observation = sm.Observation(
    exposure=2000,
)

centre = observation.detector.detector_size / 2

sources = sm.generate_sources(
    n_sources=100,
    rate=0.1,
    fwhm=1.2,
    x0=centre,
    y0=centre,
    radius=2048,
    rng=rng,
)

times, x, y = observation.simulate_events(
    sources,
    rng=rng,
)

truth = sm.create_truth_catalogue(sources)

sm.save_events_to_fits(times, x, y)
sm.save_truth_catalogue(truth)

sm.make_image_from_events(
    x,
    y,
    exposure=observation.exposure,
    detector_size=observation.detector.detector_size,
)

Source models

GaussianSource

A Gaussian point source.

sm.GaussianSource(
    rate=1.0,
    x=2400,
    y=2400,
    fwhm=1.2,
)

ExponentialGalaxy

An elliptical exponential galaxy with an exponential surface brightness profile.

sm.ExponentialGalaxy(
    rate=0.5,
    x=2400,
    y=2400,
    r0=3.0,
    q=0.7,
    pa=np.pi / 4,
)

UniformDisk

A uniformly illuminated circular source.

sm.UniformDisk(
    rate=5.0,
    x=2400,
    y=2400,
    radius=200,
)

Observation

An Observation combines

  • exposure time
  • detector configuration
  • optional pointing drift
observation = sm.Observation(
    exposure=2000,
)

A pointing drift model can also be supplied.

drift = sm.Drift(
    x_offset=x_shift,
    y_offset=y_shift,
)

observation = sm.Observation(
    exposure=2000,
    drift=drift,
)

Output products

Simulit can generate

  • simulated photon event lists
  • detector images
  • truth catalogues

It can also append simulated events to an existing UVIT Level-2 event list, enabling realistic testing of UVIT analysis software.

Examples

The examples/ directory contains complete working examples.

  • mixed_sources.py — mixed populations of point sources, galaxies, and diffuse background
  • synthetic_drift.py — simulate observations with synthetic UVIT-inspired pointing drift

Planned features

Future development is expected to include:

  • additional source models
  • realistic background models
  • cosmic ray simulations
  • detector artefacts
  • UVIT slitless spectroscopy
  • filter-dependent simulations
  • additional validation datasets

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

simulit-0.1.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

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

simulit-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file simulit-0.1.0.tar.gz.

File metadata

  • Download URL: simulit-0.1.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for simulit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c236e1997e98e9341b6f46fa9c5b778b8cc917bcd34c591f540c8626da4f3c7f
MD5 0952761e934511fee978049fd56b923c
BLAKE2b-256 efaaaa30b723bd399c6e310aa0d325a95ca17c230003d1b5c57862a55730f0a5

See more details on using hashes here.

File details

Details for the file simulit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: simulit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for simulit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f321c98a7d97f8f264489ef9df457bb37136cb38aa02650c93f2e2625015ecf
MD5 b0a51a8d9227618475e931ffe5ab30eb
BLAKE2b-256 99f2f8cce43a4cf50949a013d83f65aee6b966dd7e9a5df7a1dd43a4b4bcb20f

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