Unverified Commit d74b1a8c authored by dcalc's avatar dcalc Committed by GitHub
Browse files

Merge pull request #2 from dcalc/dcalc-patch-1

cpos_arr in unsharp masking
parents 5399f282 8f8678bf
...@@ -52,13 +52,13 @@ def unsharp_masking(flat,sigma,flat_pmp_temp,cpos_arr,clean_mode,pol_end=4): ...@@ -52,13 +52,13 @@ def unsharp_masking(flat,sigma,flat_pmp_temp,cpos_arr,clean_mode,pol_end=4):
""" """
flat_demod, demodM = demod_hrt(flat, flat_pmp_temp) flat_demod, demodM = demod_hrt(flat, flat_pmp_temp)
norm_factor = np.mean(flat_demod[512:1536,512:1536,0,0]) norm_factor = np.mean(flat_demod[512:1536,512:1536,0,cpos_arr[0]])
flat_demod /= norm_factor flat_demod /= norm_factor
new_demod_flats = np.copy(flat_demod) new_demod_flats = np.copy(flat_demod)
b_arr = np.zeros((2048,2048,3,5)) # b_arr = np.zeros((2048,2048,3,5))
if cpos_arr[0] == 0: if cpos_arr[0] == 0:
wv_range = range(1,6) wv_range = range(1,6)
...@@ -85,7 +85,7 @@ def unsharp_masking(flat,sigma,flat_pmp_temp,cpos_arr,clean_mode,pol_end=4): ...@@ -85,7 +85,7 @@ def unsharp_masking(flat,sigma,flat_pmp_temp,cpos_arr,clean_mode,pol_end=4):
a = np.copy(np.clip(flat_demod[:,:,pol,wv], -0.02, 0.02)) a = np.copy(np.clip(flat_demod[:,:,pol,wv], -0.02, 0.02))
b = a - gaussian_filter(a,sigma) b = a - gaussian_filter(a,sigma)
b_arr[:,:,pol-1,wv-1] = b # b_arr[:,:,pol-1,wv-1] = b
c = a - b c = a - b
new_demod_flats[:,:,pol,wv] = c new_demod_flats[:,:,pol,wv] = c
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment