<?xml version="1.0" encoding="UTF-8"?>
<!--$Id: stc-v1.30.xsd,v 1.1.1.1 2006/11/14 02:56:42 gupchup Exp $-->
<!-- Schema definition for the SpaceTimeCoords -->
<!--Change Log:
$Log: stc-v1.30.xsd,v $
Revision 1.1.1.1  2006/11/14 02:56:42  gupchup
no message

Revision 1.5  2006/04/10 15:37:58  budavari
schema upgrade

Revision 2.12  2006/03/31 15:48:29  arots
Added a second Region substitution group, Region2
for non-symmetric operations on two regions, such as difference.

Revision 2.11  2006/03/30 23:33:14  arots
Fixed reference to Region in region operation types.

Revision 2.10  2006/03/23 21:59:15  arots
Removed STCCoordinate[List] and STCRegion[List] elements.
Renamed the stc[Coordinate|Region][List]Type to STC[Coordinate|Region][List].
Modeled STCCoordinate[List] type after STCRegion[List].
All of this should make life easier for Tamas.

Revision 2.8  2006/03/03 14:44:09  arots
Repaired dropped parts of stcRegionType and stcRegionListType.

Revision 2.7  2006/03/01 20:58:22  arots
STC Version 1.30:
Removed anonymous types, added application public types for regions,
introduced universal referencing model using Xlink.

Revision 2.6  2005/02/25 19:30:24  arots
IVOA version 1.20:
Distinguished LSRK and LSRD, LOCAL_GROUP_CENTER replaces SUPER_GALACTIC_CENTER
Subtle changes to force validation by Xerces-J2: slight obfuscation
Added TEB time scale, warning on use of ISOTime (> 0001-01-01 !)
Added reference spheroid to GEO_D, changed GEO to GEO_C
Added discussion of planetographic vs planetocentric systems,
right- and left-handed systems
Removed GEOGRAPHIC CoordFlavor (is really 3-D spherical); added POLAR

Revision 2.5  2005/01/05 14:22:11  arots
Release Verion 1.10
Added Pixel Space; overhaul of inheritance and polymorphism

Revision 2.4  2004/07/23 21:17:50  arots
Modified ivoa schema locations; changed URN from nvo- to vo-

Revision 2.3  2004/07/16 22:37:53  arots
Release version v1.0.

Revision 2.2  2004/07/07 16:16:22  arots
Completed conversion to substitution groups.
This version is ready for review.

revision 2.1
date: 2004/05/23 03:32:59;  author: arots;  state: Exp;  lines: +798 -1
Fixed line breaks

revision 2.0
date: 2004/05/21 21:09:17;  author: arots;  state: Exp;  lines: +1 -679
Reworking with substitution groups and generalized CoordSys & Coords.

revision 1.10
date: 2004/03/31 21:20:30;  author: arots;  state: Exp;  lines: +362 -218
Proper units and improvements.

Revision 1.9  2003/08/06 19:31:04  arots
Added time reference direction to time frame.

Revision 1.8  2003/05/15 10:04:23  arots
Allow multiple intervals, add fill factor.

Revision 1.7  2003/05/08 20:28:19  arots
Added spectral coordinate.
Fixed intervals.
Rationalized coordinate frames.

Revision 1.6  2003/05/02 18:46:43  arots
Removed coord_sys_id attribute from time interval.

Revision 1.5  2003/04/30 16:55:58  arots
Added CoordSpec to Resource and Search - was needed.

Revision 1.4  2003/04/30 13:27:12  arots
Fixed up change log, changed schema locations.

Revision 1.3  2003/04/29 21:04:37  arots
Trivial.

Revision 1.2  2003/04/29 20:56:40  arots
Completed new astronTimeType and proper handling of units.

Revision 1.1  2003/04/28 16:25:34  arots
Initial revision
-->
<xs:schema xmlns:stc="http://www.ivoa.net/xml/STC/stc-v1.30.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" targetNamespace="http://www.ivoa.net/xml/STC/stc-v1.30.xsd" elementFormDefault="qualified">
  <!--<xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="http://hea-www.harvard.edu/~arots/nvometa/v1.30/xlink.xsd"/>-->
  <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/>
  <!-- CoordSystem -->
  <!-- Reference frames -->
  <xs:complexType name="coordFrameType">
    <xs:annotation>
      <xs:documentation>A CoordFrame has to have at least a name</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Name" type="xs:string" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="CoordFrame" type="stc:coordFrameType" abstract="true">
    <xs:annotation>
      <xs:documentation>CoordFrame substitution group head element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:simpleType name="coordEquinoxType">
    <xs:annotation>
      <xs:documentation>Coordinate equinox: B{year} or J{year} with at least one decimal; do not use in conjunction with ICRS</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="[BJ]\-?\d?\d?\d?\d\d\d\d\.\d\d?\d?"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="spaceRefFrameType" abstract="true">
    <xs:annotation>
      <xs:documentation>Abstract space reference frame type</xs:documentation>
    </xs:annotation>
    <xs:attribute name="epoch" type="xs:decimal" use="optional"/>
  </xs:complexType>
  <xs:complexType name="icrsType">
    <xs:annotation>
      <xs:documentation>ICRS type: no equinox</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:spaceRefFrameType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="fkType">
    <xs:annotation>
      <xs:documentation>FK[45] type: needs an equinox</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:spaceRefFrameType">
        <xs:sequence>
          <xs:element name="Equinox" type="stc:coordEquinoxType" nillable="true"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="geodType">
    <xs:annotation>
      <xs:documentation>The Geodetic reference frame; semi-major axis and inverse flattening may be provided to define the reference spheroid; the default is the IAU 1976 reference spheroid</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:icrsType">
        <xs:attribute name="radius" type="xs:double" use="optional" default="6378140"/>
        <xs:attribute name="inv_flattening" type="xs:double" use="optional" default="298.257"/>
        <xs:attribute name="unit" type="stc:posUnitType" use="optional" default="m"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="customSpaceRefFrameType">
    <xs:annotation>
      <xs:documentation>A custom space reference frame type defined through pole and X-axis directions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:spaceRefFrameType">
        <xs:sequence>
          <xs:annotation>
            <xs:documentation>Define coordinate reference frame from scratch; pole and X-axis need to be defined in a known coordinate system</xs:documentation>
          </xs:annotation>
          <xs:element name="Frame" type="xs:string"/>
          <xs:element name="Pole_Zaxis" type="stc:astroCoordsType"/>
          <xs:element name="Xaxis" type="stc:astroCoordsType"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="SpaceRefFrame" type="stc:spaceRefFrameType" abstract="true">
    <xs:annotation>
      <xs:documentation>Head element for the Coordinate reference frame substitution group: optional equinox with either a standard reference system (ICRS, FK5, FK4) and optional standard pole (equatorial, ecliptic, galactic, etc.), or a custom frame with pole (positive Z-axis) and positive X-axis direction </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="ICRS" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The ICRS reference frame</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="FK4" type="stc:fkType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>FK4; needs a Besselian epoch</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="FK5" type="stc:fkType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>FK5; needs a Julian epoch</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="ECLIPTIC" type="stc:fkType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>Ecliptic coordinates; needs an epoch</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="GALACTIC_I" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>Galactic coordinates; first system</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="GALACTIC_II" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>Galactic coordinates; second system</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="SUPER_GALACTIC" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>SuperGalactic coordinates</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="AZ_EL" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>Local Azimuth and Elevation coordinates</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="BODY" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>Generic Body coordinates</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--Solar and earth-related coordinate frames; see Fraenz & Harper 2002, Plan & Sp Sci 50, 217-->
  <xs:element name="GEO_C" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The Geocentric (co-rotating) reference frame</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="GEO_D" type="stc:geodType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The Geodetic reference frame; semi-major axis and inverse flattening may be provided to define the reference spheroid; the default is the IAU 1976 reference spheroid</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="MAG" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The Geomagnetic reference frame</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="GSE" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The Geocentric Solar Ecliptic reference frame</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="GSM" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The Geocentric Solar Magnetic reference frame</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="SM" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The Solar Magnetic reference frame</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="HGC" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The Heliographic reference frame</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="HEE" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The Heliocentric Earth Ecliptic reference frame</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="HEEQ" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The Heliocentric Earth Equatorial reference frame</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="HCI" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The Heliocentric Inertial reference frame</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="HCD" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The Heliocentric of Date reference frame</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--Planetocentric (co-rotating) system coordinate frames; see Explanatory Supplement, Sec 7.4 or Fraenz & Harper 2002, Plan & Sp Sci 50, 217, Table 6-->
  <xs:element name="MERCURY_C" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetocentric reference frame anchored on Mercury</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="VENUS_C" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetocentric reference frame anchored on Venus</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="LUNA_C" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The lunacentric reference frame anchored on the moon</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="MARS_C" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetocentric reference frame anchored on Mars</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="JUPITER_C_III" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetocentric reference frame anchored on Jupiter</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="SATURN_C_III" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetocentric reference frame anchored on Saturn</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="URANUS_C_III" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetocentric reference frame anchored on Uranus</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="NEPTUNE_C_III" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetocentric reference frame anchored on Neptune</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PLUTO_C" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetocentric reference frame anchored on Pluto</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--Planetographic (co-rotating) system coordinate frames; see Explanatory Supplement, Sec 7.4 or Fraenz & Harper 2002, Plan & Sp Sci 50, 217, Table 6-->
  <xs:element name="MERCURY_G" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetographic reference frame anchored on Mercury</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="VENUS_G" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetographic reference frame anchored on Venus</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="LUNA_G" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The lunagraphic reference frame anchored on the moon</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="MARS_G" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetographic reference frame anchored on Mars</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="JUPITER_G_III" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetographic reference frame anchored on Jupiter</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="SATURN_G_III" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetographic reference frame anchored on Saturn</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="URANUS_G_III" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetographic reference frame anchored on Uranus</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="NEPTUNE_G_III" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetographic reference frame anchored on Neptune</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PLUTO_G" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>The planetographic reference frame anchored on Pluto</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--Unknown space reference frame; the client is responsible for assigning a default-->
  <xs:element name="UNKNOWNFrame" type="stc:icrsType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>Unknown space reference frame; the client is responsible for assigning a default</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--The Custom frame-->
  <xs:element name="CustomSpaceRefFrame" type="stc:customSpaceRefFrameType" substitutionGroup="stc:SpaceRefFrame">
    <xs:annotation>
      <xs:documentation>Coordinate reference frame: a custom pole (positive Z-axis) and positive X-axis direction </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:simpleType name="planetaryEphemType">
    <xs:annotation>
      <xs:documentation>If solar system positions are implied anywhere, the planetary ephemeris to be used needs to be provided - usually JPL-DE405 with ICRS and JPL-DE200 with FK5</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="JPL-DE200"/>
      <xs:enumeration value="JPL-DE405"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="referencePositionType" abstract="true">
    <xs:annotation>
      <xs:documentation>Abstract type for reference positions</xs:documentation>
    </xs:annotation>
  </xs:complexType>
  <xs:complexType name="stdRefPosType">
    <xs:annotation>
      <xs:documentation>Type for standard reference positions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:referencePositionType">
        <xs:sequence>
          <xs:element name="PlanetaryEphem" type="stc:planetaryEphemType" nillable="true" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="customRefPosType">
    <xs:annotation>
      <xs:documentation>Type for custom positions: specifies reference origin</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:referencePositionType">
        <xs:sequence>
          <xs:element name="CoordOrigin" type="stc:astroCoordsType"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ReferencePosition" type="stc:referencePositionType" abstract="true">
    <xs:annotation>
      <xs:documentation>Head element from the ReferencePosition substitution group: either a "known place" such as geocenter or barycenter (RefPos), or a position defined in a known coordinate system (CoordOrigin)</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="TOPOCENTER" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Location of the observer/telescope</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="BARYCENTER" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Barycenter of the solar system</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="HELIOCENTER" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Center of the sun</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="GEOCENTER" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Center of the earth</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="LSR" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>(Kinematic) Local Standard of Rest (only used for Doppler velocities); equivalent to LSRK</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="LSRK" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Kinematic Local Standard of Rest (only used for Doppler velocities); equivalent to LSR</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="LSRD" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Dynamic Local Standard of Rest (only used for Doppler velocities)</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="GALACTIC_CENTER" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Center of the Galaxy</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="LOCAL_GROUP_CENTER" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Center of the Local Group</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="MOON" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Center of the Moon</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="EMBARYCENTER" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Barycenter of the Earth-Moon system</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="MERCURY" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Center of Mercury</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="VENUS" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Center of Venus</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="MARS" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Center of Mars</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="JUPITER" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Center of Jupiter</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="SATURN" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Center of Saturn</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="URANUS" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Center of Uranus</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="NEPTUNE" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Center of Neptune</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PLUTO" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Center of Pluto</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="RELOCATABLE" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>A relocatable origin, especially useful for simulations</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="UNKNOWNRefPos" type="stc:stdRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Unknown origin; the client is responsible for assigning a default</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="CustomRefPos" type="stc:customRefPosType" substitutionGroup="stc:ReferencePosition">
    <xs:annotation>
      <xs:documentation>Origin of the coordinate system, given as a position in another, known, coordinate system</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="coordFlavorType">
    <xs:annotation>
      <xs:documentation>Provides the spatial coordinate definitions: number of axes, SPHERICAL, CARTESIAN, UNITSPHERE, POLAR, or HEALPIX, presence of velocities</xs:documentation>
    </xs:annotation>
    <xs:attribute name="coord_naxes" default="2">
      <xs:simpleType>
        <xs:restriction base="xs:integer">
          <xs:minInclusive value="1"/>
          <xs:maxInclusive value="3"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="coord_vel" type="xs:boolean" default="false"/>
  </xs:complexType>
  <xs:complexType name="healpixType">
    <xs:annotation>
      <xs:documentation>2-D Healpix coordinates; defaults for H(4) and K(3)</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordFlavorType">
        <xs:attribute name="healpix_H" type="xs:integer" default="4"/>
        <xs:attribute name="healpix_K" type="xs:integer" default="3"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="CoordFlavor" type="stc:coordFlavorType" abstract="true">
    <xs:annotation>
      <xs:documentation>Abstract head element for the CoordFlavor substitution group</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="SPHERICAL" type="stc:coordFlavorType" substitutionGroup="stc:CoordFlavor">
    <xs:annotation>
      <xs:documentation>Spherical 2-D (longitude, latitude) or 3-D (long, lat, radius/elevation) coordinates</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="CARTESIAN" type="stc:coordFlavorType" substitutionGroup="stc:CoordFlavor">
    <xs:annotation>
      <xs:documentation>Cartesian 1-, 2-, or 3-D coordinates</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="UNITSPHERE" type="stc:coordFlavorType" substitutionGroup="stc:CoordFlavor">
    <xs:annotation>
      <xs:documentation>3-D Unit sphere coordinates (direction cosines); in (long,lat), X is in the direction (0,0), Y (pi/2,0), Z (0,pi/2)</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="POLAR" type="stc:coordFlavorType" substitutionGroup="stc:CoordFlavor">
    <xs:annotation>
      <xs:documentation>2-D polar coordinates (radius, posangle)</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="HEALPIX" type="stc:healpixType" substitutionGroup="stc:CoordFlavor">
    <xs:annotation>
      <xs:documentation>2-D Healpix coordinates; defaults for H(4) and K(3)</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="spaceFrameType">
    <xs:annotation>
      <xs:documentation>A spatial coordinate frame consists of a coordinate frame, a reference position, a flavor, and, optionally, an offset center</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordFrameType">
        <xs:sequence>
          <xs:element ref="stc:SpaceRefFrame">
            <xs:annotation>
              <xs:documentation>Coordinate reference frame: optional equinox with either a standard reference system (ICRS, FK5, FK4) and optional standard pole (equatorial, ecliptic, galactic, etc.), or pole (positive Z-axis) and positive X-axis direction </xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element ref="stc:ReferencePosition">
            <xs:annotation>
              <xs:documentation>Origin of the coordinate reference frame: either a "known place" such as geocenter or barycenter, or a position defined in a known coordinate system</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="OffsetCenter" type="stc:coordValueType" minOccurs="0"/>
          <xs:element ref="stc:CoordFlavor">
            <xs:annotation>
              <xs:documentation>Provides the coordinate definitions: number of axes, SPHERICAL, CARTESIAN, UNITSPHERE, POLAR, or HEALPIX, presence of velocities</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="timeFrameType">
    <xs:annotation>
      <xs:documentation>The time reference frame consists of a timescale, a reference position, and optionally a reference direction (needed when transformations have been applied)</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordFrameType">
        <xs:sequence>
          <xs:element name="TimeScale" type="stc:timeScaleType" default="TT">
            <xs:annotation>
              <xs:documentation>The time reference frame consists of a time scale, a time format, and a reference time, if needed</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element ref="stc:ReferencePosition">
            <xs:annotation>
              <xs:documentation>Origin of the coordinate reference frame: either a "known place" such as geocenter or barycenter, or a position defined in a known coordinate system</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="TimeRefDirection" type="stc:astroCoordsType" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Some time transformations (e.g., change of RefPos) depend on an assumed directonal position of the source</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="spectralFrameType">
    <xs:annotation>
      <xs:documentation>Contains the spectral frame reference position</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordFrameType">
        <xs:sequence>
          <xs:element ref="stc:ReferencePosition">
            <xs:annotation>
              <xs:documentation>The reference frame for the spectral scale; note presence of LSR</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="dopplerDefinitionType">
    <xs:annotation>
      <xs:documentation>The Doppler definition used: optical, radio, or pseudo-relativistic (i.e., how is a redshift converted to a velocity); the most common is optical, except when the reference is LSR (usually radio)</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="OPTICAL"/>
      <xs:enumeration value="RADIO"/>
      <xs:enumeration value="RELATIVISTIC"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="redshiftFrameType">
    <xs:annotation>
      <xs:documentation>Contains the Doppler definitions, including whether the values are velocity or redshift (value_type)</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordFrameType">
        <xs:sequence>
          <xs:element name="DopplerDefinition" type="stc:dopplerDefinitionType" nillable="true">
            <xs:annotation>
              <xs:documentation>The Doppler definition used: optical, radio, or pseudo-relativistic (i.e., how is a redshift converted to a velocity); the most common is optical, except when the reference is LSR (usually radio)</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element ref="stc:ReferencePosition">
            <xs:annotation>
              <xs:documentation>The reference frame for the Doppler velocities or redshfts; note presence of LSR</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="value_type" use="optional" default="VELOCITY">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="VELOCITY"/>
              <xs:enumeration value="REDSHIFT"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <!--CoordSys definition-->
  <xs:complexType name="coordSysType">
    <xs:annotation>
      <xs:documentation>Coordinate system definition: a collection of coordinate frames</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcBaseType">
        <xs:annotation>
          <xs:documentation>A CoordSys consists of at least one coordinate frames; unfortunately, schema inheritance and polymorphism doesn't allow us to specify this in the most genarl way</xs:documentation>
        </xs:annotation>
        <xs:sequence maxOccurs="unbounded">
          <xs:element ref="stc:TimeFrame" minOccurs="0"/>
          <xs:element ref="stc:SpaceFrame" minOccurs="0"/>
          <xs:element ref="stc:SpectralFrame" minOccurs="0"/>
          <xs:element ref="stc:RedshiftFrame" minOccurs="0"/>
          <xs:element ref="stc:GenericCoordFrame" minOccurs="0" maxOccurs="unbounded"/>
          <xs:element ref="stc:PixelCoordFrame" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="CoordSys" type="stc:coordSysType" nillable="true">
    <xs:annotation>
      <xs:documentation>Head element (not abstract) of the CoordSys group</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!-- AstroCoordSystem -->
  <xs:element name="TimeFrame" type="stc:timeFrameType" substitutionGroup="stc:CoordFrame">
    <xs:annotation>
      <xs:documentation>The time coordinate reference frame</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="SpaceFrame" type="stc:spaceFrameType" substitutionGroup="stc:CoordFrame">
    <xs:annotation>
      <xs:documentation>The spatial coordinate reference frame</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="SpectralFrame" type="stc:spectralFrameType" substitutionGroup="stc:CoordFrame">
    <xs:annotation>
      <xs:documentation>The reference frame for the spectral coordinate; note presence of LSR</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="RedshiftFrame" type="stc:redshiftFrameType" substitutionGroup="stc:CoordFrame">
    <xs:annotation>
      <xs:documentation>Contains the Doppler definitions, including whether the values are velocity or redshift (value_type)</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PixelCoordFrame" type="stc:coordFrameType" substitutionGroup="stc:CoordFrame">
    <xs:annotation>
      <xs:documentation>Element for pixel Coordinate Frames</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="GenericCoordFrame" type="stc:coordFrameType" substitutionGroup="stc:CoordFrame">
    <xs:annotation>
      <xs:documentation>Element for generic Coordinate Frames</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="astroCoordSystemType">
    <xs:annotation>
      <xs:documentation>The astronomical coordinate system definition: spatial coordinate frame and reference position; time frame and reference position; the coordinate flavor; spectral frame and (optionally) Doppler frame; and the planetary ephemeris; an ID is required, since this is how coordinate elements are associated with their coordinate systems</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:restriction base="stc:coordSysType">
        <xs:sequence>
          <xs:element ref="stc:TimeFrame" minOccurs="0"/>
          <xs:element ref="stc:SpaceFrame" minOccurs="0"/>
          <xs:element ref="stc:SpectralFrame" minOccurs="0"/>
          <xs:element ref="stc:RedshiftFrame" minOccurs="0"/>
          <xs:element ref="stc:GenericCoordFrame" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="AstroCoordSystem" type="stc:astroCoordSystemType" substitutionGroup="stc:CoordSys" nillable="true">
    <xs:annotation>
      <xs:documentation>The coordinate system definition: spatial coordinate frame and reference position; time frame and reference position; the coordinate flavor; the spectral fromae and redshift/Doppler frame; and the planetary ephemeris; an ID is required, since this is how coordinate elements are associated with their coordinate systems</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--Pixel coordinate system-->
  <xs:complexType name="pixelCoordSystemType">
    <xs:annotation>
      <xs:documentation>The pixel coordinate system definition</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:restriction base="stc:coordSysType">
        <xs:sequence maxOccurs="unbounded">
          <xs:element ref="stc:PixelCoordFrame"/>
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="PixelCoordSystem" type="stc:pixelCoordSystemType" substitutionGroup="stc:CoordSys" nillable="true">
    <xs:annotation>
      <xs:documentation>Pixel form of CoordSys</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--  ###################  Start of the former coords.xsd -->
  <!-- Attribute types: units and time scale-->
  <xs:simpleType name="unitType">
    <xs:annotation>
      <xs:documentation>Basic unit type</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string"/>
  </xs:simpleType>
  <xs:simpleType name="timeUnitType">
    <xs:annotation>
      <xs:documentation>Time units may be second (s), hour (h: 3600 s), day (d: 86400 s), Julian year (a, yr: 365.25 d), Julian century (cy: 36525 d), or empty (i.e., dimensionless) for ISO-8601 format</xs:documentation>
    </xs:annotation>
    <xs:restriction base="stc:unitType">
      <xs:enumeration value="s"/>
      <xs:enumeration value="h"/>
      <xs:enumeration value="d"/>
      <xs:enumeration value="a"/>
      <xs:enumeration value="yr"/>
      <xs:enumeration value="cy"/>
      <xs:enumeration value=""/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="posUnitType">
    <xs:annotation>
      <xs:documentation>Spatial coordinate units may be angular (degrees, radians, hours, arcmins, arcsecs), linear (meters, km, mm, AUs, parsecs, kpc, Mpc, lightyears), or empty (i.e., dimensionless).  The three-units strings are for special 3-D vectors where the components do not share the same unit; one may prefer to give each component its own unit, instead.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="stc:unitType">
      <xs:enumeration value="deg"/>
      <xs:enumeration value="deg deg m"/>
      <xs:enumeration value="deg deg Mpc"/>
      <xs:enumeration value="rad"/>
      <xs:enumeration value="h"/>
      <xs:enumeration value="arcmin"/>
      <xs:enumeration value="arcsec"/>
      <xs:enumeration value="m"/>
      <xs:enumeration value="km"/>
      <xs:enumeration value="mm"/>
      <xs:enumeration value="AU"/>
      <xs:enumeration value="pc"/>
      <xs:enumeration value="kpc"/>
      <xs:enumeration value="Mpc"/>
      <xs:enumeration value="lyr"/>
      <xs:enumeration value=""/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="angleUnitType">
    <xs:annotation>
      <xs:documentation>Angular coordinate units may be degrees, radians, hours, arcmins, arcsecs</xs:documentation>
    </xs:annotation>
    <xs:restriction base="stc:unitType">
      <xs:enumeration value="deg"/>
      <xs:enumeration value="rad"/>
      <xs:enumeration value="h"/>
      <xs:enumeration value="arcmin"/>
      <xs:enumeration value="arcsec"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="posAngleReferenceType">
    <xs:annotation>
      <xs:documentation>Position angles may be counted from North (through East), (positive) X (to positive Y), or (positive) Y (to positive X) axis</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="North"/>
      <xs:enumeration value="X"/>
      <xs:enumeration value="Y"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="velTimeUnitType">
    <xs:annotation>
      <xs:documentation>Velocity units are a posUnitType / velTimeType; the latter may be second, day, hour, year (a or yr), century, but not empty</xs:documentation>
    </xs:annotation>
    <xs:restriction base="stc:unitType">
      <xs:enumeration value="s"/>
      <xs:enumeration value="h"/>
      <xs:enumeration value="d"/>
      <xs:enumeration value="a"/>
      <xs:enumeration value="yr"/>
      <xs:enumeration value="cy"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="spectralUnitType">
    <xs:annotation>
      <xs:documentation>Spectral units may be frequency (Hz, kHz, MHz, GHz), wavelength (meters, mm, micron, nm, Angstrom), or energy (eV, keV, MeV, GeV, TeV)</xs:documentation>
    </xs:annotation>
    <xs:restriction base="stc:unitType">
      <xs:enumeration value="Hz"/>
      <xs:enumeration value="kHz"/>
      <xs:enumeration value="MHz"/>
      <xs:enumeration value="GHz"/>
      <xs:enumeration value="m"/>
      <xs:enumeration value="mm"/>
      <xs:enumeration value="um"/>
      <xs:enumeration value="nm"/>
      <xs:enumeration value="Angstrom"/>
      <xs:enumeration value="eV"/>
      <xs:enumeration value="keV"/>
      <xs:enumeration value="MeV"/>
      <xs:enumeration value="GeV"/>
      <xs:enumeration value="TeV"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="timeScaleType">
    <xs:annotation>
      <xs:documentation>The actual time scale used: TT, TAI, UTC, TDB, etc.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="TT">
        <xs:annotation>
          <xs:documentation>Terrestrial Time; the basis for ephemerides</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TDT">
        <xs:annotation>
          <xs:documentation>Obsolete synonym for TT</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ET">
        <xs:annotation>
          <xs:documentation>Ephemeris Time; predecessor of, and continuous with, TT</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TDB">
        <xs:annotation>
          <xs:documentation>Barycentric Dynamic Time:the independent variable in planetay ephemerides; time at the solar system barycenter synchronous with TT on an annual basis; sometimes called TEB</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TEB">
        <xs:annotation>
          <xs:documentation>Barycentric Ephemeris Time: time at the solar system barycenter synchronous with TT on an annual basis; a deprecated synonym of TDB.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TCG">
        <xs:annotation>
          <xs:documentation>Terrestrial Coordinate Time</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TCB">
        <xs:annotation>
          <xs:documentation>Barycentric Coordinate Time; runs slower than TDB but is consistent with physical constants</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TAI">
        <xs:annotation>
          <xs:documentation>International Atomic Time; runs 32.184 s behind TT</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="IAT">
        <xs:annotation>
          <xs:documentation>Synonym for TAI</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="UTC">
        <xs:annotation>
          <xs:documentation>Coordinated Universal Time; currently (2006) runs 33 leapseconds behind TAI</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="LST">
        <xs:annotation>
          <xs:documentation>Local Siderial Time; only for ground-based observations; note that the second is shorter</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="LOCAL">
        <xs:annotation>
          <xs:documentation>Only to be used for simulations in conjunction with a relocatable spatial frame</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="posAngleType">
    <xs:annotation>
      <xs:documentation>Position angles are doubles and include optionally a unit attribute (default deg) and a reference attribute (default X)</xs:documentation>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:double">
        <xs:attribute name="unit" type="stc:angleUnitType" default="deg"/>
        <xs:attribute name="reference" type="stc:posAngleReferenceType" default="X"/>
        <xs:attributeGroup ref="stc:STCReference"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:attributeGroup name="STCReference">
    <xs:annotation>
      <xs:documentation>These four attributes represent the standard IVOA referencing system: internal (within the document) referencing through "id" and "idref", external referencing through Xlink, using only "type=simple" and "href".</xs:documentation>
    </xs:annotation>
    <xs:attribute name="id" type="xs:ID" use="optional"/>
    <xs:attribute name="idref" type="xs:IDREF" use="optional"/>
    <xs:attribute ref="xlink:type" use="optional" default="simple"/>
    <xs:attribute ref="xlink:href" use="optional"/>
  </xs:attributeGroup>
  <xs:complexType name="stcBaseType" abstract="true">
    <xs:annotation>
      <xs:documentation>STC standard base type. Elements of derived types may contain real content, be a reference to another element in the document (idref), or be a reference to a distributed resource; the href is to be a standard IVOA identifier or a valid URL. Actuation is up to the client. At this time it is required to be of type simple. An id is optional; it allows referencing by other elements.</xs:documentation>
    </xs:annotation>
    <xs:attributeGroup ref="stc:STCReference"/>
  </xs:complexType>
  <!--The definition of astronTimeType-->
  <xs:element name="AbsoluteTime" type="xs:anyType" abstract="true">
    <xs:annotation>
      <xs:documentation>Substitution group for absoluteTimeType component of astronTimeType</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="isoTimeType">
    <xs:annotation>
      <xs:documentation>ISO8601 time; note: only a limited subset of ISO 8601 is allowed: yyyy-mm-ddThh:mm:ss.sss...; unfortunately, XSchema does not allow hh, mm, or ss to be optional, ".ss" is.</xs:documentation>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:dateTime">
        <xs:attributeGroup ref="stc:STCReference"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="jdTimeType">
    <xs:annotation>
      <xs:documentation>A decimal type for JD and MJD, with optional referencing</xs:documentation>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:decimal">
        <xs:attributeGroup ref="stc:STCReference"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:simpleType name="relocatableOriginType">
    <xs:restriction base="xs:string">
      <xs:annotation>
        <xs:documentation>A relocatable time origin for simulations</xs:documentation>
      </xs:annotation>
      <xs:enumeration value="RELOCATABLE"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="timeOffsetType">
    <xs:annotation>
      <xs:documentation>Actual elapsed time offset</xs:documentation>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:decimal">
        <xs:attributeGroup ref="stc:STCReference"/>
        <xs:attribute name="unit" type="stc:timeUnitType" use="optional" default="s"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:element name="ISOTime" type="stc:isoTimeType" substitutionGroup="stc:AbsoluteTime">
    <xs:annotation>
      <xs:documentation>ISO8601 time; note: only a limited subset of ISO 8601 is allowed: yyyy-mm-ddThh:mm:ss.sss...; only ".sss..." is optional</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="JDTime" type="stc:jdTimeType" substitutionGroup="stc:AbsoluteTime">
    <xs:annotation>
      <xs:documentation>JD time</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="MJDTime" type="stc:jdTimeType" substitutionGroup="stc:AbsoluteTime">
    <xs:annotation>
      <xs:documentation>MJD time (=JD - 2400000.5)</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="TimeOrigin" type="stc:relocatableOriginType" substitutionGroup="stc:AbsoluteTime">
    <xs:annotation>
      <xs:documentation>A relocatable time origin for simulations</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="TimeOffset" type="stc:timeOffsetType">
    <xs:annotation>
      <xs:documentation>Actual elapsed time offset</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="astronTimeType">
    <xs:annotation>
      <xs:documentation>astronTime is the generalized astronomical time type and consists of one, two, or three elements: optional TimeScale, optional relative time offset, and an absolute time (ISO8601 or a decimal JD or MJD; or it may be an IDREF to one of those three); TimeScale may be omitted only if the element is part of AstroCoords, referring to an AstroCoordSystem that specifies a TimeScale.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Timescale" type="stc:timeScaleType" minOccurs="0"/>
      <xs:element ref="stc:TimeOffset" minOccurs="0"/>
      <xs:element ref="stc:AbsoluteTime"/>
    </xs:sequence>
  </xs:complexType>
  <!--Some specific vectors of doubles-->
  <!--The original array type, abandoned for the time being (or forever):
    <xs:simpleType name="doubleArrayType">
      <xs:annotation>
        <xs:documentation>For vector coordinates we need arrays of doubles</xs:documentation>
      </xs:annotation>
      <xs:list itemType="xs:double"/>
    </xs:simpleType>
  -->
  <xs:complexType name="double1Type">
    <xs:annotation>
      <xs:documentation>A double with referencing and units attributes</xs:documentation>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:double">
        <xs:attributeGroup ref="stc:STCReference"/>
        <xs:attribute name="time_unit" type="stc:timeUnitType" use="optional"/>
        <xs:attribute name="pos_unit" type="stc:posUnitType" use="optional"/>
        <xs:attribute name="pos_angle_unit" type="stc:angleUnitType" use="optional"/>
        <xs:attribute name="vel_time_unit" type="stc:velTimeUnitType" use="optional"/>
        <xs:attribute name="spectral_unit" type="stc:spectralUnitType" use="optional"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="double2Type">
    <xs:annotation>
      <xs:documentation>A vector of 2 doubles; components are now separated.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcBaseType">
        <xs:sequence>
          <xs:element name="C1" type="stc:double1Type"/>
          <xs:element name="C2" type="stc:double1Type"/>
        </xs:sequence>
        <xs:attribute name="unit" type="stc:posUnitType" use="optional"/>
        <xs:attribute name="vel_time_unit" type="stc:velTimeUnitType" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="double3Type">
    <xs:annotation>
      <xs:documentation>A vector of 3 doubles with separated components</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcBaseType">
        <xs:sequence>
          <xs:element name="C1" type="stc:double1Type"/>
          <xs:element name="C2" type="stc:double1Type"/>
          <xs:element name="C3" type="stc:double1Type"/>
        </xs:sequence>
        <xs:attribute name="unit" type="stc:posUnitType" use="optional"/>
        <xs:attribute name="vel_time_unit" type="stc:velTimeUnitType" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="double4Type">
    <xs:annotation>
      <xs:documentation>A vector of 4 doubles (2x2 matrix)</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcBaseType">
        <xs:sequence>
          <xs:element name="M11" type="xs:double"/>
          <xs:element name="M12" type="xs:double"/>
          <xs:element name="M21" type="xs:double"/>
          <xs:element name="M22" type="xs:double"/>
        </xs:sequence>
        <xs:attribute name="unit" type="stc:posUnitType" use="optional"/>
        <xs:attribute name="vel_time_unit" type="stc:velTimeUnitType" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="double9Type">
    <xs:annotation>
      <xs:documentation>A vector of 9 doubles (3x3 matrix)</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcBaseType">
        <xs:sequence>
          <xs:element name="M11" type="xs:double"/>
          <xs:element name="M12" type="xs:double"/>
          <xs:element name="M13" type="xs:double"/>
          <xs:element name="M21" type="xs:double"/>
          <xs:element name="M22" type="xs:double"/>
          <xs:element name="M23" type="xs:double"/>
          <xs:element name="M31" type="xs:double"/>
          <xs:element name="M32" type="xs:double"/>
          <xs:element name="M33" type="xs:double"/>
        </xs:sequence>
        <xs:attribute name="unit" type="stc:posUnitType" use="optional"/>
        <xs:attribute name="vel_time_unit" type="stc:velTimeUnitType" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="curve2Type">
    <xs:annotation>
      <xs:documentation>A curve in 2-D space, defined by its end points and a shape attribute (default: line or great circle)</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="P1" type="stc:double2Type"/>
      <xs:element name="P2" type="stc:double2Type"/>
    </xs:sequence>
    <xs:attribute name="curve_shape" type="xs:string" use="optional" default="line"/>
  </xs:complexType>
  <xs:complexType name="curve3Type">
    <xs:annotation>
      <xs:documentation>A curve in 3-D space, defined by its end points and a shape attribute (default: line or great circle)</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="P1" type="stc:double3Type"/>
      <xs:element name="P2" type="stc:double3Type"/>
    </xs:sequence>
    <xs:attribute name="curve_shape" type="xs:string" use="optional" default="line"/>
  </xs:complexType>
  <!--Substitution group for coordinate values-->
  <xs:element name="CoordValue" type="xs:anyType" abstract="true">
    <xs:annotation>
      <xs:documentation>The head element for the CoordinateValue substitution group</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="coordValueType">
    <xs:annotation>
      <xs:documentation>A type that just holds a 1-3D coordinate value</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element ref="stc:CoordValue"/>
    </xs:sequence>
  </xs:complexType>
  <!--Substitution groups for 1-D coordinates -->
  <xs:element name="Value" type="stc:double1Type" substitutionGroup="stc:CoordValue">
    <xs:annotation>
      <xs:documentation>double</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Error" type="stc:double1Type">
    <xs:annotation>
      <xs:documentation>double</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Resolution" type="stc:double1Type">
    <xs:annotation>
      <xs:documentation>double</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Size" type="stc:double1Type">
    <xs:annotation>
      <xs:documentation>double</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PixSize" type="stc:double1Type">
    <xs:annotation>
      <xs:documentation>double</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--1-D coordinate types-->
  <xs:complexType name="coordinateType" abstract="true">
    <xs:annotation>
      <xs:documentation>Abstract coordinate type; a concrete Coordinate consists of a Value, Error, Resolution, Size, and PixSize</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcBaseType">
        <xs:sequence>
          <xs:element name="Name" type="xs:string" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="posCoordinateType" abstract="true">
    <xs:annotation>
      <xs:documentation>Abstract coordinate type for position coordinates: add units</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordinateType">
        <xs:attribute name="unit" type="stc:posUnitType" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="velCoordinateType" abstract="true">
    <xs:annotation>
      <xs:documentation>Abstract coordinate type for velocity coordinates: add units</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordinateType">
        <xs:attribute name="unit" type="stc:posUnitType" use="optional"/>
        <xs:attribute name="vel_time_unit" type="stc:velTimeUnitType" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="basicCoordinateType">
    <xs:annotation>
      <xs:documentation>Basic scalar coordinate type</xs:documentation>
      <xs:documentation>Single Error, Resolution, Size, PixSize elements indicate definite values; pairs indicate ranges</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordinateType">
        <xs:sequence>
          <xs:element ref="stc:Value" minOccurs="0"/>
          <xs:element ref="stc:Error" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:Resolution" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:Size" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:PixSize" minOccurs="0" maxOccurs="2"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="scalarCoordinateType">
    <xs:annotation>
      <xs:documentation>Generic scalar coordinate type: a basic scalar coordinate with units</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:basicCoordinateType">
        <xs:attribute name="unit" type="xs:string" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="posVector1CoordinateType">
    <xs:annotation>
      <xs:documentation>Position scalar coordinate type; sibling of basicCoordinateType</xs:documentation>
      <xs:documentation>Single Error, Resolution, Size, PixSize elements indicate definite values; pairs indicate ranges</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:posCoordinateType">
        <xs:sequence>
          <xs:element ref="stc:Value" minOccurs="0"/>
          <xs:element ref="stc:Error" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:Resolution" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:Size" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:PixSize" minOccurs="0" maxOccurs="2"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="velVector1CoordinateType">
    <xs:annotation>
      <xs:documentation>Velocity scalar coordinate type; sibling of basicCoordinateType</xs:documentation>
      <xs:documentation>Single Error, Resolution, Size, PixSize elements indicate definite values; pairs indicate ranges</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:velCoordinateType">
        <xs:sequence>
          <xs:element ref="stc:Value" minOccurs="0"/>
          <xs:element ref="stc:Error" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:Resolution" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:Size" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:PixSize" minOccurs="0" maxOccurs="2"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="timeCoordinateType">
    <xs:annotation>
      <xs:documentation>Time coordinate type; sibling of basicCoordinateType</xs:documentation>
      <xs:documentation>Single Error, Resolution, Size, PixSize elements indicate definite values; pairs indicate ranges</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordinateType">
        <xs:sequence>
          <xs:element name="TimeInstant" type="stc:astronTimeType" minOccurs="0"/>
          <xs:element ref="stc:Error" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:Resolution" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:Size" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:PixSize" minOccurs="0" maxOccurs="2"/>
        </xs:sequence>
        <xs:attribute name="unit" type="stc:timeUnitType" use="optional" default="s"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <!--Substitution groups for 2-D coordinates -->
  <xs:complexType name="size2Type">
    <xs:annotation>
      <xs:documentation>Consists of a Size (2 doubles) and optional position angle element</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Size" type="stc:double2Type"/>
      <xs:element name="PosAngle" type="stc:posAngleType" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="CValue2" type="xs:anyType" abstract="true" substitutionGroup="stc:CoordValue">
    <xs:annotation>
      <xs:documentation>Substitution group for a 2-D coordinate value</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Value2" type="stc:double2Type" substitutionGroup="stc:CValue2">
    <xs:annotation>
      <xs:documentation>double vector</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Curve2" type="stc:curve2Type" substitutionGroup="stc:CValue2">
    <xs:annotation>
      <xs:documentation>Curve in 2-D</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="CError2" type="xs:anyType" abstract="true">
    <xs:annotation>
      <xs:documentation>Substitution group for a 2-D coordinate error</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Error2Radius" type="stc:double1Type" substitutionGroup="stc:CError2">
    <xs:annotation>
      <xs:documentation>double: radius of a 2-D error circle</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Error2" type="stc:double2Type" substitutionGroup="stc:CError2">
    <xs:annotation>
      <xs:documentation>2 doubles Error element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Error2PA" type="stc:size2Type" substitutionGroup="stc:CError2">
    <xs:annotation>
      <xs:documentation>size2Type Error element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Error2Matrix" type="stc:double4Type" substitutionGroup="stc:CError2">
    <xs:annotation>
      <xs:documentation>2x2 matrix Error element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="CResolution2" type="xs:anyType" abstract="true">
    <xs:annotation>
      <xs:documentation>Substitution group for a 2-D coordinate resolution</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Resolution2Radius" type="stc:double1Type" substitutionGroup="stc:CResolution2">
    <xs:annotation>
      <xs:documentation>double: radius of a 2-D circular resolution</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Resolution2" type="stc:double2Type" substitutionGroup="stc:CResolution2">
    <xs:annotation>
      <xs:documentation>2 doubles Resolution element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Resolution2PA" type="stc:size2Type" substitutionGroup="stc:CResolution2">
    <xs:annotation>
      <xs:documentation>size2Type Resolution element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Resolution2Matrix" type="stc:double4Type" substitutionGroup="stc:CResolution2">
    <xs:annotation>
      <xs:documentation>2x2 matrix Resolution element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="CSize2" type="xs:anyType" abstract="true">
    <xs:annotation>
      <xs:documentation>Substitution group for a 2-D coordinate size</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Size2Radius" type="stc:double1Type" substitutionGroup="stc:CSize2">
    <xs:annotation>
      <xs:documentation>double: radius of a 2-D circle</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Size2" type="stc:double2Type" substitutionGroup="stc:CSize2">
    <xs:annotation>
      <xs:documentation>2 doubles Size element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Size2PA" type="stc:size2Type" substitutionGroup="stc:CSize2">
    <xs:annotation>
      <xs:documentation>size2Type Size element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Size2Matrix" type="stc:double4Type" substitutionGroup="stc:CSize2">
    <xs:annotation>
      <xs:documentation>2x2 matrix Size element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="CPixSize2" type="xs:anyType" abstract="true">
    <xs:annotation>
      <xs:documentation>Substitution group for a 2-D coordinate pixel size</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PixSize2" type="stc:double2Type" substitutionGroup="stc:CPixSize2">
    <xs:annotation>
      <xs:documentation>2 doubles PixSize element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PixSize2PA" type="stc:size2Type" substitutionGroup="stc:CPixSize2">
    <xs:annotation>
      <xs:documentation>size2Type PixSize element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PixSize2Matrix" type="stc:double4Type" substitutionGroup="stc:CPixSize2">
    <xs:annotation>
      <xs:documentation>2x2 matrix PixSize element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--2-D coordinate types-->
  <xs:complexType name="posVector2CoordinateType">
    <xs:annotation>
      <xs:documentation>Posiion 2-D coordinate type</xs:documentation>
      <xs:documentation>Single CError2, CResolution2, CSize2, CPixSize2 elements indicate definite values; pairs indicate ranges</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:posCoordinateType">
        <xs:sequence>
          <xs:element name="Name1" type="xs:string" minOccurs="0"/>
          <xs:element name="Name2" type="xs:string" minOccurs="0"/>
          <xs:element ref="stc:CValue2" minOccurs="0"/>
          <xs:element ref="stc:CError2" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:CResolution2" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:CSize2" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:CPixSize2" minOccurs="0" maxOccurs="2"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="velVector2CoordinateType">
    <xs:annotation>
      <xs:documentation>Velocity 2-D coordinate type</xs:documentation>
      <xs:documentation>Single CError2, CResolution2, CSize2, CPixSize2 elements indicate definite values; pairs indicate ranges</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:velCoordinateType">
        <xs:sequence>
          <xs:element name="Name1" type="xs:string" minOccurs="0"/>
          <xs:element name="Name2" type="xs:string" minOccurs="0"/>
          <xs:element ref="stc:CValue2" minOccurs="0"/>
          <xs:element ref="stc:CError2" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:CResolution2" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:CSize2" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:CPixSize2" minOccurs="0" maxOccurs="2"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <!--Substitution groups for 3-D coordinates -->
  <xs:complexType name="size3Type">
    <xs:annotation>
      <xs:documentation>Consists of a Size (3 doubles) and optional position angle element</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Size" type="stc:double3Type"/>
      <xs:element name="PosAngle1" type="stc:posAngleType" minOccurs="0"/>
      <xs:element name="PosAngle2" type="stc:posAngleType" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="CValue3" type="xs:anyType" abstract="true" substitutionGroup="stc:CoordValue">
    <xs:annotation>
      <xs:documentation>Substitution group for a 3-D coordinate value</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Value3" type="stc:double3Type" substitutionGroup="stc:CValue3">
    <xs:annotation>
      <xs:documentation>Vector of 3 doubles</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Curve3" type="stc:curve3Type" substitutionGroup="stc:CValue3">
    <xs:annotation>
      <xs:documentation>Curve in 3-D</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="CError3" type="xs:anyType" abstract="true">
    <xs:annotation>
      <xs:documentation>Substitution group for a 3-D coordinate error</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Error3Radius" type="stc:double1Type" substitutionGroup="stc:CError3">
    <xs:annotation>
      <xs:documentation>double: radius of a 3-D error sphere</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Error3" type="stc:double3Type" substitutionGroup="stc:CError3">
    <xs:annotation>
      <xs:documentation>3 doubles Error element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Error3PA" type="stc:size3Type" substitutionGroup="stc:CError3">
    <xs:annotation>
      <xs:documentation>size3Type Error element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Error3Matrix" type="stc:double9Type" substitutionGroup="stc:CError3">
    <xs:annotation>
      <xs:documentation>3x3 matrix Error element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="CResolution3" type="xs:anyType" abstract="true">
    <xs:annotation>
      <xs:documentation>Substitution group for a 3-D coordinate resolution</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Resolution3Radius" type="stc:double1Type" substitutionGroup="stc:CResolution3">
    <xs:annotation>
      <xs:documentation>double: radius of a 3-D spherical resolution</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Resolution3" type="stc:double3Type" substitutionGroup="stc:CResolution3">
    <xs:annotation>
      <xs:documentation>3 doubles Resoltuion element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Resolution3PA" type="stc:size3Type" substitutionGroup="stc:CResolution3">
    <xs:annotation>
      <xs:documentation>size3Type Resolution element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Resolution3Matrix" type="stc:double9Type" substitutionGroup="stc:CResolution3">
    <xs:annotation>
      <xs:documentation>3x3 matrix Resoltuion element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="CSize3" type="xs:anyType" abstract="true">
    <xs:annotation>
      <xs:documentation>Substitution group for a 3-D coordinate size</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Size3Radius" type="stc:double1Type" substitutionGroup="stc:CSize3">
    <xs:annotation>
      <xs:documentation>double: radius of a 3-D sphere</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Size3" type="stc:double3Type" substitutionGroup="stc:CSize3">
    <xs:annotation>
      <xs:documentation>3 doubles Size element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Size3PA" type="stc:size3Type" substitutionGroup="stc:CSize3">
    <xs:annotation>
      <xs:documentation>size3Type Size element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Size3Matrix" type="stc:double9Type" substitutionGroup="stc:CSize3">
    <xs:annotation>
      <xs:documentation>3x3 matrix Size element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="CPixSize3" type="xs:anyType" abstract="true">
    <xs:annotation>
      <xs:documentation>Substitution group for a 3-D coordinate pixel size</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PixSize3" type="stc:double3Type" substitutionGroup="stc:CPixSize3">
    <xs:annotation>
      <xs:documentation>3 doubles PixSize element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PixSize3PA" type="stc:size3Type" substitutionGroup="stc:CPixSize3">
    <xs:annotation>
      <xs:documentation>size3Type PixSize element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PixSize3Matrix" type="stc:double9Type" substitutionGroup="stc:CPixSize3">
    <xs:annotation>
      <xs:documentation>3x3 matrix PixSize element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--3-D coordinate types-->
  <xs:complexType name="posVector3CoordinateType">
    <xs:annotation>
      <xs:documentation>Position 3-D coordinate type</xs:documentation>
      <xs:documentation>Single CError3, CResolution3, CSize3, CPixSize3 elements indicate definite values; pairs indicate ranges</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:posCoordinateType">
        <xs:sequence>
          <xs:element name="Name1" type="xs:string" minOccurs="0"/>
          <xs:element name="Name2" type="xs:string" minOccurs="0"/>
          <xs:element name="Name3" type="xs:string" minOccurs="0"/>
          <xs:element ref="stc:CValue3" minOccurs="0"/>
          <xs:element ref="stc:CError3" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:CResolution3" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:CSize3" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:CPixSize3" minOccurs="0" maxOccurs="2"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="velVector3CoordinateType">
    <xs:annotation>
      <xs:documentation>Velocity 3-D coordinate type</xs:documentation>
      <xs:documentation>Single CError3, CResolution3, CSize3, CPixSize3 elements indicate definite values; pairs indicate ranges</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:velCoordinateType">
        <xs:sequence>
          <xs:element name="Name1" type="xs:string" minOccurs="0"/>
          <xs:element name="Name2" type="xs:string" minOccurs="0"/>
          <xs:element name="Name3" type="xs:string" minOccurs="0"/>
          <xs:element ref="stc:CValue3" minOccurs="0"/>
          <xs:element ref="stc:CError3" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:CResolution3" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:CSize3" minOccurs="0" maxOccurs="2"/>
          <xs:element ref="stc:CPixSize3" minOccurs="0" maxOccurs="2"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <!-- Coord Substitution Groups-->
  <xs:element name="Coordinate" type="stc:coordinateType" abstract="true">
    <xs:annotation>
      <xs:documentation>Head element of Coordinate substitution group</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="ScalarCoordinate" type="stc:scalarCoordinateType" substitutionGroup="stc:Coordinate">
    <xs:annotation>
      <xs:documentation>Generic scalar coordinate element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="stringCoordinateType">
    <xs:annotation>
      <xs:documentation>Generic string coordinate type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordinateType">
        <xs:sequence>
          <xs:element name="Value" type="xs:string"/>
        </xs:sequence>
        <xs:attribute name="unit" type="xs:string" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="pixelCoordinateType">
    <xs:annotation>
      <xs:documentation>Generic coordinate type for pixels</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordinateType">
        <xs:sequence>
          <xs:element name="Value" type="xs:double"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="StringCoordinate" type="stc:stringCoordinateType" substitutionGroup="stc:Coordinate">
    <xs:annotation>
      <xs:documentation>Generic string coordinate element</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PixelCoordinate" type="stc:pixelCoordinateType" substitutionGroup="stc:Coordinate">
    <xs:annotation>
      <xs:documentation>Generic coordinate element for pixels</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Position" type="stc:posCoordinateType" abstract="true">
    <xs:annotation>
      <xs:documentation>Head element of Position coordinate substitution group</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Position1D" type="stc:posVector1CoordinateType" substitutionGroup="stc:Position">
    <xs:annotation>
      <xs:documentation>1-D Position coordinate</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Position2D" type="stc:posVector2CoordinateType" substitutionGroup="stc:Position">
    <xs:annotation>
      <xs:documentation>2-D Position coordinate</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Position3D" type="stc:posVector3CoordinateType" substitutionGroup="stc:Position">
    <xs:annotation>
      <xs:documentation>3-D Position coordinate</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Velocity" type="stc:velCoordinateType" abstract="true">
    <xs:annotation>
      <xs:documentation>Head element of Velocity coordinate substitution group</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Velocity1D" type="stc:velVector1CoordinateType" substitutionGroup="stc:Velocity">
    <xs:annotation>
      <xs:documentation>1-D Velocity coordinate</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Velocity2D" type="stc:velVector2CoordinateType" substitutionGroup="stc:Velocity">
    <xs:annotation>
      <xs:documentation>2-D Velocity coordinate</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Velocity3D" type="stc:velVector3CoordinateType" substitutionGroup="stc:Velocity">
    <xs:annotation>
      <xs:documentation>3-D Velocity coordinate</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--FITS file type to hold coordinate values-->
  <xs:complexType name="fitsType">
    <xs:annotation>
      <xs:documentation>Specifies a FITS file and optionally a specific HDU by HDU number or HDU name</xs:documentation>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:anyURI">
        <xs:attribute name="hdu_num" type="xs:integer"/>
        <xs:attribute name="hdu_name" type="xs:string"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="coordFITSColumnsType">
    <xs:annotation>
      <xs:documentation>Refers coordinate components to specific columns in the FITS file HDU</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Name" type="xs:string" minOccurs="0"/>
      <xs:element name="Value" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>The column name for the coordinate value; comma-separated if multi-dimensional</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Error" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>The column name for the coordinate error; comma-separated if multi-dimensional</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Resolution" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>The column name for the coordinate resolution; comma-separated if multi-dimensional</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Size" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>The column name for the coordinate size; comma-separated if multi-dimensional</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PixSize" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>The column name for the coordinate pixel size; comma-separated if multi-dimensional</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="astroCoordsFileType">
    <xs:annotation>
      <xs:documentation>Coordinate references to a specific FITS file</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordinateType">
        <xs:annotation>
          <xs:documentation>Coordinate references to a specific FITS file</xs:documentation>
        </xs:annotation>
        <xs:sequence>
          <xs:element name="FITSFile" type="stc:fitsType"/>
          <xs:element name="FITSTime" type="stc:coordFITSColumnsType" minOccurs="0"/>
          <xs:element name="FITSPosition" type="stc:coordFITSColumnsType" minOccurs="0"/>
          <xs:element name="FITSVelocity" type="stc:coordFITSColumnsType" minOccurs="0"/>
          <xs:element name="FITSSpectral" type="stc:coordFITSColumnsType" minOccurs="0"/>
          <xs:element name="FITSRedshift" type="stc:coordFITSColumnsType" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <!--Some trivial coordinate types - to avoid having them declared as anonymous types-->
  <xs:complexType name="spectralCoordinateType">
    <xs:complexContent>
      <xs:extension base="stc:basicCoordinateType">
        <xs:attribute name="unit" type="stc:spectralUnitType" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="redshiftCoordinateType">
    <xs:complexContent>
      <xs:extension base="stc:basicCoordinateType">
        <xs:attribute name="unit" type="stc:posUnitType" use="optional"/>
        <xs:attribute name="vel_time_unit" type="stc:velTimeUnitType" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <!--Orbital elements-->
  <xs:complexType name="orbitType">
    <xs:annotation>
      <xs:documentation>Orbit defined by six orbital elements</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordinateType">
        <xs:sequence>
          <xs:element name="a" type="stc:double1Type">
            <xs:annotation>
              <xs:documentation>Semi-major axis</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="e" type="stc:double1Type">
            <xs:annotation>
              <xs:documentation>Eccentricity</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="i" type="stc:double1Type">
            <xs:annotation>
              <xs:documentation>Inclination</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="Node" type="stc:double1Type">
            <xs:annotation>
              <xs:documentation>Longitude of ascending node</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="Aop" type="stc:double1Type">
            <xs:annotation>
              <xs:documentation>Argument of pericenter</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="T" type="stc:astronTimeType">
            <xs:annotation>
              <xs:documentation>Epoch of pericenter</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <!-- Coords Types-->
  <xs:complexType name="coordsType">
    <xs:annotation>
      <xs:documentation>The generic coordsType</xs:documentation>
    </xs:annotation>
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:element ref="stc:Coordinate"/>
    </xs:sequence>
    <xs:attribute name="coord_system_id" type="xs:IDREF" use="required"/>
  </xs:complexType>
  <xs:complexType name="astroCoordsType">
    <xs:annotation>
      <xs:documentation>The astronomical (STC) coordsType</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordsType">
        <xs:sequence>
          <xs:element name="Time" type="stc:timeCoordinateType" minOccurs="0"/>
          <xs:element ref="stc:Position" minOccurs="0"/>
          <xs:element ref="stc:Velocity" minOccurs="0"/>
          <xs:element name="Spectral" type="stc:spectralCoordinateType" minOccurs="0"/>
          <xs:element name="Redshift" type="stc:redshiftCoordinateType" minOccurs="0"/>
          <xs:element name="CoordFile" type="stc:astroCoordsFileType" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Some or all coordinate values may be given in  file</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="Orbit" type="stc:orbitType" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Orbit specified by orbital elements</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="pixelCoordsType">
    <xs:annotation>
      <xs:documentation>The pixel coordinates type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:restriction base="stc:coordsType">
        <xs:sequence maxOccurs="unbounded">
          <xs:element ref="stc:PixelCoordinate"/>
        </xs:sequence>
        <xs:attribute name="coord_system_id" type="xs:IDREF" use="required"/>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Coords" type="stc:coordsType">
    <xs:annotation>
      <xs:documentation>Head element of Coords group (not abstract)</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="AstroCoords" type="stc:astroCoordsType" substitutionGroup="stc:Coords">
    <xs:annotation>
      <xs:documentation>The coordinate element consists either of a coordinate file or a sequence of time element, spatial coordinate element, velocity element, and redshift element; the spatial and velocity elements may be scalar or vector; it needs to refer to a coordinate system</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PixelCoords" type="stc:pixelCoordsType" substitutionGroup="stc:Coords">
    <xs:annotation>
      <xs:documentation>Contains pixel coordinates</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--  ###################  End of the former coords.xsd -->
  <!--  ###################  Start of the former region.xsd -->
  <!--Shape definitions; in 2-D: Allsky, Circle, Ellipse, Polygon, Box, and Sector are derived from Shape; Polygon includes also Vertex and SmallCircle; in 3-D: Halfspace, Convex, Convexhull -->
  <xs:annotation>
    <xs:documentation>Region is the base type for everything</xs:documentation>
  </xs:annotation>
  <xs:complexType name="regionAreaType">
    <xs:annotation>
      <xs:documentation>Element to hold the area of a Region, once calculated; the element holds the actual area, linearAreaUnit the linear units of the of the area (i.e., it should be squared to get the proper units of the area), and validArea indicates whether the area has been calculated properly.</xs:documentation>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:double">
        <xs:attribute name="linearAreaUnit" type="stc:posUnitType" use="required"/>
        <xs:attribute name="validArea" type="xs:boolean" use="required"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="regionType" abstract="true">
    <xs:annotation>
      <xs:documentation>Abstract region type; a Region is a Shape or the result of a Region Operation involving one or more Regions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:spatialIntervalType">
        <xs:sequence>
          <xs:element name="Area" type="stc:regionAreaType" minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="note" type="xs:string" use="optional"/>
        <xs:attribute name="coord_system_id" type="xs:IDREF" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="shapeType" abstract="true">
    <xs:annotation>
      <xs:documentation>Shape is the abstract type that is the building block of regions; in real life it needs to be replaced by a concrete shape</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:regionType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="allSkyType">
    <xs:annotation>
      <xs:documentation>AllSky type: just a shape without any child elements</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:shapeType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="circleType">
    <xs:annotation>
      <xs:documentation>Circle shape: center and radius</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:shapeType">
        <xs:sequence>
          <xs:element name="Center" type="stc:double2Type">
            <xs:annotation>
              <xs:documentation>The coordinates of the circle's center</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="Radius" type="xs:double">
            <xs:annotation>
              <xs:documentation>The radius of the circle</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ellipseType">
    <xs:annotation>
      <xs:documentation>Ellipse shape: center, semi-major, semi-minor axis and position angle; in spherical coordinates defined as the shape cut out of the sphere by a cone with elliptical cross-section</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:shapeType">
        <xs:sequence>
          <xs:element name="Center" type="stc:double2Type">
            <xs:annotation>
              <xs:documentation>The coordinates of the circle's center</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="SemiMajorAxis" type="xs:double">
            <xs:annotation>
              <xs:documentation>The radius of the circle</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="SemiMinorAxis" type="xs:double">
            <xs:annotation>
              <xs:documentation>Half the minor axis of the ellipse, in radius_unit</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="PosAngle" type="stc:posAngleType">
            <xs:annotation>
              <xs:documentation>Position angle of major axis (Radius).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <!-- smallCircleType is used in vertices to indicate that the polygon side associated with a vertex and its predecessor is to be a small circle rather than the default great circle -->
  <xs:complexType name="smallCircleType">
    <xs:annotation>
      <xs:documentation>smallCircleType indicates in polygons that side is along small circle; with optional pole</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Pole" type="stc:double2Type" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="vertexType">
    <xs:annotation>
      <xs:documentation>Vertex is a position with optional SmallCircle element; the SmallCircle element indicates that the polygon side formed by that vertex and its predecessor vertex is a small circle, rather than a great circle; SmallCircle has no meaning in Cartesian coordinates</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Position" type="stc:double2Type"/>
      <xs:element name="SmallCircle" type="stc:smallCircleType" nillable="true" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="polygonType">
    <xs:annotation>
      <xs:documentation>Polygon: one or more vertices; counter-clockwise (as seen from "inside" or from "top") encircled area is enclosed; sides should span less than 180 deg in each coordinate if spherical; a polygon may not intersect itself</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:shapeType">
        <xs:sequence>
          <xs:element name="Vertex" type="stc:vertexType" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>In order to form polygons, vertices are to be connected with straight line segments. In the case of spherical coordinates: greatcircle segments; if a smallCircle element si present, the vertex and its predecessor are to be connected with a smallcircle, by default in the CoordSys that is referenced; optionally, a pole may be specified (other than the CoordSys pole) that defines the smallcircle system</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="boxType">
    <xs:annotation>
      <xs:documentation>Box shape: a rectangle defined by its center and size on both dimensions; since it is a polygon, it is redundant, but simple rectangles with great circle sides are awkward to define in spherical coordinates</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:shapeType">
        <xs:sequence>
          <xs:element name="Center" type="stc:double2Type">
            <xs:annotation>
              <xs:documentation>The coordinates of the box's center</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="Size" type="stc:double2Type">
            <xs:annotation>
              <xs:documentation>The lengths of the box's sides</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="sectorType">
    <xs:annotation>
      <xs:documentation>A sector is the counter-clockwise area between two half-lines</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:shapeType">
        <xs:sequence>
          <xs:element name="Position" type="stc:double2Type">
            <xs:annotation>
              <xs:documentation>The vertex position of the sector</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="PosAngle1" type="stc:posAngleType">
            <xs:annotation>
              <xs:documentation>The area ccw from this position angle is included</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="PosAngle2" type="stc:posAngleType">
            <xs:annotation>
              <xs:documentation>The area cw from this position angle is included</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="hsOffsetType">
    <xs:restriction base="xs:double">
      <xs:minInclusive value="-1.0"/>
      <xs:maxInclusive value="1.0"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="halfspaceType">
    <xs:annotation>
      <xs:documentation>An area on the unit sphere defined by the intersection with a plane</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Vector" type="stc:double3Type">
        <xs:annotation>
          <xs:documentation>This needs to be a spherical coordinate vector; it is the unit vector that is normal to the plane that forms a constraint for a convex</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Offset" type="stc:hsOffsetType">
        <xs:annotation>
          <xs:documentation>The distance along the normal vector where the constraint plane intersects that vector; if positive, the spherical sector on the far side (seen from the center) is selected; if negative, the point of intersection is in the opposite direction of the vector, resulting in more than a hemisphere; the valid range is -1.0 to +1.0</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="convexType">
    <xs:annotation>
      <xs:documentation>A convex polygon defined by one or more Constraints</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:shapeType">
        <xs:sequence>
          <xs:element name="Halfspace" type="stc:halfspaceType" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="convexHullType">
    <xs:annotation>
      <xs:documentation>A convex hull: the smallest convex polygon that contains all its points; in spherical coordinates all points have to be contained within a hemisphere</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:shapeType">
        <xs:sequence>
          <xs:element name="Point" type="stc:double3Type" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <!--A generic sky indexing type-->
  <xs:complexType name="skyIndexType" abstract="true">
    <xs:annotation>
      <xs:documentation>This is a hook for regions defined in sky indexing schemes</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:shapeType"/>
    </xs:complexContent>
  </xs:complexType>
  <!--Boolean operations on regions-->
  <xs:complexType name="unionType">
    <xs:annotation>
      <xs:documentation>The union of two or more regions is a region</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:regionType">
        <xs:sequence>
          <xs:element ref="stc:Region" minOccurs="2" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="intersectionType">
    <xs:annotation>
      <xs:documentation>The intersection of two or more regions is a region</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:regionType">
        <xs:sequence>
          <xs:element ref="stc:Region" minOccurs="2" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="negationType">
    <xs:annotation>
      <xs:documentation>The negation of a region is a region</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:regionType">
        <xs:sequence>
          <xs:element ref="stc:Region"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="diffType">
    <xs:annotation>
      <xs:documentation>The difference of two regions (Region1 minus Region2) is a region; it is equivalent to the intersection of Region1 with notRegion2</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:regionType">
        <xs:sequence>
          <xs:element ref="stc:Region"/>
          <xs:element ref="stc:Region2"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <!-- Region itself; it's either a Shape or a the result of a Boolean operation-->
  <xs:element name="Region" type="stc:regionType" abstract="true" substitutionGroup="stc:PositionInterval" nillable="true">
    <xs:annotation>
      <xs:documentation>Head element of the Region substitution group; a Region is a Shape or the result of a Region Operation on one or more Regions</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--The three operators (Intersection, Union, Negation) can be substituted for Region-->
  <xs:element name="Intersection" type="stc:intersectionType" substitutionGroup="stc:Region" nillable="true">
    <xs:annotation>
      <xs:documentation>The intersection of two or more regions is a region</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Union" type="stc:unionType" substitutionGroup="stc:Region" nillable="true">
    <xs:annotation>
      <xs:documentation>The union of two or more regions is a region</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Negation" type="stc:negationType" substitutionGroup="stc:Region" nillable="true">
    <xs:annotation>
      <xs:documentation>The negation of a region is a region</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Difference" type="stc:diffType" substitutionGroup="stc:Region" nillable="true">
    <xs:annotation>
      <xs:documentation>The difference of two regions (Region1 minus Region2) is a region; it is equivalent to the intersection of Region1 with notRegion2</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--Here are element definitions so Circle, Ellipse, Polygon, and Sector can be substituted for Shape-->
  <xs:element name="AllSky" type="stc:allSkyType" substitutionGroup="stc:Region" nillable="true">
    <xs:annotation>
      <xs:documentation>AllSky is just a convenience, meaning no bounds</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Circle" type="stc:circleType" substitutionGroup="stc:Region" nillable="true">
    <xs:annotation>
      <xs:documentation>The circle is defined by a center and a radius</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Ellipse" type="stc:ellipseType" substitutionGroup="stc:Region" nillable="true">
    <xs:annotation>
      <xs:documentation>Ellipse is an extension of the circle shape, with a minor axis radius and position angle</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Polygon" type="stc:polygonType" substitutionGroup="stc:Region" nillable="true">
    <xs:annotation>
      <xs:documentation>A polygon is a shape delineated by a list of vertices connected with lines, great circles, or small circles; the inside of the polygon is circumscribed counter-clockwise by the list of vertices; the polygon may be concave but not self-intersecting; the last vertex in the list is the predecessor of the first.  For celestial coordinates it is assumed that we are looking at the sphere from the inside, with Right Ascension increasing to the left. Sides should span less than 180 deg in each coordinate.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Box" type="stc:boxType" substitutionGroup="stc:Region" nillable="true">
    <xs:annotation>
      <xs:documentation>A box is a rectangle; the midpoints of its sides are the endpoints of a cross centered on the center position with arms that extend half the size for each coordinate in both directions, and the sides are lines or great circles that intersect the cross at its end points at right angles; the arms of the cross are parallel to the coordinate axes at the center point.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Sector" type="stc:sectorType" substitutionGroup="stc:Region" nillable="true">
    <xs:annotation>
      <xs:documentation>A sector selects the area between two half great circles or half lines meeting in a specified point</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Convex" type="stc:convexType" substitutionGroup="stc:Region" nillable="true">
    <xs:annotation>
      <xs:documentation>A convex is defined as the intersection of one or more half-plane constraints with the unit sphere; this may also be described as the union of one or more convex polygons bounded by one or more constraint planes</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="ConvexHull" type="stc:convexHullType" substitutionGroup="stc:Region" nillable="true">
    <xs:annotation>
      <xs:documentation>A convex hull is the convex polygon that contains all of the specified positions; the points have to be constrained to lie in one hemisphere</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="SkyIndex" type="stc:skyIndexType" abstract="true" substitutionGroup="stc:Region" nillable="true">
    <xs:annotation>
      <xs:documentation>A shape defined through a sky indexing scheme; this is really a substitution group for concrete implementations</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!-- This is a substitution group for a second Region: Region2; it's either a Shape or a the result of a Boolean operation-->
  <xs:element name="Region2" type="stc:regionType" abstract="true" substitutionGroup="stc:PositionInterval" nillable="true">
    <xs:annotation>
      <xs:documentation>Head element of the Region2 substitution group; a Region is a Shape or the result of a Region Operation on one or more Regions</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--The three operators (Intersection, Union, Negation) can be substituted for Region-->
  <xs:element name="Intersection2" type="stc:intersectionType" substitutionGroup="stc:Region2" nillable="true">
    <xs:annotation>
      <xs:documentation>The intersection of two or more regions is a region</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Union2" type="stc:unionType" substitutionGroup="stc:Region2" nillable="true">
    <xs:annotation>
      <xs:documentation>The union of two or more regions is a region</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Negation2" type="stc:negationType" substitutionGroup="stc:Region2" nillable="true">
    <xs:annotation>
      <xs:documentation>The negation of a region is a region</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Difference2" type="stc:diffType" substitutionGroup="stc:Region2" nillable="true">
    <xs:annotation>
      <xs:documentation>The difference of two regions (Region1 minus Region2) is a region; it is equivalent to the intersection of Region1 with notRegion2</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--Here are element definitions so Circle, Ellipse, Polygon, and Sector can be substituted for Shape-->
  <xs:element name="AllSky2" type="stc:allSkyType" substitutionGroup="stc:Region2" nillable="true">
    <xs:annotation>
      <xs:documentation>AllSky is just a convenience, meaning no bounds</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Circle2" type="stc:circleType" substitutionGroup="stc:Region2" nillable="true">
    <xs:annotation>
      <xs:documentation>The circle is defined by a center and a radius</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Ellipse2" type="stc:ellipseType" substitutionGroup="stc:Region2" nillable="true">
    <xs:annotation>
      <xs:documentation>Ellipse is an extension of the circle shape, with a minor axis radius and position angle</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Polygon2" type="stc:polygonType" substitutionGroup="stc:Region2" nillable="true">
    <xs:annotation>
      <xs:documentation>A polygon is a shape delineated by a list of vertices connected with lines, great circles, or small circles; the inside of the polygon is circumscribed counter-clockwise by the list of vertices; the polygon may be concave but not self-intersecting; the last vertex in the list is the predecessor of the first.  For celestial coordinates it is assumed that we are looking at the sphere from the inside, with Right Ascension increasing to the left. Sides should span less than 180 deg in each coordinate.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Box2" type="stc:boxType" substitutionGroup="stc:Region2" nillable="true">
    <xs:annotation>
      <xs:documentation>A box is a rectangle; the midpoints of its sides are the endpoints of a cross centered on the center position with arms that extend half the size for each coordinate in both directions, and the sides are lines or great circles that intersect the cross at its end points at right angles; the arms of the cross are parallel to the coordinate axes at the center point.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Sector2" type="stc:sectorType" substitutionGroup="stc:Region2" nillable="true">
    <xs:annotation>
      <xs:documentation>A sector selects the area between two half great circles or half lines meeting in a specified point</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Convex2" type="stc:convexType" substitutionGroup="stc:Region2" nillable="true">
    <xs:annotation>
      <xs:documentation>A convex is defined as the intersection of one or more half-plane constraints with the unit sphere; this may also be described as the union of one or more convex polygons bounded by one or more constraint planes</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="ConvexHull2" type="stc:convexHullType" substitutionGroup="stc:Region2" nillable="true">
    <xs:annotation>
      <xs:documentation>A convex hull is the convex polygon that contains all of the specified positions; the points have to be constrained to lie in one hemisphere</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="SkyIndex2" type="stc:skyIndexType" abstract="true" substitutionGroup="stc:Region2" nillable="true">
    <xs:annotation>
      <xs:documentation>A shape defined through a sky indexing scheme; this is really a substitution group for concrete implementations</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--  ###################  End of the former region.xsd -->
  <!--Types for CoordArea-->
  <xs:complexType name="coordIntervalType" abstract="true">
    <xs:annotation>
      <xs:documentation>Abstact coordinate interval type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcBaseType">
        <xs:attribute name="lo_include" type="xs:boolean" default="true">
          <xs:annotation>
            <xs:documentation>Limit to be included?</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="hi_include" type="xs:boolean" default="true">
          <xs:annotation>
            <xs:documentation>Limit to be included?</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="fill_factor" type="xs:float" use="optional" default="1.0">
          <xs:annotation>
            <xs:documentation>Fraction of interval that is occupied by data</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="timeIntervalType">
    <xs:annotation>
      <xs:documentation>The time interval needs to contain a start time or a stop time or both; it needs to refer to a coordinate system; boundaries may or may not be inclusive</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordIntervalType">
        <xs:sequence>
          <xs:element name="StartTime" type="stc:astronTimeType" minOccurs="0">
            <xs:annotation>
              <xs:documentation>astronTime may be expressed in ISO8601 or as a double relative to a reference time</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="StopTime" type="stc:astronTimeType" minOccurs="0">
            <xs:annotation>
              <xs:documentation>astronTime may be expressed in ISO8601 or as a double relative to a reference time</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="coordScalarIntervalType">
    <xs:annotation>
      <xs:documentation>Scalar coordinate interval type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordIntervalType">
        <xs:sequence>
          <xs:element name="LoLimit" type="xs:double" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Lower bound of interval</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="HiLimit" type="xs:double" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Upper bound of interval</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="coord2VecIntervalType">
    <xs:annotation>
      <xs:documentation>2-D coordinate interval type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordIntervalType">
        <xs:sequence>
          <xs:element name="LoLimit2Vec" type="stc:double2Type" minOccurs="0"/>
          <xs:element name="HiLimit2Vec" type="stc:double2Type" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="coord3VecIntervalType">
    <xs:annotation>
      <xs:documentation>3-D coordinate interval type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordIntervalType">
        <xs:sequence>
          <xs:element name="LoLimit3Vec" type="stc:double3Type" minOccurs="0"/>
          <xs:element name="HiLimit3Vec" type="stc:double3Type" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="spatialIntervalType" abstract="true">
    <xs:complexContent>
      <xs:extension base="stc:coordIntervalType">
        <xs:attribute name="epoch" type="xs:decimal" use="optional"/>
        <xs:attribute name="unit" type="stc:posUnitType" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="posScalarIntervalType">
    <xs:annotation>
      <xs:documentation>Scalar coordinate interval type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:spatialIntervalType">
        <xs:sequence>
          <xs:element name="LoLimit" type="xs:double" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Lower bound of interval</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="HiLimit" type="xs:double" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Upper bound of interval</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="pos2VecIntervalType">
    <xs:annotation>
      <xs:documentation>2-D coordinate interval type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:spatialIntervalType">
        <xs:sequence>
          <xs:element name="LoLimit2Vec" type="stc:double2Type" minOccurs="0"/>
          <xs:element name="HiLimit2Vec" type="stc:double2Type" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="pos3VecIntervalType">
    <xs:annotation>
      <xs:documentation>3-D coordinate interval type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:spatialIntervalType">
        <xs:sequence>
          <xs:element name="LoLimit3Vec" type="stc:double3Type" minOccurs="0"/>
          <xs:element name="HiLimit3Vec" type="stc:double3Type" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="velocityIntervalType" abstract="true">
    <xs:annotation>
      <xs:documentation>Contains a spatial velocity CoordInterval</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:spatialIntervalType">
        <xs:attribute name="vel_time_unit" type="stc:velTimeUnitType" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="velScalarIntervalType">
    <xs:annotation>
      <xs:documentation>Scalar coordinate interval type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:velocityIntervalType">
        <xs:sequence>
          <xs:element name="LoLimit" type="xs:double" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Lower bound of interval</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="HiLimit" type="xs:double" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Upper bound of interval</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="vel2VecIntervalType">
    <xs:annotation>
      <xs:documentation>2-D coordinate interval type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:velocityIntervalType">
        <xs:sequence>
          <xs:element name="LoLimit2Vec" type="stc:double2Type" minOccurs="0"/>
          <xs:element name="HiLimit2Vec" type="stc:double2Type" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="vel3VecIntervalType">
    <xs:annotation>
      <xs:documentation>3-D coordinate interval type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:velocityIntervalType">
        <xs:sequence>
          <xs:element name="LoLimit3Vec" type="stc:double3Type" minOccurs="0"/>
          <xs:element name="HiLimit3Vec" type="stc:double3Type" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="CoordInterval" type="stc:coordIntervalType" abstract="true">
    <xs:annotation>
      <xs:documentation>The 1-, 2-, or 3-D coordinate interval substitution group head element; such an element needs to contain a minimum or maximum scalar or vector value, or both; it needs to refer to a coordinate system; boundaries may or may not be inclusive; and it can have a fill factor</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="CoordScalarInterval" type="stc:coordScalarIntervalType" substitutionGroup="stc:CoordInterval">
    <xs:annotation>
      <xs:documentation>An interval in a scalar coordinate</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Coord2VecInterval" type="stc:coord2VecIntervalType" substitutionGroup="stc:CoordInterval">
    <xs:annotation>
      <xs:documentation>An interval ("box") in a 2-D coordinate pair</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Coord3VecInterval" type="stc:coord3VecIntervalType" substitutionGroup="stc:CoordInterval">
    <xs:annotation>
      <xs:documentation>An interval ("cube") in a 3-D coordinate triplet</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PositionInterval" type="stc:coordIntervalType" abstract="true">
    <xs:annotation>
      <xs:documentation>The spatial (position) coordinate interval substitution group head element; such an element needs to contain a minimum or maximum scalar or vector value, or both; it needs to refer to a coordinate system; boundaries may or may not be inclusive; and it can have a fill factor</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PositionScalarInterval" type="stc:posScalarIntervalType" substitutionGroup="stc:PositionInterval">
    <xs:annotation>
      <xs:documentation>An interval in a scalar coordinate</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Position2VecInterval" type="stc:pos2VecIntervalType" substitutionGroup="stc:PositionInterval">
    <xs:annotation>
      <xs:documentation>An interval ("box") in a 2-D coordinate pair</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Position3VecInterval" type="stc:pos3VecIntervalType" substitutionGroup="stc:PositionInterval">
    <xs:annotation>
      <xs:documentation>An interval ("cube") in a 3-D coordinate triplet</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="VelocityInterval" type="stc:coordIntervalType" abstract="true">
    <xs:annotation>
      <xs:documentation>The spatial (velocity) coordinate interval substitution group head element; such an element needs to contain a minimum or maximum scalar or vector value, or both; it needs to refer to a coordinate system; boundaries may or may not be inclusive; and it can have a fill factor</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="VelocityScalarInterval" type="stc:velScalarIntervalType" substitutionGroup="stc:VelocityInterval">
    <xs:annotation>
      <xs:documentation>An interval in a scalar coordinate</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Velocity2VecInterval" type="stc:vel2VecIntervalType" substitutionGroup="stc:VelocityInterval">
    <xs:annotation>
      <xs:documentation>An interval ("box") in a 2-D coordinate pair</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="Velocity3VecInterval" type="stc:vel3VecIntervalType" substitutionGroup="stc:VelocityInterval">
    <xs:annotation>
      <xs:documentation>An interval ("cube") in a 3-D coordinate triplet</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="sphereType">
    <xs:annotation>
      <xs:documentation>Defines a sphere.  A special kind of area is a circle or sphere (in two or three dimensions), defined by a center position and a radius; the radius requires a unit</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:spatialIntervalType">
        <xs:sequence>
          <xs:element name="Radius" type="xs:double"/>
          <xs:element name="Center" type="stc:double3Type"/>
        </xs:sequence>
        <xs:attribute name="radius_unit" type="stc:posUnitType" use="optional" default="deg"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="velocitySphereType">
    <xs:annotation>
      <xs:documentation>Defines a velocity sphere</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:velocityIntervalType">
        <xs:annotation>
          <xs:documentation>A special kind of area is a circle or sphere (in two or three dimensions), defined by a center position and a radius; the radius requires a unit</xs:documentation>
        </xs:annotation>
        <xs:sequence>
          <xs:element name="Radius" type="xs:double"/>
          <xs:element name="Center" type="stc:double3Type"/>
        </xs:sequence>
        <xs:attribute name="radius_unit" type="stc:posUnitType" use="optional" default="deg"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="regionFileType">
    <xs:annotation>
      <xs:documentation>Points to a Region file</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:spatialIntervalType">
        <xs:sequence>
          <xs:element name="File" type="xs:anyURI"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <!-- CoordArea -->
  <xs:element name="Sphere" type="stc:sphereType" substitutionGroup="stc:PositionInterval">
    <xs:annotation>
      <xs:documentation>Defines a sphere (3-D) region for spatial coordinates; contains a center position and a radius</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="RegionFile" type="stc:regionFileType" substitutionGroup="stc:PositionInterval">
    <xs:annotation>
      <xs:documentation>A region as defined in a FITS region file</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="VelInterval" type="stc:spatialIntervalType" abstract="true">
    <xs:annotation>
      <xs:documentation>Contains a Velocity CoordInterval element: a 1-D range, 2-D box, or 3-D cube; plus a time unit for velocity values</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="VelocitySphere" type="stc:velocitySphereType" substitutionGroup="stc:VelocityInterval">
    <xs:annotation>
      <xs:documentation>Defines a sphere (3-D) region for velocity coordinates; contains a center position and a radius</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="spectralIntervalType">
    <xs:annotation>
      <xs:documentation>Contains a 1-D spectral interval</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordScalarIntervalType">
        <xs:attribute name="unit" type="stc:spectralUnitType" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="redshiftIntervalType">
    <xs:annotation>
      <xs:documentation>Contains a 1-D redshift interval; position and time units are required if redshifts are expressed as Doppler velocities</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:coordScalarIntervalType">
        <xs:attribute name="unit" type="stc:posUnitType" use="optional"/>
        <xs:attribute name="vel_time_unit" type="stc:velTimeUnitType" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="coordAreaType">
    <xs:annotation>
      <xs:documentation>Generalized coordinate area type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcBaseType">
        <xs:sequence maxOccurs="unbounded">
          <xs:element name="TimeInterval" type="stc:timeIntervalType" minOccurs="0" maxOccurs="unbounded"/>
          <xs:element ref="stc:PositionInterval" minOccurs="0"/>
          <xs:element ref="stc:VelocityInterval" minOccurs="0" maxOccurs="unbounded"/>
          <xs:element name="SpectralInterval" type="stc:spectralIntervalType" minOccurs="0" maxOccurs="unbounded"/>
          <xs:element name="RedshiftInterval" type="stc:redshiftIntervalType" minOccurs="0" maxOccurs="unbounded"/>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:CoordInterval"/>
          </xs:sequence>
        </xs:sequence>
        <xs:attribute name="coord_system_id" type="xs:IDREF" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="astroCoordAreaType">
    <xs:annotation>
      <xs:documentation>Astronomical area type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:restriction base="stc:coordAreaType">
        <xs:sequence>
          <xs:element name="TimeInterval" type="stc:timeIntervalType" minOccurs="0" maxOccurs="unbounded"/>
          <xs:element ref="stc:PositionInterval" minOccurs="0"/>
          <xs:element ref="stc:VelocityInterval" minOccurs="0" maxOccurs="unbounded"/>
          <xs:element name="SpectralInterval" type="stc:spectralIntervalType" minOccurs="0" maxOccurs="unbounded"/>
          <xs:element name="RedshiftInterval" type="stc:redshiftIntervalType" minOccurs="0" maxOccurs="unbounded"/>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:CoordScalarInterval"/>
          </xs:sequence>
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="pixelCoordAreaType">
    <xs:annotation>
      <xs:documentation>Pixel area type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:restriction base="stc:coordAreaType">
        <xs:sequence>
          <xs:sequence maxOccurs="unbounded">
            <xs:element ref="stc:CoordScalarInterval"/>
          </xs:sequence>
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="CoordArea" type="stc:coordAreaType">
    <xs:annotation>
      <xs:documentation>General coordinate area description; head element but not abstract</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="AstroCoordArea" type="stc:astroCoordAreaType" substitutionGroup="stc:CoordArea" nillable="true">
    <xs:annotation>
      <xs:documentation>Astronomical coordinate volume</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="PixelCoordArea" type="stc:pixelCoordAreaType" substitutionGroup="stc:CoordArea">
    <xs:annotation>
      <xs:documentation>Pixel space bounds</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!-- Toplevel: STCmetadata contains a choice of: ResourceProfile, SearchLocation, CatalogEntryLocation, and
ObservationLocation plus ObservatoryLocation elements -->
  <xs:complexType name="stcMetadataType" abstract="true">
    <xs:annotation>
      <xs:documentation>Abstract stcMetadata type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcBaseType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="stcDescriptionType">
    <xs:annotation>
      <xs:documentation>Generalized single stcMetadata type</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcMetadataType">
        <xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:CoordSys"/>
          </xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:Coords"/>
          </xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:CoordArea"/>
          </xs:sequence>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="stcResourceProfileType">
    <xs:annotation>
      <xs:documentation>Type for STC Resource Profile</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:restriction base="stc:stcDescriptionType">
        <xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:AstroCoordSystem">
              <xs:annotation>
                <xs:documentation>The coordinate system definition: spatial coordinate frame and reference position; time frame and reference position; the coordinate flavor; and the planetary ephemeris; an ID is required, since this is how coordinate elements are associated with their coordinate systems</xs:documentation>
              </xs:annotation>
            </xs:element>
          </xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:AstroCoords">
              <xs:annotation>
                <xs:documentation>AstroCoords contains information on time and spatial resolution, errors, and pixelsizes (if fixed); typical best numbers are expected</xs:documentation>
              </xs:annotation>
            </xs:element>
          </xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:AstroCoordArea">
              <xs:annotation>
                <xs:documentation>The coverage area of the resource; the fill factor does not need to be 1.0</xs:documentation>
              </xs:annotation>
            </xs:element>
          </xs:sequence>
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="searchLocationType">
    <xs:annotation>
      <xs:documentation>Type for STC search location</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:restriction base="stc:stcDescriptionType">
        <xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:AstroCoordSystem"/>
          </xs:sequence>
          <xs:sequence minOccurs="0">
            <xs:element ref="stc:AstroCoords"/>
          </xs:sequence>
          <xs:sequence minOccurs="0">
            <xs:element ref="stc:AstroCoordArea"/>
          </xs:sequence>
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="catalogEntryLocationType">
    <xs:annotation>
      <xs:documentation>Type for STC catalog entry description</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:restriction base="stc:stcDescriptionType">
        <xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:AstroCoordSystem"/>
          </xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:AstroCoords"/>
          </xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:AstroCoordArea"/>
          </xs:sequence>
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="obsDataLocationType">
    <xs:annotation>
      <xs:documentation>Type for observational STC metadata</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcMetadataType">
        <xs:sequence>
          <xs:annotation>
            <xs:documentation>Describes the spatial and temporal volume covered by an observation</xs:documentation>
          </xs:annotation>
          <xs:element name="ObservatoryLocation" type="stc:observatoryLocationType">
            <xs:annotation>
              <xs:documentation>Specifies the location of the observatory during the observation</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="ObservationLocation" type="stc:observationLocationType">
            <xs:annotation>
              <xs:documentation>Describes the spatial and temporal coverage of the observation</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="PixelSpace" type="stc:pixelSpaceType" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Defines the pixel coordinate system for pixelated data</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="observatoryLocationType">
    <xs:annotation>
      <xs:documentation>Type for an observatory location</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:restriction base="stc:stcDescriptionType">
        <xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:AstroCoordSystem"/>
          </xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:AstroCoords"/>
          </xs:sequence>
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="observationLocationType">
    <xs:annotation>
      <xs:documentation>Type for describing the coordinate volume occupied by observational data, as seen from the observatory location</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:restriction base="stc:stcDescriptionType">
        <xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:AstroCoordSystem"/>
          </xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:AstroCoords"/>
          </xs:sequence>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:AstroCoordArea"/>
          </xs:sequence>
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="pixelSpaceType">
    <xs:annotation>
      <xs:documentation>Type to specify a pixel space</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:restriction base="stc:stcDescriptionType">
        <xs:sequence>
          <xs:element ref="stc:PixelCoordSystem"/>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="stc:PixelCoords"/>
          </xs:sequence>
          <xs:element ref="stc:PixelCoordArea"/>
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="STCmetadata" type="stc:stcMetadataType" abstract="true">
    <xs:annotation>
      <xs:documentation>Toplevel: Abstract STCmetadata contains a choice of: ResourceProfile, SearchLocation, CatalogEntryLocation, or ObservationLocation plus ObservatoryLocation elements</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="STCResourceProfile" type="stc:stcResourceProfileType" substitutionGroup="stc:STCmetadata">
    <xs:annotation>
      <xs:documentation>Describes the spatial and temporal coverage of a resource</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="SearchLocation" type="stc:searchLocationType" substitutionGroup="stc:STCmetadata">
    <xs:annotation>
      <xs:documentation>Defines the spatial and temporal coordinate space specified by a query</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="CatalogEntryLocation" type="stc:catalogEntryLocationType" substitutionGroup="stc:STCmetadata">
    <xs:annotation>
      <xs:documentation>Describes the spatial and temporal coverage of a catalog (fragment) and contains the coordinates of the catalog entries; multiple coordinate systems are allowed</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="ObsDataLocation" type="stc:obsDataLocationType" substitutionGroup="stc:STCmetadata">
    <xs:annotation>
      <xs:documentation>Describes the coordinate system used in and coordinate space occupied by a particular observational dataset; it contains an observation location, an observatory location, and optionally a pixel coordinate system</xs:documentation>
    </xs:annotation>
  </xs:element>
  <!--Following are application level types and associated global elements.
Using the complexTypes, one can insert a stand-alone STC structure in an document as follows.
First, incorporated in a schema, declare the namespace and give the schema location:
<xs:schema xmlns="http://www.ivoa.net/xml/VOEvent/v1.0"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:stc="http://www.ivoa.net/xml/STC/stc-v1.30.xsd"
        targetNamespace="http://www.ivoa.net/xml/VOEvent/v1.0"
        elementFormDefault="qualified">
    <xs:import namespace="http://www.ivoa.net/xml/STC/stc-v1.30.xsd"
           schemaLocation="http://hea-www.harvard.edu/~arots/nvometa/v1.30/stc-v1.30.xsd"/>
Then include an STC element in the schema:
    <xs:element name="WhereWhen">
      <xs:complexType>
        <xs:all>
          <xs:element ref="stc:ObsDataLocation" minOccurs="0"/>
        </xs:all>
      </xs:complexType>
    </xs:element>
</xs:schema>
In an instance document:
<?xml version="1.0" encoding="UTF-8"?>
<VOEvent id="ivo://raptor.lanl/VOEvent#235649409" role="observation" version="1.0"
      xmlns="http://www.ivoa.net/xml/VOEvent/v1.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
      xsi:schemaLocation="http://www.ivoa.net/xml/VOEvent/v1.0          
      VOEvent-v1.0a.xsd">
    
    <WhereWhen>
      <ObsDataLocation xmlns="http://www.ivoa.net/xml/STC/stc-v1.30.xsd"
        xmlns:xlink="http://www.w3.org/1999/xlink"
        xsi:schemaLocation=
        "http://www.ivoa.net/xml/STC/stc-v1.30.xsd 
        http://hea-www.harvard.edu/~arots/nvometa/v1.30/stc-v1.30.xsd">
        <ObservatoryLocation id="KPNO" xlink:type="simple"
          xlink:href="ivo://STClib/Observatories#KPNO"/>
        <ObservationLocation>
          <AstroCoordSystem id="FK5-UTC-TOPO" xlink:type="simple"
            xlink:href="ivo://STClib/CoordSys#TT-ICRS-TOPO"/>
          <AstroCoords coord_system_id="FK5-UTC-TOPO">
            <Time unit="s">
              <TimeInstant>
                <ISOTime>2005-04-15T23:59:59</ISOTime>
              </TimeInstant>
              <Error>1.0</Error>
            </Time>
            <Position2D unit="deg">
              <Value2> 
                <C1>148.88821</C1>
                <C2>69.06529</C2>
              </Value2>
              <Error2Radius>0.03</Error2Radius>
            </Position2D>
          </AstroCoords>
        </ObservationLocation>
      </ObsDataLocation>
    </WhereWhen>
</VOEvent>

Or, alternatively, using a single STC type to generate a document:
<?xml version="1.0" encoding="utf-8"?>
    <MySTC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://www.ivoa.net/xml/STC/stc-v1.30.xsd" 
        xmlns:xlink="http://www.w3.org/1999/xlink" 
        xsi:schemaLocation="http://www.ivoa.net/xml/STC/stc-v1.30.xsd stc-v1.30.xsd" 
        xsi:type="stcXXXType">
        ...
    </MySTC>
Using the global elements works pretty much in the same way.
-->
  <xs:complexType name="STCCoordinate">
    <xs:annotation>
      <xs:documentation>Type for STC Coordinate</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcMetadataType">
        <xs:sequence>
          <xs:element ref="stc:AstroCoordSystem"/>
          <xs:element ref="stc:AstroCoords"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="STCCoordinateList">
    <xs:annotation>
      <xs:documentation>Type for STC Coordinate List</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcMetadataType">
        <xs:sequence>
          <xs:element ref="stc:AstroCoordSystem"/>
          <xs:element ref="stc:AstroCoords" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="STCRegion">
    <xs:annotation>
      <xs:documentation>Type for STC Region</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcMetadataType">
        <xs:sequence>
          <xs:element ref="stc:AstroCoordSystem"/>
          <xs:element ref="stc:Region"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="STCRegionList">
    <xs:annotation>
      <xs:documentation>Type for STC Region list</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="stc:stcMetadataType">
        <xs:sequence>
          <xs:element ref="stc:AstroCoordSystem"/>
          <xs:element ref="stc:Region" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <!-- Here are discarded instantiations of the metadata types
  <xs:element name="STCCoordinate" type="stc:stcCoordinateType" substitutionGroup="stc:STCmetadata">
    <xs:annotation>
      <xs:documentation>Describes an STC Coordinate</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="STCCoordinateList" type="stc:stcCoordinateListType" substitutionGroup="stc:STCmetadata">
    <xs:annotation>
      <xs:documentation>Describes an STC Coordinate List</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="STCRegion" type="stc:stcRegionType" substitutionGroup="stc:STCmetadata">
    <xs:annotation>
      <xs:documentation>Describes a spatial region</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="STCRegionList" type="stc:stcRegionListType" substitutionGroup="stc:STCmetadata">
    <xs:annotation>
      <xs:documentation>Describes a spatial region list</xs:documentation>
    </xs:annotation>
  </xs:element>
  -->
</xs:schema>
