19 #ifndef __Radiation_Input__
20 #define __Radiation_Input__
24 #include "BaseInput.h"
29 vector<double> theta, phi;
30 vector<double> power_v, power_h, power_t;
31 vector<double> pol_axial_ratio, pol_tilt;
33 vector<double> E_theta_mag, E_phi_mag;
34 vector<double> E_theta_phase, E_phi_phase;
43 string searchString(
"RADIATION PATTERNS");
44 while (m_stream.good())
46 string line = readline();
48 if (line.find(searchString,0) != string::npos)
51 while (line.find(
"VOLTS/M",0) == string::npos)
64 stringstream ss(line);
66 theta.push_back(read_fixed(ss));
67 phi.push_back(read_fixed(ss));
68 power_v.push_back(read_fixed(ss));
69 power_h.push_back(read_fixed(ss));
70 power_t.push_back(read_fixed(ss));
71 pol_axial_ratio.push_back(read_fixed(ss));
72 pol_tilt.push_back(read_fixed(ss));
76 E_theta_mag.push_back(read_sci(ss));
77 E_theta_phase.push_back(read_fixed(ss));
79 E_phi_mag.push_back(read_sci(ss));
80 E_phi_phase.push_back(read_fixed(ss));
85 cout <<
"Radiation pattern: " << n_items <<
" lines" << endl;
92 if (difference(ai) > 1e-4)
102 if (n_items != ai.n_items)
105 for (
long i=0; i < n_items;i++)
107 if (theta[i] != ai.theta[i])
109 if (phi[i] != ai.phi[i])
114 ret += diff(power_v[i], ai.power_v[i]);
115 ret += diff(power_h[i], ai.power_h[i]);
116 ret += diff(power_t[i], ai.power_t[i]);
117 if (power_v[i] > -999.0)
119 ret += diff(pol_axial_ratio[i], ai.pol_axial_ratio[i]);
120 ret += diff(pol_tilt[i], ai.pol_tilt[i]);
122 ret += diff(deg_polar(E_theta_mag[i],E_theta_phase[i]), deg_polar(ai.E_theta_mag[i],ai.E_theta_phase[i]));
123 ret += diff(deg_polar(E_phi_mag[i],E_phi_phase[i]), deg_polar(ai.E_phi_mag[i],ai.E_phi_phase[i]));
126 catch (
string message)
128 cout <<
"Diff at [" << theta[i] <<
"," << phi[i] <<
"] : " << message << endl;