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.1.tar.gz (47.5 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.1-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shield_das-0.1.tar.gz
  • Upload date:
  • Size: 47.5 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.1.tar.gz
Algorithm Hash digest
SHA256 4d2171fcd662e4cb3c72c91cefb8b70aa91ae550c6a24da4017add8626b9ca63
MD5 a245b515bf5fe646c86fe0a1da7de1fd
BLAKE2b-256 cba1f373020a632c0aa27c7fa13d048c1ba084ff4c66dfa7196cb23d7b91db3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for shield_das-0.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: shield_das-0.1-py3-none-any.whl
  • Upload date:
  • Size: 29.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 032faab1a9fe5991a5950b5d4d08d3c75aaa5c3caaa5f995d9b0ab05723eed20
MD5 e94268a3614e6e47bc16bc969285f4e1
BLAKE2b-256 342dd4c4ddb9cc9b3f8603ea68afdc6a1bcea26f0e3f33b274459422a103c4b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for shield_das-0.1-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