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:
- Ensure all tests pass:
python -m unittest - Format code with black:
black -l 120 . - Sort imports with isort:
isort --profile=google .
For bug reports and feature requests, please open an issue.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d92892aa36457d8d03b4ea6f11e11a14d30035b90b2f4db5517d6e222fdfbdbe
|
|
| MD5 |
b0fbedfb7b41ee47e983df7ddde7bf1d
|
|
| BLAKE2b-256 |
88a69838adb4f0e15ce136e9753ff1ad31bd348db84a01f18451dad99d2eaae5
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d853b969b212f91f603edfe564d2e6f7836b80c019872f5756633946b18c120a
|
|
| MD5 |
a44dd105f62bdea986911de2b3982e9e
|
|
| BLAKE2b-256 |
a1de861ae24518ed91b43209c5a5dc7b7c584f44847b7fef0c0196bf92af6afb
|