Skip to main content

Push Fink candidates to TNS.

Project description

pypi

Fink TNS

This repository hosts scripts to define a TNS bot to push extragalactic candidates from Fink to TNS. Usage:

# ZTF
$ python submit_from_ztf_api.py -h

# LSST
python submit_from_lsst_api.py -h

You need credentials to submit objects.

LSST submission example

Set up credentials

Create a folder credentials at the root of the repository:

mkdir credentials

Put you credentials inside:

ls credentials/
-rw-r--r-- 1 fink  56 Jun  2 09:36 tns_marker.txt
-rw-r--r-- 1 fink  41 Jun  2 09:35 tns_api.key

Build report and check

Specify the source ID, and some metadata, and run the script with the argument --dry-run:

#!/bin/bash

# LSST diaObjectId
OID="170296772058939493"

# Any remarks to be reported
REMARKS="Whatever is useful to say"

# Who is reporting, comma separated
REPORTER="YOUR NAMES, on behalf of the Fink Collaboration"

# 0 is Other, 1 is PSN, 2 is PNV, 3 is AGN, 4 is NUC, 6 is FRB
ATTYPE=1

# Path to credentials
OUTPATH="credentials"

python submit_from_lsst_api.py \
    -diaObjectId "$OID" \
    -remarks "$REMARKS" \
    -reporter "$REPORTER" \
    -attype "$ATTYPE" \
    -outpath "$OUTPATH" \
    --dry_run  # Only show the report without sending

You will get the report printed on screen:

{'at_report': {'0': {'ra': {'value': 150.43671674454322, 'error': 0.06033093561674197, 'units': 'arcsec'}, 'dec': ...

Inspect carefully the values. If you are happy with, validate this report using the sandbox option:

python submit_from_lsst_api.py \
    -diaObjectId "$OID" \
    -remarks "$REMARKS" \
    -reporter "$REPORTER" \
    -attype "$ATTYPE" \
    -outpath "$OUTPATH" \
    --sandbox  # Send to the sandbox

If you get:

{'id_code': 401, 'id_message': 'Unauthorized'}

You are likely using a wrong API key and/or marker. If all good, you should see:

{'id_code': 200, 'id_message': 'OK', 'data': {'report_id': 277675}}

Connect to the sandbox website to confirm your transient is there:

  1. go to https://sandbox.wis-tns.org, and connect
  2. submit your coordinates
  3. check your report appears at the bottom

Final submission

If all above is right (or if you are using a stable release of fink-tns), just submit your report:

python submit_from_lsst_api.py \
    -diaObjectId "$OID" \
    -remarks "$REMARKS" \
    -reporter "$REPORTER" \
    -attype "$ATTYPE" \
    -outpath "$OUTPATH"

Connect to the sandbox website to confirm your transient is there:

  1. go to https://wwww.wis-tns.org, and connect
  2. submit your coordinates
  3. check your report appears at the bottom

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fink_tns-0.15.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fink_tns-0.15-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file fink_tns-0.15.tar.gz.

File metadata

  • Download URL: fink_tns-0.15.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for fink_tns-0.15.tar.gz
Algorithm Hash digest
SHA256 6896d9f3dd82e60f7b0b78a4fddbfdb777035f628bb7fd45e12b7ca6e25ced27
MD5 468794bf302e04956917cb16ac8cc5a0
BLAKE2b-256 106986f223ace805360515dec51fb8bf842dcdb1564e63bbffc3937a544deba4

See more details on using hashes here.

File details

Details for the file fink_tns-0.15-py3-none-any.whl.

File metadata

  • Download URL: fink_tns-0.15-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for fink_tns-0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 2e411a90c5640b4a7b44f8a9743a516a19bdf95f4242f0e7968cf1f8796dc911
MD5 f8d36a28b301da4d56342d296ac19d24
BLAKE2b-256 e8ac556ace46d5a9a824057069f1b9c64cff18525d16c750599cb0424feb51bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page