This file contains hidden or 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
| """example to do pure pyFAI integration""" | |
| import os | |
| import tifffile as tif | |
| from pyFAI.azimuthalIntegrator import AzimuthalIntegrator | |
| def pyFAI_integrate(data_dir, poni_fp, npt=1450, mask=None): | |
| """helper function to integrate a series of images inside data_dir with geometry and mask provided | |
| Parameters |
This file contains hidden or 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
| import os | |
| import yaml | |
| import numpy as np | |
| import pandas as pd | |
| import tifffile as tif | |
| # same engine as xpdan | |
| from xpdan.glbl import an_glbl | |
| from xpdan.data_reduction import xpd_data_proc | |
| w_dir = os.path.join(an_glbl.home, 'tiff_base') |
This file contains hidden or 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
| # whaht xpdacq has: | |
| # dark frame: | |
| # 1. dark frame before scan | |
| # 2. update global dark frame information | |
| # 3. inject associated dark frame information to each run | |
| # tiff save (exporter): | |
| # 1. read md from header to pull associated dark frame | |
| # 2. dark subtraction | |
| # 3. filename template | |
| # device configuration : |
This file contains hidden or 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
| def configure_pe1c(exp): | |
| try: | |
| from bluesky.plans import abs_set | |
| except ImportError: | |
| from bluesky.plan_stubs import abs_set | |
| acq_time = pe1c.cam.acquire_time.get() | |
| num_frame = np.ceil(exp/acq_time) | |
| computed_exp = num_frame * acq_time | |
| yield from abs_set(pe1c.images_per_set, num_frame, wait=True) | |
| print("INFO: requested exposure time = {} - > computed exposure time" |
This file contains hidden or 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
| import bluesky.plans as bp | |
| import bluesky.preprocessors as bpp | |
| from bluesky.callbacks import LiveTable | |
| from xpdacq.beamtime import _configure_area_det | |
| # configure to 5s | |
| _configure_area_det(5) |
This file contains hidden or 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
| from itertools import tee | |
| import bluesky.plans as bp | |
| import bluesky.plan_stubs as bps | |
| import bluesky.preprocessors as bpp | |
| from bluesky.run_engine import RunEngine | |
| from bluesky.simulators import summarize_plan | |
| from ophyd.sim import hw | |
| ns = hw() |
This file contains hidden or 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
| import bluesky.plans as bp | |
| import bluesky.plan_stubs as bps | |
| from bluesky.utils import Msg, short_uid as _short_uid | |
| from bluesky.preprocessors import subs_wrapper | |
| from bluesky.simulators import summarize_plan | |
| from bluesky.callbacks import LiveTable | |
| # shutter configuration, change wrt beamline! | |
| shutter = sh |
This file contains hidden or 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
| # command at bluesky level | |
| test_det = pe3c | |
| test_det.cam.acquire_time.put(1) | |
| test_det.images_per_set.put(60) | |
| RE(bp.count(1)) | |
| # reproduce the bug in xpdAcq | |
| glbl['frame_acq_time'] = 1 | |
| glbl['dk_window'] = 0.1 |
This file contains hidden or 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
| # ACQ SIDE | |
| # ====================================================== | |
| import bluesky.plans as bp | |
| import bluesky.preprocessors as bpp | |
| import bluesky.plan_stubs as bps | |
| from bluesky.utils import Msg, short_uid as _short_uid | |
| from bluesky.preprocessors import subs_wrapper | |
| from bluesky.simulators import summarize_plan | |
| from bluesky.callbacks import LiveTable |
This file contains hidden or 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
| import time | |
| import numpy as np | |
| import bluesky.plans as bp | |
| import bluesky.plan_stubs as bps | |
| import bluesky.preprocessors as bpp | |
| from bluesky.utils import Msg, short_uid as _short_uid | |
| from bluesky.preprocessors import subs_wrapper | |
| from bluesky.simulators import summarize_plan | |
| from bluesky.callbacks import LiveTable | |
| from xpdacq.xpdacq_conf import xpd_configuration |