#!/usr/bin/env python # Simple script to run the alarm analyzer without visualization from alarm_analyzer import AlarmAnalyzer def main(): print("Creating analyzer instance...") # Create analyzer instance analyzer = AlarmAnalyzer('CardinalAlarmsDec25.csv', 'SensorReport Cardinal 2025-12-23_processed.xlsx') print("Loading data...") # Load data alarm_data, sensor_data = analyzer.load_data() print(f"Loaded {len(alarm_data)} alarm records") if analyzer.sensor_mapping: print(f"Created sensor mapping for {len(analyzer.sensor_mapping)} sensors") else: print("No sensor mapping created - sensor report may not have been processed correctly") print("Categorizing alarms...") # Categorize alarms categorized_data = analyzer.categorize_alarms() print("Pairing events and calculating durations...") # Pair events and calculate durations paired_events = analyzer.pair_events_and_calculate_durations() print("Performing basic analysis...") # Perform basic analysis basic_results = analyzer.basic_analysis() print("Performing advanced analysis...") # Perform advanced analysis advanced_results = analyzer.advanced_analysis() print("Exporting results...") # Export results (this doesn't require matplotlib) analyzer.export_results(output_dir='output') # Perform uptime analysis print("Performing uptime analysis...") uptime_results = analyzer.calculate_uptime_metrics() # Export uptime metrics to new files analyzer.export_uptime_metrics(output_dir="output", uptime_results=uptime_results) print("Analysis completed successfully!") print("Results have been exported to the output directory.") if __name__ == '__main__': main()