i4Ds / Karabo-Pipeline

The Karabo Pipeline can be used as Digital Twin for SKA
https://i4ds.github.io/Karabo-Pipeline/
MIT License
11 stars 4 forks source link

No error when combining visibilities after using `ObservationLong` #290

Closed kenfus closed 1 year ago

kenfus commented 1 year ago

Currently, I get the following error when trying to combine visibilities:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[14], line 1
----> 1 Visibility.combine_vis(2, visibilities, combined_vis_filepath)
      2 visibilties = Visibility(combined_vis_filepath)

File ~/miniconda3/envs/karabo-env/lib/python3.9/site-packages/karabo/simulation/visibility.py:208, in Visibility.combine_vis(number_of_days, visiblity_files, combined_vis_filepath)
    206 start_row = t * block.num_baselines
    207 exposure_sec = time_inc[t]
--> 208 ms.write_coords(
    209     start_row,
    210     block.num_baselines,
    211     uui[t],
    212     vvi[t],
    213     wwi[t],
    214     exposure_sec,
    215     time_inc[t],
    216     time_stamp,
    217 )
    218 ms.write_vis(
    219     start_row, 0, block.num_channels, block.num_baselines, out_vis[t]
    220 )

File ~/miniconda3/envs/karabo-env/lib/python3.9/site-packages/oskar/measurement_set.py:344, in MeasurementSet.write_coords(self, start_row, num_baselines, uu, vv, ww, exposure_sec, interval_sec, time_stamp)
    316 def write_coords(self, start_row, num_baselines, uu, vv, ww,
    317                  exposure_sec, interval_sec, time_stamp):
    318     """Writes baseline coordinate data to the main table.
    319 
    320     This function writes the supplied list of baseline coordinates to
   (...)
    342         time_stamp (float):     Time stamp of visibility block.
    343     """
--> 344     _measurement_set_lib.write_coords(
    345         self._capsule, start_row, num_baselines, uu, vv, ww,
    346         exposure_sec, interval_sec, time_stamp)

RuntimeError: Input data dimension mismatch.

Code can be found here: https://github.com/i4Ds/Karabo-Pipeline/blob/92986fd08b4e2112f6290e610cc918452bd72dd8/karabo/examples/time_GPU_speed.ipynb

sfiruch commented 1 year ago

Please create a unit-test first.

kenfus commented 1 year ago

The error is made by changing the parameter number_of_time_steps. However, we need to set this to something else than 1 because of #284.

Could you have a look at it please @rohitcbscient?