From 6f30d641d3341969c948bb111dc51de7a5642743 Mon Sep 17 00:00:00 2001 From: gac-x05la Date: Tue, 11 Aug 2020 10:00:56 +0200 Subject: [PATCH] Version 1_14 --- config/settings.properties | 2 + config/variables.properties | 2 + devices/m1.properties | 19 ++++---- devices/m2.properties | 19 ++++---- script/CPython/gfitoff.py | 30 +++++++++++++ script/CPython/wrapper.py | 6 +++ script/Ca_CO3_6days.que | 1 + script/Queues/2020_04_29_Ca_CO3_Ni.que | 1 + script/Queues/CA_CO3_Zn_watergap.que | 1 + script/Queues/Ca_CO3_7days.que | 1 + script/Queues/Ca_CO3_8days.que | 1 + script/Queues/Ca_CO3_Zn_lt.que | 1 + script/Queues/Ca_CO3_Zn_lt_p2.que | 1 + script/Queues/Ca_CO3_Zn_lt_p2b.que | 1 + script/Queues/lt_p2.py | 0 script/Queues/test.que | 1 + script/Test/Dummy1.py | 1 + script/Test/Dummy2.py | 1 + script/Test/Dummy3.py | 1 + script/Test/TestGfitoff.py | 25 +++++++++++ ...nTheFly_9800eV_XY_100ms_88_1_heart_2um.que | 1 + script/apatite_q_1.que | 1 + script/apatite_q_2.que | 1 + script/local.py | 43 +++++++++++++++++++ 24 files changed, 143 insertions(+), 18 deletions(-) create mode 100644 config/settings.properties create mode 100644 config/variables.properties create mode 100644 script/CPython/gfitoff.py create mode 100644 script/CPython/wrapper.py create mode 100644 script/Ca_CO3_6days.que create mode 100644 script/Queues/2020_04_29_Ca_CO3_Ni.que create mode 100644 script/Queues/CA_CO3_Zn_watergap.que create mode 100644 script/Queues/Ca_CO3_7days.que create mode 100644 script/Queues/Ca_CO3_8days.que create mode 100644 script/Queues/Ca_CO3_Zn_lt.que create mode 100644 script/Queues/Ca_CO3_Zn_lt_p2.que create mode 100644 script/Queues/Ca_CO3_Zn_lt_p2b.que create mode 100644 script/Queues/lt_p2.py create mode 100644 script/Queues/test.que create mode 100644 script/Test/Dummy1.py create mode 100644 script/Test/Dummy2.py create mode 100644 script/Test/Dummy3.py create mode 100644 script/Test/TestGfitoff.py create mode 100644 script/XRF_OnTheFly_9800eV_XY_100ms_88_1_heart_2um.que create mode 100644 script/apatite_q_1.que create mode 100644 script/apatite_q_2.que diff --git a/config/settings.properties b/config/settings.properties new file mode 100644 index 0000000..e70b363 --- /dev/null +++ b/config/settings.properties @@ -0,0 +1,2 @@ +#Tue Jul 28 09:52:01 CEST 2020 +FdaBrowser=true diff --git a/config/variables.properties b/config/variables.properties new file mode 100644 index 0000000..c2abe18 --- /dev/null +++ b/config/variables.properties @@ -0,0 +1,2 @@ +#Thu Feb 27 09:28:05 CET 2020 +FileSequentialNumber=20 diff --git a/devices/m1.properties b/devices/m1.properties index 7d43488..0607bf2 100644 --- a/devices/m1.properties +++ b/devices/m1.properties @@ -1,15 +1,16 @@ -#Tue Dec 04 12:20:43 CET 2018 -defaultSpeed=1.0 -estbilizationDelay=0 -maxSpeed=10.0 -maxValue=10.0 -minSpeed=0.1 -minValue=-10.0 +#Wed Feb 26 15:51:03 CET 2020 offset=0.0 +maxValue=10.0 precision=2 -resolution=NaN rotation=false scale=1.0 -sign_bit=0 +estbilizationDelay=0 +maxSpeed=10.0 +resolution=NaN startRetries=1 +minValue=-10.0 unit=mm +defaultSpeed=1.0 +sign_bit=0 +monitorByPosition=false +minSpeed=0.1 diff --git a/devices/m2.properties b/devices/m2.properties index 7d43488..0607bf2 100644 --- a/devices/m2.properties +++ b/devices/m2.properties @@ -1,15 +1,16 @@ -#Tue Dec 04 12:20:43 CET 2018 -defaultSpeed=1.0 -estbilizationDelay=0 -maxSpeed=10.0 -maxValue=10.0 -minSpeed=0.1 -minValue=-10.0 +#Wed Feb 26 15:51:03 CET 2020 offset=0.0 +maxValue=10.0 precision=2 -resolution=NaN rotation=false scale=1.0 -sign_bit=0 +estbilizationDelay=0 +maxSpeed=10.0 +resolution=NaN startRetries=1 +minValue=-10.0 unit=mm +defaultSpeed=1.0 +sign_bit=0 +monitorByPosition=false +minSpeed=0.1 diff --git a/script/CPython/gfitoff.py b/script/CPython/gfitoff.py new file mode 100644 index 0000000..d692d8d --- /dev/null +++ b/script/CPython/gfitoff.py @@ -0,0 +1,30 @@ +import numpy as np +import scipy.optimize + + +def gfitoff(x, y, off=None, amp=None, com=None, sigma=None): + if off is None: + off = y.min() # good enough starting point for offset + + if com is None: + com = x[y.argmax()] + + if amp is None: + amp = y.max() - off + + # For normalised gauss curve sigma=1/(amp*sqrt(2*pi)) + if sigma is None: + surface = np.trapz((y-off), x=x) + sigma = surface / (amp * np.sqrt(2 * np.pi)) + try: + popt, pcov = scipy.optimize.curve_fit(gauss_fn, x, y, p0=[off, amp, com, sigma], method='lm') + popt[3] = abs(popt[3]) # sigma should be returned as positive + except Exception as e: + print("Gauss fitting not successful.\n" + str(e)) + popt = [off, amp, com, abs(sigma)] + + return popt + + +def gauss_fn(x, a, b, c, d): + return a + b * np.exp(-(np.power((x - c), 2) / (2 * np.power(d, 2)))) diff --git a/script/CPython/wrapper.py b/script/CPython/wrapper.py new file mode 100644 index 0000000..624c467 --- /dev/null +++ b/script/CPython/wrapper.py @@ -0,0 +1,6 @@ +from jeputils import * + + +def gfitoff(x, y, off=None, amp=None, com=None, sigma=None): + ret = call_jep("CPython/gfitoff", "gfitoff", [to_npa(x), to_npa(y), off, amp, com, sigma]) + return ret if ret is None or is_list(ret) else ret.data diff --git a/script/Ca_CO3_6days.que b/script/Ca_CO3_6days.que new file mode 100644 index 0000000..3bc8dab --- /dev/null +++ b/script/Ca_CO3_6days.que @@ -0,0 +1 @@ +[ [ [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200429/XRF_XRD_otf_Ca_CO3_Sigel_6days_overv.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200429/XRF_XRD_otf_Ca_CO3_Sigel_6days_overv.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200429/XRF_XRD_otf_Ca_CO3_Sigel_6days_overv.xml", "", "Resume", "Aborted" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200429/XRF_XRD_otf_Ca_CO3_Sigel_6days_overv.xml", "", "Resume", "" ] ] ] \ No newline at end of file diff --git a/script/Queues/2020_04_29_Ca_CO3_Ni.que b/script/Queues/2020_04_29_Ca_CO3_Ni.que new file mode 100644 index 0000000..44164f0 --- /dev/null +++ b/script/Queues/2020_04_29_Ca_CO3_Ni.que @@ -0,0 +1 @@ +[ [ [ false, "/sls/X05LA/Data1/x05laop/2020_04/20200428/XRF_XRD_otf_Ca_Ni_CO3_Sigel_14days_f2.xml", "", "Resume", "" ], [ false, "/sls/X05LA/Data1/x05laop/2020_04/20200428/XRF_XRD_otf_Ca_Ni_CO3_Sigel_14days_f3.xml", "", "Resume", "" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200428/XRF_XRD_otf_Ca_Ni_CO3_Sigel_14days_f4.xml", "", "Resume", "" ] ] ] \ No newline at end of file diff --git a/script/Queues/CA_CO3_Zn_watergap.que b/script/Queues/CA_CO3_Zn_watergap.que new file mode 100644 index 0000000..ed3c5c5 --- /dev/null +++ b/script/Queues/CA_CO3_Zn_watergap.que @@ -0,0 +1 @@ +[ [ [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap_fine.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap_fine.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap_fine.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap.xml", "", "Resume", "Success" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200407/XRF_otf_Ca_Zn_CO3_Sigel_watergap_fine.xml", "", "Resume", "Success" ] ] ] \ No newline at end of file diff --git a/script/Queues/Ca_CO3_7days.que b/script/Queues/Ca_CO3_7days.que new file mode 100644 index 0000000..b0e2a0d --- /dev/null +++ b/script/Queues/Ca_CO3_7days.que @@ -0,0 +1 @@ +[ [ [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200430/XRF_XRD_otf_Ca_CO3_Sigel_7days_overv.xml", "", "Resume", "" ], [ false, "/sls/X05LA/Data1/x05laop/2020_04/20200430/XRF_XRD_otf_Ca_CO3_Sigel_7days_rzone.xml", "", "Resume", "" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200430/XRF_XRD_otf_Ca_CO3_Sigel_7days_overv.xml", "", "Resume", "" ], [ false, "/sls/X05LA/Data1/x05laop/2020_04/20200430/XRF_XRD_otf_Ca_CO3_Sigel_7days_overv.xml", "", "Resume", "" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200430/XRF_XRD_otf_Ca_CO3_Sigel_7days_rzone.xml", "", "Resume", "" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200430/XRF_XRD_otf_Ca_CO3_Sigel_7days_overv.xml", "", "Resume", "" ] ] ] \ No newline at end of file diff --git a/script/Queues/Ca_CO3_8days.que b/script/Queues/Ca_CO3_8days.que new file mode 100644 index 0000000..cdfdaa6 --- /dev/null +++ b/script/Queues/Ca_CO3_8days.que @@ -0,0 +1 @@ +[ [ [ true, "/sls/X05LA/Data1/x05laop/2020_05/20200501/20200501091902_XRF_XRD_otf_Ca_CO3_Sigel_6days_rzone/20200501091902_XRF_XRD_otf_Ca_CO3_Sigel_6days_rzone.xml", "", "Resume", "" ], [ true, "/sls/X05LA/Data1/x05laop/2020_05/20200501/20200501195438_XRF_XRD_otf_Ca_CO3_Sigel_8days_overv/20200501195438_XRF_XRD_otf_Ca_CO3_Sigel_8days_overv.xml", "", "Resume", "" ], [ true, "/sls/X05LA/Data1/x05laop/2020_05/20200501/20200501091902_XRF_XRD_otf_Ca_CO3_Sigel_6days_rzone/20200501091902_XRF_XRD_otf_Ca_CO3_Sigel_6days_rzone.xml", "", "Resume", "" ], [ true, "/sls/X05LA/Data1/x05laop/2020_05/20200501/20200501195438_XRF_XRD_otf_Ca_CO3_Sigel_8days_overv/20200501195438_XRF_XRD_otf_Ca_CO3_Sigel_8days_overv.xml", "", "Resume", "" ] ] ] \ No newline at end of file diff --git a/script/Queues/Ca_CO3_Zn_lt.que b/script/Queues/Ca_CO3_Zn_lt.que new file mode 100644 index 0000000..6cd628a --- /dev/null +++ b/script/Queues/Ca_CO3_Zn_lt.que @@ -0,0 +1 @@ +[ [ [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200408/XRF_XRD_otf_Ca_Zn_CO3_Sigel_lt_p2.xml", "", "Resume", "" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200408/XRF_XRD_otf_Ca_Zn_CO3_Sigel_lt_p1.xml", "", "Resume", "" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200408/XRF_XRD_otf_Ca_Zn_CO3_Sigel_lt_p3.xml", "", "Resume", "" ] ] ] \ No newline at end of file diff --git a/script/Queues/Ca_CO3_Zn_lt_p2.que b/script/Queues/Ca_CO3_Zn_lt_p2.que new file mode 100644 index 0000000..c285130 --- /dev/null +++ b/script/Queues/Ca_CO3_Zn_lt_p2.que @@ -0,0 +1 @@ +[ [ [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200409/XRF_XRD_otf_Ca_Zn_CO3_Sigel_lt_p2_a2_f.xml", "", "Resume", "Failure" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200409/XRF_XRD_otf_Ca_Zn_CO3_Sigel_lt_p2_a3_f.xml", "", "Resume", "Aborted" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200409/XRF_XRD_otf_Ca_Zn_CO3_Sigel_lt_p2_a4_f.xml", "", "Resume", "" ] ] ] \ No newline at end of file diff --git a/script/Queues/Ca_CO3_Zn_lt_p2b.que b/script/Queues/Ca_CO3_Zn_lt_p2b.que new file mode 100644 index 0000000..384ef6d --- /dev/null +++ b/script/Queues/Ca_CO3_Zn_lt_p2b.que @@ -0,0 +1 @@ +[ [ [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200409/XRF_XRD_otf_Ca_Zn_CO3_Sigel_lt_p2_a2_f.xml", "", "Resume", "" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200409/XRF_XRD_otf_Ca_Zn_CO3_Sigel_lt_p2_a3_f.xml", "", "Resume", "" ], [ true, "/sls/X05LA/Data1/x05laop/2020_04/20200409/XRF_XRD_otf_Ca_Zn_CO3_Sigel_lt_p2_a4_f.xml", "", "Resume", "" ] ] ] \ No newline at end of file diff --git a/script/Queues/lt_p2.py b/script/Queues/lt_p2.py new file mode 100644 index 0000000..e69de29 diff --git a/script/Queues/test.que b/script/Queues/test.que new file mode 100644 index 0000000..38ced0d --- /dev/null +++ b/script/Queues/test.que @@ -0,0 +1 @@ +[ [ [ true, "Test/Dummy1.py", "", "Resume", "" ], [ true, "Test/Dummy3.py", "", "Resume", "" ], [ true, "Test/Dummy2.py", "", "Resume", "" ] ] ] \ No newline at end of file diff --git a/script/Test/Dummy1.py b/script/Test/Dummy1.py new file mode 100644 index 0000000..368023d --- /dev/null +++ b/script/Test/Dummy1.py @@ -0,0 +1 @@ +sleep(5.0) \ No newline at end of file diff --git a/script/Test/Dummy2.py b/script/Test/Dummy2.py new file mode 100644 index 0000000..4449157 --- /dev/null +++ b/script/Test/Dummy2.py @@ -0,0 +1 @@ +sleep(7.0) \ No newline at end of file diff --git a/script/Test/Dummy3.py b/script/Test/Dummy3.py new file mode 100644 index 0000000..4449157 --- /dev/null +++ b/script/Test/Dummy3.py @@ -0,0 +1 @@ +sleep(7.0) \ No newline at end of file diff --git a/script/Test/TestGfitoff.py b/script/Test/TestGfitoff.py new file mode 100644 index 0000000..e277dae --- /dev/null +++ b/script/Test/TestGfitoff.py @@ -0,0 +1,25 @@ +from mathutils import Gaussian, fit_gaussian +from plotutils import plot_function + + +x=[-200.30429237268825, -200.2650700434188, -200.22115208318002, -199.9457671375377, -199.86345548879072, -199.85213073174933, -199.35687977133284, -199.13811861090275, -197.97304970346386, -197.2952215624348, -195.09076092936948, -192.92276048970703, -191.96871876227698, -189.49577852322938, -187.9652790409825, -183.63756456925222, -180.04899765472996, -178.43839623242422, -174.07311671294445, -172.0410133577918, -165.90824309893102, -160.99771795989466, -159.30176653939253, -154.27688897558514, -152.0854103810786, -145.75652847587313, -140.80843828908465, -139.23982133191495, -134.27073891256106, -132.12649284133064, -125.95947209775511, -121.00309550337462, -119.26736932643232, -114.2706655484383, -112.07393889578914, -105.72295990367157, -100.8088439880125, -99.2034906238494, -94.30042325164636, -92.15010048151461, -85.92203653534293, -81.03913275494665, -79.27412793784428, -74.33487658582118, -72.06274362408762, -65.76562628131825, -60.91255356825276, -59.20334389560392, -54.33286972659312, -52.19387171350535, -45.94978737932291, -41.03014719193582, -39.301602568238906, -34.35572209014114, -32.04464301272608, -25.8221033382824, -20.922074315528747, -19.21590299233186, -14.31090212502093, -12.217203140101386, -5.9283722049240435, -0.9863587170369246, 0.7408048387279834, 5.71126832601389, 7.972628957879352, 14.204559894256546, 19.11839959633025, 20.8218087836657, 25.678748486941828, 27.822718344586864, 34.062659474970715, 38.9745656819391, 40.77409719734158, 45.72080631619803, 47.974156754056835, 54.23453768983539, 59.12020360609568, 60.77306570712026, 65.70734521458867, 67.8344660434617, 74.03187028154134, 78.96532114824849, 80.76070945985495, 85.74802197591286, 87.9140889204674, 94.18082276873524, 99.25790470037091, 100.68454787413205, 105.7213026221542, 107.79483801526698, 113.99555681638138, 119.0707052529143, 120.72715813056156, 125.77551384921307, 127.91257836719551, 134.2011330887875, 139.23043006997628, 140.71673537840158, 145.76288138835983, 147.80216629676042, 154.06420451405637, 159.0846626604798, 160.76183155710717, 165.73699067536242, 167.9265357747636, 173.96705069576544, 178.2522282751915, 179.9042617354548, 183.54586165856657, 185.23269803071796, 189.41678143751972, 191.87149157986588, 192.8741468985015, 195.0241934550453, 195.966634211846, 197.9821647518146, 198.99006812859284, 199.33202054855676, 199.91897441965887, 200.11536227958896, 200.22280936469997, 200.25181179127208] +y=[11.0, 6.0, 8.0, 5.0, 11.0, 7.0, 18.0, 11.0, 12.0, 10.0, 8.0, 6.0, 16.0, 4.0, 12.0, 9.0, 15.0, 14.0, 8.0, 20.0, 15.0, 8.0, 9.0, 11.0, 13.0, 12.0, 13.0, 15.0, 13.0, 20.0, 10.0, 7.0, 17.0, 11.0, 20.0, 13.0, 13.0, 23.0, 14.0, 10.0, 17.0, 15.0, 20.0, 16.0, 14.0, 13.0, 18.0, 22.0, 9.0, 20.0, 12.0, 14.0, 17.0, 19.0, 14.0, 14.0, 23.0, 19.0, 15.0, 20.0, 20.0, 21.0, 20.0, 23.0, 22.0, 15.0, 10.0, 17.0, 21.0, 15.0, 23.0, 23.0, 25.0, 18.0, 16.0, 21.0, 22.0, 16.0, 16.0, 14.0, 19.0, 20.0, 18.0, 20.0, 23.0, 13.0, 16.0, 20.0, 25.0, 15.0, 15.0, 17.0, 22.0, 26.0, 19.0, 30.0, 25.0, 17.0, 17.0, 23.0, 16.0, 27.0, 21.0, 21.0, 26.0, 27.0, 21.0, 17.0, 20.0, 20.0, 21.0, 19.0, 25.0, 19.0, 13.0, 23.0, 20.0, 20.0, 18.0, 20.0, 19.0, 25.0] +p=plot(y, "data", xdata = x)[0] + + +#Fitting with CPython +[off, amp, com, sigma] = gfitoff(x, y, off=None, amp=None, com=None, sigma=None) +print "Fit: ", [off, amp, com, sigma] + +#Plotting CPythjon fit +gauss = Gaussian(amp, com, sigma) +fit = [gauss.value(i) + off for i in x] +p.addSeries(LinePlotSeries("fit")) +p.getSeries(1).setData(x,fit) +p.setLegendVisible(True) + +#Builtin fit +[amp, com, sigma] = fit_gaussian(y, x) +gauss = Gaussian(amp, com, sigma) +plot_function(p, gauss, "fit2", x) + diff --git a/script/XRF_OnTheFly_9800eV_XY_100ms_88_1_heart_2um.que b/script/XRF_OnTheFly_9800eV_XY_100ms_88_1_heart_2um.que new file mode 100644 index 0000000..77af3fd --- /dev/null +++ b/script/XRF_OnTheFly_9800eV_XY_100ms_88_1_heart_2um.que @@ -0,0 +1 @@ +[ [ [ true, "/sls/X05LA/Data1/x05laop/2020_07/20200715/XRF_OnTheFly_9800eV_XY_100ms_88_1_heart_10um.xml", "", "Resume", "Success" ] ] ] \ No newline at end of file diff --git a/script/apatite_q_1.que b/script/apatite_q_1.que new file mode 100644 index 0000000..4000644 --- /dev/null +++ b/script/apatite_q_1.que @@ -0,0 +1 @@ +[ [ [ true, "/sls/X05LA/Data1/x05laop/2020_06/20200619/20200619221650_Apatite_2Dtomo/20200619221650_Apatite_2Dtomo.xml", "", "Resume", "" ] ] ] \ No newline at end of file diff --git a/script/apatite_q_2.que b/script/apatite_q_2.que new file mode 100644 index 0000000..a5434c2 --- /dev/null +++ b/script/apatite_q_2.que @@ -0,0 +1 @@ +[ [ [ true, "/sls/X05LA/Data1/x05laop/2020_06/20200619/20200619182206_Apatite_2Dmap/20200619182206_Apatite_2Dmap.xml", "", "Resume", "" ] ] ] \ No newline at end of file diff --git a/script/local.py b/script/local.py index 9dc8b0d..347d019 100644 --- a/script/local.py +++ b/script/local.py @@ -1,4 +1,47 @@ ################################################################################################### # Deployment specific global definitions - executed after startup.py ################################################################################################### +import ch.psi.fda.ProcessorFDA as ProcessorFDA +import ch.psi.pshell.crlogic.CrlogicPositioner as CrlogicPositioner +import ch.psi.pshell.crlogic.CrlogicSensor as CrlogicSensor +import ch.psi.pshell.epics.ChannelDouble as ChannelDouble +import ch.psi.pshell.epics.ChannelDoubleArray as ChannelDoubleArray +import ch.psi.pshell.epics.ChannelInteger as ChannelInteger +import ch.psi.pshell.epics.ChannelIntegerArray as ChannelIntegerArray + + +crlogic_config = {} +crlogic_config["class"] = "ch.psi.pshell.crlogic.CrlogicScan" +#crlogic_config["prefix"] = "X10DA-ES1-CRL" +#crlogic_config["ioc"] = "X10DA-VME-ES1" +#crlogic_config["integrationTime"] = 0.2 +#crlogic_config["additionalBacklash"] = 0.01 + + +run("CPython/wrapper") + +################################################################################################### +# EPICS utilities +################################################################################################### + + +def caget_str(ch): + return ''.join((chr(i) if i else "") for i in caget(ch)) + +def caput_str(ch, val): + ret = [ord(c) for c in val] + ret = ret + ([0] * (256-len(ret))) + ret = to_array(ret, 'b') + caput(ch, ret) + +################################################################################################### +# FDA utilities +################################################################################################### + + +def run_fda(file_name, arguments={}): + """ + Run FDA loop + """ + ProcessorFDA().execute(file_name,arguments)