Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/spst/UnixTransition/doc/create_uscs.html
Дата изменения: Fri Apr 8 12:46:14 2016
Дата индексирования: Mon Apr 11 01:31:12 2016
Кодировка:

Поисковые слова: arp 220
Python: module create_uscs
 
 
create_uscs (version 08/06/08)
index
create_uscs.py

PURPOSE --
Create USCs (User Specified Constraints).
 
DEVELOPER --
Bill Workman
 
KEY --
args = a list containing the argumants from the command line.
queryOptions = a dictionary conaining optional db query parameters.
processOptions = a dictionary containing options such as listonly.
required_args = a dictionary of required arguments.
uscOptions = a dictionary containing USC specification options.
usc_name = Name of USC (see the assist relation usc for examples).
usc_keyword_args = a dictionary of USC specification options.
visitList = a list of visits obtained either from the command line
    or a database query.
windowList = a list of dictionaries containing start and end times.
 
CODE ALGORITHM --
1. If no parameters, then print documentation string and exit.
2. Define options and parameters.
3. Set variables from required_args and uscOptions.
4. If visit list is defined use it, otherwise look it up in
   the database.
5. If not running in list_only mode, use visit_util.apply_usc
   to write the USC's into the database. If running in
   list_only mode, print the visit list.
 
NOTES --
1. To create a USC for given visit(s), an example would be:
do create_uscs LRP_GTO_STIS 1999.001:00:00:00 2000.274:00:00:00 -visits="0756601"
2. To create USCs for a range of visits given by a database search,
   an example would be (it is suggested to also include the -list_only option
   to ensure the database changes proceed as intended):
do create_uscs LRP_GTO_STIS 1999.001:00:00:00 2000.274:00:00:00
   -other_qualifiers="and (sut.sunit_id in (select sunit_id from usc where
   sunit_id="0756601"))"
Note that a visit's status must be pi, implementation, or scheduling in order
for the database search capability to find a given visit.
 
MODIFICATION HISTORY --
Date        Who            What
====        ===            ====
01/31/01    Workman        initial implementation
05/10/05    Bower          re-testing and restructuring
05/18/05    Bower          implement -exclude_usc option
05/20/05    Bower          change call for populatefromdb
05/25/05    Bower          add -verbose option
08/06/08    Bower          add -parallels option

 
Modules
       
spss_sys_util
sys
visit_util

 
Functions
       
run(args)
Create USCs.
 
Usage:
do create_uscs usc_name window1_start window1_end
   [[window2_start window2_end]...] [-options]
 
usc_name is the name of the USC to be inserted into assist relation
   usc. It must be 50 characters or less in all caps.
 
window_start and window_end are the start and end times of the window
   in SOGS format.
 
-options are one or more of:
 
    Visit list DB query options (to define the DB search parameters):
    -prime
    -parallel
    -internal
    -pure_parallel
    -visits=      "01234v1 01234v2 01234v3 ..."
    -si_modes=    "stis_ccd stis_fuv_mama stis_nuv_mama wfpc2 fgs
                   nic1 nic2 nic3 acs_hrc acs_wfc acs_sbc"
    -type=        "GO GTO ENG SM..." 
    -cycle=       <cycle #>
     OR        -min_cycle=<min cycle #>
        and/or -max_cycle=<max cycle #>
    -other_qualifiers= "any valid subquery of the form:"
              "and (sut.sunit_id in (select sunit_id from ... where ...))"
          OR  "and (cp.prop_id in (select prop_id from ... where ...))"
 
    USC specification Options:
    -usc_mode=    "combine" (default) | "override"
    -usc_value=   <float type> (default=1.0)
    -usc_comment= "explanatory text" (default="No comment provided.")
    -exclude_usc  (To define the actual USC inserted into the DB to be
                   the logical complement of the window defined on the
                   command line.)
    -list_only    (When used, function only displays the list of visits
                   based on query options; USC's are not created.)
 
    Verbose output Options:
    -verbose

 
Data
        __version__ = '08/06/08'