Skip to content

Commit

Permalink
Merge branch 'master' of github.com:epics-base/pvaPy
Browse files Browse the repository at this point in the history
  • Loading branch information
sveseli committed Oct 23, 2023
2 parents 6de7a07 + e1e3965 commit a45a335
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pvapy/cli/adSimServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def __init__(self, filePath, config):
self.filePath = filePath
self.cfg = config
self.nInputFrames = 0
self.rows = 0
self.cols = 0
if not fabio:
raise Exception('Missing fabio support.')
if not filePath:
Expand Down Expand Up @@ -173,6 +175,8 @@ def loadBinInputFile(self):
self.frames = np.ndarray.flatten(self.frames)
print(f'Loaded input file {self.filePath}')
self.nInputFrames += nFrames
self.rows = self.cfg['file_info']['height']
self.cols = self.cfg['file_info']['width']
return 1
except Exception as ex:
print(f'Cannot load input file {self.filePath}: {ex}, skipping it')
Expand All @@ -194,8 +198,10 @@ def getFrameData(self, frameId):
return None

def getFrameInfo(self):
if self.frames is not None and not self.nInputFrames:
self.rows, self.cols = self.frames.shape
if self.frames is not None and not self.bin:
frames, self.rows, self.cols = self.frames.shape
self.dtype = self.frames.dtype
elif self.frames is not None and self.bin:
self.dtype = self.frames.dtype
return (self.nInputFrames, self.rows, self.cols, self.colorMode, self.dtype, self.compressorName)

Expand Down Expand Up @@ -327,6 +333,7 @@ def __init__(self, inputDirectory, inputFile, mmapMode, hdfDataset, hdfCompressi
allowedNpExtensions = ['npy', 'npz', 'NPY']
if nFrames > 0:
inputFiles = inputFiles[:nFrames]
inputFiles = sorted(inputFiles)
if cfgFile is not None and yaml is not None:
self.configFile = yaml.load(open(cfgFile, 'r'), Loader=yaml.CLoader)
if self.configFile['file_info']['ordered_files'] is not None:
Expand Down

0 comments on commit a45a335

Please sign in to comment.