Skip to content

Commit

Permalink
fix typo on noise map population
Browse files Browse the repository at this point in the history
  • Loading branch information
mmccrackan committed Jul 19, 2024
1 parent 361f499 commit c8a3ba0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/citlali/core/mapmaking/jinc_mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ void JincMapmaker::populate_maps_jinc(TCData<TCDataKind::PTC, Eigen::MatrixXd> &
}

if (run_noise) {
for (int i=0; i<omb.noise.size(); ++i) {
for (int i=0; i<nmb->noise.size(); ++i) {
nmb->noise[i] += nmb_copy->noise[i];
}
}
Expand Down
16 changes: 14 additions & 2 deletions include/citlali/core/mapmaking/naive_mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ void NaiveMapmaker::populate_maps_naive(TCData<TCDataKind::PTC, Eigen::MatrixXd>
// pointer to map buffer with noise maps
map_buffer_t *nmb, *nmb_copy;

// get pointer to map buffer for noise maps
if (run_noise) {
nmb = use_cmb ? &cmb : (use_omb ? &omb : nullptr);
nmb_copy = use_cmb ? &cmb_copy : (use_omb ? &omb_copy : nullptr);
Expand All @@ -159,9 +160,20 @@ void NaiveMapmaker::populate_maps_naive(TCData<TCDataKind::PTC, Eigen::MatrixXd>
// cosine and sine of angles
double angle, cos_2angle, sin_2angle;

// add detector to map?
bool run_det;

for (Eigen::Index i=0; i<n_dets; ++i) {
// skip fg = -1 if in polarization mode
if (run_polarization && apt["fg"](i)==-1) {
run_det = false;
}
else {
run_det = true;
}

// skip completely flagged detectors
if ((in.flags.data.col(i).array()==0).any()) {
if ((in.flags.data.col(i).array()==0).any() && run_det) {
// which map to assign detector to
Eigen::Index map_index = map_indices(i);

Expand Down Expand Up @@ -311,7 +323,7 @@ void NaiveMapmaker::populate_maps_naive(TCData<TCDataKind::PTC, Eigen::MatrixXd>
}

if (run_noise) {
for (int i=0; i<omb.noise.size(); ++i) {
for (int i=0; i<nmb->noise.size(); ++i) {
nmb->noise[i] += nmb_copy->noise[i];
}
}
Expand Down

0 comments on commit c8a3ba0

Please sign in to comment.