not logged in  
login | register  

Filter Profile module

Using this website and web service, you can search and manage profiles of filters used for astronomical purposes. Version 1.0 allows you to post your own profiles (after registration) and search the profiles in the database by several criteria.

  1. WebService functions
    1. The WebServiceId (UserGUID)
    2. Data structures
    3. Admin service functions
    4. Search service functions
    5. Utility service functions
  2. Database schema
    1. Filters table
    2. FilterResponses table
    3. Database functions
    4. Sample SQL queries
  3. Revision history

1. WebService functions

The filter profile webservices use the SOAP standard to communicate with the clients. Some of the functions can be called via HTTP POST and HTTP GET as well. We provide several versions of each function to access our database in your favourite format. We support standard SOAP format, VOTable and ASCII.

To learn more about WebServices, visit the following sites: http://msdn.microsoft.com/webservices/ or http://java.sun.com/webservices/ Web service clients and VOTable parsers are also available in Perl, Python etc.

Search service:

search.asmx

WSDL:

search.asmx?WSDL

Admin service:

admin.asmx

WSDL:

admin.asmx?WSDL

Utility service:

util.asmx

WSDL:

util.asmx?WSDL

1.1. The WebServiceId (UserGUID)

Since every registered user of our system can post his/her filter profiles to the database, it is important to identify them not only with login name and password while using the web site, but somehow when accessing the administrative function via webservices. WebServiceId (named UserGUID in the functions) is a unique 64bit integer, which is used for this identification purpose. You can get your WebServiceId instantly after registration.

You can post new filter only with your WebServiceId, and you can modify or delete only those filter which were posted by you.

1.2. Data structures

Each filter profile consists of a header and an array of wavelength-response pairs.

1.2.1. Filter SOAP object

Implements the filter profile's header

Member name

Data type

Description

Id

int (4)

Database primary key of the filter. Set to 0, when you want to create a new filter, anyway set to the appropriate Id

Name

string

Name of the filter

Description

string

Long description of the filter

Ucd

string

Universal Content Descriptor

Version

string

Version number of the filter

DateCreated

datetime

Date of registration into the database, read-only

DateModified

datetime

Date of the last modification, read-only

WavelengthMin

double (8)

Minimum of the wavelength interval, read-only, calculated by the service

WavelengthMax

double (8)

Maximum of the wavelength interval, read-only, calculated by the service

WavelengthEff

double (8)

Effective wavelength (weighted average), read-only, calculated by the service

WavelengthScale

enum

Wavelenght scale
0: Linear
1: Logarithmic
2: Other

EffectiveWidth

double (8)

Effective width of the filter in Angtroms

Unit

string

Unit of response values

Responses

array

An array of Response object to store wavelength-response pairs

1.2.2. Response SOAP object

Member name

Data type

Description

FilterId

int (4)

The ID of the filter which this Response object belongs to.

Wavelength

double (8)

The wavelength in Angstroms

Value

double (8)

The response value associated with the wavelength

Note! Filter response values may be uncalibrated, or normalized to 1 or 100%.

1.2.3. FilterGraphParameters object

This object is used with the plot function. Initialize all values before calling the function. Set numeric values to -1 to use default.

Member name

Data type

Description

width

int (4)

Width of the image in pixels

height

int (4)

Height of the image in pixels

wavelengthMin

float (4)

Minimum value on the x-axis

wavelengthMax

float (4)

Maximum value on the x-axis

valueMin

float (4)

Minimum value on the y-axis

valueMax

float (4)

Maximum value on the y-axis

wavelengthLogBase

float (4)

Log base on the x-axis

valueLogBase

float (4)

Log base on the y-axis

titles

bool

Displays title on the graph if true

normalize

bool

Normalizes filter to 1 at peak if true

autoLoad

bool

If true, the service loads filters automatically when a valid FilterID is set.

1.3. Admin service function

Filter Profile Admin Service functions are for registered users and the functions can be accessed only with a WebServiceId recieved at registration.

Functions

Function name

Parameters

Description

CreateFilter

Records a new filter header to the database

 

string UserGUID

Your WebServiceId

 

string name

Name of the filter

 

string description

Long description of the filter

 

string ucd

Universal Content Descriptor

 

string version

Version number of the filter

 

enum wavelengthScale

Linear = 0 or Logarithmic = 1 or Other = 2

 

return value int

Returns the database ID of the new filter

CreateFilterIndirect

Records a new filter header to the database, but accepts a standard SOAP Filter object as an input parameter. Can be used from SOAP client only. Also records the FilterResponse objects in one step.

 

object filter

Filter to record to the database

 

return value int

Returns the database ID of the new filter

ModifyFilter

Modifies an existing filter header

 

int filterId

ID of the filter to modify

 

string UserGUID

Your WebServiceId

 

string name

Name of the filter

 

string description

Long description of the filter

 

string ucd

Universal Content Descriptor

 

string version

Version number of the filter

 

enum wavelengthScale

Linear = 0 or Logarithmic = 1 or Other = 2

 

return value bool

Returns true when the filter modified successfully, otherwise false

ModifyFilterIndirect

Modifies an existing filter header record.
Note! Since a SOAP filter object can contain filter responses, and those can be sent to this method too, you should know that this function does not modify the wavelength-response pairs, only the header info. To modify responses, delete them first using the DeleteFilterResponses method, and insert the new responses with AppenFilterResponseIndirect.

 

string UserGUID

Your WebServiceId

 

object filter

The filter to modify with the new data in a SOAP object. The object's FilterId must be specified.

 

return value bool

Returns true when the filter modified successfully, otherwise false

DeleteFilter

Deletes a filter from the database by it's ID

 

string UserGUID

Your WebServiceId

 

int id

ID of the filter to delete

 

return value bool

Returns true when the filter deleted successfully, otherwise false

DeleteFilterIndirect

Deletes a filter from the database by it's ID. Accepts Filter SOAP object as input.

 

string UserGUID

Your WebServiceId

 

object filter

The filter to delete in the form of a SOAP object. The object's FilterId must be specified.

 

return value bool

Returns true when the filter deleted successfully, otherwise false

AppendFilterResponse

Appends a wavelength-response pair to a filter specified by its Id

 

string UserGUID

Your WebServiceId

 

int filterId

Id of the filter to attach the new wavelength-response pair

 

double wavelength

Wavelength in Angstroms

 

double response

Response value

 

return value bool

Returns true when the new wavelength-response pair appended successfully, otherwise false

AppendFilterResponseIndirect

Appends an array of wavelength-response pairs to a filter specified by its Id

 

string UserGUID

Your WebServiceId

 

int filterId

Id of the filter to attach the new wavelength-response pair

 

array responses

An array of wavelength-response pairs in the form of a SOAP array.

 

return value bool

Returns true when the new wavelength-response pairs appended successfully, otherwise false

DeleteFilterResponses

Deletes all wavelength-response pairs associated with the filter

 

string UserGUID

Your WebServiceId

 

int filterId

Id of the filter which wavelength-response pairs should be deleted

 

return value bool

Returns true when the responses deleted succesfully, otherwise false

1.4 Filter Profile Search service functions

The Filter Profiles Search service functions provide functionality to query the filter database. They can return data in different standard formats: SOAP XML, plain ascii and the NVO standard VOTable.

Functions

Function name

Parameters

Description

GetFilter
GetFilterAscii
GetFilterVOTable

Returns a Filter profile in different formats. The function can return the header only, or the response values too.

int id

Id of the filter to return

bool returnResponses

If true, function returns response values too

return value object

The filter in a SOAP XML object, VOTable or an ascii string

GetAllFilters

Returns an array of all filters in the database

bool returnResponses

If true, function returns response values too

return value array

The array of filters

GetAllFiltersVOTable

Returns all filter headers from the database in a VOTable

return value VOTable

VOTable containing the filter headers

FindFiltersByKeyword

Performs a LIKE query on the filters table and returns results as an array of filters. The search is performed on the following columns of the Filters table: Name, Description, UCD, Version

bool returnResponses

If true, function returns response values too

return value array

The array of filters matching the criterium

FindFiltersByKeywordVOTable

Acts like the previous function except that it returns VOTable and cannot return response values

return value VOTable

The VOTable containing the filter headers matching the criterium

FindFiltersAdvanced

Returns filters matching the advanced criteria. The different search conditions are connected with AND. Specify zero string ("") to omit conditions with string data type, and -1 for numeric data types.

string keyword

LIKE query in the following columns of the Filters table: Name, Description, UCD, Version.

string name

LIKE query on the Name column.

string description

LIKE query on the Description column.

string ucd

LIKE query on the UCD column.

string version

LIKE query on the Version column.

string dateCreatedFrom

If specified, the column must be greater than this value.

string dateCreatedTo

If specified, the column must be less than this value.

string dateModifiedFrom

If specified, the column must be greater than this value.

string dateModifiedTo

If specified, the column must be less than this value.

double wavelengthMinFrom

If specified, the column must be greater than this value.

double wavelengthMinTo

If specified, the column must be less than this value.

double wavelengthMaxFrom

If specified, the column must be greater than this value.

double wavelengthMaxTo

If specified, the column must be less than this value.

double wavelengthEffFrom

If specified, the column must be greater than this value.

double wavelengthEffTo

If specified, the column must be less than this value.

double effectiveWidthFrom

If specified, the column must be greater than this value.

double effectiveWidthTo

If specified, the column must be less than this value.

enum wavelengthScale

Linear = 0 or Logarithmic = 1 or Other = 2 or Any = -1
Specify Any to omit this criterium

bool returnResponses

If true, function returns response values too

return value array

Array of filters matching the criteria

FindFiltersAdvancedVOTable

Function and parameters are the same as the previous, except that this function returns results in a VOTable format and does not return response values

return value VOTable

The VOTable containing the filter headers matching the criteria

FindFiltersAdvancedIndirect

Function works exacly as FindFiltersAdvanced, except it uses a structure as an input instead of the numerous parameters

struct par

Structure of parameters as described above

bool returnResponses

If true, function returns response values too

return value array

Array of filters matching the criteria

FindFiltersBySqlQuery

Function returns filter profiles matching the specified SQL query. To get more information on valid queries, see the database structure section of this documentation.

string sql

A SQL SELECT, WHERE and ORDER BY clause to run on the Filters table.

bool returnResponses

If true, function returns response values too

return value array

Array of filters matching the criteria

FindFiltersBySqlQueryVOTable

The same function as the previous, except that this one returns filter headers in a VOTable. Does not return response values.

string sql

A SQL SELECT, WHERE and ORDER BY clause to run on the Filters table.

return value VOTable

The VOTable containing the filter headers matching the criteria

1.5 Filter Profile Utilities service function

The Filter Profile Utility webservice functions provide functionality to perform basic operations on filter profiles. Most of these functions can be called from a SOAP client only and does not support the VOTable data format.

Functions

Function name

Parameters

Description

ResampleFilter

Resamples the filter to a different wavelength interval and scale. The function uses linear interpolation at the unknown wavelength values and assumes 0 outside the measured interval. This operation is required before convolving with spectra.

The formula to determine new wavelength values:

Linear resampling: wavelength = start + i * inc
Logarithmic resampling: 10^(start + i * inc)

where i goes from 0 to points - 1

 

object filter

The filter object with filled Responses array

 

enum scale

Linear = 0 or Logarithmic = 1, determines the new scale of the wavelength axis

 

double start

The new minimum wavelength in the resampled filter.

 

double inc

Incrementum of the resampled filter, used in the formula above

 

int points

Number of points to resample to

 

return value object

Returns the resampled filter

NormalizeFilter

Normalizes filter response curve.

 

object filter

The filter object with filled Responses array

 

return value object

Returns the normalized filter

PlotFilterGraph

Generates a graph with the filter profile curves on it. The parameters should be passed in a FilterGraphParameters object. It is not nessesary to be the filters in the database, you can plot your own curves too. However, if you want to plot filters that are already in the database, it's enough to post a filter header with the FilterID field specified and the Points array empty, the service will recognize them and load from the database automatically.

 

array filters

An array of filter objects to plot.

 

struct par

A FilterGraphParameters structure with the parameters of the graph.

 

return value
bytes

A binary array containing the graph in GIF format. Save it to a file or send to the user interface from your service client application.

2. Database schema

Since you can query the filter 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, otherwise you will get an error.

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 these constants are upper case!

2.1. Filters table

This table contains filter header information

Column name

Data type

Description

ID

int (4)

Primary key of the Filters table

Name

nvarchar (255)

Name of the filter

Description

ntext

Long description of the filter

UCD

nvarchar (255)

Universal Content Descriptor

Version

nvarchar (15)

Version of the filter

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

WavelengthEff

float (8)

Effective wavelength (weighted average)

WavelengthScale

int (4)

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

EffectiveWidth

float (8)

Effective width of the filter in Angstroms

Unit

nvarchar (15)

Unit of response values

Indices on the Filters table

Index name

Columns

Description

PK_Filters

ID

Primary key, Unique

2.2. FilterResponses table

This table contains filter responses. The FilterID column determines the corresponding row in the Filters table and should be use for join queries..

Column name

Data type

Description

FilterID

int (4)

Foreign key to the Filters table

Wavelength

float (8)

Wavelength in Angstroms

Value

float (8)

Response value.
(Some filters are stored normalized, some in absolute values or percent, flux calculation eliminates this factor.)

Indices on the FilterResponses table

Index name

Columns

Description

FK_FilterResponses_Filters

FilterID -> ID

Foreign key

2.3. Database functions that can be used for advanced queries

Function name

Description

GetFilterResponsePeak_Value(@FilterID int)

Returns the peak throughtput value of the filter

GetFilterResponsePeak_Wavelength(@FilterID int)

Returns the maximum throughtput wavelength of the specified filter

GetFilterResponseValue_Interpolate (@FilterID int, @Wavelength float)

Returns the filter response value at any wavelength using linear interpolation

GetFilterWavelengthEff (@FilterID int)

Returns the filter's effective wavelength. Function performs a weighted average calculation on FilterResponses belonging to the filter instead of returning the value stored in the Filters table.

2.4. Sample SQL queries

The following samples illustrate how to use the SQL query interface. You can execute each query by clicking on the execute link.

T-SQL command

Description

 

SELECT * FROM Filters WHERE WavelengthEff BETWEEN 3000 AND 5000

Returns all filters in the optical interval

execute

SELECT * FROM Filters WHERE GetFilterResponseValue_Interpolate(ID, 3647.35) > 0.5

Returns the filters where the response at 3647.35 Angstroms is more than 0.5

execute

SELECT * FROM Filters ORDER BY Name

Returns filter headers in alpahbetical order by their Name column

execute

3. Revision history