Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Finder class to compile all modules #22

Closed
hstewart93 opened this issue Jun 6, 2024 · 0 comments · Fixed by #31
Closed

Add Finder class to compile all modules #22

hstewart93 opened this issue Jun 6, 2024 · 0 comments · Fixed by #31
Labels
first release requirement Feature required for MVP
Milestone

Comments

@hstewart93
Copy link
Owner

hstewart93 commented Jun 6, 2024

"""Compile ContinUNet modules into Finder class for source finding."""

from continunet.image.fits import ImageSquare
from continunet.image.pre_processing import PreProcessor
from continunet.network.unet import Unet


class Finder:
    """Class for source finding in radio continuum images."""

    def __init__(self, image: str, layers: int = 4):
        if not image.endswith(".fits"):
            raise ValueError("File must be a .fits file.")
        self.image = image
        if layers != 4:
            raise ValueError("Number of layers must be 4.")
        self.layers = layers
        self.sources = None
        self.reconstructed_image = None
        self.segmentation_map = None
        self.model_map = None
        self.residuals = None
        self.raw_sources = None


    def find_sources(self):
        """Find sources in a continuum image."""
        image_object = ImageSquare(self.image)
        pre_processed_image = PreProcessor(image_object, self.layers)

        unet = Unet(pre_processed_image.data, layers=self.layers)
        # pre processor is not implemented but should take PreProcessor object and Unet.reconstructed
        # # PreProcessor has input data and wcs information for creating catalogue
        # post_processed_image = PostProcessor(unet.reconstructed, pre_processed_image)

        # self.sources = post_processed_image.catalogue

        return unet.reconstructed
@hstewart93 hstewart93 converted this from a draft issue Jun 6, 2024
@hstewart93 hstewart93 added the first release requirement Feature required for MVP label Jun 6, 2024
@hstewart93 hstewart93 moved this from Backlog to Ready in ContinUNet Development Jun 6, 2024
@hstewart93 hstewart93 moved this from Ready to In progress in ContinUNet Development Jun 6, 2024
@hstewart93 hstewart93 added this to the First Release milestone Jun 6, 2024
@hstewart93 hstewart93 linked a pull request Jun 21, 2024 that will close this issue
@hstewart93 hstewart93 moved this from In progress to In review in ContinUNet Development Jul 1, 2024
@github-project-automation github-project-automation bot moved this from In review to Done in ContinUNet Development Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first release requirement Feature required for MVP
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant