SIMBAD: Help page

Recent modifications (11-jan-2014):

%OBJECT can be used to display the requested identifier. For queries by coordinates,
the distance from the requested center can be display with %DIST.


In the script mode, you can perform any kind of queries defined in a script file and get the result in ascii format. You can either define your own format for displaying the data or get the result in a votable, specifying the data fields you are interested in.

The scripting language accepts commands described below. You can define several formats and use them to display data. Votable definitions can be specified and used for output.

1  A first example

Here is a first script which executes some identifier queries, and displays the result according to a specified format.


echo My first Simbad4 script
format object form1 "%IDLIST(1) : %COO(D)"
query id hd 1
query id hd 2
goto lab1
query id hd 3
query id hd 4
lab1:
# three last queries
query id hdx 997
query id hd 998
query id hd 999
format display

A few explanations:

The result comes as a pure ASCII data in the web page, with no embedded HTML, or can be directly received in a file.

Here is the output of the previous script:


::script::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

echo My first Simbad4 script
format object form1 "%IDLIST(1) : %COO(D)"
query id hd 1
query id hd 2
goto lab1
query id hd 3
query id hd 4
lab1:
# three last queries
query id hdx 997
query id hd 998
query id hd 999
format display

::console:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

C.D.S.  -  SIMBAD4 rel 0.97beta  -  2006.06.27CEST19:04:55
first Simbad4 script
object formats:
form1:	"%IDLIST(1) : %COO(D)"

simbatch done

::error:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Error: the identifier 'hdx 997' could not be recognized for catalogs:
hd: Henry Draper
h: catalogue H

::data::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

BD+67  1599 : +67 50 24.013
BD+56  3142 : +57 46 13.224
BD+02    18 : +03 28 10.946
BD-03    18 : -02 11 52.789


The output file is divided in four parts:

The section separator is designed to be easily parsed to separate the sections, especially the data part, which can be further ingested in some other application. For instance in VO enabled applications, if it consist of a VOTable output.

For instance, the following perl script extracts the data part of a result file:

#!/usr/bin/perl

while (<>) {
	if (/^::data::/) {
		$data = 1;
		next;
	}
	if ($data) {
		print;
	}
}

2  Another example

This second script makes a few queries by coordinates and displays specified fields in a VOTable:


votable vot1 {
	MAIN_ID
	RA(d)
	DEC(d)
	PMRA
	PMDEC
	ubv
}
votable open vot1
set radius 30m
12 30 +10 20
13 40 +11 21
15:00-10:10 radius=10m
votable close

This script first defines a VOTable output, by specifying the data fields to put in the VOTable (in the example, the main identifier, right ascension and declination in decimal format, proper motions and ubv measurements). Then the VOTable definition is opened, making it active. A radius is defined (30 arcmin) to override the default value (10 arcmin), and finally several coordinate queries are defined. The last one has its own radius value, used only for thist query.

One may notice that the coordinates are written alone on a line, without the command keywords query coo. Whereas one can always write complete commands, the script is able to recognize automatically several kind of queries by analyzing their data part. Namely:

fieldfull command command definition short command
identifiers query id identifier any identifier. In fact, the script takes as an identifier anything that it cannot recognize explicitely ngc 1400 1200
around ident query around identifier query around an identifier by prefixing it with a '∼' char ∼sirius
catalogue query cat acronym all objects from a catalogue rot
coordinates query coo ra dec the right ascension and declination can be written alone 12 30 +10 20
bibcode query bibcode bibcode query a bibcode 2005AA...430..165F

The output of this script is a votable, which can be ingested in any VO enabled application.

3  The simbad scripting commands detailed

The list of command can be splitted into several sections:

3.1  script control commands

3.2  data input control commands

3.3  data output control commands

3.4  query commands

These are the actual query commands. The asterisk before a query means that the command keyword query something can be ommited : the programme is able to guess which kind of data is submitted

4  Format definition

The scripting language has instructions to define the output format of data. Specific formats are applied for astronomical objects and references through the commands

format object [name] "format-string"
format reference [name] "format-string"

A format is immediately applied to the next commands when it is defined. The name allows to recall a previously defined format and making it active. If a script defines only one format, the name is not required.

The "format-string" contains a format definition similar to the C language format definitions. Its possibilities are described below.

A format string can be written on several lines as long as a line is ended by a '+' char (except the last line). Only the chars between double quotes participate to the format, allowing any kind of indentation. The first line must contain a first part of the format string.

Example:

format object f1 "%IDLIST(1) | "+
                 "%-27COO(A D) | "+
		 "%-15SP(S)"

4.1  the format-string specifications

A format-string consist of a mixture of text, including special characters like newline ('\n') and formatted data items represented by '%DATANAME' associated with several options and modifiers. The usage of modifiers differs somewhat from the C language ones.

Here are a few example, from very simple to more complicate:

4.2  options and modifiers for a format data item

The complete syntax for a format data item is:

%<+|-><#><0><n.m>FIELD-NAME<(options)><[list-sub-format]>

+ displays a positive sign if the field is a number "%+10.3PM(A)"
- left justify the displayed field "%IDLIST[%-20* %-20* %-20*\n]"
# displays the number of items if the field is a collection "number of ids: %4#IDLIST, number of refs: %6#BIBCODELIST\n"
0 left fill a number with zeros "number of ids: %04#IDLIST"
n represents, for any type of field, the total number of chars to reserve for its display "%30IDLIST(1)"
m represents the number of decimal positions to display if the field is a decimal number "coo: %12.8COO(d;A) %12.4COO(d;D)"
FIELD-NAME name of the field. The exhaustive list is described below. %COO %PMRA
options several fields have specific options that must be written after the field name between parenthesis. See the details below with the list of fields
"%COO(d;AD) - %COO(B)"
"%IDLIST(1)"
	  
list-sub-format When the field correspond to a collection, this allows to bypass the default display of the whole collecton. Each element in the collection is applied to a next format entry %* until the whole collection is done. If the collection is larger thant the number of %* items, the sub-format is reexecuted from the beginning as many times as needed to process the whole data collection.
"%IDLIST[%-30*  |  %-30*  | %-30*\n]"
"%BIBCODELIST[%*  %*  %*  %*\n]"
	

4.3  list of format items

4.3.1  Object types

4.3.2  Coordinates

Distance

4.3.3  Proper motion

4.3.4  Parallax

4.3.5  Radial velocity

4.3.6  Fluxes

4.3.7  Spectral type

4.3.8  Morphological type

4.3.9  Object dimensions

4.3.10  identifiers

To help you choosing a separator never contained in any identifier, here is the list of all special characters which may exist in identifiers. A good separator should be a special character not contained in this list:

=+-.,:!?*#/\'"[]()

4.3.11  Bibcodes

4.3.12  References

A reference is displayed in a reference format, created by:

4.3.13  Measurements

4.3.14  Notes

5  Field names for VOTable output

A VOTable output is defined by a list of field names. These names are defined below. Some of them allow or require a parameter written in parenthesis.

Object type         

 
otype          standard name of the object type
otype(opt)          object type. The option can be:
  • N : numerical display
  • S : standard name (max 6 chars)
  • 3 : short name (max 3 chars)
  • V : full description

Magnitude and Fluxes         

The parameter filtername must correspond to an existing filter.
Currently: B,V.
Coming soon: IR filters (R,I,J,K,L)
fluxdata(filtername)          all fields related with a particular filter.
flux(filtername)          value of the flux for the given filter
flux_name(filtername)          name of the filter
flux_unit(filtername)          flux unit (mag, jy, ...)
flux_system(filtername)          flux unit (mag, jy, ...)
flux_error(filtername)          error value of the flux measurement
flux_qual(filtername)          quality (A:best, E:worst) of the flux
flux_bibcode(filtername)          bibcode

Coordinates         

 
coordinates          all fields related with coordinates
coo(opt)          only ra and dec fields. The options have the following syntax: ({d|s};frame;epoch;equinox)
  • d : decimal display
  • s : sexagesimal display
  • frame : ICRS, FK5, FK4, GAL, SGAL, ECL
  • epoch : epoch (decimal value) for the coordinates display
  • equinox : equinox (decimal value) for the coordinates display
ra(opt)          right ascension. The options are the same as for coo above.
dec(opt)          declination. The options are the same as for coo above.
ra_prec          right ascension precision code (0:1/10deg, ..., 8: 1/1000 arcsec)
dec_prec          declination precision code (0:1/10deg, ..., 8: 1/1000 arcsec)
coo_err_maja          major axis of the error ellipse
coo_err_mina          minor axis of the error ellipse
coo_err_angle          angle of the error ellipse
coo_qual          quality (A:astrometric, .., E:unknown)
coo_wavelength          wavelength type of the measure (Radio, IR, Visible, UV, X, Gamma)
coo_bibcode          bibliographical reference

Proper motions         

 
propermotions          all fields related with the proper motions
pm          proper motion values in right ascension and declination
pmra          proper motion in right ascension
pmdec          proper motion in declination
pmra_prec          precision code (0:1/10deg, ..., 8: 1/1000 arcsec)
pmdec_prec          precision code (0:1/10deg, ..., 8: 1/1000 arcsec)
pm_err_maja          major axis of the error ellipse
pm_err_mina          minor axis of the error ellipse
pm_err_angle          angle of the error ellipse
pm_qual          quality (A:astrometric, .., E:unknown)
pm_bibcode          bibliographical reference

Parallaxes         

 
parallax          all fields related to parallaxes
plx          parallax value
plx_prec          precision code (0:1/10deg, ..., 8: 1/1000 arcsec)
plx_error          parallax error
plx_qual          parallax quality (A:astrometric, .., E:unknown)
plx_bibcode          bibliographical reference

Radial Velocity and redshift         

Fields beginning with rvz display the data as it is in the database.
Fields beginning with rv force the display as a radial velocity.
Fields beginning with z force the display as a redshift
velocity          all fields related with radial velocity and redshift
rvz_type          stored type of velocity: 'v'=radial velocity, 'z'=redshift
rv_value          Radial velocity value. Eventually translated from a redshift
z_value          Redshift value. Eventually translated from a radial velocity
rvz_radvel          stored value. Either a radial velocity, or a redshift, depending on the rvz_type field
rvz_error          Error. In the same unit as rvz_radvel
rvz_qual          Quality code (A: best, .., E: worst)
rvz_wavelength          wavelength type of the measure (Radio, IR, Visible, UV, X, Gamma)
rvz_bibcode          Bibliographical reference

Spectral type         

 
sptype          all fields related with the spectral type
sp          spectral type value
sp_qual          spectral type quality (A: best, .., E: worst)
sp_nature          spectral type nature ('s'pectroscopic, 'a'bsorbtion, 'e'mmission
sp_bibcode          Bibliographical reference

Morphological type         

 
morphtype          all fields related to the morphological type
mt          morphological type value
mt_qual          morphological type quality (A: best, .., E: worst)
mt_bibcode          Bibliographical reference

Extended object dimensions         

 
dimensions          all fields related to object dimensions
dim          main fields related to object dimensions: major and minor axis, angle and inclination
dim_majaxis          Major axis
dim_minaxis          Minor axis
dim_angle          angle of the object
dim_incl          inclination (unit of 15d: value from 0 to 6)
dim_qual          quality (A: best, .., E: worst)
dim_wavelength          wavelength type in which these dimensions were measured (Radio, IR, Visible, UV, X, Gamma)
dim_bibcode          Bibliographical reference

Identifiers         

 
main_id          main identifier of an astronomical object. It is the same as id(1)
ids          all identifiers of an astronomical object separated with a ipipe
id(opt)          an identifier. Options can be:
  • 1 : display the first (main identifier) of the object. Is the same as main_id
  • cat : display the identifier from the given catalog. If it doesn't exist, the field is left empty
  • cat1|cat2|...[|1] : display the identifier from the first catalog, or, if it doesn't exits the one from the second identifier and so on. If none is found, the field is left empty, except if |1 closes the list: then the first identifier is used.

Bibliography         

 
bibcodelist(y1-y2)          number of references. The parameter is optional and limit the count to the references between the years y1 and y2

Measurement catalogs         

For each measurement catalog, the VOTable contains all fields of the first measurement. When applicable, the first measurement is the mean one.
measurements          display all fields from all measurements (291 fields)

cel         

Celescope catalog of ultra-violet photometry

cl.g         

Cluster of Galaxies: Abell & Corwin,Astrophys. J. Suppl.,70,1 (1989)

diameter         

Stellar diameters, see 2001A&A...367..521P for an explanation of the coding of the methods of measurements.

distance         

Measure of distances by several means

einstein         

The Einstein Observatory Soft X-ray Source List

fe_h         

Stellar parameters (Teff, log(g) and [Fe/H]) taken from the literature.

gcrv         

General Catalogue of Radial Velocities

gen         

Geneva Photometric System Catalogue

gj         

Gliese Jahreiss Nearby Stars (Catalog of stars within 20 parsecs of the Sun)

hbet         

The Hbeta photometric system (Crawford and Mander,1966,Astron. J. 7,114)

hbet1         

The Hbeta photometric system (Crawford and Mander,1966,Astron. J. 7,114)

hgam         

Catalogue of equivalent width of Hgamma line from Petrie et al. (1973PDAO...14..151P)

iras         

InfraRed Astronomical Satellite Measurements extracted from the IRAS Point Source Catalog, 2nd Edition

irc         

Infra-red measurements by Neugebauer and Leighton, Caltech, NASA, 1969

iso         

Infrared Space Observatory (ISO) log

iue         

International Ultraviolet Explorer

jp11         

UBVRIJKLMNH Johnson s photometry

mk         

MK classifications in the Morgan-Keenan system and the Michigan Catalogues of Two-Dimensional Spectral Types for the HD stars (Houk N.,1975,and seq.)

orv         

oRV stellar radial velocities (will shortly replace the GCRV measurements.

mesplx         

Parallax measurements

mespm         

compilation of measurements of stellar proper motions (except SAO catalogue). These data are presently given at equinox and epoch 1950, in the FK4 system.

pos         

compilation of measurements of stellar positions (except SAO data)

posa         

Measurements of Position (since June 1998)

rot         

Stellar Rotational Velocities

rvel         

Radial velocities of galaxies

sao         

SAO catalogue (Star catalog of 258997 stars for the epoch and equinox 1950.0,1966)

td1         

UV fluxes from TD1 satellite,by Thompson et al.

ubv         

UBV data in Johnson's UBV system compiled by J.-Cl. Mermilliod from Institut d Astronomie de Lausanne (1973A&AS...71..413M)

uvby         

The Strömgren uvby photometric system

uvby1         

The Strömgren uvby photometric system

v*         

variable stars parameters extracted mainly from the General Catalog of Variable Stars by Kukarkin et al. USSR Academy of Sciences (3rd edition in 1969,and continuations)

xmm         

XMM log

z         

Redshift data for extragalactic sources

ze         

Redshift data for extragalactic sources (with error on redshift)


Simbad Help   ·   Top   ·   Previous   ·   Next
©UDS/CNRS  Contact: Question@simbad

2017.09.19-15:23:58

© UDS/CNRS

Contact