fritz-marshal / fritz

Astronomical data platform for the Zwicky Transient Facility.
https://fritz.science
Other
24 stars 34 forks source link

Automatic IAU source naming does not work in the archive endpoint #548

Closed DanielWarshofsky closed 5 months ago

DanielWarshofsky commented 7 months ago

Please fill out relevant sections below; remove those that are unused.

Describe the bug when posting to the https://fritz.science/api/archive endpoint without specifying an obj_id the error message Only letters, numbers, underscores, semicolons, colons, +, and - are allowed in source ID is returned. This is because when obj_id=None the radec_to_iau is used to create a name for the source but this will include a . in the name

To Reproduce Steps to reproduce the behavior: run

import json
import pathlib
import requests
import urllib
token = "My Token"
params={'catalog':'ZTF_sources_20240117',
            'light_curve_ids':[11534622048883],
            'group_ids':[1678],
            'ra':1,
            'dec':1}
url = urllib.parse.urljoin("https://fritz.science/", f'/api/archive')
headers = {'Authorization': f'token {token}'}
p = requests.post(url, headers=headers, json=params)
print(p.json()['message'])

Platform information:

DanielWarshofsky commented 5 months ago

This works now.