Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92694587
gsteps
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 22, 20:41
Size
1 KB
Mime Type
text/x-python
Expires
Sun, Nov 24, 20:41 (2 d)
Engine
blob
Format
Raw Data
Handle
22488886
Attached To
rGTOOLS Gtools
gsteps
View Options
#!/usr/bin/env python
'''
Extract and plot info contained in cpu.txt files
Yves Revaz
jeu avr 6 15:58:19 CEST 2006
'''
import
os
,
sys
,
string
from
optparse
import
OptionParser
from
Gtools
import
*
from
Gtools
import
io
from
optparse
import
OptionParser
import
Ptools
as
pt
def
parse_options
():
usage
=
"usage: %prog [options] file"
parser
=
OptionParser
(
usage
=
usage
)
parser
=
pt
.
add_postscript_options
(
parser
)
parser
=
pt
.
add_limits_options
(
parser
)
parser
=
pt
.
add_log_options
(
parser
)
parser
=
pt
.
add_cmd_options
(
parser
)
parser
.
add_option
(
"-t"
,
action
=
"store"
,
dest
=
"time"
,
type
=
"string"
,
default
=
'hour'
,
help
=
"time : day, hour, minute, second"
,
metavar
=
" TYPE"
)
(
options
,
args
)
=
parser
.
parse_args
()
if
len
(
args
)
==
0
:
print
"you must specify a filename"
sys
.
exit
(
0
)
files
=
args
return
files
,
options
#######################################
# MakePlot
#######################################
def
MakePlot
(
dirs
,
opt
):
# some inits
palette
=
pt
.
GetPalette
()
colors
=
pt
.
SetColorsForFiles
(
files
,
palette
)
labels
=
[]
# read files
for
file
in
files
:
Step
,
a
,
da
=
io
.
read_info
(
file
)
pt
.
plot
(
a
,
da
)
pt
.
xlabel
(
'Time'
)
pt
.
ylabel
(
'Step'
)
if
__name__
==
'__main__'
:
files
,
opt
=
parse_options
()
pt
.
InitPlot
(
files
,
opt
)
#pt.figure(figsize=(8*2,6*2))
#pt.figure(dpi=10)
pt
.
pcolors
#fig = pt.gcf()
#fig.subplots_adjust(left=0.1)
#fig.subplots_adjust(right=1)
#fig.subplots_adjust(bottom=0.12)
#fig.subplots_adjust(top=0.95)
#fig.subplots_adjust(wspace=0.25)
#fig.subplots_adjust(hspace=0.02)
MakePlot
(
files
,
opt
)
pt
.
EndPlot
(
files
,
opt
)
Event Timeline
Log In to Comment