stf

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: LGPL-2.1 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TrajUnIniRead       = "Traj object uninitialized to read"
	TrajUnIniWrite      = "Traj object uninitialized to read"
	ReadError           = "Error reading frame"
	UnableToOpen        = "Unable to open file"
	SecurityCheckFailed = "Failed Security Check"
	NilCoordinates      = "Given nil coordinates"
	WrongFormat         = "Wrong format in the STF file or frame"
	NotEnoughSpace      = "Not enough space in passed blocks"
	EOF                 = "EOF"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error is the general structure for DCD trajectory errors. It fullfills chem.Error and chem.TrajError

func (Error) Critical

func (err Error) Critical() bool

Critical returns true if the error is critical, false otherwise

func (Error) Decorate

func (E Error) Decorate(deco string) []string

Decorate Adds new information to the error

func (Error) Error

func (err Error) Error() string

func (Error) FileName

func (err Error) FileName() string

Filename returns the file to which the failing trajectory was associated

func (Error) Format

func (err Error) Format() string

Format returns the format of the file (always "dcd") associated to the error

type StfR

type StfR struct {
	// contains filtered or unexported fields
}

Read!

func New

func New(name string) (*StfR, map[string]string, error)

New opens a STF trajectory for reading, and returns a pointer to the handle, a map with the metadata (or nil, if no metadata is found) and error or nil.

func (*StfR) Close

func (S *StfR) Close()

Close closes the object, and marks it as unreadable

func (*StfR) Len

func (S *StfR) Len() int

Len returns the number of atoms in each frame of the trajectory.

func (*StfR) Next

func (S *StfR) Next(c *v3.Matrix, box ...[]float64) error

Next puts in the given matrix (c) the coordinates for the next frame of the trajectory and, if given, and the information is present, puts the box vector information in box Returns error if the operation is not successful. If the error is EOF, the end of the trajectory has been reached, not an actual error.

func (*StfR) NextConc

func (D *StfR) NextConc(frames []*v3.Matrix) ([]chan *v3.Matrix, error)

NextConc takes a slice of bools and reads as many frames as elements the list has form the trajectory. The frames are discarted if the corresponding elemetn of the slice is false. The function returns a slice of channels through each of each of which a *matrix.DenseMatrix will be transmited

func (*StfR) Readable

func (S *StfR) Readable() bool

Readabe returns true if the handle is readable (if it is possible to call Next on it)

type StfW

type StfW struct {
	// contains filtered or unexported fields
}

Write!

func NewWriter

func NewWriter(name string, natoms int, header map[string]string, compressionLevel ...int) (*StfW, error)

Only the first map will be read!

func (*StfW) Close

func (S *StfW) Close()

func (*StfW) Len

func (S *StfW) Len() int

func (*StfW) WNext

func (S *StfW) WNext(coord *v3.Matrix, box ...[]float64) error

func (*StfW) WNextDense

func (S *StfW) WNextDense(dcoord *mat.Dense) error

compatibility with Gonum

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL