3 #ifndef SZA_UTIL_CARMACONFIG_H
4 #define SZA_UTIL_CARMACONFIG_H
15 #include "carma/szautil/Angle.h"
18 #include "carma/szautil/Length.h"
44 sza::util::Length diameter_;
45 sza::util::Length sweptVolumeDiameter_;
46 sza::util::Length elAxisHeight_;
47 sza::util::Length cylinderDiameter_;
51 unsigned subarrayNumber_;
59 Antenna(
const Antenna& location) {
63 Antenna(Antenna& location) {
67 void operator=(
const Antenna& location) {
68 *
this = (Antenna&) location;
72 void operator=(Antenna& ant) {
73 antNumber_ = ant.antNumber_;
74 diameter_ = ant.diameter_;
75 sweptVolumeDiameter_ = ant.sweptVolumeDiameter_;
76 elAxisHeight_ = ant.elAxisHeight_;
77 cylinderDiameter_ = ant.cylinderDiameter_;
78 antFlag_ = ant.antFlag_;
79 tracking_ = ant.tracking_;
80 subarrayNumber_ = ant.subarrayNumber_;
83 sza::util::AntennaType::Type getAntType();
87 std::string antType();
91 friend std::ostream& operator<<(std::ostream& os, Antenna& pad);
143 BO = BO_OVRO | BO_BIMA,
148 CO = CO_OVRO | CO_BIMA,
153 DO = DO_OVRO | DO_BIMA,
155 ANY = A|B|C|D|E|H|L|I|BO|CO|DO,
157 BIMA = A_BIMA|B_BIMA|C_BIMA|D_BIMA|E_BIMA|BO_BIMA|CO_BIMA|DO_BIMA,
158 OVRO = A_OVRO|B_OVRO|C_OVRO|D_OVRO|E_OVRO|BO_OVRO|CO_OVRO|DO_OVRO,
160 SZA = H_SZA|L_SZA|I_SZA|BP_SZA|AP_SZA
173 sza::util::Length east_;
175 sza::util::Length north_;
177 sza::util::Length up_;
180 CarmaConfig::Antenna ant_;
189 virtual ~PadLocation() {};
191 PadLocation(
unsigned padNumber,
192 double eastInMeters,
double northInMeters,
194 unsigned occupationFlags) {
196 padNumber_ = padNumber;
197 east_.setMeters(eastInMeters);
198 north_.setMeters(northInMeters);
199 up_.setMeters(upInMeters);
200 flags_ = occupationFlags;
204 PadLocation(
const PadLocation& location) {
208 PadLocation(PadLocation& location) {
212 void operator=(
const PadLocation& location) {
213 *
this = (PadLocation&) location;
216 void operator=(PadLocation& location) {
217 east_ = location.east_;
218 north_ = location.north_;
220 flags_ = location.flags_;
221 padNumber_ = location.padNumber_;
222 ant_ = location.ant_;
223 validity_ = location.validity_;
228 friend std::ostream& operator<<(std::ostream& os, PadLocation& pad);
233 bool isShadowed(Angle& az, Angle& el, PadLocation& pad);
238 bool isShadowed(Angle& az0, Angle& el0, PadLocation& pad,
239 bool useSweptVolumeDiameter,
240 Percent& percent,
bool isPercentOfDiameter,
bool verbose=
false);
242 double shadowedArea(
double radiusShadowedAnt,
double radiusShadowingAnt,
double sep);
244 std::string listConfigs();
246 void addConf(std::ostringstream& os,
bool& prev,
247 unsigned flags,
unsigned conf);
256 virtual ~CarmaConfig();
258 CarmaConfig(
const CarmaConfig& conf);
259 CarmaConfig(CarmaConfig& conf);
260 void operator=(
const CarmaConfig& conf);
261 void operator=(CarmaConfig& conf);
270 bool isOccupied(
unsigned padNumber,
unsigned configFlag);
275 static Antenna getAntennaInfo(
unsigned configFlag);
280 void associatePadAndAntenna(std::vector<PadLocation>& pads,
281 unsigned padNumber,
unsigned antNumber);
285 void associatePadAndAntenna(
unsigned padNumber,
unsigned antNumber);
291 std::vector<PadLocation> getConfiguration(
unsigned flag);
293 std::vector<PadLocation> getConfiguration(std::string name);
297 std::vector<PadLocation> getSzaImagingConfiguration();
298 std::vector<PadLocation> getSzaLowDecConfiguration();
299 std::vector<PadLocation> getSzaHighDecConfiguration();
300 std::vector<PadLocation> getSzaBPConfiguration();
301 std::vector<PadLocation> getSzaAPConfiguration();
306 void associateSzaImagingConfiguration(std::vector<PadLocation>& pads);
307 void associateSzaLowDecConfiguration(std::vector<PadLocation>& pads);
308 void associateSzaHighDecConfiguration(std::vector<PadLocation>& pads);
309 void associateSzaAPConfiguration(std::vector<PadLocation>& pads);
310 void associateSzaBPConfiguration(std::vector<PadLocation>& pads);
314 std::vector<PadLocation> sortByAntNumber(std::vector<PadLocation>& pads);
320 void initializeCurrentConfiguration();
321 void setCurrentConfiguration(
unsigned flag);
322 void setCurrentConfiguration(std::string name);
323 void setCurrentConfiguration(ArrayConfig::Type type);
324 void addPad(
unsigned padNumber,
unsigned antType,
int antNumber=-1);
325 void removePad(
unsigned padNumber);
326 void addPad(std::vector<PadLocation>& pads);
327 void removePad(std::vector<PadLocation>& pads);
328 std::vector<PadLocation> getCurrentConfiguration();
329 std::vector<PadLocation> getAllPads();
331 static unsigned confNameToFlag(std::string name);
332 static unsigned confTypeToFlag(ArrayConfig::Type type);
333 static std::string confFlagToName(
unsigned flag);
334 static ArrayConfig::Type confFlagToType(
unsigned flag);
336 std::string confName() {
337 return confFlagToName(currentConfFlag_);
340 ArrayConfig::Type confType() {
341 return confFlagToType(currentConfFlag_);
345 unsigned currentConfFlag_;
347 PadLocation findNearest(Length east, Length north);
353 PadLocation getPadByNumber(
unsigned padNumber);
355 void initializeCarmaPadLocations();
359 std::vector<PadLocation> padLocations_;
365 std::vector<PadLocation> currentConfiguration_;
374 #endif // End #ifndef SZA_UTIL_CARMACONFIG_H
Tagged: Mon Aug 17 11:01:48 PDT 2009.
Tagged: Thu Oct 9 22:48:42 PDT 2008.
Tagged: Sat Mar 27 16:28:13 PST 2004.
Tagged: Wed Oct 15 14:14:12 PDT 2008.