Skip to content

psana.psexp.singlefile_ds

SingleFileDataSource is returned by DataSource(files=...). files is one xtc2 file name or a list of names (a single string is turned into a list by DataSourceBase). The files are read one after another, and small-data files are not used. A file that does not exist raises FileNotFoundError when it is opened: the first file in the constructor, the others when runs() reaches them. runs() yields one RunSingleFile (see psana.psexp.run) for each BeginRun.

See DataSource, Run and the event loop.

psana.psexp.singlefile_ds

Define SingleFileDataSource, the data source that reads the xtc2 files given with files.

SingleFileDataSource

SingleFileDataSource(*args, **kwargs)

Bases: DataSourceBase

Data source that reads the xtc2 files listed in files directly, one after another.

Smalldata (smd) files are not used. The constructor passes the keyword arguments to DataSourceBase.__init__, opens the first file with a DgramManager (FileNotFoundError if it does not exist), and starts the Prometheus client.

runs

runs()

Yield a RunSingleFile for each BeginRun found, reading the files in order.

When the current file has no more BeginRun dgrams the next file is opened and searched; iteration stops when no files remain or a newly opened file has no BeginRun. Each run gets the experiment, run number and timestamp from the BeginRun dgram, plus dsparms, the DgramManager, the configs and the BeginRun dgrams.

is_mpi

is_mpi()

Return False.