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:
blackfor 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 clonethe repogit checkout -b my-new-feature- make changes
git add my-changesgit commit -m "my changes"git push origin my-new-feature- create a pull request on github
Metadata
Release files for snipergw 1.0.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 |
|---|---|---|---|---|
| snipergw-1.0.0.tar.gz | 134.4 kB | Without provenance | Details for snipergw-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| snipergw-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for snipergw-1.0.0-py3-none-any.whl |
Total release size: 147.7 kB
Release files / snipergw-1.0.0.tar.gz
| Download URL | snipergw-1.0.0.tar.gz |
|---|---|
| Size | 134.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12fd611f163aa26349cccc26d57a2b6302ce80cfa4181b1c48609adde13a6ef7
|
|
BLAKE2b-256 checksum How to use checksums |
2c298f51c5b4916b40dc8228e591de1bf0df89b04e712d54b01ea57a0539bd6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Release files / snipergw-1.0.0-py3-none-any.whl
| Download URL | snipergw-1.0.0-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd108ac40839a49beaab43aa119a8fa05db7db3c75474834600b244b55d578d4
|
|
BLAKE2b-256 checksum How to use checksums |
147b22915119e7a56569b9d9e112c6338030ab6c1651393c61541d39c12fe376
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Security for snipergw 1.0.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.