Skip to content
Snippets Groups Projects
Commit 99999124 authored by Loïc Le Guyader's avatar Loïc Le Guyader
Browse files

Adds initial flat field fitting guess parameter

parent ca5154e5
No related branches found
No related tags found
1 merge request!186Improved BOZ flat field
This commit is part of merge request !186. Comments created here will be created in the context of that merge request.
......@@ -61,11 +61,13 @@ class parameters():
self.flat_field = None
self.flat_field_prod_th = (5.0, np.PINF)
self.flat_field_ratio_th = (np.NINF, 1.2)
self.plane_guess_fit = None
self.Fnl = None
self.alpha = None
self.sat_level = None
self.max_iter = None
# temporary data
self.arr_dark = None
self.tid_dark = None
......@@ -166,6 +168,7 @@ class parameters():
v['flat_field'] = self.flat_field
v['flat_field_prod_th'] = self.flat_field_prod_th
v['flat_field_ratio_th'] = self.flat_field_ratio_th
v['plane_guess_fit'] = self.plane_guess_fit
v['Fnl'] = self.Fnl
v['alpha'] = self.alpha
......@@ -198,6 +201,7 @@ class parameters():
c.rois_th = v['rois_th']
c.set_flat_field(v['flat_field'], v['flat_field_prod_th'], v['flat_field_ratio_th'])
c.plane_guess_fit = v['plane_guess_fit']
c.set_Fnl(v['Fnl'])
c.alpha = v['alpha']
......@@ -220,6 +224,7 @@ class parameters():
f += f'rois: {self.rois}\n'
f += f'flat field p: {self.flat_field} prod:{self.flat_field_prod_th} ratio:{self.flat_field_ratio_th}\n'
f += f'plane guess fit: {self.plane_guess_fit}\n'
if self.Fnl is not None:
f += f'dFnl: {np.array(self.Fnl) - np.arange(2**9)}\n'
......@@ -1040,7 +1045,12 @@ def plane_fitting(params):
return d2_2 + d0_2
p_guess_fit = [-0.2, -0.1, 1, -0.54]
return 1e3*(d2_2 + d0_2)
if params.plane_guess_fit is None:
p_guess_fit = [-20, 0.0, 1.5, -0.5, -20, 0, 1.5, -0.5 ]
else:
p_guess_fit = params.plane_guess_fit
res = minimize(_crit, p_guess_fit)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment