Skip to main content

A library for analyzing data and simulations from the WFM coded mask instrument.

Project description

Bloodmoon

A Python library for analyzing data from the Wide Field Monitor (WFM) coded mask instrument. Bloodmoon provides tools for:

  • Image reconstruction
  • Source detection and parameter estimation
  • Detector effects modeling (vignetting, PSF)
  • Dual-camera source localization

⚠️ Note: Bloodmoon is under active development. APIs may change between versions.

Installation

PyPI

pip install bloodmoon

From Source

Installing from source is necessary when doing development work. The exact process depends on your platform but will generally require:

  • Git
  • Python 3.11 or later
  • pip
  • venv or conda (for environment management)

Using venv

# Clone repository
git clone https://github.com/peppedilillo/bloodmoon.git
cd bloodmoon

# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: .\venv\Scripts\activate

# Install package in editable mode with development dependencies
pip install -e ".[dev]"

Using Conda

# Clone repository
git clone https://github.com/peppedilillo/bloodmoon.git
cd bloodmoon

# Create and activate conda environment
conda create -n "bloodmoon" python=3.11
conda activate bloodmoon

# Install package in editable mode with development dependencies
pip install -e ".[dev]"

Quick Start

import bloodmoon as bm

# Load camera configuration
wfm = bm.codedmask("wfm_mask.fits")

# Load simulation data
filepaths = bm.simulation_files("simdir/")
sdl1a = bm.simulation(filepaths["cam1a"]["reconstructed"])
sdl1b = bm.simulation(filepaths["cam1b"]["reconstructed"])

# Create detector images
detector, bins = bm.count(wfm, sdl1a.data)

# Reconstruct sky image
sky = bm.decode(wfm, detector)

# Run iterative source detection
for sources, residuals in bm.iros(wfm, sdl1a, sdl1b, max_iterations=10):
    # Process detected sources...
    pass

For more take a look at our demo.

Development

Running Tests

Assuming you installed from sources, and your source living into bloodmon directory.

cd bloodmoon
python -m unittest

Contributing

Contributions are welcome! Before submitting a pull request:

  1. Ensure all tests pass: python -m unittest
  2. Format code with black: black -l 120 .
  3. Sort imports with isort: isort --profile=google .

For bug reports and feature requests, please open an issue.

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

bloodmoon-0.1.0.tar.gz (10.9 MB view details)

Uploaded Source

Built Distribution

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

bloodmoon-0.1.0-py3-none-any.whl (6.5 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bloodmoon-0.1.0.tar.gz
  • Upload date:
  • Size: 10.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for bloodmoon-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d92892aa36457d8d03b4ea6f11e11a14d30035b90b2f4db5517d6e222fdfbdbe
MD5 b0fbedfb7b41ee47e983df7ddde7bf1d
BLAKE2b-256 88a69838adb4f0e15ce136e9753ff1ad31bd348db84a01f18451dad99d2eaae5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bloodmoon-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for bloodmoon-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d853b969b212f91f603edfe564d2e6f7836b80c019872f5756633946b18c120a
MD5 a44dd105f62bdea986911de2b3982e9e
BLAKE2b-256 a1de861ae24518ed91b43209c5a5dc7b7c584f44847b7fef0c0196bf92af6afb

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