<?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_0__04_06" format="binary" last-modified="2018-06-20">
  <cd:Record format="binary">
    <cd:Description>Level 0 Product</cd:Description>
    <cd:Field name="mph">
      <cd:NamedType id="MPH_v2"/>
    </cd:Field>
    <cd:Field name="sph">
      <cd:NamedType id="Level_0_SPH"/>
    </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="wind_velocity">
      <cd:Array>
        <cd:Description>Wind Measurement MDS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[0]]]></cd:Dimension>
        <cd:NamedType id="Level_0_MDSR_04_04_LIDAR"/>
        <ct:NamedTest id="FixedValue128" path="[]/aocs/instr_func"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[0] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[0]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="laser_diode_temperature">
      <cd:Array>
        <cd:Description>Laser Diode Temperature Adjustment MDS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[1]]]></cd:Dimension>
        <cd:NamedType id="Level_0_MDSR_04_04_LIDAR"/>
        <ct:NamedTest id="FixedValue32" path="[]/aocs/instr_func"/>
        <!-- Value of instr_func is not clear yet <ct:NamedTest id="FixedValue1" path="[]/aocs/instr_func"/> -->
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[1] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[1]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="instr_response_cal">
      <cd:Array>
        <cd:Description>Instrument Response Calibration MDS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[2]]]></cd:Dimension>
        <cd:NamedType id="Level_0_MDSR_04_04_LIDAR"/>
        <ct:NamedTest id="FixedValue64" path="[]/aocs/instr_func"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[2] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[2]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="instr_spec_reg">
      <cd:Array>
        <cd:Description>Instrument Spectral Registration MDS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[3]]]></cd:Dimension>
        <cd:NamedType id="Level_0_MDSR_04_04_LIDAR"/>
        <ct:NamedTest id="FixedValue1" path="[]/aocs/instr_func"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[3] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[3]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="instr_auto_test">
      <cd:Array>
        <cd:Description>Instrument Auto Test MDS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[4]]]></cd:Dimension>
        <cd:NamedType id="Level_0_MDSR_04_04_LIDAR"/>
        <ct:NamedTest id="FixedValue2" path="[]/aocs/instr_func"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[4] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[4]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="dark_current_cal">
      <cd:Array>
        <cd:Description>Dark Current Calibration MDS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[5]]]></cd:Dimension>
        <cd:NamedType id="Level_0_MDSR_04_04_IMAGING"/>
        <ct:NamedTest id="FixedValue4" path="[]/aocs/instr_func"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[5] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[5]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="instr_defocus_cal">
      <cd:Array>
        <cd:Description>Instrument Defocus Calibration MDS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[6]]]></cd:Dimension>
        <cd:NamedType id="Level_0_MDSR_04_04_IMAGING"/>
        <ct:NamedTest id="FixedValue8" path="[]/aocs/instr_func"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[6] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[6]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="phase_adjustment">
      <cd:Array>
        <cd:Description>Laser Chopper Mechanism Phase Adjustment MDS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[7]]]></cd:Dimension>
        <cd:NamedType id="Level_0_MDSR_04_04_LIDAR"/>
        <ct:NamedTest id="FixedValue16" path="[]/aocs/instr_func"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[7] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[7]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="offline_wind_velocity">
      <cd:Array>
        <cd:Description>Offline Wind Velocity Measurement Mode MDS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[8]]]></cd:Dimension>
        <cd:NamedType id="Level_0_MDSR_04_04_LIDAR"/>
        <ct:NamedTest id="FixedValue256" path="[]/aocs/instr_func"/>
        <!-- Value of instr_func is not clear yet <ct:NamedTest id="FixedValue128" path="[]/aocs/instr_func"/> -->
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[8] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[8]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="nop_udm">
      <cd:Array>
        <cd:Description>No Operation and User Defined Mode MDS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[9]]]></cd:Dimension>
        <cd:NamedType id="Level_0_MDSR_04_04_LIDAR"/>
        <ct:NamedTest id="FixedValue0" path="[]/aocs/instr_func"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[9] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[9]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="dark_current_mem_zone">
      <cd:Array>
        <cd:Description>Dark Current in Memory Zone Calibration Mode MDS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[10]]]></cd:Dimension>
        <cd:NamedType id="Level_0_MDSR_04_04_LIDAR"/>
        <ct:NamedTest id="FixedValue401" path="[]/aocs/instr_func"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[10] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[10]]]></cd:BitOffset>
    </cd:Field>
    <cd:Field name="laser_beam_monitoring">
      <cd:Array>
        <cd:Description>Laser Beam Monitoring Calibration Mode MDS</cd:Description>
        <cd:Dimension><![CDATA[$num_dsr[11]]]></cd:Dimension>
        <cd:NamedType id="Level_0_MDSR_04_04_IMAGING"/>
        <ct:NamedTest id="FixedValue611" path="[]/aocs/instr_func"/>
      </cd:Array>
      <cd:Available><![CDATA[$ds_available[11] != 0]]></cd:Available>
      <cd:BitOffset><![CDATA[$ds_offset[11]]]></cd:BitOffset>
    </cd:Field>
    <ct:NamedTest id="NumDataSets" path="mph/num_data_sets"/>
    <ct:NamedTest id="IspTfCrCErrorsSignificant" path="sph/isp_tf_crc_errors_significant"/>
    <ct:NamedTest id="MissingIspSignificant" path="sph/missing_isps_significant"/>
    <ct:NamedTest id="IspCrCErrorsSignificant" path="sph/isp_crc_errors_significant"/>
    <ct:NamedTest id="RsCorrectionsSignificant" path="sph/rs_corrections_significant"/>
    <ct:NamedTest id="CrcCountCheckTransferFrames" path="sph/num_tf_crc_error_isps"/>
    <ct:NamedTest id="CrcCountSPMissing" path="sph/number_missing_isps"/>
    <ct:NamedTest id="CrcCountSPInvalid" path="sph/num_isp_crc_errors"/>
    <ct:NamedTest id="CrcCountCheckRS" path="sph/num_rs_isps"/>
  </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 = 12]]></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(int(/dsd[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[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[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_Start_Lat"/>
  <ct:NamedCrossFileTest id="SPH_Start_Long"/>
  <ct:NamedCrossFileTest id="SPH_Stop_Lat"/>
  <ct:NamedCrossFileTest id="SPH_Stop_Long"/>
  <ct:NamedCrossFileTest id="SPH_Sat_Track"/>
  <ct:NamedCrossFileTest id="SPH_Isp_TF_CRC_Errors_Significant"/>
  <ct:NamedCrossFileTest id="SPH_Missing_ISPs_Significant"/>
  <ct:NamedCrossFileTest id="SPH_ISP_CRC_Errors_Significant"/>
  <ct:NamedCrossFileTest id="SPH_Rs_Corrections_Significant"/>
  <ct:NamedCrossFileTest id="SPH_Num_TF_CRC_Error_Isps"/>
  <ct:NamedCrossFileTest id="SPH_TF_CRC_Error_Isps_Thresh"/>
  <ct:NamedCrossFileTest id="SPH_Number_Missing_Isps"/>
  <ct:NamedCrossFileTest id="SPH_Missing_Isps_Thresh"/>
  <ct:NamedCrossFileTest id="SPH_Num_ISP_CRC_Errors"/>
  <ct:NamedCrossFileTest id="SPH_ISP_CRC_Thresh"/>
  <ct:NamedCrossFileTest id="SPH_Num_Rs_Isps"/>
  <ct:NamedCrossFileTest id="SPH_Rs_Thresh"/>
</cd:ProductDefinition>
