<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v4.4 (http://www.xmlspy.com) by Ed Shaya (NASA) -->
<xs:schema targetNamespace="http://xml.gsfc.nasa.gov/XDF" xmlns="http://xml.gsfc.nasa.gov/XDF" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:annotation>
		<xs:documentation>This schema describes telemetry data by inheriting  schema elements from XDF using a redefine.</xs:documentation>
	</xs:annotation>
	<xs:redefine schemaLocation="XDF_019.xsd"/>
	<xs:complexType name="binaryFloatType">
		<xs:annotation>
			<xs:documentation>allow for I758 type floats.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="binaryFloatType">
				<xs:attribute name="type" default="IEEE">
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:enumeration value="IEEE"/>
							<xs:enumeration value="I758"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="dataFormatType">
		<xs:annotation>
			<xs:documentation>
				<xs:documentation>Extends xdf dataFormat types to include binaryTime</xs:documentation>
			</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="dataFormatType">
				<xs:sequence minOccurs="0">
					<xs:element name="binaryTime">
						<xs:annotation>
							<xs:documentation>datatype for holding date and time in binary representation</xs:documentation>
						</xs:annotation>
						<xs:complexType>
							<xs:attribute name="bits" use="required">
								<xs:annotation>
									<xs:documentation>width in bits</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:unsignedByte">
										<xs:minInclusive value="1"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:attribute>
							<xs:attribute name="timeUnits" use="required">
								<xs:annotation>
									<xs:documentation>List of time units present, eg "year month day hour".  If just "day" or "second" then it is an offset and the fiducialTime is needed.</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:NMTOKENS">
										<xs:enumeration value="year"/>
										<xs:enumeration value="month"/>
										<xs:enumeration value="day"/>
										<xs:enumeration value="hour"/>
										<xs:enumeration value="minute"/>
										<xs:enumeration value="second"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:attribute>
							<xs:attribute name="fiducialTime" type="xs:dateTime">
								<xs:annotation>
									<xs:documentation>date and timeof zero time if it is represented as an offset.</xs:documentation>
								</xs:annotation>
							</xs:attribute>
						</xs:complexType>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="binaryIntegerType">
		<xs:annotation>
			<xs:documentation>Extend XDF binary Integers to allow for ones-complement and sign-magnitude</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="binaryIntegerType">
				<xs:attribute name="representation" default="twosComplement">
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:enumeration value="twosComplement"/>
							<xs:enumeration value="onesCompliment"/>
							<xs:enumeration value="signMagnitude"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="structureType">
		<xs:annotation>
			<xs:documentation>Extend XDF structure to include: system, subsystem, PI, collaborator, and rights.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="structureType">
				<xs:sequence>
					<xs:element ref="project"/>
					<xs:element ref="system"/>
					<xs:element ref="subsystem" maxOccurs="unbounded"/>
					<xs:element ref="PrincipleInvestigator" maxOccurs="unbounded"/>
					<xs:element ref="collaborator" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element ref="rights" minOccurs="0"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="arrayType">
		<xs:annotation>
			<xs:documentation>extend arrayType to include I785 floats types and integer twos-complement and sign-magnitude.  Setting it here means it is not needed in all of the individual fields.  But, setting either of these  in a field would over-ride the setting here.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="arrayType">
				<xs:attribute name="binaryFloatRepresentation" default="IEEE">
					<xs:simpleType>
						<xs:restriction base="xs:NMTOKEN">
							<xs:enumeration value="IEEE"/>
							<xs:enumeration value="I758"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
				<xs:attribute name="binaryIntegerRepresentation" default="twosComplement">
					<xs:simpleType>
						<xs:restriction base="xs:NMTOKEN">
							<xs:enumeration value="twosComplement"/>
							<xs:enumeration value="onesCompliment"/>
							<xs:enumeration value="signMagnitude"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="noteType">
		<xs:annotation>
			<xs:documentation>extend noteType with lo(hi)Inclusive(Exclusive), bit, and applyToConverted attributes.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="noteType">
				<xs:attribute name="loInclusive" type="xs:float">
					<xs:annotation>
						<xs:documentation> lo(hi)Inclusive(Exclusive) which sets the range on values for which the text in note applies.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="hiInclusive" type="xs:float"/>
				<xs:attribute name="loExclusive" type="xs:float"/>
				<xs:attribute name="hiExclusive" type="xs:float"/>
				<xs:attribute name="bit" type="xs:unsignedByte">
					<xs:annotation>
						<xs:documentation>text in note applies to the nth bit, where n is set here.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="applyToConverted" default="true">
					<xs:annotation>
						<xs:documentation>Need to first apply conversion before determining if note applies to value (if this is set to true)</xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:restriction base="xs:boolean">
							<xs:enumeration value="false"/>
							<xs:enumeration value="true"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="fieldType">
		<xs:annotation>
			<xs:documentation>Like columns in  tables, this holds header info (name, units, dataFromat) of a single data type.</xs:documentation>
			<xs:documentation>This type has both extensions (start,end,default, min,max,conversion) and restrictions on @class/enumeration.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:restriction base="fieldType">
				<xs:sequence>
					<xs:sequence>
						<xs:choice>
							<xs:element ref="units"/>
							<xs:element ref="unitless"/>
						</xs:choice>
						<xs:element name="dataFormat" type="dataFormatType"/>
						<xs:element name="specialValues" type="specialValuesType" minOccurs="0"/>
					</xs:sequence>
					<xs:element ref="relation" minOccurs="0"/>
					<xs:element name="note" type="noteType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element ref="start" minOccurs="0"/>
					<xs:element ref="end" minOccurs="0"/>
					<xs:element ref="default" minOccurs="0"/>
					<xs:element ref="min" minOccurs="0"/>
					<xs:element ref="max" minOccurs="0"/>
					<xs:element ref="conversion" minOccurs="0"/>
				</xs:sequence>
				<xs:attribute name="name" type="xs:string"/>
				<xs:attribute name="description" type="xs:string"/>
				<xs:attribute name="fieldId" type="xs:ID">
					<xs:annotation>
						<xs:documentation>Unique identifier for field</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="fieldIdRef" type="xs:IDREF">
					<xs:annotation>
						<xs:documentation>Allow clone of field metadata from another array.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="class">
					<xs:annotation>
						<xs:documentation>Each discipline should define enumeration of field/types.</xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:restriction base="xs:NMTOKENS">
							<xs:enumeration value="messageId">
								<xs:annotation>
									<xs:documentation/>
								</xs:annotation>
							</xs:enumeration>
							<xs:enumeration value="structureId">
								<xs:annotation>
									<xs:documentation/>
								</xs:annotation>
							</xs:enumeration>
							<xs:enumeration value="CCSDSId">
								<xs:annotation>
									<xs:documentation/>
								</xs:annotation>
							</xs:enumeration>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
				<xs:attribute name="complexComponent">
					<xs:annotation>
						<xs:documentation>If complex numbers are needed, simply add a fieldAxis with 2 fields, a real one and an imaginary one</xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:restriction base="xs:NMTOKEN">
							<xs:enumeration value="real"/>
							<xs:enumeration value="imaginary"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
				<xs:attribute name="unitDirectionAxisRef" type="xs:IDREF">
					<xs:annotation>
						<xs:documentation>N-d vector fields are handled by N unitDirection fields. If the components are along the axes use ref to refer to axisIdRef. </xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="telemetry" type="structureType">
		<xs:annotation>
			<xs:documentation>Root Element for this telemetry schema.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="project">
		<xs:annotation>
			<xs:documentation>Project or Mission Title</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:string">
					<xs:attribute name="description" type="xs:string"/>
					<xs:attribute name="type" type="xs:string"/>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="system">
		<xs:annotation>
			<xs:documentation>Main system or spacecraft source of data</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:string">
					<xs:attribute name="description" type="xs:string"/>
					<xs:attribute name="type" type="xs:string"/>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="subsystem">
		<xs:annotation>
			<xs:documentation>Subsystem within main system source of data</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:string">
					<xs:attribute name="description" type="xs:string"/>
					<xs:attribute name="type" type="xs:string"/>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="PrincipleInvestigator">
		<xs:annotation>
			<xs:documentation>principle investigator</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:string">
					<xs:attribute name="email" type="xs:anyURI"/>
					<xs:attribute name="address" type="xs:string"/>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="collaborator">
		<xs:annotation>
			<xs:documentation>associated personnel to project</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:string">
					<xs:attribute name="email" type="xs:string"/>
					<xs:attribute name="address" type="xs:string"/>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="rights" type="xs:string">
		<xs:annotation>
			<xs:documentation>Statement of data  copyrights ownership and restrictions</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="curvePoint">
		<xs:annotation>
			<xs:documentation>sampled point on curve that provides conversion from data units to physical units</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="output" type="xs:float">
				<xs:annotation>
					<xs:documentation>The output component of the point.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="input" type="xs:float">
				<xs:annotation>
					<xs:documentation>The input component of the point.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="conversion">
		<xs:annotation>
			<xs:documentation>Holds various ways to convert from data units to physical units</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:choice minOccurs="0">
				<xs:element name="spline">
					<xs:annotation>
						<xs:documentation>spline fit through a set of curvePoints</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element ref="curvePoint" minOccurs="3" maxOccurs="unbounded"/>
						</xs:sequence>
						<xs:attribute name="order">
							<xs:annotation>
								<xs:documentation>Order of spline fit.  order=1 is piecewise linear, order=2 is piecewise parabolic, order=3 is cubic spline.</xs:documentation>
							</xs:annotation>
							<xs:simpleType>
								<xs:restriction base="xs:unsignedByte">
									<xs:maxInclusive value="8"/>
									<xs:minInclusive value="1"/>
								</xs:restriction>
							</xs:simpleType>
						</xs:attribute>
					</xs:complexType>
				</xs:element>
				<xs:element name="polynomial">
					<xs:annotation>
						<xs:documentation>conversion curve is generated by polynomial.  The coefficients are procided here as a list.</xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:list itemType="xs:float"/>
					</xs:simpleType>
				</xs:element>
			</xs:choice>
		</xs:complexType>
	</xs:element>
	<xs:element name="start">
		<xs:annotation>
			<xs:documentation>start bit or byte of a field from beginning of record</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:nonNegativeInteger">
					<xs:attribute name="bitOrByte">
						<xs:simpleType>
							<xs:restriction base="xs:string">
								<xs:enumeration value="byte"/>
								<xs:enumeration value="bit"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:attribute>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="end">
		<xs:annotation>
			<xs:documentation>end  bit or byte of a field from beginning of record</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:nonNegativeInteger">
					<xs:attribute name="bitOrByte">
						<xs:simpleType>
							<xs:restriction base="xs:string">
								<xs:enumeration value="byte"/>
								<xs:enumeration value="bit"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:attribute>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="min">
		<xs:annotation>
			<xs:documentation>minimum value of field.  If no @type then this is minimum possbile</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:float">
					<xs:attribute name="inclusive" default="true">
						<xs:simpleType>
							<xs:restriction base="xs:boolean">
								<xs:enumeration value="true"/>
								<xs:enumeration value="false"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:attribute>
					<xs:attribute name="type">
						<xs:annotation>
							<xs:documentation>If present and set to yellow, then this is the minimum yellow level.  Same if red.</xs:documentation>
						</xs:annotation>
						<xs:simpleType>
							<xs:restriction base="xs:string">
								<xs:enumeration value="yellow"/>
								<xs:enumeration value="red"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:attribute>
					<xs:attribute name="applyToConverted" default="true">
						<xs:annotation>
							<xs:documentation>determines whether to apply min value to raw or to converted values.</xs:documentation>
						</xs:annotation>
						<xs:simpleType>
							<xs:restriction base="xs:boolean">
								<xs:enumeration value="false"/>
								<xs:enumeration value="true"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:attribute>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="max">
		<xs:annotation>
			<xs:documentation>see annotations in min element</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:float">
					<xs:attribute name="inclusive" default="true">
						<xs:simpleType>
							<xs:restriction base="xs:boolean">
								<xs:enumeration value="true"/>
								<xs:enumeration value="false"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:attribute>
					<xs:attribute name="type">
						<xs:simpleType>
							<xs:restriction base="xs:string">
								<xs:enumeration value="yellow"/>
								<xs:enumeration value="red"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:attribute>
					<xs:attribute name="applyToConverted" default="true">
						<xs:simpleType>
							<xs:restriction base="xs:boolean">
								<xs:enumeration value="false"/>
								<xs:enumeration value="true"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:attribute>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="default" type="xs:string">
		<xs:annotation>
			<xs:documentation>Default value to apply when noData value is set.</xs:documentation>
		</xs:annotation>
	</xs:element>
</xs:schema>
