Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93792136
pychem_read
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
Sun, Dec 1, 13:18
Size
2 KB
Mime Type
text/x-python
Expires
Tue, Dec 3, 13:18 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22705542
Attached To
rGEAR Gear
pychem_read
View Options
#!/usr/bin/env python
import
Ptools
as
pt
from
optparse
import
OptionParser
from
pNbody
import
*
from
pNbody
import
units
import
string
from
scipy
import
optimize
from
PyChem
import
chemistry
UnitLength_in_cm
=
3.085e+21
UnitMass_in_g
=
1.989e+43
UnitVelocity_in_cm_per_s
=
20725573.785998672
UnitTime_in_s
=
148849920000000.0
def
parse_options
():
usage
=
"usage: %prog [options] file"
parser
=
OptionParser
(
usage
=
usage
)
parser
=
pt
.
add_postscript_options
(
parser
)
parser
=
pt
.
add_ftype_options
(
parser
)
parser
=
pt
.
add_reduc_options
(
parser
)
parser
=
pt
.
add_center_options
(
parser
)
parser
=
pt
.
add_select_options
(
parser
)
parser
=
pt
.
add_cmd_options
(
parser
)
parser
=
pt
.
add_display_options
(
parser
)
parser
=
pt
.
add_info_options
(
parser
)
parser
=
pt
.
add_limits_options
(
parser
)
parser
=
pt
.
add_log_options
(
parser
)
parser
.
add_option
(
"--x"
,
action
=
"store"
,
dest
=
"x"
,
type
=
"string"
,
default
=
'r'
,
help
=
"x value to plot"
,
metavar
=
" STRING"
)
parser
.
add_option
(
"--y"
,
action
=
"store"
,
dest
=
"y"
,
type
=
"string"
,
default
=
'T'
,
help
=
"y value to plot"
,
metavar
=
" STRING"
)
parser
.
add_option
(
"--z"
,
action
=
"store"
,
dest
=
"z"
,
type
=
"string"
,
default
=
None
,
help
=
"z value to plot"
,
metavar
=
" STRING"
)
parser
.
add_option
(
"--legend"
,
action
=
"store_true"
,
dest
=
"legend"
,
default
=
False
,
help
=
"add a legend"
)
parser
.
add_option
(
"--NumberOfTables"
,
action
=
"store"
,
dest
=
"NumberOfTables"
,
type
=
"int"
,
default
=
1
,
help
=
"NumberOfTables"
,
metavar
=
" INT"
)
parser
.
add_option
(
"--DefaultTable"
,
action
=
"store"
,
dest
=
"DefaultTable"
,
type
=
"int"
,
default
=
0
,
help
=
"DefaultTable"
,
metavar
=
" INT"
)
(
options
,
args
)
=
parser
.
parse_args
()
pt
.
check_files_number
(
args
)
files
=
args
return
files
,
options
########################################################################
# MAIN
########################################################################
if
__name__
==
'__main__'
:
files
,
opt
=
parse_options
()
# read files
for
file
in
files
:
chemistry
.
SetVerbosityOn
()
chemistry
.
init_chimie
(
file
,
opt
.
NumberOfTables
,
opt
.
DefaultTable
)
#for tableid in range(opt.NumberOfTables):
# chemistry.info(tableid)
Event Timeline
Log In to Comment