lib

package
v0.0.0-...-7eedc68 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

package lib contains various functions needed by guppy and mpi_guppy. The functions in this particular package mainly just utility functions that might be useful for other programs manually piping output from Guppy. Almost all of the heavy lifting is done by lib/'s subpackages.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the version of the software. This can potentially be used
	// to differentiate between breaking changes to the input/output format.
	Version            uint64 = 0x1
	RockstarFormatCode uint64 = 0xffffffff00000001

	SupportedCompressionMethods = []string{"LagrangianDelta"}
	SupportedIDOrders           = []string{"ZUnigridPlusOne"}
)

Functions

func CheckWriteConfig

func CheckWriteConfig(cfg *WriteConfig) error

func ExampleWriteConfig

func ExampleWriteConfig() string

func ExpandFileNames

func ExpandFileNames(cfg *WriteConfig) (
	snaps []int, inputs, outputs [][]string,
)

func GetSnapioHeader

func GetSnapioHeader(cfg *WriteConfig, file string) (snapio.Header, error)

func InputBuffers

func InputBuffers(hd snapio.Header, workers int) []*snapio.Buffer

func RandomFileName

func RandomFileName(files [][]string) string

func ReadAsBytes

func ReadAsBytes(f io.Reader, buf interface{}) error

func SystemByteOrder

func SystemByteOrder() binary.ByteOrder

func WriteAsBytes

func WriteAsBytes(f io.Writer, buf interface{}) error

Types

type OutputBuffer

type OutputBuffer struct {
	Buffer *compress.Buffer
	B      []byte
	Writer *compress.Writer
}

func OutputBuffers

func OutputBuffers(cfg *WriteConfig, workers int) []*OutputBuffer

type PipeHeader

type PipeHeader struct {
	Version, Format                  uint64
	N, NTot                          int64
	Span, Origin, TotalSpan          [3]int64
	Z, OmegaM, OmegaL, H100, L, Mass float64
}

type RockstarParticle

type RockstarParticle struct {
	ID   uint64
	X, V [3]float32
}

RockstarParticle is a particle with the structure expected by the Rockstar halo finder.

type WriteConfig

type WriteConfig struct {
	CompressionMethod string
	Vars, Types       []string
	Accuracies        []float64

	Input, Output            string
	Snaps                    []string
	OutputGridWidth          int64
	CreateMissingDirectories bool
	ByteOrder                string

	FileType                string
	GadgetVars, GadgetTypes []string
	IDOrder                 string

	Threads int64
}

func ParseWriteConfig

func ParseWriteConfig(configName string) (*WriteConfig, error)

Directories

Path Synopsis
package parse contains routines for parsing config files.
package parse contains routines for parsing config files.
package eq is a simple package for telling whether two arrays are equal to one another.
package eq is a simple package for telling whether two arrays are equal to one another.
package format handles Guppy's miniature formatting languages for snapshot file, e.g:
package format handles Guppy's miniature formatting languages for snapshot file, e.g:
package particles contains functions for manipulating particles with generic fields and ID-orderings.
package particles contains functions for manipulating particles with generic fields and ID-orderings.
package snapio contains functions for reading snapshot files.
package snapio contains functions for reading snapshot files.
package thread contains functions useful for multi-threading.
package thread contains functions useful for multi-threading.

Jump to

Keyboard shortcuts

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