Commits
299 299 | for op, op_dict in process_dict.items(): |
300 300 | fix_dict[op] = dict() |
301 301 | for col, process_set in op_dict.items(): |
302 302 | if col not in ignore_columns: |
303 303 | report_conformance(mslist, col, process_set) |
304 304 | fix_dict[op][col] = process_set |
305 305 | fix_conformance(fix_dict) |
306 306 | |
307 307 | |
308 308 | def sort_vis(vislist, spw, mode, width, field, antenna, scan, intent, timerange): |
309 + | """Sort the given MeasurementSet path(s) by their earliest data-taking time, in increasing order. |
310 + | |
311 + | Return a 7-tuple where |
312 + | * the first entry holds the re-ordered paths |
313 + | * the remaining entries hold their corresponding data selection parameters |
314 + | * FIXME: input parameters mode and width are not used |
315 + | """ |
309 316 | if isinstance(vislist, str) or len(vislist) == 1: |
310 317 | return vislist, field, spw, antenna, scan, intent, timerange |
311 318 | # chronological sort |
312 319 | sorted_vislist, sorted_timelist = mslisthelper.sort_mslist(vislist) |
313 320 | _vislist = list(vislist) |
314 321 | sorted_idx = [_vislist.index(vis) for vis in sorted_vislist] |
315 322 | mslisthelper.report_sort_result(sorted_vislist, sorted_timelist, sorted_idx, mycasalog=casalog) |
316 323 | # conform MS |
317 324 | conform_mslist(sorted_vislist) |
318 325 | fieldsel = SelectionHandler(field) |
1004 1011 | antenna, scan, intent, timerange |
1005 1012 | ) |
1006 1013 | sorted_vis = _sorted[0] |
1007 1014 | sorted_field = _sorted[1] |
1008 1015 | sorted_spw = _sorted[2] |
1009 1016 | sorted_antenna = _sorted[3] |
1010 1017 | sorted_scan = _sorted[4] |
1011 1018 | sorted_intent = _sorted[5] |
1012 1019 | sorted_timerange = _sorted[6] |
1013 1020 | |
1021 + | sorted_baseline = [antenna_to_baseline(a) for a in sorted_antenna] |
1022 + | |
1014 1023 | # Handle image geometric parameters |
1015 1024 | _ephemsrcname = '' |
1016 1025 | ephem_sources = ['MERCURY', 'VENUS', 'MARS', 'JUPITER', 'SATURN', |
1017 1026 | 'URANUS', 'NEPTUNE', 'PLUTO', 'SUN', 'MOON', 'TRACKFIELD'] |
1018 1027 | if isinstance(phasecenter, str) and phasecenter.strip().upper() in ephem_sources: |
1019 1028 | _ephemsrcname = phasecenter |
1020 1029 | _imsize, _cell, _phasecenter = _handle_image_params( |
1021 1030 | imsize, cell, phasecenter, sorted_vis, |
1022 1031 | sorted_field, sorted_spw, sorted_antenna, |
1023 1032 | sorted_scan, sorted_intent, sorted_timerange, |
1027 1036 | # Set up PySynthesisImager input parameters |
1028 1037 | # - List all parameters that you need here |
1029 1038 | # - Defaults will be assumed for unspecified parameters |
1030 1039 | # - Nearly all parameters are identical to that in the task. Please look at the |
1031 1040 | # list of parameters under __init__ using " help ImagerParameters " ) |
1032 1041 | casalog.post('*** Creating paramList ***', origin=origin) |
1033 1042 | paramList = ImagerParameters( |
1034 1043 | # input file name |
1035 1044 | msname=sorted_vis, # 'sdimaging.ms', |
1036 1045 | # data selection |
1037 - | field=field, # '', |
1038 - | spw=_spw, # '0', |
1039 - | timestr=timerange, |
1040 - | antenna=baseline, |
1041 - | scan=scan, |
1042 - | state=intent, |
1046 + | field=sorted_field, # '', |
1047 + | spw=sorted_spw, # '0', |
1048 + | timestr=sorted_timerange, |
1049 + | antenna=sorted_baseline, |
1050 + | scan=sorted_scan, |
1051 + | state=sorted_intent, |
1043 1052 | # image parameters |
1044 1053 | imagename=output_path_prefix, # 'try2', |
1045 1054 | nchan=imnchan, # 1024, |
1046 1055 | start=imstart, # '0', |
1047 1056 | width=imwidth, # '1', |
1048 1057 | outframe=outframe, |
1049 1058 | veltype=veltype, |
1050 1059 | restfreq=_restfreq, |
1051 1060 | phasecenter=_phasecenter, # 'J2000 17:18:29 +59.31.23', |
1052 1061 | imsize=_imsize, # [75,75], |