Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
LAMBERT Jean-charles
uns_projects
Commits
ee258d5e
Commit
ee258d5e
authored
Jun 02, 2020
by
LAMBERT Jean-charles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add post_build_movie2.py
parent
7a4af7b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletion
+40
-1
py/unsiotools/simulations/c2dplot.py
py/unsiotools/simulations/c2dplot.py
+38
-0
setup.py
setup.py
+2
-1
No files found.
py/unsiotools/simulations/c2dplot.py
View file @
ee258d5e
...
...
@@ -787,6 +787,44 @@ class C2dplot:
#plt.contour(zd, origin='lower',cmap='winter',norm = matplotlib.colors.LogNorm(), extent=[view_xmin, view_xmax, view_ymin, view_ymax])
#plt.contour(zd,norm = matplotlib.colors.LogNorm(), extent=[view_xmin, view_xmax, view_ymin, view_ymax])
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
def
commandLinePbm2
():
dbname
=
None
import
argparse
# help
parser
=
argparse
.
ArgumentParser
(
description
=
"Build simulation movie after smart analysis"
,
formatter_class
=
argparse
.
ArgumentDefaultsHelpFormatter
)
# options
parser
.
add_argument
(
'simname'
,
help
=
'Simulation name'
)
parser
.
add_argument
(
'--dbname'
,
help
=
'UNS database file name'
,
default
=
dbname
)
parser
.
add_argument
(
'--verbose'
,
help
=
'verbose mode on'
,
dest
=
"verbose"
,
action
=
"store_true"
,
default
=
False
)
parser
.
add_argument
(
'--overwrite'
,
help
=
'overwrite file if exist'
,
dest
=
"overwrite"
,
action
=
"store_true"
,
default
=
False
)
parser
.
add_argument
(
'--ncores'
,
help
=
'#cores used, 0 means all'
,
default
=
4
,
type
=
int
)
#parser.add_argument('--no-verbose',help='verbose mode off', dest="verbose", action="store_false", default=True)
# parse
args
=
parser
.
parse_args
()
# start main funciton
processPbm2
(
args
)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
def
processPbm2
(
args
):
import
unsiotools.simulations.c2dplot
as
c2d
movie
=
c2d
.
C2dplot
(
verbose_debug
=
args
.
verbose
)
try
:
movie
.
buildMovie
(
args
.
simname
,
overwrite
=
args
.
overwrite
,
ncores
=
args
.
ncores
)
except
Exception
as
x
:
import
traceback
print
(
x
,
file
=
sys
.
stderr
)
traceback
.
print_exc
(
file
=
sys
.
stdout
)
except
KeyboardInterrupt
:
sys
.
exit
()
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# commandLine, parse the command line
def
commandLine
():
...
...
setup.py
View file @
ee258d5e
...
...
@@ -82,7 +82,7 @@ class build_py(_build_py, object):
#
MAJOR
=
'0'
MINOR
=
'0'
MICRO
=
'
7
'
MICRO
=
'
8
'
VERSION
=
'%s.%s.%s'
%
(
MAJOR
,
MINOR
,
MICRO
)
#
...
...
@@ -186,6 +186,7 @@ def setup_package():
"uns_inert.py = unsiotools.simulations.cinert:commandLine"
,
"uns_plot_inert.py = unsiotools.simulations.cplotinert:commandLine"
,
"post_build_movie.py = unsiotools.simulations.cmovie:commandLine"
,
"post_build_movie2.py = unsiotools.simulations.c2dplot:commandLinePbm2"
,
"process_analysis.py = unsiotools.simulations.cuns_analysis:commandLine"
,
"remove_sim_halo.py = unsiotools.simulations.creducesim:commandLine"
,
"ramses2gadget.py = unsiotools.simulations.cramses2gadget:commandLine"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment