Commit 0ceb4dd1 authored by hang yu's avatar hang yu
Browse files

notebook analyzing the prm l2p TF data

parent 2cba5087
......@@ -62,6 +62,43 @@ def pack_par_to_dict(par, n_zr, n_pr, n_zc, n_pc):
return par_dict
def sort_par_dict(par_dict):
zs_real = par_dict['zs_real']
ps_real = par_dict['ps_real']
zs_f = par_dict['zs_f']
zs_Q = par_dict['zs_Q']
ps_f = par_dict['ps_f']
ps_Q = par_dict['ps_Q']
ks = par_dict['ks']
if len(zs_real)>0:
zs_real = np.sort(zs_real)
if len(ps_real)>0:
ps_real = np.sort(ps_real)
if len(zs_f)>0:
idx_zs_f = np.argsort(zs_f)
zs_f = zs_f[idx_zs_f]
zs_Q = zs_Q[idx_zs_f]
if len(ps_f)>0:
idx_ps_f = np.argsort(ps_f)
ps_f = ps_f[idx_ps_f]
ps_Q = ps_Q[idx_ps_f]
par_dict = {'zs_real':zs_real,
'ps_real':ps_real,
'zs_f':zs_f,
'zs_Q':zs_Q,
'ps_f':ps_f,
'ps_Q':ps_Q,
'ks':ks}
return par_dict
def par_to_TF_vect(freq, par,
n_zr, n_pr, n_zc, n_pc):
......@@ -525,9 +562,13 @@ def update_par_dict_from_data_backup(freq, G_data, G_err, par_dict0,
options={'disp': False})
par=par.x
par_dict = pack_par_to_dict(par, n_zr, n_pr, n_zc, n_pc)
par_dict = sort_par_dict(par_dict)
return par_dict
########################################
### auxiliary functions ###
########################################
......
This diff is collapsed.
Supports Markdown
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