Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
7e737e5
Merge pull request #41 from jwlodek/2025-2.0
jwlodek Apr 23, 2025
38f4a6d
Initial toml file
tacaswell Aug 26, 2025
8bd86be
Regenerate with current versions
tacaswell Aug 26, 2025
6308df8
FIX: do not use deprecated api from tifffile
tacaswell Aug 29, 2025
266e76a
Initial packages to get profile to import
tacaswell Aug 29, 2025
1eb1de2
MNT: pin setuptools back to be safe
tacaswell Aug 29, 2025
9510ca9
MNT: remove commented out code using unsupported library
tacaswell Sep 3, 2025
667c737
Add hdf5 plugins and standardize Python pinning
tacaswell Sep 3, 2025
39bfb5a
update lockfile
tacaswell Sep 3, 2025
890f512
Update lock file
tacaswell Sep 4, 2025
19ab38b
update core pins
tacaswell Sep 4, 2025
65b4664
regenerate lock
tacaswell Sep 4, 2025
bac36e1
Update versions
tacaswell Sep 4, 2025
9a6bd63
Adding more third-party floors
tacaswell Sep 4, 2025
469a46e
Update versions
tacaswell Sep 5, 2025
d575739
Pilatus server ini
Sep 9, 2025
3dccaa3
MNT: update ophyd-async and pull more from CF
tacaswell Sep 9, 2025
374c959
generate lock file
tacaswell Sep 9, 2025
db1fee4
MNT: Mostly functional profile for data security
jwlodek Sep 10, 2025
27bbaa9
PDF data sec 9/12/25 with Kari and Roman (Jakub earlier this week)
mrakitin Sep 12, 2025
6090f99
reverse fs and add temperature pbar @clin1
Sep 16, 2025
63ea1a0
revise pbar_set_temp @clin1
cheng-hung Sep 16, 2025
2c12608
organize thermal controller and add plan @clin1
Sep 17, 2025
768312f
Revise server after data security @clin1
Sep 18, 2025
b952c32
Update Kafka server after data security
Sep 25, 2025
313a346
Manage envs when lanuching terminal
tacaswell Oct 22, 2025
fd2b755
Update and regenerate lock
tacaswell Oct 22, 2025
4c875c0
MNT: change from deprecated section name
tacaswell Nov 7, 2025
b723c98
Update pixi.toml for new packages
tacaswell Nov 7, 2025
a66fd4a
BLD: update lock file
tacaswell Nov 7, 2025
08b0bac
Update recent changes @clin1
Nov 12, 2025
6115bcb
Add pvxslibs
tacaswell Nov 17, 2025
bd66aac
Update pixi.toml for new packages
tacaswell Nov 17, 2025
b3e4760
clean metadata from redis @clin1
Nov 21, 2025
315823f
revise mask in pyfai integrate @clin1
cheng-hung Nov 21, 2025
d268155
ENH: switch ophyd-async for conda-forge
tacaswell Nov 24, 2025
a3dca53
MNT: ignore PYTHONPATH when launching terminal
tacaswell Nov 24, 2025
6edb693
update bluesky and databroker pins
tacaswell Nov 25, 2025
4dc449c
regenerate lock
tacaswell Nov 25, 2025
294a2a5
Update startup and kafka 2025-12-12 @clin1
Dec 12, 2025
c780c0d
upload supporting png @clin1
cheng-hung Dec 12, 2025
7843e60
add fitting of rectangular @clin1
cheng-hung Dec 12, 2025
da3e59b
Merge pull request #42 from tacaswell/pixi
tacaswell Dec 17, 2025
c144d26
Merge branch 'main' into data-security
cheng-hung Dec 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,6 @@ history.sqlite
Link\ to\ startup

.vscode/
# pixi environments
.pixi/*
!.pixi/config.toml
11,768 changes: 11,768 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

65 changes: 65 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[workspace]
channels = ["conda-forge"]
name = "pdf-profile-collection"
platforms = ["linux-64"]
version = "2025.3.1"

[system-requirements]
libc = "2.17"

[feature.profile.dependencies]
bluesky-base = "==1.14.6"
bluesky-queueserver = "*"
matplotlib-base= ">=3.9.3,<4"
networkx = ">=3.4.2,<4"
nslsii = "==0.11.4"
numpy = "*"
ophyd = ">=1.11.0"
pyepics = "*"
python = ">=3.12,<3.13"
semver = ">=3.0.4,<4"
tiled-client = ">=0.1.6"
bluesky-darkframes = ">=0.6.0,<0.7"
xpdacq = ">=1.1.4,<2"
xpdan = ">=0.8.2,<0.9"
lmfit = ">=1.3.4,<2"
databroker = "==2.0.0"
bluesky-tiled-plugins = ">=2.0.0b68"
tifffile = ">=2025.5.10,<2026"
setuptools = "<81"
hdf5-external-filter-plugins = ">=0.1.0,<0.2"
blosc-hdf5-plugin = ">=1.0.1,<2"
epicscorelibs = ">=7.0.7.99.1.1,<8"
ophyd-async = ">=0.13.7,<0.14"


[feature.profile.pypi-dependencies]
pvxslibs = ">=1.3.2, <2"


[feature.qs.dependencies]
bluesky-queueserver = "*"
bluesky-httpserver = "*"

[feature.qs.tasks]
# This section needs some development work to understand the best way to
# thread the required configuration through both the task and files checked into
# the profile. These will interact with the ansible roles for pushing out the
# systemd units
qs-backend = "start-re-manager --profile-dir=."
qs-server = "uvicorn --host localhost --port 60610 bluesky_httpserver.server:app"


[feature.terminal.dependencies]
ipython = ">=9.5.0"
pyside6 = "*"
numpy = ">2"


[feature.terminal.tasks]
start = "unset SESSION_MANAGER PYTHONPATH && MPLBACKEND=qtagg ipython --profile-dir=."
pvs = "ipython --profile-dir=. -c 'get_pv_types(); exit()'"

[environments]
terminal = {features=["profile", "terminal"], solve-group="profile"}
qs = {features=["profile", "qs"], solve-group="profile"}
415 changes: 415 additions & 0 deletions scripts/.ipynb_checkpoints/fit_box-checkpoint.ipynb

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions scripts/Battery_Coincell/Battery_Coincell.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@


from epics import PV
from epics import caget, caput
import datetime
import numpy as np
import pylab
from pylab import *
import os
from tifffile import imsave, imread
import sys


####Only XRD measurement
####Detector position on XRD measurement

sample_ID = []
scan_plan = []

xstage = OT_stage_2_X
ystage = OT_stage_2_Y

pos_x = [158.15, 158.15, 158.15, 158.15, 158.15, 158.15]
pos_y = [158.15, 158.15, 158.15, 158.15, 158.15, 158.15]

det_exp_time = []

sleep_time = [60,60,60,60,60,60] # or put list = [x,x,x,x,x,x] length needs to be same as sample_ID

glbl['dk_window']=0.1
glbl['frame_acq_time']=0.1 #XRD det exposure time in situ cells
xpd_configuration["area_det"] = pe1c #pilatus1 # pe1c, pe2c

#if you use Pilatus detector
# dark_strategy = no_dark

#if you use PE detector
dark_strategy = None

number_of_repeat = 10000

def tqdm_sleep(rest_time, message='Sleep'):
from tqdm import tqdm
for j in tqdm(range(0,100), desc=message):
time.sleep(rest_time/100)


for num in range (number_of_repeat): #10000$$$$$$$$$$$$$

for i in range(len(sample_ID)):

glbl['frame_acq_time'] = det_exp_time[i]
RE(mv(xstage, pos_x[i], ystage, pos_y[i]))
xrun(sample_ID[i], scan_plan[i], useful_info = measurement_data(), dark_strategy=dark_strategy)

try:
tqdm_sleep(sleep_time[i], message='Sleep after changing sample') #if you use "list", use tqdm_sleep(sleep_time, )
except (KeyError, ValueError):
tqdm_sleep(sleep_time[0], message='Sleep after changing sample')
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ def measurement(num_repeat, sleep_clear=1, frame_time=0.1, Settle_time=10):
DetZ.append(round(Det_1_Z.position))

try:
tset = thermal_device.setpoint.get() #for linkham get target temperature
tset = thermal_device.setpoint.get() #for eurotherm/linkham get target temperature
except AttributeError:
tset = thermal_device.setpoint #for eurotherm
tset = thermal_device.setpoint ## After revision on 2025/09/17, eurotherm and linkam use the same attribute to read temperature

tqdm_sleep(Settle_time, message='Wait for thermal equilibrium')

Expand Down Expand Up @@ -125,7 +125,8 @@ def measurement(num_repeat, sleep_clear=1, frame_time=0.1, Settle_time=10):
glbl['frame_acq_time'] = det_exp_PDF
# RE(mv(thermal_device,Tlist[i]))
print(f'\nmove {thermal_device.name} to {Tlist[i]}\n')
thermal_device.move(Tlist[i])
# thermal_device.move(Tlist[i])
RE(pbar_set_temp(temp_controller = thermal_device, ramprate = 5, setpoint = Tlist[i], ))
#Det_1_Z.move(D1)
move_PDF()
measurement(num_repaet_PDF, rest_time=sleep_clear, frame_time=det_exp_PDF, Settle_time=Settle_time)
Expand All @@ -143,7 +144,8 @@ def measurement(num_repeat, sleep_clear=1, frame_time=0.1, Settle_time=10):
move_PDF()
for i in range(len(Tlist)):
print(f'\nmove {thermal_device.name} to {Tlist[i]}\n')
thermal_device.move(Tlist[i])
# thermal_device.move(Tlist[i])
RE(pbar_set_temp(temp_controller = thermal_device, ramprate = 5, setpoint = Tlist[i], ))
measurement(num_repaet_PDF, rest_time=sleep_clear, frame_time=det_exp_PDF, Settle_time=Settle_time)
tqdm_sleep(st2, message='Sleep after PDF')

Expand All @@ -153,7 +155,8 @@ def measurement(num_repeat, sleep_clear=1, frame_time=0.1, Settle_time=10):
move_XRD()
for i in range(len(Tlist)):
print(f'\nmove {thermal_device.name} to {Tlist[i]}\n')
thermal_device.move(Tlist[i])
# thermal_device.move(Tlist[i])
RE(pbar_set_temp(temp_controller = thermal_device, ramprate = 5, setpoint = Tlist[i], ))
measurement(num_repaet_XRD, rest_time=sleep_clear, frame_time=det_exp_XRD, Settle_time=Settle_time)
tqdm_sleep(st2, message='Sleep after XRD')

Expand Down
60 changes: 60 additions & 0 deletions scripts/Hotairblower/1008_2025/Hotairblower_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Cryostat T-dependent XRD and PDF measurements
# Created: 11/09/2020 (MA)

import time
import pylab
from pylab import *
import numpy as np
import os
from tifffile import imread, imsave
import matplotlib.pyplot as plt
import shutil

#======================================== Definition of variables =======================================
# Users plese change variables as necessay

A = [450, 500, 550] + [600]*3 + [650] + [700]*3 + [30]

# A = [25, 28, 25]

T_threshold = 1 # T-setpoint +-threshold
Settle_time = 60 # Settle time after HAB reach the setpoint Temperature

smpi_PDF = 8 # sample index for PDF
spi_PDF = 5 # scan plan index for PDF
frame_time = 1.5 # frame acquisition time for PDF and XRD

smpi_XRD = 8 # for XRD
spi_XRD = 5 # for XRD

glbl['frame_acq_time'] = 0.1 # Deatector frame acquasition time
glbl['dk_window'] = 30 # dark current acquasition window
st2 = 5 # sleep timebefore each measuement
temp_controller = hotairblower

#======================================= Definition of Measuremet =======================================
# Do not change anyhing below.

i = 0
for t in A:

RE(pbar_set_temp(temp_controller=temp_controller, setpoint=t, tolerance=T_threshold))

tqdm_sleep(Settle_time, message='Wait for thermal equilibrium...')

print('\nMove to PDF Setup\n')
set_PDF()
glbl['frame_acq_time'] = frame_time
xrun(smpi_PDF, spi_PDF, more_info = measurement_data())
glbl['frame_acq_time'] = 0.1
tqdm_sleep(st2, message='Sleep and Change to XRD')

print('\nMove to XRD Setup')
set_XRD()
glbl['frame_acq_time'] = frame_time
xrun(smpi_XRD, spi_XRD, more_info = measurement_data())
glbl['frame_acq_time'] = 0.1

print('\nGo to next Temperature...\n')


89 changes: 89 additions & 0 deletions scripts/Hotairblower/1008_2025/definitions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@

temp_controller = lakeshore336_2
#------------------------------------------= ''' Do not change anything below !!!'''---------------------.move----------------
config_dir = "/nsls2/data3/pdf/pdfhack/legacy/processed/xpdacq_data/user_data/config_base/"


def set_PDF(): # Move PDF poni and mask files to config directory
xpd_configuration['area_det']=pilatus1
Grid_Z.move(1972)
# xpd_configuration['area_det']=pe1c
# Det_1_Z.move(2679)

try:
os.remove(config_dir + "xpdAcq_calib_info.poni")
except Exception:
pass
shutil.copy(config_dir + "/pilatus_PDF/" + "xpdAcq_calib_info.poni" , config_dir)
try:
os.remove(config_dir + "Mask.npy")
except Exception:
pass
shutil.copy(config_dir + "/pilatus_PDF/" + "Mask.npy" , config_dir)

def set_XRD(): # Move XRD poni and mask files to config directory
# xpd_configuration['area_det']=pe1c
# Det_1_Z.move(2679+700)
xpd_configuration['area_det']=pilatus1
Grid_Z.move(1972+700)

try:
os.remove(config_dir + "xpdAcq_calib_info.poni")
except Exception:
pass
shutil.copy(config_dir + "/pilatus_XRD/" + "xpdAcq_calib_info.poni" , config_dir)
try:
os.remove(config_dir + "Mask.npy")
except Exception:
pass
shutil.copy(config_dir + "/pilatus_XRD/" + "Mask.npy" , config_dir)


## run the following commmand before using scan_shifter_pos(OT_stage_2_X, -128, -218, 400)
def set_scan_pos():
Grid_X.move(0)
Grid_Y.move(130)

xpd_configuration['area_det']=pe1c
glbl['frame_acq_time']=0.1



def measurement_data(): # .......Captures metadata
info_dict = {}
info_dict['OT_stage_1_X'] = OT_stage_1_X.read()
info_dict['OT_stage_1_Y'] = OT_stage_1_Y.read()
info_dict['Det_1_X'] = Det_1_X.read()
info_dict['Det_1_Y'] = Det_1_Y.read()
info_dict['Det_1_Z'] = Det_1_Z.read()
info_dict['Grid_X'] = Grid_X.read()
info_dict['Grid_Y'] = Grid_Y.read()
info_dict['Grid_Z'] = Grid_Z.read()
info_dict['ring_current'] = ring_current.read()
info_dict['frame_acq_time'] = glbl['frame_acq_time']
info_dict['dk_window'] = glbl['dk_window']
# info_dict['cryostat_A'] = lakeshore336.read()['lakeshore336_temp_A_T']['value']
# info_dict['cryostat_A_V'] = caget('XF:28ID1-ES{LS336:1-Chan:A}Val:Sens-I')
# info_dict['cryostat_B'] = lakeshore336.read()['lakeshore336_temp_B_T']['value']
# info_dict['cryostat_B_V'] = caget('XF:28ID1-ES{LS336:1-Chan:B}Val:Sens-I')
# info_dict['cryostat_C'] = lakeshore336.read()['lakeshore336_temp_C_T']['value']
# info_dict['cryostat_C_V'] = caget('XF:28ID1-ES{LS336:1-Chan:C}Val:Sens-I')
# info_dict['cryostat_D'] = lakeshore336.read()['lakeshore336_temp_D_T']['value']
# info_dict['cryostat_D_V'] = caget('XF:28ID1-ES{LS336:1-Chan:D}Val:Sens-I')
# info_dict['hotairblower'] = hotairblower.read()['hotairblower_readback']['value']
info_dict['Measurement_time'] = time.time()
return info_dict

# def Det_scan(SI, SP, repeat): # Pilatus three position scan
# for j in range(repeat):
# # det_x = [40.644, 31.356, 36]
# # det_y = [-3.356, -12.644, -8]
# # for i in range(len(det_x)):
# # Grid_X.move(det_x[i])
# # Grid_Y.move(det_y[i])
# # #xrun(SI, jog([pilatus1], SP, OT_stage_2_Y, use_ypos-.5, use_ypos+.5), dark_strategy=no_dark, more_info = useful_info())
# xrun(SI, SP, dark_strategy= no_dark, more_info = measurement_data(), user_config = my_config)




Binary file added scripts/Look_up_table_2025_1002.xlsx
Binary file not shown.
Loading