This repository has been archived by the owner on Jun 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Improper handling of empty chunk #428
Comments
Maybe related to #385 |
Hi @mhliu0001, long story short of this issue is:
|
Hi @ramirezdiego , thanks for the quick reply! I am raising this issue because I think there is a simple fix to this bug: just deleting the line https://github.com/XENONnT/WFSim/blob/master/wfsim/strax_interface.py#L969 and other stuff that creates a chunk with start=end=0. To be specific: for data_type in self.provides:
if 'nv' in data_type:
if exist_nveto_result:
chunk[data_type] = self.chunk(start=self.sim_nv.chunk_time_pre,
end=self.sim_nv.chunk_time,
data=result_nv[data_type.strip('_nv')],
data_type=data_type)
# If nv is not one of the targets just return an empty chunk
# If there is TPC event, set TPC time for the start and end
else:
dummy_dtype = self._truth_dtype if 'truth' in data_type else strax.raw_record_dtype()
if exist_tpc_result:
chunk[data_type] = self.chunk(start=self.sim.chunk_time_pre,
end=self.sim.chunk_time,
data=np.array([], dtype=dummy_dtype),
data_type=data_type)
else:
chunk[data_type] = self.chunk(start=0, end=0, data=np.array([], dtype=dummy_dtype), #here
data_type=data_type)
else:
if exist_tpc_result:
chunk[data_type] = self.chunk(start=self.sim.chunk_time_pre,
end=self.sim.chunk_time,
data=result[data_type],
data_type=data_type)
else:
dummy_dtype = self._truth_dtype if 'truth' in data_type else strax.raw_record_dtype()
if exist_nveto_result:
chunk[data_type] = self.chunk(start=self.sim_nv.chunk_time_pre,
end=self.sim_nv.chunk_time,
data=np.array([], dtype=dummy_dtype),
data_type=data_type)
else:
chunk[data_type] = self.chunk(start=0, end=0, data=np.array([], dtype=dummy_dtype), #here
data_type=data_type) Those two lines marked with #here actually are the root of this problem. I don't know why they were here in the first place, maybe someone know that. If these lines are redundant, we can just delete them and fix this. I am still investigating this problem, but if this is the case, does it make sense to you to fix it before our full-chain simulation for SR1? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
From https://github.com/XENONnT/WFSim/blob/master/wfsim/strax_interface.py#L969, if a chunk has empty data (occurs when chunk_size or event_rate is set too small),
WFSim
will create chunks with start time and end time to be zeros. This will cause an exception whenstrax
checks the continuity of chunks, like:The text was updated successfully, but these errors were encountered: