Skip to content

Commit 111794d

Browse files
committed
pep8 updates
1 parent 301c0a8 commit 111794d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

notebooks/NIRCam/NIRCam_wisp_subtraction/subtract_wisp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@
4545
from astropy.stats import median_absolute_deviation, sigma_clipped_stats
4646
from astropy.wcs import WCS
4747
import matplotlib
48-
matplotlib.use('Agg')
4948
import matplotlib.pyplot as plt
5049
import numpy as np
5150
from photutils.segmentation import detect_sources, detect_threshold
5251
from scipy.ndimage import binary_dilation, generate_binary_structure
52+
matplotlib.use('Agg')
5353

5454
warnings.filterwarnings('ignore', message="Input data contains invalid values*") # nan values expected throughout code
5555
warnings.filterwarnings('ignore', message="All-NaN slice encountered*")
@@ -133,7 +133,7 @@ def make_segmap(f, seg_from_lw=True, sigma=0.8, npixels=10, dilate_segmap=5, sav
133133
if (seg_from_lw) & ('long' not in detector):
134134
segmap_tmp = np.zeros(segmap_data.shape).astype(int)
135135
wcs = WCS(fits.getheader(f_lw, 'SCI')) # lw cal wcs
136-
seg_y, seg_x = np.where(segmap_data!=0)
136+
seg_y, seg_x = np.where(segmap_data != 0)
137137
sky_coords = wcs.pixel_to_world(seg_x, seg_y)
138138
wcs = WCS(fits.getheader(f_sw, 'SCI')) # sw cal wcs
139139
coords = wcs.world_to_pixel(sky_coords)
@@ -378,7 +378,7 @@ def subtract_wisp(f, wisp_data, segmap_data=None, sub_wisp=True, gauss_smooth_wi
378378
data_masked = np.copy(data)
379379
wisp_data_masked = np.copy(wisp_data)
380380
data_masked[(dq & 1 != 0) | (segmap_data != 0) | (wisp_mask == 0)] = np.nan
381-
wisp_data_masked[(dq & 1 != 0) | (segmap_data != 0) |(wisp_mask == 0)] = np.nan
381+
wisp_data_masked[(dq & 1 != 0) | (segmap_data != 0) | (wisp_mask == 0)] = np.nan
382382

383383
# Make a version of the original data where only good pixels outside
384384
# the wisp region are unmasked.

0 commit comments

Comments
 (0)