Skip to main content

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

Metadata

Release files for fink-tns 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fink-tns 1.0
File Size Uploaded
fink_tns-1.0.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fink-tns 1.0
File Interpreter ABI Platform
fink_tns-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.8 kB

Release files / fink_tns-1.0.tar.gz

Download URL fink_tns-1.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a303ee262e718b512dc667abf501f65187de454e08b436ffccdbb7bd798348ce
BLAKE2b-256 checksum
How to use checksums
d6686a220c37d3c7d9c8dca3fa830e76627444737d8a4ae5aed86c4f0f6216ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / fink_tns-1.0-py3-none-any.whl

Download URL fink_tns-1.0-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
099bf5a3689f1e6dad6071b506eaacf18b636179ef7eef5decffbf81c5e1434a
BLAKE2b-256 checksum
How to use checksums
b1bbe744f66768cc995069d64805b292b3ff80b5625258da0cf0662701d3d44e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

0.15

2 release files

0.14

2 release files

0.13

2 release files

0.12

2 release files

0.11

2 release files

0.10

2 release files

0.9

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page