Menu

Home

Nathan Towne
Attachments
Figure01.png (115283 bytes)
Figure02.png (37931 bytes)
spectrum.png (21916 bytes)

#sidmon5.net
This package is a VLF receiver for monitoring VLF transmitter signals for evidence of transients indicating ionospheric disturbances, usually caused by x-ray bursts from the sun. It takes sample pairs from dual-channel sound cards and spectrally processes them to Stokes parameters.

In sidmon5 data sets, there are four Stokes parameters per transmitter, plus four for a total-power 'transmitter' that can be used as a diagnostic or for flagging data points to be ingnored in post processing.

sidmon5 was the precursor of this program. The motivation for this new .Net version is that sidmon5 is not able to keep up with the data in its python environment, even when multiprocessing was employed. Although python with numpy can be fast, particularly when processing large arrays, the larger number of smaller steps involved in the extraction of spectral-line intensities is slow in the interpretive environment of python.

So sidmon5.net was developed in .Net in C# and Visual Basic. Running on a Raspberry Pi 4B, it requires only a 30% cpu-core usage while data usage is 100%. An earlier version streamed samples from alsaaudio through a python program via stdout to a .Net program. But the current version streams data from libsoundio through its C API to a 100% .Net program.

The plot utility is written in python.

Features

  1. Acquires two polarizations from loop antennas via a sound card, recording Stokes parameters.
  2. Total-power Stokes parameters useful for flagging data.
  3. Compiled application in .Net, written in C# and Visual Basic.
  4. Time plots of
    • Stokes parameters,
    • X/Y polarization amplitudes and relative phase,
    • ellipse major and minor axes and orientation,
    • normalized parameters,
    • GOES x-ray flux, and
    • SWPC event start-peak-stop times.
  5. Scatter plots of pairs of parameters.
    • Multiple pairs of parameters color coded,
    • multiple color-coded time segments.
  6. Utilities for
    • downloading SWPC-events and GOES x-ray data.

Other notes.

Data are saved to the output file in the following format:

    yyyy-mm-ddThh:mm:ss.fffffffZ,I1,Q1,U1,V1,I2,Q2,U2,V2, ...
    2025-06-04T21:19:32.5520007Z,21.46,-21.64,-3.42,-0.10,20.43,-15.56,13.20,1.88,45.37,18.29,-42.19,-11.10
    ...

for Stokes I, Q, U, and V of each transmitter, plus four wider-bandwidth Stokes parameters available for flagging in post processing, e.g., plotting.

Dependencies

Installation

Clone the program to a directory

    cd <dir>
    git clone https://git.code.sf.net/p/sidmon5-net/code sidmon5.net

Run the installation script.

    cd sidmon5.net
    ./install dependencies
    ./install configure

The first installs linux packages needed by the program, including FFTW, libsoundio, and .Net. The second creates

  • /etc/sidmon5.net/install_location - for the sidmon installation directory,
  • /etc/sidmon5.net/user - install user,
  • /etc/sidmon5.net/events_location - forthe installation directory for SWPC events reports (default is subdirectory EventsReports), and
  • /etc/sidmon5.net/goes_location - for the directory where GOES x-ray intensities are placed.
  • /etc/sidmon5.net/data_location - for the directory into which data are deposited and from which data are read (default is subdirectory data).

The first path should not be changed, but use the commands

    echo "<eventspath>"     | sudo tee /etc/sidmon5.net/events_location
    echo "<goesdatapath>"   | sudo tee /etc/sidmon5.net/goes_location
    echo "<datapath>"       | sudo tee /etc/sidmon5.net/data_location

to update the others to the actual destination directories if different from the defaults. The configuration step will not modify them once they are defined.

The file sidmon is placed in /etc/init.d/ during installation for use to control sidmon. Edit for the specifics of the installation, particularly the variables

  • device - for the sound device used, and
  • headerfile - for the file that configures sidmon, providing sample rate, transmitters to monitor, etc.

Useful aliases for pasting into .bashrc or elsewhere:

# sidmon5.net

This package is a VLF receiver for monitoring VLF transmitter signals for evidence of transients indicating ionospheric disturbances, usually caused by x-ray bursts from the sun. It takes sample pairs from dual-channel sound cards and spectrally processes them to Stokes parameters.

In sidmon5 data sets, there are four Stokes parameters per transmitter, plus four for a total-power 'transmitter' that can be used as a diagnostic or for flagging data points to be ingnored in post processing.

sidmon5 was the precursor of this program. The motivation for this new .Net version is that sidmon5 is not able to keep up with the data in its python environment, even when multiprocessing was employed. Although python with numpy can be fast, particularly when processing large arrays, the larger number of smaller steps involved in the extraction of spectral-line intensities is slow in the interpretive environment of python.

So sidmon5.net was developed in .Net in C# and Visual Basic. Running on a Raspberry Pi 4B, it requires only a 30% cpu-core usage while data usage is 100%. An earlier version streamed samples from alsaaudio through a python program via stdout to a .Net program. But the current version streams data from libsoundio through its C API to a 100% .Net program.

The plot and other utilities are written in python.

Features

  1. Acquires two polarizations from loop antennas via a sound card, recording Stokes parameters.
  2. Total-power Stokes parameters useful for flagging data.
  3. Compiled application in .Net, written in C# and Visual Basic.
  4. Plot and other utilities are written in python.
  5. Time plots of
    • Stokes parameters,
    • X/Y polarization amplitudes and relative phase,
    • ellipse major and minor axes and orientation,
    • normalized parameters,
    • GOES x-ray flux, and
    • SWPC event start-peak-stop times.
  6. Scatter plots of pairs of parameters.
    • Multiple pairs of parameters color coded,
    • multiple color-coded time segments.
  7. Utilities for
    • simpler syntax for plotting in a Bash script,
    • downloading SWPC-events and GOES x-ray data,
    • viewing file headers,
    • estimating data precision,
    • installation, and
    • acquisition start, stop, restart, status, etc.

Data are saved to the output file in the following format:

    yyyy-mm-ddThh:mm:ss.fffffffZ,I1,Q1,U1,V1,I2,Q2,U2,V2, ...
    2025-06-04T21:19:32.5520007Z,21.46,-21.64,-3.42,-0.10,20.43,-15.56,13.20,1.88,45.37,18.29,-42.19,-11.10
    ...

for Stokes I, Q, U, and V of each transmitter, plus four wider-bandwidth Stokes parameters available for flagging in post processing, e.g., plotting.

Dependencies

Installation

Clone the program to a directory

    $ cd <dir>
    $ git clone https://git.code.sf.net/p/sidmon5-net/code sidmon5.net

Run the installation script.

    $ cd sidmon5.net
    $ ./install dependencies
    $ ./install configure

The first installs linux packages needed by the program, including FFTW, libsoundio, and .Net. The second creates

  • /etc/sidmon5.net/install_location - for the sidmon installation directory,
  • /etc/sidmon5.net/user - install user,
  • /etc/sidmon5.net/events_location - forthe installation directory for SWPC events reports (default is subdirectory EventsReports), and
  • /etc/sidmon5.net/goes_location - for the directory where GOES x-ray intensities are placed.
  • /etc/sidmon5.net/data_location - for the directory into which data are deposited and from which data are read (default is subdirectory data).

The first path should not be changed, but use the commands

    $ echo "<eventspath>"     | sudo tee /etc/sidmon5.net/events_location
    $ echo "<goesdatapath>"   | sudo tee /etc/sidmon5.net/goes_location
    $ echo "<datapath>"       | sudo tee /etc/sidmon5.net/data_location

to update the others to the actual destination directories if different from the defaults. The configuration step will not modify them once they are defined.

The file sidmon is placed in /etc/init.d/ during installation for use to control sidmon. Edit for the specifics of the installation, particularly the variables

  • device - for the sound device used, and
  • headerfile - for the file that configures sidmon, providing sample rate, transmitters to monitor, etc.

Useful aliases for pasting into .bashrc or elsewhere:

    $ alias sidmon='/etc/init.d/sidmon'
    $ alias audio="$(cat /etc/sidmon5.net/install_location)/python/audio.py"
    $ alias plot="$(cat /etc/sidmon5.net/install_location)/plot"
    $ alias plot.py="$(cat /etc/sidmon5.net/install_location)/python/plot.py"

Usage

For basic usage

To control and monitor sidmon5 using the sidmon alias,

    $ sidmon start        # start
    $ sidmon stop         # stop
    $ sidmon restart      # restart
    $ sidmon status       # view status
    $ sidmon info         # print installation information and status
    $ sidmon log | err    # print tail of stdout and stderr log files
    $ sidmon tail         # print tail of current data file
    $ sidmon cron         # list installed cron tasks

when queried from another computer, use a command like

ssh <user>@<ip> "/etc/init.d/sidmon <subcommand>"

There are convenience functions.

    $ install aliases   # list useful aliases for pasting into .bashrc
    $ install version   # display versions of .Net and FFTW

The python program plot.py is used for time plots and scatter plots. An example time plot is

and scatter plot

See the SuperSID reference below and other sources for information on loop antennas and the ins and outs of SID detection.

In my experience, the sound device infrequently becomes inaccessible, and acquisition stops. For this reason it is useful to have a cron task that periodically checks that sidmon is running, and if not restarts it, such as

    */15 * * * * if ! /etc/init.d/sidmon status > /dev/null; then /etc/init.d/sidmon start; fi

Configuration files

sidmon5.net's configuration-file (header) format is rationalized from the format of sidmon2 and sidmon3. Refer to the documentation of sidmon2 to understand sidmon's fitting algorithm and transmitter groups, and the sidmon5 example Header.txt. Configure the first lines for site and personal information. Provide transmitter lines for the transmitters being monitored. Provide a group for each transmitter whose line is well separated from other lines. Provide a group for transmitters whose lines might overlap.

    # Site = <sitename>
    # Contact = <name, email, etc.>
    # Latitude = <lat>
    # Longitude = <lng>
    # Elevation = <ele>
    # LogInterval = 5
    #
    # fourierframe = 16384
    # fourierframecount = 4
    # channelcount = 2
    #
    # antenna cards: name, gain, normal pointing (deg)
    # antenna = name1, 1.0, 0.0
    # antenna = name2, 1.0, 90.0
    #
    # sound-card
    # device = plughw:CARD=Device,DEV=0
    # frame rate in Hz
    # frameratesetting  = 72000.0
    # frameratemeasured = 72000.0
    #
    # transmitter and group cards follow the cards above
    #
    # 11/2024 transmitter format: name, frequency, latitude, longitude, location/description
    # transmitter = NPM, 21400, +21.420166, -158.151140, Pearl Harbour Lualuahei HI
    # transmitter = NAA, 24000, +44.644936, -067.281639, Cutler ME
    # transmitter = NLK, 24800, +48.203487, -121.916827, Oso Wash Jim Creek WA
    # transmitter = NML, 25200, +46.365990, -098.335638, La Moure ND
    # transmitter = All, 25000, 0.0, 0.0, whole-band Stokes parameters for flagging
    #
    # transmitter groups: name, freq1, freq2, transmitter list
    # group = npm, 21100, 21700, 1, NPM
    # group = naa, 23600, 24400, 1, NAA
    # group = nlknml, 24350, 25600, 1, NLK, NML

Utilities

audio.py

The file audio.py has useful utilities, one for displaying spectra.

audio.py spectrum  <device> <framerateHz> [<integrationtimeseconds>]

To list available sound cards and devices, enter

audio.py hardware

Use this function to identify transmitters to monitor and when setting up the transmitter and group settings in the header file. It is best to use the lowest sample rate that 1) is supported by the card, 2) has Nyquist frequency above the maximum observed frequency, 3) has bandwidth (frequency cutoff) above the maximum observed frequency, and 4) the no-input spectrum is clean with a sharp cutoff. For example,

One need not limit oneself to 'standard' audio sample rates, but one must carefully check spectra and transmitter line locations to be sure that the samples are actually processed correctly by the sound device at a given sample rate.

The configuration file provides entries for both the sample-rate setting and measured sample rate at that setting. Check the sample rate at a candidate setting using another utility in audio.py.

audio.py measurerate <device> <framerateHz> [<durationminutes> [<printintervalseconds>]]

Sample rates are measured against the system clock, so it is necessary that the system have a clock stabilized by NTP. A GPS-disciplined NTP server on the LAN is helpful, but perhaps not necessary. A sample-rate error offsets the fitting functions from the lines, degrading performance. A few Hz error probably will have little impact, while a 20 Hz error probably will have a significant impact. If a large error is measured, double check it, and enter it into the header file a the sampleratemeasured line. Otherwise just enter the setting.

utils.py

To download an SWPC events report, use the command

    $ utils.py events yyyymmdd

The files are needed if their events are to be displayed in time plots. To schedule download, one can have a cron task, e.g.,

    30 18 * * * cd $(cat /etc/sidmon5.net/events_location) && $(cat /etc/sidmon5.net/install_location)/python/utils.py events "$(date -u --date yesterday +\%Y\%m\%d)"

The precision of the data can be estimated using the precision subcommand. Select a segment of a trace that is free of structure and provde start and end times of that segment. It computes mean and standard deviation of the detrended segment.

    $ utils.py precision <filename> <h1:m1,h2:m2> <transmitter> <order>
    $ utils.py precision 20250623towne24.csv 19:00,20:00 NML 2
                    integration time : 4.32 s
              point count (excluded) : 719 (1)
                                mean : 203.8
                             std dev : 3.897
                          fractional : 1.91%
                 effective bandwidth : 632.2 Hz

Detrending is by fitting to a polynomial of the given order. The code tries to exclude glitches. The numbers are applied to the radiometer equation to get an effective bandwidth, perhaps a useful sensitivity figure of merit.

To view information in the header of a data file, use the header subcommand.

    $ utils.py header 20250622towne24.csv 
    sample rate   72000.0 Hz
    interval      5.000 s

    transmitters
         NPM - 21400.0 Hz ( 21.4202°, -158.1511°)
         NAA - 24000.0 Hz ( 44.6449°,  -67.2816°)
         NLK - 24800.0 Hz ( 48.2035°, -121.9168°)
         NML - 25200.0 Hz ( 46.3660°,  -98.3356°)
         All - 25000.0 Hz (  0.0000°,    0.0000°)

    transmitter groups
         npm - 21098.1 to 21700.2 Hz (1), NPM
         naa - 23598.6 to 24398.4 Hz (1), NAA
      nlknml - 24350.1 to 25598.1 Hz (1), NLK, NML

Data flagging

Regardless of the number of transmitters being measured, there is an additional 'transmitter' whose Stokes parameters are being measured, which is the mean Stokes parameters of bandwidth between the bandwidths allocated to the transmitter groups defined in the header. This transmitter is called All and can be plotted as any other transmitter. The purpose of this transmitter is in part a diagnostic that gives an indication of the RFI in which the transmitter signals reside. It is also intended to be used for flagging, where undecimated time data points in which a specified Stokes parameter is above a specified threshold, then that time point is ignored, i.e., not plotted. It is useful with lightning in which there is a short glitch with a lot of intensity that can be removed. It cannot deal with local electronic noise that might be on at a relatively steady intensity for longer times.

To use this feature, use the --flagging switch to specify a flagging signal and a threshold. For example,

    $ plot select       20250603towne24     NPMi,NLKi --flagging=Alli,100
    $ python/plot.py -f 20250603towne24 -ps NPMi,NLKi --flagging=Alli,100

The program will print a count of the data points that are excluded. One must experiment to find a threshold that excludes a small but still useful number of points.

Shared libraries

For some reason, .Net is not finding libsoundio.so and libfftw3f.so consistently. If you have this problem, a workaround is to create simlinks to them from either

    $HOME/dotnet_install/shared/Microsoft.NETCore.App/9.0.2/

or
<installationdir>/sidmon5/bin/Release/net9.0/</installationdir>

For example,

    $ ln -s /usr/local/lib/libsoundio.so \
        <installationdir>/sidmon5/bin/Release/net9.0/libsoundio.so

The .Net version in the command will likely need to be adjusted.

References


*
SuperSID.

*
sidmon2.

*
sidmon3.

*
Gross, N. C., Cohen, M. B., Said, R. K., & Golkowski, M. (2018). Polarization of narrow-band VLF transmitter signals as an ionospheric diagnostic. Journal of Geophysical Research: Space Physics, 123, 901–917.


Related

Wiki: ScatterPlots.md
Wiki: TimePlots.md
Wiki: plot.md

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.