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

cube_recenter_satspots with filter_freq #621

Merged
merged 5 commits into from
Oct 5, 2023

Conversation

ElenaKoko
Copy link
Contributor

I integrated cube_filter_highpass and cube_filter_lowpass into the frame_center_satspots and mentioned in the cube_recenter_satspots

@codecov-commenter
Copy link

codecov-commenter commented Oct 4, 2023

Codecov Report

Merging #621 (2aa9106) into master (7ede796) will decrease coverage by 0.00%.
The diff coverage is 50.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##           master     #621      +/-   ##
==========================================
- Coverage   57.38%   57.38%   -0.00%     
==========================================
  Files          67       67              
  Lines       13545    13549       +4     
==========================================
+ Hits         7772     7774       +2     
- Misses       5773     5775       +2     
Files Coverage Δ
vip_hci/preproc/recentering.py 66.42% <50.00%> (-0.10%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -308,8 +308,8 @@ def cube_shift(cube, shift_y, shift_x, imlib='vip-fft',

def frame_center_satspots(array, xy, subi_size=19, sigfactor=6, shift=False,
imlib='vip-fft', interpolation='lanczos4',
fit_type='moff', border_mode='reflect', debug=False,
verbose=True):
fit_type='moff', filter_freq=(0,0), border_mode='reflect',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best practice is to limit each line of python code to 80 characters. Some text editors can show you where the imaginary line would be. Here to not go beyond the limit, border_mode... should have been placed on the next line.

@@ -343,6 +343,10 @@ def frame_center_satspots(array, xy, subi_size=19, sigfactor=6, shift=False,
See the documentation of the ``vip_hci.preproc.frame_shift`` function.
fit_type: str, optional {'gaus','moff'}
Type of 2d fit to infer the centroid of the satellite spots.
filter_freq: tuple of 2 elements.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace with tuple of 2 floats, optional

@@ -343,6 +343,10 @@ def frame_center_satspots(array, xy, subi_size=19, sigfactor=6, shift=False,
See the documentation of the ``vip_hci.preproc.frame_shift`` function.
fit_type: str, optional {'gaus','moff'}
Type of 2d fit to infer the centroid of the satellite spots.
filter_freq: tuple of 2 elements.
If the first and second elements are bigger than 0, then the first element
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block needs to be indented the same way as the description for other parameters

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with:
"If the first (resp. second) element of the tuple is larger than 0, a high-pass (resp. low-pass) filter is applied to the image, before fitting the satellite spots. The elements should correspond to the fwhm_size of the frame_filter_highpass and frame_filter_lowpass functions, respectively. If both elements are non-zero, both high-pass and low-pass filter of the image are applied, in that order. This can be useful to better isolate the signal from the satellite spots."

@@ -445,7 +449,13 @@ def intersection(L1, L2):
centx = []
centy = []
subims = []

if filter_freq[0] > 0:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove blank line

array = frame_filter_highpass(array, mode='gauss-subt',
fwhm_size=filter_freq[0])
if filter_freq[1] > 0:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove blank line

@@ -503,7 +513,7 @@ def intersection(L1, L2):


def cube_recenter_satspots(array, xy, subi_size=19, sigfactor=6, plot=True,
fit_type='moff', lbda=None, border_mode='constant',
fit_type='moff', lbda=None, filter_freq=(0,0), border_mode='constant',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line is longer than 80 characters

@@ -541,6 +551,10 @@ def cube_recenter_satspots(array, xy, subi_size=19, sigfactor=6, plot=True,
lbda: 1d array or list, opt
Wavelength vector. If provided, the subimages will be scaled accordingly
to follow the motion of the satellite spots.
filter_freq: tuple of 2 elements.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same suggestion as above

@@ -541,6 +551,10 @@ def cube_recenter_satspots(array, xy, subi_size=19, sigfactor=6, plot=True,
lbda: 1d array or list, opt
Wavelength vector. If provided, the subimages will be scaled accordingly
to follow the motion of the satellite spots.
filter_freq: tuple of 2 elements.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent and use similar description as suggested above (replace the occurrences of "image" into "images" though)

@VChristiaens VChristiaens merged commit 12e61f3 into vortex-exoplanet:master Oct 5, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants