In [1]:
from kbmodpy import kbmod as kb
import numpy
import matplotlib.pyplot as plt
import os
%matplotlib inline
In [2]:
path = '../../HITS/test_35/4,6tempExp/new_header/'
In [3]:
files = os.listdir(path)
In [4]:
files.sort()
files = [path+f for f in files]
files = files[:4]
files
Out[4]:
In [5]:
stack = kb.image_stack(files)
In [6]:
flags = ~0 # mask a pixel with any flag
flag_exceptions = [32,39]#int('100000', 2) # unless it also has this flag
master_flags = int('100111', 2) # mask any pixels which have any of
# these more than two times
In [7]:
stack.apply_mask_flags(flags, flag_exceptions)
In [8]:
stack.apply_master_mask(master_flags, 2)
In [9]:
images = stack.get_images()
In [10]:
img = images[2]
In [11]:
sub = img.science()
In [12]:
sub = sub[ 2400:3900,2800:4000]
In [ ]:
In [13]:
fig = plt.figure(figsize=(12,12))
plt.imshow(sub, origin='lower', vmin=-50, vmax=500)#cmap=plt.cm.Greys_r,
plt.xlabel('X Pixels')
plt.ylabel('Y Pixels')
plt.colorbar()
Out[13]:
In [14]:
p = kb.psf(1.0)
In [15]:
search = kb.stack_search(stack, p)
In [16]:
search.gpu(50,50, 0.15, 0.9, 2300.0, 3200.0)
In [21]:
search.filter_min_obs(3)
In [22]:
res = search.get_results(0, 10)
In [23]:
#res = [t for t in res if t.sum_count>2]
In [24]:
#search.save_results("filtered.txt")
In [25]:
res
Out[25]:
In [ ]: