<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema  
            xmlns:nwis="http://water.usgs.gov/XML/NWIS/5.0" 
             
            xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
            elementFormDefault="qualified" version="5.0">

  <xsd:include schemaLocation="Channel.xsd"/>
  <xsd:include schemaLocation="MidSectionDischargeMeasurement.xsd"/>
  <xsd:include schemaLocation="VolumetricDischargeMeasurement.xsd"/>
  <xsd:include schemaLocation="FlumeDischargeMeasurement.xsd"/>
  <xsd:include schemaLocation="AdcpDischargeMeasurement.xsd"/>
  <xsd:include schemaLocation="DischargeMeasurementShiftAnalysis.xsd"/>
  <xsd:include schemaLocation="../shared/ReferenceListCodeType.xsd"/>
  <xsd:include schemaLocation="../shared/DateTimeWithDatum.xsd"/>
  <xsd:include schemaLocation="../shared/DateTimeWithDatumPartial.xsd"/>
  <xsd:include schemaLocation="../shared/IEEE754FloatValue.xsd"/>
  <xsd:include schemaLocation="../shared/RecordHistory.xsd"/>
  <xsd:include schemaLocation="../shared/Equipment.xsd"/>

  <xsd:element name="DischargeMeasurement">
    <xsd:annotation>
      <xsd:documentation>
        <Definition>A set of measurements made, that result in the calculation of the streamflow (discharge) of a stream at that point in time.</Definition>
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="MeasurementNumber" type="xsd:NMTOKEN">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The number identifying the discharge measurement.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="DischargeDateTime" type="DateTimeWithDatumPartial">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The official date and time (full or partial) of the discharge measurement.  Usually the mean of the start and end date and time (if specified).of the discharge measurement.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="StartDateTime" type="DateTimeWithDatum" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The starting date and time of the discharge measurement.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="EndDateTime" type="DateTimeWithDatum" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The ending date and time of the discharge measurement.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
       <xsd:element name="MeasurementUnusedIndicator" type="xsd:boolean">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>Flag indicating if the discharge measurement was NOT used in records processing.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="MeasurementQualityCode" type="ReferenceListCodeType">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The code indicating the quality of the discharge measurement.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="DischargeCode" type="ReferenceListCodeType">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The code indicating the method of adjustment of discharge value.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="DischargeMeasure" type="IEEE754UncertaintyFloatValueType">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The stream discharge of the discharge measurement. The default units are in cubic feet per second.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="SlopeStationDischargeMeasure" type="IEEE754FloatValueType" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The rating analysis discharge is the discharge value used in rating and shift analysis for sites where slope a factor and the discharge flowing past the gage has to be adjusted to be used in the analysis. The default units are cubic feet per second.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
	<xsd:element name="StageMeasure" type="IEEE754FloatValueType">
    	  <xsd:annotation>
      	    <xsd:documentation>
              <Definition>The value of the stream stage that corresponds to the discharge flowing past the gage. The default units are in feet.</Definition>
      	    </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="StageDifferenceMeasure" type="IEEE754FloatValueType" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The change in stage during measurement. The default units are feet.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="StageDifferenceDurationMeasure" type="IEEE754FloatValueType" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The duration of time over which the change in stage was measured. The default units are hours.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="MeanAuxilliaryStageMeasure" type="IEEE754FloatValueType" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The mean auxilliary stream stage for a site where slope is a factor. The default units are feet.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="MeanIndexVelocityMeasure" type="IEEE754FloatValueType" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The mean index velocity of the stream for a site where velocity is a factor. The default units are feet per second.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="StandardSectionAreaMeasure" type="IEEE754FloatValueType" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The stream cross-section area at the standard cross-section. The default units are square feet.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="SectionVelocityMeasure" type="IEEE754FloatValueType" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The stream velocity at the standard cross-section. The default units are feet per second.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="BaseFlowCode" type="ReferenceListCodeType" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The code indicating if stream flow is base flow or not</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="DischargeChannelAdjustmentMeasure" type="IEEE754FloatValueType" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The discharge adjustment from the measured channels to the final discharge value</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="ReviewerName" type="xsd:string" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The name of the reviewer of the discharge measurement</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="Comment" type="xsd:string" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>Comments about the discharge measurement.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element ref="Channel" minOccurs="0" maxOccurs="unbounded"/>
	<xsd:element ref="ShiftAnalysis" minOccurs="0">
          <xsd:annotation>
            <xsd:documentation>
              <Definition>The analysis to determine a shift to a stage-discharge rating, based on the discharge measurement.</Definition>
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>
