<?xml version="1.0" encoding="UTF-8"?>
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://psa.esa.int/psa/em16/frend/v1"
    xmlns:frend="http://psa.esa.int/psa/em16/frend/v1"
    xmlns:pds="http://pds.nasa.gov/pds4/pds/v1"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    version="1.1.0.0">
 
    <xs:import namespace="http://pds.nasa.gov/pds4/pds/v1" schemaLocation="https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1B00.xsd"/>
 
  <xs:annotation>
    <xs:documentation>

        LDD for the FREND instrument on board ExoMars 2016/TGO
    
    </xs:documentation>
  </xs:annotation>
 
  <xs:element name="FREND_Data" type="frend:FREND_Data"> </xs:element>

  <xs:complexType name="FREND_Data">
    <xs:annotation>
      <xs:documentation>Description of a FREND instrument
        observation</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="gap" type="frend:gap" minOccurs="0" maxOccurs="unbounded"> </xs:element>
      <xs:element name="utc_time_n" type="frend:utc_time_n" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="map_flag" type="frend:map_flag" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="sci_acc_time" type="frend:sci_acc_time" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="count_he1" type="frend:count_he1" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="count_he2" type="frend:count_he2" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="count_he3" type="frend:count_he3" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="count_he4" type="frend:count_he4" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="count_scn" type="frend:count_scn" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="count_scg" type="frend:count_scg" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="count_he1_err" type="frend:count_he1_err" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="count_he2_err" type="frend:count_he2_err" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="count_he3_err" type="frend:count_he3_err" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="count_he4_err" type="frend:count_he4_err" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="count_scn_err" type="frend:count_scn_err" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="count_scg_err" type="frend:count_scg_err" minOccurs="0" maxOccurs="1"> </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="gap">
    <xs:annotation>
<xs:documentation>Description here REVISE</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="gap_id" type="frend:gap_id" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="gap_start" type="frend:gap_start" minOccurs="0" maxOccurs="1"> </xs:element>
      <xs:element name="gap_end" type="frend:gap_end" minOccurs="0" maxOccurs="1"> </xs:element>
    </xs:sequence>
  </xs:complexType>

    <xs:annotation>
      <xs:documentation>This section contains the simpleTypes that provide more constraints
        than those at the base data type level. The simpleTypes defined here build on the base data
        types. This is another component of the common dictionary and therefore falls within the
        common namespace.
      </xs:documentation>
    </xs:annotation>

  <xs:simpleType name="count_he1">
    <xs:annotation>
      <xs:documentation>Count rate accumulated in counter HE1 during
        current frame corrected for all instrument and space environment
        effects, in counts per second REVISE CHANGE
        UNITS</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Real">
     <xs:minInclusive value="-1.7976931348623157e308"/>
     <xs:maxInclusive value="1.7976931348623157e308"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="count_he1_err">
    <xs:annotation>
      <xs:documentation>Count rate error for detector HE1 in counts per
        second [REVISE CONFIRM UNITS]</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Real">
     <xs:minInclusive value="-1.7976931348623157e308"/>
     <xs:maxInclusive value="1.7976931348623157e308"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="count_he2">
    <xs:annotation>
      <xs:documentation>Count rate accumulated in counter HE2 during
        current frame corrected for all instrument and space environment
        effects, in counts per second REVISE CHANGE
        UNITS</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Real">
     <xs:minInclusive value="-1.7976931348623157e308"/>
     <xs:maxInclusive value="1.7976931348623157e308"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="count_he2_err">
    <xs:annotation>
      <xs:documentation>Count rate error for detector HE2 in counts per
        second [REVISE CONFIRM UNITS]</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Real">
     <xs:minInclusive value="-1.7976931348623157e308"/>
     <xs:maxInclusive value="1.7976931348623157e308"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="count_he3">
    <xs:annotation>
      <xs:documentation>Count rate accumulated in counter HE3 during
        current frame corrected for all instrument and space environment
        effects, in counts per second REVISE CHANGE
        UNITS</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Real">
     <xs:minInclusive value="-1.7976931348623157e308"/>
     <xs:maxInclusive value="1.7976931348623157e308"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="count_he3_err">
    <xs:annotation>
      <xs:documentation>Count rate error for detector HE3 in counts per
        second [REVISE CONFIRM UNITS]</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Real">
     <xs:minInclusive value="-1.7976931348623157e308"/>
     <xs:maxInclusive value="1.7976931348623157e308"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="count_he4">
    <xs:annotation>
      <xs:documentation>Count rate accumulated in counter HE4 during
        current frame corrected for all instrument and space environment
        effects, in counts per second REVISE CHANGE
        UNITS</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Real">
     <xs:minInclusive value="-1.7976931348623157e308"/>
     <xs:maxInclusive value="1.7976931348623157e308"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="count_he4_err">
    <xs:annotation>
      <xs:documentation>Count rate error for detector HE4 in counts per
        second [REVISE CONFIRM UNITS]</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Real">
     <xs:minInclusive value="-1.7976931348623157e308"/>
     <xs:maxInclusive value="1.7976931348623157e308"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="count_scg">
    <xs:annotation>
      <xs:documentation>Count rate accumulated in counter scg during
        current frame corrected for all instrument and space environment
        effects, in counts per second REVISE CHANGE
        UNITS</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Real">
     <xs:minInclusive value="-1.7976931348623157e308"/>
     <xs:maxInclusive value="1.7976931348623157e308"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="count_scg_err">
    <xs:annotation>
      <xs:documentation>Count rate error for detector SCG in counts per
        second [REVISE CONFIRM UNITS]</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Real">
     <xs:minInclusive value="-1.7976931348623157e308"/>
     <xs:maxInclusive value="1.7976931348623157e308"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="count_scn">
    <xs:annotation>
      <xs:documentation>Count rate accumulated in counter SCN during
        current frame corrected for all instrument and space environment
        effects, in counts per second REVISE CHANGE
        UNITS</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Real">
     <xs:minInclusive value="-1.7976931348623157e308"/>
     <xs:maxInclusive value="1.7976931348623157e308"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="count_scn_err">
    <xs:annotation>
      <xs:documentation>Count rate error for detector SCN in counts per
        second [REVISE CONFIRM UNITS]</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Real">
     <xs:minInclusive value="-1.7976931348623157e308"/>
     <xs:maxInclusive value="1.7976931348623157e308"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="gap_end">
    <xs:annotation>
<xs:documentation>Description here REVISE</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Date_Time_YMD_UTC">
  <!-- format="YYYY-MM-DDTHH:MM:SS.SSSZ" -->
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="gap_id">
    <xs:annotation>
<xs:documentation>Description here REVISE</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Real">
     <xs:minInclusive value="-1.7976931348623157e308"/>
     <xs:maxInclusive value="1.7976931348623157e308"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="gap_start">
    <xs:annotation>
<xs:documentation>Description here REVISE</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Date_Time_YMD_UTC">
  <!-- format="YYYY-MM-DDTHH:MM:SS.SSSZ" -->
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="map_flag">
    <xs:annotation>
      <xs:documentation>Flag value 0 indicates if the frame is good for
        mapping purposes. Any other value – frame to be excluded for
        mapping. Reason codes (i.e. solar flare, off-nadir, instrument
        state) of this parameter to be provided in product delivery
        notes. </xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_NonNegative_Integer">
    	<xs:pattern value='[0-9]+'/>
     <xs:minInclusive value="0"/>
     <xs:maxInclusive value="255"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="sci_acc_time">
    <xs:annotation>
      <xs:documentation>Accumulation time of current frame in
        seconds</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_NonNegative_Integer">
    	<xs:pattern value='[0-9]+'/>
     <xs:minInclusive value="0"/>
     <xs:maxInclusive value="18446744073709551615"/>
	   </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="utc_time_n">
    <xs:annotation>
      <xs:documentation>UTC time of this frame, derived from spacecraft
        time through SPICE.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="pds:ASCII_Date_Time_YMD_UTC">
  <!-- format="YYYY-MM-DDTHH:MM:SS.SSSZ" -->
	   </xs:restriction>
  </xs:simpleType>
</xs:schema>
