<?xml version="1.0" encoding="UTF-8"?>

<!-- <!DOCTYPE sddlschema SYSTEM "sddlschema.xsd">-->

<sddl>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- -->
<!--  SDDL Name:  APERTURE_DEF.SDDL -->
<!-- -->
<!--  Purpose:      This SDDL file defines the aperture_def relation.-->
<!-- -->
<!--  Modification History:-->
<!-- -->
<!--    Date       PR     Who                      Reason-->
<!--  - - - -    - - - -  - -   - - - - - - - - - - - - - - - - - - - - - -->
<!--  01/20/99   34586    MSwam created from a subset of SPSS qaapertures table-->
<lm>  07/03/03   48821    CTB   Converted to XML format </lm><!-- last mod -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


    <record name="APERTURE_DEF">
        <description>This relation defines the size, shape, and location
                       of the science instrument apertures.  Three fundamental
                       cartesian coordinate systems are used.  The first of 
                       these systems is the V1-V2-V3 system.  It is the three 
                       dimensional 'vehicle' coordinate system.  The V2-V3 
                       plane defines the 'aperture' plane.  The other two 
                       fundamental coordinate systems are defined in the 
                       aperture plane relative to the V1,V2,V3 frame. 
                       
                       The Science Instrument Coordinate System (SICS) is 
                       actually a set of coordinate systems; one or more for
                       each science instrument.  Coordinates are expressed
                       in arcseconds.  Generally there is one SICS defined
                       for each aperture.

                       The Science Aperture Coordinate System (SIAS) is 
                       similar to the SICS except the coordinates are 
                       expressed in units appropriate for the instrument 
                       (i.e. pixels).  SIAS is not used in SPSS.  

                       This relation does NOT defines the 
                       conversion factors needed to transform coordinates 
                       expressed in one coordinate system to another.   See 
                       the SPSS Algorithms document (SE-06-02 Appendix B) for
                       a complete discussion of these transformations and
			see relation sics_sias_coef for the conversion
			coefficients.</description>

        <field name="coord_id">
            <type>C10</type>
            <description>This is the aperture coordinate system ID.  It is the
                 name of the aperture coordinate system used to specify
                 the location of the target within the aperture.</description>
        </field>

        <field name="valid_date">
            <type>C17</type>
            <description>effective date (YYYY.DDD:HH:MM:SS) before which the 
                 data for this aperture must not be used</description>
            </field>

        <field name="center_v2">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field specifies the V2 coordinate of the center
                         of the aperture.  This defines the SICS X direction
                         center (Xo).</description>
        </field>

        <field name="center_v3">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field specifies the V3 coordinate of the center
                 of the aperture.  This defines the SICS Y direction
                 center (Yo).</description>
        </field>

        <field name="aper_shape">
            <type>C1</type>
            <description>This field specifies the geometric shape of the 
                 aperture. The possible choices are 'P', 'C', 'Q', 
                 or 'R'.  
                 'P' implies a pickle shape (FGS).   'C' implies a 
                 circular shape.  'Q' implies a quadrilateral shape.
                 'R' implies a rectangular shape.</description>
        </field>

        <field name="radius">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field is only significant for circular or pickle
                 shaped apertures and is defined in the SICS system.   
                 For a circular aperture, this is the radius of the 
                 aperture measured from the center ('center_v2',
                 'center_v3'). For a pickle aperture, this is the 
                 outer radius.</description>
        </field>

        <field name="vertex1_x">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field is only significant for quadrilateral or
                 rectangular shaped apertures and is defined in the 
                 SICS system.  These apertures are defined in counter-
                 clockwise order from vertex 1 to vertex 4.  This is 
                 the X coordinate of vertex 1.</description>
        </field>

        <field name="vertex1_y">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field is only significant for quadrilateral or
                 rectangular shaped apertures and is defined in the 
                 SICS system.  These apertures are defined in counter-
                 clockwise order from vertex 1 to vertex 4.  This is 
                 the Y coordinate of vertex 1.</description>
        </field>

        <field name="vertex2_x">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field is only significant for quadrilateral or
                 rectangular shaped apertures and is defined in the 
                 SICS system.  These apertures are defined in counter-
                 clockwise order from vertex 1 to vertex 4.  This is 
                 the X coordinate of vertex 2.</description>
        </field>

        <field name="vertex2_y">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field is only significant for quadrilateral or
                 rectangular shaped apertures and is defined in the 
                 SICS system.  These apertures are defined in counter-
                 clockwise order from vertex 1 to vertex 4.  This is 
                 the Y coordinate of vertex 2.</description>
        </field>

        <field name="vertex3_x">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field is only significant for quadrilateral or
                 rectangular shaped apertures and is defined in the 
                 SICS system.  These apertures are defined in counter-
                 clockwise order from vertex 1 to vertex 4.  This is 
                 the X coordinate of vertex 3.</description>
        </field>

        <field name="vertex3_y">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field is only significant for quadrilateral or
                 rectangular shaped apertures and is defined in the 
                 SICS system.  These apertures are defined in counter-
                 clockwise order from vertex 1 to vertex 4.  This is 
                 the Y coordinate of vertex 3.</description>
        </field>

        <field name="vertex4_x">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field is only significant for quadrilateral or
                 rectangular shaped apertures and is defined in the 
                 SICS system.  These apertures are defined in counter-
                 clockwise order from vertex 1 to vertex 4.  This is 
                 the X coordinate of vertex 4.</description>
        </field>

        <field name="vertex4_y">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field is only significant for quadrilateral or
                 rectangular shaped apertures and is defined in the 
                 SICS system.  These apertures are defined in counter-
                 clockwise order from vertex 1 to vertex 4.  This is 
                 the Y coordinate of vertex 4.</description>
        </field>

        <field name="vertex1_v2">
                <type>R8</type>
                <units>ARCSECONDS</units>
                <description>This field is only significant for quadrilateral or
                     rectangular shaped apertures and is defined in the 
                     V2-V3 system.  These apertures are defined in 
                     counter-clockwise order from vertex 1 to vertex 4. 
                     This is the V2 coordinate of vertex 1.</description>
        </field>

        <field name="vertex1_v3">
                <type>R8</type>
                <units>ARCSECONDS</units>
                <description>This field is only significant for quadrilateral or
                     rectangular shaped apertures and is defined in the 
                     V2-V3 system.  These apertures are defined in 
                     counter-clockwise order from vertex 1 to vertex 4. 
                     This is the V3 coordinate of vertex 1.</description>
        </field>

        <field name="vertex2_v2">
                <type>R8</type>
                <units>ARCSECONDS</units>
                <description>This field is only significant for quadrilateral or
                     rectangular shaped apertures and is defined in the 
                     V2-V3 system.  These apertures are defined in 
                     counter-clockwise order from vertex 1 to vertex 4. 
                     This is the V2 coordinate of vertex 2.</description>
        </field>

        <field name="vertex2_v3">
                <type>R8</type>
                <units>ARCSECONDS</units>
                <description>This field is only significant for quadrilateral or
                     rectangular shaped apertures and is defined in the 
                     V2-V3 system.  These apertures are defined in 
                     counter-clockwise order from vertex 1 to vertex 4. 
                     This is the V3 coordinate of vertex 2.</description>
        </field>

        <field name="vertex3_v2">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field is only significant for quadrilateral or
                 rectangular shaped apertures and is defined in the 
                 V2-V3 system.  These apertures are defined in 
                 counter-clockwise order from vertex 1 to vertex 4. 
                 This is the V2 coordinate of vertex 3.</description>
        </field>

        <field name="vertex3_v3">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field is only significant for quadrilateral or
                 rectangular shaped apertures and is defined in the 
                 V2-V3 system.  These apertures are defined in 
                 counter-clockwise order from vertex 1 to vertex 4. 
                 This is the V3 coordinate of vertex 3.</description>
        </field>

        <field name="vertex4_v2">
            <type>R8</type>
            <units>ARCSECONDS</units>
            <description>This field is only significant for quadrilateral or
                 rectangular shaped apertures and is defined in the 
                 V2-V3 system.  These apertures are defined in 
                 counter-clockwise order from vertex 1 to vertex 4. 
                 This is the V2 coordinate of vertex 4.</description>
            <range>0 .. 3600</range>
        </field>

        <field name="vertex4_v3">
                <type>R8</type>
                <units>ARCSECONDS</units>
                <description>This field is only significant for quadrilateral or
                     rectangular shaped apertures and is defined in the 
                     V2-V3 system.  These apertures are defined in 
                     counter-clockwise order from vertex 1 to vertex 4. 
                     This is the V3 coordinate of vertex 4.</description>
            <range>0 .. 3600</range>
        </field>

        <field name="aper_ref_ang">
            <type>R8</type>
            <units>DEGREES</units>
            <description>This is the aperture reference angle (Ta).  It 
                 specifies the rotation angle needed to transform 
                 from SICS to V2V3 coordinate systems.   The angle is 
                 measured counter-clockwise as viewed looking along 
                 the +V1-axis from the V3-axis to the positive side 
                 of the aperture's major axis.</description>
            <range>0 .. 360</range>
        </field>

        <field name="polynomial">
            <type>I2</type>
            <description>This field indicates the degree of the polynomial
                 used in the transformation from SIAS to SICS.   The
                 maximum value is 5.</description>
        </field>

        <field name="x_sic_center">
            <type>R8</type>
            <description>This is the x coordinate (in pixels) of the origin 
                 of the SICS system expressed in the SIAS system. </description>
        </field>

        <field name="y_sic_center">
                <type>R8</type>
                <description>This is the y coordinate (in lines) of the origin 
                     of the SICS system expressed in the SIAS system.</description>
        </field>

        <field name="x_sia_center">
             <type>R8</type>
             <description>This is the x coordinate of the origin of the SIAS
                         system expressed in the SICS system.</description>
        </field>

        <field name="y_sia_center">
            <type>R8</type>
            <description>This is the y coordinate of the origin of the SIAS
                      system expressed in the SICS system.</description>
        </field>

    </record>


    <relation name="aperture_def">
        <type>APERTURE_DEF</type>
        <description>Definition of apertures</description>
        <subsystem_using>OPUS</subsystem_using>

        <index name="aperture_def_1">
            <type>unique clustered</type>
            <field name="coord_id"/>
            <field name="valid_date"/>
        </index>
    </relation>


    <instance  name="aperture_def" scope="global" type="APERTURE_DEF" />

</sddl>
