Hi:)
While working on the post-ptep e2e simulations, I noticed that if we try to read an observation saved without the tod field, I mean there is no obs.tod, then lines 543 and 568-569 give an error as there is no result.tod.
I propose to change these lines as follows (this is a git diff output):
# All the fields must conform to the same shape as `Observation.tod`
- assert result.tod.shape == hdf5_tod.shape
+ assert result.__getattribute__(tod_fields[0]).shape == hdf5_tod.shape
result.__setattr__(cur_field_name, hdf5_tod.astype(tod_dtype)[:])
# If we arrive here, we must have read at least one TOD
@@ -565,8 +565,8 @@ def read_one_observation(
if read_local_flags_if_present:
flags = __find_flags(
inpf,
- expected_num_of_dets=result.tod.shape[0],
- expected_num_of_samples=result.tod.shape[1],
+ expected_num_of_dets=result.__getattribute__(tod_fields[0]).shape[0],
+ expected_num_of_samples=result.__getattribute__(tod_fields[0]).shape[1],
)
I've tried with this modification and the code works. I can take care of the fix, I already created a local branch and I'm ready to commit in a PR:) What do you think?
Hi:) While working on the post-ptep e2e simulations, I noticed that if we try to read an observation saved without the
tod
field, I mean there is noobs.tod
, then lines 543 and 568-569 give an error as there is noresult.tod
. I propose to change these lines as follows (this is a git diff output):I've tried with this modification and the code works. I can take care of the fix, I already created a local branch and I'm ready to commit in a PR:) What do you think?