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.
pip install bloodmoon
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)
# 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]"
# 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]"
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.
Assuming you installed from sources, and your source living into bloodmon
directory.
cd bloodmoon
python -m unittest
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.