not logged in  
login | register  

Docs:

Documentation
Web Services
FAQs
Downloads
Contact
References

Up

4.1 Database tables (old version)

Since you can query the spectrum database using SQL query, you should get familiar with the database structure. Our database server uses the T-SQL 92 standard query language, so joins and aggregate function can be used. Text fields are stored in two-byte unicode.

Note! If you use the WebService to return data in a VOTable format, you are allowed to use SELECT [column[, column ...]] format to specify the columns to return. When using the web form or the webservice, but you want the results in a SOAP object format, you always have to use SELECT * (star) instead of a column list.

We implemented a SQL preparser to allow using predefined constants in queries. These constants are detailed at the description of each column in parentheses. All of these constants are upper case!

4.1.1 Spectra table

This table contains spectrum header information

Column name

Data type

Description

ID

bigint (8)

Primary key of the Spectra table

Name

nvarchar (255)

Name of the spectrum

Description

ntext

Long description of the spectrum

UCD

nvarchar (255)

Universal Content Descriptor

Ra

float (8)

Right ascenation in J2000

Dec

float (8)

Declination in J2000

Cx

float (8)

 

Cy

float (8)

 

Cz

float (8)

 

HtmlID

bigint (8)

HTM id calculated from the coordinates

Synthetic

bit

 

Z

real (4)

Redshift of the object

ZError

real (4)

Absolute error of redshift of the object

ZStatus

smallint (2)

 

ZWarning

int (4)

 

ZConfidence

real (4)

 

Class

smallint (2)

Class of the object
0: Unknown (UNKNOWN)
1: Star (STAR)
2: Galaxy (GALAXY)
3: Qso (QSO)
4: Hiz_Qso (HIZ_QSO)
5: Sky (SKY)
6: Star_Late (STAR_LATE)
7: Gal_Em (GAL_EM)
101: Merger (MERGER)
102: BrightStarHalo (BRIGHTSTARHALO)

SurveyID

int (4)

ID of the survey from which the spectrum comes. Foreign key to the Surveys table.
1: SDSS DR1 (SDSS)
2: 2dF GRS (2DF) etc.

ObjectID

bigint (8)

ID of the object in the original survey catalog

DateMeasured

datetime (8)

Date of exposition

DateCreated

datetime (8)

Date of registration into the database

DateModified

datetime (8)

Date of last modification

WavelengthMin

float (8)

Minimum of the wavelength interval

WavelengthMax

float (8)

Maximum of the wavelength interval

WavelengthScale

int (4)

Wavelenght scale
0: Linear (LINEAR)
1: Logarithmic (LOGARITHMIC)
2: Other (OTHER)

ValueUnitID

int (4)

Unit of spectral data. Foreign key to the SpectrumValueUnits table
1: Jy (10e-17 erg/cm^2/s/A) - calibrated
2: counts - uncalibrated

Public

bit

 

UserFolder

int (4)

Indices on the Spectra table

Index name

Columns

Description

PK_Spectra

ID

Primary key, Unique

IX_Spectra_HtmID

HtmID

4.1.2 SpectrumKeys table

This table contains the spectra's custom key pairs. The SpectrumID column determines the corresponding row in the Spectra table and should be used for join queries. Since each value can be either numeric or textual, use the appropriate field when writing queries. The value type is recognized by the web service and stored in the NumValue or StringValue field, the other field is always NULL.

Column name

Data type

Description

SpectrumID

bigint (8)

Foreign key to the Spectra table

NumValue

float (8)

Numeric data

StringValue

nvarchar (50)

Textual data, or storing unit if NumValue is not null

Indices on the SpectrumPoints table

Index name

Columns

Description

FK_SpectrumKeys_Spectra

SpectrumID -> ID

Foreign key

4.1.3 SpectrumPoints table

This table contains the spectra's wavelength-value pairs. The SpectrumID column determines the corresponding row in the Spectra table and should be used for join queries. The unit of the values is determined by the ValueUnitID int the Spectra table. Since the database stores uncalibrated spectra too, be sure to use calibrated spectra only (ValueUnitID= 1, Jy) when calculating magnitudes.

Column name

Data type

Description

SpectrumID

bigint (8)

Foreign key to the Spectra table

Wavelength

real (4)

Wavelength in Angstroms

Value

real (4)

Spectrum value.
See notes above!

Error

real (4)

Error of value

Mask

int (4)

Gives extra information about the validity of value at the given wavelength, following the SDSS convetions.
*** more doc needed ***

Indices on the SpectrumPoints table

Index name

Columns

Description

FK_SpectrumPoints_Spectra

SpectrumID -> ID

Foreign key

2.4. SpectrumValueUnits table

The table contains the common spectrum value units.

Column name

Data type

Description

ID

int (4)

Primary key on the table

Text

nvarchar (50)

Written form of the unit

Calibrated

bit

Flag for calibrated values (can be used for magnitude calculation)

Indices on the SpectrumValueUnits table

Index name

Columns

Description

 

 

***

2.5. Surveys table

This table contains the name of different surveys from which we loaded spectral data. The table contains only surveys loaded at JHU, other users should use SurveyID = 0.

Column name

Data type

Description

ID

int (4)

Primary key on the table

Name

nvarchar (50)

Name of the survey