A data acquisition program for NIST transition-edge sensor (TES) microcalorimeters. Designed to replace the earlier programs ndfb_server
and matter
(see their bitbucket repository).
Dastad requires Go version 1.21 or higher (released August 2023) because gonum-v1 v0.15 and other depdencies require it. Dastard is tested automatically on versions 1.21 and stable, the most recent stable version (as of August 21, 2024, that means Go version 1.23.0).
We recommend always using the Makefile
to build Dastard. That's not a typical go usage, but we have a simple trick built into the Makefile
that allows it to execute go build
with linker arguments to set values of two global variables. By this step, we are able to get the git hash and the build date of the current version to be known inside Dastard. Hooray! The lesson is always use one of the following:
# To build locally and run that copy
make build && ./dastard
or
# To install as $(go env GOPATH)/bin/dastard, which generally means $HOME/go/bin/dastard
make install # also implies make build
dastard
There was a problem with Go version 1.20 and TDM systems If you are using TDM systems with the Lancero device, beware that we had trouble making the device read correctly with Go 1.20 (as of April 20, 2023). This turns out to be the result of a bug in Go 1.20, surprisingly. We believe this problem was worked around in May 2023 (Dastard v0.2.19) AND completely fixed with Go 1.21+. We leave this note here just in case you notice TDM problems that we didn't.
One successful installation of the dependencies looked like this. Before pasting the following, be sure to run some simple command as sudo first; otherwise, the password entering step will screw up your multi-line paste.
# Dastard dependencies
sudo apt-get -y update
sudo apt-get install -y libsodium-dev libzmq3-dev git gcc pkg-config
# Install go
sudo add-apt-repository -y ppa:longsleep/golang-backports
sudo apt-get -y update
sudo apt-get -y install golang-go
go version
# Install Dastard as a development copy
# (These lines should have an equivalent "go install" like maybe "go install gitub.com/usnistgov/dastard@latest"??)
DASTARD_DEV_PATH=$(go env GOPATH)/src/github.com/usnistgov
mkdir -p $DASTARD_DEV_PATH
cd $DASTARD_DEV_PATH
git clone https://github.com/usnistgov/dastard
cd dastard
# Build, then try to run the local copy
# Using the Makefile is preferred, because it's the only way we're aware of to get the git hash and build date
# embedded in the built binary file. Run the new binary and check its version output.
make build && ./dastard --version
# Check whether the GOPATH is in your bash path. If not, update ~/.bashrc to make it so.
# This will fix the current terminal AND all that run ~/.bashrc in the future, but not
# any other existing terminals (until you do "source ~/.bashrc" in them).
source update-path.sh
# Now that PATH includes go's bin, try to install and run the installed copy
make install
dastard --version
Be sure to add ~/go/bin
to your PATH
environment variable, or replace ~/go
with the results of your specific result when you run go env GOPATH
.
The following seem to be out-of-date and apply only to Ubuntu 16.04 LTS, but just in case they are useful to you, here are the old instructions.
sudo add-apt-repository -y 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-stable/xUbuntu_16.04/ ./'
cd ~/Downloads
wget http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-stable/xUbuntu_16.04/Release.key
sudo apt-key add - < Release.key
sudo apt-get -y update
sudo apt-get install -y libsodium-dev libczmq-dev git
The following seemed to work on a NASA balloon flight computer in March 2023:
USE="static-libs -systemd" emerge --ask net-libs/zeromq dev-libs/libsodium
emerge --ask dev-vcs/git dev-lang/go
mkdir -p $(go env GOPATH)/bin/
After this, follow the Ubuntu instructions starting with "# Install Dastard as a development copy". Make sure that the update-path.sh
script worked and properly updated your PATH
variable. That script hasn't been tested in Gentoo, as far as I know.
As appropriate, use one of
brew install go zmq libsodium pkg-config
or
sudo port install go zmq libsodium-dev pkg-config
This only applies to users who will need µMUX, or any data source that eventually sends UDP packets to Dastard. The size of the standard Linux receive buffer for network sockets is only 208 kB, which is not nearly sufficient and leads to dropped packets. We recommend increasing the buffer size to 64 MB. In Linux, that buffer size parameter is called net.core.rmem_max
. In Mac OS X it seems to be called net.inet.udp.recvspace
. For one-time testing, this means you increase the buffer with:
sudo sysctl -w net.core.rmem_max=67108864
If that works as intended, you can make the configuration permanent (i.e., it will persist after rebooting) if
you add the following line to /etc/sysctl.conf
net.core.rmem_max=67108864
That's only for Linux machines. OS X doesn't seem to have such a file, but might instead require a startup script, possibly in /Library/StartupItems/
.
DASTARD is the Data Acquisition System for Triggering, Analyzing, and Recording Data. It is to be used with TES microcalorimeter arrays and the NIST Time-Division Multiplexed (TDM) readout or--in the future--the Microwave Multiplexed readout.
Assuming that the TDM readout system is properly configured first (beyond the scope of this project), one can use Dastard to:
Some reasons to replace the earlier data acquisition programs with Dastard in Go:
Some goals for DASTARD, in addition to these reasons:
DASTARD is a back-end program written in Go. It handles the "server" aspects of ndfb_server
, as well as the triggering and data-recording duties of matter
. It is complemented by two GUI-based projects: a control GUI and a data plotter.
We envision future control clients other than Dastard-commander. They should enable commanding from, for example, the beamline control system of a synchrotron.
Futher reading:
DASTARD caches its configuration via the Viper "complete configuration solution for Go applications". You can find your user file at $HOME/.dastard/config.yaml
. It's human-readable, though you should normally never need to read or edit it. If you have configuration problems and cannot find another way out, it is okay to delete this file (or hide it temporarily in, for example, /tmp/
). If you want some kind of global defaults that you want to persist even if that file is deleted, it is possible to create a global /etc/dastard/config.yaml
file with a subset of the values you want to set by default.
But again, this is expert usage! You should not normally need to touch or look at the configuration file. It's there for internal use to allow settings to persist from one run of Dastard to another.
For all email address, replace "@nist" with "@nist.gov".
Many key concepts in Dastard were adapted from the programs ndfb_server
, xcaldaq_client
, and matter
, written by Dastard's authors and by contributors from both NIST Boulder Laboratories and NASA Goddard Space Flight Center.