+------------------------------------------------------------------------------ | Program Name: step_a_prepare.py | Program Version: 2026-09-10 10:49:28 | Date: 2026-09-11 | Time: 08:48:52 | Input 1 - Raw CSV: tep_plant_10days.csv | Input 2 - Glossary: tep_schema.csv | Input 3 - Time stamp: auto-detected (e.g. "2026-04-01 00:00:00") -> 3.0 min grid +------------------------------------------------------------------------------
CTRL Designer LLC
| Step | Name | What it does | Program | Output folder | State |
|---|---|---|---|---|---|
| A | Prepare | Raw historian exports become one clean, regular Data table. Merge files, normalise timestamps, replace bad-value strings, put on a regular grid, fill short gaps, apply the repair rules, and record every change. | step_a_prepare.py + A-Prepare-GUI-v01.py | A-Data/<project>/ | you are here |
| B | Explore | Trend and cluster the clean data. The engineer chooses which tags, which period, and which window counts as normal, and writes it down as the scope. | step_b_explore.py + B-Explore-GUI-v01.py | B-Scope/<project>/ | next |
| C | Analyze | Operability (PCA, T2/SPE, events), oscillation and slowness per tag, control-loop metrics, batch phases - all driven by the scope from B. | step_c_analyze.py + C-Analyze-GUI-v01.py | C-Analysis/<project>/ | |
| D | AI review | An AI reads the results and the scope and drafts findings, anomalies and questions for the engineer. | step_d_review.py + D-Review-GUI-v01.py | D-Review/<project>/ | |
| E | Report | The engineer edits, decides, and either closes the study or returns to B with a new scope. | to build | E-Report/<project>/ |
| File | Role | Size | Location |
|---|---|---|---|
| tep_plant_10days.csv | data | 1.8 MB | /Users/yahyanazer/Dropbox/__C_2026_Work/CTRL-Designer/B-CDL-Data-Analysis/A-Raw-Data/TEP/tep_plant_10days.csv |
| tep_schema.csv | glossary (TAG - Description - EU) | 6 kB | /Users/yahyanazer/Dropbox/__C_2026_Work/CTRL-Designer/B-CDL-Data-Analysis/A-Raw-Data/TEP/tep_schema.csv |
Timestamp formats found in the raw files:
| file | first timestamp as written |
|---|---|
| tep_plant_10days.csv | 2026-04-01 00:00:00 |
Raw data root: /Users/yahyanazer/Dropbox/__C_2026_Work/CTRL-Designer/B-CDL-Data-Analysis/A-Raw-Data
| # | Operation | Result |
|---|---|---|
| 1 | Read the raw files and detect the timestamp column | single file; formats seen: 1 |
| 2 | Replace PI bad-value strings (Bad, No Data, Shutdown, …) with unknown | 15 values |
| 3 | Put every tag on one regular time grid | 4,800 samples at 3 min; 40 timestamps were absent |
| 4 | Fill gaps of at most 5 samples by time interpolation | 265 values filled |
| 5 | Score every tag: missing, bad values, update interval, longest flat run, spikes | 52 tags scored |
| 6 | Drop tags that are constant or mostly missing | 0 dropped, 52 kept |
| 7 | Apply the repair rules | gaps<=5 interpolate; slow tags held; frozen unknown; spikes flag → 7 actions |
| 8 | Locate every issue in time | 214 issues: spike 154, missing 52, slow update 6, bad values 1, frozen 1 |
| 9 | Attach descriptions and units from the glossary | 41 AI, 11 AO tags labelled |
| 10 | Draw the evidence and write the reports | availability map, issue timeline, per-tag panels, 4 HTML reports |
| File | What it is | Size | Location |
|---|---|---|---|
| prepare_report.html | what Step A did, with the charts | 29 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/TEP-Plant-10days-AIAO/prepare_report.html |
| bad_tags_report.html | every flagged tag: trend + zoom per bad zone | 58 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/TEP-Plant-10days-AIAO/bad_tags_report.html |
| fixed_tags_report.html | ACTUAL / BAD / FIXED per repaired tag | 48 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/TEP-Plant-10days-AIAO/fixed_tags_report.html |
| data.parquet | the corrected table Step B reads | 888 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/TEP-Plant-10days-AIAO/data.parquet |
| data.csv | same table for Excel / Seeq | 1.8 MB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/TEP-Plant-10days-AIAO/data.csv |
| raw_on_grid.parquet | raw values on the same grid (before/after) | 874 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/TEP-Plant-10days-AIAO/raw_on_grid.parquet |
| repairs.csv | every repair action with its reason | 1 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/TEP-Plant-10days-AIAO/repairs.csv |
| data_quality.csv | per-tag metrics and status | 3 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/TEP-Plant-10days-AIAO/data_quality.csv |
| issues.csv | every issue located in time | 12 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/TEP-Plant-10days-AIAO/issues.csv |
| glossary_used.csv | TAG - Description - EU as used | 3 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/TEP-Plant-10days-AIAO/glossary_used.csv |
| manifest.json | inputs, settings, counts - the reproducibility record | 1 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/TEP-Plant-10days-AIAO/manifest.json |
| quality_overview.png | tags x time availability map | 157 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/TEP-Plant-10days-AIAO/quality_overview.png |
Project folder: /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/TEP-Plant-10days-AIAO
data.parquet from this folder, trend and cluster the tags, choose the tags, the period and the reference (normal) window, and write scope.json into B-Scope/TEP-Plant-10days-AIAO/.© 2026 CTRL Designer LLC. All rights reserved.
Yahya Nazer · info@ctrlDesigner.com