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
# 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
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
"""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 numpy as np | |
from itertools import product | |
from xpdacq.beamtime import _configure_area_det | |
import bluesky.plans as bp | |
from bluesky.plans import (scan, subs_wrapper, abs_set, count, list_scan, | |
adaptive_scan, reset_positions_wrapper) | |
from bluesky.callbacks import LiveTable, LivePlot |
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 numpy as np | |
from itertools import product | |
from xpdacq.beamtime import _configure_area_det | |
import bluesky.plans as bp | |
from bluesky.plans import (scan, subs_wrapper, abs_set, count, list_scan, | |
adaptive_scan, reset_positions_wrapper) | |
from bluesky.callbacks import LiveTable, LivePlot |
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 | |
from xpdacq.beamtime import _configure_area_det | |
import os | |
import numpy as np | |
import itertools | |
from bluesky.plans import (scan, subs_wrapper, abs_set, count, list_scan, | |
adaptive_scan, reset_positions_wrapper) | |
from bluesky.callbacks import LiveTable, LivePlot | |
from bluesky.plan_tools import print_summary |
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 | |
from xpdacq.beamtime import _configure_area_det | |
## set up tiff name | |
xpd_data_proc.data_fields.append(('gas_current_gas', '')) | |
## switch gas | |
gas.set('He') # switch to 'He', available entries are defined by gas.gas_list. E.g. gas.gas_list= ['He', 'O2'] | |
## configure the exposure time first |
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
# you have two options: | |
# assume you are using diff_x for x-motor and diff_y for y-motor. | |
# CHECK with wh_pos() !!! (but I think it is) | |
import bluesky.plans as bp | |
from cycler import cycler | |
# option1 : continuous trajactory with sneak pattern. scan diff_x from 1 to 3 with 3 stepes, same for diff_y | |
# change the argument as needed |
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
# every time we exit out from ipython, we need to configure devices | |
# in this example, we move sample_stage_2 in x direction (ss_stg2_x) | |
xpd_configuration['temp_controller'] = cryostat | |
xpd_configuration['stat_motor'] = ss_stg2_x | |
# scanplan : 1s expo, from 300k to 303k with 1k step | |
# sample_ind <1> at motor position 1.55 | |
# sample_ind <3> at motor position 2.55 | |
# sample_ind <7> at motor position 3.55 | |
ScanPlan(bt, statTramp, 1, 300, 303, 1, {1:1.55, 3:2.55, 7:3.55}) |