Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dermen committed Mar 14, 2024
1 parent 99971ad commit c5144ff
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/dxtbx/format/FormatXTC.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
.type = str
.help = Experiment identifier, e.g. mfxo1916
run = None
.type = ints
.type = int
.multiple = True
.help = Run number or a list of runs to process
mode = idx
.type = str
Expand Down Expand Up @@ -245,23 +246,27 @@ def populate_events(self):
self.run_mapping = {}

if self.params.mode == "idx":
for run in self._psana_runs.values():
for run_num, run in self._psana_runs.items():
times = run.times()
if self._hit_inds is not None and run.run() in self._hit_inds:
if self._hit_inds is not None and run_num not in self._hit_inds:
continue
if self._hit_inds is not None and run_num in self._hit_inds:
temp = []
for i_hit in self._hit_inds[run.run()]:
for i_hit in self._hit_inds[run_num]:
temp.append( times[i_hit] )
times = tuple(temp)
if (
self.params.filter.required_present_codes
or self.params.filter.required_absent_codes
) and self.params.filter.pre_filter:
times = [t for t in times if self.filter_event(run.event(t))]
self.run_mapping[run.run()] = (

self.run_mapping[run_num] = (
len(self.times),
len(self.times) + len(times),
run,
)

self.times.extend(times)
self.n_images = len(self.times)

Expand Down

0 comments on commit c5144ff

Please sign in to comment.