Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Froth Logo

froth: Superbubble Identification with Graph Neural Networks


License: MIT Python 3.9+


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.


Currently Available Models

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

Installation

Install from PyPI

Coming soon.

Install from source:

git clone https://github.com/sytan177/froth.git
cd froth
pip install -e . 

Requirements

  • Python 3.9+

Core Dependencies

  • numpy
  • torch
  • torch-geometric
  • scikit-learn
  • h5py
  • numba
  • joblib

Optional - for galaxy image preprocessing

  • photutils
  • torch-sparse
  • torch-scatter

Quick Start

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()

Contributing

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.

About

Superbubble Identification with Graph Neural Networks

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages