#!/usr/bin/env ruby $: << '~/src/eclipse/autopilot/common/ruby/' require 'gnuplot' require 'gnuplot_support' require 'process_log.rb' =begin # 3Dƒvƒƒbƒg Plotter3::plot_basic('3D.eps'){|plot| data_x = [1,1,4,4] data_y = [1,4,4,1] data_z = [3,4,2,1] plot.xrange '[-10:10]' plot.yrange '[-10:10]' plot.set('zrange', '[0:10]') plot.set('pm3d') plot.set('dgrid3d', '30,30') plot.set('hidden3d') plot.set('ticslevel', 0) items = [ Gnuplot::DataSet::new([data_x, data_y, data_z]){|ds| ds.with = "dots"# lw 3" ds.title = "Test" } ] plot.data = items } =end data = ProcessLog::log2hash($stdin) =begin data.each{|sid, sat_val| puts "SID: #{sid}" sat_val.each{|freq, freq_val| puts "FREQ: #{freq}; Max: #{freq_val[MAX][0]} at #{freq_val[MAX][1]}" } } =end Plotter::plot_basic_3d('AQ_CA.eps'){|plot| plot_data_sat = [] # X plot_data_freq = [] # Y plot_data_power = [] # d data.sort.each{|sat| sid, sat_val = sat if plot_data_sat.empty? then sat_val.sort.each{|freq_data| plot_data_freq << (freq_data[0] / 1E6) } end plot_data_power << [] sat_val.sort.each{|freq_data| plot_data_power.last << freq_data[1][ProcessLog::MAX][0] } plot_data_sat << sid } plot.xrange '[1:36]' plot.yrange '[1.395:1.415]' plot.set('zrange', '[400:1200]') plot.xlabel "'Satellite ID'" plot.ylabel "'IF [MHz]'" plot.set('zlabel', "'Power'") plot.set('pm3d') plot.set('palette', 'defined (400 "blue", 525 "white", 625 "red", 1200 "red")') #plot.set('dgrid3d', '41,71') plot.set('hidden3d') plot.set('ticslevel', 0.3) plot.set('view 65,340') #p [plot_data_sat, plot_data_freq, plot_data_power] items = [ Gnuplot::DataSet::new(DataSet3D::new([plot_data_sat, plot_data_freq, plot_data_power])){|ds| ds.with = "dots" #"lines lw 2" ds.title = "Analysis Result" } ] plot.data = items }