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

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

<sddl>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- -->
<!--  SDDL Name; DATASET_LINK.SDDL -->
<!-- -->
<!--  Purpose:      This SDDL file defines the DATASET_LINK relation.-->
<!-- -->
<!--  Modification History:-->
<!-- -->
<!--    Date       OPR      Who                       Reason-->
<!--  - - - -    - - - -    - -    - - - - - - - - - - - - - - - - - - - - - - - - -->
<!--  01/30/01    44862      Baum   Original implementation-->
<lm>  07/03/03   48821     CTB   Converted to XML format </lm> <!-- last mod -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 

    <record name="DATASET_LINK_TYPE"> 
 
 
        <description>This relation is used to link the dataset rootname to 
                   programmatic ids with keys to facilitate joins to other
                   relations. </description>


            <field name="dataset_rootname">
                    <type>C9</type>
                    <description>IPPPSSOOT for jitter or astrometry datasets</description>

            </field>

            <field name="dataset_type">
                    <type>C3</type>
                    <description>Either FGS or AST, for FGS obslogs or astrometry,
                         respectively.</description>

            </field>

            <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.
                    It 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>C2</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. </description>
            </field>
    </record>
 
 
 
 
    <relation name="dataset_link">
 
        <type>DATASET_LINK_TYPE</type>

        <description>Links datasets to programmatic IDs</description>

        <subsystem_using>OPUS</subsystem_using>

        <index name="dataset_link_1">
            <type>unique clustered</type>
            <field name="dataset_rootname"/>
            <field name="dataset_type"/>
            <field name="program_id"/>
            <field name="obset_id"/>
            <field name="ob_number"/>
        </index>

        <index name="dataset_link_2">
            <type>nonclustered</type>
            <field name="program_id"/>
            <field name="obset_id"/>
            <field name="ob_number"/>
            <field name="dataset_type"/>
        </index>

    </relation>
</sddl>
