analyze

package
v0.0.0-...-e3578a0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterPoints

func FilterPoints(
	rs []RingBuffer, levels int, hFactor float64,
) (pxs, pys [][]float64, ok bool)

func GaussianKDE

func GaussianKDE(xs []float64, h, low, high float64, n int) *intr.Spline

func NaNSplit

func NaNSplit(
	vals []float64, opts ...NaNSplitOption,
) (valSets [][]float64, auxSets [][][]float64)

NaNSplit splits a slice into all non-empty sub-slices which are separated by NaNs. Additional arrays may be passed to NaNSplit, which will be split at the same locations.

func PennaCoeffs

func PennaCoeffs(xs, ys, zs []float64, I, J, K int) []float64

func Smooth

func Smooth(
	xs, ys []float64, window int, opts ...SmoothOption,
) (vals, derivs []float64, ok bool)

Smooth returns a smoothed 1D series as well as the derivative of that series using a Savitzky-Golay filter of the given size. It also takes optional arguments which allow the smoothing to be done in-place.

func SplashbackRadius

func SplashbackRadius(
	rs, rhos, derivs []float64, opts ...SplashbackRadiusOption,
) (r float64, ok bool)

Types

type KDETree

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

func NewKDETree

func NewKDETree(
	rs, phis []float64, splits int, hFactor float64,
) (*KDETree, bool)

func (*KDETree) FilterNearby

func (kt *KDETree) FilterNearby(
	rs, ths []float64, level int, dr float64,
) (fRs, fThs []float64, idxs []int)

func (*KDETree) GetConnMaxes

func (kt *KDETree) GetConnMaxes(level int) (rs, ths []float64)

func (*KDETree) GetRFunc

func (kt *KDETree) GetRFunc(level int, rt RFuncType) func(float64) float64

func (*KDETree) H

func (kt *KDETree) H() float64

func (*KDETree) PlotLevel

func (kt *KDETree) PlotLevel(level int, opts ...interface{})

type NaNSplitOption

type NaNSplitOption internalNaNSplitOption

NaNSplitOption is an abstract data type which allows for the customization of calls to NaNSplit without cluttering the call signature in the common case. This works similarly to kwargs in other languages.

func Aux

func Aux(aux ...[]float64) NaNSplitOption

Aux gives additional slices to NaNSplit which will be split at the same locations as the main input array.

func AuxSets

func AuxSets(auxSets [][][]float64) NaNSplitOption

AuxSets supplies NaNSplit with a pre-allocated valSets array.

func ValSets

func ValSets(valSets [][]float64) NaNSplitOption

ValSets supplies NaNSplit with a pre-allocated valSets array.

type ProjectedShell

type ProjectedShell func(h *los.HaloProfiles, ring int, phi float64) float64

func PennaPlaneFit

func PennaPlaneFit(
	xs, ys [][]float64, hRef *los.HaloProfiles, I, J int,
) (cs []float64, shell ProjectedShell)

type RFuncType

type RFuncType int
const (
	Radial RFuncType = iota
	Cartesian
)

type RingBuffer

type RingBuffer struct {
	PlaneXs, PlaneYs, Xs, Ys, Zs, Rs, Phis []float64
	Oks                                    []bool

	N, Bins int
	// contains filtered or unexported fields
}

func (*RingBuffer) Clear

func (r *RingBuffer) Clear()

func (*RingBuffer) Init

func (r *RingBuffer) Init(n, bins int)

func (*RingBuffer) OkPlaneCoords

func (r *RingBuffer) OkPlaneCoords(xs, ys []float64) (okXs, okYs []float64)

func (*RingBuffer) OkPolarCoords

func (r *RingBuffer) OkPolarCoords(rs, phis []float64) (okRs, okPhis []float64)

func (*RingBuffer) Splashback

func (r *RingBuffer) Splashback(
	h los.Halo, ring int, window int, dLim float64,
)

type Shell

type Shell func(phi, theta float64) float64

func CumulativeShells

func CumulativeShells(
	xs, ys [][]float64, h *los.HaloProfiles,
	I, J, start, stop, step int,
) (ringCounts []int, shells []Shell)

func PennaFunc

func PennaFunc(cs []float64, I, J, K int) Shell

func PennaVolumeFit

func PennaVolumeFit(
	xs, ys [][]float64, h los.Halo, I, J int,
) (cs []float64, shell Shell)

func (Shell) CartesianSampledVolume

func (s Shell) CartesianSampledVolume(samples int, rMax float64) float64

func (Shell) Contains

func (s Shell) Contains(x, y, z float64) bool

func (Shell) DiffVolume

func (s1 Shell) DiffVolume(s2 Shell, samples int) float64

func (Shell) MaxDiff

func (s1 Shell) MaxDiff(s2 Shell, samples int) float64

func (Shell) MeanRadius

func (s Shell) MeanRadius(samples int) float64

func (Shell) MedianRadius

func (s Shell) MedianRadius(samples int) float64

func (Shell) Moments

func (s Shell) Moments(samples int) (Ix, Iy, Iz float64)

func (Shell) RadialRange

func (s Shell) RadialRange(samples int) (low, high float64)

func (Shell) SurfaceArea

func (s Shell) SurfaceArea(samples int) float64

func (Shell) Volume

func (s Shell) Volume(samples int) float64

type SmoothOption

type SmoothOption internalSmoothOption

SmoothOption is an abstract data type which allows for the customization of calls to Smooth without cluttering the call signature in the common case. This works similarly to kwargs in other languages.

func Derivs

func Derivs(derivs []float64) SmoothOption

Derivs supplies Smooth with a slice which smoothed derivatives can be written to.

func Vals

func Vals(vals []float64) SmoothOption

Vals supplies Smooth with a slice which smoothed values can be written to.

type SplashbackRadiusOption

type SplashbackRadiusOption internalSplashbackRadiusOption

func DLim

DLim sets limit for d ln(rho) / d ln(r) above which point cannot be the splashback radius. The default value is -5.

type Tracers

type Tracers struct {
	Vol, Sa, Ix, Iy, Iz float64
}

func CumulativeTracers

func CumulativeTracers(
	shells [][]Shell, samples int,
) (means, stds []Tracers)

Jump to

Keyboard shortcuts

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