I am trying to use Astrometry.net automatically from within a Jupyter notebook. I am trying with the request/json and with astroquery.
With requests/json, I first login, as suggested on
http://astrometry.net/doc/net/api.htmlAfter that, I have simply tried to check that the session was available by doing:
import requests
import json
# Login
session = R.text.split('"')[-2]
# Request
data={'request-json': json.dumps({"session": f'"{session}"'})})
print(R.text)
But I am then getting back:
{"status": "error", "errormessage": "no session with key \"\"5es6xgobq02ooddqb5076dns58lz2uw6\"\""}
Same message if I try with the complete example with URL and other parameters on on
http://astrometry.net/doc/net/api.htmlWhat am I doing wrong here?
I am also trying astroquery.astrometry_net
I use my API key and a file with X, Y, and FLUX columns.
Here are my lines of code:
sources = Table.read(path + '/astrometrynet_'+str(cl)+'.xyls')
# Sort sources in ascending order
sources.sort('FLUX')
# Reverse to get descending order
sources.reverse()
image_width = int(max(sources['X']))
image_height = int(max(sources['Y']))
wcs_header = ast.solve_from_source_list(sources['X'], sources['Y'],
image_width, image_height,
center_dec=int(apt_coo.dec.value), center_ra=int(apt_coo.ra.value), radius=5,
scale_lower=1, scale_upper=10, scale_units='arcminwidth',
solve_timeout=300)
Where apt_coo is a SkyCoord of my target.
This prints Solving....... before stopping without any other message (definitely stopping before 300sec).
print(wcs_header) returns an empty dictionary
Does that mean it failed to solve or something else?