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

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

<sddl>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- -->
<!--  SDDL Name:    ASN_ASSOCIATION.SDDL-->
<!-- -->
<!--  Purpose:      This SDDL file defines the ASN_ASSOCIATION relation.-->
<!-- -->
<!--  Modification History:-->
<!-- -->
<!--    Date       OPR      Who                       Reason-->
<!--  - - - -    - - - -    - -   - - - - - - - - - - - - - - - - - - - - - -->
<!--  05/10/99   39260      Baum  Original implementation-->
<lm>  07/03/03   48821     CTB   Converted to XML format </lm> <!-- last mod -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


    <record name="ASN_ASSOC_TYPE">

        <description>This relation is used to provide attributes that apply to
                   entire associations.

                   An association is a set of exposures that will be merged 
                   into products by OPUS pipeline. The full association 
                   consists of a list of exposures and products.

                   This is one of the relations used to define 
                   associations for OPUS. ASN_MEMBERS and ASN_PRODUCT_LINK
                   are the others relations.</description>


            <field name="association_id">
                    <type>C9</type>

                    <description>This field identifies an OPUS association.   An
                    association is a set of exposures that will be
                    merged into products by OPUS pipeline calibration
                    processing. The full association consists of a
                    list of exposures and products.  

                    This field completely identifies an association. This is 
                    the OPUS value used for the keyword ASN_ID.  It has the
                    following format:

                           IPPPSSAAa

                    where:
                           I = instrument code
                               (e.g., N for NICMOS, O for STIS),
                         PPP = program_id
                          SS = obset_id of the first associated exposure,
                         AAa = the two-character sequence (AA = 01,02,...)
                               is unique within the obset SS;
                               plus the product id (a) that is always
                               0 for associations and primary products.</description>
            </field>

            <field name="si_name">
	            <type>C4</type>

                    <description>This is the identifier type for a Science Instrument (SI).
                    The SI list includes the:
                       FOC  - Faint Object Camera
                       FOS  - Faint Object Spectrograph
                       WFII - Wide Field Planetary Camera 2
                       HRS  - High Resloution Spectrograph
                       CSTR - COSTAR
                       FGS  - Fine Guidance Sensor
                       NIC  - NICMOS
                       STIS - Space Telescope Infrared Spectrograph
                       ACS  - Advanced Camera for Surveys
                       COS  - Cosmic Origins Spectrometer
                       WF3  - Wide Field Planetary Camera 3</description>
            </field>

            <field name="last_exp_date">
                    <type>C17</type>

                    <description>This field contains the latest predicted time of the
                    exposure members of an association. It uses the standard
                    SOGS time format - yyyy.ddd:hh:mm:ss
                    where yyyy = year
                          ddd = day of year
                          hh = hours
                          mm = minutes
                          ss = seconds</description>
            </field>
 
            <field name="collect_date">
                    <type>C17</type>

                    <description>This field contains the date of the association file 
	            created by OPUS. It uses the standard SOGS time
                    format - yyyy.ddd:hh:mm:ss
                    where yyyy = year
                          ddd = day of year
                          hh = hours
                          mm = minutes
                          ss = seconds</description>
            </field>
 
    </record>


    <relation name="asn_association">

        <type>ASN_ASSOC_TYPE</type>

        <description>Association Relation</description>

        <subsystem_using>OPUS</subsystem_using>
        <subsystem_using>DADS</subsystem_using>

            <index name="asn_association_1">
                    <type>unique clustered</type>
                    <field name="association_id"/>
            </index>

            <index name="asn_association_2">
                    <type>nonclustered</type>
                    <field name="last_exp_date"/>
            </index>

            <index name="asn_association_3">
                    <type>nonclustered</type>
                    <field name="si_name"/>
                    <field name="last_exp_date"/>
            </index>
    </relation>
</sddl>
