Commit 2983d261 authored by Markus Gaug's avatar Markus Gaug
Browse files

convert alpha_dict to units of km^-1

parent 5989656b
Pipeline #7267 failed with stages
in 0 seconds
......@@ -54,7 +54,8 @@ def dynamic_rebinning(lic_channel,x,y,offset,offseterr,pc_thres=9.,rebin_start=0
summ_t = summ_t + time
summ_v = summ_v + cont
#print ('ii=', ii, 'cnt=', cnt, ' cont=', cont, ' summ_v=', summ_v, ' time=', time)
if (verbose):
print ('ii=', ii, 'cnt=', cnt, ' cont=', cont, ' summ_v=', summ_v, ' time=', time)
if (summ_v > pc_thres):
xx[cnt] = summ_t / (current_bins)
......@@ -307,7 +308,7 @@ def invert_raman_savgol_filt(x, y, N_R, bin_widths, filt_window=21, filt_poly=5)
* filt_poly Polynomial for Savitzky-Golay filter
"""
print ('HERE2', bin_widths)
#print ('HERE2', bin_widths)
assert (x.shape == y.shape)
assert (x.shape == N_R.shape)
......@@ -354,14 +355,18 @@ def invert_beta(x,y_elastic,y_raman,alpha_aer_elastic, N_R, lambda_elastic, lamb
alpha_aer_raman = alpha_aer_elastic * (lambda_elastic/lambda_raman)**angstrom_k
# calculate molecular extinction
alpha_mol_elastic = alpha_dict[lambda_elastic] * N_R
alpha_mol_raman = alpha_dict[lambda_raman] * N_R
alpha_mol_elastic = alpha_dict[lambda_elastic] * N_R * 1e3 # convert to km^-1
alpha_mol_raman = alpha_dict[lambda_raman] * N_R * 1e3 # convert to km^-1
# calculate the transmission factor
tau_aer_elastic = cumtrapz(alpha_aer_elastic, x, initial=0)
tau_aer_raman = cumtrapz(alpha_aer_raman, x, initial=0)
tau_mol_elastic = cumtrapz(alpha_mol_elastic, x, initial=0)
tau_mol_raman = cumtrapz(alpha_mol_raman, x, initial=0)
print ('tau_aer_elastic (z0): ', tau_aer_elastic[z0_idx])
print ('tau_aer_elastic: ', tau_aer_elastic)
print ('tau_mol_elastic: ', tau_mol_elastic)
tau_aer_elastic = tau_aer_elastic - tau_aer_elastic[z0_idx]
tau_aer_raman = tau_aer_raman - tau_aer_raman [z0_idx]
......@@ -370,9 +375,13 @@ def invert_beta(x,y_elastic,y_raman,alpha_aer_elastic, N_R, lambda_elastic, lamb
Tfac = np.exp( - tau_aer_raman - tau_mol_raman) / np.exp( - tau_aer_elastic - tau_mol_elastic )
Pfac = y_raman[z0_idx] / y_raman * y_elastic / y_elastic[z0_idx] * N_R / N_R[z0_idx]
print ('y_raman[z0_idx]:', y_raman[z0_idx], ' y_elastic:', y_elastic)
print ('Tfac:', Tfac, 'Pfac:', Pfac)
beta_mol_elastic = alpha_mol_elastic / LR_mol
print ('beta_mol_elastic:', beta_mol_elastic)
print ('P*T:', Tfac*Pfac*beta_mol_elastic[z0_idx])
return Pfac * Tfac * ( 0. + beta_mol_elastic[z0_idx] ) - beta_mol_elastic
......
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