-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from NSLS-II-BMM/hanukkah-experiment
Hanukkah experiment
- Loading branch information
Showing
5 changed files
with
148 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
9c1f9ce6-6c35-42c9-ae0b-40620336596c | ||
b02b4bfc-ef9f-4a8d-bfcd-852923061371 | ||
df21d22a-dc85-4566-932f-d66b20f714bd | ||
7a5257a9-c5f6-4dab-908e-82ec74308817 | ||
818400f0-b9a7-489d-ba3b-9839d8e35700 | ||
3c8a6931-b465-46e2-860a-bca6a203ac04 | ||
4bbd010d-5310-4fad-ad4e-956517c04aff | ||
7d7e5497-9fb4-4829-b526-425d42974012 | ||
8e4e5b73-2fad-41ca-b3ca-e1c1d6183052 | ||
797a514b-f673-4131-a236-f5250331f3dd | ||
434b6f94-37ae-41d3-8d3e-8b4ab18d9711 | ||
ea441617-9794-46f0-8e6e-f704ebba8163 | ||
e8374ec8-2a80-48c4-a77f-bd3271677590 | ||
4a992e79-3f45-4c1c-8a99-a47f7b8d8af5 | ||
cb0629dc-a6ea-4581-abbc-bbde76aecb10 | ||
7fd0e59f-9b06-48f1-a17d-a9053032fe34 | ||
ef501a87-5e09-41aa-a72b-20004e00d510 | ||
dafdf68f-a064-4dd3-acf0-dd6506c0aca7 | ||
1ba7768a-bddb-48ac-9148-1162659c38d0 | ||
60d42219-ab88-4865-ae44-6684e538c322 | ||
6d1be8c4-2534-4e8b-a12e-82875eae3996 | ||
adb51916-d093-44d0-b86c-6397901d4eec | ||
340e4116-2a30-4a4c-a1a4-04ca7c7657e0 | ||
91ce30b3-03cf-4557-b7a5-c97293dce1be | ||
ec5023d6-a45d-4109-8d42-7cc0c74d72ed | ||
2bd7ca7f-4ac4-4ed8-8eac-a5e8aa0aea89 | ||
bd09a4ee-3e36-4f07-b1f8-e9baace2617a | ||
bd1a9f03-8117-4393-a49f-9ea2c28b53c1 | ||
95364f08-e085-41ad-9b23-6820a850c67f | ||
5c2d9d83-89e2-481e-818d-73864b792ed6 | ||
58b676df-1f08-4554-8736-ac6ef1fe0422 | ||
0288139d-b373-4525-ad51-f919b4eb5d1a | ||
adb8d6a8-6b7d-4d38-8c74-26fdc3268519 | ||
803bc7ef-60ba-4c43-962c-6db72b400f6d | ||
4a9fc081-fd94-45c8-a2e4-e7cfd615d155 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import numpy as np | ||
import tiled.client.node | ||
from bluesky_adaptive.server import register_variable, shutdown_decorator, startup_decorator | ||
|
||
from bmm_agents.sklearn import MultiElementActiveKmeansAgent | ||
|
||
agent = MultiElementActiveKmeansAgent( | ||
filename="PtNi-Multimodal-PtDrivenKmeans", | ||
exp_mode="fluorescence", | ||
read_mode="transmission", | ||
exp_data_type="mu", | ||
elements=["Pt", "Ni"], | ||
edges=["L3", "K"], | ||
element_origins=[[186.307, 89.276], [186.384, 89.305]], | ||
element_det_positions=[185, 160], | ||
sample="AlPtNi wafer pretend-binary PtNi", | ||
preparation="AlPtNi codeposited on a silica wafer", | ||
exp_bounds="-200 -30 -10 25 13k", | ||
exp_steps="10 2 0.5 0.05k", | ||
exp_times="1 1 1 1", | ||
bounds=np.array([(-32, 32), (-32, 32)]), | ||
ask_on_tell=False, | ||
report_on_tell=True, | ||
k_clusters=6, | ||
analyzed_element="Pt", | ||
) | ||
|
||
|
||
@startup_decorator | ||
def startup(): | ||
agent.start() | ||
path = "/nsls2/data/pdf/shared/config/source/bmm-agents/bmm_agents/startup_scripts/historical_Pt_uids.txt" | ||
with open(path, "r") as f: | ||
uids = [] | ||
for line in f: | ||
uids.append(line.strip().strip(",").strip("'")) | ||
|
||
agent.tell_agent_by_uid(uids) | ||
|
||
|
||
@shutdown_decorator | ||
def shutdown_agent(): | ||
return agent.stop() | ||
|
||
|
||
register_variable("tell cache", agent, "tell_cache") | ||
register_variable("agent name", agent, "instance_name") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters