Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add code to call spotfinder script #239

Open
wants to merge 3 commits into
base: 2022-3-amxfmx
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions ispybLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ def createDataCollection(directory, filePrefix, jpegImageFilename, params, reque
params['datacollection_number'] = request_obj['runNum']
if request_obj['img_width'] > 0:
params['n_images'] = int(round((request_obj['sweep_end'] - request_obj['sweep_start']) / request_obj['img_width']))
if request_obj['protocol'] == "raster":
row_defs = request_obj['rasterDef']['rowDefs']
num_rows = len(row_defs)
num_images_per_row = row_defs[0]['numsteps']
params['n_images'] = int(num_images_per_row * num_rows)
else:
params['n_images'] = 1 # stills mode
params['exp_time'] = request_obj['exposure_time']
Expand Down
1 change: 0 additions & 1 deletion lsdcGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -3969,7 +3969,6 @@ def takeRasterSnapshot(self,rasterReq):
jpegImageThumbFilename = jpegImagePrefix+"t.jpg"
logger.info("saving raster snapshot")
self.saveVidSnapshotCB("Raster Result from sample " + str(rasterReq["request_obj"]["file_prefix"]),useOlog=False,reqID=rasterReq["uid"],rasterHeatJpeg=jpegImageFilename)
self.saveVidSnapshotCB("Raster Result from sample " + str(rasterReq["request_obj"]["file_prefix"]),useOlog=False,reqID=rasterReq["uid"],rasterHeatJpeg=jpegImageFilename)
try:
ispybLib.insertRasterResult(rasterReq,visitName)
except Exception as e:
Expand Down
20 changes: 4 additions & 16 deletions runSpotFinder4syncW.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,13 @@
numimages = round(range_degrees/img_width)
numstart = reqObj["file_number_start"]

dialsComm = getBlConfig("dialsComm")
dialsTuneLowRes = getBlConfig(RASTER_TUNE_LOW_RES)
dialsTuneHighRes = getBlConfig(RASTER_TUNE_HIGH_RES)
dialsTuneIceRingFlag = getBlConfig(RASTER_TUNE_ICE_RING_FLAG)
dialsTuneResoFlag = getBlConfig(RASTER_TUNE_RESO_FLAG)
dialsTuneIceRingWidth = getBlConfig(RASTER_TUNE_ICE_RING_WIDTH)
if (dialsTuneIceRingFlag):
iceRingParams = " ice_rings.filter=true ice_rings.width=" + str(dialsTuneIceRingWidth)
else:
iceRingParams = ""
if (dialsTuneResoFlag):
resoParams = " d_min=" + str(dialsTuneLowRes) + " d_max=" + str(dialsTuneHighRes)
else:
resoParams = ""
dialsCommWithParams = dialsComm + resoParams + iceRingParams
print(dialsCommWithParams)
for i in range (numstart,numimages,10):
comm_s = f"ssh -q {node} \"{os.environ['MXPROCESSINGSCRIPTSDIR']}eiger2cbf.sh {request_id} {i} {i} 0 {seqNum}\""
os.system(comm_s)
# now handle the cbfs with dials
# prerequisite: dials.spot_server running on the host where the processing is to occur, owned by the user who runs LSDC server
comm_s = f"ssh -q {node} \"{os.environ['MXPROCESSINGSCRIPTSDIR']}dials_spotfind.sh {request_id} 0 {seqNum} per_image\""
print(comm_s)

retry = 3
localDialsResultDict = {}
Expand Down