Identify supernova-driven bubbles or general underdense regions in simulation snapshots or galaxy images using trained graph neural networks. The models can take either gas data or image intensity as input features. Currently validated on high-resolution Arepo galaxy simulations with spatial resolutions of 10, 30, and 100 pc, as well as JWST galaxy images in the F770W and F1130W bands.
This package implements the method described in the paper:
Coming soon.
| Model | Type | Input | Features |
|---|---|---|---|
aerate_3D |
3D | simulation snapshot | gas density & temperature |
aerate_3D_den |
3D | simulation snapshot | gas density |
aerate_3D_hot |
3D | simulation snapshot | gas density & temperature, hard negatives for T < 105.5 K |
aerate_2D_den |
2D | galaxy image | column density / intensity |
Coming soon.
git clone https://github.com/sytan177/froth.git
cd froth
pip install -e . - Python 3.9+
- numpy
- torch
- torch-geometric
- scikit-learn
- h5py
- numba
- joblib
- photutils
- torch-sparse
- torch-scatter
See examples/getting_started.ipynb for a practical walkthrough covering simulation snapshots and observational images.
from froth import SnapData, ImageData, SnapConfig, ImageConfig, BubbleClassifier, BubbleExtractor
# simulation snapshot
snap = SnapData(snapshot_data, config_file='config.yaml')
classifier = BubbleClassifier(model_name='aerate_3d')
classifier.aerate_snapshot(snap)
extractor = BubbleExtractor(snap)
extractor.knock_snapshot()
# observational image
image = ImageData('path_to_file.fits')
classifier = BubbleClassifier(model_name='aerate_2d_den')
classifier.aerate_image(image)
extractor = BubbleExtractor(image)
extractor.knock_image()We welcome bug fixes, new features and contributions testing the code on different simulation setups and codes. The 2D projected maps function is still in development. Simply fork the repository and send us a pull request with your changes. Tests would be much appreciated.