360 Secure SkillHub
360 安全技能中心

Clay

该 Skill 通过 Python 脚本对 PMU(相量测量单元)CSV 数据执行质量检查,对照可配置的 IEEE/NERC 安全限值校验频率、电压幅值、相量角、缺失值和时间戳连续性,输出 stdout 汇总、标记行 CSV 及可选 HTML 图表报告。

clayutk
clayutk
热度 42.81
最近更新 2026-05-11 17:36:35
分类:数据依赖:代码执行 / 读写文件应用场景:数据处理 / 报告撰写 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pmu-data-quality-skill
Metadata
name
pmu-data-quality
description
Run data quality checks on PMU (Phasor Measurement Unit) data. Use when the user asks to validate, check, or audit PMU measurements including frequency, voltage magnitude, and phasor angle data against security limits. Also triggers for keywords like "data quality", "PMU check", "out of range", "bad data", or "security limit".
allowed-tools
["Bash","Read","Write","Glob"]

PMU Data Quality Checker

Performs automated data quality checks on PMU (Phasor Measurement Unit) CSV data files against configurable security limits defined in IEEE/NERC standards.

What This Skill Checks

  1. Frequency Data — Checks if frequency measurements stay within the nominal range (default: 59.95–60.05 Hz for 60 Hz systems)
  2. Voltage Magnitude Data — Checks if voltage magnitudes stay within acceptable per-unit limits (default: 0.95–1.05 pu)
  3. Phasor Angle Data — Checks if phasor angles stay within expected bounds (default: -180° to +180°, with rate-of-change check)
  4. Missing / NaN Data — Flags rows with missing or null values
  5. Timestamp Continuity — Detects gaps in the reporting rate (e.g., expected 30 samples/sec or 60 samples/sec)

How to Use

Quick check on a CSV file:

python <skill_base_path>/scripts/pmu_quality_check.py path/to/data.csv

With custom limits config:

python <skill_base_path>/scripts/pmu_quality_check.py path/to/data.csv --config <skill_base_path>/templates/limits_config.json

On the template sample data (for testing):

python <skill_base_path>/scripts/pmu_quality_check.py <skill_base_path>/templates/sample_pmu_data.csv

Expected CSV Format

The input CSV should have columns similar to:

timestamp frequency voltage_mag voltage_angle current_mag current_angle
  • timestamp — ISO 8601 or Unix epoch
  • frequency — in Hz
  • voltage_mag — in per-unit (pu) or kV (specify in config)
  • voltage_angle / current_angle — in degrees
  • current_mag — in per-unit (pu) or Amps

Column names are configurable via the limits config JSON. If the user's CSV uses different column names (like those from openHistorian or FNET exports), update the column_mapping section in the config.

Output

The script produces:

  • A summary report printed to stdout
  • A flagged rows CSV saved alongside the input (e.g., data_flagged.csv)
  • An optional HTML report with charts if --html flag is passed

Workflow

  1. Ask the user for their PMU data file (CSV)
  2. Check if the column names match the expected format; if not, ask or auto-detect
  3. Run the quality check script
  4. Present the summary and ask if the user wants to adjust limits or dig deeper into flagged data