30 vector<double> theta, phi;
31 vector<double> power_v, power_h, power_t;
32 vector<double> pol_axial_ratio, pol_tilt;
34 vector<double> E_theta_mag, E_phi_mag;
35 vector<double> E_theta_phase, E_phi_phase;
44 string searchString(
"RADIATION PATTERNS");
45 while (m_stream.good())
47 string line = readline();
49 if (line.find(searchString,0) != string::npos)
52 while (line.find(
"VOLTS/M",0) == string::npos)
65 stringstream ss(line);
67 theta.push_back(read_fixed(ss));
68 phi.push_back(read_fixed(ss));
69 power_v.push_back(read_fixed(ss));
70 power_h.push_back(read_fixed(ss));
71 power_t.push_back(read_fixed(ss));
72 pol_axial_ratio.push_back(read_fixed(ss));
73 pol_tilt.push_back(read_fixed(ss));
77 if (!sense_token.empty() && isalpha(
static_cast<unsigned char>(sense_token[0])))
80 pol_sense = sense_token;
81 E_theta_mag.push_back(read_sci(ss));
89 E_theta_mag.push_back(sense_token.empty() ? 0.0 : atof(sense_token.c_str()));
92 E_theta_phase.push_back(read_fixed(ss));
94 E_phi_mag.push_back(read_sci(ss));
95 E_phi_phase.push_back(read_fixed(ss));
100 cout <<
"Radiation pattern: " << n_items <<
" lines" << endl;
107 if (difference(ai) > 1e-4)
117 if (n_items != ai.n_items)
120 for (
long i=0; i < n_items;i++)
122 if (theta[i] != ai.theta[i])
124 if (phi[i] != ai.phi[i])
129 ret += diff(power_v[i], ai.power_v[i]);
130 ret += diff(power_h[i], ai.power_h[i]);
131 ret += diff(power_t[i], ai.power_t[i]);
132 if (power_v[i] > -999.0)
134 ret += diff(pol_axial_ratio[i], ai.pol_axial_ratio[i]);
135 ret += diff(pol_tilt[i], ai.pol_tilt[i]);
137 ret += diff(deg_polar(E_theta_mag[i],E_theta_phase[i]), deg_polar(ai.E_theta_mag[i],ai.E_theta_phase[i]));
138 ret += diff(deg_polar(E_phi_mag[i],E_phi_phase[i]), deg_polar(ai.E_phi_mag[i],ai.E_phi_phase[i]));
141 catch (
string message)
143 cout <<
"Diff at [" << theta[i] <<
"," << phi[i] <<
"] : " << message << endl;