Skip to content

jrobrien91/waggle-parsivel-io

Repository files navigation

OTT Parsivel2 - I/O Plugin

Waggle Sensor Plugin for the OTT Parsivel2 - Laser Disdrometer.

The plugin establishes a serial connection wtih the Parsivel2, writes data at user defined frequencies to a local file, and uploads to Beehive via the Waggle Plugin.

Science

The OTT Parsivel2 is a laser disdrometer which is capable of measuring all types of preciptiation. The Parsivel2 classifies hydrometeors into 32 separate size and velocity classes, allowing users to calculate the type, amount, and intensity of preciptiation. From this particle size distribution, users are capable of calculating the equivalent radar reflectivity factor, among other parameters, to investigate microphyiscal characteristics of precipitation.

Usage

To execute the plugin use the following workflow:

Conda Environment

A environment.yml file has been included within this repository to allow users to reproduce the application's conda environment.

Build the Conda Environment (if not previously created)

conda env create -f environment.yml

Activate the Conda Environment

conda activate waggle_parsivel

Determine Serial Port

PySerial offers a handy toolist to list all serial ports currently in use. To determine the port for the instrument, run:

python -m serial.tools.list_ports

Otherwise, check USB devices locally:

ls -lh /dev/ttyUSB*

The default serial settings for the OTT Parsivel2 are

  1. Baud Rate = 19200
  2. Data Bits = 8
  3. Parity = None
  4. Stop Bits = 1

Deployment

To execute the OTT Parsivel2 I/O Plugin:

Waggle Node (locally)

  1. Before deploying the plugin locally on the waggle node, pull any recent changes and build the image
cd waggle-parsivel-io
sudo pluginctl build .
  1. Next, deploy the plugin via pluginctl
sudo pluginctl deploy -n parsivel --selector zone=core --privileged 10.31.81.1:5000/local/waggle-parsivel-io
  1. Verify the image deployed successfully
sudo pluginctl ps

Examples:

  1. To change the default serial device:
sudo pluginctl deploy -n parsivel --selector zone=core --privileged 10.31.81.1:5000/local/waggle-parsivel-io -- --device /dev/ttyUSB5
  1. To enable printing information to screen:
sudo pluginctl deploy -n parsivel --selector zone=core --privileged 10.31.81.1:5000/local/waggle-parsivel-io -- --verbose
  1. To change the frequency of file generation to hourly:
sudo pluginctl deploy -n parsivel --selector zone=core --privileged 10.31.81.1:5000/local/waggle-parsivel-io -- --freq 60

Locally

If utilizing a local computer and not the Waggle node, reference the application directly

python app.py --device "/dev/ttyUSB5" --verbose

Access the Data

import sage_data_client

df = sage_data_client.query(
    start="2025-02-12T16:00:00Z",
    end="2025-02-12T17:00:00.000Z", 
    filter={
        "plugin": "10.31.81.1:5000/local/waggle-parsivel-io.*",
        "vsn": "W09F"
    }
)

SAGE Job Script Example

name: atmos-parsivel
plugins:
- name: waggle-parsivel-io
  pluginSpec:
    image: registry.sagecontinuum.org/jrobrien/waggle-parsivel-io:0.25.02.04
    args:
    - --device
    - /dev/ttyUSB5
    privileged: true
    selector:
      zone: core
nodeTags: []
nodes:
  W09F: true
scienceRules:
- 'schedule("waggle-parsivel-io"): cronjob("waggle-parsivel-io", "*/10 * * * *")'
successCriteria:
- WallClock('1day')

About

Waggle Sensor Plugin for the OTT Parsivel2 - Laser Disdrometer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages