HERA-Team / hera_sim

Simple simulation code for HERA-like redundant interferometric arrays
Other
16 stars 8 forks source link

Bug in Simulator #199

Open r-pascua opened 2 years ago

r-pascua commented 2 years ago

I think I found a bug in the Simulator class that has eluded the test suite. It looks like calling the add method with a multiplicative effect and both ret_vis and add_vis set to True will result in the gain dictionary being returned, but the gains not actually being applied to the data. I think this can be fixed by inserting the following code block between lines 1082 and 1083 of the simulate.py module:

if add_vis:
    self.data.data_array = data_copy

Additionally, the test_adding_vis_but_also_returning test should be updated to catch this. I think the best way to do this is to parametrize the test function, with one branch being an additive effect and the other being a multiplicative effect. I'll probably be the one to fix this, so I'll leave it to future-me to figure out the updated contents of the test.