No project description provided
Project description
SniperGW
Simple Nodal Interface for Planning Electromagnetic Reconnaissance of Gravitational Waves (SniperGW)
snipergw
is a simple python package to glue together existing emgw tools.
Specifically it does three things:
- Downloads fits files, e.g via ligo-gracedb to download GW events, GRB events via web scraping, or from a URL
- Uses gwemopt to generate an observation schedule
- Actually submits these schedules to either ZTF or WINTER via APIs
Installation
We suggest using a conda environment to install snipergw
, with python>=3.10.
You can then install the package using pip
and poetry
:
git clone git@github.com:robertdstein/snipergw.git
cd snipergw
pip install -e .
pre-commit install
If you still have problems, try installing troublesome packages with conda
, and then do pip install -e .
instead of poetry install
.
Note for ARM-based macs: The installation of fiona
might fail if you do not have gdal installed. In that case, consider using a conda
and running conda install -c conda-forge gdal
before running pip install
.
If you want to generate movies, you also need to install ffmpeg
, which you can do via brew install ffmpeg
or conda install -c conda-forge ffmpeg
.
Usage
To use this functionality, you must first configure the connection details. This is instrument-specific.
ZTF
You need both an API token, and to know the address of the Kowalski host address. You can then set these as environment variables:
export KOWALSKI_API_TOKEN=...
WINTER
If you have not configured your winterapi user, you will be prompted for your winterapi user name and password. This only needs to be done once. You may also be prompted to allow use of keychain. If you do not have these details, contact the WINTER team to be issued with a set of credentials.
Then, in order to trigger a ToO, you need to select a program (e.g 2020A000). You can set the program name as an environment variable:
export WINTER_PROGRAM_NAME=2020A000
if you have not used the program before, you will also need to set the password:
export WINTER_PROGRAM_KEY=...
After setting the password once, you will not need to repeat this step.
The password is emailed to the PI of each WINTER program, and should be shared with you if you wish to trigger under that program.
Running sniper GW
To run sniper GW, you can do:
python -m snipergw -e EVENTNAME -t TELNAME
An example would be:
python -m snipergw -e S230529ay -t WINTER
Options
- No event: snipergw will download the latest event from the LIGO graceDB
- Event name: snipergw will download the event with the given name from the LIGO graceDB
- URL: snipergw will download the event from the given URL
- GRB: snipergw will download the latest GRB from the GCN circular page (Fermi-GBM)
- Skymap name: if a skymap with ".fit" in its name is saved to ~/Data/snipergw/sky_maps, snipergw will use this skymap instead of downloading a new one
Flags:
- -s: submit
- -d: delete
Code contribution guide
We use pre-commit
to enforce code style. Please install it and run it before committing your code.
We enforce the following code style:
black
for code formatting- isort for import sorting
the pre-commit
configuration is in .pre-commit-config.yaml
.
If your code does not meet the style requirements, the commit will fail but
the scripts will then be fixed automatically.
You just need to git add
the fixed files, and then commit again.
In general, we try and follow the 'PR' model of code development:
git clone
the repogit checkout -b my-new-feature
- make changes
git add my-changes
git commit -m "my changes"
git push origin my-new-feature
- create a pull request on github
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file snipergw-1.0.0.tar.gz
.
File metadata
- Download URL: snipergw-1.0.0.tar.gz
- Upload date:
- Size: 134.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12fd611f163aa26349cccc26d57a2b6302ce80cfa4181b1c48609adde13a6ef7 |
|
MD5 | 187ef25654da5c4f45f0c725c7361857 |
|
BLAKE2b-256 | 2c298f51c5b4916b40dc8228e591de1bf0df89b04e712d54b01ea57a0539bd6f |
File details
Details for the file snipergw-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: snipergw-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd108ac40839a49beaab43aa119a8fa05db7db3c75474834600b244b55d578d4 |
|
MD5 | 70bc305b4b511de404aa1fe17dd3c536 |
|
BLAKE2b-256 | 147b22915119e7a56569b9d9e112c6338030ab6c1651393c61541d39c12fe376 |