Source
69
69
csys.spectralCoordinate().restFrequency(), "Hz"
70
70
);
71
71
Vector<Stokes::StokesTypes> stokes(0);
72
72
try {
73
73
AnnCircle circle(
74
74
centerx, centery, radius, dirTypeString,
75
75
csys, shape, beginFreq, endFreq, freqRefFrameString,
76
76
dopplerString, restfreq, stokes, false
77
77
);
78
78
thrown = false;
79
-
} catch (AipsError x) {
79
+
} catch (const AipsError& x) {
80
80
log << LogIO::NORMAL
81
81
<< "Exception thrown as expected: " << x.getMesg()
82
82
<< LogIO::POST;
83
83
}
84
84
AlwaysAssert(thrown, AipsError);
85
85
}
86
86
{
87
87
log << LogIO::NORMAL
88
88
<< "Test that bad quantity for world direction coordinate throws exception"
89
89
<< LogIO::POST;
106
106
csys.spectralCoordinate().restFrequency(), "Hz"
107
107
);
108
108
Vector<Stokes::StokesTypes> stokes(0);
109
109
try {
110
110
AnnCircle circle(
111
111
centerx, centery, radius, dirTypeString,
112
112
csys, shape, beginFreq, endFreq, freqRefFrameString,
113
113
dopplerString, restfreq, stokes, false
114
114
);
115
115
thrown = false;
116
-
} catch (AipsError x) {
116
+
} catch (const AipsError& x) {
117
117
log << LogIO::NORMAL
118
118
<< "Exception thrown as expected: " << x.getMesg()
119
119
<< LogIO::POST;
120
120
}
121
121
AlwaysAssert(thrown, AipsError);
122
122
}
123
123
124
124
{
125
125
log << LogIO::NORMAL
126
126
<< "Test region outside image throws exception"
129
129
Quantity centerx(450, "pix");
130
130
Quantity centery(400, "pix");
131
131
Quantity radius(30, "arcsec");
132
132
Vector<Stokes::StokesTypes> stokes(0);
133
133
try {
134
134
AnnCircle circle(
135
135
centerx, centery, radius,
136
136
csys, shape, stokes
137
137
);
138
138
thrown = false;
139
-
} catch (ToLCRegionConversionError x) {
139
+
} catch (const ToLCRegionConversionError& x) {
140
140
log << LogIO::NORMAL
141
141
<< "Exception thrown as expected: "
142
142
<< x.getMesg() << LogIO::POST;
143
143
}
144
144
AlwaysAssert(thrown, AipsError);
145
145
}
146
146
{
147
147
log << LogIO::NORMAL
148
148
<< "Test region outside image not required"
149
149
<< LogIO::POST;
152
152
Quantity centery(400, "pix");
153
153
Quantity radius(30, "arcsec");
154
154
Vector<Stokes::StokesTypes> stokes(0);
155
155
Bool requireRegion(false);
156
156
try {
157
157
AnnCircle circle(
158
158
centerx, centery, radius,
159
159
csys, shape, stokes, requireRegion
160
160
);
161
161
thrown = false;
162
-
} catch (ToLCRegionConversionError x) {
162
+
} catch (const ToLCRegionConversionError& x) {
163
163
log << LogIO::NORMAL
164
164
<< "Unexpected exception thrown: "
165
165
<< x.getMesg() << LogIO::POST;
166
166
}
167
167
AlwaysAssert(!thrown, AipsError);
168
168
}
169
169
170
170
{
171
171
Quantity centerx(-0.01, "deg");
172
172
Quantity centery(0.02, "deg");
599
599
cout << freqs[0].get("Hz").getValue() << endl;
600
600
AlwaysAssert(
601
601
near(freqs[0].get("Hz").getValue(), 1410929824.5978253),
602
602
AipsError
603
603
);
604
604
AlwaysAssert(
605
605
near(freqs[1].get("Hz").getValue(), 1429881678.974175),
606
606
AipsError
607
607
);
608
608
}
609
-
} catch (AipsError x) {
609
+
} catch (const AipsError& x) {
610
610
cerr << "Caught exception: " << x.getMesg() << endl;
611
611
return 1;
612
612
}
613
613
614
614
cout << "OK" << endl;
615
615
return 0;
616
616
}