Skip to content

Commit

Permalink
update readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
hstewart93 committed Jul 1, 2024
1 parent 19ed670 commit 8b009db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ContinUNet
[![Pytest](https://github.com/hstewart93/continunet/actions/workflows/pytest.yml/badge.svg)](https://github.com/hstewart93/continunet/actions/workflows/pytest.yml)

Source finding package for radio continuum data powered by U-Net segmentation algorithm.

## Installation
Expand Down
5 changes: 3 additions & 2 deletions continunet/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(self, image: str, layers: int = 4):
if layers != 4:
raise ValueError("Number of layers must be 4.")
self.layers = layers
self.image_object = None
self.sources = None
self.reconstructed_image = None
self.post_processor = None
Expand All @@ -43,10 +44,10 @@ def find(self, generate_maps=False, use_raw=False):
"""Find sources in a continuum image."""
start_time = time.time()
# Load image
image_object = ImageSquare(self.image)
self.image_object = ImageSquare(self.image)

# Pre-process image
pre_processor = PreProcessor(image_object, self.layers)
pre_processor = PreProcessor(self.image_object, self.layers)
data = pre_processor.process()

# Run U-Net
Expand Down
3 changes: 2 additions & 1 deletion continunet/image/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def get_model_map(self, use_raw=False):

def get_residuals(self, use_raw=False):
"""Calculate the residuals from the input image and the model map."""
self.get_model_map(use_raw)
if self.model_map is None:
self.get_model_map(use_raw)
self.residuals = self.cutout_object.data - self.model_map
return self.residuals

0 comments on commit 8b009db

Please sign in to comment.