Skip to content

Commit

Permalink
Optional fwhm=None in FrameSelectionModule
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Stolker committed Feb 28, 2020
1 parent 6be597d commit da4f0d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions pynpoint/processing/frameselection.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def __init__(self,
index_out_tag: str = None,
method: str = 'median',
threshold: float = 4.,
fwhm: float = 0.1,
fwhm: Union[float, None] = 0.1,
aperture: Union[Tuple[str, float], Tuple[str, float, float]] = ('circular', 0.2),
position: Union[Tuple[int, int, float], Tuple[None, None, float],
Tuple[int, int, None]] = None) -> None:
Expand All @@ -161,10 +161,10 @@ def __init__(self,
threshold : float
Threshold in units of sigma for the frame selection. All images that are a `threshold`
number of sigmas away from the median/maximum photometry will be removed.
fwhm : float
fwhm : float, None
The FWHM (arcsec) of the Gaussian kernel that is used to smooth the images before the
brightest pixel is located. Recommended to be similar in size to the FWHM of the
stellar PSF.
stellar PSF. No smoothing is applied if set to None.
aperture : tuple(str, float), tuple(str, float, float)
Tuple with the aperture properties for measuring the photometry around the location of
the brightest pixel. The first element contains the aperture type ('circular',
Expand Down Expand Up @@ -282,7 +282,8 @@ def run(self) -> None:
pixscale = self.m_image_in_port.get_attribute('PIXSCALE')
nimages = self.m_image_in_port.get_shape()[0]

self.m_fwhm = int(math.ceil(self.m_fwhm/pixscale))
if self.m_fwhm is not None:
self.m_fwhm = int(math.ceil(self.m_fwhm/pixscale))

if self.m_position is not None and self.m_position[2] is not None:
self.m_position = (self.m_position[0],
Expand Down
6 changes: 3 additions & 3 deletions pynpoint/util/star.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def locate_star(image: np.ndarray,

@typechecked
def star_positions(input_port: InputPort,
fwhm: float,
fwhm: Union[int, None],
position: Union[Tuple[int, int, float], Tuple[None, None, float],
Tuple[int, int, None]] = None) -> np.ndarray:
"""
Expand All @@ -78,9 +78,9 @@ def star_positions(input_port: InputPort,
----------
input_port : pynpoint.core.dataio.InputPort
Input port where the images are stored.
fwhm : int
fwhm : int, None
The FWHM (pix) of the Gaussian kernel that is used to smooth the images before the
brightest pixel is located.
brightest pixel is located. No smoothing is applied if set to None.
position : tuple(int, int, int), None
Subframe that is selected to search for the star. The tuple contains the center (pix)
and size (pix) (pos_x, pos_y, size). Setting `position` to None will use the full
Expand Down

0 comments on commit da4f0d7

Please sign in to comment.