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-1.0.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-1.0-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fink_tns-1.0.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-1.0.tar.gz
Algorithm Hash digest
SHA256 a303ee262e718b512dc667abf501f65187de454e08b436ffccdbb7bd798348ce
MD5 ce45bd47cb9292e4e1f661df132b1819
BLAKE2b-256 d6686a220c37d3c7d9c8dca3fa830e76627444737d8a4ae5aed86c4f0f6216ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fink_tns-1.0-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-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 099bf5a3689f1e6dad6071b506eaacf18b636179ef7eef5decffbf81c5e1434a
MD5 90ef0362f29728059eac95dd3e623bb4
BLAKE2b-256 b1bbe744f66768cc995069d64805b292b3ff80b5625258da0cf0662701d3d44e

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