<?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="ALD_U_N_2B_02_30" format="binary" last-modified="2018-04-03">
  <cd:Record format="binary">
    <cd:Description>Level 2B Product</cd:Description>
    <cd:Field name="mph">
      <cd:NamedType id="MPH_v2"/>
    </cd:Field>
    <cd:Field name="sph">
      <cd:NamedType id="Level_2B_SPH_02_00"/>
    </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="meas_map">
      <cd:Array>
        <cd:Description>Measurement Map Annotation</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[0]]]></cd:Dimension>
        <cd:NamedType id="Level_2BC_Meas_Map_ADSR"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[0] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[0]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="mie_grouping">
      <cd:Array>
        <cd:Description>Mie Grouping ADS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[1]]]></cd:Dimension>
        <cd:NamedType id="Level_2BC_Grouping_ADSR_02_30"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[1] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[1]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="rayleigh_grouping">
      <cd:Array>
        <cd:Description>Rayleigh Grouping ADS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[2]]]></cd:Dimension>
        <cd:NamedType id="Level_2BC_Grouping_ADSR_02_30"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[2] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[2]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="mie_geolocation">
      <cd:Array>
        <cd:Description>Mie Wind Geolocation Data</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[3]]]></cd:Dimension>
        <cd:NamedType id="Level_2BC_Geolocation_ADSR_02_00"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[3] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[3]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="rayleigh_geolocation">
      <cd:Array>
        <cd:Description>Rayleigh Wind Geolocation Data</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[4]]]></cd:Dimension>
        <cd:NamedType id="Level_2BC_Geolocation_ADSR_02_00"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[4] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[4]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="amd_product_confid_data">
      <cd:Array>
        <cd:Description>AMD Product Confidence Data</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[5]]]></cd:Dimension>
        <cd:NamedType id="Level_2B_AMD_PCD_ADSR_02_00"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[5] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[5]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="meas_product_confid_data">
      <cd:Array>
        <cd:Description>Measurement level Product Confidence Data</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[6]]]></cd:Dimension>
        <cd:NamedType id="Level_2B_Meas_PCD_ADSR_02_30"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[6] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[6]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="mie_wind_prod_conf_data">
      <cd:Array>
        <cd:Description>Mie Wind Product Confidence Data</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[7]]]></cd:Dimension>
        <cd:NamedType id="Level_2BC_Mie_Wind_PCD_ADSR_02_00"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[7] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[7]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="rayleigh_wind_prod_conf_data">
      <cd:Array>
        <cd:Description>Rayleigh Wind Product Confidence Data</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[8]]]></cd:Dimension>
        <cd:NamedType id="Level_2BC_Rayleigh_Wind_PCD_ADSR_02_00"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[8] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[8]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="mie_hloswind">
      <cd:Array>
        <cd:Description>Mie HLOS winds</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[9]]]></cd:Dimension>
        <cd:NamedType id="Level_2BC_Mie_HLOSWind_MDSR_02_00"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[9] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[9]]]></cd:BitOffset>
      <ct:NamedTest id="LessThanOnePercentOfMieWindVelocityMissing"/>
    </cd:Field>
    <cd:Field name="rayleigh_hloswind">
      <cd:Array>
        <cd:Description>Rayleigh HLOS winds</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[10]]]></cd:Dimension>
        <cd:NamedType id="Level_2BC_Rayleigh_HLOSWind_MDSR_02_00"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[10] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[10]]]></cd:BitOffset>
      <ct:NamedTest id="LessThanOnePercentOfRayleighWindVelocityMissing"/>
    </cd:Field>
    <cd:Field name="mie_profile">
      <cd:Array>
        <cd:Description>Mie Profile</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[11]]]></cd:Dimension>
        <cd:NamedType id="Level_2BC_Wind_Profile_MDSR_02_00"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[11] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[11]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="rayleigh_profile">
      <cd:Array>
        <cd:Description>Rayleigh Profile</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[12]]]></cd:Dimension>
        <cd:NamedType id="Level_2BC_Wind_Profile_MDSR_02_00"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[12] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[12]]]></cd:BitOffset>
    </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 = 13]]></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) == "Meas_Map_ADS                "); $ds_to_dsd_index[1] = index(/dsd, str(./ds_name) == "Mie_Grouping_ADS            "); $ds_to_dsd_index[2] = index(/dsd, str(./ds_name) == "Rayleigh_Grouping_ADS       "); $ds_to_dsd_index[3] = index(/dsd, str(./ds_name) == "Mie_Geolocation_ADS         "); $ds_to_dsd_index[4] = index(/dsd, str(./ds_name) == "Rayleigh_Geolocation_ADS    "); $ds_to_dsd_index[5] = index(/dsd, str(./ds_name) == "AMD_Product_Confid_Data_ADS "); $ds_to_dsd_index[6] = index(/dsd, str(./ds_name) == "Meas_Product_Confid_Data_ADS"); $ds_to_dsd_index[7] = index(/dsd, str(./ds_name) == "Mie_Wind_Prod_Conf_Data_ADS "); $ds_to_dsd_index[8] = index(/dsd, str(./ds_name) == "Rayl_Wind_Prod_Conf_Data_ADS"); $ds_to_dsd_index[9] = index(/dsd, str(./ds_name) == "Mie_Wind_MDS                "); $ds_to_dsd_index[10] = index(/dsd, str(./ds_name) == "Rayleigh_Wind_MDS           "); $ds_to_dsd_index[11] = index(/dsd, str(./ds_name) == "Mie_Profile_MDS             "); $ds_to_dsd_index[12] = index(/dsd, str(./ds_name) == "Rayleigh_Profile_MDS        ")]]></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_NumMeasurements"/>
  <ct:NamedCrossFileTest id="SPH_NumMieGroups"/>
  <ct:NamedCrossFileTest id="SPH_NumRayleighGroups"/>
  <ct:NamedCrossFileTest id="SPH_NumMieWindResults"/>
  <ct:NamedCrossFileTest id="SPH_NumRayleighWindResults"/>
  <ct:NamedCrossFileTest id="SPH_NumMieProfiles"/>
  <ct:NamedCrossFileTest id="SPH_NumRayleighProfiles"/>
  <ct:NamedCrossFileTest id="SPH_NumAMDprofiles"/>
  <ct:NamedCrossFileTest id="SPH_intersect_start_lat"/>
  <ct:NamedCrossFileTest id="SPH_intersect_start_long"/>
  <ct:NamedCrossFileTest id="SPH_intersect_stop_lat"/>
  <ct:NamedCrossFileTest id="SPH_intersect_stop_long"/>
  <ct:NamedCrossFileTest id="SPH_Sat_Track"/>
  <ct:NamedCrossFileTest id="SPH_Num_Valid_Clear_Mie_Profiles"/>
  <ct:NamedCrossFileTest id="SPH_Num_Valid_Clear_Rayleigh_Prof"/>
  <ct:NamedCrossFileTest id="SPH_Num_Valid_Cloud_Mie_Profiles"/>
  <ct:NamedCrossFileTest id="SPH_Num_Valid_Cloud_Rayleigh_Prof"/>
  <ct:NamedCrossFileTest id="SPH_Num_Invalid_Clear_Mie_Profiles"/>
  <ct:NamedCrossFileTest id="SPH_Num_Invalid_Clear_Rayleigh_Prof"/>
  <ct:NamedCrossFileTest id="SPH_Num_Invalid_Cloud_Mie_Profiles"/>
  <ct:NamedCrossFileTest id="SPH_Num_Invalid_Cloud_Rayleigh_Prof"/>
  <ct:NamedCrossFileTest id="SPH_Num_Profiles_Surface_Mie"/>
  <ct:NamedCrossFileTest id="SPH_Num_Profiles_Surface_Ray"/>
  <ct:NamedCrossFileTest id="SPH_Num_Valid_Clear_Winds_L2B_Mie"/>
  <ct:NamedCrossFileTest id="SPH_Num_Valid_Clear_Winds_L2B_Ray"/>
  <ct:NamedCrossFileTest id="SPH_Num_Valid_Cloud_Winds_L2B_Mie"/>
  <ct:NamedCrossFileTest id="SPH_Num_Valid_Cloud_Winds_L2B_Ray"/>
  <ct:NamedCrossFileTest id="SPH_Num_Invalid_Clear_Winds_L2B_Mie"/>
  <ct:NamedCrossFileTest id="SPH_Num_Invalid_Clear_Winds_L2B_Ray"/>
  <ct:NamedCrossFileTest id="SPH_Num_Invalid_Cloud_Winds_L2B_Mie"/>
  <ct:NamedCrossFileTest id="SPH_Num_Invalid_Cloud_Winds_L2B_Ray"/>
</cd:ProductDefinition>
