+------------------------------------------------------------------------------ | Program Name: step_a_prepare.py | Program Version: 2026-09-10 10:49:28 | Date: 2026-09-11 | Time: 08:49:53 | Input 1 - Raw CSV: chem_reactors_21d.csv | Input 2 - Glossary: chem_reactors_schema.csv | Input 3 - Time stamp: Timestamp (e.g. "2024-01-01 00:00:00") -> 1.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 |
|---|---|---|---|
| chem_reactors_21d.csv | data | 43.1 MB | /Users/yahyanazer/Dropbox/__C_2026_Work/CTRL-Designer/B-CDL-Data-Analysis/A-Raw-Data/Chem-Reactors/chem_reactors_21d.csv |
| chem_reactors_schema.csv | glossary (TAG - Description - EU) | 5 kB | /Users/yahyanazer/Dropbox/__C_2026_Work/CTRL-Designer/B-CDL-Data-Analysis/A-Raw-Data/Chem-Reactors/chem_reactors_schema.csv |
Timestamp formats found in the raw files:
| file | first timestamp as written |
|---|---|
| chem_reactors_21d.csv | 2024-01-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 | 0 values |
| 3 | Put every tag on one regular time grid | 30,240 samples at 1 min; 0 timestamps were absent |
| 4 | Fill gaps of at most 5 samples by time interpolation | 163,759 values filled |
| 5 | Score every tag: missing, bad values, update interval, longest flat run, spikes | 90 tags scored |
| 6 | Drop tags that are constant or mostly missing | 12 dropped, 78 kept |
| 7 | Apply the repair rules | gaps<=5 interpolate; slow tags held; frozen unknown; spikes flag → 0 actions |
| 8 | Locate every issue in time | 43 issues: spike 42, missing 1 |
| 9 | Attach descriptions and units from the glossary | 78 AI, 0 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 | 25 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/Chemical-Reactors-21d-AIAO/prepare_report.html |
| bad_tags_report.html | every flagged tag: trend + zoom per bad zone | 13 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/Chemical-Reactors-21d-AIAO/bad_tags_report.html |
| fixed_tags_report.html | ACTUAL / BAD / FIXED per repaired tag | 12 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/Chemical-Reactors-21d-AIAO/fixed_tags_report.html |
| data.parquet | the corrected table Step B reads | 23.6 MB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/Chemical-Reactors-21d-AIAO/data.parquet |
| data.csv | same table for Excel / Seeq | 43.7 MB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/Chemical-Reactors-21d-AIAO/data.csv |
| raw_on_grid.parquet | raw values on the same grid (before/after) | 22.4 MB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/Chemical-Reactors-21d-AIAO/raw_on_grid.parquet |
| repairs.csv | every repair action with its reason | 0 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/Chemical-Reactors-21d-AIAO/repairs.csv |
| data_quality.csv | per-tag metrics and status | 8 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/Chemical-Reactors-21d-AIAO/data_quality.csv |
| issues.csv | every issue located in time | 3 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/Chemical-Reactors-21d-AIAO/issues.csv |
| glossary_used.csv | TAG - Description - EU as used | 4 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/Chemical-Reactors-21d-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/Chemical-Reactors-21d-AIAO/manifest.json |
| quality_overview.png | tags x time availability map | 221 kB | /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/Chemical-Reactors-21d-AIAO/quality_overview.png |
Project folder: /Volumes/YN-4T/WIP/CTRL-Designer/B-CDL-Data-Analysis/A-Data/Chemical-Reactors-21d-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/Chemical-Reactors-21d-AIAO/.© 2026 CTRL Designer LLC. All rights reserved.
Yahya Nazer · info@ctrlDesigner.com