From 9921033d582306aad1b62162a0c94c017719be14 Mon Sep 17 00:00:00 2001 From: Maksim Rakitin Date: Sun, 8 Sep 2019 00:53:46 -0400 Subject: [PATCH 1/3] Enable Azure Pipelines integration Add azure-pipelines.yml and relevant BL-specific steps --- .ci/bl-specific.sh | 2 + R_Rh_0p180.txt | 101 ++++++++++++++++++++++++++++++++++++++++ R_Si_0p180.txt | 101 ++++++++++++++++++++++++++++++++++++++++ startup/37-database.py | 2 +- startup/37-database2.py | 2 +- startup/97_HDM.py | 9 ++-- 6 files changed, 212 insertions(+), 5 deletions(-) create mode 100644 R_Rh_0p180.txt create mode 100644 R_Si_0p180.txt diff --git a/.ci/bl-specific.sh b/.ci/bl-specific.sh index 8d29912..2a038b8 100644 --- a/.ci/bl-specific.sh +++ b/.ci/bl-specific.sh @@ -1,3 +1,5 @@ #!/bin/bash +cp -v R_*.txt ~/.ipython/profile_${TEST_PROFILE}/ + conda install -y -c ${CONDA_CHANNEL_NAME} 11-id-chx-collection diff --git a/R_Rh_0p180.txt b/R_Rh_0p180.txt new file mode 100644 index 0000000..8bee2f0 --- /dev/null +++ b/R_Rh_0p180.txt @@ -0,0 +1,101 @@ +9000.00 0.940142 + 9019.50 0.940200 + 9039.00 0.940258 + 9058.50 0.940315 + 9078.00 0.940373 + 9097.50 0.940430 + 9117.00 0.940486 + 9136.50 0.940543 + 9156.00 0.940599 + 9175.50 0.940655 + 9195.00 0.940710 + 9214.50 0.940765 + 9234.00 0.940820 + 9253.50 0.940874 + 9273.00 0.940928 + 9292.50 0.940982 + 9312.00 0.941036 + 9331.50 0.941089 + 9351.00 0.941142 + 9370.50 0.941194 + 9390.00 0.941247 + 9409.50 0.941299 + 9429.00 0.941350 + 9448.50 0.941402 + 9468.00 0.941453 + 9487.50 0.941504 + 9507.00 0.941555 + 9526.50 0.941605 + 9546.00 0.941655 + 9565.50 0.941705 + 9585.00 0.941755 + 9604.50 0.941804 + 9624.00 0.941853 + 9643.50 0.941901 + 9663.00 0.941950 + 9682.50 0.941998 + 9702.00 0.942046 + 9721.50 0.942093 + 9741.00 0.942140 + 9760.50 0.942187 + 9780.00 0.942234 + 9799.50 0.942280 + 9819.00 0.942326 + 9838.50 0.942371 + 9858.00 0.942416 + 9877.50 0.942462 + 9897.00 0.942506 + 9916.50 0.942551 + 9936.00 0.942595 + 9955.50 0.942639 + 9975.00 0.942683 + 9994.50 0.942727 + 10014.0 0.942771 + 10033.5 0.942814 + 10053.0 0.942857 + 10072.5 0.942899 + 10092.0 0.942942 + 10111.5 0.942984 + 10131.0 0.943026 + 10150.5 0.943067 + 10170.0 0.943108 + 10189.5 0.943149 + 10209.0 0.943190 + 10228.5 0.943231 + 10248.0 0.943271 + 10267.5 0.943311 + 10287.0 0.943351 + 10306.5 0.943390 + 10326.0 0.943429 + 10345.5 0.943468 + 10365.0 0.943507 + 10384.5 0.943546 + 10404.0 0.943584 + 10423.5 0.943622 + 10443.0 0.943659 + 10462.5 0.943697 + 10482.0 0.943734 + 10501.5 0.943771 + 10521.0 0.943808 + 10540.5 0.943844 + 10560.0 0.943880 + 10579.5 0.943916 + 10599.0 0.943952 + 10618.5 0.943987 + 10638.0 0.944023 + 10657.5 0.944058 + 10677.0 0.944092 + 10696.5 0.944127 + 10716.0 0.944161 + 10735.5 0.944195 + 10755.0 0.944228 + 10774.5 0.944262 + 10794.0 0.944295 + 10813.5 0.944328 + 10833.0 0.944361 + 10852.5 0.944393 + 10872.0 0.944426 + 10891.5 0.944458 + 10911.0 0.944489 + 10930.5 0.944521 + 10950.0 0.944552 diff --git a/R_Si_0p180.txt b/R_Si_0p180.txt new file mode 100644 index 0000000..7769c8f --- /dev/null +++ b/R_Si_0p180.txt @@ -0,0 +1,101 @@ +9000.00 0.925326 + 9019.50 0.924762 + 9039.00 0.924177 + 9058.50 0.923572 + 9078.00 0.922945 + 9097.50 0.922294 + 9117.00 0.921618 + 9136.50 0.920916 + 9156.00 0.920186 + 9175.50 0.919426 + 9195.00 0.918636 + 9214.50 0.917812 + 9234.00 0.916953 + 9253.50 0.916056 + 9273.00 0.915118 + 9292.50 0.914137 + 9312.00 0.913109 + 9331.50 0.912032 + 9351.00 0.910901 + 9370.50 0.909712 + 9390.00 0.908460 + 9409.50 0.907140 + 9429.00 0.905746 + 9448.50 0.904270 + 9468.00 0.902707 + 9487.50 0.901047 + 9507.00 0.899280 + 9526.50 0.897394 + 9546.00 0.895376 + 9565.50 0.893212 + 9585.00 0.890882 + 9604.50 0.888367 + 9624.00 0.885643 + 9643.50 0.882678 + 9663.00 0.879438 + 9682.50 0.875879 + 9702.00 0.871947 + 9721.50 0.867576 + 9741.00 0.862684 + 9760.50 0.857163 + 9780.00 0.850878 + 9799.50 0.843648 + 9819.00 0.835235 + 9838.50 0.825321 + 9858.00 0.813477 + 9877.50 0.799135 + 9897.00 0.781586 + 9916.50 0.760065 + 9936.00 0.734071 + 9955.50 0.703926 + 9975.00 0.671151 + 9994.50 0.637921 + 10014.0 0.606014 + 10033.5 0.576358 + 10053.0 0.549211 + 10072.5 0.524483 + 10092.0 0.501951 + 10111.5 0.481362 + 10131.0 0.462478 + 10150.5 0.445087 + 10170.0 0.429007 + 10189.5 0.414082 + 10209.0 0.400182 + 10228.5 0.387192 + 10248.0 0.375020 + 10267.5 0.363582 + 10287.0 0.352807 + 10306.5 0.342633 + 10326.0 0.333006 + 10345.5 0.323879 + 10365.0 0.315210 + 10384.5 0.306964 + 10404.0 0.299107 + 10423.5 0.291611 + 10443.0 0.284449 + 10462.5 0.277597 + 10482.0 0.271036 + 10501.5 0.264745 + 10521.0 0.258707 + 10540.5 0.252907 + 10560.0 0.247330 + 10579.5 0.241963 + 10599.0 0.236795 + 10618.5 0.231814 + 10638.0 0.227009 + 10657.5 0.222370 + 10677.0 0.217889 + 10696.5 0.213558 + 10716.0 0.209368 + 10735.5 0.205314 + 10755.0 0.201388 + 10774.5 0.197584 + 10794.0 0.193897 + 10813.5 0.190321 + 10833.0 0.186851 + 10852.5 0.183483 + 10872.0 0.180212 + 10891.5 0.177034 + 10911.0 0.173946 + 10930.5 0.170943 + 10950.0 0.168023 diff --git a/startup/37-database.py b/startup/37-database.py index 02db657..2530749 100644 --- a/startup/37-database.py +++ b/startup/37-database.py @@ -4,7 +4,7 @@ from bson import ObjectId import matplotlib.patches as mpatches from IPython.display import clear_output -cli = pymongo.MongoClient('xf11id-ca') +cli = pymongo.MongoClient(db.reg.config['host']) samples_2 = cli.get_database('samples').get_collection('samples_2') data_acquisition_collection = cli.get_database('samples').get_collection('data_acquisition_collection') beamline_pos = cli.get_database('samples').get_collection('beamline_pos') diff --git a/startup/37-database2.py b/startup/37-database2.py index 24a090b..7160e76 100644 --- a/startup/37-database2.py +++ b/startup/37-database2.py @@ -4,7 +4,7 @@ from bson import ObjectId import matplotlib.patches as mpatches from IPython.display import clear_output -cli = pymongo.MongoClient('xf11id-ca') +cli = pymongo.MongoClient(db.reg.config['host']) samples_2 = cli.get_database('samples').get_collection('samples_2') data_acquisition_collection = cli.get_database('samples').get_collection('data_acquisition_collection') beamline_pos = cli.get_database('samples').get_collection('beamline_pos') diff --git a/startup/97_HDM.py b/startup/97_HDM.py index 36601b0..f77e721 100644 --- a/startup/97_HDM.py +++ b/startup/97_HDM.py @@ -1,3 +1,4 @@ +import os CHA_Vol_PV = 'XF:11IDB-BI{XBPM:02}CtrlDAC:ALevel-SP' @@ -40,9 +41,11 @@ def get_R(header_si, header_rh): voltage_CHA = [ 3.5, 4.0, 4.5, 5.0, 5.5] voltage_CHA = [ 3.0,3.2,3.4,3.6,3.8,4.0,4.2,4.4,4.6,4.8,5.0,5.2,5.4] -r_eng=np.array(np.loadtxt("/home/xf11id/Downloads/R_Rh_0p180.txt"))[:,0]/1e3 -rsi_0p18=np.array(np.loadtxt("/home/xf11id/Downloads/R_Si_0p180.txt"))[:,1] -rrh_0p18=np.array(np.loadtxt("/home/xf11id/Downloads/R_Rh_0p180.txt"))[:,1] +profile_dir = get_ipython().profile_dir.location + +r_eng=np.array(np.loadtxt(os.path.join(profile_dir, "R_Rh_0p180.txt")))[:,0]/1e3 +rsi_0p18=np.array(np.loadtxt(os.path.join(profile_dir, "R_Si_0p180.txt")))[:,1] +rrh_0p18=np.array(np.loadtxt(os.path.join(profile_dir, "R_Rh_0p180.txt")))[:,1] def get_Rdata( voltage_CHA, E ): R = np.zeros(len(voltage_CHA), len(E)) From 75ddbba4ac3398152879cb3f6bf58b6a1a7cbebe Mon Sep 17 00:00:00 2001 From: Maksim Rakitin Date: Tue, 19 Nov 2019 14:50:56 -0500 Subject: [PATCH 2/3] Move the .txt files into the data_files/ dir --- R_Rh_0p180.txt => data_files/R_Rh_0p180.txt | 0 R_Si_0p180.txt => data_files/R_Si_0p180.txt | 0 startup/97_HDM.py | 7 ++++--- 3 files changed, 4 insertions(+), 3 deletions(-) rename R_Rh_0p180.txt => data_files/R_Rh_0p180.txt (100%) rename R_Si_0p180.txt => data_files/R_Si_0p180.txt (100%) diff --git a/R_Rh_0p180.txt b/data_files/R_Rh_0p180.txt similarity index 100% rename from R_Rh_0p180.txt rename to data_files/R_Rh_0p180.txt diff --git a/R_Si_0p180.txt b/data_files/R_Si_0p180.txt similarity index 100% rename from R_Si_0p180.txt rename to data_files/R_Si_0p180.txt diff --git a/startup/97_HDM.py b/startup/97_HDM.py index f77e721..b64bb5e 100644 --- a/startup/97_HDM.py +++ b/startup/97_HDM.py @@ -42,10 +42,11 @@ def get_R(header_si, header_rh): voltage_CHA = [ 3.0,3.2,3.4,3.6,3.8,4.0,4.2,4.4,4.6,4.8,5.0,5.2,5.4] profile_dir = get_ipython().profile_dir.location +data_files_dir = 'data_files' -r_eng=np.array(np.loadtxt(os.path.join(profile_dir, "R_Rh_0p180.txt")))[:,0]/1e3 -rsi_0p18=np.array(np.loadtxt(os.path.join(profile_dir, "R_Si_0p180.txt")))[:,1] -rrh_0p18=np.array(np.loadtxt(os.path.join(profile_dir, "R_Rh_0p180.txt")))[:,1] +r_eng=np.array(np.loadtxt(os.path.join(profile_dir, data_files_dir, "R_Rh_0p180.txt")))[:,0]/1e3 +rsi_0p18=np.array(np.loadtxt(os.path.join(profile_dir, data_files_dir, "R_Si_0p180.txt")))[:,1] +rrh_0p18=np.array(np.loadtxt(os.path.join(profile_dir, data_files_dir, "R_Rh_0p180.txt")))[:,1] def get_Rdata( voltage_CHA, E ): R = np.zeros(len(voltage_CHA), len(E)) From 7bbe3c6f9777b213bf58723ad4c14274cd65ed46 Mon Sep 17 00:00:00 2001 From: Maksim Rakitin Date: Tue, 19 Nov 2019 15:03:41 -0500 Subject: [PATCH 3/3] Fix the copy command :sheep: --- .ci/bl-specific.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/bl-specific.sh b/.ci/bl-specific.sh index 2a038b8..635efd7 100644 --- a/.ci/bl-specific.sh +++ b/.ci/bl-specific.sh @@ -1,5 +1,5 @@ #!/bin/bash -cp -v R_*.txt ~/.ipython/profile_${TEST_PROFILE}/ +cp -Rv data_files ~/.ipython/profile_${TEST_PROFILE}/ conda install -y -c ${CONDA_CHANNEL_NAME} 11-id-chx-collection