3
3
#include < fstream>
4
4
#include < random>
5
5
#include < sys/stat.h>
6
+ #include " purify/h5reader.h"
6
7
#include " purify/logging.h"
7
8
#include " purify/operators.h"
8
- #include " purify/h5reader.h"
9
9
10
10
namespace purify {
11
11
namespace utilities {
12
12
13
13
bool has_suffix (const std::string &str, const std::string &suff) {
14
- return str.size () >= suff.size () &&
15
- str.compare (str.size () - suff.size (), suff.size (), suff) == 0 ;
14
+ return str.size () >= suff.size () && str.compare (str.size () - suff.size (), suff.size (), suff) == 0 ;
16
15
}
17
16
18
17
Matrix<t_real> generate_antennas (const t_uint N, const t_real scale) {
@@ -247,8 +246,7 @@ utilities::vis_params read_visibility_h5(const std::string &vis_name, const bool
247
246
if (w_term) {
248
247
std::vector<t_real> wtemp = vis_file.read <t_real>(" w" );
249
248
uv_vis.w = Eigen::Map<Vector<t_real>>(wtemp.data (), wtemp.size (), 1 );
250
- }
251
- else {
249
+ } else {
252
250
uv_vis.w = Vector<t_real>::Zero (utemp.size ());
253
251
}
254
252
@@ -259,7 +257,7 @@ utilities::vis_params read_visibility_h5(const std::string &vis_name, const bool
259
257
260
258
uv_vis.vis = Vector<t_complex>::Zero (retemp.size ());
261
259
uv_vis.weights = Vector<t_complex>::Zero (retemp.size ());
262
- for (size_t i= 0 ; i< retemp.size (); ++i) {
260
+ for (size_t i = 0 ; i < retemp.size (); ++i) {
263
261
uv_vis.vis (i) = t_complex (retemp[i], imtemp[i]);
264
262
uv_vis.weights (i) = 1 / sigma[i];
265
263
}
@@ -272,9 +270,8 @@ utilities::vis_params read_visibility_h5(const std::string &vis_name, const bool
272
270
}
273
271
274
272
utilities::vis_params read_visibility (const std::string &vis_name, const bool w_term) {
275
-
276
- if ( has_suffix (vis_name, " .h5" ) ) return read_visibility_h5 (vis_name, w_term);
277
- return read_visibility_csv (vis_name, w_term);
273
+ if (has_suffix (vis_name, " .h5" )) return read_visibility_h5 (vis_name, w_term);
274
+ return read_visibility_csv (vis_name, w_term);
278
275
}
279
276
280
277
void write_visibility (const utilities::vis_params &uv_vis, const std::string &file_name,
0 commit comments