mailr19876 - in /trunk/test_suite/shared_data/relaxation_data/white_noise: ./ curve.py dist.agr simulation.py stats.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on June 05, 2013 - 22:31:
Author: bugman
Date: Wed Jun  5 22:31:56 2013
New Revision: 19876

URL: http://svn.gna.org/viewcvs/relax?rev=19876&view=rev
Log:
Added a directory and files for testing the white noise in relaxation data.

This includes scripts and graphs.


Added:
    trunk/test_suite/shared_data/relaxation_data/white_noise/
    trunk/test_suite/shared_data/relaxation_data/white_noise/curve.py
    trunk/test_suite/shared_data/relaxation_data/white_noise/dist.agr
    trunk/test_suite/shared_data/relaxation_data/white_noise/simulation.py
    trunk/test_suite/shared_data/relaxation_data/white_noise/stats.py

Added: trunk/test_suite/shared_data/relaxation_data/white_noise/curve.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/relaxation_data/white_noise/curve.py?rev=19876&view=auto
==============================================================================
--- trunk/test_suite/shared_data/relaxation_data/white_noise/curve.py (added)
+++ trunk/test_suite/shared_data/relaxation_data/white_noise/curve.py Wed Jun 
 5 22:31:56 2013
@@ -1,0 +1,14 @@
+# Generate an exponential curve.
+
+from math import exp
+
+
+rx = 2.25
+i0 = 10000.0
+times = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
+
+intensities = []
+for i in range(len(times)):
+    intensities.append(i0 * exp(-rx*times[i]))
+
+print intensities

Added: trunk/test_suite/shared_data/relaxation_data/white_noise/dist.agr
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/relaxation_data/white_noise/dist.agr?rev=19876&view=auto
==============================================================================
--- trunk/test_suite/shared_data/relaxation_data/white_noise/dist.agr (added)
+++ trunk/test_suite/shared_data/relaxation_data/white_noise/dist.agr Wed Jun 
 5 22:31:56 2013
@@ -1,0 +1,550 @@
+# Grace project file
+#
+@version 50122
+@page size 792, 612
+@page scroll 5%
+@page inout 5%
+@link page off
+@map font 0 to "Times-Roman", "Times-Roman"
+@map font 1 to "Times-Italic", "Times-Italic"
+@map font 2 to "Times-Bold", "Times-Bold"
+@map font 3 to "Times-BoldItalic", "Times-BoldItalic"
+@map font 4 to "Helvetica", "Helvetica"
+@map font 5 to "Helvetica-Oblique", "Helvetica-Oblique"
+@map font 6 to "Helvetica-Bold", "Helvetica-Bold"
+@map font 7 to "Helvetica-BoldOblique", "Helvetica-BoldOblique"
+@map font 8 to "Courier", "Courier"
+@map font 9 to "Courier-Oblique", "Courier-Oblique"
+@map font 10 to "Courier-Bold", "Courier-Bold"
+@map font 11 to "Courier-BoldOblique", "Courier-BoldOblique"
+@map font 12 to "Symbol", "Symbol"
+@map font 13 to "ZapfDingbats", "ZapfDingbats"
+@map color 0 to (255, 255, 255), "white"
+@map color 1 to (0, 0, 0), "black"
+@map color 2 to (255, 0, 0), "red"
+@map color 3 to (0, 255, 0), "green"
+@map color 4 to (0, 0, 255), "blue"
+@map color 5 to (255, 255, 0), "yellow"
+@map color 6 to (188, 143, 143), "brown"
+@map color 7 to (220, 220, 220), "grey"
+@map color 8 to (148, 0, 211), "violet"
+@map color 9 to (0, 255, 255), "cyan"
+@map color 10 to (255, 0, 255), "magenta"
+@map color 11 to (255, 165, 0), "orange"
+@map color 12 to (114, 33, 188), "indigo"
+@map color 13 to (103, 7, 72), "maroon"
+@map color 14 to (64, 224, 208), "turquoise"
+@map color 15 to (0, 139, 0), "green4"
+@reference date 0
+@date wrap off
+@date wrap year 1950
+@default linewidth 1.0
+@default linestyle 1
+@default color 1
+@default pattern 1
+@default font 0
+@default char size 1.000000
+@default symbol size 1.000000
+@default sformat "%.8g"
+@background color 0
+@page background fill on
+@timestamp off
+@timestamp 0.03, 0.03
+@timestamp color 1
+@timestamp rot 0
+@timestamp font 0
+@timestamp char size 1.000000
+@timestamp def "Wed Jun  5 22:13:21 2013"
+@r0 off
+@link r0 to g0
+@r0 type above
+@r0 linestyle 1
+@r0 linewidth 1.0
+@r0 color 1
+@r0 line 0, 0, 0, 0
+@r1 off
+@link r1 to g0
+@r1 type above
+@r1 linestyle 1
+@r1 linewidth 1.0
+@r1 color 1
+@r1 line 0, 0, 0, 0
+@r2 off
+@link r2 to g0
+@r2 type above
+@r2 linestyle 1
+@r2 linewidth 1.0
+@r2 color 1
+@r2 line 0, 0, 0, 0
+@r3 off
+@link r3 to g0
+@r3 type above
+@r3 linestyle 1
+@r3 linewidth 1.0
+@r3 color 1
+@r3 line 0, 0, 0, 0
+@r4 off
+@link r4 to g0
+@r4 type above
+@r4 linestyle 1
+@r4 linewidth 1.0
+@r4 color 1
+@r4 line 0, 0, 0, 0
+@g0 on
+@g0 hidden false
+@g0 type XY
+@g0 stacked false
+@g0 bar hgap 0.000000
+@g0 fixedpoint off
+@g0 fixedpoint type 0
+@g0 fixedpoint xy 0.000000, 0.000000
+@g0 fixedpoint format general general
+@g0 fixedpoint prec 6, 6
+@with g0
+@    world 0, 0, 5, 0.06
+@    stack world 0, 0, 0, 0
+@    znorm 1
+@    view 0.150000, 0.150000, 1.150000, 0.850000
+@    title ""
+@    title font 0
+@    title size 1.500000
+@    title color 1
+@    subtitle ""
+@    subtitle font 0
+@    subtitle size 1.000000
+@    subtitle color 1
+@    xaxes scale Normal
+@    yaxes scale Normal
+@    xaxes invert off
+@    yaxes invert off
+@    xaxis  on
+@    xaxis  type zero false
+@    xaxis  offset 0.000000 , 0.000000
+@    xaxis  bar on
+@    xaxis  bar color 1
+@    xaxis  bar linestyle 1
+@    xaxis  bar linewidth 1.0
+@    xaxis  label ""
+@    xaxis  label layout para
+@    xaxis  label place auto
+@    xaxis  label char size 1.000000
+@    xaxis  label font 0
+@    xaxis  label color 1
+@    xaxis  label place normal
+@    xaxis  tick on
+@    xaxis  tick major 1
+@    xaxis  tick minor ticks 1
+@    xaxis  tick default 6
+@    xaxis  tick place rounded true
+@    xaxis  tick in
+@    xaxis  tick major size 1.000000
+@    xaxis  tick major color 1
+@    xaxis  tick major linewidth 1.0
+@    xaxis  tick major linestyle 1
+@    xaxis  tick major grid off
+@    xaxis  tick minor color 1
+@    xaxis  tick minor linewidth 1.0
+@    xaxis  tick minor linestyle 1
+@    xaxis  tick minor grid off
+@    xaxis  tick minor size 0.500000
+@    xaxis  ticklabel on
+@    xaxis  ticklabel format general
+@    xaxis  ticklabel prec 5
+@    xaxis  ticklabel formula ""
+@    xaxis  ticklabel append ""
+@    xaxis  ticklabel prepend ""
+@    xaxis  ticklabel angle 0
+@    xaxis  ticklabel skip 0
+@    xaxis  ticklabel stagger 0
+@    xaxis  ticklabel place normal
+@    xaxis  ticklabel offset auto
+@    xaxis  ticklabel offset 0.000000 , 0.010000
+@    xaxis  ticklabel start type auto
+@    xaxis  ticklabel start 0.000000
+@    xaxis  ticklabel stop type auto
+@    xaxis  ticklabel stop 0.000000
+@    xaxis  ticklabel char size 1.000000
+@    xaxis  ticklabel font 0
+@    xaxis  ticklabel color 1
+@    xaxis  tick place both
+@    xaxis  tick spec type none
+@    yaxis  on
+@    yaxis  type zero false
+@    yaxis  offset 0.000000 , 0.000000
+@    yaxis  bar on
+@    yaxis  bar color 1
+@    yaxis  bar linestyle 1
+@    yaxis  bar linewidth 1.0
+@    yaxis  label ""
+@    yaxis  label layout para
+@    yaxis  label place auto
+@    yaxis  label char size 1.000000
+@    yaxis  label font 0
+@    yaxis  label color 1
+@    yaxis  label place normal
+@    yaxis  tick on
+@    yaxis  tick major 0.01
+@    yaxis  tick minor ticks 1
+@    yaxis  tick default 6
+@    yaxis  tick place rounded true
+@    yaxis  tick in
+@    yaxis  tick major size 1.000000
+@    yaxis  tick major color 1
+@    yaxis  tick major linewidth 1.0
+@    yaxis  tick major linestyle 1
+@    yaxis  tick major grid off
+@    yaxis  tick minor color 1
+@    yaxis  tick minor linewidth 1.0
+@    yaxis  tick minor linestyle 1
+@    yaxis  tick minor grid off
+@    yaxis  tick minor size 0.500000
+@    yaxis  ticklabel on
+@    yaxis  ticklabel format general
+@    yaxis  ticklabel prec 5
+@    yaxis  ticklabel formula ""
+@    yaxis  ticklabel append ""
+@    yaxis  ticklabel prepend ""
+@    yaxis  ticklabel angle 0
+@    yaxis  ticklabel skip 0
+@    yaxis  ticklabel stagger 0
+@    yaxis  ticklabel place normal
+@    yaxis  ticklabel offset auto
+@    yaxis  ticklabel offset 0.000000 , 0.010000
+@    yaxis  ticklabel start type auto
+@    yaxis  ticklabel start 0.000000
+@    yaxis  ticklabel stop type auto
+@    yaxis  ticklabel stop 0.000000
+@    yaxis  ticklabel char size 1.000000
+@    yaxis  ticklabel font 0
+@    yaxis  ticklabel color 1
+@    yaxis  tick place both
+@    yaxis  tick spec type none
+@    altxaxis  off
+@    altyaxis  off
+@    legend on
+@    legend loctype view
+@    legend 0.85, 0.8
+@    legend box color 1
+@    legend box pattern 1
+@    legend box linewidth 1.0
+@    legend box linestyle 1
+@    legend box fill color 0
+@    legend box fill pattern 1
+@    legend font 0
+@    legend char size 1.000000
+@    legend color 1
+@    legend length 4
+@    legend vgap 1
+@    legend hgap 1
+@    legend invert false
+@    frame type 0
+@    frame linestyle 1
+@    frame linewidth 1.0
+@    frame color 1
+@    frame pattern 1
+@    frame background color 0
+@    frame background pattern 0
+@    s0 hidden false
+@    s0 type xy
+@    s0 symbol 0
+@    s0 symbol size 1.000000
+@    s0 symbol color 1
+@    s0 symbol pattern 1
+@    s0 symbol fill color 1
+@    s0 symbol fill pattern 0
+@    s0 symbol linewidth 1.0
+@    s0 symbol linestyle 1
+@    s0 symbol char 65
+@    s0 symbol char font 0
+@    s0 symbol skip 0
+@    s0 line type 1
+@    s0 line linestyle 1
+@    s0 line linewidth 1.0
+@    s0 line color 1
+@    s0 line pattern 1
+@    s0 baseline type 0
+@    s0 baseline off
+@    s0 dropline off
+@    s0 fill type 0
+@    s0 fill rule 0
+@    s0 fill color 1
+@    s0 fill pattern 1
+@    s0 avalue off
+@    s0 avalue type 2
+@    s0 avalue char size 1.000000
+@    s0 avalue font 0
+@    s0 avalue color 1
+@    s0 avalue rot 0
+@    s0 avalue format general
+@    s0 avalue prec 3
+@    s0 avalue prepend ""
+@    s0 avalue append ""
+@    s0 avalue offset 0.000000 , 0.000000
+@    s0 errorbar on
+@    s0 errorbar place both
+@    s0 errorbar color 1
+@    s0 errorbar pattern 1
+@    s0 errorbar size 1.000000
+@    s0 errorbar linewidth 1.0
+@    s0 errorbar linestyle 1
+@    s0 errorbar riser linewidth 1.0
+@    s0 errorbar riser linestyle 1
+@    s0 errorbar riser clip off
+@    s0 errorbar riser clip length 0.100000
+@    s0 comment "dist.agr"
+@    s0 legend  ""
+@    s1 hidden false
+@    s1 type xy
+@    s1 symbol 0
+@    s1 symbol size 1.000000
+@    s1 symbol color 2
+@    s1 symbol pattern 1
+@    s1 symbol fill color 2
+@    s1 symbol fill pattern 0
+@    s1 symbol linewidth 1.0
+@    s1 symbol linestyle 1
+@    s1 symbol char 65
+@    s1 symbol char font 0
+@    s1 symbol skip 0
+@    s1 line type 1
+@    s1 line linestyle 1
+@    s1 line linewidth 1.0
+@    s1 line color 2
+@    s1 line pattern 1
+@    s1 baseline type 0
+@    s1 baseline off
+@    s1 dropline off
+@    s1 fill type 0
+@    s1 fill rule 0
+@    s1 fill color 1
+@    s1 fill pattern 1
+@    s1 avalue off
+@    s1 avalue type 2
+@    s1 avalue char size 1.000000
+@    s1 avalue font 0
+@    s1 avalue color 1
+@    s1 avalue rot 0
+@    s1 avalue format general
+@    s1 avalue prec 3
+@    s1 avalue prepend ""
+@    s1 avalue append ""
+@    s1 avalue offset 0.000000 , 0.000000
+@    s1 errorbar on
+@    s1 errorbar place both
+@    s1 errorbar color 2
+@    s1 errorbar pattern 1
+@    s1 errorbar size 1.000000
+@    s1 errorbar linewidth 1.0
+@    s1 errorbar linestyle 1
+@    s1 errorbar riser linewidth 1.0
+@    s1 errorbar riser linestyle 1
+@    s1 errorbar riser clip off
+@    s1 errorbar riser clip length 0.100000
+@    s1 comment "dist.agr"
+@    s1 legend  ""
+@target G0.S0
+@type xy
+0 0
+0.05 0
+0.1 0
+0.15 0
+0.2 0
+0.25 0
+0.3 0
+0.35 0
+0.4 0
+0.45 0
+0.5 1e-05
+0.55 0
+0.6 0
+0.65 0
+0.7 1e-05
+0.75 0
+0.8 0
+0.85 3e-05
+0.9 4e-05
+0.95 6e-05
+1 0.00011
+1.05 0.00026
+1.1 0.00036
+1.15 0.00057
+1.2 0.00078
+1.25 0.00161
+1.3 0.00198
+1.35 0.003
+1.4 0.00435
+1.45 0.00583
+1.5 0.00772
+1.55 0.00988
+1.6 0.01316
+1.65 0.0166
+1.7 0.02094
+1.75 0.02505
+1.8 0.02997
+1.85 0.03406
+1.9 0.03884
+1.95 0.04203
+2 0.04395
+2.05 0.04642
+2.1 0.05079
+2.15 0.05188
+2.2 0.05148
+2.25 0.05016
+2.3 0.04812
+2.35 0.04759
+2.4 0.04391
+2.45 0.04115
+2.5 0.03703
+2.55 0.03299
+2.6 0.03063
+2.65 0.02568
+2.7 0.0228
+2.75 0.01982
+2.8 0.01645
+2.85 0.01397
+2.9 0.01256
+2.95 0.01055
+3 0.00865
+3.05 0.00731
+3.1 0.00606
+3.15 0.00494
+3.2 0.00371
+3.25 0.00305
+3.3 0.00225
+3.35 0.00181
+3.4 0.00146
+3.45 0.00122
+3.5 0.00091
+3.55 0.00082
+3.6 0.00066
+3.65 0.00048
+3.7 0.00028
+3.75 0.00025
+3.8 0.00022
+3.85 0.0002
+3.9 9e-05
+3.95 8e-05
+4 3e-05
+4.05 7e-05
+4.1 4e-05
+4.15 5e-05
+4.2 7e-05
+4.25 1e-05
+4.3 0
+4.35 1e-05
+4.4 1e-05
+4.45 3e-05
+4.5 1e-05
+4.55 2e-05
+4.6 0
+4.65 0
+4.7 0
+4.75 0
+4.8 0
+4.85 0
+4.9 1e-05
+4.95 0
+&
+@target G0.S1
+@type xy
+0 9.1780569e-09
+0.05 1.8136965e-08
+0.1 3.5296446e-08
+0.15 6.7647203e-08
+0.2 1.2767951e-07
+0.25 2.3732586e-07
+0.3 4.344316e-07
+0.35 7.8315958e-07
+0.4 1.3903739e-06
+0.45 2.4308909e-06
+0.5 4.185543e-06
+0.55 7.0972588e-06
+0.6 1.1851736e-05
+0.65 1.9490627e-05
+0.7 3.1566189e-05
+0.75 5.0346697e-05
+0.8 7.9081029e-05
+0.85 0.00012232807
+0.9 0.00018635131
+0.95 0.00027957046
+1 0.00041304997
+1.05 0.00060098884
+1.1 0.00086115776
+1.15 0.0012152105
+1.2 0.0016887791
+1.25 0.0023112485
+1.3 0.0031151068
+1.35 0.0041347737
+1.4 0.0054048424
+1.45 0.0069577181
+1.5 0.0088207014
+1.55 0.011012652
+1.6 0.013540453
+1.65 0.016395587
+1.7 0.019551193
+1.75 0.022960008
+1.8 0.026553594
+1.85 0.030243154
+1.9 0.033922149
+1.95 0.037470727
+2 0.040761803
+2.05 0.043668387
+2.1 0.046071612
+2.15 0.047868759
+2.2 0.048980523
+2.25 0.04935682
+2.3 0.048980523
+2.35 0.047868759
+2.4 0.046071612
+2.45 0.043668387
+2.5 0.040761803
+2.55 0.037470727
+2.6 0.033922149
+2.65 0.030243154
+2.7 0.026553594
+2.75 0.022960008
+2.8 0.019551193
+2.85 0.016395587
+2.9 0.013540453
+2.95 0.011012652
+3 0.0088207014
+3.05 0.0069577181
+3.1 0.0054048424
+3.15 0.0041347737
+3.2 0.0031151068
+3.25 0.0023112485
+3.3 0.0016887791
+3.35 0.0012152105
+3.4 0.00086115776
+3.45 0.00060098884
+3.5 0.00041304997
+3.55 0.00027957046
+3.6 0.00018635131
+3.65 0.00012232807
+3.7 7.9081029e-05
+3.75 5.0346697e-05
+3.8 3.1566189e-05
+3.85 1.9490627e-05
+3.9 1.1851736e-05
+3.95 7.0972588e-06
+4 4.185543e-06
+4.05 2.4308909e-06
+4.1 1.3903739e-06
+4.15 7.8315958e-07
+4.2 4.344316e-07
+4.25 2.3732586e-07
+4.3 1.2767951e-07
+4.35 6.7647203e-08
+4.4 3.5296446e-08
+4.45 1.8136965e-08
+4.5 9.1780569e-09
+4.55 4.5739286e-09
+4.6 2.2448147e-09
+4.65 1.084986e-09
+4.7 5.1644045e-10
+4.75 2.4208555e-10
+4.8 1.1175578e-10
+4.85 5.0807006e-11
+4.9 2.2747293e-11
+4.95 1.0029709e-11
+&

Added: trunk/test_suite/shared_data/relaxation_data/white_noise/simulation.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/relaxation_data/white_noise/simulation.py?rev=19876&view=auto
==============================================================================
--- trunk/test_suite/shared_data/relaxation_data/white_noise/simulation.py 
(added)
+++ trunk/test_suite/shared_data/relaxation_data/white_noise/simulation.py 
Wed Jun  5 22:31:56 2013
@@ -1,0 +1,67 @@
+"""Simulation of white noise through an exponential.
+
+To run the script, type:
+
+$ ../../../../relax simulation.py
+"""
+
+# relax module imports.
+from lib.statistics import bucket, gaussian
+from pipe_control.mol_res_spin import return_spin
+
+
+# Create the data pipe.
+pipe.create('white noise', 'relax_fit')
+
+# Add a single spin.
+spin.create(res_num=1, res_name='Gly', spin_name='N')
+
+# Get the spin.
+spin_cont = return_spin(':1@N')
+
+# Set up the synthetic peak intensities (rx = 2.25, i0 = 10000).
+cdp.spectrum_ids = ['ncyc_1', 'ncyc_2', 'ncyc_3', 'ncyc_4', 'ncyc_5', 
'ncyc_6', 'ncyc_7', 'ncyc_8', 'ncyc_9', 'ncyc_10']
+times = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
+intensities = [7985.162187593771, 6376.281516217733, 5091.564206075492, 
4065.6965974059913, 3246.5246735834976, 2592.4026064589157, 
2070.0755268115263, 1652.9888822158653, 1319.9384318783023, 
1053.9922456186434]
+cdp.relax_times = {}
+spin_cont.intensities = {}
+spin_cont.intensity_err = {}
+for i in range(len(times)):
+    cdp.relax_times[cdp.spectrum_ids[i]] = times[i]
+    spin_cont.intensities[cdp.spectrum_ids[i]] = intensities[i]
+    spin_cont.intensity_err[cdp.spectrum_ids[i]] = 1000.0
+
+# Set the relaxation curve type.
+relax_fit.select_model('exp')
+
+# Grid search.
+grid_search(inc=11)
+
+# Minimise.
+minimise('simplex', constraints=False)
+
+# Monte Carlo simulations.
+monte_carlo.setup(number=100000)
+monte_carlo.create_data()
+monte_carlo.initial_values()
+minimise('simplex', constraints=False)
+monte_carlo.error_analysis()
+
+# Bucket and write out the data.
+dist = bucket(spin_cont.rx_sim, lower=0, upper=5, inc=100, verbose=True)
+file = open('dist.agr', 'w')
+file.write("@target G0.S0\n@type xy\n")
+for i in range(len(dist)):
+    file.write("%s %s\n" % (dist[i][0], dist[i][1]))
+file.write("&\n")
+
+# The Gaussian distribution.
+file.write("@target G0.S1\n@type xy\n")
+for i in range(len(dist)):
+    pr = gaussian(dist[i][0], mu=2.25, sigma=spin_cont.rx_err)
+    file.write("%s %s\n" % (dist[i][0], pr*0.05))
+file.write("&\n")
+file.close()
+
+# Save the state.
+state.save('state', force=True)

Added: trunk/test_suite/shared_data/relaxation_data/white_noise/stats.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/relaxation_data/white_noise/stats.py?rev=19876&view=auto
==============================================================================
--- trunk/test_suite/shared_data/relaxation_data/white_noise/stats.py (added)
+++ trunk/test_suite/shared_data/relaxation_data/white_noise/stats.py Wed Jun 
 5 22:31:56 2013
@@ -1,0 +1,3 @@
+
+def bucket():
+    return []




Related Messages


Powered by MHonArc, Updated Wed Jun 05 22:40:02 2013