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

Поисковые слова: рер р р р р р р р р р р р р р
Python: module send_sars_for_snas3
 
 
send_sars_for_snas3 (version 15.07.29)
index
send_sars_for_snas3.py

PURPOSE --
Send the SARS (schedule add requests) to SNAS to request TDRSS
service from the NCC at Goddard. For each schedule name, copy the
.ssr and .tcw files to the SNAS_IMPORT directory.
 
Based on send_sars_to_ups.py
 
DEVELOPER --
Gary Bower and Don Chance
 
MODIFICATION HISTORY --
 
o Initial implementation 7/21/10
o default to 50 SARS  drc 8/9/10
o fix sanity checking code drc 8/17/10
o send all events at once for generic run drc 8/17/10
o monitor responses                            04/01/11
o fix file names                               04/04/11
o fix typo                                     04/04/11B
o array initialization                         04/04/11D
o add status check and summary section         05/06/11
o wait for status file to appear               05/10/11
o fix validity check                           05/11/11
o catch unrecognised rejects                   05/16/11
o update reject and decline handling           05/17/11
o delete executed SNAS command files (.qrs .qel)       05/26/11
o fix id reference                             06/09/11
o catch EV list error                          07/26/11
o allow directory option (for .ssr and .sdr)   08/23/11
o ensure Deletes sent first (multifile)        12/14/11
o Add to documentation                         07/10/12
o fix reporting error                          06/23/15
o recognized more statuses                     07/06/15
o remove reliance on rowcount after DB update  07/15/15
o do update_pass_status only for NCC mode g or i
                                               07/29/15
o increased real-time default SARS to 100 - jrc
                                               09/10/15

 
Modules
       
archive_util
configure_util
os
spss_sys_util
spst_getopt
stpydb
sys
tdrs_util
time
time_util

 
Functions
       
check_archive(tempfile, verbose)
Confirms that the file is in the archive area
check_status(ssrfil, logfile, verbose)
Checks the SNAS status response to the ingest
evlistdata(relfile, verbose)
Extracts data from the given Report file for the Event Summary Listing
 
Returns    list of events using event class from tdrs_util
get_comid(comfil)
Extracts the id from the first line of the command file
Returns a string
get_repid(repfil)
Extracts the id from the first line of the report file
Returns a string
get_report_files(comfiles, repsenttime, verbose)
For the given command files checks to see if the requested report files
have appeared.
    comfiles        - list of command files sent to SNAS (Import) requesting reports
    repsenttime     - time the command files were sent to SNAS
    verbose         - flag indicating if informational messages should be provided
 
Returns list of report files found in SNAS_EXPORT that match request
get_ssr_data(ssrfil, verbose)
Gets the count of SARs and lists of Ref IDs for the RRs and SDRs
within the SSR file.  Also returns a list of strings useful for matching in the
SNAS status files (.sts .sts1 etc.)
 
Returns    list of SAR starttimes, list of RR ref ids, list of SDR ref ids,
            list of reference field from all lines
loggit(logfile, msg)
Enters the message into the logfile with timestamp
make_report_request_files(reps, idrep, st, en)
Make report request command files
reps            - list of tpyes of reports desired by file extension
                        (allowed values  - qrs qer qel)
idrep           - an id to allow different requests and reports to be
                        differentiated
st              - start time of report request range string 'yydddHHMMSS'
en              - end time of report request range string 'yydddHHMMSS'
monitor_ingest_success(tempfiles, timeout, verbose)
Monitors the transition of the tempfiles from the SNAS_IMPORT
directory to the archive area.  The action needs to succeed before the
timeout clock ends.   The timeout value is in seconds.
reqsumdata(rrsfile, senttime, verbose)
Extracts data from the given Report file for the Schedule Request Summary
 
Returns     list of Deleted events,
            list of start times of Granted add events
            list of ref ids of Granted Replace events
            list of start times of NCCQueued add events
            list of ref ids of NCCQUeued Replace events
            list of declined events identifier (start time for Add and refid for Replace)
            list of rejected events identifier (start time for Add and refid for Replace)
run(*args)
Send the SARS to UPS given a mission schedule run name and
type for (I)nitial SARs or (R)eplace SARs
 
Usage:
do send_sars_to_ups schedname  [-file=<ssrfile>] [-batch_size=n] [-verbose]
                            [-log=<logfile>]  [-nolog] [-directory=<directory>]
                            [-interactive]
 
    where
     schedname must be a Mission Schedule run name (e.g., SAdddJnn_F)
     <ssrfile>    is a specific SSR file to be sent to the UPS
         (e.g. as part of the MAT LEI process)
     <directory>  is a specfic directory containing an SDR and/or SSR file
                    both of which need to be sent to SNAS e.g. as
                    part of the AVTUT process.
     batch_size   specifies the number of events to send at a time.
                  A value of 0 (zero) means send all the deletes at
                  once.  Defaults: 100 for real-time; a single large batch
                  for generics and initial
     verbose      produces informational messages
     logfile      Creates specified logfile for send and response information
                    (only produces output in auto mode).  If no -log
                    option specified a default logfile is made.
     nolog        No log file is produced
     noauto       Sends the SSR file to NCC but does not monitor the SNAS statuses
                    (i.e. the old fashoned way)
     interactive  Queries the user at every file submission for confirmation
                    If user enter a <return> the file is submitted.
                    If the user enters    'skip'   then that file is not sent.
 
    The -type option (implicit in the schedname data) indicates the
        type of SAR request (e.g., i (initial), or r (replace).
update_pass_status(schedname, logfile=<open file '<stdout>', mode 'w' at 0x47078>)

 
Data
        ADD_PASS_ARCHIVE_DIR = '/data/scheduling/spss_flight_data/pass/archive/add'
INGEST_TIMEOUT = 120
PASS_ARCHIVE_DIR = '/data/scheduling/spss_flight_data/pass/archive'
REPORT_EXT_DICT = {'qed': 'red', 'qel': 'rel', 'qer': 'rer', 'qrs': 'rrs'}
REPORT_TIMEOUT = 180
SNAS_ARCHIVE = '/data/scheduling/spss_flight_data/planinst/snas/archive'
SNAS_EXPORT = '/data/scheduling/spss_flight_data/planinst/snas/export'
SNAS_IMPORT = '/data/scheduling/spss_flight_data/planinst/snas/import'
__version__ = '15.07.29'