Skip to content

Commit

Permalink
Merge pull request #571 from VChristiaens/master
Browse files Browse the repository at this point in the history
Now closing HDU in open_fits function, PEP8 formatting and upgraded version
  • Loading branch information
VChristiaens authored Jan 9, 2023
2 parents 0ab7a89 + 88b0edc commit 9948e7f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
Binary file modified paper.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion vip_hci/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.3.5"
__version__ = "1.3.6"


from . import preproc
Expand Down
2 changes: 1 addition & 1 deletion vip_hci/fits/fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def open_fits(fitsfilename, n=0, header=False, ignore_missing_end=False,
else:
data = hdulist[n].data
data = np.array(data, dtype=precision)

hdulist.close()
if header:
header = hdulist[n].header
if verbose:
Expand Down
22 changes: 12 additions & 10 deletions vip_hci/preproc/badpixremoval.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,10 +778,10 @@ def bp_removal_2d(array_corr, cy, cx, fwhm, sig, protect_mask, bpm_mask_ori,
if bpm_mask is None or not correct_only:
if (cy is None or cx is None) and protect_mask:
cy, cx = frame_center(array)
array_corr, bpix_map_cumul = bp_removal_2d(array_corr, cy, cx, fwhm, sig,
protect_mask, bpm_mask,
min_thr, half_res_y, mad,
verbose)
array_corr, bpix_map_cumul = bp_removal_2d(array_corr, cy, cx, fwhm,
sig, protect_mask,
bpm_mask, min_thr,
half_res_y, mad, verbose)
else:
fwhm_round = int(round(fwhm))
fwhm_round = fwhm_round+1-(fwhm_round % 2) # make it odd
Expand All @@ -807,12 +807,14 @@ def bp_removal_2d(array_corr, cy, cx, fwhm, sig, protect_mask, bpm_mask_ori,
for i in range(n_z):
if verbose:
print('************Frame # ', i, ' *************')
array_corr[i], bpix_map_cumul[i] = bp_removal_2d(array_corr[i], cy[i],
cx[i], fwhm[i],
sig, protect_mask,
bpm_mask, min_thr,
half_res_y, mad,
verbose)
array_corr[i], bpix_map_cumul[i] = bp_removal_2d(array_corr[i],
cy[i], cx[i],
fwhm[i], sig,
protect_mask,
bpm_mask,
min_thr,
half_res_y, mad,
verbose)
else:
if isinstance(fwhm, (float, int)):
fwhm_round = int(round(fwhm))
Expand Down

0 comments on commit 9948e7f

Please sign in to comment.