fouracc

package module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

README

fouracc

GoDoc

fouracc is a simple Fourier analysis of acceleration data for the LSST testbench.

fouracc cmd

$> go get github.com/lsst-lpc/fouracc/cmd/fouracc
$> fouracc ./testdata/msr-accel-2019-08-06.csv 
fouracc: chunk size: 256
fouracc: file:       ./testdata/msr-accel-2019-08-06.csv
fouracc: data: 16384
fouracc: coeffs: 64
fouracc: dims: (c=64, r=128)

$> fouracc -chunks=128 ./testdata/msr-accel-2019-08-06.csv 
fouracc: chunk size: 128
fouracc: file:       ./testdata/msr-accel-2019-08-06.csv
fouracc: data: 16384
fouracc: coeffs: 128
fouracc: dims: (c=128, r=64)

img

fouracc-srv

fouracc also provides a web server that can run Fourier analyses over HTTP.

$> go get github.com/lsst-lpc/fouracc/cmd/fouracc-srv
$> fouracc-srv
fouracc-srv: http server listening on :8080
fouracc-srv: fname: msr-accel-2019-08-06.csv
fouracc-srv: chunks: 256
fouracc-srv: xs: 16384, 16384
fouracc-srv: coeffs: 64
fouracc-srv: dims: (c=64, r=128)
^Cfouracc-srv: shutdown sequence...

srv

Documentation

Overview

Package fouracc provides a function to analyze a time series by chunks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(r io.Reader) (xs, ys []float64, err error)

Load reads data from the provided io.Reader. Load expects 1 or 2 columns of the form ([time series], amplitudes).

func Plot

func Plot(dc draw.Canvas, fft FFT) error

Plot plots the provided FFT on the provided canvas.

Types

type FFT

type FFT struct {
	Data struct {
		X []float64
		Y []float64
	}
	Ts     []float64   // chunked time series
	Freqs  []float64   // frequencies
	Coeffs [][]float64 // FFT coefficients

	Name   string
	Chunks int
	Scale  float64 // Frequency scale
}

func ChunkedFFT

func ChunkedFFT(fname string, chunksz int, xs, ys []float64, freq float64) FFT

func (FFT) Dims

func (fft FFT) Dims() (c, r int)

func (FFT) X

func (fft FFT) X(c int) float64

func (FFT) Y

func (fft FFT) Y(r int) float64

func (FFT) Z

func (fft FFT) Z(c, r int) float64

Directories

Path Synopsis
cmd
fouracc
Command fouracc runs a FFT analysis on an MSR acceleration file.
Command fouracc runs a FFT analysis on an MSR acceleration file.
fouracc-srv
Command fouracc-srv runs a web server for the FFT analysis on an MSR acceleration file.
Command fouracc-srv runs a web server for the FFT analysis on an MSR acceleration file.
Package msr parses CSV files directly produced by MSR acceleration sensors.
Package msr parses CSV files directly produced by MSR acceleration sensors.

Jump to

Keyboard shortcuts

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