<?xml version="1.0"?>
<!-- $Header$ -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="0.1" elementFormDefault="unqualified">

  
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- INSTRUMENT SETUP RELATED TAGS -->

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Steps - useful to repeat stuff -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->  
  <xs:simpleType name="STEPS_Type">
    <xs:annotation>
      <xs:appinfo>STEPS</xs:appinfo>
      <xs:documentation xml:lang="en">
        STEPS.   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:integer">
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Amount - useful to put generic value -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->  
  <xs:simpleType name="AMOUNT_Type">
    <xs:annotation>
      <xs:appinfo>AMOUNT</xs:appinfo>
      <xs:documentation xml:lang="en">
        AMOUNT.   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:float">
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- INBEAM_DEP -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="INBEAM_DEP_Type">
    <xs:annotation>
      <xs:appinfo>Input Beam Deployer</xs:appinfo>
      <xs:documentation xml:lang="en">
        Deployable arm for input beam selector (2 positions). IN: closed, OUT: opened.   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="OUT"/>
      <xs:enumeration value="IN"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- INBEAM_TT Type -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="INBEAM_TT_Type">
    <xs:annotation>
      <xs:appinfo>Input Beam TipTilt</xs:appinfo>
      <xs:documentation xml:lang="en">
        TipTilt adjustment entrance folding mirror (2 positions). IN: closed, NPOS_2: Named position.  
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="IN"/>
      <!-- <xs:enumeration value="NPOS_2"/> -->
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- INBEAM_TT_X Type -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="INBEAM_TT_X_Type">
    <xs:annotation>
      <xs:appinfo>Input Beam TipTilt X</xs:appinfo>
      <xs:documentation xml:lang="en">
        Input beam tiptilt mirror X-axis. Value must be float.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:float">
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- INBEAM_TT_Y Type -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="INBEAM_TT_Y_Type">
    <xs:annotation>
      <xs:appinfo>Input Beam TipTilt Y</xs:appinfo>
      <xs:documentation xml:lang="en">
        Input beam tiptilt mirror Y-axis. Value must be float.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:float">
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- SHUTTER Type -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="SHUTTER_Type">
    <xs:annotation>
      <xs:appinfo>Entrance Shutter</xs:appinfo>
      <xs:documentation xml:lang="en">
        Entrance shutter. IN: closed, OUT: opened. Home position is IN.  
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="IN"/>
      <xs:enumeration value="OUT"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- APODIZER_W -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="APODIZER_W_Type">
    <xs:annotation>
      <xs:appinfo>Apodizer Wheel</xs:appinfo>
      <xs:documentation xml:lang="en">
        Apodizer wheel (8 positions).  
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="SP1_APO"/>
      <xs:enumeration value="SP2a_APO"/>
      <xs:enumeration value="SP2b_APO"/>
      <xs:enumeration value="HOLE"/>
      <xs:enumeration value="HOLE2"/>
      <xs:enumeration value="HOLE3"/>
      <xs:enumeration value="Lens_PD_neg"/>
      <xs:enumeration value="Lens_PD_pos"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="APODIZER_W_List_Type">
    <xs:list itemType="APODIZER_W_Type"/>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- CORO_SLIT_W -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="CORO_SLIT_W_Type">
    <xs:annotation>
      <xs:appinfo>Coronagraphic Slit Wheel</xs:appinfo>
      <xs:documentation xml:lang="en">
        Coronagraphic masks and slits wheel (9 positions).  
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="FQPM"/>
      <xs:enumeration value="GAUSS"/>
      <xs:enumeration value="SP1_FPM"/>
      <xs:enumeration value="SP2a_FPM"/>
      <xs:enumeration value="SP2b_FPM"/>
      <xs:enumeration value="SLIT1"/>
      <xs:enumeration value="SLIT2"/>
      <xs:enumeration value="WINDOW"/>
      <xs:enumeration value="HOLE"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- LYOT_GRISM_W -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="LYOT_GRISM_W_Type">
    <xs:annotation>
      <xs:appinfo>Lyot Grism Wheel</xs:appinfo>
      <xs:documentation xml:lang="en">
        Lyot stops wheel (7 positions).   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="PRISM"/>
      <xs:enumeration value="SP_LYOT_STOP"/>
      <xs:enumeration value="HOLE"/>
      <xs:enumeration value="GRISM"/>
      <xs:enumeration value="WOLLASTON"/>
      <xs:enumeration value="FQPM_LYOT_STOP"/>
      <xs:enumeration value="GAUSS_LYOT_STOP"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- SCI_FILT_W1 -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="SCI_FILT_W1_Type">
    <xs:annotation>
      <xs:appinfo>1st Scientific Filter Wheel</xs:appinfo>
      <xs:documentation xml:lang="en">
        1st scientific filter wheel (8 positions).   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="HOLE"/>
      <xs:enumeration value="BB_Y"/>
      <xs:enumeration value="BB_J"/>
      <xs:enumeration value="BB_H"/>
      <xs:enumeration value="NB_H2"/>
      <xs:enumeration value="NB_H3"/>
      <xs:enumeration value="ND2"/>
      <xs:enumeration value="HOLE2"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="SCI_FILT_W1_List_Type">
    <xs:list itemType="SCI_FILT_W1_Type"/>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- SCI_FILT_W2 -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="SCI_FILT_W2_Type">
    <xs:annotation>
      <xs:appinfo>2nd Scientific Filter Wheel</xs:appinfo>
      <xs:documentation xml:lang="en">
        2nd scientific filter wheel (8 positions). 
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="HOLE"/>
      <xs:enumeration value="NB_FeII"/>
      <xs:enumeration value="NB_HeI"/>
      <xs:enumeration value="NB_PaB"/>
      <xs:enumeration value="NB_ContJ"/>
      <xs:enumeration value="NB_ContH"/>
      <xs:enumeration value="ND3"/>
      <xs:enumeration value="ND4"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="SCI_FILT_W2_List_Type">
    <xs:list itemType="SCI_FILT_W2_Type"/>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- DB_FILT_W -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="DB_FILT_W_Type">
    <xs:annotation>
       <xs:appinfo>Dual Band Filter Wheel</xs:appinfo>
      <xs:documentation xml:lang="en">
        Dual Band filter wheel (5 positions).   
      </xs:documentation>
     </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="WINDOW"/>
      <xs:enumeration value="H2-H3"/>
      <xs:enumeration value="ContJ-PaB"/>
      <xs:enumeration value="ContH-FeII"/>
      <xs:enumeration value="Phase_Diversity_Couple"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DB_FILT_W_List_Type">
    <xs:list itemType="DB_FILT_W_Type"/>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- ND_FILT_W -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="ND_FILT_W_Type">
    <xs:annotation>
      <xs:appinfo>Neutral Density Filter Wheel</xs:appinfo>
      <xs:documentation xml:lang="en">
        Neutral density filter wheel (8 positions).   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="OD4"/>
      <xs:enumeration value="HOLE"/>
      <xs:enumeration value="OD0_2"/>
      <xs:enumeration value="OD0_5"/>
      <xs:enumeration value="OD1"/>
      <xs:enumeration value="OD1_3"/>
      <xs:enumeration value="OD2"/>
      <xs:enumeration value="OD3"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="ND_FILT_W_List_Type">
    <xs:list itemType="ND_FILT_W_Type"/>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Pupil Lens Type -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="PUPIL_LENS_DEP_Type">
    <xs:annotation>
      <xs:appinfo>Pupil Lens Deployer</xs:appinfo>
      <xs:documentation xml:lang="en">
        Pupil Lens Deployer (2 positions). IN: INSERT, OUT: OUT.   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="OUT"/>
      <xs:enumeration value="IN"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Calibration Mirror dep. -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="CAL_MIRROR_DEP_Type">
    <xs:annotation>
      <xs:appinfo>Calibration Mirror Deployer</xs:appinfo>
      <xs:documentation xml:lang="en">
        Calibration mirror deployer (2 positions). IN: closed, OUT: opened.   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="IN"/>
      <xs:enumeration value="OUT"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Fiber deployer Type -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="CAL_FIBER_DEP_Type">
    <xs:annotation>
      <xs:appinfo>Calibration Fiber Deployer</xs:appinfo>
      <xs:documentation xml:lang="en">
        Calibration fiber deployer.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="FOCUS_IN"/>
      <xs:enumeration value="DEFOCUS_IN"/>
      <xs:enumeration value="NO_FIBERS"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Filter deployer Type (davide) -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="CAL_FILTER_DEP_Type">
    <xs:annotation>
      <xs:appinfo>Calibration Filter Deployer</xs:appinfo>
      <xs:documentation xml:lang="en">
        Calibration Filter Deployer (2 positions). IN: closed, OUT: opened.   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="OUT"/>
      <xs:enumeration value="IN"/>
    </xs:restriction>
  </xs:simpleType>

 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Cal flat field lamp       -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="CAL_FF_LAMP_Type">
    <xs:annotation>
      <xs:appinfo>Calibration FlatField Lamp</xs:appinfo>
      <xs:documentation xml:lang="en">
        Calibration flatfield lamp (2 positions).    
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="ON"/>
      <xs:enumeration value="OFF"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~ -->
  <!-- Cal fiber lamp 1 -->
  <!-- ~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="CAL_FIBER_FOCUS_LAMP_Type">
    <xs:annotation>
      <xs:appinfo>Calibration Fiber Focus Lamp</xs:appinfo>
      <xs:documentation xml:lang="en">
        Calibration fiber focus lamp (2 positions).
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="ON"/>
      <xs:enumeration value="OFF"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~ -->
  <!-- Cal fiber lamp 2 -->
  <!-- ~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="CAL_FIBER_DEFOCUS_LAMP_Type">
    <xs:annotation>
      <xs:appinfo>Calibration Fiber Defocus Lamp</xs:appinfo>
      <xs:documentation xml:lang="en">
        Calibration fiber defocus lamp (2 positions).   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="ON"/>
      <xs:enumeration value="OFF"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~ -->
  <!-- Lamp tel sim -->
  <!-- ~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="LAMP_TEL_SIM_Type">
    <xs:annotation>
      <xs:appinfo>Simulation Lamp</xs:appinfo>
      <xs:documentation xml:lang="en">
        Simulation lamp (2 positions).   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="ON"/>
      <xs:enumeration value="OFF"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Coronagraphic Combos -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="MaskComb_Type">
    <xs:annotation>
      <xs:appinfo>Mask Combination</xs:appinfo>
      <xs:documentation xml:lang="en">
        Coronagraphic techniques combinations of masks depend on the scientific observation.  
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">

      <!-- Coronagraphic Imaging -->
      <!-- Pupil Stabilized Comb's -->
      <xs:enumeration value="CI_SP1"/>
      <xs:enumeration value="CI_SP2a"/>
      <xs:enumeration value="CI_SP2b"/>
      <xs:enumeration value="CI_FQPM"/>
      <xs:enumeration value="CI_SP1_DB"/>
      <xs:enumeration value="CI_SP2a_DB"/>
      <xs:enumeration value="CI_SP2b_DB"/>
      <xs:enumeration value="CI_HOLE"/>

      <!-- Coronagraphic Imaging -->
      <!-- Field Stabilized Comb's -->
      <xs:enumeration value="CI_GAUSS_LYOT"/>

      <!-- Long Slit Spectroscopy -->
      <!-- Field Stab Comb's -->
      <xs:enumeration value="LSS_LR_Close"/>
      <xs:enumeration value="LSS_LR_Distant"/>
      <xs:enumeration value="LSS_MR_Close"/>
      <xs:enumeration value="LSS_MR_Distant"/>
      <!-- Direct Imaging -->
      <xs:enumeration value="DI_HOLE"/>
      <xs:enumeration value="DI_DB"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Scientific filters Comb's -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="FiltComb_Type">
    <xs:annotation>
      <xs:appinfo>Filter Combination</xs:appinfo>
      <xs:documentation xml:lang="en">
        Scientific Filter Combinations.   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="BBY_NBFeII"/>
      <xs:enumeration value="BBY_ND3"/>
      <xs:enumeration value="BBY_ND4"/>
      <xs:enumeration value="BBJ_NBFeII"/>
      <xs:enumeration value="BBJ_ND3"/>
      <xs:enumeration value="BBJ_ND4"/>
      <xs:enumeration value="BBH_NBFeII"/>
      <xs:enumeration value="BBH_ND3"/>
      <xs:enumeration value="BBH_ND4"/>
      <xs:enumeration value="NBH2_NBFeII"/>
      <xs:enumeration value="NBH2_ND3"/>
      <xs:enumeration value="NBH2_ND4"/>
      <xs:enumeration value="NBH3_NBFeII"/>
      <xs:enumeration value="NBH3_ND3"/>
      <xs:enumeration value="NBH3_ND4"/>
      <xs:enumeration value="HOLE_HOLE"/>
      <xs:enumeration value="HOLE_NBFeII"/>
      <xs:enumeration value="HOLE_NBHeI"/>
      <xs:enumeration value="HOLE_NBPaB"/>
      <xs:enumeration value="HOLE_NBContJ"/>
      <xs:enumeration value="HOLE_NBContH"/>
      <xs:enumeration value="HOLE_ND3"/>
      <xs:enumeration value="HOLE_ND4"/>
      <xs:enumeration value="ND2_HOLE"/>
      <xs:enumeration value="ND2_NBFeII"/>
      <xs:enumeration value="ND2_NBHeI"/>
      <xs:enumeration value="ND2_NBPaB"/>
      <xs:enumeration value="ND2_NBContJ"/>
      <xs:enumeration value="ND2_NBContH"/>
      <xs:enumeration value="ND2_ND3"/>
      <xs:enumeration value="ND2_ND4"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- InstrumentMode Type -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="InstrumentMode_Type">
    <xs:annotation>
      <xs:appinfo>Instrument Mode</xs:appinfo>
      <xs:documentation xml:lang="en">
        SHARK-NIR allows the Instrument modes.  
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="GEN"/>
      <xs:enumeration value="DI"/>
      <xs:enumeration value="CI"/>
      <xs:enumeration value="LSS"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- ADC Type -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="ADC_Mode_Type">
    <xs:annotation>
      <xs:appinfo>ADC Mode</xs:appinfo>
      <xs:documentation xml:lang="en">
        Atmospheric dispersion corrector mode (2 positions).  
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="OFF"/>
      <xs:enumeration value="ON"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="ADC_Offset_Type">
    <xs:annotation>
      <xs:appinfo>ADC Offset for Rotation</xs:appinfo>
      <xs:documentation xml:lang="en">
        Specify the type of rotation between the ADCs (3 options). None: nothing is done, COROT_Offset: co-rotation, COUNTER_Offset: counter rotation.   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="None"/>
      <xs:enumeration value="COROT_Offset"/>
      <xs:enumeration value="COUNTER_Offset"/>
    </xs:restriction>
  </xs:simpleType>
  
  <xs:simpleType name="ADC1_PosAng_Type">
    <xs:annotation>
      <xs:appinfo>ADC1 Position Angle</xs:appinfo>
      <xs:documentation xml:lang="en">
        ADC1 prisms position angle. Value must be float.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="min_disp"/>
      <xs:enumeration value="other"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="ADC2_PosAng_Type">
    <xs:annotation>
      <xs:appinfo>ADC2 Position Angle</xs:appinfo>
      <xs:documentation xml:lang="en">
        ADC2 prisms position angle. Value must be float.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="min_disp"/>
      <xs:enumeration value="other"/>
    </xs:restriction>
  </xs:simpleType>


  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- Derotator Type -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <xs:simpleType name="DROT_Mode_Type">
    <xs:annotation>
      <xs:appinfo>Derotator Mode</xs:appinfo>
      <xs:documentation xml:lang="en">
        Derotator mode (three positions).
        PUPIL: you can edit the position of the derotator (DROT_PosAng) and it won't move from there.
        FIELD_FREE: puts itself in the ideal position to maximize the derotation time.
        FIELD_FIXED: you can edit the position of the derotator (DROT_PosAng) from which the derotation starts.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="PUPIL"/>
      <xs:enumeration value="FIELD_FIXED"/>
      <xs:enumeration value="FIELD_FREE"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DROT_PosAng_Type">
    <xs:annotation>
      <xs:appinfo>Derotator Position Angle</xs:appinfo>
      <xs:documentation xml:lang="en">
        Derotator position angle. Value must be float. Range [0-180]
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:float">
      <!-- <xs:minInclusive value="0"/> -->
      <!-- <xs:maxExclusive value="180"/> -->
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="OBS_PosAng_Type">
    <xs:annotation>
      <xs:appinfo>Observation Position Angle</xs:appinfo>
      <xs:documentation xml:lang="en">
        Observation position angle for Field Stabilized mode. Value must be float.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:float">
      <!-- <xs:minInclusive value="0"/> -->
      <!-- <xs:maxExclusive value="180"/> -->
    </xs:restriction>
  </xs:simpleType>
  
  <!-- ~~~~~~~~~~~~~~~~ -->
  <!-- Instrument Setup -->
  <!-- ~~~~~~~~~~~~~~~~ -->

  <xs:complexType name="InstrumentSetup_Type" mixed="false">
    <xs:all>
      <xs:element name="InstrumentMode"                type="InstrumentMode_Type" minOccurs="0" maxOccurs="1"/>
      <!-- <xs:element name="CoroImaFieldStabComb"          type="CoroImaFieldStabComb_Type" minOccurs="0" maxOccurs="1"/> -->
      <!-- <xs:element name="CoroImaPupilStabComb"         type="CoroImaPupilStabComb_Type" minOccurs="0" maxOccurs="1"/> -->
      <!-- <xs:element name="LongSlitFieldStabComb"         type="LongSlitFieldStabComb_Type" minOccurs="0" maxOccurs="1"/> -->
      <xs:element name="MaskComb"                      type="MaskComb_Type" minOccurs="0" maxOccurs="1"/>
      <!-- <xs:element name="FiltComb"                      type="FiltComb_Type" minOccurs="0" maxOccurs="1"/> -->
      <!-- <xs:element name="FieldStabComb"                 type="FieldStabComb" minOccurs="0" maxOccurs="1"/> -->
      <xs:element name="STEPS"                         type="STEPS_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="AMOUNT"                        type="AMOUNT_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="SHUTTER"                       type="SHUTTER_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="INBEAM_DEP"                    type="INBEAM_DEP_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="INBEAM_TT"                     type="INBEAM_TT_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="INBEAM_TT_X"                   type="INBEAM_TT_X_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="INBEAM_TT_Y"                   type="INBEAM_TT_Y_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="APODIZER_W"                    type="APODIZER_W_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="APODIZER_W_List"               type="APODIZER_W_List_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="ND_FILT_W"                     type="ND_FILT_W_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="CORO_SLIT_W"                   type="CORO_SLIT_W_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="LYOT_GRISM_W"                  type="LYOT_GRISM_W_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="DB_FILT_W"                     type="DB_FILT_W_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="SCI_FILT_W1"                   type="SCI_FILT_W1_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="SCI_FILT_W1_List"              type="SCI_FILT_W1_List_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="SCI_FILT_W2"                   type="SCI_FILT_W2_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="SCI_FILT_W2_List"              type="SCI_FILT_W2_List_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="PUPIL_LENS_DEP"                type="PUPIL_LENS_DEP_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="CAL_FIBER_DEP"                 type="CAL_FIBER_DEP_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="CAL_FILTER_DEP"                type="CAL_FILTER_DEP_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="CAL_MIRROR_DEP"                type="CAL_MIRROR_DEP_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="CAL_FF_LAMP"                   type="CAL_FF_LAMP_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="CAL_FIBER_FOCUS_LAMP"          type="CAL_FIBER_FOCUS_LAMP_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="CAL_FIBER_DEFOCUS_LAMP"        type="CAL_FIBER_DEFOCUS_LAMP_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="LAMP_TEL_SIM"                  type="LAMP_TEL_SIM_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="ADC_Mode"                      type="ADC_Mode_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="ADC_Offset"                    type="ADC_Offset_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="ADC1_PosAng"                   type="ADC1_PosAng_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="ADC2_PosAng"                   type="ADC2_PosAng_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="DROT_Mode"                     type="DROT_Mode_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="DROT_PosAng"                   type="DROT_PosAng_Type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="OBS_PosAng"                    type="OBS_PosAng_Type" minOccurs="0" maxOccurs="1"/>
    </xs:all>
  </xs:complexType>
</xs:schema>
