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

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

<sddl>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- -->
<!--  SDDL Name:    NIC_SAA_DARK.SDDL-->
<!-- -->
<!--  Purpose:      This SDDL file defines the NIC_SAA_DARK relation.-->
<!-- -->
<!--  Modification History:-->
<!-- -->
<!--    Date       PR      Who                       Reason-->
<!--  - - - -    - - - -   - -   - - - - - - - - - - - - - - - - - - - - - -->
<!--  03/03/00   40279     Baum  Original implementation-->
<lm>  07/03/03   48821     CTB   Converted to XML format </lm> <!-- last mod -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

    <record name="SAA_DARK_TYPE">

        <description>This relation is used to identify NICMOS associations 
                   containing Post-SAA dark exposures. The records are
                   created for all such associations whether or not there are
                   any exposures that use it. There is a separate record for
                   each NICMOS configuration and saa_exit time. The relation
                   is used to allow the linkage of NICMOS exposures to SAA
                   darks that may occur in a previous (replan) SMS. Records
                   having saa_exit_hour values that are a few weeks old have
                   no operational value and may be deleted at any time. There
                   is no reason to archive any of these records. " </description>


            <field name="saa_exit_hour">
                    <type>C11</type>
                    <description>YYYY.DDD:HH -- This is the hour at which the saa
                         exit occurs. If the exit time is near an hour 
                         boundary, a second record with the adjacent hour
                         is also present. This field is used to match with
                         the first 11 characters of nic_saa_exit.saa_exit
                         to create the nic_saa_link records. </description>
            </field>

            <field name="config">
                    <type>C15</type>

                    <description>This is the value from qelogsheet.config that must be
                    the same for both exposures of the association. The same
                    value must match any qelogsheet.config for linked 
                    exposures in nic_saa_link. There should be three records
                    with different config values for each value of
                    saa_exit_hour. </description>
            </field>

            <field name="program_id">
                    <type>C3</type>

                    <description>The program_id of the dark association. See 
                    asn_product_link.program_id. </description>
            </field>

            <field name="obset_id">
                    <type>C2</type>

                    <description>Association observation set identifier of the dark
                    association. See asn_product_link.asn_obset_id. " </description>
            </field>

            <field name="member_num">
                    <type>C3</type>
                    <description>Member number of the dark association primary product.
                     See asn_product_link.member_num. </description>
            </field>

    </record>


    <relation name="nic_saa_dark">

        <type>SAA_DARK_TYPE</type>

        <description>NICMOS SAA Dark Association Relation</description>

        <subsystem_using>OPUS</subsystem_using>

        <index name="nic_saa_dark_1">
            <type>unique clustered</type>
            <field name="saa_exit_hour"/>
            <field name="config"/>
        </index>

        <index name="nic_saa_dark_2">
            <type>nonclustered</type>
            <field name="program_id"/>
            <field name="obset_id"/>
            <field name="member_num"/>
            <field name="saa_exit_hour"/>
        </index>

    </relation>
</sddl>
