User Tools

Site Tools


ansvr Developer Notes

ansvr is a wrapper around the plate solve command, solve-field. If your client program is on the same machine where is installed, you should consider invoking solve-field directly as that is simpler and more efficient than going through the ansvr HTTP interface.

Using solve-field directly

If you put your image to be solved ( 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/"

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.

Using the HTTP interface

If you do want to use the HTTP interface, here are some notes on the subset of the Web API implemented by ansvr.

login request

Client request: POST /api/login
Server response: JSON object: {“session”:“SESSION_ID”}

  subsequent requests from the client pass the session id

upload request

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:


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)

submissions request

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.


Keep posting the submissions request periodically until the job has completed.

job status request

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.


calibration request

Client: POST /api/jobs/<JOB_ID>/calibration
Server: solution data as a JSON object:



I have a perl module that works as an ansvr or 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 I am interested in hearing how ansvr is being used as this can help steer future development.

ansvrdevelopernotes.txt · Last modified: 2018/05/22 23:55 by andy