1
1
#!/usr/bin/env python3
2
+ # coding=UTF-8
3
+ #
4
+ # BSD 2-Clause License
5
+ #
6
+ # Copyright (c) 2019, Jason Leake
7
+ # All rights reserved.
8
+ #
9
+ # Redistribution and use in source and binary forms, with or without
10
+ # modification, are permitted provided that the following conditions are met:
11
+ #
12
+ # 1. Redistributions of source code must retain the above copyright notice, this
13
+ # list of conditions and the following disclaimer.
14
+ #
15
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
16
+ # this list of conditions and the following disclaimer in the documentation
17
+ # and/or other materials provided with the distribution.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+ #
2
30
3
31
#
4
32
# Process one CWA file. The file is specified on the command line:
@@ -60,27 +88,13 @@ def process(file, configFile):
60
88
for splitFile in splitFiles :
61
89
datafile , nonBaselinedFile , baselinedFile = ax3_stats .stats (splitFile )
62
90
63
- # Get the file titles from ax3_plot_minutes.py directly, later
64
- plotType = [ "mean_x" ,
65
- "peak_to_peak_x" ,
66
- "rms_x" ,
67
- "std_dev_x" ,
68
- "mean_y" ,
69
- "peak_to_peak_y" ,
70
- "rms_y" ,
71
- "std_dev_y" ,
72
- "mean_z" ,
73
- "peak_to_peak_z" ,
74
- "rms_z" ,
75
- "std_dev_z" ,
76
- "mean_total" ,
77
- "peak_to_peak_total" ,
78
- "rms_total" ,
79
- "std_dev_total" ]
80
-
81
- for thisPlot in plotType :
91
+ plotMinutes = ax3_plot_minutes .PlotMinutes ()
92
+ for thisPlot in plotMinutes .fileTitles ():
93
+ if len (thisPlot ) == 0 :
94
+ continue
95
+
82
96
if getb (config , thisPlot , "ax3_plot_minutes" ):
83
- plotMinutes = ax3_plot_minutes . PlotMinutes ()
97
+
84
98
85
99
bcontrolfile = get (config , thisPlot , "bcontrolfile" )
86
100
nbcontrolfile = get (config , thisPlot , "nbcontrolfile" )
@@ -116,7 +130,9 @@ def main():
116
130
parser = argparse .ArgumentParser (description =
117
131
"Processing chain for ax3_... scripts" )
118
132
parser .add_argument ("filename" , help = "Input filename" )
119
- parser .add_argument ("--controlfile" , nargs = "?" , help = "INI file to control plotting" , default = "crunch_default.ini" )
133
+ parser .add_argument ("--controlfile" , nargs = "?" ,
134
+ help = "INI file to control plotting" ,
135
+ default = "crunch_default.ini" )
120
136
args = parser .parse_args ()
121
137
filePath = args .filename
122
138
controlFile = args .controlfile
@@ -131,7 +147,7 @@ def main():
131
147
elapsed = time .time ();
132
148
process (filePath , controlFile )
133
149
elapsed = time .time () - elapsed
134
- print (f"Elapsed time { elapsed } seconds" )
150
+ print (f"Elapsed time { int ( round ( elapsed )) } seconds" )
135
151
136
152
if __name__ == "__main__" :
137
153
main ()
0 commit comments