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

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

<sddl>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- -->
<!--  SDDL Name:  QOLINK_SMS.SDDL -->
<!-- -->
<!--  Purpose:      This SDDL file defines the qolink_sms relation.-->
<!-- -->
<!--  Modification History:-->
<!-- -->
<!--    Date       OPR      Who                       Reason-->
<!--  - - - -    - - - -    - -   - - - - - - - - - - - - - - - - - - - - - -->
<!--  05/09/96    31365     JJB  Original implementation-->
<!--  03/10/97    33526     JJB  Extend table to include products and add status-->
<!--  07/28/97    34813     JJB  Extend table to add OPUS tracking fields-->
<!--  07/06/99    38210     KEN  Extend table to add start/stop time fields-->
<!--  03/30/00    40279     JJB  Add index for start time used by insert_ss_records-->
<!--  05/09/01    44524     JJB  Add time_type field for FGS project-->
<lm>  07/03/03    48821     CTB   Converted to XML format </lm> <!-- last mod -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

    <record name="QOLSMS_TYPE"> 
 
 
            <description>This relation is used to provide DADS and OPUS with the
                       SMS_ID for any observation in the support schedule. It
                       can be used to list all observations and association
                       products for a particular SMS_ID. It contains a status
                       field to identify observation or product archive success
                       or unavailability. It contains eight OPUS tracking
                       fields not used by DADS.</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="ob_number">
                    <type>C3</type>
                    <units>BASE_36</units>
                    <description>Observations are numbered sequentially throughout
                     an observation set and are assigned by SMS/Gen.
                     An ob_number is _NOT_ the same as an obset_ID. The
                     third character is only used for association products.</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.

		    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="status">
                    <type>C1</type>
                    <description>The condition or availability for archiving is indicated
                     by a status code with the following definition:
		
                     U - Unexecuted - the initial condition for exposures or
                         products that will be archived independently of
                         associations.
 
                     M - Member - the initial condition for exposures that
                         are only archived within an association product.

                     N - Not available - set by operations to indicate 
                         exposures or products that cannot be generated.

                     E - Executed and archived successfully.</description>
            </field>

            <field name="inst">
                    <type>C1</type>
                    <description>One character identifier for the instrument used for the   
                     science observation. The relation between this value and
                     the names in qobservation.si_id are: 

                       1 = 1
                       2 = 2
                       3 = 3
                       J = ACS
                       N = NIC
                       O = STIS
                       U = WFII
                       V = HSP
                       W = WFPC
                       X = FOC
                       Y = FOS
                       Z = HRS </description>
            </field>

            <field name="taq">
                    <type>C1</type>
                    <description>Flags observation as a target acquisition.

                     Y - The qobservation.target_acqmode field is 01 or 02.
                         This observation is a target acquisition.</description>
            </field>

            <field name="ocx_expected">
                    <type>C1</type>
                    <description>Flags this observation as real time (mode 1) target acq.

                     Y - The qobservation.target_acqmode field is 01.
                         This observation is a mode 1 (real time) target
                         acquisition image.</description>
            </field>

            <field name="pdq_created">
                    <type>C1</type>
                    <description>OPUS pipeline has created a PDQ file for this observation.

                     The value of this column is an alphanumeric code that
                     indicates the status, real or inferred, of the PDQ file
                     for the observation.</description>
            </field>


            <field name="oms_archived">
                    <type>C1</type>
                    <description>OMS pipeline has successfully achived an observation log
                     for this observation.

                     X - The data assessment software has validated
                         existence of the OMS observation log for this
                         observation in DADS.</description>
            </field>

            <field name="rti_checked">
                    <type>C1</type>
                    <description>OPUS staff has checked for existence of real time
                     information for this observation.

                     X - The OPUS staff has run RTI_CHECK software for
                         this observation.</description>
            </field>


            <field name="ocx_appended">
                    <type>C1</type>
                    <description>An OCX file has been appended to the PDQ file.

                     The value of this column is an alphanumeric code that
                     indicates that the data assessment software has located
                     an OCX file (and the type of file) for this
                     observation and has appended it to the PDQ file.</description>
            </field>


            <field name="assessed">
                    <type>C1</type>
                    <description>This observation has been assessed for procedural quality.

                     The value of this column is an alphanumeric code that
                     summarizes the essentials of the assessment process.</description>
            </field>


            <field name="dq_archived">
                    <type>C1</type>
                    <description>Archive status of the procedureal data quality file(s).

                     The value of this column is an alphanumeric code that
                     indicates the archive status of the PDQ (and optionally
                     the OCX) file of this observation.</description>
            </field>


            <field name="start_time">
                    <type>C17</type>
                    <description>This field (format: yyyy.ddd:hh:mm:ss) contains 
                      either the planned or actual start time of the 
                      observation. The time_type field indicates the
                      source of the time. </description>
            </field>


            <field name="end_time">
                    <type>C17</type>
                    <description>This field (format: yyyy.ddd:hh:mm:ss) contains  
                      either the planned or actual end time of the 
                      observation. The time_type field indicates the
                      source of the time. </description>
            </field>

            <field name="time_type">
                    <type>C1</type>
                    <description>(P/A) When this field is P for planned, start_time and
                      end_time are generated from SPSS planning data and the
                      accuracy is questionable. When this field is A for
                      actual, start_time and end_time have been updated by the
                      OPUS pipeline using science data. </description>
            </field>

        <relation name="qolink_sms">
 
            <type>QOLSMS_TYPE</type>

            <description>Link observations to CCL Relation</description>

            <subsystem_using>OPUS</subsystem_using>

            <index name="qolink_sms_1">
                <type>unique clustered</type>
                <field name="program_id"/>
            <field name="obset_id"/>
            <field name="ob_number"/>
            </index>

            <index name="qolink_sms_2">
                <type>nonclustered</type>
                <field name="sms_id"/>
            </index>

            <index name="qolink_sms_3">
                <type>nonclustered</type>
                <field name="start_time"/>
            </index>

        </relation>
    </record>
</sddl>
