Skip to content

Latest commit

Β 

History

History
204 lines (143 loc) Β· 3.82 KB

File metadata and controls

204 lines (143 loc) Β· 3.82 KB

MultiViz Time Waveform Upload Example

This repository contains a small Python project and a Jupyter notebook showing how to upload time waveform vibration data to MultiViz using the MultivizClient.
The notebook demonstrates working with both JSON payloads and CSV files.


πŸ“‚ Project Structure

.
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ information.txt        # Metadata for CSV example
β”‚   β”œβ”€β”€ sample_payload.json    # JSON waveform example
β”‚   β”œβ”€β”€ values_1.csv           # X-axis data
β”‚   β”œβ”€β”€ values_2.csv           # Y-axis data
β”‚   └── values_3.csv           # Z-axis data
β”œβ”€β”€ notebooks/
β”‚   └── upload_to_multiviz.ipynb # Main demonstration notebook
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ helper.py              # Helper functions (I/O, parsing, utils)
β”‚   β”œβ”€β”€ logger.py              # Basic logger
β”‚   β”œβ”€β”€ multiviz_client.py     # MultiViz communication layer
β”œβ”€β”€ requirements.txt
└── README.md

πŸš€ Setup Instructions

1. Create & activate a virtual environment

Windows:

python -m venv .venv
.\.venv\Scripts\activate

macOS / Linux:

python3 -m venv .venv
source .venv/bin/activate

2. Install dependencies

pip install --upgrade pip
pip install -r requirements.txt

If you plan to run the notebook and Jupyter is not included:

pip install jupyterlab

πŸ”‘ Configure MultiViz API Key

Open the notebook:

notebooks/upload_to_multiviz.ipynb

Set your API key in the first code cell:

MULTIVIZ_API_KEY = "YOUR_API_KEY_HERE"
MULTIVIZ_BASE_URL = "https://api.beta.multiviz.com"

πŸ“˜ Running the Notebook

From the project root:

jupyter lab

Then open:

notebooks/upload_to_multiviz.ipynb

Run all cells from top to bottom.

The notebook will:

  • Initialize the MultivizClient
  • Show how to create waveform sources
  • Upload waveform measurements from JSON or CSV

πŸ“‘ Example 1 β€” JSON Upload

This example uses:

data/sample_payload.json

The function upload_example_measurement_json():

  • Loads payload
  • Builds waveform sources
  • Uploads waveform samples (X/Y/Z axes)
  • Sends metadata (location, asset, sensor, gateway, process_data, etc.)

To run:

upload_example_measurement_json()

πŸ“‘ Example 2 β€” CSV Upload

Files:

data/information.txt
data/values_1.csv
data/values_2.csv
data/values_3.csv

information.txt includes metadata such as:

Snapshot Id     : 202804
Recorded At     : 10/22/2025 00:58:37
Recorded by User: Unknown
Device Name        : UT-CMP-201
Device Serial      : VW8AQ5A840
Machine Name       : cylinder
Sensor Serial      : 1890727266
Sensor Name        : Sensor 1890727266
Samples            : 8192
Time Period        : 640ms
Sensor Position    : 1
Axis               : All
Freq Max           : 5000
FFT Res            : 1.563
Avg. Number        : 1
Slice/Bin Duration : 0ms

The function upload_example_measurement_csv() will:

  • Parse metadata
  • Load CSV sample columns
  • Create waveform sources (X/Y/Z)
  • Upload each measurement

Run:

upload_example_measurement_csv()

πŸ›  Troubleshooting

Import errors:

If you get:

ModuleNotFoundError: No module named 'src'

Ensure you launched Jupyter from the project root.

Or manually add it:

import sys
sys.path.append(".")

πŸ“¬ Support

If anything is unclear or you want the README adapted for internal documentation, just let me know!

πŸ“¦ Download

πŸ“₯ Download ZIP (v1.0.2)

Or always get the newest version:

⭐ Latest release