<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://dotastro.org/simpletimeseries"
	targetNamespace="http://dotastro.org/simpletimeseries"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
	attributeFormDefault="unqualified" version="1.15">

	<xsd:annotation>
		<xsd:documentation xml:lang="en">
			SimpleTimeseries
			This version has been modified by Arnold Rots and John Brewer.
			It contains a redesign of the space and time metadata,
			consistent in terminology and structure with IVOA standards.
			  
			Like the first version it attempts only to store simple astronomical
			timeseries which consist of timestamp and 0 or more data values
			associated with that timestamp.  At this time, those values can
			be:
				Position (in 2 dimensions, icrs or galactic, with errors)
				Magnitude	(with errors)
				Flux		(with errors)
				Doubles		(with errors)
				Strings		(with numeric codes)
		</xsd:documentation>
	</xsd:annotation>

	<!-- Root Element: SimpleTimeseries -->
	<xsd:element name="SimpleTimeseries">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="TITLE" minOccurs="0" maxOccurs="1">
					<xsd:simpleType>
						<xsd:restriction base="xsd:string">
							<xsd:maxLength value="255"/>
						</xsd:restriction>
					</xsd:simpleType>
				</xsd:element>
				<xsd:element name="DESCRIPTION" type="xsd:string" minOccurs="0" maxOccurs="1"/>

				<xsd:element name="SPACETIMESYS" minOccurs="1" maxOccurs="1">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="TimeFrame" type="TimeFrame" minOccurs="1"
								maxOccurs="1">
								<xsd:annotation>
									<xsd:documentation>
										TimeFrame defines timescale, reference position time zero
										point, and folding info.
									</xsd:documentation>
								</xsd:annotation>
							</xsd:element>

							<xsd:element name="SpaceFrame" type="SpaceFrame" minOccurs="0"
								maxOccurs="1">
								<xsd:annotation>
									<xsd:documentation>
										SapceFrame defines the spactial reference frame and
										spatial reference position.  This is only required if
										position information is recorded in the data.
										
										Since it is not possible to require that the SpaceFrame exist
										whenever you include position data, parsers should assume the
										following defaults:
											SpaceRefFrame = ICRS
											ReferencePosition = GEOCENTER
									</xsd:documentation>
								</xsd:annotation>
							</xsd:element>

							<xsd:element name="TimeDefaults" type="TimeDefaults" minOccurs="0"
								maxOccurs="1">
								<xsd:annotation>
									<xsd:documentation>
										This optional elemnt allows global time-related defaults
										(errors, integration times, resolution) to be set.
									</xsd:documentation>
								</xsd:annotation>
							</xsd:element>

							<xsd:element name="PositionDefaults" type="PositionDefaults"
								minOccurs="0" maxOccurs="1">
								<xsd:annotation>
									<xsd:documentation>
										This optional element allows global position-related dfaults
										(errors, resolution) to be set.
									</xsd:documentation>
								</xsd:annotation>
							</xsd:element>
						</xsd:sequence>
					</xsd:complexType>
				</xsd:element>

				<xsd:element name="NOBAND" type="NOBAND" minOccurs="0" maxOccurs="1"/>
				<xsd:element name="BAND" type="BAND" minOccurs="0" maxOccurs="unbounded"/>

				<xsd:element name="FIELD" type="FIELD" minOccurs="0" maxOccurs="unbounded"/>

				<xsd:element name="SERIES" type="SERIES" minOccurs="1" maxOccurs="1"/>
			</xsd:sequence>

			<xsd:attribute name="id" type="xsd:ID" use="optional"/>
		</xsd:complexType>

		<xsd:key name="bandKey">
			<xsd:selector xpath="BAND|NOBAND"/>
			<xsd:field xpath="@bandid"/>
		</xsd:key>

		<xsd:key name="fieldKey">
			<xsd:selector xpath="./FIELD"/>
			<xsd:field xpath="@fld"/>
		</xsd:key>

		<xsd:keyref name="bandKeyref" refer="bandKey">
			<xsd:selector xpath="./FIELD"/>
			<xsd:field xpath="@bandid"/>
		</xsd:keyref>

		<xsd:keyref name="fieldKeyRef" refer="fieldKey">
			<xsd:selector xpath="./SERIES/ELEM/*"/>
			<xsd:field xpath="@fld"/>
		</xsd:keyref>
	</xsd:element>

	<!-- Primary types within SimpleTimeseries container -->
	<xsd:complexType name="TimeFrame">
		<xsd:sequence>
			<xsd:element name="TimeScale" type="TimeScale" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="ReferencePosition" type="ReferencePosition" minOccurs="1"
				maxOccurs="1"/>
			<xsd:element name="TimeZero" type="xsd:decimal" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="Period" type="periodType" minOccurs="0" maxOccurs="1"/>
		</xsd:sequence>
		<xsd:attribute name="jdtype" type="jdType" use="optional" default="JD"/>
		<xsd:attribute name="unit" type="timeUnitType" use="optional" default="day"/>
	</xsd:complexType>

	<xsd:complexType name="SpaceFrame">
		<xsd:sequence>
			<xsd:element name="SpaceRefFrame" type="SpaceRefFrame" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="ReferencePosition" type="ReferencePosition" minOccurs="1"
				maxOccurs="1"/>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="TimeDefaults">
		<xsd:sequence>
			<xsd:element name="UNC" minOccurs="0" maxOccurs="3">
				<xsd:complexType>
					<xsd:annotation>
						<xsd:documentation>
							Expanded to allow setting units for uncertainty which differ
							from the units used for the time value.  For instance, the
							timestamp could be measured in days with the uncertainty in milliseconds
						</xsd:documentation>
					</xsd:annotation>
					<xsd:complexContent>
						<xsd:extension base="uncType">
							<xsd:attribute name="unit" type="timeUnitType" use="optional"/>
						</xsd:extension>
					</xsd:complexContent>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="RESOLUTION" minOccurs="0" maxOccurs="1">
				<xsd:complexType>
					<xsd:annotation>
						<xsd:documentation>
							Like the uncertainty, the units of resolution may be different than
							the units of the timestamp.
						</xsd:documentation>
					</xsd:annotation>
					<xsd:simpleContent>
						<xsd:extension base="xsd:double">
							<xsd:attribute name="unit" type="timeUnitType" use="optional"/>
						</xsd:extension>
					</xsd:simpleContent>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="WIDTH" minOccurs="0" maxOccurs="1">
				<xsd:complexType>
					<xsd:annotation>
						<xsd:documentation>
							The default integration time and its associated units which may
							be different than the units of the timestamp.
						</xsd:documentation>
					</xsd:annotation>
					<xsd:simpleContent>
						<xsd:extension base="xsd:double">
							<xsd:attribute name="unit" type="timeUnitType" use="optional"/>
						</xsd:extension>
					</xsd:simpleContent>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="POSITION" minOccurs="0" maxOccurs="1">
				<xsd:complexType>
					<xsd:annotation>
						<xsd:documentation>
							The position within the integration time of the timestamp.
							Limited to the values 'begin','end','midpoint'
						</xsd:documentation>
					</xsd:annotation>
					<xsd:attribute name="type" use="required">
						<xsd:simpleType>
							<xsd:restriction base="xsd:string">
								<xsd:enumeration value="begin"/>
								<xsd:enumeration value="end"/>
								<xsd:enumeration value="midpoint"/>
								<!-- assumed if no default provided -->
							</xsd:restriction>
						</xsd:simpleType>
					</xsd:attribute>
				</xsd:complexType>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="PositionDefaults">
		<xsd:sequence>
			<xsd:element name="C1">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="VAL" type="C1Val" minOccurs="0" maxOccurs="1"/>
						<xsd:element name="ERR" minOccurs="0" maxOccurs="2">
							<xsd:complexType>
								<xsd:annotation>
									<xsd:documentation>
										Expanded to allow setting units for position errors which differ
										from the units used for the position value.  Position is always
										in decimal degrees, but the error could be in milli-arcseconds.
									</xsd:documentation>
								</xsd:annotation>
								<xsd:complexContent>
									<xsd:extension base="ErrPos">
										<xsd:attribute name="unit" type="positionUnitType" use="optional"/>
									</xsd:extension>
								</xsd:complexContent>
							</xsd:complexType>
						</xsd:element>
						<xsd:element name="SIZE" minOccurs="0" maxOccurs="1">
							<xsd:complexType>
								<xsd:annotation>
									<xsd:documentation>
										Default value for the optional 'size' attribute of the position value.
										Using the 'unit' attribute, it is also possible to set the units of
										size if they differ from the units of position.
									</xsd:documentation>
								</xsd:annotation>
								<xsd:simpleContent>
									<xsd:extension base="xsd:double">
										<xsd:attribute name="unit" type="positionUnitType" use="optional"/>
									</xsd:extension>
								</xsd:simpleContent>
							</xsd:complexType>
						</xsd:element>
						<xsd:element name="RESOLUTION" minOccurs="0" maxOccurs="1">
							<xsd:complexType>
								<xsd:annotation>
									<xsd:documentation>
										Default value for the optional 'resolution' attribute of the position value.
										Using the 'unit' attribute, it is also possible to set the units of
										resolution if they differ from the units of position.
									</xsd:documentation>
								</xsd:annotation>
								<xsd:simpleContent>
									<xsd:extension base="xsd:double">
										<xsd:attribute name="unit" type="positionUnitType" use="optional"/>
									</xsd:extension>
								</xsd:simpleContent>
							</xsd:complexType>
						</xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			
			<xsd:element name="C2">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="VAL" type="C2Val" minOccurs="0" maxOccurs="1"/>
						<xsd:element name="ERR" minOccurs="0" maxOccurs="2">
							<xsd:complexType>
								<xsd:annotation>
									<xsd:documentation>
										Expanded to allow setting units for position errors which differ
										from the units used for the position value.  Position is always
										in decimal degrees, but the error could be in milli-arcseconds.
									</xsd:documentation>
								</xsd:annotation>
								<xsd:complexContent>
									<xsd:extension base="ErrPos">
										<xsd:attribute name="unit" type="positionUnitType" use="optional"/>
									</xsd:extension>
								</xsd:complexContent>
							</xsd:complexType>
						</xsd:element>
						<xsd:element name="SIZE" minOccurs="0" maxOccurs="1">
							<xsd:complexType>
								<xsd:annotation>
									<xsd:documentation>
										Default value for the optional 'size' attribute of the position value.
										Using the 'unit' attribute, it is also possible to set the units of
										size if they differ from the units of position.
									</xsd:documentation>
								</xsd:annotation>
								<xsd:simpleContent>
									<xsd:extension base="xsd:double">
										<xsd:attribute name="unit" type="positionUnitType" use="optional"/>
									</xsd:extension>
								</xsd:simpleContent>
							</xsd:complexType>
						</xsd:element>
						<xsd:element name="RESOLUTION" minOccurs="0" maxOccurs="1">
							<xsd:complexType>
								<xsd:annotation>
									<xsd:documentation>
										Default value for the optional 'resolution' attribute of the position value.
										Using the 'unit' attribute, it is also possible to set the units of
										resolution if they differ from the units of position.
									</xsd:documentation>
								</xsd:annotation>
								<xsd:simpleContent>
									<xsd:extension base="xsd:double">
										<xsd:attribute name="unit" type="positionUnitType" use="optional"/>
									</xsd:extension>
								</xsd:simpleContent>
							</xsd:complexType>
						</xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="FIELD">
		<xsd:simpleContent>
			<xsd:extension base="xsd:string">
				<xsd:attribute name="fld" type="xsd:ID" use="required"/>
				<xsd:attribute name="bandid" type="xsd:IDREF" use="required"/>
				<xsd:attribute name="ucd" type="xsd:token" use="required"/>
				<xsd:attribute name="datatype" type="xsd:token" use="required"/>
				<xsd:attribute name="unit" type="xsd:token" use="required"/>
				<xsd:attribute name="default" use="optional"/>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>

	<xsd:complexType name="SERIES">
		<xsd:sequence>
			<xsd:element name="ELEM" type="ELEM" maxOccurs="unbounded">
				<xsd:unique name="noRepeatedFields">
					<xsd:selector xpath="./*"/>
					<xsd:field xpath="@fld"/>
				</xsd:unique>
			</xsd:element>
		</xsd:sequence>
		<xsd:attribute name="id" type="xsd:ID" use="optional"/>
	</xsd:complexType>

	<xsd:complexType name="ELEM">
		<xsd:sequence>
			<xsd:element name="TIME" type="TimeVal" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="POS" type="PositionVal" minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="FLD_VAL" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute name="row" type="xsd:float" use="optional">
			<xsd:annotation>
				<xsd:documentation>
					Allows the document creator to define a document order
					for the series elements separate from the traditional
					time ordering (which most processors and stylesheets
					will use to order the series elements).
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="uri" type="xsd:anyURI" use="optional">
			<xsd:annotation>
				<xsd:documentation>
					URI's can be attached to series elements to reference original
					event data.  This would allow, for instance, a simpletimeseries
					of VOEvents to be specified with their timestamps and optionally
					with their data.
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>

	<xsd:element name="DVAL" type="DoubleVal" substitutionGroup="FLD_VAL"/>
	<xsd:element name="MAG" type="DoubleVal" substitutionGroup="FLD_VAL"/>
	<xsd:element name="FLUX" type="DoubleVal" substitutionGroup="FLD_VAL"/>
	<xsd:element name="NOTE" type="StringVal" substitutionGroup="FLD_VAL"/>

	<!-- **********************************************************************
			Generic data types for timeseries values
	-->
	<xsd:element name="FLD_VAL" abstract="true" type="FieldVal"/>
	<xsd:complexType name="FieldVal">
		<xsd:attribute name="fld" type="xsd:IDREF" use="required"/>
	</xsd:complexType>

	<xsd:complexType name="DoubleVal">
		<xsd:complexContent>
			<xsd:extension base="FieldVal">
				<xsd:sequence>
					<xsd:element name="VAL" type="xsd:double"/>
					<xsd:element name="ERR" type="Err1D" minOccurs="0" maxOccurs="2"/>
					<xsd:element name="COMMENT" type="xsd:string" minOccurs="0"/>
				</xsd:sequence>

				<xsd:attribute name="limit" use="optional" default="false">
					<xsd:simpleType>
						<xsd:restriction base="xsd:string">
							<xsd:enumeration value="upper"/>
							<xsd:enumeration value="lower"/>
							<xsd:enumeration value="false"/>
						</xsd:restriction>
					</xsd:simpleType>
				</xsd:attribute>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="fluxVal">
		<xsd:annotation>
			<xsd:documentation>
				Flux values differ from Magnitudes only in the direction of
				increasing brightness.  Larger values of MAG refer to lower
				brightness.  Larger values of FLUX refer to greater brightness.
				This also affects the direction of limits and errors.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="FieldVal">
				<xsd:sequence>
					<xsd:element name="VAL">
						<xsd:simpleType>
							<xsd:restriction base="xsd:double"> </xsd:restriction>
						</xsd:simpleType>
					</xsd:element>
					<xsd:element name="ERR" type="Err1D" minOccurs="0" maxOccurs="2"/>
					<xsd:element name="COMMENT" type="xsd:string" minOccurs="0"/>
				</xsd:sequence>

				<xsd:attribute name="limit" use="optional" default="false">
					<xsd:simpleType>
						<xsd:restriction base="xsd:string">
							<xsd:enumeration value="upper"/>
							<xsd:enumeration value="lower"/>
							<xsd:enumeration value="false"/>
						</xsd:restriction>
					</xsd:simpleType>
				</xsd:attribute>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<!-- string values with optional integer codes -->
	<xsd:complexType name="StringVal">
		<xsd:complexContent>
			<xsd:extension base="FieldVal">
				<xsd:sequence>
					<xsd:element name="VAL" type="xsd:string"/>
					<xsd:element name="CODE" type="xsd:integer" minOccurs="0"/>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="Err1D">
		<xsd:simpleContent>
			<xsd:extension base="xsd:double">
				<xsd:attribute name="limit" use="optional" default="false">
					<xsd:simpleType>
						<xsd:restriction base="xsd:string">
							<xsd:enumeration value="upper"/>
							<xsd:enumeration value="lower"/>
							<xsd:enumeration value="false"/>
						</xsd:restriction>
					</xsd:simpleType>
				</xsd:attribute>

				<xsd:attribute name="confidence" use="optional" default="1">
					<xsd:simpleType>
						<xsd:restriction base="xsd:float">
							<xsd:minInclusive value="1.0"/>
							<xsd:maxInclusive value="10.0"/>
						</xsd:restriction>
					</xsd:simpleType>
				</xsd:attribute>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>

	<xsd:complexType name="ErrPos">
		<xsd:simpleContent>
			<xsd:extension base="xsd:double">
				<xsd:attribute name="confidence" use="optional" default="1">
					<xsd:simpleType>
						<xsd:restriction base="xsd:float">
							<xsd:minInclusive value="1.0"/>
							<xsd:maxInclusive value="10.0"/>
						</xsd:restriction>
					</xsd:simpleType>
				</xsd:attribute>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>

	<xsd:complexType name="NOBAND">
		<xsd:attribute name="bandid" type="xsd:string" fixed="noband"/>
		<xsd:attribute name="description" use="optional">
			<xsd:simpleType>
				<xsd:restriction base="xsd:string">
					<xsd:maxLength value="255"/>
				</xsd:restriction>
			</xsd:simpleType>
		</xsd:attribute>
		<xsd:attribute name="uri" type="xsd:anyURI" use="optional"/>
	</xsd:complexType>

	<xsd:complexType name="BAND">
		<xsd:simpleContent>
			<xsd:extension base="xsd:string">
				<xsd:attribute name="ucd" type="xsd:token" use="required"/>
				<xsd:attribute name="bandid" type="xsd:ID" use="required"/>
				<xsd:attribute name="description" use="optional">
					<xsd:simpleType>
						<xsd:restriction base="xsd:string">
							<xsd:maxLength value="255"/>
						</xsd:restriction>
					</xsd:simpleType>
				</xsd:attribute>
				<xsd:attribute name="uri" type="xsd:anyURI" use="optional"/>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>

	<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		SPACE AND TIME TYPES
		TimeVal should be the only type used, the tType and uType
		are to be used to add attributes to the elements within the TimeVal
	-->
	<xsd:complexType name="tType">
		<xsd:simpleContent>
			<xsd:extension base="xsd:decimal">
				<xsd:attribute name="width" use="optional">
					<xsd:simpleType>
						<xsd:restriction base="xsd:decimal">
							<xsd:minInclusive value="0.0"/>
						</xsd:restriction>
					</xsd:simpleType>
				</xsd:attribute>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>

	<xsd:complexType name="tPropType">
		<xsd:annotation>
			<xsd:documentation>
				A type for time related SpaceTimeSys properties, allowing the units to be
				specified in addition to the value.  Units set in this manner override the
				time units settings set in the TimeFrame.  For instance, 'day's may be set
				for the time stamps, but 'second's may be set for the integration time.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:simpleContent>
			<xsd:extension base="xsd:decimal">
				<xsd:attribute name="unit" type="timeUnitType" use="optional"/>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>

	<!-- Uncertainties for time values -->
	<xsd:complexType name="uncType">
		<xsd:simpleContent>
			<xsd:extension base="xsd:decimal">
				<xsd:attribute name="type" use="optional" default="midpoint">
					<xsd:simpleType>
						<xsd:restriction base="xsd:string">
							<xsd:enumeration value="midpoint"/>
							<xsd:enumeration value="begin"/>
							<xsd:enumeration value="end"/>
						</xsd:restriction>
					</xsd:simpleType>
				</xsd:attribute>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>

	<xsd:complexType name="TimeVal">
		<xsd:sequence>
			<xsd:element name="T" type="tType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="UNC" type="uncType" minOccurs="0" maxOccurs="3"/>
			<xsd:element name="RESOLUTION" type="xsd:decimal" minOccurs="0" maxOccurs="1"/>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:simpleType name="jdType">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="JD"/>
			<xsd:enumeration value="MJD"/>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="TimeScale">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="TDB"/>
			<xsd:enumeration value="TT"/>
			<xsd:enumeration value="UTC"/>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="TimeWidth">
		<xsd:restriction base="xsd:float">
			<xsd:minInclusive value="0.0"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	
	<xsd:simpleType name="C1Val">
		<xsd:restriction base="xsd:double">
			<xsd:minInclusive value="0.0"/>
			<xsd:maxExclusive value="360.0"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="C2Val">
		<xsd:restriction base="xsd:double">
			<xsd:minInclusive value="-90.0"/>
			<xsd:maxInclusive value="90.0"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:complexType name="PositionType">
		<xsd:sequence>
			<xsd:element name="C1">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="VAL" minOccurs="1" maxOccurs="1">
							<xsd:complexType>
								<xsd:simpleContent>
									<xsd:extension base="C1Val">
										<xsd:attribute name="size" use="optional" type="xsd:double"/>
										<xsd:attribute name="resolution" use="optional" type="xsd:double"/>
									</xsd:extension>
								</xsd:simpleContent>
							</xsd:complexType>
						</xsd:element>
						<xsd:element name="ERR" type="ErrPos" minOccurs="0" maxOccurs="2"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="C2">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="VAL" minOccurs="1" maxOccurs="1">
							<xsd:complexType>
								<xsd:simpleContent>
									<xsd:extension base="C2Val">
										<xsd:attribute name="size" use="optional" type="xsd:double"/>
										<xsd:attribute name="resolution" use="optional" type="xsd:double"/>
									</xsd:extension>
								</xsd:simpleContent>
							</xsd:complexType>
						</xsd:element>
						<xsd:element name="ERR" type="ErrPos" minOccurs="0" maxOccurs="2"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="PositionVal">
		<xsd:complexContent>
			<xsd:extension base="PositionType">
				<xsd:attribute name="fld" type="xsd:IDREF" use="required"/>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:simpleType name="ReferencePosition">
		<xsd:annotation>
			<xsd:documentation>
				The allowed reference positions are TOPOCENTER, GEOCENTER, HELIOCENTER, and BARYCENTER;
				the latter 2 should only be paired with time scale TDB.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="BARYCENTER"/>
			<xsd:enumeration value="GEOCENTER"/>
			<xsd:enumeration value="HELIOCENTER"/>
			<xsd:enumeration value="TOPOCENTER"/>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="SpaceRefFrame">
		<xsd:annotation>
			<xsd:documentation>SpaceReferenceFrame may be ICRS or GALACTIC</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="ICRS"/>
			<xsd:enumeration value="GALACTIC"/>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="timeUnitType">
		<xsd:annotation>
			<xsd:documentation>Time units may be 'second', 'day', 'year' or 'radian' (for phased data)</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="second"/>
			<xsd:enumeration value="day"/>
			<xsd:enumeration value="year"/>
			<xsd:enumeration value="radian"/>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="positionUnitType">
		<xsd:annotation>
			<xsd:documentation>Spatial units may be 'deg', 'arcmin', 'arcsec' or 'mas'.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="deg"/>
			<xsd:enumeration value="arcmin"/>
			<xsd:enumeration value="arcsec"/>
			<xsd:enumeration value="mas"/>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:complexType name="periodType">
		<xsd:annotation>
			<xsd:documentation>
				A period may be specified; it may have its own units attribute overriding 
				the global time unit. If the "folded" attribute is true, the time series 
				is expected to be folded at the value of Period, starting at TimeZero.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="tPropType">
				<xsd:attribute name="folded" type="xsd:boolean" use="optional" default="false"/>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<!-- ****************************************************************** -->
</xsd:schema>
