libmbd

package
v0.0.0-...-3d371da Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2015 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package libmbd contains data structures and helper routines for extracting reaction data from binary mcell reaction data output files

Index

Constants

View Source
const (
	Step uint16 = 1 << iota
	TimeListType
	IterationListType
)

enumeration describing the output type of the included data

View Source
const (
	API1 = "MCELL_BINARY_API_1"
	API2 = "MCELL_BINARY_API_2"
)

list of currently know API versions

Variables

This section is empty.

Functions

This section is empty.

Types

type API1Data

type API1Data struct {
	Offset       uint64 // offset into data buffer
	BlockEntries []BlockEntry
}

API1Data are data items specific to API version 1 of the mcell binary output format.

type API2Data

type API2Data struct {
	OutputBufSize uint64
	TotalNumCols  uint64
	BlockInfo     []BlockData
}

API2Data are data items specific to API version 1 of the mcell binary output format.

type BlockData

type BlockData struct {
	Name      string
	NumCols   uint64
	DataTypes []uint16
	Offset    uint64
}

BlockData is used for API version 2. It stores metadata for a given data block such as the data name, number of data columns, the type of data stored (int/double), and the internal offset into the buffer at which the data can be found.

type BlockEntry

type BlockEntry struct {
	Type  byte
	Start uint64
	End   uint64
}

BlockEntry is used for API version 1. It stores the beginning and end of each data block within the data buffer.

type CountData

type CountData struct {
	Col       [][]float64
	DataTypes []uint16
}

CountData is a container holding the data corresponding to a reaction data output block consisting of a number of columns

type MCellData

type MCellData struct {
	Buffer         util.ReadBuf
	OutputListType uint16
	BlockSize      uint64
	StepSize       float64
	TimeList       []float64
	NumBlocks      uint64
	BlockNames     []string
	BlockNameMap   map[string]uint64
	API            string
	API1Data
	API2Data
}

MCellData tracks the data contained in the binary mcell file as well as relevant metadata to retrieve specific data items. NOTE: Depending on the API version of the binary output data not all fields are defined

func (*MCellData) BlockDataByID

func (d *MCellData) BlockDataByID(id uint64) (*CountData, error)

BlockDataByID returns the data stored in the data block of the given ID as a CountData struct NOTE: This is the only method of MCellData which is API sensitive

func (*MCellData) BlockDataByName

func (d *MCellData) BlockDataByName(name string) (*CountData, error)

BlockDataByName returns the data stored in the data block of the given name as a CountData struct

func (*MCellData) BlockDataByRegex

func (d *MCellData) BlockDataByRegex(selection string) (map[string]*CountData, error)

BlockDataByRegex returns a map with all datasets whose name matched the supplied regex. The map keys are the dataset names, the values are the corresponding count data items.

func (*MCellData) BlockLen

func (d *MCellData) BlockLen() uint64

BlockLen returns the number of output iterations per datablock

func (*MCellData) DataNames

func (d *MCellData) DataNames() []string

DataNames returns the list of available blocknames

func (*MCellData) IDtoBlockName

func (d *MCellData) IDtoBlockName(id uint64) (string, error)

IDtoBlockName returns the blockname corresponding to the given id

func (*MCellData) NumDataBlocks

func (d *MCellData) NumDataBlocks() uint64

NumDataBlocks returns the number of available datablocks

func (*MCellData) OutputStepLen

func (d *MCellData) OutputStepLen() float64

OutputStepLen returns the output step length. NOTE: The returns value is only meaningful is OutputListType == Step, otherwise this function returns 0

func (*MCellData) OutputTimes

func (d *MCellData) OutputTimes() []float64

OutputTimes returns a slice with the output times corresponding to the column data (either computed from STEP or via ITERATION_LIST/TIME_LIST) NOTE: In the case of STEP we cache the timelist after the first request

func (*MCellData) OutputType

func (d *MCellData) OutputType() uint16

OutputType returns the output type (STEP, ITERATION_LIST/TIME_LIST)

Jump to

Keyboard shortcuts

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