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

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

<sddl>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- -->
<!--  SDDL Name:    RTI_TABLE.XML -->
<!-- -->
<!--  Purpose:      This SDDL file defines the RTI_TABLE relation.-->
<!-- -->
<!--  Modification History:-->
<!-- -->
<!--    Date       OPR      Who                       Reason-->
<!--  - - - -    - - - -    - -   - - - - - - - - - - - - - - - - - - - - - -->
<!--  07/23/07   57479     LEG    Initial version                     -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


    <record name="RTI_TABLE_TYPE">

        <description>summary of planned obsets and their quality
                   </description>



            <field name="program_id">
                    <type>C3</type>
                    <units>BASE_36</units>
                    <description>When a proposal is accepted into the PMDB 
                    by SPSS it must
                    be assigned a unique 3 character base 36 program identifier.
                    This is done by the PMDB/ACCEPT_PROP command.
                    Is is used for identification of proposals by spacecraft
                    and OPUS software. It is also used in the OPUS and DADS
                    rootname for all archived science data files.
                    Because of flight design software, program_id must be
                    three characters. </description>
            </field>

            <field name="obset_id">
                    <type>C2</type>
                    <units>BASE_36</units>
                    <description>An observation set is a collection of one or more
                    alignments that are grouped together based on FGS pointing
                    requirements.  That is, if multiple alignments can all be
                    executed using the same guide star pair, they are grouped
                    into the same observation set. </description>
            </field>

            <field name="sms_id">
                    <type>C9</type>
                    <description><![CDATA[ The C&C list is a major data
                    structure within SPSS that
                    contains information on 'candidates' and the 'calendar'.

                    The candidate data, often referred to as the candidate
                    pool, are scheduling units and their associated
                    observation set, alignment, and target data.

                    The calendar is a timeline of activities that are laid
                    down by the SPSS scheduling utilities.  Example
                    activities include slews, PCS aquisitions, small angle
                    maneuvers, science, TDRS contacts, tape recordings,
                    science instrument reconfigurations, and others.

                    When a C&C List is saved in SPSS (via the cclist -save
                    comand) it receives an identifier.  The identifier can
                    be up to 9 characters long.  Within operations, the C&C
                    list naming convention is:    yydddnxx

                    where          yy  = last two digits of the year
                                   ddd = day of year of start of calendar
                                     n = length of calendar in days (usually 7)
                                    xx = unique identifier within above info.
                                    ]]> </description>

            </field>

            <field name="proposal_id">
                    <type>C5</type>
                    <description>A proposal consists of many individual observations
                    submitted as a package by a proposer.  When a proposal is
                    processed by the proposal entry system (RPS2),
                    it is assigned a proposal identifier.  That identifier is
                    an integer that is converted into a 5 character base 36
                    string.</description>
            </field>

        <field name="sunit_id">
                <type>C7</type>
                <description>A scheduling unit consists of one or more
                   observation sets and is the fundemental object which is
                   placed on SPSS calendars. A synonym for a scheduling unit
                   in SPSS is a 'candidate.' A scheduling unit is identified
                   by a seven character base 36 string. For operational
                   proposals the first five characters are the proposal ID
                   (with a leading zero).
                 </description>
        </field>

        <field name="first_start">
                <type>C17</type>
                <description>This field is set to the earliest start time
                     of the observations in qolink_sms for a given program_id,
                     obset_id, sms_id.
                </description>
        </field>

        <field name="last_end">
                <type>C17</type>
                <description>This field is set to the latest end time
                     of the observations in qolink_sms for a given program_id,
                     obset_id, sms_id.
                </description>
        </field>

        <field name="dependency">
                <type>C1</type>
                <description>is this scheduling unit dependent on another?
                </description>
        </field>

        <field name="prime_obs">
                <type>C5</type>
                <description>the prime obset for this scheduling unit, if any
                </description>
        </field>

        <field name="path_obs">
                <type>C5</type>
                <description>the pathfinder obset for this scheduling unit, 
                             if any
                </description>
        </field>

        <field name="mode1_obs">
                <type>C5</type>
                <description>the obset containing a mode 1 target acquisition 
                       (interactive) for this scheduling unit, if any
                </description>
        </field>

        <field name="manual">
                <type>C1</type>
                <description>should this obset be reviewed by an 
                    operations astronomer?
                </description>
        </field>

        <field name="dq_flag">
                <type>C1</type>
                <description>was this obset assessed for quality?
                </description>
        </field>

        <field name="glb_comment_file">
                <type>C25</type>
                <description>file name containing a comment that applies 
                   to the quality of all observations in this obset
                </description>
        </field>

        <field name="next_key">
                <type>C1</type>
                <description>the first unused key field in this record
                </description>
        </field>

        <field name="key1">
                <type>C14</type>
                <description>a keyword that pertains to the quality of 
                        observations in this obset
                </description>
        </field>

        <field name="k1_obnum">
                <type>C3</type>
                <description>the obnum of the observation in the obset 
                    to receive this keyword
                </description>
        </field>

        <field name="key2">
                <type>C14</type>
                <description>a keyword that pertains to the quality of 
                     observations in this obset
                </description>
        </field>

        <field name="k2_obnum">
                <type>C3</type>
                <description>the obnum of the observation in the obset 
                     to receive this keyword
                </description>
        </field>

        <field name="key3">
                <type>C14</type>
                <description>a keyword that pertains to the quality of 
                     observations in this obset
                </description>
        </field>

        <field name="k3_obnum">
                <type>C3</type>
                <description>the obnum of the observation in the obset 
                     to receive this keyword
                </description>
        </field>

        <field name="key4">
                <type>C14</type>
                <description>a keyword that pertains to the quality of 
                     observations in this obset
                </description>
        </field>

        <field name="k4_obnum">
                <type>C3</type>
                <description>the obnum of the observation in the obset 
                     to receive this keyword
                </description>
        </field>

        <field name="key5">
                <type>C14</type>
                <description>a keyword that pertains to the quality of 
                     observations in this obset
                </description>
        </field>

        <field name="k5_obnum">
                <type>C3</type>
                <description>the obnum of the observation in the obset 
                     to receive this keyword
                </description>
        </field>

        <field name="comment">
                <type>I4</type>
                <description>
                   numeric code for failure.  This field maps to the comment
                   field in dq_comments.
                </description>
        </field>

        <field name="da_init">
                <type>C2</type>
                <description>moniker of observations astronomer reviewing obset
                </description>
        </field>

        <field name="dq_time">
                <type>SYBASE_DATETIME</type>
                <description>when was quality evaluated?
                </description>
        </field>

        <field name="glb_comment">
                <type>text</type>
                <description> a comment that applies to the quality of all 
                        observations in this obset
                </description>
        </field>

        <field name="delete_time">
                <type>SYBASE_DATETIME</type>
                <description>when was the last file needed to assess 
                      quality removed from online storage?
                </description>
        </field>

        <field name="delete_stage">
                <type>C1</type>
                <description>assessment products previously deleted
                </description>
        </field>

        <field name="insert_date">
                <type>SYBASE_DATETIME</type>
                <description>
                   Date and time the record was inserted into this table
                </description>
        </field>

        <field name="update_date">
                <type>SYBASE_DATETIME</type>
                <description>
                   Date and time the record was last updated
                </description>
        </field>

        <field name="delete_date">
                <type>SYBASE_DATETIME</type>
                <description>
                   Date and time when all records are deleted from qolink_sms
                   for a given program_id, obset_id and sms_id.
                   The rti_table record remains and the delete_date is
                   filled in indicating this record is inactive.
                </description>
        </field>

    </record>


    <relation name="rti_table">

        <type>RTI_TABLE_TYPE</type>

        <description>summary of planned obsets and their quality</description>

        <subsystem_using>OPUS</subsystem_using>

            <index name="rti_table_1">
                    <type>unique clustered</type>
                    <field name="program_id"/>
                    <field name="obset_id"/>
                    <field name="sms_id"/>
            </index>

    </relation>
</sddl>


