espressomd.io.writer package¶
Submodules¶
espressomd.io.writer.h5md module¶
- class espressomd.io.writer.h5md.H5md(**kwargs)[source]¶
Bases:
ScriptInterfaceHelper
H5md file object.
Note
Bonds will be written to the file if they exist. The pypresso script will be written in the metadata.
- Parameters:
file_path (
str
) – Path to the trajectory file, or an existing file to append data to (it must have the same specifications).unit_system (
UnitSystem
, optional) – Physical units for the data.fields (
set
orstr
, optional) – List of fields to write to the trajectory file. Defaults to'all'
. Seevalid_fields()
for the list of valid fields. This list defines the H5MD specifications. If the file infile_path
already exists but has different specifications, an exception is raised.
- get_params()¶
Get the parameters from the script interface.
- valid_fields()¶
Get the list of valid fields.
- write()¶
Call the H5md write method.
- flush()¶
Call the H5md flush method.
- close()¶
Close the H5md file.
- file_path¶
Path to the trajectory file.
- Type:
str
- script_path¶
Path to the pypresso script, or empty string for interactive sessions.
- Type:
str
- fields¶
List of fields to write to the trajectory file.
- Type:
list
- mass_unit¶
- Type:
str
- length_unit¶
- Type:
str
- time_unit¶
- Type:
str
- force_unit¶
- Type:
str
- velocity_unit¶
- Type:
str
- charge_unit¶
- Type:
str
- class espressomd.io.writer.h5md.UnitSystem(**kwargs)[source]¶
Bases:
object
Data class for writing H5MD trajectories with physical units. There are four settable units: ‘mass’, ‘length’, ‘time’, ‘charge’. Units should be written as strings following the specifications defined here, e.g.
UnitSystem(time='ps', mass='u', length='nm', charge='e')
.
espressomd.io.writer.vtf module¶
- espressomd.io.writer.vtf.vtf_pid_map(system, types='all')[source]¶
Generates a VTF particle index map to ESPResSo
id
. This fills the gap for particle ID’s as required by VMD.- Parameters:
system (
espressomd.system.System
)types (
str
) – Specifies the particle types. The id mapping depends on which particles are going to be printed. This should be the same as the one used inwritevsf()
andwritevcf()
.
- Returns:
A dictionary where the values are the VTF indices and the keys are the ESPresSo particle
id
.- Return type:
dict
- espressomd.io.writer.vtf.writevcf(system, fp, types='all')[source]¶
writes a VCF (VTF Coordinate Format) to a file. This can be used to write a timestep to a VTF file.
- Parameters:
system (
espressomd.system.System
)types (
str
) – Specifies the particle types. The string ‘all’ will write all particlesfp (file) – File pointer to write to.
- espressomd.io.writer.vtf.writevsf(system, fp, types='all')[source]¶
writes a VST (VTF Structure Format) to a file. This can be used to write the header of a VTF file.
- Parameters:
system (
espressomd.system.System
)types (
str
) – Specifies the particle types. The string ‘all’ will write all particlesfp (file) – File pointer to write to.