Skip to main content

SHIELD permeation rig data aquisition system

Project description

SHIELD permeation rig Data Aquisistion System

This is a tool to be used with the SHIELD hydrogen permeation rig, providing a way to both record data from the rig and have a live UI displaying plots of the pressure values in the gauges connected to the rig and the temperature of the connected thermocouple.

Image

Example script

This is an example of a script that can be used to activate the DAS.

from shield_das import (
    DataRecorder,
    WGM701_Gauge,
    DataPlotter,
    CVM211_Gauge,
    Baratron626D_Gauge
)
import time
import sys

# Define gauges
gauge_1 = WGM701_Gauge(
    gauge_location="downstream",
    export_filename="WGM701_pressure_data.csv",
)
gauge_2 = CVM211_Gauge(
    gauge_location="upstream",
    export_filename="CVM211_pressure_data.csv",
)
gauge_3 = Baratron626D_Gauge(
    name="Baratron626D_1KT",
    gauge_location="upstream",
    export_filename="Baratron626D_1KT_upstream_pressure_data.csv",
    full_scale_Torr=1000,
)
gauge_4 = Baratron626D_Gauge(
    name="Baratron626D_1T",
    gauge_location="downstream",
    export_filename="Baratron626D_1T_downstream_pressure_data.csv",
    full_scale_Torr=1,
)

# Create recorder
my_recorder = DataRecorder(
    gauges=[gauge_1, gauge_2, gauge_3, gauge_4],
)

if __name__ == "__main__":
    # Check if we're running in headless mode
    headless = "--headless" in sys.argv
    
    if headless:
        # Start recorder directly in headless mode
        my_recorder.start()
    else:
        # Create and start the plotter
        plotter = DataPlotter(my_recorder)
        plotter.start()
    
    # Keep the main thread running (same for both modes)
    try:
        while True:
            time.sleep(1)
            # Print status every 10 seconds in headless mode
            if headless and int(time.time()) % 10 == 0:
                import datetime
                print(f"Current time: {datetime.datetime.now()} - Recording in progress... Elapsed time: {my_recorder.elapsed_time:.1f}s")
    except KeyboardInterrupt:
        my_recorder.stop()
        print("Recorder stopped")

Test mode

If the labjack is not connected, the program can be run in test_mode, where dummy data is generated which can then be recorded and veiwed for testing the program works.

It can be activate with the argument test_mode in the DataRecorder class:

# Create recorder
my_recorder = DataRecorder(
    gauges=[gauge_1, gauge_2, gauge_3, gauge_4],
    test_mode=True
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shield_das-0.1rc1.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shield_das-0.1rc1-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file shield_das-0.1rc1.tar.gz.

File metadata

  • Download URL: shield_das-0.1rc1.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for shield_das-0.1rc1.tar.gz
Algorithm Hash digest
SHA256 3d2e283ecdb4cb76c8caf91c5ae6768dadd6b58330a78f4ea6c2c2cccbd151f5
MD5 fbc81a9baf942df9a588728436a845d0
BLAKE2b-256 37e98502b88e32596db261609de58c3e1e1c7fd42ee1eed60febdc6bcc12f5d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for shield_das-0.1rc1.tar.gz:

Publisher: python-publish.yml on PTTEPxMIT/SHIELD_DAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shield_das-0.1rc1-py3-none-any.whl.

File metadata

  • Download URL: shield_das-0.1rc1-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for shield_das-0.1rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 4049087f491ec822d606efb3cd01465b7abce7537c9c6cc8fb7afd7173231b54
MD5 f0b1d8dae63a26fa71cb17265a78ed28
BLAKE2b-256 bcbae59c6b6e6bf994e53747fa1d512bb5db90ee551b4315058489a6eac51665

See more details on using hashes here.

Provenance

The following attestation bundles were made for shield_das-0.1rc1-py3-none-any.whl:

Publisher: python-publish.yml on PTTEPxMIT/SHIELD_DAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page