https://github.com/psteinb/gw_simulator
https://github.com/psteinb/gw_simulator
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/psteinb/gw_simulator
- Owner: psteinb
- License: mit
- Created: 2025-02-06T11:07:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-11T16:09:58.000Z (about 1 year ago)
- Last Synced: 2025-04-11T16:25:06.232Z (about 1 year ago)
- Language: Jupyter Notebook
- Size: 229 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gravitational Wave Simulator
This package is meant to abstract the simulation of a gravitational wave event recorded by the LIGO experiment.
## Installation
Include the following in your `requirements.txt`:
```
https://github.com/psteinb/gw_simulator.git@master
```
or download and install the package:
``` bash
git clone https://github.com/psteinb/gw_simulator.git
cd gw_simulator
python -m pip install .
```
A pypi release is in the making.
## Usage
If you want to use the default simulator configs, do the following:
``` python
from gw_simulator.generate import run_sim
import torch
batchsize = 3
theta = torch.ones((batchsize, 2))
theta[..., 0] = torch.arange(1, batchsize+1)
theta[..., 1] = theta[..., 0]*10
masses, xs = run_sim(theta)
```
If you like to play with the simulator, you might want to do:
``` python
from gw_simulator.simulator.interface import GravitationalWaveBenchmarkSimulator as gws
import torch
batchsize = 3
theta = torch.ones((batchsize, 2))
theta[..., 0] = torch.arange(1, batchsize+1)
theta[..., 1] = theta[..., 0]*10
simulator = gws(path_to_config)
xs = simulator(theta)
```