halo

package
v0.0.0-...-b5d641a Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadBinaryRockstarVals

func ReadBinaryRockstarVals(
	file string, cosmo *io.CosmologyHeader, valFlags ...Val,
) (ids []int, vals [][]float64, err error)

func ReadRockstar

func ReadRockstar(
	file string, rType Radius, cosmo *io.CosmologyHeader,
) (rids []int, xs, ys, zs, ms, rs []float64, err error)

ReadRockstar reads halo information from the given Rockstar catalog, sorted from largest to smallest.

func ReadRockstarVals

func ReadRockstarVals(
	file string, cosmo *io.CosmologyHeader, valFlags ...Val,
) (ids []int, vals [][]float64, err error)

func RockstarConvert

func RockstarConvert(inFile, outFile string) error

func RockstarConvertTopN

func RockstarConvertTopN(inFile, outFile string, n int) error

Types

type Bounds

type Bounds struct {
	Origin, Span [3]int
}

Bounds is a cell-aligned bounding box.

func (*Bounds) ConvertIndices

func (b *Bounds) ConvertIndices(x, y, z, width int) (bx, by, bz int)

ConvertIndices converts non-periodic indices to periodic indices.

func (*Bounds) Inside

func (b *Bounds) Inside(val int, width int, dim int) bool

Inside returns true if the given value is within the bounding box along the given dimension. The periodic box width is given by width.

func (*Bounds) SphereBounds

func (b *Bounds) SphereBounds(pos [3]float64, r, cw, width float64)

SphereBounds creates a cell-aligned bounding box around a non-aligned sphere within a box with periodic boundary conditions.

type Grid

type Grid struct {
	Cells int
	Width float64

	// Grid-sized
	Heads []int
	// Data-sized
	Next []int
	// contains filtered or unexported fields
}

func NewGrid

func NewGrid(cells int, width float64, dataLen int) *Grid

func (*Grid) AverageLength

func (g *Grid) AverageLength() int

func (*Grid) Insert

func (g *Grid) Insert(xs, ys, zs []float64)

func (*Grid) Length

func (g *Grid) Length(idx int) int

func (*Grid) MaxLength

func (g *Grid) MaxLength() int

func (*Grid) ReadIndexes

func (g *Grid) ReadIndexes(idx int, buf []int) []int

func (*Grid) TotalCells

func (g *Grid) TotalCells() int

type Radius

type Radius int
const (
	RVirial Radius = iota
	R200c
	R200m
	R500c
	R2500c
)

func RadiusFromString

func RadiusFromString(s string) (r Radius, ok bool)

func (Radius) Mass

func (r Radius) Mass(c *io.CosmologyHeader, rs, out []float64)

func (Radius) Radius

func (r Radius) Radius(c *io.CosmologyHeader, ms, out []float64)

func (Radius) RockstarColumn

func (r Radius) RockstarColumn() int

func (Radius) RockstarMass

func (r Radius) RockstarMass() bool

func (Radius) String

func (r Radius) String() string

type SubhaloFinder

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

SubhaloFinder computes which halos in a collection are subhalos of other halos in that collection based purely off of position information.

func NewSubhaloFinder

func NewSubhaloFinder(g *Grid) *SubhaloFinder

NewSubhaloFinder creates a new subhalo finder corresponding to the given Grid.

func (*SubhaloFinder) FindSubhalos

func (sf *SubhaloFinder) FindSubhalos(
	xs, ys, zs, rs []float64, mult float64,
)

FindSubhalos computes.

func (*SubhaloFinder) HostCount

func (sf *SubhaloFinder) HostCount(ih int) int

func (*SubhaloFinder) Hosts

func (sf *SubhaloFinder) Hosts(ih int) []int

func (*SubhaloFinder) IntersectCount

func (sf *SubhaloFinder) IntersectCount(ih int) int

func (*SubhaloFinder) Intersects

func (sf *SubhaloFinder) Intersects(ih int) []int

func (*SubhaloFinder) StartEnd

func (sf *SubhaloFinder) StartEnd(ih int) (start, end int)

func (*SubhaloFinder) SubhaloCount

func (sf *SubhaloFinder) SubhaloCount(ih int) int

func (*SubhaloFinder) Subhalos

func (sf *SubhaloFinder) Subhalos(ih int) []int

type Val

type Val int
const (
	Scale Val = iota
	ID
	DescScale
	DescID
	NumProg
	PID
	UPID
	DescPID
	Phantom
	SAMMVir
	MVir
	RVir
	Rs
	Vrms
	MMP
	ScaleOfLastMMP
	VMax
	X
	Y
	Z
	Vx
	Vy
	Vz
	Jx
	Jy
	Jz
	Spin
	BreadthFirstID
	DepthFirstID
	TreeRootID
	OrigHaloID
	SnapNum
	NextCoprogenitorDepthFirstID
	LastProgenitorDepthFirstID
	RsKylpin
	MVirAll
	M200b
	M200c
	M500c
	M2500c
	XOff
	Voff
	SpinBullock
	BToA
	CToA
	Ax
	Ay
	Az
	BToA500c
	CToA500c
	Ax500c
	Ay500c
	Az500c
	TU
	MAcc
	MPeak
	VAcc
	VPeak
	HalfmassScale
	AccRateInst
	AccRate100Myr
	AccRateTdyn

	RadVir
	Rad200b
	Rad200c
	Rad500c
	Rad2500c
)

Jump to

Keyboard shortcuts

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