-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathngc1559.py
55 lines (44 loc) · 1.9 KB
/
ngc1559.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from astro_utils import *
auto_plot('NGC1559', exp='log', png='nircam_deband.png', pkl=True, resize=False, method='rrgggbb', plot=False,
max_color=False, fill=False, deband=2, adj_args={'factor': 3})
# os.chdir('/media/innereye/My Passport/Data/JWST/data/HH211NIRCAM/')
rgb = auto_plot('NGC1559', exp='log', png='nircam_deband.png', pkl=True, resize=False, method='rrgggbb', plot=False,
max_color=False, fill=False, deband=2, adj_args={'factor': 3})
remake = rgb.copy()
remake[..., 0] = np.max([rgb[..., 0], np.min(rgb[..., 1:], 2)], 0)
##
rgb = auto_plot('NGC1559', exp='log', png='deband_w.png', pkl=True, resize=False, method='mnnw', plot=False,
max_color=False, fill=False, deband=False, adj_args={'factor': 3})
##
os.chdir('/media/innereye/My Passport/Data/JWST/data/NGC1559/')
# rgb = plt.imread('deband.png')[..., :3]
# rgb[..., 0] = np.max([rgb[..., 0], np.min(rgb[..., 1:], 2)], 0)
path = glob('*.fits')
filt = filt_num(path)
order = np.argsort(filt)
filt = filt[order]
path = np.array(path)[order]
layers = np.load('NGC1559.pkl', allow_pickle=True)
plt.figure()
for lay in range(layers.shape[2]):
layers[..., lay] = level_adjust(layers[..., lay], factor=3)
plt.subplot(2,3, lay+1)
plt.imshow(layers[..., lay], origin='lower')
plt.figure()
for lay in range(layers.shape[2]):
plt.subplot(2,3, lay+1)
plt.imshow(layers[2800:3600, 2800:3600, lay], origin='lower')
rgb = np.zeros((layers.shape[0], layers.shape[1], 3))
rgb[..., 0] = layers[..., 3]
mean = (layers[..., 2] + layers[..., 1])/2
mean[mean > 1] = 1
rgb[..., 1] = mean
rgb[..., 2] = layers[..., 0]
plt.imshow(rgb, origin='lower')
rgb[..., 0] = np.max([layers[..., 4], np.min(rgb[..., 1:], 2)], 0)
plt.imshow(rgb, origin='lower')
rgb[..., 0] = np.max([layers[..., 3], rgb[..., 0]], 0)
plt.imshow(rgb, origin='lower')
rgb[..., 0] = np.max([layers[..., 5], rgb[..., 0]], 0)
plt.figure()
plt.imshow(rgb, origin='lower')