Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
7564d1dc
Commit
7564d1dc
authored
2 months ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Write run-time configuration options if set to non-default values
parent
58bf1660
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scripts/model_maker.py
+16
-0
16 additions, 0 deletions
src/scripts/model_maker.py
with
16 additions
and
0 deletions
src/scripts/model_maker.py
+
16
−
0
View file @
7564d1dc
...
@@ -328,6 +328,14 @@ def load_model(model_file):
...
@@ -328,6 +328,14 @@ def load_model(model_file):
for
j
in
range
(
expected_radii
):
for
j
in
range
(
expected_radii
):
sconf
[
'
rcf
'
][
i
][
j
]
=
float
(
model
[
'
particle_settings
'
][
'
rad_frac
'
][
i
][
j
])
sconf
[
'
rcf
'
][
i
][
j
]
=
float
(
model
[
'
particle_settings
'
][
'
rad_frac
'
][
i
][
j
])
# Create the gconf dict
# Create the gconf dict
try
:
use_refinement
=
False
if
model
[
'
system_settings
'
][
'
refinement
'
]
==
"
0
"
else
True
except
KeyError
:
use_refinement
=
False
try
:
dyn_orders
=
False
if
model
[
'
radiation_settings
'
][
'
dyn_orders
'
]
==
"
0
"
else
True
except
KeyError
:
use_refinement
=
False
str_polar
=
model
[
'
radiation_settings
'
][
'
polarization
'
]
str_polar
=
model
[
'
radiation_settings
'
][
'
polarization
'
]
if
(
str_polar
not
in
[
"
LINEAR
"
,
"
CIRCULAR
"
]):
if
(
str_polar
not
in
[
"
LINEAR
"
,
"
CIRCULAR
"
]):
print
(
"
ERROR: %s is not a recognized polarization state.
"
%
str_polar
)
print
(
"
ERROR: %s is not a recognized polarization state.
"
%
str_polar
)
...
@@ -338,6 +346,8 @@ def load_model(model_file):
...
@@ -338,6 +346,8 @@ def load_model(model_file):
model
[
'
input_settings
'
][
'
geometry_file
'
]
model
[
'
input_settings
'
][
'
geometry_file
'
]
)
)
}
}
gconf
[
'
use_refinement
'
]
=
use_refinement
gconf
[
'
dyn_orders
'
]
=
dyn_orders
gconf
[
'
nsph
'
]
=
sconf
[
'
nsph
'
]
gconf
[
'
nsph
'
]
=
sconf
[
'
nsph
'
]
gconf
[
'
application
'
]
=
model
[
'
particle_settings
'
][
'
application
'
]
gconf
[
'
application
'
]
=
model
[
'
particle_settings
'
][
'
application
'
]
gconf
[
'
li
'
]
=
int
(
model
[
'
geometry_settings
'
][
'
li
'
])
gconf
[
'
li
'
]
=
int
(
model
[
'
geometry_settings
'
][
'
li
'
])
...
@@ -865,6 +875,12 @@ def write_legacy_gconf(conf):
...
@@ -865,6 +875,12 @@ def write_legacy_gconf(conf):
output
.
write
(
str_line
)
output
.
write
(
str_line
)
str_line
=
"
{0:d}
\n
0
\n
"
.
format
(
conf
[
'
jwtm
'
])
str_line
=
"
{0:d}
\n
0
\n
"
.
format
(
conf
[
'
jwtm
'
])
output
.
write
(
str_line
)
output
.
write
(
str_line
)
if
(
gconf
[
'
use_refinement
'
]):
str_line
=
"
USE_REFINEMENT=1
\n
"
output
.
write
(
str_line
)
if
(
not
gconf
[
'
dyn_orders
'
]):
str_line
=
"
USE_DYN_ORDER=0
\n
"
output
.
write
(
str_line
)
output
.
close
()
output
.
close
()
return
result
return
result
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment