Skip to content

Commit

Permalink
Add check for hwp buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
tskisner committed May 6, 2020
1 parent 7c70ea8 commit 43c2cf9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/toast/_libtoast_tod_pointing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ void init_tod_pointing(py::module & m) {
auto hwpbuf = py::cast <py::buffer> (hwpang);
pybuffer_check_1D <double> (hwpbuf);
py::buffer_info info_hwpang = hwpbuf.request();
if (info_hwpang.size != n) {
auto log = toast::Logger::get();
std::ostringstream o;
o << "HWP buffer size is not consistent.";
log.error(o.str().c_str());
throw std::runtime_error(o.str().c_str());
}
rawhwpang = reinterpret_cast <double *> (info_hwpang.ptr);
}
toast::pointing_matrix_healpix(hpix, nest, eps, cal, mode, n,
Expand Down
2 changes: 1 addition & 1 deletion src/toast/todmap/pointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def exec(self, data):
try:
hwpang = tod.local_hwp_angle()
except:
pass
hwpang = None

# read the common flags and apply bitmask

Expand Down

0 comments on commit 43c2cf9

Please sign in to comment.