Commits

Rui Xue authored 7356f47f130
PIPE-2498: prevent numpy scalar dtype representation of spwmap in the hif_selfcal QA weblog.
No tags

pipeline/hif/heuristics/auto_selfcal/selfcal_helpers.py

Modified
1870 1870 max_bw_index = (eff_bws == np.max(eff_bws[minflagged_index[0]])).nonzero()
1871 1871 max_bw_min_flags_index = np.intersect1d(minflagged_index[0], max_bw_index[0])
1872 1872 # if len(max_bw_min_flags_index) > 1:
1873 1873 # don't need the conditional since this works with array lengths of 1
1874 1874 map_index = max_bw_min_flags_index[np.argmax(eff_bws[max_bw_min_flags_index])]
1875 1875 # else:
1876 1876 # map_index=max_bw_min_flags_index[0]
1877 1877
1878 1878 # make spwmap list that first maps everything to itself, need max spw to make that list
1879 1879 maxspw = np.max(slib[vis]['spwsarray']+1)
1880 - applycal_spwmap_int_list = list(np.arange(maxspw))
1880 + applycal_spwmap_int_list = np.arange(maxspw).tolist()
1881 1881 for i in range(len(applycal_spwmap_int_list)):
1882 1882 applycal_spwmap.append(applycal_spwmap_int_list[i])
1883 1883
1884 1884 # replace the elements that require spwmapping (spwmap[i] == True
1885 1885 for i in range(len(spwmap)):
1886 1886 LOG.info(f'{i} {spwlist[i]} {spwmap[i]}')
1887 1887 if spwmap[i]:
1888 1888 applycal_spwmap[int(spwlist[i])] = int(spwlist[map_index])
1889 1889 # always fallback to combinespw for spectral scans
1890 1890 if fallback != '' and spectral_scan:

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut