Skip to content

Commit

Permalink
Update the new code to fit the eigen transition, fix more tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
DinoBektesevic committed Oct 24, 2023
1 parent d7e644f commit 14caac8
Show file tree
Hide file tree
Showing 13 changed files with 338 additions and 362 deletions.
4 changes: 2 additions & 2 deletions src/kbmod/fake_data_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def make_fake_ImageStack(self):
for i in range(self.num_times):
img = LayeredImage(
("%06i" % i),
self.width,
self.height,
self.width,
self.noise_level,
self.noise_level**2,
self.times[i],
Expand Down Expand Up @@ -142,7 +142,7 @@ def insert_object(self, trj):
# re-set the image. This last step needs to be done
# explicitly because of how pybind handles references.
current = self.stack.get_single_image(i)
add_fake_object(current, px, py, trj.flux, current.get_psf())
add_fake_object(current, py, px, trj.flux, current.get_psf())

# Save the trajectory into the internal list.
self.trajectories.append(trj)
Expand Down
1 change: 1 addition & 0 deletions src/kbmod/search/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ PYBIND11_MODULE(search, m) {
search::layered_image_bindings(m);
search::image_stack_bindings(m);
search::stack_search_bindings(m);
search::stamp_creator_bindings(m);
search::trajectory_bindings(m);
search::pixel_pos_bindings(m);
search::image_moments_bindings(m);
Expand Down
16 changes: 8 additions & 8 deletions src/kbmod/search/raw_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,12 @@ RawImage& RawImage::operator=(RawImage&& source) {
for(int j = 0; j < height; ++j) {
for(int i = 0; i < width; ++i){
if (bitmask(j, i) == -1){
if (((j-1 > 0) && (bitmask(j-1, i) == itr-1)) ||
((i-1 > 0) && (bitmask(j, i-1) == itr-1)) ||
if (((j-1 >= 0) && (bitmask(j-1, i) == itr-1)) ||
((i-1 >= 0) && (bitmask(j, i-1) == itr-1)) ||
((j+1 < height) && (bitmask(j+1, i) == itr-1)) ||
((i+1 < width) && (bitmask(j, i+1) == itr-1))){
bitmask(j, i) = itr;
}
}
}
} // for i
} // for j
Expand Down Expand Up @@ -351,10 +351,10 @@ RawImage& RawImage::operator=(RawImage&& source) {
dist2 = new_dist2;
}
}
}

} // for x
} // for y
return result;
}
}


// Find the basic image moments in order to test if stamps have a gaussian shape.
Expand Down Expand Up @@ -581,8 +581,8 @@ RawImage& RawImage::operator=(RawImage&& source) {
// and value based filtering.
result(y, x) = 0.0;
}
}

} // for x
} // for y
return RawImage(result);
}

Expand Down
Loading

0 comments on commit 14caac8

Please sign in to comment.