<!--
Change History:

v0.2
* Demoted RepCount into PFIS Procedure.
* Added WaveLengthCount and FocusPatternCount to FocusPattern

v0.3
* Slitmask now contains phase 1 and 2 groups. The phase 1 group contains a slitmask
  type and a slit width. The phase 2 group contains a slitmask id and a slitmask file.
* WPConfig changed to PolConfig as it includes the beamsplitter configuration.
* PFIS FilterId's have been enumerated (list drawn from PFIS PIPT).
* "linear-hi" added to PolPatternName.
* EtPattern now contains phase 1 and 2 groups. The phase 1 groups contains a wavelength
  mid value and a wavelength count value. The phase 2 group contains an array of
	wavelengths.
* Standardised all elements which need to contain both a value and a unit.
* Added support for pellicle setups.
* Instead of just having Blocks and ObsConfigs, we now have Blocks which can only
  contain SubBlocks which can only contain SubSubBlocks which can only contain
	ObsConfigs. These 4 levels will always exist. Nesting is achieved not by varying
	the depth of blocks but by adjusting the 'Count' value of each level. This simplification
	was necessary for database constraints.
* Added a SequenceNumber to all of the instrument configurations.
-->
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <!-- +++++++++++ -:Proposal:- +++++++++++ -->
  <xs:element name="Proposal">
    <xs:complexType>
      <xs:annotation>
        <xs:documentation>
					The root node of a SALT proposal.
        </xs:documentation>
      </xs:annotation>
      <xs:sequence>
        <xs:element name="Title" type="xs:string">
          <xs:annotation>
            <xs:documentation>The title of the proposal.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="Abstract" type="xs:string">
          <xs:annotation>
            <xs:documentation>A text based version of the abstract.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="ScientificJustification" type="xs:base64Binary">
          <xs:annotation>
            <xs:documentation>A base 64 encoded binary of the PDF version of the scientific justification.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="Phase" default="1">
          <xs:annotation>
            <xs:documentation>
              1 = Request for time.
              2 = Detailed telescope configuration.
            </xs:documentation>
          </xs:annotation>
          <xs:simpleType>
            <xs:restriction base="xs:positiveInteger">
              <xs:maxInclusive value="2"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
        <xs:element name="Semester" default="1">
          <xs:annotation>
            <xs:documentation>
              1 = 1 March to 30 September.
              2 = 1 October to 28 February
            </xs:documentation>
          </xs:annotation>
          <xs:simpleType>
            <xs:restriction base="xs:positiveInteger">
              <xs:maxInclusive value="2"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
        <xs:element name="Year" default="2005">
          <xs:annotation>
            <xs:documentation>The year corresponding with the beginning of the chosen semester.</xs:documentation>
          </xs:annotation>
          <xs:simpleType>
            <xs:restriction base="xs:positiveInteger">
              <xs:minInclusive value="2005"/>
              <xs:maxInclusive value="2100"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
        <xs:element name="ActOnAlert" type="xs:boolean" default="false">
          <xs:annotation>
            <xs:documentation>For targets of opportunity. Act on alert authorisation.</xs:documentation>
          </xs:annotation>
        </xs:element>
				<xs:element name="TotalRequiredTime" default="1.0">
					<xs:annotation>
						<xs:documentation>The total required time for the proposal in seconds.</xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:restriction base="xs:float">
							<xs:minExclusive value="0"/>
						</xs:restriction>
					</xs:simpleType>
					<xs:attribute name="Units" type="xs:string" use="required" fixed="seconds"/>
				</xs:element>
        <xs:element name="Partner" type="Partner" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>The SALT partners associated with this proposal.</xs:documentation>
          </xs:annotation>
        </xs:element>
				<xs:element name="PrincipalInvestigator" type="xs:IDREF"/>
				<xs:element name="PrincipalContact" type="xs:IDREF"/>
        <xs:element name="Target" type="Target" maxOccurs="unbounded"/>
        <xs:element name="PFIS" type="PFIS" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="SALTICAM" type="SALTICAM" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element name="PayloadConfig" type="PayloadConfig" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="ObsConfig" type="ObsConfig" maxOccurs="unbounded"/>
        <xs:element name="Block" type="Block" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:annotation>
        <xs:documentation>
					The current version of the schema.
				</xs:documentation>
      </xs:annotation>
      <xs:attribute name="Version" type="xs:float" use="required" fixed="0.3"/>
    </xs:complexType>
  </xs:element>
  <!-- +++++++++++ -:Partner:- +++++++++++ -->
  <xs:complexType name="Partner">
    <xs:sequence>
      <xs:element name="Name" default="nrf">
        <xs:annotation>
          <xs:documentation>The name of the SALT partner.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="nrf"/>
            <xs:enumeration value="camk"/>
            <xs:enumeration value="hetb"/>
            <xs:enumeration value="rutgers"/>
            <xs:enumeration value="gu"/>
            <xs:enumeration value="uw"/>
            <xs:enumeration value="cmu"/>
            <xs:enumeration value="uc"/>
            <xs:enumeration value="uksc"/>
            <xs:enumeration value="unc_ch"/>
            <xs:enumeration value="dartmouth"/>
            <xs:enumeration value="other"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Institute" type="Institute" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>The institutes associated with this SALT partner.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TimeDistribution" default="1">
        <xs:annotation>
          <xs:documentation>The percentage of the total required time to be charged to this SALT partner.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:integer">
            <xs:minExclusive value="0"/>
						<xs:maxInclusive value="100"/>
          </xs:restriction>
        </xs:simpleType>
				<xs:attribute name="Units" type="xs:string" use="required" fixed="%"/>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <!-- +++++++++++ -:Institute:- +++++++++++ -->
  <xs:complexType name="Institute">
    <xs:sequence>
      <xs:element name="Name" type="xs:string">
        <xs:annotation>
          <xs:documentation>The name of the institute.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Address" type="xs:string" maxOccurs="10">
        <xs:annotation>
          <xs:documentation>The physical address of the institute.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="URL" type="xs:anyURI" default="http://" minOccurs="0">
        <xs:annotation>
          <xs:documentation>The website address of the institute.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Investigator" type="Investigator" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>The astronomical investigators associated with this proposal.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <!-- +++++++++++ -:Investigator:- +++++++++++ -->
  <xs:complexType name="Investigator">
    <xs:all>
      <xs:element name="Name" type="xs:string"/>
      <xs:element name="Surname" type="xs:string"/>
      <xs:element name="Email" type="xs:anyURI"/>
      <xs:element name="Phone" type="xs:string"/>
      <xs:element name="Fax" type="xs:string"/>
    </xs:all>
    <xs:attribute name="id" type="xs:ID"/>
  </xs:complexType>
  <!-- +++++++++++ -:Target:- +++++++++++ -->
  <xs:complexType name="Target">
    <xs:sequence>
      <xs:element name="Name" type="xs:string"/>
      <xs:element name="RightAscension" type="RightAscension"/>
      <xs:element name="Declination" type="Declination"/>
      <xs:element name="TargetType" type="TargetType" default="unknown"/>
      <xs:element name="VMagnitudeRange">
        <xs:complexType>
          <xs:all>
            <xs:element name="Minimum" default="0.0">
              <xs:simpleType>
                <xs:restriction base="xs:decimal">
                  <xs:minInclusive value="0.0"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
            <xs:element name="Maximum" default="0.0">
              <xs:simpleType>
                <xs:restriction base="xs:decimal">
                  <xs:minInclusive value="0.0"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
          </xs:all>
        </xs:complexType>
      </xs:element>
      <xs:element name="Equinox" type="xs:float" default="2000"/>
      <xs:element name="Ephemeris" type="Ephemeris" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="ref" type="xs:IDREF"/>
    <xs:attribute name="id" type="xs:ID"/>
  </xs:complexType>
  <!-- +++++++++++ -:TargetType:- +++++++++++ -->
  <xs:simpleType name="TargetType">
    <xs:annotation>
      <xs:documentation>
				Rough classification of a target for database query purposes (e.g. "Show me all the data from
				Seyfert galaxies in the constellation Cygnus").
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="calibration_astrometric_standard"/>
      <xs:enumeration value="calibration_dome_flat"/>
      <xs:enumeration value="calibration_guide_star"/>
      <xs:enumeration value="calibration_photometric_standard"/>
      <xs:enumeration value="calibration_polarimetric_standard"/>
      <xs:enumeration value="calibration_radial_velocity_standard"/>
      <xs:enumeration value="calibration_sky_flat"/>
      <xs:enumeration value="calibration_spectropolarimetric_standard"/>
      <xs:enumeration value="calibration_spectroscopic_standard"/>
      <xs:enumeration value="galaxy_active_galactic_nucleus"/>
      <xs:enumeration value="galaxy_black_hole"/>
      <xs:enumeration value="galaxy_blazar"/>
      <xs:enumeration value="galaxy_dwarf"/>
      <xs:enumeration value="galaxy_elliptical"/>
      <xs:enumeration value="galaxy_galaxy"/>
      <xs:enumeration value="galaxy_galaxy_cluster"/>
      <xs:enumeration value="galaxy_gravitational_lens"/>
      <xs:enumeration value="galaxy_interacting"/>
      <xs:enumeration value="galaxy_irregular"/>
      <xs:enumeration value="galaxy_seyfert"/>
      <xs:enumeration value="galaxy_spiral"/>
      <xs:enumeration value="galaxy_starburst"/>
      <xs:enumeration value="galaxy_supernova"/>
      <xs:enumeration value="galaxy_quasar"/>
      <xs:enumeration value="misc_constellation"/>
      <xs:enumeration value="misc_optical_flash"/>
      <xs:enumeration value="misc_other"/>
      <xs:enumeration value="misc_sky"/>
      <xs:enumeration value="misc_star_field"/>
      <xs:enumeration value="nebula_bipolar"/>
      <xs:enumeration value="nebula_dark_cloud"/>
      <xs:enumeration value="nebula_gaseous"/>
      <xs:enumeration value="nebula_outflow_or_jet"/>
      <xs:enumeration value="nebula_reflection"/>
      <xs:enumeration value="nebula_supernova_remnant"/>
      <xs:enumeration value="solar_system_asteroid"/>
      <xs:enumeration value="solar_system_comet"/>
      <xs:enumeration value="solar_system_earth"/>
      <xs:enumeration value="solar_system_kuiper_belt_object"/>
      <xs:enumeration value="solar_system_jupiter"/>
      <xs:enumeration value="solar_system_mars"/>
      <xs:enumeration value="solar_system_mercury"/>
      <xs:enumeration value="solar_system_moon"/>
      <xs:enumeration value="solar_system_neptune"/>
      <xs:enumeration value="solar_system_planetary_moon"/>
      <xs:enumeration value="solar_system_planetary_ring"/>
      <xs:enumeration value="solar_system_pluto"/>
      <xs:enumeration value="solar_system_saturn"/>
      <xs:enumeration value="solar_system_uranus"/>
      <xs:enumeration value="solar_system_venus"/>
      <xs:enumeration value="star_binary_or_multiple"/>
      <xs:enumeration value="star_black_hole"/>
      <xs:enumeration value="star_brown_dwarf"/>
      <xs:enumeration value="star_cataclysmic_variable"/>
      <xs:enumeration value="star_classical_nova"/>
      <xs:enumeration value="star_cepheid_variable"/>
      <xs:enumeration value="star_eclipsing_binary"/>
      <xs:enumeration value="star_gamma_ray_burst"/>
      <xs:enumeration value="star_globular_cluster"/>
      <xs:enumeration value="star_irregular_variable"/>
      <xs:enumeration value="star_microlensing_event"/>
      <xs:enumeration value="star_nearby"/>
      <xs:enumeration value="star_neutron"/>
      <xs:enumeration value="star_open_cluster"/>
      <xs:enumeration value="star_pre_main_sequence"/>
      <xs:enumeration value="star_proper_motion"/>
      <xs:enumeration value="star_protostar"/>
      <xs:enumeration value="star_pulsar"/>
      <xs:enumeration value="star_star"/>
      <xs:enumeration value="star_star_cluster"/>
      <xs:enumeration value="star_supernova"/>
      <xs:enumeration value="star_variable"/>
      <xs:enumeration value="star_white_dwarf"/>
      <xs:enumeration value="star_wolf_rayet"/>
      <xs:enumeration value="sun_chromosphere"/>
      <xs:enumeration value="sun_corona"/>
      <xs:enumeration value="sun_sun"/>
      <xs:enumeration value="sun_sunspot"/>
      <xs:enumeration value="unknown"/>
    </xs:restriction>
  </xs:simpleType>
  <!-- +++++++++++ -:RightAscension:- +++++++++++ -->
  <xs:complexType name="RightAscension">
    <xs:annotation>
      <xs:documentation>
        Equatorial Right Ascension of &lt;Target&gt;, measured in hours, minutes,
				and seconds. An optional proper motion may be included.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Hours" default="0">
        <xs:simpleType>
          <xs:restriction base="xs:nonNegativeInteger">
            <xs:maxInclusive value="23"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Minutes" default="0">
        <xs:simpleType>
          <xs:restriction base="xs:nonNegativeInteger">
            <xs:maxInclusive value="59"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Seconds" default="0.0">
        <xs:simpleType>
          <xs:restriction base="xs:decimal">
            <xs:minInclusive value="0.0"/>
            <xs:maxInclusive value="59.999"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="ProperMotion" default="0">
        <xs:simpleType>
          <xs:restriction base="xs:float">
            <xs:minInclusive value="0"/>
          </xs:restriction>
        </xs:simpleType>
				<xs:attribute name="Units" type="xs:string" use="required" fixed="arcseconds/year"/>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <!-- +++++++++++ -:Declination:- +++++++++++ -->
  <xs:complexType name="Declination">
    <xs:annotation>
      <xs:documentation>
				Container for the equatorial celestial coordinate of a Target in
				degrees, arcminutes and (decimal) arcseconds. An optional ProperMotion
				element may be provided.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Sign" default="+">
        <xs:simpleType>
	  <xs:restriction base="xs:string">
            <xs:enumeration value="+"/>
            <xs:enumeration value="-"/>
          </xs:restriction>
	</xs:simpleType>
      </xs:element>
      <xs:element name="Degrees" default="0">
        <xs:simpleType>
          <xs:restriction base="xs:nonNegativeInteger">
            <xs:minInclusive value="0"/>
            <xs:maxInclusive value="180"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Arcminutes" default="0">
        <xs:simpleType>
          <xs:restriction base="xs:nonNegativeInteger">
            <xs:minInclusive value="0"/>
            <xs:maxInclusive value="59"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Arcseconds" default="0.0">
        <xs:simpleType>
          <xs:restriction base="xs:decimal">
            <xs:minInclusive value="0.0"/>
            <xs:maxInclusive value="59.999"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="ProperMotion" default="0">
        <xs:simpleType>
          <xs:restriction base="xs:float">
            <xs:minInclusive value="0"/>
          </xs:restriction>
        </xs:simpleType>
				<xs:attribute name="Units" type="xs:string" use="required" fixed="arcseconds/year"/>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <!-- +++++++++++ -:PFIS:- +++++++++++ -->
  <xs:complexType name="PFIS">
    <xs:sequence>
			<xs:element name="SequenceNumber" type="xs:positiveInteger"/>
      <xs:element name="PfisConfig" type="PfisConfig">
        <xs:annotation>
          <xs:documentation>This describes the mechanical configuration of the intstrument</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PfisProcedure" type="PfisProcedure">
        <xs:annotation>
          <xs:documentation>This specifies the way the instrument is operated during an exposure</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PfisDetector" type="PfisDetector">
        <xs:annotation>
          <xs:documentation>This specifies the exposure for the detector controller</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <!-- +++++++++++ -:PFIS Configuration:- +++++++++++ -->
  <xs:complexType name="PfisConfig">
    <xs:annotation>
      <xs:documentation>
        A PFIS configuration.
      </xs:documentation>
    </xs:annotation>
    <xs:all>
      <xs:element name="Config" default="imaging">
        <xs:annotation>
          <xs:documentation>This specifies one of the three fundamental configurations</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="imaging"/>
            <xs:enumeration value="spectroscopy"/>
            <xs:enumeration value="fabry_perot"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
			<xs:element name="SlitMask">
			  <xs:annotation>
				  <xs:documentation>
					  Phase 1 and phase 2 slitmask info.
					</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:choice>
						<xs:group name="Phase1">
							<xs:element name="Type" default="none">
								<xs:annotation>
									<xs:documentation>
										This specifies a simple phase 1 definition of slit type.
										none - no slit mask.
										mos - multi object spectroscopy.
										longslit - longslit spectroscopy.
									</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:enumeration value="none"/>
										<xs:enumeration value="mos"/>
										<xs:enumeration value="longslit"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="SlitWidth" default="1.25">
								<xs:simpleType>
									<xs:restriction base="xs:float">
										<xs:minExclusive value="0"/>
									</xs:restriction>
								</xs:simpleType>
								<xs:attribute name="Units" type="xs:string" use="required" fixed="arcseconds"/>
							</xs:element>
						</xs:group>
						<xs:group name="Phase2">
							<xs:element name="Id" type="xs:string" default="none">
								<xs:annotation>
									<xs:documentation>
										This is the bar code of the desired slit mask.
									</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="File" type="xs:base64Binary">
							<xs:annotation>
								<xs:documentation>
									A base 64 encoded binary of the slitmask file generated by the
									PFIS slitmask tool.
								</xs:documentation>
							</xs:annotation>
						</xs:element>
						</xs:group>
					</xs:choice>
				</xs:complexType>
			</xs:element>
      <xs:element name="PolConfig" default="open">
        <xs:annotation>
          <xs:documentation>
            This specifies which of the polarimetric optics are in the beam.
            open - no polarimetry.
            linear - just the half wave plate.
            linear_parallel - half wave plate with the beam splitter rotated by 90°.
            stokes - half wave and quarter wave plates.
            stokes_parallel - half wave and quarter wave plates with the beam splitter rotated by 90°.
          </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="open"/>
            <xs:enumeration value="linear"/>
            <xs:enumeration value="linear_parallel"/>
            <xs:enumeration value="stokes"/>
            <xs:enumeration value="stokes_parallel"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="FocusPosition" type="xs:float" default="0">
        <xs:annotation>
          <xs:documentation>
						The focus position in microns. This is referred to the home indicator
						of the focus actuator in the camera.
					</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="EtConfig" default="tf">
        <xs:annotation>
          <xs:documentation>There are four ways to insert the two etalons</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="tf"/>
            <xs:enumeration value="lr"/>
            <xs:enumeration value="mr"/>
            <xs:enumeration value="hr"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Grating" default="open">
        <xs:annotation>
          <xs:documentation>The bar code of the desired grating.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="open"/>
            <xs:enumeration value="pg0300"/>
            <xs:enumeration value="pg0900"/>
            <xs:enumeration value="pg1300"/>
            <xs:enumeration value="pg1800"/>
            <xs:enumeration value="pg2300"/>
            <xs:enumeration value="pg3000"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="GratingAngle" type="xs:float" default="0">
        <xs:annotation>
          <xs:documentation>
            The grating can be rotated to any angle between 0 and 100 degrees.
						The angular choice is quantized only by the resolution of the stepper motor.
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="FilterId" default="pc00000">
        <xs:annotation>
          <xs:documentation>
						The bar code of the desired filter. Defaults to the clear filter.
					</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
					  <xs:annotation>
						  <xs:documentation>The clear filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pc00000"/>
					  <xs:annotation>
						  <xs:documentation>The schott WG-320 filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pc03200"/>
					  <xs:annotation>
						  <xs:documentation>The hoya UV-34 filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pc03400"/>
					  <xs:annotation>
						  <xs:documentation>The schott GG-385 filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pc03850"/>
					  <xs:annotation>
						  <xs:documentation>The hoya Y-46 filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pc04600"/>
					  <xs:annotation>
						  <xs:documentation>The 4349 (79) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi04349"/>
					  <xs:annotation>
						  <xs:documentation>The 4412 (92) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi04412"/>
					  <xs:annotation>
						  <xs:documentation>The 4478 (85) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi04478"/>
					  <xs:annotation>
						  <xs:documentation>The 4530 (90) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi04530"/>
					  <xs:annotation>
						  <xs:documentation>The 4600 (95) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi04600"/>
					  <xs:annotation>
						  <xs:documentation>The 4670 (100) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi04670"/>
					  <xs:annotation>
						  <xs:documentation>The 4760 (111) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi04760"/>
					  <xs:annotation>
						  <xs:documentation>The 4820 (105) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi04820"/>
					  <xs:annotation>
						  <xs:documentation>The 4912 (105) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi04912"/>
					  <xs:annotation>
						  <xs:documentation>The 4991 (108) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi04991"/>
					  <xs:annotation>
						  <xs:documentation>The 5072 (110) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi05072"/>
					  <xs:annotation>
						  <xs:documentation>The 5152 (109) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi05152"/>
					  <xs:annotation>
						  <xs:documentation>The 5237 (119) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi05237"/>
					  <xs:annotation>
						  <xs:documentation>The 5325 (125) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi05325"/>
					  <xs:annotation>
						  <xs:documentation>The 5420 (130) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi05420"/>
					  <xs:annotation>
						  <xs:documentation>The 5520 (135) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi05520"/>
					  <xs:annotation>
						  <xs:documentation>The 5632 (137) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi05632"/>
					  <xs:annotation>
						  <xs:documentation>The 5731 (134) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi05731"/>
					  <xs:annotation>
						  <xs:documentation>The 5834 (143) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi05834"/>
					  <xs:annotation>
						  <xs:documentation>The 5946 (164) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi05946"/>
					  <xs:annotation>
						  <xs:documentation>The 6062 (149) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi06062"/>
					  <xs:annotation>
						  <xs:documentation>The 6179 (169) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi06179"/>
					  <xs:annotation>
						  <xs:documentation>The 6300 (158) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi06300"/>
					  <xs:annotation>
						  <xs:documentation>The 6418 (162) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi06418"/>
					  <xs:annotation>
						  <xs:documentation>The 6536 (156) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi06536"/>
					  <xs:annotation>
						  <xs:documentation>The 6647 (149) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi06647"/>
					  <xs:annotation>
						  <xs:documentation>The 6765 (168) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi06765"/>
					  <xs:annotation>
						  <xs:documentation>The 6894 (182) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi06894"/>
					  <xs:annotation>
						  <xs:documentation>The 7021 (162) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi07021"/>
					  <xs:annotation>
						  <xs:documentation>The 7131 (140) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi07131"/>
					  <xs:annotation>
						  <xs:documentation>The 7253 (184) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi07253"/>
					  <xs:annotation>
						  <xs:documentation>The 7400 (218) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi07400"/>
					  <xs:annotation>
						  <xs:documentation>The 7556 (201) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi07556"/>
					  <xs:annotation>
						  <xs:documentation>The 7692 (169) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi07692"/>
					  <xs:annotation>
						  <xs:documentation>The 7832 (208) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi07832"/>
					  <xs:annotation>
						  <xs:documentation>The 7999 (249) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi07999"/>
					  <xs:annotation>
						  <xs:documentation>The 8175 (225) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi08175"/>
					  <xs:annotation>
						  <xs:documentation>The 8350 (245) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi08350"/>
					  <xs:annotation>
						  <xs:documentation>The 8535 (260) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi08535"/>
					  <xs:annotation>
						  <xs:documentation>The 8730 (275) filter</xs:documentation>
						</xs:annotation>
            <xs:enumeration value="pi08730"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="ArtStation">
        <xs:annotation>
          <xs:documentation>
            There are 132 detented locations. The enumerated values consists of two integers.
            The first integer represents the station number.
						The second gives the camera angle in hundredths of a degree.
          </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="_0_0"/>
            <xs:enumeration value="_1_175"/>
            <xs:enumeration value="_2_250"/>
            <xs:enumeration value="_3_325"/>
            <xs:enumeration value="_4_400"/>
            <xs:enumeration value="_5_475"/>
            <xs:enumeration value="_6_550"/>
            <xs:enumeration value="_7_625"/>
            <xs:enumeration value="_8_700"/>
            <xs:enumeration value="_9_775"/>
            <xs:enumeration value="_10_850"/>
            <xs:enumeration value="_11_925"/>
            <xs:enumeration value="_12_1000"/>
            <xs:enumeration value="_13_1075"/>
            <xs:enumeration value="_14_1150"/>
            <xs:enumeration value="_15_1225"/>
            <xs:enumeration value="_16_1300"/>
            <xs:enumeration value="_17_1375"/>
            <xs:enumeration value="_18_1450"/>
            <xs:enumeration value="_19_1525"/>
            <xs:enumeration value="_20_1600"/>
            <xs:enumeration value="_21_1675"/>
            <xs:enumeration value="_22_1750"/>
            <xs:enumeration value="_23_1825"/>
            <xs:enumeration value="_24_1900"/>
            <xs:enumeration value="_25_1975"/>
            <xs:enumeration value="_26_2050"/>
            <xs:enumeration value="_27_2125"/>
            <xs:enumeration value="_28_2200"/>
            <xs:enumeration value="_29_2275"/>
            <xs:enumeration value="_30_2350"/>
            <xs:enumeration value="_31_2425"/>
            <xs:enumeration value="_32_2500"/>
            <xs:enumeration value="_33_2575"/>
            <xs:enumeration value="_34_2650"/>
            <xs:enumeration value="_35_2725"/>
            <xs:enumeration value="_36_2800"/>
            <xs:enumeration value="_37_2875"/>
            <xs:enumeration value="_38_2950"/>
            <xs:enumeration value="_39_3025"/>
            <xs:enumeration value="_40_3100"/>
            <xs:enumeration value="_41_3175"/>
            <xs:enumeration value="_42_3250"/>
            <xs:enumeration value="_43_3325"/>
            <xs:enumeration value="_44_3400"/>
            <xs:enumeration value="_45_3475"/>
            <xs:enumeration value="_46_3550"/>
            <xs:enumeration value="_47_3625"/>
            <xs:enumeration value="_48_3700"/>
            <xs:enumeration value="_49_3775"/>
            <xs:enumeration value="_50_3850"/>
            <xs:enumeration value="_51_3925"/>
            <xs:enumeration value="_52_4000"/>
            <xs:enumeration value="_53_4075"/>
            <xs:enumeration value="_54_4150"/>
            <xs:enumeration value="_55_4225"/>
            <xs:enumeration value="_56_4300"/>
            <xs:enumeration value="_57_4375"/>
            <xs:enumeration value="_58_4450"/>
            <xs:enumeration value="_59_4525"/>
            <xs:enumeration value="_60_4600"/>
            <xs:enumeration value="_61_4675"/>
            <xs:enumeration value="_62_4750"/>
            <xs:enumeration value="_63_4825"/>
            <xs:enumeration value="_64_4900"/>
            <xs:enumeration value="_65_4975"/>
            <xs:enumeration value="_66_5050"/>
            <xs:enumeration value="_67_5125"/>
            <xs:enumeration value="_68_5200"/>
            <xs:enumeration value="_69_5275"/>
            <xs:enumeration value="_70_5350"/>
            <xs:enumeration value="_71_5425"/>
            <xs:enumeration value="_72_5500"/>
            <xs:enumeration value="_73_5575"/>
            <xs:enumeration value="_74_5650"/>
            <xs:enumeration value="_75_5725"/>
            <xs:enumeration value="_76_5800"/>
            <xs:enumeration value="_77_5875"/>
            <xs:enumeration value="_78_5950"/>
            <xs:enumeration value="_79_6025"/>
            <xs:enumeration value="_80_6100"/>
            <xs:enumeration value="_81_6175"/>
            <xs:enumeration value="_82_6250"/>
            <xs:enumeration value="_83_6325"/>
            <xs:enumeration value="_84_6400"/>
            <xs:enumeration value="_85_6475"/>
            <xs:enumeration value="_86_6550"/>
            <xs:enumeration value="_87_6625"/>
            <xs:enumeration value="_88_6700"/>
            <xs:enumeration value="_89_6775"/>
            <xs:enumeration value="_90_6850"/>
            <xs:enumeration value="_91_6925"/>
            <xs:enumeration value="_92_7000"/>
            <xs:enumeration value="_93_7075"/>
            <xs:enumeration value="_94_7150"/>
            <xs:enumeration value="_95_7225"/>
            <xs:enumeration value="_96_7300"/>
            <xs:enumeration value="_97_7375"/>
            <xs:enumeration value="_98_7450"/>
            <xs:enumeration value="_99_7525"/>
            <xs:enumeration value="_100_7600"/>
            <xs:enumeration value="_101_7675"/>
            <xs:enumeration value="_102_7750"/>
            <xs:enumeration value="_103_7825"/>
            <xs:enumeration value="_104_7900"/>
            <xs:enumeration value="_105_7975"/>
            <xs:enumeration value="_106_8050"/>
            <xs:enumeration value="_107_8125"/>
            <xs:enumeration value="_108_8200"/>
            <xs:enumeration value="_109_8275"/>
            <xs:enumeration value="_110_8350"/>
            <xs:enumeration value="_111_8425"/>
            <xs:enumeration value="_112_8500"/>
            <xs:enumeration value="_113_8575"/>
            <xs:enumeration value="_114_8650"/>
            <xs:enumeration value="_115_8725"/>
            <xs:enumeration value="_116_8800"/>
            <xs:enumeration value="_117_8875"/>
            <xs:enumeration value="_118_8950"/>
            <xs:enumeration value="_119_9025"/>
            <xs:enumeration value="_120_9100"/>
            <xs:enumeration value="_121_9175"/>
            <xs:enumeration value="_122_9250"/>
            <xs:enumeration value="_123_9325"/>
            <xs:enumeration value="_124_9400"/>
            <xs:enumeration value="_125_9475"/>
            <xs:enumeration value="_126_9550"/>
            <xs:enumeration value="_127_9625"/>
            <xs:enumeration value="_128_9700"/>
            <xs:enumeration value="_129_9775"/>
            <xs:enumeration value="_130_9850"/>
            <xs:enumeration value="_131_9925"/>
            <xs:enumeration value="_132_10000"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
    </xs:all>
  </xs:complexType>
  <!-- +++++++++++ -:PFIS Procedure:- +++++++++++ -->
  <xs:complexType name="PfisProcedure">
    <xs:annotation>
      <xs:documentation>
        A PFIS procedure.
      </xs:documentation>
    </xs:annotation>
    <xs:all>
      <xs:element name="Procedure" default="normal">
        <xs:annotation>
          <xs:documentation>
            The procedure executes an observation by operating the appropriate mechanisms during the exposure.
            normal - single exposure with no moving parts.
            polarimetry - multiple exposures using wave plate patterns.
            fabry_perot - multiple exposures using the etalon pattern.
            fp_polarimetry - multiple exposures using both the wave plate patterns and the etalon pattern.
            focus - multiple exposures using the focus pattern.
          </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="normal"/>
            <xs:enumeration value="polarimetry"/>
            <xs:enumeration value="fabry_perot"/>
            <xs:enumeration value="fp_polarimetry"/>
            <xs:enumeration value="focus"/>
          </xs:restriction>
        </xs:simpleType>
	      <xs:attribute name="RepCount" type="xs:positiveInteger" default="1"/>
      </xs:element>
      <xs:element name="PolPatternName">
        <xs:annotation>
          <xs:documentation>
            There are three standard polarimetry patterns selected by name only.
			      Custom patterns are allowed which will require the patterns to be provided.
					</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="linear"/>
            <xs:enumeration value="linear_hi"/>
            <xs:enumeration value="circular"/>
            <xs:enumeration value="all_stokes"/>
            <xs:enumeration value="custom"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="HWavePattern">
        <xs:annotation>
          <xs:documentation>
						The half wave-plate sequence of positions when using
						a custom polarimetry pattern
					</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Station" type="PfisWaveStation" maxOccurs="8"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="QWavePattern">
        <xs:annotation>
          <xs:documentation>
						The quarter wave-plate sequence of positions when using
						a custom polarimetry pattern
					</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Station" type="PfisWaveStation" maxOccurs="8"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="EtPattern">
        <xs:annotation>
          <xs:documentation>
					  This custom polarimetry pattern scans through wavelengths.
					</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:choice>
						<xs:group name="Phase1">
							<xs:element name="WavelengthMid" default="5000">
								<xs:annotation>
									<xs:documentation>
										This is the wavelength in Angstroms at centre of the scan.
									</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:float">
										<xs:minInclusive value="4300"/>
										<xs:maxInclusive value="9000"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="WavelengthCount" default="1">
								<xs:annotation>
									<xs:documentation>
										This is the number of Wavelength counts. It gives an indication
										of the number of readouts required and subsequently the attainable
										signal to noise ratio for each count.
									</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:positiveInteger">
										<xs:maxInclusive value="100"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
						</xs:group>
						<xs:group name="Phase2">
						  <xs:element name="Wavelength" maxOccurs="100">
							  <xs:annotation>
								  <xs:documentation>
									  A list of wavelengths
									</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
								  <xs:restriction base="xs:float">
									  <xs:minInclusive value="3200"/>
										<xs:maxInclusive value="9000"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
						</xs:group>
          </xs:choice>
        </xs:complexType>
      </xs:element>
      <xs:element name="FocusPattern">
        <xs:annotation>
          <xs:documentation>This steps through spectrograph focus positions.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="FocusStart" default="0">
              <xs:annotation>
                <xs:documentation>PFIS focus position at which to start a series of focus exposures.</xs:documentation>
              </xs:annotation>
              <xs:simpleType>
                <xs:restriction base="xs:float">
                  <xs:minInclusive value="-5000"/>
                  <xs:maxInclusive value="5000"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
            <xs:element name="FocusStep" default="100">
              <xs:annotation>
                <xs:documentation>The focus increment between focus exposures.</xs:documentation>
              </xs:annotation>
              <xs:simpleType>
                <xs:restriction base="xs:float">
                  <xs:minInclusive value="-1000"/>
                  <xs:maxInclusive value="1000"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
            <xs:element name="FocusCount" default="1">
              <xs:annotation>
                <xs:documentation>
									This is the number of FocusSteps to take starting from FocusStart.
									The most counts you could have is with a WaveLengthStart of -5000 and a
									FocusStep of 1. That (10000 + 1).
								</xs:documentation>
              </xs:annotation>
              <xs:simpleType>
                <xs:restriction base="xs:positiveInteger">
                  <xs:maxInclusive value="10001"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:all>
  </xs:complexType>
  <!-- +++++++++++ -:PFIS Detector Setup:- +++++++++++ -->
  <xs:complexType name="PfisDetector">
    <xs:annotation>
      <xs:documentation>
        A PFIS Detector setup.
      </xs:documentation>
    </xs:annotation>
    <xs:all>
      <xs:element name="DetMode" default="normal">
        <xs:annotation>
          <xs:documentation>Describes the readout modes</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="normal"/>
            <xs:enumeration value="frame_transfer"/>
            <xs:enumeration value="shuffle"/>
            <xs:enumeration value="video"/>
            <xs:enumeration value="drift_scan"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Calculation" default="none">
        <xs:annotation>
          <xs:documentation>
            PDET can do various calculations on an image
            none - no calculation.
            aperture - compute the location of backlit slitmask apertures.
            star - compute the location of stars.
            peakup - centre stars onto slitmask apertures.
          </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="none"/>
            <xs:enumeration value="aperture"/>
            <xs:enumeration value="star"/>
            <xs:enumeration value="peakup"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="FrameCount" type="xs:positiveInteger" default="1">
        <xs:annotation>
          <xs:documentation>PDET will make this many exposures each time it gets the start command.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="FrameSize" default="256">
        <xs:annotation>
          <xs:documentation>In frame transfer mode this many CCD rows are shifted.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:positiveInteger">
            <xs:maxInclusive value="4096"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="PreShuffle" default="0">
        <xs:annotation>
          <xs:documentation>Shuffles this many CCD rows before an exposure</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:nonNegativeInteger">
            <xs:maxInclusive value="4096"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="PostShuffle" default="0">
        <xs:annotation>
          <xs:documentation>Shuffles this many CCD rows after an exposure</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:nonNegativeInteger">
            <xs:maxInclusive value="4096"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="PreBinRows" default="1">
        <xs:annotation>
          <xs:documentation>Combine this many CCD rows during readout</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:positiveInteger">
            <xs:maxInclusive value="9"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="PreBinCols" default="1">
        <xs:annotation>
          <xs:documentation>Combine this many CCD columns during readout</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:positiveInteger">
            <xs:maxInclusive value="9"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Prepare" type="xs:boolean" default="false">
        <xs:annotation>
          <xs:documentation>This is a place holder - ask Luis for description</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ShutterCommand" default="open">
        <xs:annotation>
          <xs:documentation>
            Tells PDET how to operate the shutter.
            closed - keep the shutter closed during the exposure.
            open - open the shutter before the exposure and then close it after.
            stay_open - open the shutter before the exposure and keep it open after.
          </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="closed"/>
            <xs:enumeration value="open"/>
            <xs:enumeration value="stay_open"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Bias" default="off">
        <xs:annotation>
          <xs:documentation>
            A bias exposure keeps the shutter closed and ignores the exposure time.
            off - no bias, a normal exposure.
            on - do a bias exposure.
            calibrate - ask Luis.
          </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="off"/>
            <xs:enumeration value="on"/>
            <xs:enumeration value="calibrate"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="ExposureTime" default="10">
        <xs:annotation>
          <xs:documentation>Exposure time in seconds</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:float">
            <xs:minExclusive value="0"/>
          </xs:restriction>
        </xs:simpleType>
				<xs:attribute name="Units" type="xs:string" use="required" fixed="seconds"/>
      </xs:element>
      <xs:element name="Gain" default="faint">
        <xs:annotation>
          <xs:documentation>
            This sets the amplifier gain for the CCD readout amplifiers.
            faint - high gain for faint objects.
            bright - low gain for bright objects.
          </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="faint"/>
            <xs:enumeration value="bright"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="ReadoutSpeed" default="slow">
        <xs:annotation>
          <xs:documentation>
            Sets the readout speed. Faster readouts have more noise.
            none - don't do a readout.
            slow - do a low noise, slow readout.
            fast - do a higher noise, faster readout.
          </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="none"/>
            <xs:enumeration value="slow"/>
            <xs:enumeration value="fast"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
    </xs:all>
  </xs:complexType>
  <!-- +++++++++++ -:PFIS Wave Station:- +++++++++++ -->
  <xs:simpleType name="PfisWaveStation">
    <xs:annotation>
      <xs:documentation>
        Each wave plate has 32 detented positions. A wave plate pattern consists of
        one to eight positions in a particular sequence.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="_0_0"/>
      <xs:enumeration value="_1_1125"/>
      <xs:enumeration value="_2_2250"/>
      <xs:enumeration value="_3_3375"/>
      <xs:enumeration value="_4_4500"/>
      <xs:enumeration value="_5_5625"/>
      <xs:enumeration value="_6_6750"/>
      <xs:enumeration value="_7_7875"/>
      <xs:enumeration value="_8_9000"/>
      <xs:enumeration value="_9_10125"/>
      <xs:enumeration value="_10_11250"/>
      <xs:enumeration value="_11_12375"/>
      <xs:enumeration value="_12_13500"/>
      <xs:enumeration value="_13_14625"/>
      <xs:enumeration value="_14_15750"/>
      <xs:enumeration value="_15_16875"/>
      <xs:enumeration value="_16_18000"/>
      <xs:enumeration value="_17_19125"/>
      <xs:enumeration value="_18_20250"/>
      <xs:enumeration value="_19_21375"/>
      <xs:enumeration value="_20_22500"/>
      <xs:enumeration value="_21_23625"/>
      <xs:enumeration value="_22_24750"/>
      <xs:enumeration value="_23_25875"/>
      <xs:enumeration value="_24_27000"/>
      <xs:enumeration value="_25_28125"/>
      <xs:enumeration value="_26_29250"/>
      <xs:enumeration value="_27_30375"/>
      <xs:enumeration value="_28_31500"/>
      <xs:enumeration value="_29_32625"/>
      <xs:enumeration value="_30_33750"/>
      <xs:enumeration value="_31_34875"/>
    </xs:restriction>
  </xs:simpleType>
  <!-- +++++++++++ -:SALTICAM:- +++++++++++ -->
  <xs:complexType name="SALTICAM">
		<xs:annotation>
			<xs:documentation>
				A phase 1 SALTICAM instrument configuration
			</xs:documentation>
		</xs:annotation>
    <xs:sequence>
      <xs:element name="Name" type="xs:string"/>
			<xs:element name="SequenceNumber" type="xs:positiveInteger"/>
      <xs:element name="Filter" default="clear">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="clear"/>
            <xs:enumeration value="own"/>
            <xs:enumeration value="U"/>
            <xs:enumeration value="B"/>
            <xs:enumeration value="V"/>
            <xs:enumeration value="R"/>
            <xs:enumeration value="I"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="PreBinning">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Rows" default="1">
              <xs:simpleType>
                <xs:restriction base="xs:positiveInteger">
                  <xs:minInclusive value="1"/>
                  <xs:maxInclusive value="9"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
            <xs:element name="Columns" default="1">
              <xs:simpleType>
                <xs:restriction base="xs:positiveInteger">
                  <xs:minInclusive value="1"/>
                  <xs:maxInclusive value="9"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="ExposureTime" default="10">
        <xs:annotation>
          <xs:documentation>Exposure time in seconds</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:float">
            <xs:minExclusive value="0"/>
          </xs:restriction>
        </xs:simpleType>
				<xs:attribute name="Units" type="xs:string" use="required" fixed="seconds"/>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="ref" type="xs:IDREF"/>
    <xs:attribute name="id" type="xs:ID"/>
  </xs:complexType>
  <!-- +++++++++++ -:HRS:- +++++++++++ -->
  <xs:complexType name="HRS">
		<xs:annotation>
			<xs:documentation>
				An HRS instrument configuration.
			</xs:documentation>
		</xs:annotation>
    <xs:sequence>
      <xs:element name="Name" type="xs:string"/>
			<xs:element name="SequenceNumber" type="xs:positiveInteger"/>
		</xs:sequence>
	</xs:complexType>
  <!-- +++++++++++ -:PayloadConfig:- +++++++++++ -->
  <xs:complexType name="PayloadConfig">
		<xs:annotation>
			<xs:documentation>
				A payload configuration is mainly used to cope with the situation where a pellicle
				setup is being used. It is a rather simple matter to cope with a single
				instrument being used at a time. The complexity comes in when two instruments
				are used concurrently. With the pellicle setup the primary instrument is
				always SALTICAM. The fold mirrors allow one other payload port to be used.
				So we can use SALTICAM and PFIS or SALTICAM and HRS or SALTICAM and the 
				auxilliary port.
			</xs:documentation>
		</xs:annotation>
    <xs:sequence>
      <xs:element name="Name" type="xs:string"/>
      <xs:element name="Comments" type="xs:string" minOccurs="0"/>
			<xs:choice>
				<xs:group ref="SalticamConfigs"/>
				<xs:group ref="PfisConfigs"/>
				<xs:group ref="HrsConfigs"/>
				<xs:group name="PellicleConfig">
				  <xs:annotation>
					  <xs:documentation>
							This is a convenience boolean for inserting into the database.
							It normally defaults to false in the database. In this case it is true.
						</xs:documentation>
					</xs:annotation>
				  <xs:element name="PellicleSetup" type="xs:boolean" use="required" fixed="true"/>
				  <xs:group ref="SalticamConfigs"/>
					<xs:choice>
					  <xs:group ref="PfisConfigs"/>
						<xs:group ref="HrsConfigs"/>
					</xs:choice>
				</xs:group>
			</xs:choice>
    </xs:sequence>
    <xs:attribute name="ref" type="xs:IDREF"/>
    <xs:attribute name="id" type="xs:ID"/>
  </xs:complexType>
	<!-- +++++++++++ -:SalticamConfigs:- +++++++++++ -->
	<xs:group name="SalticamConfigs">
		<xs:annotation>
			<xs:documentation>
				An array of SALTICAM configurations to be used in the sequence as listed.
			</xs:documentation>
		</xs:annotation>
		<xs:element name="SALTICAM" type="SALTICAM" maxOccurs="unbounded"/>
	</xs:group>
	<!-- +++++++++++ -:PfisConfigs:- +++++++++++ -->
	<xs:group name="PfisConfigs">
		<xs:annotation>
			<xs:documentation>
				An array of PFIS configurations to be used in the sequence as listed.
			</xs:documentation>
		</xs:annotation>
		<xs:element name="PFIS" type="PFIS" maxOccurs="unbounded"/>
	</xs:group>
	<!-- +++++++++++ -:HrsConfigs:- +++++++++++ -->
	<xs:group name="HrsConfigs">
		<xs:annotation>
			<xs:documentation>
				An array of HRS configurations to be used in the sequence as listed.
			</xs:documentation>
		</xs:annotation>
		<xs:element name="HRS" type="HRS" maxOccurs="unbounded"/>
	</xs:group>
  <!-- +++++++++++ -:ObsConfig:- +++++++++++ -->
  <xs:complexType name="ObsConfig">
		<xs:annotation>
			<xs:documentation>
				The main purpose of the ObsConfig is to unite a source of light with a
				payload configuration. The light source may for example be a target or a
				calibration lamp.
			</xs:documentation>
		</xs:annotation>
    <xs:sequence>
      <xs:element name="Name" type="xs:string"/>
			<xs:element name="Comments" type="xs:string" minOccurs="0"/>
      <xs:element name="Counts" type="xs:positiveInteger" default="1"/>
      <xs:element name="Transparency" default="non_photometric">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="photometric"/>
            <xs:enumeration value="non_photometric"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="SeeingConstraint" type="SeeingConstraint"/>
      <xs:element name="PhaseConstraint" type="PhaseConstraint" minOccurs="0"/>
      <xs:element name="ExposureTime" default="10">
        <xs:annotation>
          <xs:documentation>Exposure time in seconds</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:float">
            <xs:minExclusive value="0"/>
          </xs:restriction>
        </xs:simpleType>
				<xs:attribute name="Units" type="xs:string" use="required" fixed="seconds"/>
      </xs:element>
      <xs:element name="TimeRestriction" type="xs:dateTime" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Target" type="xs:IDREF"/>
			<xs:element name="PaylaodConfig" type="PayloadConfig"/>
    </xs:sequence>
    <xs:attribute name="ref" type="xs:IDREF"/>
    <xs:attribute name="id" type="xs:ID"/>
  </xs:complexType>
  <!-- +++++++++++ -:PhaseConstraint:- +++++++++++ -->
  <xs:complexType name="PhaseConstraint">
    <xs:annotation>
      <xs:documentation>
				A phase constraint cannot be defined without first defining an
				Ephemeris in the referenced Target.
      </xs:documentation>
    </xs:annotation>
    <xs:all>
      <xs:element name="PhaseStart" default="0.0">
        <xs:simpleType>
          <xs:restriction base="xs:float">
            <xs:minInclusive value="0.0"/>
            <xs:maxInclusive value="1.0"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="PhaseEnd" default="1.0">
        <xs:simpleType>
          <xs:restriction base="xs:float">
            <xs:minInclusive value="0.0"/>
            <xs:maxInclusive value="1.0"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
    </xs:all>
  </xs:complexType>
  <!-- +++++++++++ -:SeeingConstraint:- +++++++++++ -->
  <xs:complexType name="SeeingConstraint">
    <xs:annotation>
      <xs:documentation>
        Describes what seeing conditions are acceptable (in arcsecs).
      </xs:documentation>
    </xs:annotation>
    <xs:all>
      <xs:element name="Comments" minOccurs="0"/>
      <xs:element name="Maximum" default="1.0">
        <xs:simpleType>
          <xs:restriction base="xs:float">
            <xs:minExclusive value="0"/>
          </xs:restriction>
        </xs:simpleType>
				<xs:attribute name="Units" type="xs:string" use="required" fixed="arcseconds"/>
      </xs:element>
      <xs:element name="Minimum" default="1.0">
        <xs:simpleType>
          <xs:restriction base="xs:float">
            <xs:minExclusive value="0"/>
          </xs:restriction>
        </xs:simpleType>
				<xs:attribute name="Units" type="xs:string" use="required" fixed="arcseconds"/>
      </xs:element>
    </xs:all>
  </xs:complexType>
  <!-- +++++++++++ -:Ephemeris:- +++++++++++ -->
  <xs:complexType name="Ephemeris">
    <xs:all>
      <xs:element name="TimeZero" default="1.0">
        <xs:simpleType>
          <xs:restriction base="xs:double">
            <xs:minExclusive value="0"/>
          </xs:restriction>
        </xs:simpleType>
				<xs:attribute name="Units" type="xs:string" use="required" fixed="HJD"/>
      </xs:element>
      <xs:element name="Period" default="1.0">
        <xs:simpleType>
          <xs:restriction base="xs:double">
            <xs:minExclusive value="0"/>
          </xs:restriction>
        </xs:simpleType>
				<xs:attribute name="Units" type="xs:string" use="required" fixed="days"/>
      </xs:element>
      <xs:element name="Pdot" default="1.0" minOccurs="0">
        <xs:simpleType>
          <xs:restriction base="xs:double">
            <xs:minExclusive value="0"/>
          </xs:restriction>
        </xs:simpleType>
				<xs:attribute name="Units" type="xs:string" use="required" fixed="days/day"/>
      </xs:element>
    </xs:all>
  </xs:complexType>
  <!-- +++++++++++ -:Block:- +++++++++++ -->
  <xs:complexType name="Block">
		<xs:sequence>
			<xs:element name="Name" type="xs:string"/>
      <xs:element name="Comments" type="xs:string" minOccurs="0"/>
			<xs:element name="Visits" type="xs:positiveInteger" default="1"/>
      <xs:element name="Wait" default="0">
        <xs:annotation>
          <xs:documentation>The number of days to wait between each visit to this block.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:float">
            <xs:minInclusive value="0"/>
          </xs:restriction>
        </xs:simpleType>
				<xs:attribute name="Units" type="xs:string" use="required" fixed="days"/>
      </xs:element>
			<xs:element name="SubBlock" type="SubBlock" maxOccurs="unbounded"/>
		</xs:sequence>
  </xs:complexType>
  <!-- +++++++++++ -:SubBlock:- +++++++++++ -->
  <xs:complexType name="SubBlock">
    <xs:sequence>
      <xs:element name="Counts" type="xs:positiveInteger" default="1"/>
			<xs:element name="SubSubBlock" type="SubSubBlock" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  <!-- +++++++++++ -:SubSubBlock:- +++++++++++ -->
  <xs:complexType name="SubSubBlock">
    <xs:sequence>
      <xs:element name="Counts" type="xs:positiveInteger" default="1"/>
			<xs:element name="ObsConfig" type="ObsConfig" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>
