Astrometry API?

Questions, bug reports, requests for enhancements, etc.
Post Reply
sxcurry
Posts: 2
Joined: Wed Oct 27, 2021 7:14 pm

Astrometry API?

Post by sxcurry »

Hi, I just installed the Astrometry software on MacOS, and it runs really well - great product.

Is there a published API to talk to the local server on port 8080? It would be great if I could write a Python app to submit images for plate solving, along with setting constraints on pixel scale, etc.

Thanks, Sean
User avatar
Peter Polakovic
Posts: 2740
Joined: Thu Apr 21, 2016 9:38 am

Re: Astrometry API?

Post by Peter Polakovic »

Hi Sean,

it is not really documented, but the source code is available here:

https://github.com/indigo-astronomy/ast ... swift#L272

In short, you have to call /api/upload URL on the port 8080 with PUT method. Set the image as request body, set "Content-Disposition" and custom header fields like "ra_center", "dec_center", "radius", "downsample_factor", "parity", "cpulimit" and "depth". You will receive a JSON response in format like { status: "sucess" } or { status: "error", errormessage: "something" }.

To check the status you have to call /api/status URL with GET method. You will get JSON response in format like { status: "ready" }, { status: "busy" } or { status: "done", calibration: { ra: ..., dec: ..., orientation: ..., pixscale: ..., parity: ... }, message: ... }.

Alternatively, you can simply call astrometry.net executables in /Applications/Astrometry/Contents/MacOS if you prefer :)

Peter
sxcurry
Posts: 2
Joined: Wed Oct 27, 2021 7:14 pm

Re: Astrometry API?

Post by sxcurry »

Thanks Peter, this looks pretty straightforward. I'll give it a try.

Yours, Sean
Post Reply