Go to the bottom.
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! SDDL Name:	QSCHEDULING.SDDL
!
! Purpose:      This SDDL file defines the qscheduling relation.
!
! Modification History:
!
!   Date       PR     Who                       Reason
! --------   -------  ---   -------------------------------------------------
! 10/25/94   27329    EGB   Original implementation
! 01/20/95   27845    MRB   Added af_rev_number for partial trans generation
! 02/02/95   28292    SK    Modified "REPLICATION" wording under 
!                             SUBSYSTEM_USING
! 03/14/94   28429    RJS   Updated comments.
! 04/10/95   31227    MRB   Added est_orbits, removed branching_su
! 04/29/95   31227.1  MRB   Change est_orbits description with Bauer comments
! 02/07/97   33001    SXT   Rename QSLINK_SPEC to QSLINK_TIMING
! 12/12/97   27706    EGB   Remove reconfig_seq
! 12/12/97   29733    MRB   Add C output
! 04/16/98   31837    MRB   Change field name from su_load_date to af_load_date
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
!
 
LANGUAGE  C, FORTRAN, SQL

INCLUDE  ZSPSS_USER_TYPES.SDDL
 
RECORD  SUNIT_TYPE
 
!------------------------------------------------------------------------------
!
!   RECORD INFORMATION
!
!------------------------------------------------------------------------------
 
    DESCRIPTION    "This is the master relation for scheduling unit data
		    in the PMDB.  

		    A scheduling unit consists of one or more observation sets
		    and is the higher level input to the SPSS calendar 
		    scheduling utilities.   A synonym for a scheduling unit in 
		    SPSS is a 'candidate.' SU is the common acronym seen for 
		    a scheduling unit.

		    There are different types of scheduling units.  The
                    types relate specifically to how they are placed on the
                    SPSS calendar.  The types are listed below with an 
                    brief explanation of each.

                    MAIN (PRIMARY) SU 

                    A main SU is a scheduling unit that contains prime science 
                    observations.  These main SUs will typically contain 
		    maneuvering activities to achieve the proper spacecraft 
		    pointing.  They may or not restrict (or preclude) other 
		    scheduling units from sharing that prime calendar time.

                    ATTACHED PARALLEL SU 

                    An attached parallel SU is a scheduling unit that contains
                    targeted science alignments.  The trick with this type
                    of SU is that it shares the pointing of some main SU, hence
                    it gets attached to it on the calendar.  

                    TARGETED INTERLEAVER SU

                    A targeted interleaver SU requires minor vehicle 
                    positioning changes within a main SU in order to collect 
                    science data on the interleaved science.  

                    NON-TARGETED INTERLEAVER SU

                    A non-targeted interleaver has no pointing requirements 
                    (since it has no target) and does not require any ST 
                    maneuvers to schedule.  Earth calibrations can be scheduled
                    as non-targeted interleavers for example.

                    UNATTACHED PARALLEL SU

                    An unattached parallel SU is a non-targeted parallel SU 
		    that can be scheduled on top of a main, interleaver, or
                    other parallel SUs.  Because it is non-targeted it has no
                    on-sky pointing requirements.  There will be no attachment 
		    data stored in qparallels for these types of SUs.

		    LINKED SU 

                    A linked scheduling unit is one that has a well defined 
                    timing/orient relationship with one or more other 
                    scheduling units. This timing/orient relationship is 
                    defined in a 'linked set' and is stored in the relation 
                    qslink_timing/qslink_orient.  A linked SU can
                    be scheduled as main, parallel,  or interleaver SU. "
 
!------------------------------------------------------------------------------
!
!   FIELD INFORMATION
!
!------------------------------------------------------------------------------
 
 

    FIELD  sunit_id
        TYPE SUNIT_ID_TYPE
        FORM
            NAME         "SGD"
            LABEL        "SCHEDULING UNIT ID"
        END_FORM
    END_FIELD
 

    FIELD  version_num
        TYPE VERSION_NUM_TYPE
        DESCRIPTION     "There can be different versions of a scheduling unit
			 scheduled on different C&C Lists."
        FORM
            NAME         "SGD"
            LABEL        "VERSION NUM"
        END_FORM
    END_FIELD
 

    FIELD  last_update
        TYPE TIME_STAMP_TYPE
        DESCRIPTION     "This field contains the time that the SU data was 
			 updated.  The setting of this field will typically 
			 happen through the PFORMs software and it will occur 
			 when data at subordinate levels (observation set, 
			 alignment, exposure) is updated that is a part of the 
			 scheduling unit."
	RELATED_FIELDS  "qscheduling.auto_update" "qscheduling.af_load_date"

        FORM
            NAME         "SGD"
            LABEL        "DATE OF LAST UPDATE"
        END_FORM
    END_FIELD
 

    FIELD  over_priorit
        TYPE            C1
        DESCRIPTION     "This field can be set to disable the calculation of	
			 the scheduling unit priority field (done at 
			 PMDB/UPDATE time).  If overridden, by setting this
			 field to 'O', then you can set the priority directly
			 via the PFORM SGD and it will not be altered by 
			 successive PMDB/UPDATE/TYPE=SU runs.  If this field
			 is set at 'D', then it will be recalculated."
	RELATED_FIELDS  "qscheduling.priority"
        FORM
            NAME         "SGD"
            LABEL        "PRIORITY OVERRIDE FLAG   (D/O)"
        END_FORM
        DISCRETE        "D",  "O"
    END_FIELD
 

    FIELD  priority
        TYPE            I2
        DESCRIPTION     "The scheduling unit priority can affect how it is 
			 considered during calendar scheduling using 
			 CALENDAR/AUTO.  Higher priority (100 is the highest) 
			 SUs are given preferential treatment by AUTO.
			 This field is calculated at PMDB/UPDATE/TYPE=SU
			 by taking the MAX of all the observation set 
			 priorities."
	RELATED_FIELDS  "qscheduling.over_priorit" "qbs_obset.pri_proposer"

        FORM
            NAME         "SGD"
            LABEL        "PRIORITY  (1-100)"
        END_FORM
        RANGE		 "1-100"
    END_FIELD
 

    FIELD  max_pathtime
        TYPE            I4
        UNITS           "SECONDS"
        DESCRIPTION     "The maximum path time of a scheduling unit is the 
			 sum of the estimated alignment durations, pcs 
			 acquisition times (constant coefficient), small angle
			 maneuvers, and minimum slews between obsets.  The
                         minimum obset and alignment separation is also
                         taken into account during this calculation (during 
			 PMDB/UPDATE/TYPE=SU).  The placement of an SU onto a
			 calendar will only be attempted if this max_pathtime 
			 field is smaller than the size of the calendar place."
        FORM
            NAME         "SGD"
            LABEL        "MAX PATH TIME"
        END_FORM
    END_FIELD
 

    FIELD  max_data_vol
        TYPE            R4
        UNITS           "KILOBITS"
        DESCRIPTION     "This field contains the maximum SU data volume.  It 
			 is set based on calculations during 
			 PMDB/UPDATE/TYPE=SU.  It is the summation of the 
			 data volume estimates for all alignments in the 
			 scheduling unit.  During scheduling SPSS will not
			 permit an SU to violate data volume constraints.  That
			 means there is a certain amount of data that can be 
			 taken during a certain time frame.  This data volume
			 constraint information is stored in the widcr_parms 
			 relation."
	RELATED_FIELDS  "qalignment.data_volume" "widcr_parms.check_datavl" "widcr_parms.check_tapevl"

        FORM
            NAME         "SGD"
            LABEL        "MAX DATA VOL (kbits)"
        END_FORM
    END_FIELD
 

    FIELD  interleave
        TYPE YES_NO_FLAG_TYPE
        DESCRIPTION     "When this field is 'Y' it means this scheduling unit 
			can be interleaved by activities from other scheduling 
			units.  The calendar timeline will have a mixture of 
			activities from multiple scheduling units within the 
			time span of a single scheduling unit.  Setting this 
			flag to 'N' will not allow the interleaving of 
			activities to occur. Finally,  this field only applies 
			to targeted interleavers that would require vehicle 
			maneuvering to obtain the interleaved science."
        FORM
            NAME         "SGD"
            LABEL        "INTERLEAVERS ALLOWED     (Y/N)"
        END_FORM
    END_FIELD
  

    FIELD  sis_used
        TYPE            I2
        DESCRIPTION     "This field is a bit map that indicates what science
			 instruments are being used in this scheduling unit.
			 It is set during PMDB/UPDATE/TYPE=SU by polling all the
			 exposures within this scheduling unit and keeping 
			 track of all the SIs used in those exposures.

			 Within this field, a specific bit will correspond to
			 a specific instrument.  If the bit is on or '1', then
			 that instrument is used within this scheduling unit.

			 SPSS developers can reference the include file
			 ZSIBITS.INC for a description of the bitmap positions.

			 Another way to determine a scheduling units SI usage 
			 is to query the qsinstrument relation."
	RELATED_FIELDS  "qexposure.si_used" "qscheduling.si_intrlv" "qsinstrument.*"

    END_FIELD
 

    FIELD  si_intrlv
        TYPE            I2
        DESCRIPTION     "This field is a bit map that indicates which science
			 instruments *cannot* be interleaved with this 
			 scheduling unit.  It is set during PMDB/UPDATE/TYPE=SU 
			 by polling qsinstrument.si_usage field.  If that field
			 has been set to I then the SI cannot be interleaved
			 for this scheduling unit.  

			 Within this field, a specific bit will correspond to
			 a specific instrument.  If the bit is on or '1', then
			 that instrument cannot be interleaved within this 
			 scheduling unit (although it may be used by this 
			 scheduling unit).  If the bit is off or '0', then the
			 SI can be interleaved.  

			 SPSS developers can reference the include file
			 ZSIBITS.INC for a description of the bitmap positions."
	RELATED_FIELDS  "qscheduling.sis_used" "qsinstrument.si_usage"

    END_FIELD
 

    FIELD  parallel_su
        TYPE YES_NO_FLAG_TYPE
        DESCRIPTION     "When this field has been set to 'Y' it means that the
			 scheduling unit can *only* be scheduled as a parallel 
			 SU.  A parallel scheduling unit is one whose calendar
			 activites can be scheduled on top of (or in parallel 
			 with) those from another scheduling unit.

			 There are two types of parallels: attached and 
			 unattached.  Attached parallels are targeted 
			 scheduling units that 	 share the pointing of some 
			 main SU (that will maneuver the HST to some defined 
			 position).  An unattached parallel is used for	
			 non-targeted observations (e.g. earth calibrations) 
			 and can be placed more liberally on a calendar.

			 When the field is 'N' it means that it is not a 
			 parallel scheduling unit."
	RELATED_FIELDS  "qscheduling.par_attach" "qscheduling.par_allowed" "qbs_obset.parallel_can"

        FORM
            NAME         "SGD"
            LABEL        "PARALLEL SCHEDULING UNIT           (Y/N)"
        END_FORM
    END_FIELD


    FIELD  ready_flag
        TYPE            C1
        DESCRIPTION     "This field is a multi-state field that denotes the 
			 readiness of a scheduling unit with respect to PASS.

			 It is set during PMDB/UPDATE/TYPE=SU and can
			 be controlled by the /READY and /PASS qualifiers on
			 that command.  Alternatively it can be set via the
			 SGD form.

			 When this field is 'P' then it is ready for PASS and 
			 can be placed on a calendar destined to have an SMS 
			 created from it.  Typically in operations the SUs are 
			 always ready for PASS and this setting is the default 
			 behavior of PMDB/UPDATE.

			 When the SU is 'S' it can be scheduled on a calendar,
			 but it may not go on an SMS.  

			 When this field is 'N', the SU is deemed 'Not Ready', 
			 usually because it is missing data and can not be 
			 scheduled on a calendar.  When this field is blank 
			 it maps to 'N'.

			 Finally, when this field is set to 'D', it means this
			 scheduling unit is dead, and it may not be placed on
			 any flight calendar, nor may it be run through
			 PMDB/UPDATE.  See OPR 24776 for more details on 
			 'Dead SUs'."
	RELATED_FIELDS  "qbs_obset.ready_flag"
        FORM
            NAME         "SGD"
            LABEL        "READY FOR SCHED/PASS (D/N/P/S)"
        END_FORM
        DISCRETE        "N",  "P",  "S", "D"
    END_FIELD
 

    FIELD  window_start
        TYPE SOGS_INT_TIME_TYPE
        DESCRIPTION     "This field denotes the start time of the scheduling 
			 unit window.  Together with qscheduling.window_stop
			 it forms a window over which PMDB/UPDATE/TYPE=SU can 
			 calculate various scheduling windows."
	RELATED_FIELDS  "qscheduling.window_stop"
        FORM
            NAME         "SGD"
            LABEL        "START TIME"
        END_FORM
    END_FIELD
 

    FIELD  window_stop
        TYPE SOGS_INT_TIME_TYPE
        DESCRIPTION     "This field denotes the end time of the scheduling 
			 unit window.  Together with qscheduling.window_start
			 it forms a window over which PMDB/UPDATE/TYPE=SU can 
			 calculate various scheduling windows."
	RELATED_FIELDS  "qscheduling.window_start"
        FORM
            NAME         "SGD"
            LABEL        "STOP TIME"
        END_FORM
    END_FIELD
 

    FIELD  calc_start
        TYPE SOGS_INT_TIME_TYPE
        DESCRIPTION     "After PMDB/UPDATE/TYPE=SU has been run, the calculated
			 start time of the scheduling unit will be stored in
			 this field.  It is derived by starting at the time 
			 qscheduling.window_start and will be the minimum 
			 observation set start time for all OBSETs associated 
			 with the SU.  

			 Together with qscheduling.calc_stop it defines the 
			 window in which the SU may be scheduled.  An SU will 
			 not be permitted on a calendar if its calc_start and 
			 calc_stop window does not overlap the calendar time 
			 span."
	RELATED_FIELDS	 "qscheduling.calc_stop"
        FORM
            NAME         "SGD"
            LABEL        "CALCULATED START"
        END_FORM
    END_FIELD
 

    FIELD  calc_stop
        TYPE SOGS_INT_TIME_TYPE
        DESCRIPTION     "After PMDB/UPDATE/TYPE=SU has been run, the calculated
			 end time of the scheduling unit will be stored in
			 this field.  It is derived by starting at the time 
			 qscheduling.window_start and will be the minimum 
			 observation set start time for all OBSETs associated 
			 with the SU.  

			 Together with qscheduling.calc_start it defines the 
			 window in which the SU may be scheduled.  An SU will 
			 not be permitted on a calendar if its calc_start and 
			 calc_stop window does not overlap the calendar time 
			 span."
	RELATED_FIELDS	 "qscheduling.calc_start"
        FORM
            NAME         "SGD"
            LABEL        "CALCULATED STOP"
        END_FORM
    END_FIELD
  

    FIELD  auto_update
        TYPE TIME_STAMP_TYPE
        DESCRIPTION     "Whenver PMDB/UPDATE/TYPE=SU is run successfully on a
			 scheduling unit this field will be updated with the 
			 system time."
	RELATED_FIELDS  "qscheduling.last_update" "qscheduling.af_load_date"

        FORM
            NAME         "SGD"
            LABEL        "DATE OF LAST PMDB/UPDATE"
        END_FORM
    END_FIELD
 

    FIELD  critical_flg
        TYPE YES_NO_FLAG_TYPE
        DESCRIPTION     "If this scheduling unit contains at least one 
			 observation set that is time critical, then this flag
			 will be set to 'Y'.  If it is a time critical SU then
			 this will be taken into account when scoring the 
			 placement of the scheduling unit during calendar AUTO 
			 scheduling.  Time critical SUs are weighted during the
			 scoring process."
	RELATED_FIELDS  "qbs_obset.critic_flag"
        FORM
            NAME         "SGD"
            LABEL        "CRITICALITY FLAG         (Y/N)"
        END_FORM
    END_FIELD
 

    FIELD  par_attach
        TYPE YES_NO_FLAG_TYPE
        DESCRIPTION     "This field only applies to scheduling units that 
			 have the qscheduling.parallel_su set to 'Y'.  If that
			 condition is true and this field is 'Y' then it means
			 the parallel SU is a targeted SU and it must be 
			 attached to some main (primary) SU via an entry in the
			 qparallels relation.  If an entry is missing in that 
			 table for a parallel SU it will not be able to be 
			 added into a C&C List."
        RELATED_FIELDS  "qscheduling.parallel_su" "qparallels.*"

        FORM
            NAME         "SGD"
            LABEL        "IF Y, PARALLEL ATTACH REQUIRED   (Y/N)"
        END_FORM
    END_FIELD
 

    FIELD  sched_interl
        TYPE YES_NO_FLAG_TYPE
        DESCRIPTION     "When this field is set to 'Y' it means that the SU
			 can be scheduled as an interleaver.  If it is 'N' the
			 calendar scheduling process will not permit it to be 
			 scheduled as such."
        FORM
            NAME         "SGD"
            LABEL        "SCHED. AS INTERLEAVER    (Y/N)"
        END_FORM
    END_FIELD
 

    FIELD  par_allowed
        TYPE PAR_ALLOWED_TYPE
	RELATED_FIELDS	 "qbs_obset.par_allowed",
			 "qalignment.par_allowed"
        FORM
            NAME         "SGD"
            LABEL        "IF N, PARALLEL ALLOWED TYPE  (Y/N/I/A)"
        END_FORM
    END_FIELD
 

    FIELD  max_su_dur
        TYPE            I4
        UNITS           "SECONDS"
        DESCRIPTION     "This field restricts the duration of the scheduling 
			 unit such that the elapsed time from the start of 
			 the first OBSET in the SU to the end of the last 
			 alignment in the SU may not exceed this time. "
	RELATED_FIELDS	 "qbs_obset.max_ob_dur",
			 "qalignment.max_al_dur"
        FORM
            NAME         "SGD"
            LABEL        "MAXIMUM SU DURATION"
        END_FORM
    END_FIELD
 

    FIELD  reusable
        TYPE YES_NO_FLAG_TYPE
        DESCRIPTION     "When this field is set to 'Y' it means that the 
			 scheduling unit is reusable and can appear on multiple
			 flight calendars that are on the global baseline. 
			 This 'Y' setting is only valid for SUs that do not 
			 produce archivable science data.  When this field is 
			 set to 'N' the SU can only appear on one flight 
			 calendar on the global baseline.
			 
			 See OPR 20709 for additional details. "
	RELATED_FIELDS	 "wistat_sunit.offbase",
			 "wbase_cat.*"
        FORM
            NAME         "SGD"
            LABEL        "REUSABLE SCHEDULING UNIT FLAG      (Y/N)"
        END_FORM
    END_FIELD
 

    FIELD  cw_status
        TYPE            C1
        DESCRIPTION     "In support of Long Range Planning (LRP), SPIKE 
			 provide SPSS windows where it believes the scheduling 
			 unit can schedule.  These windows are loaded into 
			 a PMDB table called 'constraint_windows' (via
			 SYBASE replication).

			 An SPSS user (PC) can run procedures that will verify 
			 whether or not the constraint windows that SPIKE 
			 provides are valid, or verifiable.  The final step
			 to this procedure will be running the SPSS command 
			 CALOPT which will alter the state of this field.

			 This field will denote the status of the verification.

			 When this field is 'U' or 'N' or blank that means that
                         the constraint windows are unverified. This can occur 
			 when:
				- the SU was just loaded from TRANS and the 
				  constraint windows may or may not exist.
                                  (field is 'N' or blank)
				- the constraint windows have been regenerated 
				  by SPIKE to some HST resource/PDB resource 
				  changes.  
				- PMDB/UPDATE has been rerun on the scheduling 
			          unit which will set this field to 'U'.

			 When this field is 'I' it means that CALOPT is in the
			 process of attempting to verify the SU's constraint 
			 windows.

                         When the command CALOPT/VERIFY_WINDOWS=SGD is run,
                         this field can be set to 'V' or 'F'.

			 When this field is 'V' then the SPIKE constraint
                         windows have been verified successfully through the
                         CALOPT command.  That means SPSS and SPIKE agree at the 
			 placement of the SU in the LRP.

			 When the field is 'F', the SPIKE constraint windows
                         have failed verification during CALOPT process.  There is
			 some problem causing SPSS to not be able to schedule 
			 in the LRP time frame that SPIKE has designated for 
			 this SU.

                         When the command CALOPT/VERIFY_WINDOWS=SGD is run,
                         this field can be set to 'S' or 'C'.  This command
                         specifies that the the SU's SGD windows be used
                         in place of the SPIKE constraint windows.

                         When the field is 'S', verified constraint windows
                         have been successfully generated.

                         When the field is 'C', the CALOPT was unable to
                         schedule the SU anywhere inside the SGD window,
                         hence no verified constraint windows were generated."

	RELATED_FIELDS	"constraint_windows.*",
			"constraint_windows_ver.*",
			"plan_windows.*"
        FORM
            NAME         "SGD"
            LABEL        "CONSTRAINT WINDOW STATUS"
        END_FORM
        DISCRETE	"N", "U", "V", "F", "I"
    END_FIELD
 

    FIELD  af_load_date
        TYPE TIME_STAMP_TYPE
        DESCRIPTION     "This field contains the date that the SU was loaded 
			 into the PMDB from the TRANS assignment files.  This 
			 field can be compared against other modification 
			 dates in this relation."
	RELATED_FIELDS  "qscheduling.last_update" "qscheduling.auto_update"

        FORM
            NAME         "SGD"
            LABEL        "DATE OF SU LOAD"
        END_FORM
    END_FIELD
 

    FIELD  flight_ready_flag
        TYPE YES_NO_FLAG_TYPE
        DESCRIPTION     "This field will be set to 'Y' when the scheduling 
                         unit has successfully completed SPSS scheduling
                         preparation (i.e. proposal prep).   It will be set by 
                         the DBSA state change tool after the Program 
                         Coordinator (PC) deems the SU has completed SPSS 
                         scheduling preparation as defined by PC procedures.

                         Note that at some time in the future this field will 
                         probably be renamed to scheduling_prep_done or 
                         spss_prep_done." 
	RELATED_FIELDS  "qscheduling.ready_flag"
        FORM
            NAME         "SGD"
            LABEL        ""
        END_FORM
    END_FIELD



    FIELD  af_rev_number
        TYPE AF_REVISION_NUMBER_TYPE
	RELATED_FIELDS  "qpdescrip.af_rev_number" "qsucomments.af_load_date"

    END_FIELD


    FIELD  est_orbits
        TYPE            I2
        DESCRIPTION     "The field contains the estimated number of orbits to
                         be used for scheduling this SU.  TRANS allocates
                         spacecraft time in orbits, and in general the
                         front-end systems prior to SPSS use units of orbits
                         instead of hh:mm:ss to measure observing time.

                         This datum is used by SPIKE.  It is needed to help
                         ASSIST keep track of TRANS estimates for the number
                         of orbits per visit and the total per proposal
                         (which can then be compared to the TAC allocation).

                         In the re-engineering of ASSIST, it turned out that
                         nearly all the data needed could be populated either
                         from existing PMDB fields or by inspecting the
                         proposal, hence there is no need to use SPIKE to do
                         this using information from TRANS (the old STIF
                         concept).

                         Note that the decision to depend on the PMDB for this
                         and other information assumes an operational concept
                         where visits are loaded into the PMDB almost as soon
                         as they are first transformed, even if they may be
                         refined later."
        FORM
            NAME         "SGD"
            LABEL        "ESTIMATED NUMBER OF ORBITS"
        END_FORM
    END_FIELD

END_RECORD
 
 
!------------------------------------------------------------------------------
!
!   RELATION DECLARATION
!
!------------------------------------------------------------------------------
 
RELATION  qscheduling
 
    TYPE             SUNIT_TYPE
 
    DESCRIPTION      "Scheduling Unit Relation"
 
    SUBSYSTEM_USING  "SPSS", "SPIKE", "REPLICATION-FROM-SOGS", "TRANS", "CCLIST"

    RELATED_FIELDS  "qparallels.*" "qslink_timing.*" "qslink_orient.*"

    FORM
        NAME         "SGD"
    END_FORM
 
    INDEX  qscheduling_1
        TYPE         unique, clustered
        FIELDS       sunit_id, version_num
    END_INDEX
 
END_RELATION
 
!------------------------------------------------------------------------------
!
!   INSTANCE DECLARATION
!
!------------------------------------------------------------------------------
 
 
INSTANCE  qscheduling
 
    GLOBAL
 
    TYPE        SUNIT_TYPE
 
END_INSTANCE

Go to the top.