Skip to content

Commit

Permalink
Merge pull request #160 from usnistgov/159-repeat-scans-not-loading
Browse files Browse the repository at this point in the history
take mean if len(data.shape) > 3
  • Loading branch information
pbeaucage authored Dec 2, 2024
2 parents 7f19ee9 + 410df03 commit 03556a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/PyHyperScattering/SST1RSoXSDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,10 @@ def loadRun(
data = run["primary"]["data"].read()[md["detector"] + "_image"]
elif isinstance(data,tiled.client.array.DaskArrayClient):
data = run["primary"]["data"].read()[md["detector"] + "_image"]

# Handle extra dimensions (non-pixel and non-intended dimensions from repeat exposures) by averaging them along the dim_0 axis
if len(data.shape) > 3:
data = data.mean("dim_0")

data = data.astype(int) # convert from uint to handle dark subtraction

if self.dark_subtract:
Expand Down

0 comments on commit 03556a0

Please sign in to comment.