This specification is based primarily on two documents. The first document, "Simple Image Retrieval: Interface Concepts and Issues", describes a longer term view of how simple image access can fit into a more general framework for image access in the VO. The URL-based implementation specified here is intended to be consistent with the concepts discussed in this document. A prototype SOAP/WSDL based Web Services implementation is also planned; this will provide similar functionality to the URL-based implementation, but with a Web Services interface. The second document, the "Simple Cone Search specification" provides a means to query catalogs via HTTP with a uniform interface. A large number of implementations of the Cone Search specification have demonstrated that a simple standard based on name-value HTTP GET requests and the VOTable XML format is both easy to implement and useful for catalog data access. The Simple Image Access interface (SIM) defined here follows a similar approach.
SIM is designed primarily as an "image on demand" service, with images created on-the-fly by the service given the position and size of the desired output image as specified by the client. In the ideal case the image service presents an image data collection to a client as a seamless virtual sky, allowing the client to "observe" any region within the coverage of the service, without having to worry about details such as image boundaries or calibration. SIM can also be used to search for and retrieve pre-existing, statically sized atlas or pointed images which overlap the given search region on the sky. When "observing" the virtual sky, image query and access is normally limited to regions small enough to be represented as a single image. Larger regions can be queried when performing a simple search of a static image data collection. Data collections are often distributed, and the client may query multiple image services simultaneously, e.g., to gather data from multiple wavelength regimes or surveys to analyze a single region on the sky.
In operation SIM represents a negotiation between the client and the image service. The client describes the ideal image - what it would like to get back from the image service - and the image service returns a list, encoded as a VOTable, of the (often virtual) images it can actually return. The client then examines this to determine if it is interested in any of the available images, possibly iterates with the service to refine the query, then issues a series of getImage requests to retrieve the selected images. A key point is that it is entirely up to the image service what images, if any, it offers to the client. These images may range from a simple list of static archive images which intersect the region of interest defined by the client, to a mosaiced and reprojected synthetic image matching the ideal image requested by the client. In the latter case the image is not computed until it is actually accessed or retrieved by the client.
The bulk of this document represents a technical specification for
the simple image access interface. For examples of how the interface is
intended to be used, please refer to the Usage Examples
section below.
2. Requirements for Compliance
Compliance with this specification requires that an image access web
service be maintained with the following characteristics:
Here, image service refers to a web service which
returns images or image metadata to a client. The Simple Image Access
specification defines a number of web methods which services
must provide to implement a compliant image service. A web
method is a function defined by a web service and called via the
web. Since the Simple Image Access service described here is URL-based
(e.g., as opposed to using SOAP/WSDL), the web methods described here
are implemented as URLs using HTTP GET or POST.
2.1 Compliance
The keywords "MUST", "REQUIRED", "SHOULD", and "MAY" as used in this document are to be interpreted as described in RFC 2119 [34].
An implementation is compliant if it satisfies all the MUST or REQUIRED level requirements for the protocols it implements. An implementation that satisfies all the MUST or REQUIRED level and all the SHOULD level requirements for its protocols is said to be "unconditionally compliant"; one that satisfies all the MUST level requirements but not all the SHOULD level requirements for its protocols is said to be "conditionally compliant".
The image data model assumed here is minimal at this point. An image should be a calibrated object frame imaging some region of the sky. Only two dimensional images are fully supported within the interface at this time, but an actual external FITS file can be of higher dimension provided the two spatial axes are mapped into the view seen here (e.g., a spectral data cube should be presented as a 2D image within SIM even though the actual external FITS file may have 3 or more image dimensions). Within the current interface, images consist of a pixel array, an image header describing the image, and optionally an associated world coordinate system and spectral bandpass data model. The actual image file may contain additional information not defined here.
Images can be returned as either FITS files or as graphics images. For the FITS format, each image file thus returned should contain a single image in the primary header unit (PHU). Extensions are permitted, but their usage is not defined by this interface, and the service should assume that an external client will only access the PHU. Image aggregates are permissible but are not explicitly supported by the interface. For example, a calibrated mosaic detector observation stored as a FITS multi-extension file (MEF) should be presented to the outside world as a set of separate but related images, even if the images are stored in the archive as extensions within a single FITS MEF file. In such a case the service would need to extract each image from the MEF to return it to the client at access time. Service-defined keywords or table columns can be used to associate image aggregates of various types.
Ultimately, VO data models will provide a means to describe
more complex data objects within the VO than be directly addressed by
the SIM prototype. VO data models are needed for many data objects or
attributes such as the limiting magnitude/flux/SNR of an image, for the
spatial resolution of an image (characteristic PSF), for the temporal
coverage of an image, for any data quality, exposure time, or variance
masks associated with a pixel array, and so forth.
4. Image Query
The purpose of the image query web method is to allow users to
search for image data for a given region on the sky. Additional parameters
may optionally be used to further refine the query. The size, scale,
projection, and so forth of the ideal output image can be specified,
and the service will return references to images which most closely match
what is requested. How closely the service can match the specifications
of the image requested by the client will depend upon the type of image
service as defined in section 3 above. The service
returns a table listing all available images satisfying the query.
Descriptive metadata is returned for each image to allow the client to
decide which, if any, images it wishes to retrieve. An access reference
is provided for each image to permit subsequent staging and retrieval.
The maximum size of the region of interest for a query depends upon the type of image service. Image cutout and mosaicing services are designed to generate a single image covering the region of interest specified by the client. Unless the desired image resolution is very low, the largest region on the sky that it is practical to cover with a single image is typically on the order of a degree or so (a 1 degree field at a resolution of 0.5 arcsec/pixel requires an image 7200 pixels square, or 104 MB at 16 bits per pixel). Larger images are certainly possible, but are not very practical for a service which is generating images on the fly and delivering them to a remote client over the Internet. A more typical image cutout is likely to be much smaller, on the order of several hundred pixels square or less, with analysis involving many such small regions. If a client wants to use a cutout or mosaicing service to cover a very large region at high resolution it would need to make multiple requests to generate and download all the desired image data.
Unlike the cutout and mosaicing services, image services which merely return lists of pre-existing atlas or pointed images can potentially support very large search regions in queries. The same interface is used in both cases, with the maximum (useful) size of the region of interest for the image query being specified in the service registration parameters. Our expectation is that most image queries will involve modest sized query regions.
Mosaicing services are sophisticated enough to be able to generate
images on the fly given the field center, scale, rotation, projection,
and so forth specified by the client. To support such services we need
a way to allow the client to specify the parameters of the ideal image.
This is done using a set of image generation parameters.
These parameters are optional - a client is always free to specify them,
but if the image service doesn't support on-the-fly image generation
it is free to ignore them and merely describe the images, if any, that
it can provide. The default values for the optional image generation
parameters are derived from the region of interest used for the image query.
If the image generation parameters are fully specified these override the
defaults provided by the region of interest.
4.1 Input
|
Note that when it contains extra GET arguments, the base URL ends in an ampersand, &; if there are no extra arguments, then it ends in a question mark, ?.
Every query to a given image query service uses the same base URL.
|
The constraints represent the query parameters which can vary for each successive query.
The baseURL and constraint list are concatenated to form the query.
|
A special case is SIZE=0. For an atlas or pointed image archive this tests whether the given point is in any image. For a cutout or mosaic service this will cause a default sized image to be returned. The default image size is service-defined and may be a value considered appropriate for the service, for the given image or data collection being accessed, or for the object (if any) at the given position.
|
In addition, the service MAY support the following query constraint which is used to pre-select images on the server side by specifying the type of intersection of a candidate image with the region of interest:
If this parameter is not present, INTERSECT=OVERLAPS is assumed. Calculations need not be exact, e.g., a nonrotated bounding box approximation may be used to compute the type of intersection of a candidate image with the ROI. If the client requires a more precise measure, the spatial intersection a target image with the ROI may be computed precisely using the WCS metadata returned in the output VOtable. For a cutout or mosaicing service this parameter refers to the portion of the generated image containing valid (non-blank) data.
Note that case is important for these names: the service MUST permit these parameter names to be input in upper-case (the service may permit parameter names to be case insensitive since this permits upper-case names). By convention, upper case is used here for interface-defined terms in URLs, reserving lower case for service-defined parameters or parameter values.
|
Image Geometry Defaults. The default size and extent of the desired output image are determined from these parameters as follows: if a size or scale term is given explicitly this is the value used, otherwise a default is computed based on the angular extent of the query region (SIZE). For example, if NAXISn and CDELT are given then the angular size of the image is determined by these parameters. If the NAXISn are given then the default image scale is determined by SIZE. If only CDELT is given then the image size in pixels is determined by the angular extent of the query region (SIZE). If only the region angular extent SIZE is given then the size (in pixels) and scale of the image is determined by the service to best fit the data and the region of interest.
In the simplest case, all image generation parameters may be omitted, and the generated output image defaults to the position and size of the query region. If any image generation parameters are specified these override the ROI-implied defaults.
|
In addition, these special values are defined:
The following optional syntax is defined for "GRAPHIC":
If only FORMAT=GRAPHIC is specified, the default is to return one graphics format entry for each image in the output table, with the format being selected by the service. Clients should only use this shorthand version if they can accept any of the three standard graphics formats.
|
The example above specifies the desired output image formats to be image/fits, text/html, and one of image/jpeg or image/png. Any formats matching this list are returned for each image.
No requirements are placed on compliant services on the image formats that they must support; however, if images are supported, their MIME major type must be image.
If formats indicated by this parameter are not supported by the implementing service, the returned table should be empty. If the format is not specified FORMAT=ALL is assumed.
Services that do not support this parameter MUST permit it to be present without error.
type="results", containing a single TABLE element which
contains the results of the query. The VOTable is permitted to contain
additional RESOURCE elements, but the usage of any such elements is not
defined here. If multiple resources are present it is recommended that
the query results be returned in the first resource element.
name="QUERY_STATUS". Its value attribute should set to
"OK" if the query executed successfully, regardless of whether any
matching images were found. All other possible values for the value
attribute are described in section 4.3 below.
|
Image Metadata
ucd="VOX:Image_Title", with
datatype="char", and arraysize="*",
containing a short (usually one line) description of the image.
This should concisely describe the image to a user, typically
identifying the image source (e.g., survey name), object name or
field coordinates, bandpass/filter, and so forth. Note that a
client application may present the user with a combined list of
images from many different queries and sources: the title string
is important to identify each image to the user.
ucd="INST_ID", with
datatype="char", and arraysize="*",
identifying the instrument or instruments used to make the
observation, e.g., STScI.HST.WFPC2.
ucd="VOX:Image_MJDateObs", with
datatype="double", representing the mean modified
Julian date of the observation. By "mean" we mean the midpoint of
the observation in terms of normalized exposure times: this is
the "characteristic observation time" and is independent of
observation duration.
ucd="POS_EQ_RA_MAIN", with
datatype="double", representing the ICRS
right-ascension of the center of the image.
ucd="POS_EQ_DEC_MAIN", with
datatype="double", representing the ICRS declination
of the center of the image.
ucd="VOX:Image_Naxes", with
datatype="int", specifying the number of image axes.
ucd="VOX:Image_Naxis", with
datatype="int", and arraysize="*", with
the array value giving the length in pixels of each image axis.
ucd="VOX:Image_Scale", with
datatype="double", and arraysize="*",
with the array value giving the scale in degrees per pixel of
each image axis.
ucd="VOX:Image_Format", with
datatype="char", and arraysize="*",
specifying the MIME-type of the object associated with the
image acref, e.g., "image/fits", "text/html", and so forth.
|
Coordinate System Metadata
This defines a basic sky projection world coordinate system (WCS) for the image. Each image description SHOULD include coordinate system metadata, but this is not required. The WCS metadata included here is FITS WCS-like but has been simplified: if the image contains an actual FITS WCS this may contain additional information not provided here.
ucd="VOX:STC_CoordRefFrame", with
datatype="char", and arraysize="*",
representing the coordinate system reference frame, selected from
"ICRS", "FK5", "FK4", "ECL", "GAL", and "SGAL".
ucd="VOX:STC_CoordEquinox", with
datatype="double", representing the Equinox (not
required for ICRS) of the coordinate system used for the image
world coordinate system (WCS). This should match whatever is in
the image WCS and may differ from the default ICRS coordinates
used elsewhere.
ucd="VOX:WCS_CoordProjection",
with datatype="char", and arraysize="3",
with the array value being the three-character code ("TAN", "ARC",
"SIN", and so forth) specifying the celestial projection, as for
FITS WCS.
ucd="VOX:WCS_CoordRefPixel",
with datatype="double", and
arraysize="*", with the array value specifying the
image pixel coordinates of the WCS reference pixel. This is
identical to "CRPIX" in FITS WCS.
ucd="VOX:WCS_CoordRefValue",
with datatype="double", and
arraysize="*", with the array value specifying the
world coordinates of the WCS reference pixel. This is identical to
"CRVAL" in FITS WCS.
ucd="VOX:WCS_CDMatrix", with
datatype="double", and arraysize="*",
with the array (matrix) value specifying the WCS CD matrix.
This is identical to the "CD" term in FITS WCS, and defines
the scale and rotation (among other things) of the image.
Matrix elements should be ordered as CD[i,j] = [1,1], [1,2],
[2,1], [2,2].
The above terms are based on the following two proposals: Space-Time Coordinate Specification for VO Metadata ("STC" above), and Representations of World Coordinates in FITS ("WCS" above).
If the coordinate system metadata defined here is omitted, the client can estimate the WCS of the image from the required image metadata. That is, the reference pixel defaults to the image center, the reference value is given by the RA and DEC values at the center of the image, the coordinate system is ICRS, and the image is assumed to be unrotated with no flipped axes (N up and E to the left), with the given scale. This estimated WCS is not sufficient to define the exact image footprint or where the image pixels are on the sky, but it may be sufficient for some purposes such as selecting images for retrieval. A standard WCS should still be returned in the returned image if at all possible.
Spectral Bandpass Metadata
This defines a simple model to characterize the spectral bandpass of the image. The image description SHOULD include spectral bandpass metadata for the image, but this is not required (it is highly desirable to permit automated multiwavelength analysis). The simplified model presented here is based on an analysis by Jonathan McDowell (CXC/SAO).
ucd="VOX:BandPass_ID", with
datatype="char", and arraysize="*",
identifying the bandpass by name (e.g., "V", "SDSS_U", "K",
"K-Band", etc.).
ucd="VOX:BandPass_Unit", with
datatype="char", and arraysize="*",
identifying the units used to represent spectral values, selected
from "meters", "hertz", and "keV". No other units are permitted
here; the client application may of course present a wider range
of units in the user interface.
ucd="VOX:BandPass_RefValue", with
datatype="double", specifying the characteristic
(reference) frequency, wavelength, or energy for the bandpass model.
ucd="VOX:BandPass_HiLimit", with
datatype="double", specifying the upper limit of
the bandpass.
ucd="VOX:BandPass_LoLimit", with
datatype="double", specifying the lower limit of
the bandpass.
The characteristic value and upper and lower limits should be chosen to best model the actual bandpass of the image; exactly how this is done is up to the data provider. Typical values would be the mode or central wavelength/frequency of the transmission function for the reference value, with the lower and upper cutoffs chosen to include essentially all (not necessary 100%) of the transmitted energy. At this point there is no provision for modeling the actual transmission function, e.g., as a reference to an external table stored in some online database, although this may be added in the future. Our intent here is merely to model the spectral bandpass of the image in the local rest frame (as for a filter), not to provide a full spectrophotometric calibration for the image.
Processing Metadata
Processing metadata is used to describe any processing done to the data as presented by the image service. This is especially important if the service changes the data in any way, for example a mosaicing service which reprojects image data which has already been sampled into a pixel grid.
ucd="VOX:Image_PixFlags", with
datatype="char", and arraysize="*",
specifying the type of processing done by the image service to
produce an output image pixel. The string value should be formed
from some combination of the following character codes:
For example, a typical image cutout service would have
PixFlags="C", whereas a mosaicing service operating
on precomputed images might have PixFlags="FZ".
A preview page, graphics image, or a pixel mask might
have PixFlags="V". An image produced
by sampling and reprojecting a high energy event list
might have PixFlags="X". If not specified,
PixFlags="C" is assumed.
Access Metadata
Access metadata includes any information describing either the data or the service which is needed to access the data.
ucd="VOX:Image_AccessReference",
with datatype="char" and arraysize="*",
specifying the URL to be used to access or retrieve the
image. Since the URL will often contain metacharacters
the URL is normally enclosed in an XML CDATA section
(<![CDATA[...]]>) or otherwise encoded to
escape any embedded metacharacters.
|
It is possible and permissible for an image query to reference an image which cannot be accessed, e.g., because the image metadata is available online but the image itself is not. In this case the access reference value should be given as "NONE", without a CDATA enclosure.
Since SIM is a URL-based interface the access reference is a
simple URL. If the client issues a HTTP GET request using this
URL, and the request is successful, the client will receive a
NVOX:Image_Format document in return. In most cases
this will be an image with a MIME-type such as "image/fits", but
if the image reference points to a preview page, the document type
could be "text/html". Note: the access reference
URL does not stage the data and return another image reference,
it returns the image itself as the response to the GET.
The access reference URL need not point to an actual existing online image. In many cases the URL will reference a virtual image, which will be created on-the-fly by the image service when accessed.
Image access references (acrefs) are strings which uniquely identify a (possibly virtual) image within the global name space of the Web. Acref strings are used like file pathnames to tag or index images, hence should be static in nature (meaning the string should be computed once by the service and thereafter merely copied about). Acrefs can be passed about among cooperating hosts in a distributed computing scenario, hence should access the same image regardless of the address of the client. An acref is a runtime image reference, generated by the image service at query time, and may be invalid after an interval of time (e.g., hours or days), as defined by the service.
ucd="VOX:Image_AccessRefTTL", with
datatype="int", specifying the minimum time to live
in seconds of the access reference.
ucd="VOX:Image_FileSize", with
datatype="int", representing the actual or
estimated size of the encoded image in bytes (not pixels!).
This is useful for image selection and for optimizing distributed
computations.
Resource Metadata
name="QUERY_STATUS"; if the query is successful (regardless
of whether any image rows are returned) the value attribute is set to
"OK". The remainder of this section defines other possible values to
indicate that the query was unsuccessful in some way.
When the query is unsuccessful, the contents of INFO element (i.e. its PCDATA child node) SHOULD contain an error message suitable for display. Implementation of this feature is encouraged but not required.
|
When the query is unsuccessful (in any of senses described below), the resulting VOTable is not required to contain any other elements as specified in the previous section; although, it is not an error to do so.
The other allowed values for value attribute besides "OK" are:
In this case, the inclusion of a descriptive error message is strongly encouraged.
|
5. Image Staging
By image staging we refer to the processing the server performs to
retrieve or generate the requested images and cache them in online storage
for retrieval by a client. Staging may be necessary for large archives
which must retrieve image data from hierarchical storage, or for services
which dynamically generate images where it may take a substantial time
(e.g., minutes or hours) to generate the requested images. Issuing a
staging request for a block of images also permits large servers to
optimize image generation, for example to take advantage of parallelization
for large requests.
A key point here is that image staging is optional for both the image service and for the client application. Image services which can interactively generate images on the fly (e.g., a fast image cutout service, or an atlas image service) may elect to not implement or register the staging method; images can be passed directly back to the client by the getImage method without staging them to disk at all. Client applications will work the same way whether or not they issue a staging request to a service, since the image query and image retrieval web methods are the same whether or not images are explicitly staged.
When staging of data is necessary there are two main approaches to managing image data as it is generated. The first technique is to stage data on the server for later retrieval by the client; the data is only staged for a period of time and is eventually deleted by the service. The second technique is for the service to deliver the data to the client as it becomes available. The first technique is used here as it permits the getImage method to be identical whether or not staging is used, because it is simpler for the client (getImage operates the same for any type of service), because it is simpler for the service in that the service can proceed to generate the images regardless of the state or accessibility of the client, and because it provides an implicit network caching mechanism which permits multiple distributed clients to share the same data easily. The chief drawback is that the server has to manage a network data cache on behalf of the each client it is servicing.
Aside from providing the client with asynchronous image generation and
a network data cache, the staging mechanism provides a messaging
capability. The service broadcasts messages to subscribing clients whenever
a staging (processing) event occurs, such as when a new image has been
generated and is available for retrieval, or when staging of all images
has been completed. Service generated messages can also be used to pass
informational or diagnostic messages to clients as processing proceeds.
This type of messaging is asynchronous and one way: the service broadcasts
messages to subscribing clients as things happen, whereas
clients send requests to the service to invoke web methods.
For example, to initiate staging, subscribe to staging-related messages,
or abort a staging operation in progress, the client sends a request to
(invokes a web method provided by) the service.
5.1 Staging and Messaging Protocols (Preliminary)
A preliminary design for an image staging and messaging protocol based on SOAP-encoded requests and messages exists, but has not yet been tested in any real implementation and is too preliminary to include in this document. Nonetheless several examples of what such an interface might look like are given below to give the flavor for the interface.
<?xml version='1.0' ?>
<env:Envelope xmlns:env="http://www.w3.org/2002/06/soap-envelope">
<env:Header>
<h:stagingHeader xmlns:h="urn:sim-stagingHeader"
env:role="http://www.w3.org/2002/06/soap-envelope/role/next"
env:mustUnderstand="true">
<h:serviceID>http://archive.foo.edu/vo/sim/...</h:serviceID>
<h:clientID>mailto:user@foo.bar.org</h:clientID>
<h:accessID>0</h:accessID>
</h:stagingHeader>
</env:Header>
<env:Body>
<r:stagingRequest xmlns:r="urn:sim-stagingRequest"
<r:request>access</r:request>
<r:images>
<r:image acref="http://archive.foo.edu/vo/sim/..."</r:image>
<r:image acref="http://archive.foo.edu/vo/sim/..."</r:image>
<r:image acref="http://archive.foo.edu/vo/sim/..."</r:image>
<r:image acref="http://archive.foo.edu/vo/sim/..."</r:image>
</r:images>
</r:stagingRequest>
</env:Body>
</env:Envelope>
In this example the request type is "access", meaning access the listed images. The accessID is set to zero since this is the initial access request and accessID has not yet been assigned by the service. Other types of staging requests include "subscribe" (this allows additional clients to subscribe to staging events from an existing staging context given the accessID), "status" (list the status of all images currently undergoing staging), "abort" (abort the whole staging operation), and "purge" (release storage for the listed images).
<env:Envelope xmlns:env="http://www.w3.org/2002/06/soap-envelope">
<env:Header>
<h:messageHeader xmlns:h="urn:sim-messageHeader"
env:role="http://www.w3.org/2002/06/soap-envelope/role/next"
env:mustUnderstand="true">
<h:serviceID>http://archive.foo.edu/vo/sim/...</h:serviceID>
<h:clientID>mailto:user@foo.bar.org</h:clientID>
<h:accessID>1234</h:accessID>
</h:messageHeader>
</env:Header>
<env:Body>
<m:message xmlns:m="urn:sim-message"
<m:eventType>staging</m:eventType>
<m:eventLevel>0</m:eventLevel>
<m:images>
<m:image status="staged" acref="http://..."</m:image>
<m:image status="staged" acref="http://..."</m:image>
<m:image status="staged" acref="http://..."</m:image>
<m:image status="staged" acref="http://..."</m:image>
</m:images>
</m:message>
</env:Body>
</env:Envelope>
Other types of staging events include "informational" (used to broadcast informational or diagnostic messages during execution) and "done" (all staging is complete with either normal or abnormal completion). The client can set the eventLevel attribute to specify the level of detail it wishes to see in informational messages.
All staging requests return a status indicating whether or not the
request succeeded. Messages broadcast by the service during execution
are asynchronous; the service does not need to check whether or not any
clients actually received the messages. If the subscription list is
empty no messages are sent. Subsequent getImage requests by a client
will either succeed, or fail with a DEFERRED status, indicating that the
request is valid but the requested image is not yet available (see below).
6. Image Retrieval
The image retrieval request (getImage web method) allows
a client to retrieve a single image given an access reference or "acref"
as returned by a prior image query. In the case of SIM the acref is a
simple URL since SIM is URL-based. Since an image query is required to
obtain an acref, no requirements are placed on the form the acref takes.
This has the effect of hiding the details of the acref URL from the client,
making it easy to layer an implementation of the getImage web method on
top of an existing image retrieval service, and making it easier to hide
changes to the implementation of existing services.
6.1 Input
The input to the getImage web method is the image acref for the indicated
image or virtual image. The acref for a particular image is obtained
through a prior call to the Image Query web method.
6.2 Successful Output
The output of getImage MUST be a single image or image document
returned with a MIME-type identifying the file format. If an image is
returned it must conform to the simple image data model as outlined in Image Service Types above. When the input acref points
to a physical image the primary type of the MIME code should be "image/".
Other MIME types are allowed, depending on the capabilities of the image
service; for example, a MIME-type of "text/html" may be used when the
acref URL points to an HTML description and/or preview of the image.
If a FITS image is returned the image SHOULD contain a valid
FITS WCS. Any areas of the image which do not contain
valid data, e.g., because the requested region extends beyond the bounds
of the source image, SHOULD be flagged with a blank value, using the FITS
keyword BLANK to identify the blank fill value used.
6.3 Error Response
If a condition is encountered that prevents the requested image from being
downloaded, the output MUST be a VOTable with a single RESOURCE element
containing an INFO child with name="QUERY_STATUS". The
allowed values for this INFO are the same as those defined for the Image Query; in addition, the following additional
attribute MAY be supported:
7.1. Metadata Query
A compliant service MUST support image queries with FORMAT=METADATA,
used to query the service metadata; only metadata is returned by the
service in this case. In particular, the response to this query
advertises two things about the
service:
The overall structure of the VOTable by a metadata request is the same as described in section 4.2 except that it contains no table rows. (In fact, it can in practice look exactly like a normal image query response containing no matching images.)
Each input parameter supported by the service should be listed as a
PARAM element of the RESOURCE that normally contains the image table.
Each PARAM should have a name attribute of the form
"INPUT:param_name", where param_name is
the parameter name as it should appear in the query URL. For example,
name="INPUT:POS" refers to the "POS" input parameter. All
input parameters meant to be available to clients of the service must
be listed as PARAM elements, including required parameters (POS, SIZE,
and FORMAT), optional parameters (defined in section
4.1), and non-standard parameters specific to the service. The
PARAM may contain a value attribute which should contain
the default value that will be assumed if the parameter is not set in
the query input URL. Implementors are encouraged to include, as children
of the PARAMs, DESCRIPTION elements to describe the parameter and
(where appropriate) VALUES elements to given allowed ranges or values.
Example: The input parameter listing below from
a Pointed Image Archive shows that in addition
to supporting the required parameters (POS, SIZE, and FORMAT), it also
supports the optional parameters INTERSECT and VERB as well as its own
non-standard parameter, "telescope".
<RESOURCE type="results">
<DESCRIPTION>ADIL Simple Image Access Service</DESCRIPTION>
<INFO name="QUERY_STATUS" value="OK"/>
<PARAM name="INPUT:POS" value="0,0">
<DESCRIPTION>Search Position in the form "ra,dec" where
ra and dec are given in decimal degrees in the ICRS
coordinate system.</DESCRIPTION>
</PARAM>
<PARAM name="INPUT:SIZE" value="0.05">
<DESCRIPTION>Size of search region in the RA and Dec. directions</DESCRIPTION>
</PARAM>
<PARAM name="INPUT:FORMAT" value="ALL">
<DESCRIPTION>Requested format of images</DESCRIPTION>
<VALUES>
<OPTION>image/fits</OPTION>
<OPTION>image/gif</OPTION>
<OPTION>text/html</OPTION>
<OPTION>ALL</OPTION>
<OPTION>GRAPHIC</OPTION>
<OPTION>METADATA</OPTION>
</VALUES>
</PARAM>
<PARAM name="INPUT:INTERSECT" value="OVERLAPS">
<DESCRIPTION>Choice of overlap with requested region</DESCRIPTION>
</PARAM>
<PARAM name="INPUT:VERB" value="1">
<DESCRIPTION>Verbosity level, controlling the number of columns returned</DESCRIPTION>
</PARAM>
<PARAM name="INPUT:telescope">
<DESCRIPTION>Telescope name</DESCRIPTION>
</PARAM>
...
|
The columns that are returned by an image query are described with the FIELD elements exactly as they are described in a normal image query response (section 4.2).
When FORMAT=METADATA is given, all other input parameters are normally
ignored. An exception is the VERB parameter: if given, the service MAY
choose to describe only those columns that will be returned for that
verbosity level. If the service chooses to support
the VERB parameter in this way, it must provide a PARAM with
name="VERB" and a value attribute giving the
actual verbosity level being described.
Example: The following PARAM could appear after the
PARAM elements shown in the previous example:
<PARAM name="VERB" value="1"/>
|
If the service chooses to ignore the VERB parameter, than it should describe all of the columns returned at the highest verbosity level supported.
7.2. Registering a Compliant Service
For the purposes of the NVO first year demonstrations, it is expected
that implementers will register their services by filling out a web
form. The following metadata are required for registration:
|
|
|
|
http://archive.foo.edu/vo/sim/queryImages?POS=10.63,41.25&SIZE=0.15
This query will work for any image service. For an atlas or pointed image service the service will list any image which intersects the region, regardless of the size, orientation, resolution, bandpass, etc., of the image. For a cutout or mosaicing service only images equal in size to the referenced region would be listed (since these services will generate images of the requested size), but they could still have any orientation, scale, resolution, bandpass, and so forth.
It is up to the client to examine the returned VOTable to determine which if any of the images described are to be downloaded. The image metadata returned in the table is used to perform image selection. For example, the WCS information in the table may be used to select only images which sufficiently overlap or match the region the client is interested in. The Image_FileSize attribute may be used to reject images which are too large to be worthwhile downloading. Any technique could be used for image selection, e.g., selection could be automated based on the returned metadata, or the image metadata (specifically the WCS) could be used to generate a tagged graphics marker in an image display which the user could interactively select to download the associated image.
Although SIM provides some facilities for server-side image selection, e.g., the optional INTERSECT parameter, ultimately the algorithm used for image selection has to be controlled by the client since there are potentially infinitely many client applications, and only the client knows what it is trying to do. Hence the image metadata returned as the query response plays a central role in image access.
Once the images to be retrieved have been selected the individual images can be fetched using the image access reference returned in the table record referencing the image (field Image_AccessReference). The string value of this field is the URL of the "image" (real or virtual) to be retrieved. This field is opaque to the client, but an example might be as follows:
http://archive.foo.edu/vo/sim/getImage?survey=dposs&filter=V&pos=10.63,41.25&size=0.15
The image service registry is used to discover all services available for the desired survey. If the same resource is available from multiple services these can be used for load distribution, to select the maximum network bandwidth between two endpoints, to fail-over in the event that a given service is offline, and so forth.
The registry is first used to select the list of image services to be queried. Assume we are looking for all the data available on a given region. The same query (as in Simple Query, above) would then be posed to all the target services. The query results would be analyzed for each service and the selected images retrieved. Some form of analysis would then be performed on the resultant set of images.
This is an inherently parallel operation, with the same operations being performed independently for each image service. Hence all queries can proceed concurrently - in principle the distributed operation can be completed in not much more time than it would take to query a single service.
For our example we have selected as our reference image a 256x256 pixel image cutout from the NDWFS survey. This is a wide field optical CCD mosaic survey: the data has been heavily processed, with many frames being dithered and stacked to produce the final online image data. Since the data had to be resampled it has been reprojected to a purely analytic, unrotated projection, TAN in this case. The entire 3 degree-wide field shares the same projection, hence cutouts are characterized by a reference pixel located well outside of the image. A portion of the FITS header of this reference image follows (the OBJECT keyword shown here is a good example of an Image_Title string by the way).
OBJECT = 'NDWFS J142859.86+353716.4 Bw-band'
EQUINOX = 2000. / Equinox of coordinate system
RADECSYS= 'ICRS ' / Default coordinate system
DATE-OBS= '1999-04-12' / UT Date of Earliest Obs. Used In Combined Image
FILTER = 'Bw NDWFS k1025' / Filter name(s)
CTYPE1 = 'RA---TAN' / Coordinate type
CTYPE2 = 'DEC--TAN' / Coordinate type
CRVAL1 = 218.0238 / Coordinate reference value
CRVAL2 = 34.27986 / Coordinate reference value
CRPIX1 = -8658. / Coordinate reference pixel
CRPIX2 = -18627. / Coordinate reference pixel
CD1_1 = -7.1666666666667E-5 / Coordinate matrix
CD2_1 = 4.3883176969447E-21 / Coordinate matrix
CD1_2 = 4.3883176969450E-21 / Coordinate matrix
CD2_2 = 7.16666666666673E-5 / Coordinate matrix
If we take our simple query example and add image generation parameters to match our reference image the enhanced query would look as follows:
http://archive.foo.edu/vo/sim/queryImages?POS=217.2494167,35.6212417&SIZE=0.0183333&
NAXIS=256&CFRAME=FK5&CRPIX=-8658,-18627&CRVAL=218.0238,34.27986&CDELT=7.166667E-5
Here we have omitted those image generation parameters which agree with the defaults, i.e., EQUINOX (J2000), PROJ (TAN) and ROTANG (0.0). Since the image is unrotated CDELT is given by the diagonal terms of the CD matrix, CD1_1 and CD1_2. The off-diagonal terms are effectively zero in the example (4.388E-21), to within the precision of the WCS. POS was computed by evaluating the WCS of the reference image at the image center, X=Y=128.5. A more general procedure for calculating the image scale and rotation terms from the CD matrix is given in WCS Paper II.
If we submit this query to a mosaicing service the service will describe images which should exactly duplicate the spatial characteristics of the reference image. Other services will offer images which represent the best match to the requested image, in most cases using only the POS and SIZE parameters.
The only parameters which this service must implement are POS, SIZE and FORMAT. Optional parameters the service may wish to implement include INTERSECT and VERB. Other useful service-defined parameters might include a parameter named "band" or "filter" of type BandPass_ID, as defined in the spectral bandpass section of Query Output above. Atlas or pointed image services should ignore the image generation parameters: all input parameters should however be allowed to be present in the input without error.
In operation the service should parse the image query URL and scan the set of images supported by the service to see which if any 1) match one of the requested image formats, and 2) intersect the query region. For each such image a record is formatted and added to the output VOTable: this is often the hardest part of the service to implement, as access to image metadata such as the WCS and spectral bandpass is required to fully describe the image. If the data is available online, an access reference URL (acref) should be computed which the client can invoke to retrieve the image.
For many services image access will be trivial, e.g., the acref could be a simple HTTP or FTP URL referencing the online image file. In other cases the URL might need to point to a CGI, web service, or other program which extracts the referenced image and returns it to the client. This is necessary if the image is stored in a form which violates the simple image data model. For example, CCD Mosaic frames stored as extensions in a FITS MEF must be extracted as separate images at access time: the extracted image can be returned directly to the client without staging it to disk. SDSS (as one example) stores atlas images of faint objects in a proprietary format which includes cutouts for each filter used by the survey. As each band of the atlas cutout is accessed it will need to be extracted and returned to the client separately. In cases like these where some server-side image extraction is needed it might prove worthwhile to cache the archived or extracted data on disk.
For an atlas or pointed image service MaxQueryRegionSize
can be anything up to the entire sky (360 degrees). The
MaxImageExtent, MaxImageSize, and
MaxImageFileSize attributes should reflect the maximum size
image the service can return; for an atlas or pointed image service this
is usually the largest image available.
An image cutout service is very similar in operation to an atlas or pointed image service except that, instead of "returning" (describing) entire static images, the service extracts or "cuts out" a subraster from each image or survey field which intersects the query region. The position and size of the returned image cutout will match the POS and SIZE parameters of the region requested by the client. If no data is available for part of the cutout then the full cutout region is still returned, but with undefined regions of the image set to a blank value.
Cutout services often serve only a single uniform survey, in which case a query request will usually return only zero, one, or several images (one for each band or format at the given position). However this is not necessarily the case. If a cutout service serves multiple image data collections a query response may reference any number of images, just as for an atlas or pointed image service.
The required input parameters for a cutout service are the same as for an atlas or pointed image service, i.e., POS, SIZE, and FORMAT. INTERSECT is optional, but can be used to reject cutouts which do not contain sufficient valid data (e.g., INTERSECT=CENTER would require that the center of the cutout contain valid, or non-blank, data). Other service-defined parameters such as a Band_ID parameter are just as useful for a cutout service as for other types of image services.
In addition to the usual input parameters a cutout service will often support the NAXIS image generation parameter. This is desirable to allow the client to precisely control the size of the generated image in pixels. If NAXIS is specified, then assuming a fixed image scale, NAXIS overrides the default image size implied by the query region parameter SIZE.
For a cutout image service the query region size defines the default
size of the image cutout, hence MaxQueryRegionSize
should reflect the maximum size image cutout which can be generated.
The MaxImageExtent, MaxImageSize, and
MaxImageFileSize attributes should also reflect the
maximum size image the service can return.
For a cutout service MaxQueryRegionSize and
MaxImageExtent are probably identical. One can imagine
allowing the query region size to be larger than the largest possible
cutout, with the service proposing to tile the larger region with smaller
cutouts. This is too complex to be worthwhile; if any tiling of large
regions is to be done it is preferable to leave this up to the client
since there are many ways to tile a large region.
Since cutout services create new images the service will need to generate a new image header as well as subset the image pixel array (at least for FITS format images). In particular the cutout service should propagate valid WCS data to the generated image cutout.