From 36206efdbb4c307c34b4afd275be481d00bff335 Mon Sep 17 00:00:00 2001 From: qzhang234 Date: Fri, 5 Jul 2024 10:31:31 -0500 Subject: [PATCH] changes made to bdp plan --- scripts/20240627_Day1_3pm.ipynb | 16 ++-- scripts/20240701_Day5.ipynb | 131 +++++++++++++++++++++++++++++++ src/instrument/plans/bdp_demo.py | 4 +- 3 files changed, 142 insertions(+), 9 deletions(-) create mode 100644 scripts/20240701_Day5.ipynb diff --git a/scripts/20240627_Day1_3pm.ipynb b/scripts/20240627_Day1_3pm.ipynb index de76c52..68de4f6 100644 --- a/scripts/20240627_Day1_3pm.ipynb +++ b/scripts/20240627_Day1_3pm.ipynb @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a727a3bd-6064-45e7-bf5f-a07108cdd7f6", + "id": "1", "metadata": {}, "outputs": [], "source": [] @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1", + "id": "2", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2", + "id": "3", "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -115,7 +115,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7", + "id": "8", "metadata": {}, "outputs": [], "source": [] diff --git a/scripts/20240701_Day5.ipynb b/scripts/20240701_Day5.ipynb new file mode 100644 index 0000000..80eeab3 --- /dev/null +++ b/scripts/20240701_Day5.ipynb @@ -0,0 +1,131 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "0", + "metadata": {}, + "outputs": [], + "source": [ + "import logging\n", + "import time\n", + "\n", + "import aps_8id_bs_instrument\n", + "from aps_8id_bs_instrument.data_collection import * # noqa\n", + "from aps_8id_bs_instrument.initialize_bs_tools import ( # noqa: F401\n", + " RE,\n", + " bec,\n", + " cat,\n", + " oregistry,\n", + " peaks,\n", + " sd,\n", + ")\n", + "from aps_8id_bs_instrument.utils.session_logs import logger\n", + "from bluesky.magics import BlueskyMagics\n", + "from IPython import get_ipython\n", + "\n", + "from ophyd import EpicsSignal\n", + "import bluesky.plans as bp\n", + "import bluesky.plan_stubs as bps\n", + "import databroker\n", + "cat = databroker.catalog[\"8idi_xpcs\"] " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1", + "metadata": {}, + "outputs": [], + "source": [ + "from ophyd.sim import det\n", + "det_list = [det]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], + "source": [ + "RE(bp.count(det_list))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3", + "metadata": {}, + "outputs": [], + "source": [ + "det = [flag2ad]\n", + "# flag2ad.hdf1.kind=\"omitted\"\n", + "flag2ad.stats1.kind=\"hinted\"\n", + "flag2ad.stats1.total.kind=\"hinted\"\n", + "flag2ad.stats1.max_xy.kind=\"hinted\"\n", + "flag2ad.stats1.max_xy.y.kind=\"hinted\"\n", + "bec.disable_plots()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], + "source": [ + "RE(bp.rel_scan(det_list, mr2.coarse_pitch, -0.5,0.5,11))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5", + "metadata": {}, + "outputs": [], + "source": [ + "listobjects()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], + "source": [ + "sl4.component_names" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.14" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/src/instrument/plans/bdp_demo.py b/src/instrument/plans/bdp_demo.py index d121899..c628191 100644 --- a/src/instrument/plans/bdp_demo.py +++ b/src/instrument/plans/bdp_demo.py @@ -48,6 +48,7 @@ xpcs_header = Signal(name="xpcs_header", value=RE.md.get("xpcs_header", "A001")) xpcs_index = Signal(name="xpcs_index", value=RE.md.get("xpcs_index", 0)) +APS_CYCLE = "2024-2" DEFAULT_DETECTOR_NAME = "eiger4M" DM_WORKFLOW_NAME = iconfig.get("DM_WORKFLOW_NAME", "example-01") TITLE = "BDP_XPCS_demo" # keep this short, single-word @@ -264,9 +265,10 @@ def xpcs_bdp_demo_plan( description=description, header=xpcs_header.get(), metadatafile=nxwriter.file_name.name, - index=xpcs_index.get(), + index=xpcs_index.get(),a dataDir=str(data_path), concise=dm_concise, + aps_cycle=APS_CYCLE, # TODO: get from apstools # instrument metadata (expected by nxwriter) # values from pete7.hdf # TODO: set from actual instrument values