caracal-pipeline / caracal

Containerized Automated Radio Astronomy Calibration (CARACal) pipeline
GNU General Public License v2.0
28 stars 6 forks source link

TypeError: list indices must be integers or slices, not str in refant selection #1341

Closed o-smirnov closed 3 years ago

o-smirnov commented 3 years ago

Something broke recently in the refant=auto selection. Sinah reported the same thing earlier:

# 2021-06-01 20:17:02   WARN    MeasIERS::findTab (file /code/measures/Measures/MeasIERS.cc, line 387)+ /usr/share/casacore/data/ephemerides/
# 2021-06-01 20:17:02   WARN    MeasIERS::findTab (file /code/measures/Measures/MeasIERS.cc, line 387)+ /usr/share/casacore/data/geodetic/
# 2021-06-01 20:17:02   SEVERE  MeasTable::doInitObservatories() (file /code/measures/Measures/MeasTable.cc, line 2865) Cannot read table of Observatories
# MSUtils.flag_stats - 2021-06-01 20:17:01,794 WARNING - Using the first id antenna as array centre.
# MSUtils.flag_stats - 2021-06-01 20:17:16,741 INFO - Computing correlation flag stats data...
# MSUtils.flag_stats - 2021-06-01 20:17:16,741 INFO - Correlation Names: ['XX', 'XY', 'YX', 'YY']
# MSUtils.flag_stats - 2021-06-01 20:17:25,657 INFO - Output json file: /stimela_mount/output/jove-1608538564_sdp_l0-pcal-flag-antenna_flag_summary.json.
2021-06-01 22:17:42 CARACal.Stimela.antenna_flag_summary INFO: Container [antenna_flag_summary-14051069736331216225784866157331] has executed successfully
2021-06-01 22:17:42 CARACal.Stimela.antenna_flag_summary INFO: Runtime was 0:02:29.997478.
2021-06-01 22:17:42 CARACal.Stimela.antenna_flag_summary INFO: job complete at 2021-06-01 22:17:42.349364 after 0:02:55.728773
2021-06-01 22:17:42 CARACal.Stimela.polcal INFO: Saving pipeline information in .last_polcal.json
2021-06-01 22:17:42 CARACal.Stimela.polcal INFO: Recipe executed successfully
2021-06-01 22:17:42 CARACal ERROR: list indices must be integers or slices, not str [TypeError]
2021-06-01 22:17:42 CARACal INFO:   More information can be found in the logfile at output2pol/logs-20210601-221435/log-caracal.txt
2021-06-01 22:17:42 CARACal INFO:   You are running version v1.0.4-159-g2372621b
2021-06-01 22:17:42 CARACal ERROR: Traceback (most recent call last):
2021-06-01 22:17:42 CARACal ERROR:   File "/home/oms/projects/caracal/caracal/main.py", line 183, in __run
2021-06-01 22:17:42 CARACal ERROR:     pipeline.run_workers()
2021-06-01 22:17:42 CARACal ERROR:   File "/home/oms/projects/caracal/caracal/workers/worker_administrator.py", line 441, in run_workers
2021-06-01 22:17:42 CARACal ERROR:     worker.worker(self, recipe, config)
2021-06-01 22:17:42 CARACal ERROR:   File "/home/oms/projects/caracal/caracal/workers/polcal_worker.py", line 1194, in worker
2021-06-01 22:17:42 CARACal ERROR:     pipeline.maxdist[i], i)
2021-06-01 22:17:42 CARACal ERROR:   File "/home/oms/projects/caracal/caracal/workers/utils/manage_antennas.py", line 21, in get_refant
2021-06-01 22:17:42 CARACal ERROR:     core_ants = _get_core_antennas(flag_stats, min_baseline, max_dist)
2021-06-01 22:17:42 CARACal ERROR:   File "/home/oms/projects/caracal/caracal/workers/utils/manage_antennas.py", line 54, in _get_core_antennas
2021-06-01 22:17:42 CARACal ERROR:     name = ant['name']
2021-06-01 22:17:42 CARACal ERROR: TypeError: list indices must be integers or slices, not str
2021-06-01 22:17:42 CARACal INFO: exiting with error code 1
Athanaseus commented 3 years ago

Ah yeah this is because of the latest stimela release which was supposed to go with #1328. So basically caracal master uses stimela on pip, and this will pull the latest msutils image. This should be resolved after the PR is merged.

o-smirnov commented 3 years ago

But I definitely installed stimela from master in this instance, so what gives?

What is the version of the msutils image that is needed? I can try it via general: cabs.

Athanaseus commented 3 years ago

So master is level with pypi version of stimela. This pulls the latest msutils (version 1.2.0) image 1.6.9, which requires the new changes in caracal, i.e. PR #1328 .

You need the previous image, tag 1.6.0 which has msutils version 1.1.3.

o-smirnov commented 3 years ago

Ah ok, so if once #1328 goes in, this goes way, and in the meantime

general:
  cabs:
    - name: msutils
      tag: 1.6.0

is a workaround?

Athanaseus commented 3 years ago

Yes, that's correct.

SpheMakh commented 3 years ago

Fixed