<?xml version="1.0"?>
<cd:ProductDefinition xmlns:cd="http://www.stcorp.nl/coda/definition/2008/07" xmlns:ct="http://www.stcorp.nl/coda/test/2008/10" id="AUX_MET_12_02_20" format="binary" last-modified="2018-04-03">
  <cd:Record format="binary">
    <cd:Description>ADM-Aeolus Auxiliary Meteorological Data</cd:Description>
    <cd:Field name="mph">
      <cd:NamedType id="MPH_v2"/>
    </cd:Field>
    <cd:Field name="sph">
      <cd:NamedType id="AUX_MET_SPH_02_20"/>
    </cd:Field>
    <cd:Field name="dsd">
      <cd:Array format="ascii">
        <cd:Dimension><![CDATA[$num_dsd]]></cd:Dimension>
        <cd:NamedType id="DSD"/>
      </cd:Array>
    </cd:Field>
    <cd:Field name="geo_off_nadir">
      <cd:Array>
        <cd:Description>Geolocation &amp; AOCS data (off-nadir, one DSR / profile)</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[0]]]></cd:Dimension>
        <cd:NamedType id="AUX_MET_GEOADS"/>
      </cd:Array>
    </cd:Field>
    <cd:Field name="geo_nadir">
      <cd:Array>
        <cd:Description>Geolocation &amp; AOCS data (nadir, one DSR / profile)</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[1]]]></cd:Dimension>
        <cd:NamedType id="AUX_MET_GEOADS"/>
      </cd:Array>
    </cd:Field>
    <cd:Field name="met_off_nadir">
      <cd:Array>
        <cd:Description>Metereological data (off-nadir, for reprocessing etc, one DSR / profile)</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[2]]]></cd:Dimension>
        <cd:NamedType id="AUX_MET_METDS_02_30"/>
      </cd:Array>
      <ct:NamedTest id="LessThan2PercentOfAmdUsMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdVsMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdPsMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdErrPsMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdZsMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdPbaseMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdPtopMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdPnomMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdZbaseMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdZtopMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdZnomMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdTMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdErrTMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdUMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdVMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdRhMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdErrRhMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdQMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdCcMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdClwcMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdCiwcMissing"/>
    </cd:Field>
    <cd:Field name="met_nadir">
      <cd:Array>
        <cd:Description>Metereological data (nadir, one DSR / profile)</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[3]]]></cd:Dimension>
        <cd:NamedType id="AUX_MET_METDS_02_30"/>
      </cd:Array>
      <ct:NamedTest id="LessThan2PercentOfAmdUsMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdVsMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdPsMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdErrPsMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdZsMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdPbaseMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdPtopMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdPnomMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdZbaseMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdZtopMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdZnomMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdTMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdErrTMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdUMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdVMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdRhMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdErrRhMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdQMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdCcMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdClwcMissing"/>
      <ct:NamedTest id="LessThan2PercentOfAmdCiwcMissing"/>
    </cd:Field>
  </cd:Record>
  <cd:ProductVariable name="num_dsd">
    <cd:Init><![CDATA[$num_dsd = int(/mph/num_dsd)]]></cd:Init>
  </cd:ProductVariable>
  <cd:ProductVariable name="num_ds">
    <cd:Init><![CDATA[$num_ds = 4]]></cd:Init>
  </cd:ProductVariable>
  <cd:ProductVariable name="ds_to_dsd_index">
    <cd:Dimension><![CDATA[$num_ds]]></cd:Dimension>
    <cd:Init><![CDATA[$ds_to_dsd_index[0] = index(/dsd, str(./ds_name) == "Geolocation_ADS1 off-nadir  "); $ds_to_dsd_index[1] = index(/dsd, str(./ds_name) == "Geolocation_ADS2 nadir      "); $ds_to_dsd_index[2] = index(/dsd, str(./ds_name) == "Meteorological DS1 off-nadir"); $ds_to_dsd_index[3] = index(/dsd, str(./ds_name) == "Meteorological DS2 nadir    ")]]></cd:Init>
  </cd:ProductVariable>
  <cd:ProductVariable name="ds_available">
    <cd:Dimension><![CDATA[$num_ds]]></cd:Dimension>
    <cd:Init><![CDATA[for i = 0 to $num_ds - 1 do $ds_available[i] = if($ds_to_dsd_index[i] != -1 && int(/dsd[$ds_to_dsd_index[i]]/ds_size) != 0, 1, 0)]]></cd:Init>
  </cd:ProductVariable>
  <cd:ProductVariable name="ds_offset">
    <cd:Dimension><![CDATA[$num_ds]]></cd:Dimension>
    <cd:Init><![CDATA[for i = 0 to $num_ds - 1 do $ds_offset[i] = 8 * int(/dsd[$ds_to_dsd_index[i]]/ds_offset)]]></cd:Init>
  </cd:ProductVariable>
  <cd:ProductVariable name="num_dsr">
    <cd:Dimension><![CDATA[$num_ds]]></cd:Dimension>
    <cd:Init><![CDATA[for i = 0 to $num_ds - 1 do $num_dsr[i] = int(/dsd[$ds_to_dsd_index[i]]/num_dsr)]]></cd:Init>
  </cd:ProductVariable>
  <!-- MPH Cross File Tests -->
  <ct:NamedCrossFileTest id="MPH_Product"/>
  <ct:NamedCrossFileTest id="MPH_Proc_Stage"/>
  <ct:NamedCrossFileTest id="MPH_Ref_Doc"/>
  <ct:NamedCrossFileTest id="MPH_Acquisition_Station"/>
  <ct:NamedCrossFileTest id="MPH_Proc_Center"/>
  <ct:NamedCrossFileTest id="MPH_Proc_Time"/>
  <ct:NamedCrossFileTest id="MPH_Software_Ver"/>
  <ct:NamedCrossFileTest id="MPH_Baseline"/>
  <ct:NamedCrossFileTest id="MPH_Sensing_Start"/>
  <ct:NamedCrossFileTest id="MPH_Sensing_Stop"/>
  <ct:NamedCrossFileTest id="MPH_Phase"/>
  <ct:NamedCrossFileTest id="MPH_Cycle"/>
  <ct:NamedCrossFileTest id="MPH_Rel_Orbit"/>
  <ct:NamedCrossFileTest id="MPH_Abs_Orbit"/>
  <ct:NamedCrossFileTest id="MPH_State_Vector_Time"/>
  <ct:NamedCrossFileTest id="MPH_Delta_UT1"/>
  <ct:NamedCrossFileTest id="MPH_X_Position"/>
  <ct:NamedCrossFileTest id="MPH_Y_Position"/>
  <ct:NamedCrossFileTest id="MPH_Z_Position"/>
  <ct:NamedCrossFileTest id="MPH_X_Velocity"/>
  <ct:NamedCrossFileTest id="MPH_Y_Velocity"/>
  <ct:NamedCrossFileTest id="MPH_Z_Velocity"/>
  <ct:NamedCrossFileTest id="MPH_Vector_Source"/>
  <ct:NamedCrossFileTest id="MPH_Utc_Sbt_Time"/>
  <ct:NamedCrossFileTest id="MPH_Sat_Binary_Time"/>
  <ct:NamedCrossFileTest id="MPH_Leap_Utc"/>
  <ct:NamedCrossFileTest id="MPH_Leap_Sign"/>
  <ct:NamedCrossFileTest id="MPH_Leap_Err"/>
  <ct:NamedCrossFileTest id="MPH_Product_Err"/>
  <ct:NamedCrossFileTest id="MPH_Tot_Size"/>
  <ct:NamedCrossFileTest id="MPH_Sph_Size"/>
  <ct:NamedCrossFileTest id="MPH_Num_Dsd"/>
  <ct:NamedCrossFileTest id="MPH_Dsd_Size"/>
  <ct:NamedCrossFileTest id="MPH_Num_Data_Sets"/>
  <!-- SPH Cross File Tests -->
  <ct:NamedCrossFileTest id="SPH_Sph_Descriptor"/>
  <ct:NamedCrossFileTest id="SPH_Ref_NWP_Suite"/>
  <ct:NamedCrossFileTest id="SPH_Model_Timestep"/>
  <ct:NamedCrossFileTest id="SPH_Model_Grid_Type"/>
  <ct:NamedCrossFileTest id="SPH_Model_Resol_Par1"/>
  <ct:NamedCrossFileTest id="SPH_Model_Resol_Par2"/>
  <ct:NamedCrossFileTest id="SPH_Num_of_Model_Layers"/>
  <ct:NamedCrossFileTest id="SPH_Num_Records_in_DS1"/>
  <ct:NamedCrossFileTest id="SPH_Num_Records_in_DS2"/>
  <ct:NamedCrossFileTest id="SPH_Num_Avail_L1B_Obs"/>
  <ct:NamedCrossFileTest id="SPH_Num_Missing_L1B_Obs"/>
  <ct:NamedCrossFileTest id="SPH_Num_Computed_Locations"/>
  <ct:NamedCrossFileTest id="SPH_Num_Input_Files"/>
  <ct:NamedCrossFileTest id="SPH_Num_Files_Predict_Orbit"/>
</cd:ProductDefinition>
