Skip to main content

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.

Metadata

Release files for bloodmoon 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bloodmoon 0.1.0
File Size Uploaded
bloodmoon-0.1.0.tar.gz 10.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for bloodmoon 0.1.0
File Interpreter ABI Platform
bloodmoon-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.4 MB

Release files / bloodmoon-0.1.0.tar.gz

Download URL bloodmoon-0.1.0.tar.gz
Size 10.9 MB
Tags Source
SHA-256 checksum
How to use checksums
d92892aa36457d8d03b4ea6f11e11a14d30035b90b2f4db5517d6e222fdfbdbe
BLAKE2b-256 checksum
How to use checksums
88a69838adb4f0e15ce136e9753ff1ad31bd348db84a01f18451dad99d2eaae5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.0

Release files / bloodmoon-0.1.0-py3-none-any.whl

Download URL bloodmoon-0.1.0-py3-none-any.whl
Size 6.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
d853b969b212f91f603edfe564d2e6f7836b80c019872f5756633946b18c120a
BLAKE2b-256 checksum
How to use checksums
a1de861ae24518ed91b43209c5a5dc7b7c584f44847b7fef0c0196bf92af6afb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page