calorado

package module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

README

calorado-daq

calorado-daq is a simple UDP server, processing UDP payloads from calorado.

Installation

$> go install gitlab.in2p3.fr/sbinet/calorado-daq

Dashboard

  • 134.158.120.139:3000/login

Documentation

Overview

Package calorado provides types to read/write data files and streams from the Calorado detector.

The calorado package defines a binary file:

----- CALO binary file header:
 0 -  2: uint16: 'C' 'A' 'L' 'O'
 2 -  4: uint16: file format version (0x1 for now)

----- event data. (multi-bytes encoded as little-endian)

 0 -  2: uint16: boundary-begin (0xcafe)
 2 - 10: uint64: absolute-time (UTC) of data reception
10 - 12: uint16: rate
12 - 14: uint16: temperature
14 - 16: uint16: humidity
16 - 18: uint16: voltage (mV)
18 - 20: uint16: current (mA)
20 - 22: uint16: type of frame
22 - 24: uint16: number of frames

-- n-frames of 12 bytes
 0 -  4: uint32: trigger number
 4 -  6: uint16: amplitude
 6 - 12: uint48: timestamp

-- event footer: 2 bytes
 0 -  2: uint16: boundary (0xdead)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(w *Writer, r *Reader) error

Copy copies all events from r to w.

Types

type Epoch

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

Epoch represents the origin of the relative (48bits) timestamp of a frame. It is turned an absolute time.Time timestamp.

func EpochFrom

func EpochFrom(evt Event) Epoch

EpochFrom returns a new epoch. It takes the relative timestamp of the event's first frame and turns it into an absolute timestamp.

func (Epoch) Time

func (e Epoch) Time(frame Frame) time.Time

type Event

type Event struct {
	Time time.Time // Time is the absolute time of event reception
	Rate float64   // Rate is the number of counts per second
	Temp float64   // Temp is the temperature in Celsius degrees
	Humi float64   // Humi is the humidity in percents
	Volt float64   // Volt is the battery voltage in mV
	Curr float64   // Curr is the battery current in mA

	Kind   FrameKind // kind of recorded frames
	Frames []Frame   // time ordered list of recorded frames
}

type Frame

type Frame struct {
	Trigger   uint32
	Amplitude uint16
	Timestamp uint64 // Timestamp is a relative timestamp (in 100ns ticks)
}

type FrameKind

type FrameKind uint16

FrameKind describes the type of frames being recorded or sent by a Calorado detector.

const (
	InvalidKind FrameKind = 0
	DataKind    FrameKind = 1
)

type Reader

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

func NewReader

func NewReader(r io.Reader) (*Reader, error)

func (*Reader) Read

func (r *Reader) Read(evt *Event) error

func (*Reader) Version

func (r *Reader) Version() uint16

Version returns the CALO file format version this reader is currently decoding.

type Writer

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

Writer writes events to the underlying writer in the CALO format.

func NewWriter

func NewWriter(w io.Writer) (*Writer, error)

func NewWriterAppend

func NewWriterAppend(w io.Writer) (*Writer, error)

func (*Writer) Write

func (w *Writer) Write(evt *Event) error

Directories

Path Synopsis
cmd
calo-cat
Command calo-cat concatenates a list of CALO files into a single one.
Command calo-cat concatenates a list of CALO files into a single one.
calo-daq
Command calo-daq receives data from a Calorado detector.
Command calo-daq receives data from a Calorado detector.
calo-dump
Command calo-dump displays the content of a list of CALO files.
Command calo-dump displays the content of a list of CALO files.
calo-fwd
Command calo-fwd serves an end-point for proxying CALO data.
Command calo-fwd serves an end-point for proxying CALO data.
calo-janitor
Command calo-janitor monitors a directory and automatically compresses "old enough" CALO files, that is: CALO files older than two hours.
Command calo-janitor monitors a directory and automatically compresses "old enough" CALO files, that is: CALO files older than two hours.
calo-mon
Command calo-mon runs monitoring procedures on a (set of) CALO file(s) to detect missing/dropped UDP packets, or missing CALO frames.
Command calo-mon runs monitoring procedures on a (set of) CALO file(s) to detect missing/dropped UDP packets, or missing CALO frames.
calo-srv
Command calo-srv serves end-points for monitoring and analysis of CALO files.
Command calo-srv serves end-points for monitoring and analysis of CALO files.
gen-calorado
Command gen-calorado is a simple command to generate data and send it to the calorado-daq server.
Command gen-calorado is a simple command to generate data and send it to the calorado-daq server.

Jump to

Keyboard shortcuts

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