ansvr
is a wrapper around the astrometry.net plate solve command, solve-field
. If your client program is on the same machine where astrometry.net/ansvr is installed, you should consider invoking solve-field
directly as that is simpler and more efficient than going through the ansvr
HTTP interface.
If you put your image to be solved (stars.fit
in the following example) in the folder %LOCALAPPDATA%\cygwin_ansvr\tmp\
then you can run:
%LOCALAPPDATA%\cygwin_ansvr\bin\bash.exe --login -c "/usr/bin/solve-field -p -O -U none -B none -R none -M none -N none -C cancel --crpix-center -z 2 --objs 100 -u arcsecperpix -L 1.3752 -H 1.5199 /tmp/stars.fit"
Replace the numbers after -L
and -H
with your low and high image scale estimates (arcsec per pixel). The solution will be in the file stars.wcs
(FITS format). You can run solve-field --help
to see all the available options.
If you do want to use the HTTP interface, here are some notes on the subset of the nova.astrometry.net Web API implemented by ansvr.
Client request: POST /api/login
Server response: JSON object: {“session”:“SESSION_ID”}
subsequent requests from the client pass the session id
Client: POST /api/upload/
with Content-Type: multipart/form-data
The first part of the multipart/form-data request is the JSON request with the scale hint information. Example:
{"session":"SESSION_ID","allow_commercial_use":"d","allow_modifications":"d","publicly_visible":"y","scale_units":"arcsecperpix","scale_type":"ev","scale_est":1.2225129792992102,"scale_err":100.0}
scale_est
and scale_err
are the key parameters; other parameters are ignored (except session
). The image scale is expected to be between scale_est - scale_est*scale_err/100
and scale_est + scale_est*scale_err/100
The second part of the upload request is the image data (FITS file format)
Client: POST /api/submissions/<SESSION_ID>
Server: response is a JSON object containing a non-empty jobs
list attribute and non-zero processing_finished
numeric attribute when done, e.g.
{"jobs":["2"],"processing_started":"1","user":"0","user_images":[],"processing_finished":"1"}
Keep posting the submissions request periodically until the job has completed.
Client: POST /api/jobs/<JOB_ID>
using the job id from the /api/submissions
response
Server: response contains a JSON object with the status of the solve (success/failure), e.g.
{"status":"success"}
Client: POST /api/jobs/<JOB_ID>/calibration
Server: solution data as a JSON object:
{"epoch":"J2000","parity":1,"pixscale":1.432661730613,"radius":0,"ra":332.901073719,"orientation":84.4399787598054,"dec":12.8668742287}
I have a perl module that works as an ansvr or nova.astrometry.net client that is available if anyone is interested, but if you use the command line interface (solve-field
), then you won't need it. I'd be willing to develop other language bindings if there is any interest.
If you end up adding ansvr
to your application, please drop me an email at andy.galasso@gmail.com
. I am interested in hearing how ansvr
is being used as this can help steer future development.