<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://www.soda-is.com/TemporalSerieIrradiance"
	xmlns="http://www.w3.org/2001/XMLSchema"
	xmlns:tns="http://www.soda-is.com/TemporalSerieIrradiance"
	xmlns:gml="http://www.opengis.net/gml">
	<import namespace="http://www.opengis.net/gml"
		schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd">
	</import>
	<annotation>
		<documentation>
			Schema for describing and exploiting Solar Resource
			Knowledge. Units are expressed as string. Examples: kWh/m2,
			W/(m2.sr), W.m-2.sr-1, rad, °
		</documentation>
	</annotation>

	<!-- Basic -->
	<simpleType name="absenceOfValueType">
		<annotation>
			<documentation>
				denotes the absence of a value. Usually equals -99 or
				-999
			</documentation>
		</annotation>
		<restriction base="float" />
	</simpleType>

	<!-- Geolocation and elevation -->
	<simpleType name="latitudeType">
		<annotation>
			<documentation>
				for the sake of the simplicity, latitude is in decimal
				degrees
			</documentation>
		</annotation>
		<restriction base="float" />
	</simpleType>
	<simpleType name="longitudeType">
		<annotation>
			<documentation>
				for the sake of the simplicity, longitude is in decimal
				degree
			</documentation>
		</annotation>
		<restriction base="float" />
	</simpleType>
	<simpleType name="elevationType">
		<annotation>
			<documentation>
				for the sake of the simplicity, elevation is in m
			</documentation>
		</annotation>
		<restriction base="float" />
	</simpleType>

	<complexType name="geoPointType">
		<complexContent>
			<extension base="gml:PointType"></extension>
		</complexContent>
	</complexType>

	<!-- time -->
	<complexType name="dateRangeType">
		<attribute name="begin" type="dateTime">
			<annotation>
				<documentation>
					for the sake of the simplicity, date and time are
					expressed in UT, such as YYYY-MM-DDThh:mm:ss. Using
					seconds permit to describe accurately the True Solar
					Time in UT.
				</documentation>
			</annotation>
		</attribute>
		<attribute name="end" type="dateTime"></attribute>
	</complexType>

	<!--  IPR    to be completed -->
	<!-- see openGIScons\iso\19139\20070417\gmd citation.xsd contsraints.xsd-->
	<complexType name="IPRType">
		<attribute name="providerName" type="string" />
		<attribute name="copyrightText" type="string" />
		<attribute name="providerURL" type="string" />
		<attribute name="providerLogoURL" type="string" />
	</complexType>

	<!-- Spectral Range -->
	<complexType name="spectralRangeType">
		<attribute name="begin" type="float" />
		<attribute name="end" type="float" />
		<attribute name="FWHM" type="float" />
		<attribute name="halfWidth" type="float" />
		<attribute name="unit" type="string" />
	</complexType>

	<!-- Radiation -->
	<simpleType name="radiationTypeType">
		<restriction base="float" />
	</simpleType>

	<simpleType name="radiationAccuracyType">
		<restriction base="float" />
	</simpleType>

	<simpleType name="summarizationType">
		<annotation>
			<documentation>
				duration of a measurement or aggregation
			</documentation>
		</annotation>
		<restriction base="string">
			<enumeration value="continuous" />
			<enumeration value="1 min" />
			<enumeration value="5 min" />
			<enumeration value="10 min" />
			<enumeration value="15 min" />
			<enumeration value="30 min"></enumeration>
			<enumeration value="1 h"></enumeration>
			<enumeration value="1 d"></enumeration>
			<enumeration value="5 d"></enumeration>
			<enumeration value="10 d"></enumeration>
			<enumeration value="1 wk"></enumeration>
			<enumeration value="1 month"></enumeration>
			<enumeration value="1 a"></enumeration>
		</restriction>
	</simpleType>

	<simpleType name="radiationComponentType">
		<restriction base="string">
			<enumeration value="Global" />
			<enumeration value="Direct" />
			<enumeration value="DNI" />
			<enumeration value="Diffuse" />
		</restriction>
	</simpleType>

	<complexType name="sequenceOfObservationType">
		<sequence>
			<element name="observationType" type="string"></element>
			<element name="IPR" type="tns:IPRType" minOccurs="0" />
			<element name="location" type="tns:geoPointType"
				minOccurs="1" maxOccurs="1" />
			<element name="elevation" type="tns:elevationType"
				minOccurs="1" maxOccurs="1">
			</element>
			<element maxOccurs="unbounded" minOccurs="0"
				name="sequenceOfObservation" type="tns:singleObservationType" />
		</sequence>
		<attribute name="timeSeriesTitle" type="string" />
		<attribute name="unitAccuracy" type="string" />
		<attribute name="reliabilityDescription" type="string" />
		<attribute name="summarization" type="tns:summarizationType" />
		<attribute name="offsetInstant" type="float" />
		<attribute name="absenceOfValue" type="tns:absenceOfValueType" />
		<attribute name="observationProcedureDescription" type="string" />
	</complexType>

	<complexType name="tiltedPlaneType">
		<attribute name="tilt" type="float" />
		<attribute name="azimut" type="float" />
		<attribute name="unitAngle" type="string" />
	</complexType>

	<!-- time-series of observations -->
	<complexType name="singleRadiationObservationType">
		<annotation>
			<documentation>
				Describes a single observation of radiation. Date is the
				instant of observation, value is the count (measure),
				accuracy denotes uncertainty and reliability denotes the
				confidence in the observation. Note that usually date
				denotes the end of the period of the measurement
				(summarization). For example, if the period is 1 h,
				dateTime equals to 2008-25-01T18:43:26 means that the
				observation was made during this day from 17:43:27 to
				18:43:26. It happens that several observers do not
				follow that rule and that the time may be, say the
				middle of the hour. The "offsetInstant" has been created
				to manage such case. It is expressed in percent. 100
				means that it is the end of the summarization, 50 the
				middle, 0 the beginning etc.
			</documentation>
		</annotation>
		<complexContent>
			<extension base="tns:singleObservationType"></extension>
		</complexContent>
	</complexType>

	<!-- Still incomplete. Lacks description of the spatial support of information: station, cell, pixel and sizes in the two latter cases -->
	<complexType name="sequenceOfRadiationObservationsType">
		<complexContent>
			<extension base="tns:sequenceOfObservationType">
				<sequence>
					<element name="spectralRange"
						type="tns:spectralRangeType" />
					<element maxOccurs="unbounded" minOccurs="0"
						name="sequenceOfRadiationObservation"
						type="tns:singleRadiationObservationType" />
					<element name="radiationType"
						type="tns:radiationTypeType">
					</element>
				</sequence>
			</extension>
		</complexContent>
	</complexType>

	<!-- suite a revoir -->
	<complexType name="sequenceOfIrradianceType">
		<complexContent>
			<extension base="tns:sequenceOfRadiationObservationsType" />
		</complexContent>
	</complexType>

	<complexType name="sequenceOfGlobalIrradianceType">
		<complexContent>
			<extension base="tns:sequenceOfRadiationObservationsType"></extension>
		</complexContent>
	</complexType>

	<!--  C'est quoi ce qui suit ? irradiance en J m-2 ?? -->

	<complexType name="sequenceOfDirectIrradianceType">
		<complexContent>
			<extension base="tns:sequenceOfIrradianceType"></extension>
		</complexContent>
	</complexType>

	<complexType name="sequenceOfDirectNormalIrradianceType">
		<complexContent>
			<extension base="tns:sequenceOfDirectIrradianceType"></extension>
		</complexContent>
	</complexType>

	<complexType name="sequenceOfGlobalTOAIrradianceType">
		<complexContent>
			<extension base="tns:sequenceOfGlobalIrradianceType"></extension>
		</complexContent>
	</complexType>

	<complexType name="sequenceOfGlobalClearSkyIrradianceType">
		<complexContent>
			<extension base="tns:sequenceOfGlobalIrradianceType"></extension>
		</complexContent>
	</complexType>



	<complexType name="singleObservationType">
		<sequence>
			<element name="date" type="dateTime" />
			<element name="value" type="tns:radiationTypeType" />
			<element name="accuracy" type="tns:radiationAccuracyType" />
			<element name="relability" type="float" />
		</sequence>
	</complexType>
</schema>
