delim_whitespace=True,
                    skiprows=1)

for file in static_files:
    name = file.name
    orig = parse(name)
    ### correct the curve for packing effects
    spf_corrected_int = orig.SA / spf.SA
    spf_corrected_error = spf_corrected_int * np.sqrt(
        (orig.sigSA / orig.SA)**2 + (spf.sigSA / spf.SA)**
        2)  ### https://terpconnect.umd.edu/~toh/models/ErrorPropagation.pdf
    static_spf_corrected = Trace(orig.q, np.empty_like(orig.q),
                                 np.empty_like(orig.q), spf_corrected_error,
                                 spf_corrected_int, np.empty_like(orig.q))
    # ### scale back up to proper intensities
    static_spf_corrected.scale(orig,
                               qmin=0.03,
                               qmax=0.1,
                               approach="projection")
    static_spf_corrected_scaled = Trace(orig.q, np.empty_like(orig.q),
                                        np.empty_like(orig.q),
                                        static_spf_corrected.scaled_sigSA,
                                        static_spf_corrected.scaled_SA,
                                        np.empty_like(orig.q))
    static_spf_corrected_scaled.write_dat(
        name.replace('.dat', 'spf-corrected.dat'))

# plt.xscale('log')
# plt.legend()
# plt.show()
Ejemplo n.º 2
0
    2)  ### https://terpconnect.umd.edu/~toh/models/ErrorPropagation.pdf
avg_off_spf_corrected = Trace(avg_off.q, np.empty_like(avg_off.q),
                              np.empty_like(avg_off.q), spf_corrected_error,
                              spf_corrected_int, np.empty_like(avg_off.q))

### scale back up to proper intensities
avg_off_spf_corrected.scale(avg_off,
                            qmin=0.03,
                            qmax=0.1,
                            approach="projection")
avg_off_spf_corrected_scaled = Trace(avg_off.q, np.empty_like(avg_off.q),
                                     np.empty_like(avg_off.q),
                                     avg_off_spf_corrected.scaled_sigSA,
                                     avg_off_spf_corrected.scaled_SA,
                                     np.empty_like(avg_off.q))
avg_off_spf_corrected_scaled.write_dat(
    avg_off_protein_only_file.replace('.dat', 'spf-corrected.dat'))
# plt.plot(avg_off.q,avg_off.SA, label='avg_off')
# plt.plot(avg_off_spf_corrected.q,avg_off_spf_corrected.SA, label='avg_off_spf_corr')
# plt.plot(avg_off_spf_corrected_scaled.q,avg_off_spf_corrected_scaled.SA, label='avg_off_spf_corr_scaled')

### add corrected protein-only signal to each TR difference signal
for file in tr_diff_files:
    name = file.name
    tr_diff = parse(name)
    tr_sum = tr_diff.add(avg_off_spf_corrected_scaled)
    tr_sum.write_dat(name.replace('.dat', '_spf-corrected.dat'))

# plt.xscale('log')
# plt.legend()
# plt.show()
Ejemplo n.º 3
0
	    I_0s_errors.append(I_0_error)

	iz = pd.DataFrame(I_0s)
	iz.index = iz.index
	az = pd.DataFrame(A_s)
	az.index = az.index
	ierrorz = pd.DataFrame(I_0s_errors)
	ierrorz.index = ierrorz.index

	new["I_0"] = iz
	new["A"] = az
	new["I_0s_errors"] = ierrorz
	spf = new.I_pc0/new.I_0
	spf_error = spf*np.sqrt((new.sigSA_pc0/new.I_pc0)**2 + (new.I_0s_errors/new.I_0)**2) ### https://terpconnect.umd.edu/~toh/models/ErrorPropagation.pdf
	structure_packing_factor = Trace(new.q, np.empty_like(new.q), np.empty_like(new.q), spf_error, spf, np.empty_like(new.q))
	structure_packing_factor.write_dat(samp+"_"+temp+"_spf"+".dat")

# print(new)

# plt.figure(num=1, figsize=(9,6))
# plt.scatter(new.q,new.A)
# plt.xlabel("q")
# plt.ylabel("A")
# plt.ylim(-0.001,.001)
# plt.xlim(0,1)

# plt.figure(num=2, figsize=(9,6))
# plt.scatter(new.q,new.I_0)
# # plt.scatter(new.q,new.I_pc0)
# # plt.scatter(new.q,new.I_pc1)
# # plt.scatter(new.q,new.I_pc2)