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.
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bloodmoon-0.1.0.tar.gz | 10.9 MB | Without provenance | Details for bloodmoon-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bloodmoon-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for bloodmoon-0.1.0-py3-none-any.whl |
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
|
Security for bloodmoon 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.