Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102362500
compute_Yields.py
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
Wed, Feb 19, 22:22
Size
906 B
Mime Type
text/x-python
Expires
Fri, Feb 21, 22:22 (2 d)
Engine
blob
Format
Raw Data
Handle
24338844
Attached To
rGEAR Gear
compute_Yields.py
View Options
#!/usr/bin/env python
import
libcris
import
sys
,
os
from
numpy
import
*
Ms
=
libcris
.
Mcode
.
keys
()
Zs
=
libcris
.
Zcode
.
keys
()
Ms
.
sort
()
Zs
.
sort
()
# first, get elts
filename
=
"Net/yields_net_
%s
_20130626_134213.txt"
%
(
libcris
.
Mcode
[
Ms
[
0
]]
+
libcris
.
Zcode
[
Zs
[
0
]])
Elts
,
Masses
=
libcris
.
ReadTable
(
filename
)
for
Z
in
Zs
:
outputname
=
"cristallo-Yields-
%6.4f
.txt"
%
Z
# open file and write header
f
=
open
(
outputname
,
'w'
)
f
.
write
(
"# M"
)
for
elt
in
Elts
:
f
.
write
(
"
%14s
"
%
elt
)
f
.
write
(
"
\n
"
)
for
M
in
Ms
:
if
M
==
3.0
and
Z
<=
0.0003
:
# avoid missing files
Z
=
0.0010
filename
=
"Net/yields_net_
%s
_20130626_134213.txt"
%
(
libcris
.
Mcode
[
M
]
+
libcris
.
Zcode
[
Z
])
Elts
,
Masses
=
libcris
.
ReadTable
(
filename
)
# write yields
f
.
write
(
"
%5.2f
"
%
M
)
for
i
,
elt
in
enumerate
(
Elts
):
f
.
write
(
"
%14.7e
"
%
Masses
[
i
])
f
.
write
(
"
\n
"
)
f
.
close
()
Event Timeline
Log In to Comment