Skip to content

Commit

Permalink
Merge pull request #165 from simonsobs/single_det_map_modification
Browse files Browse the repository at this point in the history
Optimization of the proj for the case of some of det_weights == 0.0
  • Loading branch information
mhasself authored Jan 18, 2024
2 parents 4e8beac + 6ed3c5a commit 1a3cb2b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/Projection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1387,9 +1387,11 @@ void to_map_single_thread(Pointer<C> &pointer,
int n_det = pointer.DetCount();
for (int i_det = 0; i_det < n_det; ++i_det) {
FSIGNAL det_wt = 1.;
if (_det_weights->obj != NULL)
if (_det_weights->obj != NULL){
det_wt = *(FSIGNAL*)((char*)_det_weights->buf +
_det_weights->strides[0]*i_det);
if (det_wt == 0.) continue;
}
double dofs[4];
double coords[4];
FSIGNAL pf[S::comp_count];
Expand Down Expand Up @@ -1423,9 +1425,11 @@ void to_weight_map_single_thread(Pointer<C> &pointer,
int n_det = pointer.DetCount();
for (int i_det = 0; i_det < n_det; ++i_det) {
FSIGNAL det_wt = 1.;
if (_det_weights->obj != NULL)
if (_det_weights->obj != NULL){
det_wt = *(FSIGNAL*)((char*)_det_weights->buf +
_det_weights->strides[0]*i_det);
if (det_wt == 0.) continue;
}
double dofs[4];
double coords[4];
FSIGNAL pf[S::comp_count];
Expand Down Expand Up @@ -1694,9 +1698,10 @@ void precomp_to_map_single_thread(Pixelizor2_Flat<TilingSys> &tiling,

for (int i_det = 0; i_det < n_det; ++i_det) {
FSIGNAL det_wt = 1.;
if (_det_weights->obj != NULL)
if (_det_weights->obj != NULL){
det_wt = *(FSIGNAL*)((char*)_det_weights->buf + _det_weights->strides[0]*i_det);

if (det_wt == 0.) continue;
}
for (auto const &rng: ivals[i_det].segments) {
for (int i_time = rng.first; i_time < rng.second; ++i_time) {
const int *pixel_offset = pixel_buf_man.data_ptr[i_det] +
Expand Down Expand Up @@ -1728,9 +1733,10 @@ void precomp_to_weight_map_single_thread(Pixelizor2_Flat<TilingSys> &tiling,
assert(spin_proj_man.steps[1] == 1); // assumed below
for (int i_det = 0; i_det < n_det; ++i_det) {
FSIGNAL det_wt = 1.;
if (_det_weights->obj != NULL)
if (_det_weights->obj != NULL){
det_wt = *(FSIGNAL*)((char*)_det_weights->buf + _det_weights->strides[0]*i_det);

if (det_wt == 0.) continue;
}
for (auto const &rng: ivals[i_det].segments) {
for (int i_time = rng.first; i_time < rng.second; ++i_time) {
const int *pixel_offset = pixel_buf_man.data_ptr[i_det] +
Expand Down

0 comments on commit 1a3cb2b

Please sign in to comment.