Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
MDANSE
Commits
945f40eb
Commit
945f40eb
authored
Jul 27, 2018
by
eric pellegrini
Browse files
The time step is now part of the settings for DCD based converters
parent
13d3d99a
Changes
1
Hide whitespace changes
Inline
Side-by-side
MDANSE/Framework/Jobs/DCDConverter.py
View file @
945f40eb
...
@@ -229,7 +229,8 @@ class DCDFile(FortranBinaryFile, dict):
...
@@ -229,7 +229,8 @@ class DCDFile(FortranBinaryFile, dict):
# This file was generated by CHARMM, or by NAMD > 2.5, with the angle
# This file was generated by CHARMM, or by NAMD > 2.5, with the angle
# cosines of the periodic cell angles written to the DCD file.
# cosines of the periodic cell angles written to the DCD file.
# This formulation improves rounding behavior for orthogonal cells
# This formulation improves rounding behavior for orthogonal cells
# so that the angles end up at precisely 90 degrees, unlike acos().
# so that the angles end up at precisely 90 degrees, unlike acos().
# See https://github.com/MDAnalysis/mdanalysis/wiki/FileFormats for info
if
numpy
.
all
(
abs
(
unitCell
[
3
:])
<=
1
):
if
numpy
.
all
(
abs
(
unitCell
[
3
:])
<=
1
):
unitCell
[
3
:]
=
PI_2
-
numpy
.
arcsin
(
unitCell
[
3
:])
unitCell
[
3
:]
=
PI_2
-
numpy
.
arcsin
(
unitCell
[
3
:])
else
:
else
:
...
@@ -280,8 +281,9 @@ class DCDConverter(Converter):
...
@@ -280,8 +281,9 @@ class DCDConverter(Converter):
settings
=
collections
.
OrderedDict
()
settings
=
collections
.
OrderedDict
()
settings
[
'pdb_file'
]
=
(
'input_file'
,{
'default'
:
os
.
path
.
join
(
'..'
,
'..'
,
'..'
,
'Data'
,
'Trajectories'
,
'CHARMM'
,
'2vb1.pdb'
)})
settings
[
'pdb_file'
]
=
(
'input_file'
,{
'default'
:
os
.
path
.
join
(
'..'
,
'..'
,
'..'
,
'Data'
,
'Trajectories'
,
'CHARMM'
,
'2vb1.pdb'
)})
settings
[
'dcd_file'
]
=
(
'input_file'
,{
'default'
:
os
.
path
.
join
(
'..'
,
'..'
,
'..'
,
'Data'
,
'Trajectories'
,
'CHARMM'
,
'2vb1.dcd'
)})
settings
[
'dcd_file'
]
=
(
'input_file'
,{
'default'
:
os
.
path
.
join
(
'..'
,
'..'
,
'..'
,
'Data'
,
'Trajectories'
,
'CHARMM'
,
'2vb1.dcd'
)})
settings
[
'
output_files'
]
=
(
'output_files'
,
{
'formats'
:[
"netcdf"
]})
settings
[
'
time_step'
]
=
(
'float'
,
{
'default'
:
1.0
,
'label'
:
"Time step (ps)"
})
settings
[
'fold'
]
=
(
'boolean'
,
{
'default'
:
False
,
'label'
:
"Fold coordinates in to box"
})
settings
[
'fold'
]
=
(
'boolean'
,
{
'default'
:
False
,
'label'
:
"Fold coordinates in to box"
})
settings
[
'output_files'
]
=
(
'output_files'
,
{
'formats'
:[
"netcdf"
]})
def
initialize
(
self
):
def
initialize
(
self
):
"""
"""
...
@@ -343,7 +345,7 @@ class DCDConverter(Converter):
...
@@ -343,7 +345,7 @@ class DCDConverter(Converter):
self
.
_universe
.
foldCoordinatesIntoBox
()
self
.
_universe
.
foldCoordinatesIntoBox
()
# The current time.
# The current time.
t
=
(
index
+
1
)
*
self
.
configuration
[
"
dcd_file"
][
"instance"
][
'time_step'
]
t
=
(
index
+
1
)
*
self
.
configuration
[
"
time_step"
][
"value"
]
# Store a snapshot of the current configuration in the output trajectory.
# Store a snapshot of the current configuration in the output trajectory.
self
.
_snapshot
(
data
=
{
'time'
:
t
})
self
.
_snapshot
(
data
=
{
'time'
:
t
})
...
...
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