ASTEROID_SERVER


Asteroid_server is  a program designed to help asteroid observers to check the objects they measure.   It provides several functions which can be accessed locally or over the Internet either by a text based interaction, similar to a telnet session, using a graphic interface or through standalone programs which do not require user intervention. The information is provided by the communication between the server and special programs -  clients.   It uses sockets for direct communication with arbitrary user programs.  Client programs can be written in any programming language which supports sockets.  The advantage of this approach is that the programs which require information about asteroids can be kept very short and the user does not need to be concerned about memory requirements, computer speed or database maintainance - as long the care for this is taken by the program administrator.

Asteroid_server uses the Lowell asteroid database which is continually updated with newly designated asteroids and is therefore useful for evaluation of current measurements.  Earth position is calculated using the series calculated by J. Chapront and G. Francou  from the Bureau des longitudes.  The series are derived by the frequency analysis of the JPL numerical integration DE403.

The asteroid_server is in development stage.  It is provided as a service for interested users to be accessed over the Internet.   Eventually it may be released in a source code form if enough people express interest.

The asteroid server used to be accessible for the outside users but due to very low demand this service is not offered anymore.
 

Client-server interface

Clients communicate with the server with ASCII strings containing commands recognized by the server.  Most of the commands are followed by some parameters.  Parameters are separated by white spaces.  Exception are two types of parameters: names and times.  Names which contain a space must be enclosed within quotation marks, such as "Crni Vrh" for the name of observatory or "1998 QU15" for an asteroid designation.   Time is typically in a format "YYYY MM DD hh:mm:ss".  Alternatively, it can be specified as a Julian Day using format jdnnnnnnn.nn.  Users who want to write their own programs,  must take care to end each command with a null character ('\0')!

Response from the server is in a form of one or more lines of text.  The format depends on the given command.  There are some special cases which should be handled by user programs which make some action depending on the server response.  In a case of error such as unrecognized command, wrong time specification, or insufficient number of arguments a response will be given in a form ERROR some text, where the text makes an explanation about the nature of the error.  Also, for some conditions which are not exactly errors, but may cause unexpected results for users, the server will repspond with WARNING some text.

After the client connects to the server, using the port 58972 and sends the user ID, the server sends an introductory line.  This line has to be accepted by the client to proceed with normal operation.  After that, server waits for commands, but only for 15 seconds.  If a timeout occurs, the server disconnects.  This is to prevent accumulation of processes on the server side.  So, for interactive programs which wait for user actions, it is necessary to connect for every single command and then to close the connection.  This is how programs asteroid_client and asteroid_client.py work.  In contrast to this, non interactive programs which are able to send commands continuosly can remain connected until they finish.
 

Available commands


 

help [command]

Help will display a list of commands or a description of a given command.  Use this to get familiar with the server.
 

set_observatory "name" longitude latitude altitude

To get accurate asteroid celestial coordinates, especially when it is near Earth,  its parallax can not be ignored and therefore geocentric coordinates are not sufficient.  You tell the program the location of your observatory using the set_observatory command.  Four parameters are accepted: name of the observatory, longitude, latitude and altitude.  The name can be any string up to 32 characters long.  When the name contains spaces, you should enclose it in quotation marks ("").  Longitude is given decimal degrees, east of Greenwich (Europe) is negative. Latitude is also given in decimal degrees, positive for north and negative for south of equator.  Altitude is measured from the sea level and is expressed in meters.

Example:

Asteroid>set_observatory "Crni Vrh" -14.074 45.947 730
OK

get_observatory

This command is used to check what values were written with the set_observatory command.

Example:

Asteroid>get_observatory
Observatory name=Crni Vrh
Longitude=-14.074000
Latitude=+45.947000
Altitude=730 meters

 

info

By sending info to the server user can find out some information about the current state of the program.

Example:

Asteroid>info
asteroid_server version 1.16
Author:  Jure Skvarc
Users: 5
Number of asteroids in database: 48841
Server uptime: 0 days, 0 hours 18 minutes 29 seconds
Requests processed since last restart: 10
All requests processed: 3836
Bytes sent since last restart: 1253
All bytes sent: 462882

check "time" ra dec distance magnitude

An observer who finds an asteroid on his image usually wants to check which asteroid is this.  Using some planetarium type of program which often also includes a rather large asteroid database or to subscribe to the Computer Service of the Minor Planet Center is the usual way to handle this problem.  Both approaches have a disadvantage of being rather slow because it is necessary to type coordinates and time into some type of form.  This problem is overcome by a combination of the asteroid_server and a suitable client program such as fitsblink  or  identify.py . By using one of these programs or a custom written program which makes use of the check command the task of identifying asteroids becomes very easy - only one click of a mouse or running a script which identifies all known asteroids imaged in one night.

The format of the arguments is the following:

Time has format "YYYY MM DD hh:mm:ss" or jdnnnnnnnn.nnnnnn,  where n's must be replaced by the Julian Day of the observation.   In interactive use (e.g.. using asteroid_client program) users will probably prefer the first type of format while in a batch mode it may be easier to use the Julian Day which will likely  be calculated at some point of the program.

Right ascension is given in hh:mm:ss.ss format.

Declination is given in dd:mm:ss.ss format.

Distance is expressed in arc minutes.  Most of the measured positions of known asteroids will be within 1 arc second from the calculated positions but giving the distance of 1 arc minute will allow identification even for times outside the epoch of validity of orbital elements while keeping a probability of having two asteroids inside this circle rather small.  Of course, if you want to list all asteroids within a wider circle, it is also possible.  The largest distance allowed is 5 degrees.

Magnitude simply sets the maximum magnitude of the asteroids which are listed as a result.

Output format has the following form:

number   name  RA DEC MAG DISTANCE

If the asteroid is not numbered, the number is 0.  If the asteroid is not named, its designation is given.  Right ascension and declination are in the same format as for input.  In contrast to input, distance is given in arc seconds, not arc minutes!  Please have this in mind.

Example:

List all asteroids with magnitude less than 17.5 which lie within one degree of the given coordinates.

Asteroid>check "1999 03 20 19:32:16" 8:22:39.54 20:45:22.2 60 17.5
  240 Vanadis            08:22:39.51 +20:45:23.1 13.3 1.00
 1187 Afra               08:23:21.49 +20:54:06.8 15.8 788.09

We see that asteroid Vanadis is only one arc second from the given position.

efemeride "minor planet" "start_time" step_size number_of_steps

To print out ephemeris for a given minor planet, use the command efemerideMinor planet can be specified by a number, name, or designation.  Quotation marks are needed only for designations because they include a white space.  Names and designations are not case sensitive.  Start time has the same format as for the check command.  Step size can be expressed in units of days, hours or minutes by appending a d, h or m unit, respectively, to the number.  The default unit is one day.  Number of steps can range from 1 to 200.  Any smaller number will be understood as 1 and any bigger number will be understood as 200.

In the first line there is an asteroid name.  Next lines contain the following information:

Date
Time
Julian Day
RA
DEC
MAG
Phase angle (degrees)
Elongation (degrees)
Distance from Sun  (astronomical units)
Distance from Earth (astronomical units)

Example:

Asteroid>efemeride "1999 cq14" "1999 02 20 0" 1d 3
Asteroid  1999 CQ14         
1999 02 20 00:00:00 2451229.500000 10:40:36.50 +04:48:29.7 17.22   4 170   2.241014   1.260016
1999 02 21 00:00:00 2451230.500000 10:39:51.91 +05:00:09.4 17.19   4 172   2.242260   1.259237
1999 02 22 00:00:00 2451231.500000 10:39:06.95 +05:11:54.2 17.16   3 173   2.243514   1.258728

fits time crval1 crval2 crpix1 crpix2 cdelt1 cdelt2 crot width height mag

This command is probably a rather rare bird.  It outputs celestial and image coordinates of all asteroids below a given magnitude for a given fits image characterized by WCS coordinates.  Parameters: Time  is always given as a Julian Day without the jd prefix.   Crval1, crval2, crpix1, crpix2, cdelt1, cdelt2 are the values of the WCS keywords with the same name, crot is a rotation angle taken from the crota1 or crota2 keyword. Width and height are the numbers of pixels of the image the horizontal and vertical direction, respectively.  These are also the values of the NAXIS1 and NAXIS2 keywords from the FITS file.  Finally, mag is the maximum magnitude of stars that should be reported.  The fits command is best used from a program which extracts the required values from a FITS header automatically.  For example, take a look at the listasteroids.pl and showasteroids.pl programs which make a use of the  fitsjd program which does the extraction of the required keyword values.  The output format is

Number Name RA DEC xcoor ycoor mag

Number is the asteroid number and is 0 if the asteroid is not numbered.
Name is the asteroid name or designation
RA is the right ascension
DEC is the declination
xcoor and ycoor are the image coordinates.  Note that they are 0 based, unlike the FITS indices which start at 1.
mag is the maximal magnitude of the asteroids listed.

Example:

  240  Vanadis            08:22:39.51 +20:45:23.1 1079.96  547.17 13.31
 1187  Afra               08:23:21.49 +20:54:06.8 1327.52  770.13 15.77

get_elements asteroid

Get asteroid orbital elements.  Asteroid can be specified by its name, number or designation.  Designation must be given inside "".  Order of the elements is:

major semi axis (AU)
eccentricity
inclination
argument of perihelion,
longitude of ascending node
mean anomaly at the epoch
epoch of osculation
equinox of orbital elements.
 

Example:

Asteroid>get_elements Chiron
Asteroid (2060) Chiron            
13.61535634 0.37950999 0.12114268 5.92124111 3.65459855 23.12401100
2451300.50000000 2451544.50000000

Client programs

A number of client programs is provided which make use of the asteroid_server.  Except for fitsblink, which has its own home page, they are given here in source as they can serve as an example of how to write simple client programs.  They  are written in three different programming languages: C, Python and Perl.  You can download all clients in their  source code .

1.  Asteroid_client is a C program which provides basic text communication with the asteroid server.  User types commands which are immediately executed on a remote server and results are displayed on the terminal screen.  This program uses readline library to let the user recall and modify previous commands.  It is useful mostly for testing the asteroid server and performing small number of queries.

2.  Asteroid_client.py is a Python program which is basically the same as the asteroid_client.  It provides a simple class which may be used in other user programs which communicate with the asteroid_server.

3.  Identify.py is a rather useful program, also written in Python.  It reads a file containing astrometric measurements of asteroids, connects to the asteroid_server and outputs measurements with properly written asteroid designations or numbers.  Any previous entry in the first column is discarded.  All lines which are less than 80 character long are simply copied to the standard output.  It is possible to provide a user defined prefix and number which are then used help to automatically create provisional designations for measurements which do not correspond to any known asteroids.  First measurement of a new asteroid is automatically marked with a discovery asterisk.

4.  Listasteroids.pl is a PERL program which reads header files of all FITS files specified in the command line and prints out a list all known asteroids on these images, together with their celestial and image coordinates and magnitude.  This programs calls a program named fitsjd which extracts the Julian Day of the time at the middle of exposure and WCS coordinates from given FITS file(s) and prints them to the standard output.

5.  Showasteroids.pl is a variant of the listasteroids.pl program.  In addition to listing of all asteroids in a given image it also shows their positions on a FITS image using the fitsblink program.  For this it has to prepare a special input file with instruction for fitsblink.  This file contains image name coordinates of the markers which denote asteroid positions.
 


jure@ing.iac.es Back to index