stack

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StackIncremental

func StackIncremental(stack, light *fits.Image, weight float32) *fits.Image

Incrementally stacks the light onto the given stack, weighted by the given weight. Creates a new stack with same dimensions as light if stack is nil. Returns the modified or created stack. Does not calculate statistics, run star detections etc.

func StackIncrementalFinalize

func StackIncrementalFinalize(stack *fits.Image, weightSum float32)

Finalizes an incremental stack. Divides pixel values by weight sum, and calculates extended stats

func StackLinearFit

func StackLinearFit(lightsData [][]float32, RefFrameLoc, sigmaLow, sigmaHigh float32, res []float32) (clipLow, clipHigh int32)

Stacking with linear regression fit. Values which are more than sigmaLow/sigmaHigh standard deviations away from linear fit are excluded from the average calculation.

func StackMADSigma

func StackMADSigma(lightsData [][]float32, RefFrameLoc, sigmaLow, sigmaHigh float32, res []float32) (clipLow, clipHigh int32)

Mean stacking with sigma clipping. Values which are more than sigmaLow/sigmaHigh MADs away from the median are excluded from the average calculation.

func StackMean

func StackMean(lightsData [][]float32, RefFrameLoc float32, res []float32)

Stacking with mean function

func StackMeanWeighted

func StackMeanWeighted(lightsData [][]float32, weights []float32, RefFrameLoc float32, res []float32)

Stacking with mean function and weights

func StackMedian

func StackMedian(lightsData [][]float32, RefFrameLoc float32, res []float32)

Stacking with median function

func StackSigma

func StackSigma(lightsData [][]float32, RefFrameLoc, sigmaLow, sigmaHigh float32, res []float32) (clipLow, clipHigh int32)

Mean stacking with sigma clipping. Values which are more than sigmaLow/sigmaHigh standard deviations away from the mean are excluded from the average calculation. The standard deviation is calculated w.r.t the mean for robustness.

func StackSigmaWeighted

func StackSigmaWeighted(lightsData [][]float32, weights []float32, RefFrameLoc, sigmaLow, sigmaHigh float32, res []float32) (clipLow, clipHigh int32)

Weighted mean stacking with sigma clipping. Values which are more than sigmaLow/sigmaHigh standard deviations away from the mean are excluded from the average calculation. The standard deviation is calculated w.r.t the mean for robustness.

func StackWinsorSigma

func StackWinsorSigma(lightsData [][]float32, RefFrameLoc, sigmaLow, sigmaHigh float32, res []float32) (clipLow, clipHigh int32)

Weighted mean stacking with sigma clipping. Values which are more than sigmaLow/sigmaHigh standard deviations away from the mean are replaced with the lowest/highest valid value.

func StackWinsorSigmaWeighted

func StackWinsorSigmaWeighted(lightsData [][]float32, weights []float32, RefFrameLoc, sigmaLow, sigmaHigh float32, res []float32) (clipLow, clipHigh int32)

Weighted mean stacking with sigma clipping. Values which are more than sigmaLow/sigmaHigh standard deviations away from the mean are replaced with the lowest/highest valid value.

Types

type OpStack

type OpStack struct {
	ops.OpBase
	Mode        StackMode      `json:"mode"`
	Weighting   StackWeighting `json:"weighting"`
	SigmaLow    float32        `json:"sigmaLow"`
	SigmaHigh   float32        `json:"sigmaHigh"`
	RefFrameLoc float32        `json:"-"`
}

func NewOpStack

func NewOpStack(mode StackMode, weighting StackWeighting, sigmaLow, sigmaHigh float32) *OpStack

func NewOpStackDefault

func NewOpStackDefault() *OpStack

func (*OpStack) Apply

func (op *OpStack) Apply(f []*fits.Image, c *ops.Context) (result *fits.Image, err error)

Stack a set of light frames. Limits parallelism to the number of available cores

func (*OpStack) MakePromises

func (op *OpStack) MakePromises(ins []ops.Promise, c *ops.Context) (outs []ops.Promise, err error)

func (*OpStack) UnmarshalJSON

func (op *OpStack) UnmarshalJSON(data []byte) error

Unmarshal the type from JSON with default values for missing entries

type OpStackBatches

type OpStackBatches struct {
	ops.OpBase
	PerBatch *ops.OpSequence `json:"perBatch"`
}

func NewOpStackBatches

func NewOpStackBatches(perBatch *ops.OpSequence) (op *OpStackBatches)

func NewOpStackBatchesDefault

func NewOpStackBatchesDefault() *OpStackBatches

func (*OpStackBatches) Apply

func (op *OpStackBatches) Apply(ins []ops.Promise, c *ops.Context) (fOut *fits.Image, err error)

func (*OpStackBatches) MakePromises

func (op *OpStackBatches) MakePromises(ins []ops.Promise, c *ops.Context) (outs []ops.Promise, err error)

type StackMode

type StackMode int
const (
	StMedian StackMode = iota
	StMean
	StSigma
	StWinsorSigma
	StMADSigma
	StLinearFit
	StAuto
)

type StackWeighting

type StackWeighting int
const (
	StWeightNone StackWeighting = iota
	StWeightExposure
	StWeightInverseNoise
	StWeightInverseHFR
)

Jump to

Keyboard shortcuts

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