Skip to content

Commit

Permalink
Merge branch 'development' into beamtime_testing_script
Browse files Browse the repository at this point in the history
  • Loading branch information
nstelter-slac authored Apr 15, 2024
2 parents 276a7b7 + 3e6f935 commit fe2e202
Show file tree
Hide file tree
Showing 29 changed files with 1,087 additions and 1,579 deletions.
16 changes: 9 additions & 7 deletions calibrationSuite/ancillaryMethods.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,17 @@ def selectedClusters(clusters, row, col, lowEnerygCut, highEnergyCut, nPixelCut=
pass


def goodClusters(clusters, row, col, nPixelCut=4, isSquare=None):
##print(clusters)
pixelRowCol = np.bitwise_and((clusters[:, :, 1] == row), (clusters[:, :, 2] == col))
def goodClusters(clusters, module, row, col, nPixelCut=4, isSquare=None):
mCut = clusters[:,:,1] == module
pixelRowCol = np.bitwise_and((clusters[:, :, 2] == row), (clusters[:, :, 3] == col))
if isSquare is None:
small = clusters[:, :, 3] < nPixelCut
small = clusters[:, :, 4] < nPixelCut
else:
small = np.bitwise_and((clusters[:, :, 3] < nPixelCut), (clusters[:, :, 4] == isSquare))
return clusters[np.bitwise_and(small, pixelRowCol)]

small = np.bitwise_and((clusters[:, :, 4] < nPixelCut), (clusters[:, :, 5] == isSquare))
c = clusters[np.bitwise_and.reduce([mCut, small, pixelRowCol])]
##print(c.shape)
##print(c)
return c

def getClusterEnergies(clusters):
##print(clusters)
Expand Down
8 changes: 7 additions & 1 deletion calibrationSuite/argumentParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ def __init__(self):
self.parser.add_argument("-r", "--run", type=int, help="run")
self.parser.add_argument("-R", "--runRange", help="run range, format ...")
self.parser.add_argument("--fivePedestalRun", type=int, help="5 pedestal run")
self.parser.add_argument("--fakePedestal", type=str, help="fake pedestal file")
self.parser.add_argument("--fakePedestalFile", type=str, help="fake pedestal file")
self.parser.add_argument("--g0PedFile", type=str, help="g0 pedestal file")
self.parser.add_argument("--g1PedFile", type=str, help="g1 pedestal file")
self.parser.add_argument("--g0GainFile", type=str, help="g0 gain file")
self.parser.add_argument("--g1GainFile", type=str, help="g1 gain file")
self.parser.add_argument("--offsetFile", type=str, help="offset file for stitching")
self.parser.add_argument("-c", "--camera", type=int, help="camera.n")
self.parser.add_argument("-p", "--path", type=str, help="the base path to the output directory")
self.parser.add_argument("-n", "--nModules", type=int, help="nModules")
self.parser.add_argument("--mode", type=str, help="detector mode (1d, 2d, ...?") ## might be discoverable otherwise
self.parser.add_argument(
"-d", "--detType", type=str, default="", help="Epix100, Epix10ka, Epix10kaQuad, Epix10ka2M, ..."
)
Expand Down
Loading

0 comments on commit fe2e202

Please sign in to comment.