Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F10881457
plotnanas
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
958 B
Subscribers
None
plotnanas
View Options
#! /usr/bin/env python
import
argparse
ap
=
argparse
.
ArgumentParser
()
ap
.
add_argument
(
"DATFILE"
,
metavar
=
"file"
,
default
=
"nanas.dat"
,
help
=
"release/count data file to read"
)
ap
.
add_argument
(
"OUTFILE"
,
nargs
=
"?"
,
metavar
=
"file"
,
default
=
None
,
help
=
"image file to write"
)
args
=
ap
.
parse_args
()
if
not
args
.
OUTFILE
:
import
os
args
.
OUTFILE
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
args
.
DATFILE
))[
0
]
+
".pdf"
import
datetime
import
numpy
as
np
import
matplotlib.pyplot
as
plt
# import matplotlib.dates as mdates
# import matplotlib.cbook as cbook
tags
,
dates
,
nanas
=
[],
[],
[]
with
open
(
args
.
DATFILE
)
as
f
:
for
line
in
f
:
items
=
line
.
split
()
tags
.
append
(
items
[
0
])
ts
=
float
(
items
[
1
]
.
replace
(
"-3600"
,
""
)
.
replace
(
"-7200"
,
""
))
dates
.
append
(
datetime
.
date
.
fromtimestamp
(
ts
))
nanas
.
append
(
int
(
items
[
2
]))
plt
.
plot
(
dates
,
nanas
)
plt
.
xlabel
(
"Year"
)
plt
.
ylabel
(
"# analyses"
)
plt
.
savefig
(
args
.
OUTFILE
)
# plt.show()
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Sat, May 3, 6:24 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4983012
Default Alt Text
plotnanas (958 B)
Attached To
rRIVETHG rivethg
Event Timeline
Log In to Comment