Skip to content

Commit

Permalink
Fix issues identified by pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
“XYangXRay” committed May 22, 2024
1 parent 605f023 commit 1a4d3f5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
8 changes: 4 additions & 4 deletions chx_packages_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
from chx_compress import (
MultifileBNLCustom,
combine_binary_files,
create_compress_header,
compress_eigerdata,
create_compress_header,
get_eigerImage_per_file,
init_compress_eigerdata,
para_compress_eigerdata,
para_segment_compress_eigerdata,
segment_compress_eigerdata,
read_compressed_eigerdata,
init_compress_eigerdata,
get_eigerImage_per_file,
segment_compress_eigerdata,
)

# from pyCHX.chx_compress_analysis import (
Expand Down
9 changes: 6 additions & 3 deletions pyCHX/XPCS_SAXS.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,13 @@ def get_t_iqc(FD, frame_edge, mask, pargs, nx=1500, plot_=False, save=False, sho

return qp, np.array(iqs), q

def get_t_iqc_imstack(imgs, frame_edge, mask, pargs, nx=1500, plot_=False, save=False, show_progress=True, *argv, **kwargs):

def get_t_iqc_imstack(
imgs, frame_edge, mask, pargs, nx=1500, plot_=False, save=False, show_progress=True, *argv, **kwargs
):
"""
Get t-dependent Iq
variant of get_t_iqc that takes an image stack like a dask array to calculate average images and then does the radial integration
variant by LW 05/162024
Expand All @@ -790,7 +793,7 @@ def get_t_iqc_imstack(imgs, frame_edge, mask, pargs, nx=1500, plot_=False, save=
for i in range(Nt):
t1, t2 = frame_edge[i]
# print (t1,t2)
avg_img=np.average(imgs[t1:t2,:,:],axis=0)
avg_img = np.average(imgs[t1:t2, :, :], axis=0)
qp, iqs[i], q = get_circular_average(avg_img, mask, pargs, nx=nx, plot_=False)

if plot_:
Expand Down
5 changes: 3 additions & 2 deletions pyCHX/chx_generic_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3494,9 +3494,10 @@ def load_dask_data(uid, detector, mask_path_full, reverse=False, rot90=False):
returns detector_images(dask-array), image_md
LW 04/26/2024
"""
import dask
import json

import dask

hdr = db[uid]
det = detector.split("_image")[0]
# collect image metadata from loading single image
Expand All @@ -3520,7 +3521,7 @@ def load_dask_data(uid, detector, mask_path_full, reverse=False, rot90=False):
got_pixel_mask = False
# load pixel mask from static location
if got_pixel_mask:
#json_open = open(_mask_path_ + "pixel_masks/pixel_mask_compression_%s.json" % detector.split("_")[0])
# json_open = open(_mask_path_ + "pixel_masks/pixel_mask_compression_%s.json" % detector.split("_")[0])
json_open = open(mask_path_full + "pixel_mask_compression_%s.json" % detector.split("_")[0])
mask_dict = json.load(json_open)
img_md["pixel_mask"] = np.array(mask_dict["pixel_mask"])
Expand Down
11 changes: 5 additions & 6 deletions pyCHX/chx_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,17 @@
use_pims(db) # use pims for importing eiger data, register_handler 'AD_EIGER2' and 'AD_EIGER'

from pyCHX.chx_compress import (
MultifileBNLCustom,
MultifileBNLCustom,
combine_binary_files,
create_compress_header,
compress_eigerdata,
create_compress_header,
get_eigerImage_per_file,
init_compress_eigerdata,
para_compress_eigerdata,
para_segment_compress_eigerdata,
segment_compress_eigerdata,
read_compressed_eigerdata,
init_compress_eigerdata,
get_eigerImage_per_file,
segment_compress_eigerdata,
)

from pyCHX.chx_compress_analysis import (
Multifile,
cal_each_ring_mean_intensityc,
Expand Down

0 comments on commit 1a4d3f5

Please sign in to comment.