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

Поисковые слова: transit
Python: module met_util
 
 
met_util (version 15.04.29)
index
met_util.py

PURPOSE --
 
Collection of routines for metrics related actions
 
DEVELOPER --
 
Alan Patterson
 
MODIFICATION HISTORY --
 
Initial implementation                     02/27/2002  APP.
Comments from Python review and updated
ftp information from CISD                  05/03/2002  APP.
add code for efficiency metrics            08/01/2002  DC.
include both 50 line Excel and text file   08/19/2002  APP.
output.
Restore email to Ron and Mike for TofO     08/26/2002  APP.
weeks
Added datavolume_by_week distribution      12/02/2002  APP.
routine
Made distribution file lists generally     05/06/2003  APP.
accessible
Add TDRS & PASS process metric data        07/16/2003  APP.
Update datavolume routine                  08/22/2003  APP.
Changes from python review                 11/05/2003  APP
Prevent distribution if on OBS             04/19/2005  APP
Turn off the new spstftp option to
  transfer to a temporary name             04/01/2014  DRC
Replace Alan's email with Joceyln's        04/29/2015  DRC

 
Modules
       
errno
file_util
os
spss_sys_util
string
time_util
transfer_util

 
Functions
       
add_to_distrib_list(nom_week, ms_name, metric, outfile)
Appends file data to the list of already distributed products
for the nominal week
distrib_met(metric_name)
Distributes the metric representation files for the metric
'metric_name'.
distribute_metrics(metric_group, id)
Causes distribution of the specified metric group indicated by the
particular id.
make_xfer_list(xfer_file_list, input_dir)
Creates a list of 3 element tuples from the defined transfer list data
The input xfer_file_list is a list of 2 element tuples containing a
filename and transfer type
The output is a list with each element being a 3 element tuple:
    1. file path of metric representation to be sent
    2. name file will have in the external metric area
    3. file transfer type ('a' or 'b') i.e. Ascii or Binary
send_email(filelist, subdir, mstring, email_addr, fail_flag)
Sends alert email to list email_addr for files listed in xferd_files
and intended for the subdir subdirectory.
send_metric_rep(filename, subdir, outfile, xfer_type)
Sends file <filename> to metrics subdirectory <subdir>
where filename is the local file to be transferred
      subdir   is the subdirectory on the external metrics PC
             (Example of subdir is : DATAVOL_out)
      outfile  is the output file name

 
Data
        DATAVOLUME_BY_WEEK_LIST = [('datavolume_by_week.txt', 'a'), ('datavolume_by_week.xls', 'b'), ('datavolume_by_week.ps', 'a')]
DATAVOLUME_LIST = [('datavolume.txt', 'a'), ('datavolume.xls', 'b'), ('datavolume.ps', 'a')]
DATAVOL_EMAIL_ADDR = ['downes@stsci.edu']
EFFICIENCY_LIST = [('efficiency_chart.txt', 'a'), ('efficiency_chart.xls', 'b'), ('efficiency_chart.ps', 'a')]
INTERNAL_EMAIL_ADDR = ['chance@stsci.edu', 'jferrara@stsci.edu']
METRIC_DICT = {'datavolume': {'dst': 'DATAVOL_out', 'list': [('datavolume.txt', 'a'), ('datavolume.xls', 'b'), ('datavolume.ps', 'a')], 'mail_string': 'datavolume', 'src': '/data/scheduling/spss_flight_data/planinst/metrics/tmp'}, 'datavolume_by_week': {'dst': 'DATAVOL_out', 'list': [('datavolume_by_week.txt', 'a'), ('datavolume_by_week.xls', 'b'), ('datavolume_by_week.ps', 'a')], 'mail_string': 'datavolume by week', 'src': '/data/scheduling/spss_flight_data/planinst/metrics/tmp'}, 'efficiency': {'dst': 'EFF_out', 'list': [('efficiency_chart.txt', 'a'), ('efficiency_chart.xls', 'b'), ('efficiency_chart.ps', 'a')], 'mail_string': 'scheduling efficiency', 'src': '/data/scheduling/spss_flight_data/planinst/metrics/tmp'}, 'tdrs_pass': {'dst': 'TDRS_PASS_out', 'list': [('tdrs_data.txt', 'a'), ('tdrs_data.xls', 'b'), ('dur_tdrs_ssaf.ps', 'a'), ('dur_tdrs_ssar.ps', 'a'), ('ms_process_stats.ps', 'a'), ('num_xmtr_on.ps', 'a')], 'mail_string': 'TDRS & PASS process data', 'src': '/data/scheduling/spss_flight_data/planinst/metrics/tmp'}}
METRIC_DIR = '/data/scheduling/spss_flight_data//planinst/metrics/'
METRIC_GROUPS = {'distrib_prod': ['efficiency'], 'final_ms': ['datavolume', 'datavolume_by_week', 'tdrs_pass']}
METRIC_TMP = '/data/scheduling/spss_flight_data/planinst/metrics/tmp'
SENT_FILE = '/data/scheduling/spss_flight_data/planinst/metrics/sent_files.list'
SUBDIRLIST = ['DATAVOL_out', 'EFF_out', 'TDRS_PASS_out']
TDRS_PASS_LIST = [('tdrs_data.txt', 'a'), ('tdrs_data.xls', 'b'), ('dur_tdrs_ssaf.ps', 'a'), ('dur_tdrs_ssar.ps', 'a'), ('ms_process_stats.ps', 'a'), ('num_xmtr_on.ps', 'a')]
__author__ = 'Alan Patterson'
__version__ = '15.04.29'

 
Author
        Alan Patterson