simple 18-Sep-2019 23:16:10 Build CASA - Casa6 Tasks Wheel Build - Build and Package RHEL6 #146 (CASA-CTB-JOB1-146) started building on agent cbt-el7-6.cv.nrao.edu (2) simple 18-Sep-2019 23:16:10 Remote agent on host cbt-el7-6.cv.nrao.edu simple 18-Sep-2019 23:16:10 Build working directory is /export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1 simple 18-Sep-2019 23:16:10 Executing build CASA - Casa6 Tasks Wheel Build - Build and Package RHEL6 #146 (CASA-CTB-JOB1-146) simple 18-Sep-2019 23:16:10 Starting task 'Clean working directory task' of type 'com.atlassian.bamboo.plugins.bamboo-artifact-downloader-plugin:cleanWorkingDirectoryTask' simple 18-Sep-2019 23:16:10 Cleaning working directory '/export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1' simple 18-Sep-2019 23:16:10 Finished task 'Clean working directory task' with result: Success simple 18-Sep-2019 23:16:10 Running pre-build action: VCS Version Collector simple 18-Sep-2019 23:16:10 Starting task 'Create wheeldirectory' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script' command 18-Sep-2019 23:16:10 Beginning to execute external process for build 'CASA - Casa6 Tasks Wheel Build - Build and Package RHEL6 #146 (CASA-CTB-JOB1-146)'\n ... running command line: \n/export/home/cbt-el7-6/bamboohome/temp/CASA-CTB-JOB1-146-ScriptBuildTask-3793895135224509782.sh\n ... in: /export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1\n ... using extra environment variables: \nbamboo_planRepository_1_branch=master\nbamboo_dependency_parent_1=CASA-CTT-235\nbamboo_dependency_parent_0=CASA-DOCKERTEST-271\nbamboo_capability_buildmachinetype=test\nbamboo_planRepository_2_branch=master\nbamboo_dependency_parent_total=2\nbamboo_repository_34078771_name=OPEN-CASA-PKG\nbamboo_planRepository_1_branchDisplayName=master\nbamboo_repository_revision_number=3774826e7368e91e81763df047614a878a1fd25f\nbamboo_resultsUrl=https://open-bamboo.nrao.edu/browse/CASA-CTB-JOB1-146\nbamboo_build_working_directory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1\nbamboo_planRepository_1_name=OPEN-CASA\nbamboo_buildKey=CASA-CTB-JOB1\nbamboo_shortPlanName=Casa6 Tasks Wheel Build\nbamboo_capability_hostname=cbt-el7-6.cv.nrao.edu\nbamboo_planRepository_2_username=\nbamboo_planRepository_name=OPEN-CASA\nbamboo_buildNumber=146\nbamboo_planRepository_2_branchDisplayName=master\nbamboo_capability_system_jdk_JDK_1_8_0_131=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64\nbamboo_shortJobName=Build and Package RHEL6\nbamboo_buildResultsUrl=https://open-bamboo.nrao.edu/browse/CASA-CTB-JOB1-146\nbamboo_planRepository_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_repository_34078770_name=OPEN-CASA\nbamboo_repository_34078770_revision_number=3774826e7368e91e81763df047614a878a1fd25f\nbamboo_agentId=21790725\nbamboo_planName=CASA - Casa6 Tasks Wheel Build\nbamboo_shortPlanKey=CTB\nbamboo_shortJobKey=JOB1\nbamboo_repository_34078771_branch_name=master\nbamboo_planRepository_2_name=OPEN-CASA-PKG\nbamboo_planRepository_revision=3774826e7368e91e81763df047614a878a1fd25f\nbamboo_repository_34078770_branch_name=master\nbamboo_buildTimeStamp=2019-09-18T23:16:10.304-04:00\nbamboo_repository_previous_revision_number=b754f51ceb53a1d87dd042f3e2865327424ab083\nbamboo_repository_git_branch=master\nbamboo_buildResultKey=CASA-CTB-JOB1-146\nbamboo_repository_branch_name=master\nbamboo_buildPlanName=CASA - Casa6 Tasks Wheel Build - Build and Package RHEL6\nbamboo_planRepository_1_revision=3774826e7368e91e81763df047614a878a1fd25f\nbamboo_capability_system_hg_executable=/bin/hg\nbamboo_repository_34078770_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_repository_name=OPEN-CASA-PKG\nbamboo_buildFailed=false\nbamboo_capability_system_docker_executable=/bin/docker\nbamboo_planRepository_branch=master\nbamboo_repository_34078770_git_branch=master\nbamboo_agentWorkingDirectory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir\nbamboo_capability_system_git_executable=/bin/git\nbamboo_planRepository_2_revision=d133fd2df3a06149a71d5c55b5876730dc7d1641\nbamboo_repository_git_username=\nbamboo_capability_operating_system=EL7\nbamboo_planRepository_branchDisplayName=master\nbamboo_planRepository_1_type=bbserver\nbamboo_planRepository_branchName=master\nbamboo_repository_34078771_git_branch=master\nbamboo_capability_project=CASA\nbamboo_planRepository_2_type=bbserver\nbamboo_capability_system_jdk_JDK=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64\nbamboo_repository_34078771_git_username=\nbamboo_repository_34078771_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa-pkg.git\nbamboo_repository_34078771_previous_revision_number=d133fd2df3a06149a71d5c55b5876730dc7d1641\nbamboo_plan_storageTag=plan-33882474\nbamboo_hg_cache_directory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir/_hg-repositories-cache\nbamboo_repository_34078770_git_username=\nbamboo_planRepository_2_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa-pkg.git\nbamboo_planRepository_1_username=\nbamboo_planRepository_type=bbserver\nbamboo_git_cache_directory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir/_git-repositories-cache\nbamboo_repository_34078770_previous_revision_number=b754f51ceb53a1d87dd042f3e2865327424ab083\nbamboo_repository_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_planRepository_2_branchName=master\nbamboo_capability_system_builder_ant_Ant=/usr\nbamboo_tmp_directory=/export/home/cbt-el7-6/bamboohome/temp\nbamboo_working_directory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1\nbamboo_planKey=CASA-CTB\nbamboo_planRepository_1_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_planRepository_username=\nbamboo_capability_system_jdk_JDK_1_8=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64\nbamboo_capability_system_jdk_JDK_1_8_0_161=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64\nbamboo_repository_34078771_revision_number=d133fd2df3a06149a71d5c55b5876730dc7d1641\nbamboo_planRepository_1_branchName=master\n simple 18-Sep-2019 23:16:10 Finished task 'Create wheeldirectory' with result: Success command 18-Sep-2019 23:16:10 Substituting variable: ${bamboo.working.directory} with /export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1 simple 18-Sep-2019 23:16:10 Starting task 'Start container' of type 'com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli' simple 18-Sep-2019 23:16:10 Running image name (casa-docker.nrao.edu:5000/casa-build-tools-centos6) command 18-Sep-2019 23:16:10 Beginning to execute external process for build 'CASA - Casa6 Tasks Wheel Build - Build and Package RHEL6 #146 (CASA-CTB-JOB1-146)'\n ... running command line: \n/bin/docker run --volume /export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1/wheeldirectory:/wheeldirectory --detach --name task-wheel-container casa-docker.nrao.edu:5000/casa-build-tools-centos6 tail -f /dev/null\n ... in: /export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1\n ... using extra environment variables: \nbamboo_planRepository_1_branch=master\nbamboo_dependency_parent_1=CASA-CTT-235\nbamboo_dependency_parent_0=CASA-DOCKERTEST-271\nbamboo_capability_buildmachinetype=test\nbamboo_planRepository_2_branch=master\nbamboo_dependency_parent_total=2\nbamboo_repository_34078771_name=OPEN-CASA-PKG\nbamboo_planRepository_1_branchDisplayName=master\nbamboo_repository_revision_number=3774826e7368e91e81763df047614a878a1fd25f\nbamboo_resultsUrl=https://open-bamboo.nrao.edu/browse/CASA-CTB-JOB1-146\nbamboo_build_working_directory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1\nbamboo_planRepository_1_name=OPEN-CASA\nbamboo_buildKey=CASA-CTB-JOB1\nbamboo_shortPlanName=Casa6 Tasks Wheel Build\nbamboo_capability_hostname=cbt-el7-6.cv.nrao.edu\nbamboo_planRepository_2_username=\nbamboo_planRepository_name=OPEN-CASA\nbamboo_buildNumber=146\nbamboo_planRepository_2_branchDisplayName=master\nbamboo_capability_system_jdk_JDK_1_8_0_131=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64\nbamboo_shortJobName=Build and Package RHEL6\nbamboo_buildResultsUrl=https://open-bamboo.nrao.edu/browse/CASA-CTB-JOB1-146\nbamboo_planRepository_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_repository_34078770_name=OPEN-CASA\nbamboo_repository_34078770_revision_number=3774826e7368e91e81763df047614a878a1fd25f\nbamboo_agentId=21790725\nbamboo_planName=CASA - Casa6 Tasks Wheel Build\nbamboo_shortPlanKey=CTB\nbamboo_build_commandline_com_atlassian_bamboo_plugins_scripttask_task_builder_script_9=/export/home/cbt-el7-6/bamboohome/temp/CASA-CTB-JOB1-146-ScriptBuildTask-3793895135224509782.sh\nbamboo_shortJobKey=JOB1\nbamboo_repository_34078771_branch_name=master\nbamboo_planRepository_2_name=OPEN-CASA-PKG\nbamboo_planRepository_revision=3774826e7368e91e81763df047614a878a1fd25f\nbamboo_repository_34078770_branch_name=master\nbamboo_buildTimeStamp=2019-09-18T23:16:10.304-04:00\nbamboo_repository_previous_revision_number=b754f51ceb53a1d87dd042f3e2865327424ab083\nbamboo_repository_git_branch=master\nbamboo_buildResultKey=CASA-CTB-JOB1-146\nbamboo_repository_branch_name=master\nbamboo_buildPlanName=CASA - Casa6 Tasks Wheel Build - Build and Package RHEL6\nbamboo_planRepository_1_revision=3774826e7368e91e81763df047614a878a1fd25f\nbamboo_capability_system_hg_executable=/bin/hg\nbamboo_repository_34078770_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_repository_name=OPEN-CASA-PKG\nbamboo_buildFailed=false\nbamboo_capability_system_docker_executable=/bin/docker\nbamboo_planRepository_branch=master\nbamboo_repository_34078770_git_branch=master\nbamboo_agentWorkingDirectory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir\nbamboo_capability_system_git_executable=/bin/git\nbamboo_planRepository_2_revision=d133fd2df3a06149a71d5c55b5876730dc7d1641\nbamboo_repository_git_username=\nbamboo_capability_operating_system=EL7\nbamboo_planRepository_branchDisplayName=master\nbamboo_planRepository_1_type=bbserver\nbamboo_planRepository_branchName=master\nbamboo_repository_34078771_git_branch=master\nbamboo_capability_project=CASA\nbamboo_planRepository_2_type=bbserver\nbamboo_capability_system_jdk_JDK=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64\nbamboo_repository_34078771_git_username=\nbamboo_repository_34078771_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa-pkg.git\nbamboo_repository_34078771_previous_revision_number=d133fd2df3a06149a71d5c55b5876730dc7d1641\nbamboo_plan_storageTag=plan-33882474\nbamboo_hg_cache_directory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir/_hg-repositories-cache\nbamboo_repository_34078770_git_username=\nbamboo_planRepository_2_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa-pkg.git\nbamboo_planRepository_1_username=\nbamboo_planRepository_type=bbserver\nbamboo_git_cache_directory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir/_git-repositories-cache\nbamboo_repository_34078770_previous_revision_number=b754f51ceb53a1d87dd042f3e2865327424ab083\nbamboo_repository_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_planRepository_2_branchName=master\nbamboo_capability_system_builder_ant_Ant=/usr\nbamboo_tmp_directory=/export/home/cbt-el7-6/bamboohome/temp\nbamboo_working_directory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1\nbamboo_planKey=CASA-CTB\nbamboo_planRepository_1_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_planRepository_username=\nbamboo_capability_system_jdk_JDK_1_8=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64\nbamboo_capability_system_jdk_JDK_1_8_0_161=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64\nbamboo_repository_34078771_revision_number=d133fd2df3a06149a71d5c55b5876730dc7d1641\nbamboo_planRepository_1_branchName=master\n build 18-Sep-2019 23:16:11 e915f7ed69d2233160b199420a74c6afeacde32598f5337598b7b4bfbec85066 simple 18-Sep-2019 23:16:11 Finished task 'Start container' with result: Success command 18-Sep-2019 23:16:11 Substituting variable: ${bamboo.working.directory} with /export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1 command 18-Sep-2019 23:16:11 Substituting variable: ${bamboo.working.directory} with /export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1 simple 18-Sep-2019 23:16:11 Starting task 'Create wheel' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script' command 18-Sep-2019 23:16:11 Beginning to execute external process for build 'CASA - Casa6 Tasks Wheel Build - Build and Package RHEL6 #146 (CASA-CTB-JOB1-146)'\n ... running command line: \n/export/home/cbt-el7-6/bamboohome/temp/CASA-CTB-JOB1-146-ScriptBuildTask-3582867859142838570.sh\n ... in: /export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1\n ... using extra environment variables: \nbamboo_planRepository_1_branch=master\nbamboo_dependency_parent_1=CASA-CTT-235\nbamboo_dependency_parent_0=CASA-DOCKERTEST-271\nbamboo_capability_buildmachinetype=test\nbamboo_planRepository_2_branch=master\nbamboo_dependency_parent_total=2\nbamboo_repository_34078771_name=OPEN-CASA-PKG\nbamboo_planRepository_1_branchDisplayName=master\nbamboo_repository_revision_number=3774826e7368e91e81763df047614a878a1fd25f\nbamboo_resultsUrl=https://open-bamboo.nrao.edu/browse/CASA-CTB-JOB1-146\nbamboo_build_working_directory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1\nbamboo_planRepository_1_name=OPEN-CASA\nbamboo_buildKey=CASA-CTB-JOB1\nbamboo_shortPlanName=Casa6 Tasks Wheel Build\nbamboo_capability_hostname=cbt-el7-6.cv.nrao.edu\nbamboo_planRepository_2_username=\nbamboo_planRepository_name=OPEN-CASA\nbamboo_buildNumber=146\nbamboo_planRepository_2_branchDisplayName=master\nbamboo_capability_system_jdk_JDK_1_8_0_131=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64\nbamboo_shortJobName=Build and Package RHEL6\nbamboo_buildResultsUrl=https://open-bamboo.nrao.edu/browse/CASA-CTB-JOB1-146\nbamboo_planRepository_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_repository_34078770_name=OPEN-CASA\nbamboo_repository_34078770_revision_number=3774826e7368e91e81763df047614a878a1fd25f\nbamboo_agentId=21790725\nbamboo_planName=CASA - Casa6 Tasks Wheel Build\nbamboo_shortPlanKey=CTB\nbamboo_build_commandline_com_atlassian_bamboo_plugins_scripttask_task_builder_script_9=/export/home/cbt-el7-6/bamboohome/temp/CASA-CTB-JOB1-146-ScriptBuildTask-3793895135224509782.sh\nbamboo_dockerContainerNames=task-wheel-container\nbamboo_shortJobKey=JOB1\nbamboo_repository_34078771_branch_name=master\nbamboo_planRepository_2_name=OPEN-CASA-PKG\nbamboo_planRepository_revision=3774826e7368e91e81763df047614a878a1fd25f\nbamboo_repository_34078770_branch_name=master\nbamboo_buildTimeStamp=2019-09-18T23:16:10.304-04:00\nbamboo_repository_previous_revision_number=b754f51ceb53a1d87dd042f3e2865327424ab083\nbamboo_build_commandline_com_atlassian_bamboo_plugins_bamboo_docker_plugin_task_docker_cli_7=/bin/docker run --volume /export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1/wheeldirectory:/wheeldirectory --detach --name task-wheel-container casa-docker.nrao.edu:5000/casa-build-tools-centos6 tail -f /dev/null\nbamboo_repository_git_branch=master\nbamboo_buildResultKey=CASA-CTB-JOB1-146\nbamboo_repository_branch_name=master\nbamboo_buildPlanName=CASA - Casa6 Tasks Wheel Build - Build and Package RHEL6\nbamboo_planRepository_1_revision=3774826e7368e91e81763df047614a878a1fd25f\nbamboo_capability_system_hg_executable=/bin/hg\nbamboo_repository_34078770_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_repository_name=OPEN-CASA-PKG\nbamboo_buildFailed=false\nbamboo_capability_system_docker_executable=/bin/docker\nbamboo_planRepository_branch=master\nbamboo_repository_34078770_git_branch=master\nbamboo_agentWorkingDirectory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir\nbamboo_capability_system_git_executable=/bin/git\nbamboo_planRepository_2_revision=d133fd2df3a06149a71d5c55b5876730dc7d1641\nbamboo_repository_git_username=\nbamboo_capability_operating_system=EL7\nbamboo_planRepository_branchDisplayName=master\nbamboo_planRepository_1_type=bbserver\nbamboo_planRepository_branchName=master\nbamboo_repository_34078771_git_branch=master\nbamboo_capability_project=CASA\nbamboo_planRepository_2_type=bbserver\nbamboo_capability_system_jdk_JDK=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64\nbamboo_repository_34078771_git_username=\nbamboo_repository_34078771_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa-pkg.git\nbamboo_repository_34078771_previous_revision_number=d133fd2df3a06149a71d5c55b5876730dc7d1641\nbamboo_plan_storageTag=plan-33882474\nbamboo_hg_cache_directory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir/_hg-repositories-cache\nbamboo_repository_34078770_git_username=\nbamboo_planRepository_2_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa-pkg.git\nbamboo_planRepository_1_username=\nbamboo_planRepository_type=bbserver\nbamboo_git_cache_directory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir/_git-repositories-cache\nbamboo_repository_34078770_previous_revision_number=b754f51ceb53a1d87dd042f3e2865327424ab083\nbamboo_repository_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_planRepository_2_branchName=master\nbamboo_capability_system_builder_ant_Ant=/usr\nbamboo_tmp_directory=/export/home/cbt-el7-6/bamboohome/temp\nbamboo_working_directory=/export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1\nbamboo_planKey=CASA-CTB\nbamboo_planRepository_1_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_planRepository_username=\nbamboo_capability_system_jdk_JDK_1_8=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64\nbamboo_capability_system_jdk_JDK_1_8_0_161=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64\nbamboo_repository_34078771_revision_number=d133fd2df3a06149a71d5c55b5876730dc7d1641\nbamboo_planRepository_1_branchName=master\n build 18-Sep-2019 23:16:11 datapath=[ "/opt/casa/data/master" ] build 18-Sep-2019 23:16:12 datapath=[ "/opt/casa/data/master" ] build 18-Sep-2019 23:16:14 Collecting casatools build 18-Sep-2019 23:16:14 Downloading https://casa-pip.nrao.edu:443/repository/pypi-group/packages/casatools/2019.152/casatools-2019.152-cp36-cp36m-linux_x86_64.whl (515.0MB) build 18-Sep-2019 23:17:05 Requirement already satisfied: numpy in /opt/rh/rh-python36/root/usr/lib64/python3.6/site-packages (from casatools) build 18-Sep-2019 23:17:05 Installing collected packages: casatools build 18-Sep-2019 23:17:08 Successfully installed casatools-2019.152 error 18-Sep-2019 23:17:09 You are using pip version 9.0.1, however version 19.2.3 is available. error 18-Sep-2019 23:17:09 You should consider upgrading via the 'pip install --upgrade pip' command. build 18-Sep-2019 23:17:23 Submodule 'casa-source' (https://open-bitbucket.nrao.edu/scm/casa/casa.git) registered for path 'casa-source' build 18-Sep-2019 23:17:23 Cloning into 'casa-source'... build 18-Sep-2019 23:17:32 Submodule path 'casa-source': checked out 'b754f51ceb53a1d87dd042f3e2865327424ab083' build 18-Sep-2019 23:17:32 Submodule 'casacore' (https://github.com/casacore/casacore.git) registered for path 'casacore' build 18-Sep-2019 23:17:32 Cloning into 'casacore'... build 18-Sep-2019 23:17:42 Submodule path 'casa-source/casacore': checked out 'c506c8c6e115777e2ea567b559fb09cef410dc85' error 18-Sep-2019 23:17:43 Previous HEAD position was b754f51... Merge pull request #1114 in CASA/casa from hf-drs30 to master error 18-Sep-2019 23:17:43 Switched to branch 'master' build 18-Sep-2019 23:17:44 Already up-to-date. build 18-Sep-2019 23:17:45 None build 18-Sep-2019 23:17:45 running bdist_wheel build 18-Sep-2019 23:17:45 initializing options... build 18-Sep-2019 23:17:45 finalizing options... build 18-Sep-2019 23:17:45 running build build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imhead.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/immoments.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imhistory.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/applycal.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/bandpass.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/blcal.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/calstat.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/concat.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/split.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/listobs.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/flagdata.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/flagcmd.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/setjy.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/cvel.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/cvel2.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/importuvfits.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/importfits.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/exportfits.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/exportuvfits.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/partition.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/listpartition.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/flagmanager.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/mstransform.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/tclean.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/immath.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/vishead.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/uvsub.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/spxfit.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/splattotable.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/specsmooth.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/specflux.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/smoothcal.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/specfit.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imstat.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/slsearch.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/delmod.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imsubimage.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/accor.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/accum.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/asdmsummary.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/clearcal.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/conjugatevis.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/exportasdm.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/importasdm.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/clearstat.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/fixplanets.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/fixvis.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/fluxscale.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/ft.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/gaincal.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/gencal.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/hanningsmooth.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imcollapse.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imcontsub.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imdev.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imfit.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/impbcor.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/importasap.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/importatca.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/importfitsidi.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/importgmrt.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/importnro.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/importvla.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/impv.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imrebin.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imreframe.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imregrid.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imsmooth.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imtrans.xml build 18-Sep-2019 23:19:09 fixing casa-source/gcwrap/tasks/imval.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/imval.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/initweights.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/listcal.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/listfits.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/listhistory.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/listsdm.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/listvis.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/makemask.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/polcal.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/polfromgain.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/predictcomp.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/rerefant.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/rmfit.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/rmtables.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/sdbaseline.xml build 18-Sep-2019 23:19:09 fixing casa-source/gcwrap/tasks/sdcal.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/sdcal.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/sdfit.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/sdfixscan.xml build 18-Sep-2019 23:19:09 fixing casa-source/gcwrap/tasks/sdgaincal.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/sdgaincal.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/sdimaging.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/sdsmooth.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/simalma.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/simobserve.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/simanalyze.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/feather.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/statwt.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/virtualconcat.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/uvcontsub.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/uvmodelfit.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/visstat.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/widebandpbcor.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/importmiriad.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/plotweather.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/plotants.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/fringefit.xml build 18-Sep-2019 23:19:09 upgrading casa-source/gcwrap/tasks/plotbandpass.xml build 18-Sep-2019 23:19:09 generating task python files... build 18-Sep-2019 23:19:09 creating build/lib.linux-x86_64-3.6/casatasks/private/parallel build 18-Sep-2019 23:19:09 copying src/modules/parallel/parallel_task_helper.py -> build/lib.linux-x86_64-3.6/casatasks/private/parallel build 18-Sep-2019 23:19:09 copying src/modules/parallel/parallel_data_helper.py -> build/lib.linux-x86_64-3.6/casatasks/private/parallel build 18-Sep-2019 23:19:09 copying src/modules/parallel/rflag_post_proc.py -> build/lib.linux-x86_64-3.6/casatasks/private/parallel build 18-Sep-2019 23:19:09 copying src/modules/parallel/__init__.py -> build/lib.linux-x86_64-3.6/casatasks/private/parallel build 18-Sep-2019 23:19:09 creating build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:09 copying src/modules/imagerhelpers/imager_parallel_cube.py -> build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:09 copying src/modules/imagerhelpers/__init__.py -> build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:09 copying src/modules/imagerhelpers/parallel_imager_helper.py -> build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:09 copying src/modules/imagerhelpers/imager_parallel_deconvolver.py -> build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:09 copying src/modules/imagerhelpers/input_parameters.py -> build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:09 copying src/modules/imagerhelpers/imager_parallel_continuum.py -> build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:09 copying src/modules/imagerhelpers/imager_base.py -> build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:09 installing to build/bdist.linux-x86_64/wheel build 18-Sep-2019 23:19:09 running install build 18-Sep-2019 23:19:09 running install_lib build 18-Sep-2019 23:19:09 running build_py build 18-Sep-2019 23:19:09 creating build/lib build 18-Sep-2019 23:19:09 creating build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/setjy.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/rerefant.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/cvel.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/imregrid.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/sdimaging.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/polfromgain.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/blcal.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/rmfit.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/predictcomp.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/virtualconcat.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/uvmodelfit.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/spxfit.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/sdfixscan.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/fixplanets.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/imreframe.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/importmiriad.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/mstransform.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/imrebin.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/specsmooth.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/delmod.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/widebandpbcor.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/visstat.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/hanningsmooth.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/importvla.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/tclean.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/listcal.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/cvel2.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/listpartition.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/exportfits.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/sdsmooth.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/asdmsummary.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/clearcal.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/rmtables.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/clearstat.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/partition.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/imtrans.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/flagcmd.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/importfitsidi.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/fixvis.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/imval.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/importnro.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/sdcal.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/plotants.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/importasdm.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/smoothcal.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/sdgaincal.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/accum.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/__init__.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/listhistory.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/importgmrt.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/gaincal.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/immath.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/bandpass.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/simanalyze.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/specflux.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/plotweather.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/applycal.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/sdbaseline.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/importuvfits.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/listobs.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/imstat.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/listsdm.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/immoments.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/importasap.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/uvcontsub.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/exportasdm.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/fluxscale.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/gencal.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/imcollapse.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/config.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/fringefit.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/imcontsub.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/vishead.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/calstat.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/imdev.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/feather.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/specfit.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/uvsub.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/ft.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/initweights.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/listfits.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/imsubimage.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/simalma.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/impv.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/split.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/polcal.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/conjugatevis.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/flagdata.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/slsearch.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/imfit.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/flagmanager.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/simobserve.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/makemask.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/exportuvfits.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/sdfit.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/importatca.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/splattotable.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/accor.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/impbcor.py -> build/lib/casatasks build 18-Sep-2019 23:19:09 copying build/lib.linux-x86_64-3.6/casatasks/importfits.py -> build/lib/casatasks build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/listvis.py -> build/lib/casatasks build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/imsmooth.py -> build/lib/casatasks build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/imhistory.py -> build/lib/casatasks build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/concat.py -> build/lib/casatasks build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/plotbandpass.py -> build/lib/casatasks build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/statwt.py -> build/lib/casatasks build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/imhead.py -> build/lib/casatasks error 18-Sep-2019 23:19:10 package init file 'build/lib.linux-x86_64-3.6/casatasks/__xml__/__init__.py' not found (or not a regular file) error 18-Sep-2019 23:19:10 package init file 'build/lib.linux-x86_64-3.6/casatasks/private/__init__.py' not found (or not a regular file) build 18-Sep-2019 23:19:10 creating build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_fixplanets.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_accum.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_uvmodelfit.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imsubimage.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_importvla.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/JPLephem_reader2.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_sdfit.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_applycal.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imcollapse.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_plotants.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imval.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_feather.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_listhistory.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_listpartition.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_fluxscale.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_tclean.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/vishead_util.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_listfits.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_mstransform.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_asdmsummary.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_importfitsidi.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_clearstat.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_sdbaseline.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_listobs.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_uvsub.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imhead.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_simobserve.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/setjy_helper.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_importgmrt.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_statwt.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_vishead.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_cvel2.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/convertephem.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_plotbandpass.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_importnro.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_split.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_calstat.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/sdbeamutil.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imstat.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_cvel.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_splattotable.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/correct_ant_posns.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_listcal.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/flaghelper.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/userconfig.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_spxfit.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_flagcmd.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_flagdata.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_importatca.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_importmiriad.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/correct_ant_posns_alma.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/cleanhelper.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_flagmanager.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imreframe.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_setjy.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_virtualconcat.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_importasap.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_ft.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/casa_transition.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_plotweather.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_visstat.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_impv.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imrebin.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_slsearch.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_specsmooth.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_listvis.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_hanningsmooth.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_sdgaincal.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_initweights.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_blcal.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_simanalyze.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_importfits.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_partition.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imfit.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_sdsmooth.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_importuvfits.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_gaincal.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_widebandpbcor.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_concat.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_immoments.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_clearcal.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_conjugatevis.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/solar_system_setjy.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_polcal.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_impbcor.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imsmooth.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/mstools.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_rmtables.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_predictcomp.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_listsdm.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/sdutil.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/partitionhelper.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_importasdm.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_simalma.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imregrid.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/ialib.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_sdcal.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_delmod.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_exportuvfits.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_bandpass.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_makemask.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/callibrary.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/imtools.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_exportasdm.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_polfromgain.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_specfit.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/concatephem.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/predictcomp_helper.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_logging.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/correct_ant_posns_evla.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/update_spw.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_exportfits.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_smoothcal.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/simutil.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imtrans.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_fixvis.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_specflux.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_rmfit.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/cvt.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_accor.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imcontsub.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_fringefit.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imdev.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_immath.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_sdfixscan.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_uvcontsub.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_gencal.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_imhistory.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_sdimaging.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/task_rerefant.py -> build/lib/casatasks/private build 18-Sep-2019 23:19:10 creating build/lib/casatasks/private/parallel build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/parallel/parallel_task_helper.py -> build/lib/casatasks/private/parallel build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/parallel/parallel_data_helper.py -> build/lib/casatasks/private/parallel build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/parallel/rflag_post_proc.py -> build/lib/casatasks/private/parallel build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/parallel/__init__.py -> build/lib/casatasks/private/parallel build 18-Sep-2019 23:19:10 creating build/lib/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers/imager_parallel_cube.py -> build/lib/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers/__init__.py -> build/lib/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers/parallel_imager_helper.py -> build/lib/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers/imager_parallel_deconvolver.py -> build/lib/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers/input_parameters.py -> build/lib/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers/imager_parallel_continuum.py -> build/lib/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/private/imagerhelpers/imager_base.py -> build/lib/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 creating build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/rerefant.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/listvis.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/importasdm.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/rmtables.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/blcal.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/accum.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/fringefit.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/importfits.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/specflux.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/fluxscale.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/flagmanager.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/calstat.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/uvsub.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/importfitsidi.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imstat.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/visstat.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/simanalyze.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/listpartition.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/uvmodelfit.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/exportuvfits.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/bandpass.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/flagdata.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/sdbaseline.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/clearcal.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/accor.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/sdcal.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/delmod.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/applycal.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/polfromgain.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/slsearch.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/polcal.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imval.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/tclean.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/splattotable.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/mstransform.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/concat.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/listsdm.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/statwt.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/importvla.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/importgmrt.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/immath.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/exportasdm.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/impbcor.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/widebandpbcor.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imdev.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/rmfit.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/predictcomp.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/initweights.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/virtualconcat.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/plotants.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imreframe.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/spxfit.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imtrans.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/listobs.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imsmooth.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/importasap.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imhead.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/sdimaging.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/flagcmd.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/fixvis.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/partition.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/specsmooth.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/gencal.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/specfit.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/simobserve.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/feather.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imcontsub.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/hanningsmooth.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/smoothcal.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imhistory.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/listfits.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/cvel2.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imrebin.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/clearstat.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/sdsmooth.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/listhistory.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/importmiriad.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/conjugatevis.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/importnro.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imregrid.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imfit.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/uvcontsub.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/importatca.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/plotbandpass.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/simalma.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/gaincal.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/exportfits.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/cvel.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/plotweather.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/sdgaincal.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/importuvfits.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/fixplanets.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/vishead.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imcollapse.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/split.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/imsubimage.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/asdmsummary.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/listcal.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/impv.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/makemask.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/immoments.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/setjy.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/ft.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/sdfixscan.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib.linux-x86_64-3.6/casatasks/__xml__/sdfit.xml -> build/lib/casatasks/__xml__ build 18-Sep-2019 23:19:10 creating build/bdist.linux-x86_64 build 18-Sep-2019 23:19:10 creating build/bdist.linux-x86_64/wheel build 18-Sep-2019 23:19:10 creating build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/setjy.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/rerefant.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/cvel.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imregrid.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/sdimaging.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/polfromgain.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/blcal.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/rmfit.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/predictcomp.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/virtualconcat.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/uvmodelfit.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/spxfit.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/sdfixscan.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/fixplanets.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imreframe.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/importmiriad.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/mstransform.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imrebin.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/specsmooth.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 creating build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_fixplanets.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_accum.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_uvmodelfit.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imsubimage.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_importvla.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/JPLephem_reader2.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_sdfit.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_applycal.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imcollapse.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_plotants.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imval.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_feather.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_listhistory.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_listpartition.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_fluxscale.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_tclean.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/vishead_util.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_listfits.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_mstransform.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_asdmsummary.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_importfitsidi.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_clearstat.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_sdbaseline.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_listobs.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_uvsub.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imhead.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_simobserve.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/setjy_helper.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_importgmrt.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_statwt.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_vishead.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_cvel2.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/convertephem.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_plotbandpass.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_importnro.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_split.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_calstat.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/sdbeamutil.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imstat.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_cvel.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_splattotable.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/correct_ant_posns.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_listcal.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/flaghelper.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/userconfig.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_spxfit.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_flagcmd.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_flagdata.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_importatca.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_importmiriad.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/correct_ant_posns_alma.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/cleanhelper.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_flagmanager.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imreframe.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_setjy.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_virtualconcat.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_importasap.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_ft.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/casa_transition.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_plotweather.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_visstat.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_impv.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imrebin.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_slsearch.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_specsmooth.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_listvis.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_hanningsmooth.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 creating build/bdist.linux-x86_64/wheel/casatasks/private/parallel build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/parallel/parallel_task_helper.py -> build/bdist.linux-x86_64/wheel/casatasks/private/parallel build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/parallel/parallel_data_helper.py -> build/bdist.linux-x86_64/wheel/casatasks/private/parallel build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/parallel/rflag_post_proc.py -> build/bdist.linux-x86_64/wheel/casatasks/private/parallel build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/parallel/__init__.py -> build/bdist.linux-x86_64/wheel/casatasks/private/parallel build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_sdgaincal.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_initweights.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_blcal.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_simanalyze.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_importfits.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_partition.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imfit.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_sdsmooth.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_importuvfits.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_gaincal.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_widebandpbcor.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_concat.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_immoments.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_clearcal.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_conjugatevis.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/solar_system_setjy.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_polcal.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_impbcor.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imsmooth.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/mstools.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_rmtables.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_predictcomp.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_listsdm.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/sdutil.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/partitionhelper.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_importasdm.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_simalma.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imregrid.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/ialib.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_sdcal.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_delmod.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 creating build/bdist.linux-x86_64/wheel/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/imagerhelpers/imager_parallel_cube.py -> build/bdist.linux-x86_64/wheel/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/imagerhelpers/__init__.py -> build/bdist.linux-x86_64/wheel/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/imagerhelpers/parallel_imager_helper.py -> build/bdist.linux-x86_64/wheel/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/imagerhelpers/imager_parallel_deconvolver.py -> build/bdist.linux-x86_64/wheel/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/imagerhelpers/input_parameters.py -> build/bdist.linux-x86_64/wheel/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/imagerhelpers/imager_parallel_continuum.py -> build/bdist.linux-x86_64/wheel/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/imagerhelpers/imager_base.py -> build/bdist.linux-x86_64/wheel/casatasks/private/imagerhelpers build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_exportuvfits.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_bandpass.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_makemask.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/callibrary.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/imtools.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_exportasdm.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_polfromgain.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_specfit.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/concatephem.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/predictcomp_helper.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_logging.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/correct_ant_posns_evla.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/update_spw.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_exportfits.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_smoothcal.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/simutil.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imtrans.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_fixvis.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_specflux.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_rmfit.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/cvt.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_accor.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imcontsub.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_fringefit.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imdev.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_immath.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_sdfixscan.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_uvcontsub.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_gencal.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_imhistory.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_sdimaging.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/private/task_rerefant.py -> build/bdist.linux-x86_64/wheel/casatasks/private build 18-Sep-2019 23:19:10 copying build/lib/casatasks/delmod.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/widebandpbcor.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/visstat.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/hanningsmooth.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/importvla.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/tclean.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/listcal.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/cvel2.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/listpartition.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/exportfits.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/sdsmooth.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/asdmsummary.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/clearcal.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/rmtables.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/clearstat.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/partition.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imtrans.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/flagcmd.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/importfitsidi.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/fixvis.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imval.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/importnro.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/sdcal.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/plotants.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/importasdm.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/smoothcal.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/sdgaincal.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/accum.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__init__.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/listhistory.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/importgmrt.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/gaincal.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/immath.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/bandpass.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/simanalyze.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/specflux.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/plotweather.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/applycal.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/sdbaseline.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/importuvfits.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/listobs.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imstat.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/listsdm.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/immoments.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/importasap.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/uvcontsub.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 creating build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/rerefant.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/listvis.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/importasdm.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/rmtables.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/blcal.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/accum.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/fringefit.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/importfits.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/specflux.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/fluxscale.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/flagmanager.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/calstat.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/uvsub.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/importfitsidi.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imstat.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/visstat.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/simanalyze.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/listpartition.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/uvmodelfit.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/exportuvfits.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/bandpass.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/flagdata.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/sdbaseline.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/clearcal.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/accor.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/sdcal.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/delmod.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/applycal.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/polfromgain.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/slsearch.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/polcal.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imval.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/tclean.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/splattotable.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/mstransform.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/concat.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/listsdm.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/statwt.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/importvla.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/importgmrt.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/immath.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/exportasdm.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/impbcor.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/widebandpbcor.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imdev.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/rmfit.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/predictcomp.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/initweights.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/virtualconcat.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/plotants.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imreframe.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/spxfit.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imtrans.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/listobs.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imsmooth.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/importasap.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imhead.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/sdimaging.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/flagcmd.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/fixvis.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/partition.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/specsmooth.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/gencal.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/specfit.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/simobserve.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/feather.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imcontsub.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/hanningsmooth.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/smoothcal.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imhistory.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/listfits.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/cvel2.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imrebin.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/clearstat.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/sdsmooth.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/listhistory.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/importmiriad.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/conjugatevis.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/importnro.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imregrid.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imfit.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/uvcontsub.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/importatca.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/plotbandpass.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/simalma.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/gaincal.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/exportfits.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/cvel.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/plotweather.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/sdgaincal.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/importuvfits.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/fixplanets.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/vishead.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imcollapse.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/split.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/imsubimage.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/asdmsummary.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/listcal.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/impv.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/makemask.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/immoments.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/setjy.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/ft.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/sdfixscan.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/__xml__/sdfit.xml -> build/bdist.linux-x86_64/wheel/casatasks/__xml__ build 18-Sep-2019 23:19:10 copying build/lib/casatasks/exportasdm.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/fluxscale.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/gencal.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imcollapse.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/config.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/fringefit.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imcontsub.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/vishead.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/calstat.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imdev.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/feather.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/specfit.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/uvsub.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/ft.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/initweights.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/listfits.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imsubimage.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/simalma.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/impv.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/split.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/polcal.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/conjugatevis.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/flagdata.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/slsearch.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imfit.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/flagmanager.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/simobserve.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/makemask.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/exportuvfits.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/sdfit.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/importatca.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/splattotable.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/accor.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/impbcor.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/importfits.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/listvis.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imsmooth.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imhistory.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/concat.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/plotbandpass.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/statwt.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 copying build/lib/casatasks/imhead.py -> build/bdist.linux-x86_64/wheel/casatasks build 18-Sep-2019 23:19:10 running install_egg_info build 18-Sep-2019 23:19:10 running egg_info build 18-Sep-2019 23:19:10 creating casatasks.egg-info build 18-Sep-2019 23:19:10 writing casatasks.egg-info/PKG-INFO build 18-Sep-2019 23:19:10 writing dependency_links to casatasks.egg-info/dependency_links.txt build 18-Sep-2019 23:19:10 writing requirements to casatasks.egg-info/requires.txt build 18-Sep-2019 23:19:10 writing top-level names to casatasks.egg-info/top_level.txt build 18-Sep-2019 23:19:10 writing manifest file 'casatasks.egg-info/SOURCES.txt' build 18-Sep-2019 23:19:10 reading manifest file 'casatasks.egg-info/SOURCES.txt' build 18-Sep-2019 23:19:10 writing manifest file 'casatasks.egg-info/SOURCES.txt' build 18-Sep-2019 23:19:10 Copying casatasks.egg-info to build/bdist.linux-x86_64/wheel/casatasks-2019.151-py3.6.egg-info build 18-Sep-2019 23:19:10 running install_scripts build 18-Sep-2019 23:19:10 creating build/bdist.linux-x86_64/wheel/casatasks-2019.151.dist-info/WHEEL build 18-Sep-2019 23:19:10 creating 'dist/casatasks-2019.151-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it build 18-Sep-2019 23:19:10 adding 'casatasks/__init__.py' build 18-Sep-2019 23:19:10 adding 'casatasks/accor.py' build 18-Sep-2019 23:19:10 adding 'casatasks/accum.py' build 18-Sep-2019 23:19:10 adding 'casatasks/applycal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/asdmsummary.py' build 18-Sep-2019 23:19:10 adding 'casatasks/bandpass.py' build 18-Sep-2019 23:19:10 adding 'casatasks/blcal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/calstat.py' build 18-Sep-2019 23:19:10 adding 'casatasks/clearcal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/clearstat.py' build 18-Sep-2019 23:19:10 adding 'casatasks/concat.py' build 18-Sep-2019 23:19:10 adding 'casatasks/config.py' build 18-Sep-2019 23:19:10 adding 'casatasks/conjugatevis.py' build 18-Sep-2019 23:19:10 adding 'casatasks/cvel.py' build 18-Sep-2019 23:19:10 adding 'casatasks/cvel2.py' build 18-Sep-2019 23:19:10 adding 'casatasks/delmod.py' build 18-Sep-2019 23:19:10 adding 'casatasks/exportasdm.py' build 18-Sep-2019 23:19:10 adding 'casatasks/exportfits.py' build 18-Sep-2019 23:19:10 adding 'casatasks/exportuvfits.py' build 18-Sep-2019 23:19:10 adding 'casatasks/feather.py' build 18-Sep-2019 23:19:10 adding 'casatasks/fixplanets.py' build 18-Sep-2019 23:19:10 adding 'casatasks/fixvis.py' build 18-Sep-2019 23:19:10 adding 'casatasks/flagcmd.py' build 18-Sep-2019 23:19:10 adding 'casatasks/flagdata.py' build 18-Sep-2019 23:19:10 adding 'casatasks/flagmanager.py' build 18-Sep-2019 23:19:10 adding 'casatasks/fluxscale.py' build 18-Sep-2019 23:19:10 adding 'casatasks/fringefit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/ft.py' build 18-Sep-2019 23:19:10 adding 'casatasks/gaincal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/gencal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/hanningsmooth.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imcollapse.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imcontsub.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imdev.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imfit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imhead.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imhistory.py' build 18-Sep-2019 23:19:10 adding 'casatasks/immath.py' build 18-Sep-2019 23:19:10 adding 'casatasks/immoments.py' build 18-Sep-2019 23:19:10 adding 'casatasks/impbcor.py' build 18-Sep-2019 23:19:10 adding 'casatasks/importasap.py' build 18-Sep-2019 23:19:10 adding 'casatasks/importasdm.py' build 18-Sep-2019 23:19:10 adding 'casatasks/importatca.py' build 18-Sep-2019 23:19:10 adding 'casatasks/importfits.py' build 18-Sep-2019 23:19:10 adding 'casatasks/importfitsidi.py' build 18-Sep-2019 23:19:10 adding 'casatasks/importgmrt.py' build 18-Sep-2019 23:19:10 adding 'casatasks/importmiriad.py' build 18-Sep-2019 23:19:10 adding 'casatasks/importnro.py' build 18-Sep-2019 23:19:10 adding 'casatasks/importuvfits.py' build 18-Sep-2019 23:19:10 adding 'casatasks/importvla.py' build 18-Sep-2019 23:19:10 adding 'casatasks/impv.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imrebin.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imreframe.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imregrid.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imsmooth.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imstat.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imsubimage.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imtrans.py' build 18-Sep-2019 23:19:10 adding 'casatasks/imval.py' build 18-Sep-2019 23:19:10 adding 'casatasks/initweights.py' build 18-Sep-2019 23:19:10 adding 'casatasks/listcal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/listfits.py' build 18-Sep-2019 23:19:10 adding 'casatasks/listhistory.py' build 18-Sep-2019 23:19:10 adding 'casatasks/listobs.py' build 18-Sep-2019 23:19:10 adding 'casatasks/listpartition.py' build 18-Sep-2019 23:19:10 adding 'casatasks/listsdm.py' build 18-Sep-2019 23:19:10 adding 'casatasks/listvis.py' build 18-Sep-2019 23:19:10 adding 'casatasks/makemask.py' build 18-Sep-2019 23:19:10 adding 'casatasks/mstransform.py' build 18-Sep-2019 23:19:10 adding 'casatasks/partition.py' build 18-Sep-2019 23:19:10 adding 'casatasks/plotants.py' build 18-Sep-2019 23:19:10 adding 'casatasks/plotbandpass.py' build 18-Sep-2019 23:19:10 adding 'casatasks/plotweather.py' build 18-Sep-2019 23:19:10 adding 'casatasks/polcal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/polfromgain.py' build 18-Sep-2019 23:19:10 adding 'casatasks/predictcomp.py' build 18-Sep-2019 23:19:10 adding 'casatasks/rerefant.py' build 18-Sep-2019 23:19:10 adding 'casatasks/rmfit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/rmtables.py' build 18-Sep-2019 23:19:10 adding 'casatasks/sdbaseline.py' build 18-Sep-2019 23:19:10 adding 'casatasks/sdcal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/sdfit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/sdfixscan.py' build 18-Sep-2019 23:19:10 adding 'casatasks/sdgaincal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/sdimaging.py' build 18-Sep-2019 23:19:10 adding 'casatasks/sdsmooth.py' build 18-Sep-2019 23:19:10 adding 'casatasks/setjy.py' build 18-Sep-2019 23:19:10 adding 'casatasks/simalma.py' build 18-Sep-2019 23:19:10 adding 'casatasks/simanalyze.py' build 18-Sep-2019 23:19:10 adding 'casatasks/simobserve.py' build 18-Sep-2019 23:19:10 adding 'casatasks/slsearch.py' build 18-Sep-2019 23:19:10 adding 'casatasks/smoothcal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/specfit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/specflux.py' build 18-Sep-2019 23:19:10 adding 'casatasks/specsmooth.py' build 18-Sep-2019 23:19:10 adding 'casatasks/splattotable.py' build 18-Sep-2019 23:19:10 adding 'casatasks/split.py' build 18-Sep-2019 23:19:10 adding 'casatasks/spxfit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/statwt.py' build 18-Sep-2019 23:19:10 adding 'casatasks/tclean.py' build 18-Sep-2019 23:19:10 adding 'casatasks/uvcontsub.py' build 18-Sep-2019 23:19:10 adding 'casatasks/uvmodelfit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/uvsub.py' build 18-Sep-2019 23:19:10 adding 'casatasks/virtualconcat.py' build 18-Sep-2019 23:19:10 adding 'casatasks/vishead.py' build 18-Sep-2019 23:19:10 adding 'casatasks/visstat.py' build 18-Sep-2019 23:19:10 adding 'casatasks/widebandpbcor.py' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/accor.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/accum.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/applycal.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/asdmsummary.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/bandpass.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/blcal.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/calstat.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/clearcal.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/clearstat.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/concat.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/conjugatevis.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/cvel.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/cvel2.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/delmod.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/exportasdm.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/exportfits.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/exportuvfits.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/feather.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/fixplanets.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/fixvis.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/flagcmd.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/flagdata.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/flagmanager.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/fluxscale.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/fringefit.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/ft.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/gaincal.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/gencal.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/hanningsmooth.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imcollapse.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imcontsub.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imdev.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imfit.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imhead.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imhistory.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/immath.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/immoments.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/impbcor.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/importasap.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/importasdm.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/importatca.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/importfits.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/importfitsidi.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/importgmrt.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/importmiriad.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/importnro.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/importuvfits.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/importvla.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/impv.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imrebin.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imreframe.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imregrid.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imsmooth.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imstat.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imsubimage.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imtrans.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/imval.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/initweights.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/listcal.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/listfits.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/listhistory.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/listobs.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/listpartition.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/listsdm.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/listvis.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/makemask.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/mstransform.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/partition.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/plotants.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/plotbandpass.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/plotweather.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/polcal.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/polfromgain.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/predictcomp.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/rerefant.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/rmfit.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/rmtables.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/sdbaseline.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/sdcal.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/sdfit.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/sdfixscan.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/sdgaincal.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/sdimaging.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/sdsmooth.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/setjy.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/simalma.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/simanalyze.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/simobserve.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/slsearch.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/smoothcal.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/specfit.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/specflux.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/specsmooth.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/splattotable.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/split.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/spxfit.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/statwt.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/tclean.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/uvcontsub.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/uvmodelfit.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/uvsub.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/virtualconcat.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/vishead.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/visstat.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/__xml__/widebandpbcor.xml' build 18-Sep-2019 23:19:10 adding 'casatasks/private/JPLephem_reader2.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/callibrary.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/casa_transition.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/cleanhelper.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/concatephem.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/convertephem.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/correct_ant_posns.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/correct_ant_posns_alma.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/correct_ant_posns_evla.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/cvt.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/flaghelper.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/ialib.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/imtools.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/mstools.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/partitionhelper.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/predictcomp_helper.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/sdbeamutil.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/sdutil.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/setjy_helper.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/simutil.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/solar_system_setjy.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_accor.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_accum.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_applycal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_asdmsummary.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_bandpass.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_blcal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_calstat.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_clearcal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_clearstat.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_concat.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_conjugatevis.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_cvel.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_cvel2.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_delmod.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_exportasdm.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_exportfits.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_exportuvfits.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_feather.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_fixplanets.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_fixvis.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_flagcmd.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_flagdata.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_flagmanager.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_fluxscale.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_fringefit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_ft.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_gaincal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_gencal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_hanningsmooth.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imcollapse.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imcontsub.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imdev.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imfit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imhead.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imhistory.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_immath.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_immoments.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_impbcor.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_importasap.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_importasdm.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_importatca.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_importfits.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_importfitsidi.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_importgmrt.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_importmiriad.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_importnro.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_importuvfits.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_importvla.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_impv.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imrebin.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imreframe.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imregrid.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imsmooth.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imstat.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imsubimage.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imtrans.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_imval.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_initweights.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_listcal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_listfits.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_listhistory.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_listobs.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_listpartition.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_listsdm.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_listvis.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_logging.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_makemask.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_mstransform.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_partition.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_plotants.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_plotbandpass.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_plotweather.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_polcal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_polfromgain.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_predictcomp.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_rerefant.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_rmfit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_rmtables.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_sdbaseline.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_sdcal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_sdfit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_sdfixscan.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_sdgaincal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_sdimaging.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_sdsmooth.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_setjy.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_simalma.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_simanalyze.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_simobserve.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_slsearch.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_smoothcal.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_specfit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_specflux.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_specsmooth.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_splattotable.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_split.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_spxfit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_statwt.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_tclean.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_uvcontsub.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_uvmodelfit.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_uvsub.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_virtualconcat.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_vishead.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_visstat.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/task_widebandpbcor.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/update_spw.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/userconfig.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/vishead_util.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/imagerhelpers/__init__.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/imagerhelpers/imager_base.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/imagerhelpers/imager_parallel_continuum.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/imagerhelpers/imager_parallel_cube.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/imagerhelpers/imager_parallel_deconvolver.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/imagerhelpers/input_parameters.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/imagerhelpers/parallel_imager_helper.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/parallel/__init__.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/parallel/parallel_data_helper.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/parallel/parallel_task_helper.py' build 18-Sep-2019 23:19:10 adding 'casatasks/private/parallel/rflag_post_proc.py' build 18-Sep-2019 23:19:10 adding 'casatasks-2019.151.dist-info/METADATA' build 18-Sep-2019 23:19:10 adding 'casatasks-2019.151.dist-info/WHEEL' build 18-Sep-2019 23:19:10 adding 'casatasks-2019.151.dist-info/top_level.txt' build 18-Sep-2019 23:19:10 adding 'casatasks-2019.151.dist-info/RECORD' build 18-Sep-2019 23:19:10 removing build/bdist.linux-x86_64/wheel build 18-Sep-2019 23:19:11 Cloning into 'casatasks'... build 18-Sep-2019 23:19:12 Cloning into 'casa-build-utils'... build 18-Sep-2019 23:19:12 diff --git a/casa-source b/casa-source build 18-Sep-2019 23:19:12 index 625c27e..b754f51 160000 build 18-Sep-2019 23:19:12 --- a/casa-source build 18-Sep-2019 23:19:12 +++ b/casa-source build 18-Sep-2019 23:19:12 @@ -1 +1 @@ build 18-Sep-2019 23:19:12 -Subproject commit 625c27ecd78f40c8571b8ea2e55b2507725bad7d build 18-Sep-2019 23:19:12 +Subproject commit b754f51ceb53a1d87dd042f3e2865327424ab083 build 18-Sep-2019 23:19:12 diff --git a/setup.py b/setup.py build 18-Sep-2019 23:19:12 index 439820e..65c538f 100755 build 18-Sep-2019 23:19:12 --- a/setup.py build 18-Sep-2019 23:19:12 +++ b/setup.py build 18-Sep-2019 23:19:12 @@ -85,6 +85,14 @@ import re build 18-Sep-2019 23:19:12 from os import listdir build 18-Sep-2019 23:19:12 from os.path import isfile, join, islink build 18-Sep-2019 23:19:12 from itertools import chain build 18-Sep-2019 23:19:12 +import argparse build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +parser=argparse.ArgumentParser() build 18-Sep-2019 23:19:12 +parser.add_argument('--version', help='version') build 18-Sep-2019 23:19:12 +parser.add_argument('bdist_wheel', help='bdist_wheel') build 18-Sep-2019 23:19:12 +args=parser.parse_args() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +print (args.version) build 18-Sep-2019 23:19:12 build 18-Sep-2019 23:19:12 module_name = 'casatasks' build 18-Sep-2019 23:19:12 build 18-Sep-2019 23:19:12 @@ -119,7 +127,12 @@ def compute_version( ): build 18-Sep-2019 23:19:12 sys.exit("couldn't determine version number") build 18-Sep-2019 23:19:12 build 18-Sep-2019 23:19:12 master_tags = [t for t in out.split('\n') if '-mas-' in t] build 18-Sep-2019 23:19:12 - return (year,len(master_tags)) build 18-Sep-2019 23:19:12 + if (args.version != None ): build 18-Sep-2019 23:19:12 + print (args.version.split(".")) build 18-Sep-2019 23:19:12 + (major, minor) = args.version.split(".") build 18-Sep-2019 23:19:12 + return(int(major), int(minor)) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + return (year,len(master_tags)) build 18-Sep-2019 23:19:12 build 18-Sep-2019 23:19:12 build 18-Sep-2019 23:19:12 (casatasks_major,casatasks_minor) = compute_version( ) build 18-Sep-2019 23:19:12 @@ -254,6 +267,8 @@ private_scripts = [ 'src/scripts/userconfig.py', build 18-Sep-2019 23:19:12 'src/tasks/task_importmiriad.py', build 18-Sep-2019 23:19:12 'src/tasks/task_plotweather.py', build 18-Sep-2019 23:19:12 'src/tasks/task_plotants.py', build 18-Sep-2019 23:19:12 + 'src/tasks/task_fringefit.py', build 18-Sep-2019 23:19:12 + 'src/tasks/task_plotbandpass.py', build 18-Sep-2019 23:19:12 'src/scripts/predictcomp_helper.py', build 18-Sep-2019 23:19:12 'src/scripts/task_logging.py', build 18-Sep-2019 23:19:12 ] build 18-Sep-2019 23:19:12 @@ -363,6 +378,8 @@ xml_xlate = { 'casa-source/gcwrap/tasks/imhead.xml': 'xml/imhead.xml', build 18-Sep-2019 23:19:12 'casa-source/gcwrap/tasks/importmiriad.xml': 'xml/importmiriad.xml', build 18-Sep-2019 23:19:12 'casa-source/gcwrap/tasks/plotweather.xml': 'xml/plotweather.xml', build 18-Sep-2019 23:19:12 'casa-source/gcwrap/tasks/plotants.xml': 'xml/plotants.xml', build 18-Sep-2019 23:19:12 + 'casa-source/gcwrap/tasks/fringefit.xml': 'xml/fringefit.xml', build 18-Sep-2019 23:19:12 + 'casa-source/gcwrap/tasks/plotbandpass.xml': 'xml/plotbandpass.xml', build 18-Sep-2019 23:19:12 } build 18-Sep-2019 23:19:12 build 18-Sep-2019 23:19:12 xml_files = [ 'xml/imhead.xml', build 18-Sep-2019 23:19:12 @@ -468,6 +485,8 @@ xml_files = [ 'xml/imhead.xml', build 18-Sep-2019 23:19:12 'xml/importmiriad.xml', build 18-Sep-2019 23:19:12 'xml/plotweather.xml', build 18-Sep-2019 23:19:12 'xml/plotants.xml', build 18-Sep-2019 23:19:12 + 'xml/fringefit.xml', build 18-Sep-2019 23:19:12 + 'xml/plotbandpass.xml', build 18-Sep-2019 23:19:12 ] build 18-Sep-2019 23:19:12 build 18-Sep-2019 23:19:12 if pyversion < 3: build 18-Sep-2019 23:19:12 @@ -632,9 +651,9 @@ class BuildCasa(build): build 18-Sep-2019 23:19:12 print("generating task python files...") build 18-Sep-2019 23:19:12 proc = Popen( [tools_config['build.compiler.xml-casa'], "output-task=%s" % moduledir, "-task"] + xml_files, build 18-Sep-2019 23:19:12 stdout=subprocess.PIPE ) build 18-Sep-2019 23:19:12 - build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 (output, error) = pipe_decode(proc.communicate( )) build 18-Sep-2019 23:19:12 - build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 exit_code = proc.wait( ) build 18-Sep-2019 23:19:12 build 18-Sep-2019 23:19:12 if exit_code != 0: build 18-Sep-2019 23:19:12 @@ -791,7 +810,32 @@ class TestCasa(Command): build 18-Sep-2019 23:19:12 cmd_setup = { 'build': BuildCasa, 'test': TestCasa } build 18-Sep-2019 23:19:12 try: build 18-Sep-2019 23:19:12 from wheel.bdist_wheel import bdist_wheel build 18-Sep-2019 23:19:12 - cmd_setup['bdist_wheel'] = bdist_wheel build 18-Sep-2019 23:19:12 + class casa_binary_wheel(bdist_wheel): build 18-Sep-2019 23:19:12 + user_options = bdist_wheel.user_options + [ build 18-Sep-2019 23:19:12 + # The format is (long option, short option, description). build 18-Sep-2019 23:19:12 + ('debug', None, 'build a debugging version'), build 18-Sep-2019 23:19:12 + ('version=', None, 'Silence distutils when passing version for bdist_wheel from the command line'), build 18-Sep-2019 23:19:12 + ] build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + def initialize_options(self): build 18-Sep-2019 23:19:12 + self.version = None build 18-Sep-2019 23:19:12 + bdist_wheel.initialize_options(self) build 18-Sep-2019 23:19:12 + if '--debug' in sys.argv: build 18-Sep-2019 23:19:12 + global _debug_build_ build 18-Sep-2019 23:19:12 + _debug_build_ = True build 18-Sep-2019 23:19:12 + self.debug = 1 build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + self.debug = 0 build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + def run(self): build 18-Sep-2019 23:19:12 + global doing_wheel_build build 18-Sep-2019 23:19:12 + doing_wheel_build = True build 18-Sep-2019 23:19:12 + bdist_wheel.run(self) build 18-Sep-2019 23:19:12 + doing_wheel_build = False build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + wheel_build = casa_binary_wheel build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + cmd_setup['bdist_wheel'] = casa_binary_wheel build 18-Sep-2019 23:19:12 except ImportError: build 18-Sep-2019 23:19:12 pass # custom command not needed if wheel is not installed build 18-Sep-2019 23:19:12 build 18-Sep-2019 23:19:12 @@ -806,7 +850,7 @@ setup( name=module_name,version=casatasks_version, build 18-Sep-2019 23:19:12 packages=[ module_name, build 18-Sep-2019 23:19:12 "%s.__xml__" % module_name, build 18-Sep-2019 23:19:12 "%s.private" % module_name, build 18-Sep-2019 23:19:12 - "%s.private.parallel" % module_name, build 18-Sep-2019 23:19:12 + "%s.private.parallel" % module_name, build 18-Sep-2019 23:19:12 "%s.private.imagerhelpers" % module_name ], build 18-Sep-2019 23:19:12 classifiers=[ 'Programming Language :: Python :: %s' % pyversion ], build 18-Sep-2019 23:19:12 description="the CASA tasks", build 18-Sep-2019 23:19:12 diff --git a/src/tasks/task_fringefit.py b/src/tasks/task_fringefit.py build 18-Sep-2019 23:19:12 new file mode 100644 build 18-Sep-2019 23:19:12 index 0000000..8b0d8b4 build 18-Sep-2019 23:19:12 --- /dev/null build 18-Sep-2019 23:19:12 +++ b/src/tasks/task_fringefit.py build 18-Sep-2019 23:19:12 @@ -0,0 +1,147 @@ build 18-Sep-2019 23:19:12 +from __future__ import absolute_import build 18-Sep-2019 23:19:12 +from __future__ import print_function build 18-Sep-2019 23:19:12 +import os build 18-Sep-2019 23:19:12 +import numpy as np build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +from casatasks.private.casa_transition import is_CASA6 build 18-Sep-2019 23:19:12 +if is_CASA6: build 18-Sep-2019 23:19:12 + from .callibrary import * build 18-Sep-2019 23:19:12 + from casatools import calibrater build 18-Sep-2019 23:19:12 + from casatasks import casalog build 18-Sep-2019 23:19:12 +else: build 18-Sep-2019 23:19:12 + from callibrary import * build 18-Sep-2019 23:19:12 + from taskinit import * build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + calibrater = cbtool build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def fringefit(vis=None,caltable=None, build 18-Sep-2019 23:19:12 + field=None,spw=None,intent=None, build 18-Sep-2019 23:19:12 + selectdata=None,timerange=None,antenna=None,scan=None, build 18-Sep-2019 23:19:12 + observation=None, msselect=None, build 18-Sep-2019 23:19:12 + solint=None,combine=None,refant=None, build 18-Sep-2019 23:19:12 + minsnr=None,zerorates=None,globalsolve=None,niter=None, build 18-Sep-2019 23:19:12 + delaywindow=None,ratewindow=None,append=None, build 18-Sep-2019 23:19:12 + docallib=None,callib=None,gaintable=None,gainfield=None,interp=None,spwmap=None, build 18-Sep-2019 23:19:12 + parang=None): build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + #Python script build 18-Sep-2019 23:19:12 + casalog.origin('fringefit') build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + mycb = calibrater() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if ((type(vis)==str) & (os.path.exists(vis))): build 18-Sep-2019 23:19:12 + mycb.open(filename=vis,compress=False,addcorr=False,addmodel=False) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + raise Exception('Visibility data set not found - please verify the name') build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Do data selection according to selectdata build 18-Sep-2019 23:19:12 + if (selectdata): build 18-Sep-2019 23:19:12 + # pass all data selection parameters in as specified build 18-Sep-2019 23:19:12 + mycb.selectvis(time=timerange,spw=spw, scan=scan, field=field, build 18-Sep-2019 23:19:12 + intent=intent, observation=str(observation), build 18-Sep-2019 23:19:12 + baseline=antenna,chanmode='none', build 18-Sep-2019 23:19:12 + msselect=msselect) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + # selectdata=F, so time,scan,baseline,msselect='' build 18-Sep-2019 23:19:12 + # using spw and field specifications only build 18-Sep-2019 23:19:12 + mycb.selectvis(time='',spw=spw,scan='',field=field,intent=intent, build 18-Sep-2019 23:19:12 + observation='', baseline='', build 18-Sep-2019 23:19:12 + chanmode='none', msselect='') build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Arrange applies.... build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if docallib: build 18-Sep-2019 23:19:12 + # by cal library from file build 18-Sep-2019 23:19:12 + mycallib=callibrary() build 18-Sep-2019 23:19:12 + mycallib.read(callib) build 18-Sep-2019 23:19:12 + mycb.setcallib(mycallib.cld) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # by traditional parameters build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + ngaintab = 0; build 18-Sep-2019 23:19:12 + if (gaintable!=['']): build 18-Sep-2019 23:19:12 + ngaintab=len(gaintable) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + ngainfld = len(gainfield) build 18-Sep-2019 23:19:12 + nspwmap = len(spwmap) build 18-Sep-2019 23:19:12 + ninterp = len(interp) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # handle list of list issues with spwmap build 18-Sep-2019 23:19:12 + if (nspwmap>0): build 18-Sep-2019 23:19:12 + if (type(spwmap[0])!=list): build 18-Sep-2019 23:19:12 + # first element not a list, only one spwmap specified build 18-Sep-2019 23:19:12 + # make it a list of list build 18-Sep-2019 23:19:12 + spwmap=[spwmap]; build 18-Sep-2019 23:19:12 + nspwmap=1; build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + for igt in range(ngaintab): build 18-Sep-2019 23:19:12 + if (gaintable[igt]!=''): build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # field selection is null unless specified build 18-Sep-2019 23:19:12 + thisgainfield='' build 18-Sep-2019 23:19:12 + if (igt=0): build 18-Sep-2019 23:19:12 + directories = figfile.split('/') build 18-Sep-2019 23:19:12 + directory = '' build 18-Sep-2019 23:19:12 + for d in range(len(directories)-1): build 18-Sep-2019 23:19:12 + directory += directories[d] + '/' build 18-Sep-2019 23:19:12 + if (os.path.exists(directory)==False): build 18-Sep-2019 23:19:12 + casalogPost(debug,"Making directory = %s" % (directory)) build 18-Sep-2019 23:19:12 + os.system("mkdir -p %s" % directory) build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("makeplot(%d): pagectr=%d, len(pages)=%d, len(spwsToPlot)=%d, pages=" % (locationCalledFrom, build 18-Sep-2019 23:19:12 + pagectr, len(pages),len(spwsToPlot)), pages) build 18-Sep-2019 23:19:12 + if (pages[pagectr][PAGE_SPW] >= len(spwsToPlot)): build 18-Sep-2019 23:19:12 + # necessary for test86: overlay='spw' of spectral scan dataset. to avoid indexing beyond the build 18-Sep-2019 23:19:12 + # end of the array in the the case that the final frame is of a baseband with n spw, and build 18-Sep-2019 23:19:12 + # earlier frames had >n spws 2014-04-08 build 18-Sep-2019 23:19:12 + ispw = spwsToPlot[-1] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + # CAS-8285: Added 'if' to be sure to use ispw passed in for single-panel plots, but build 18-Sep-2019 23:19:12 + # use the original behavior for multi-panel plots simply to preserve the pngfile build 18-Sep-2019 23:19:12 + # naming scheme (i.e. including the spw name of lower right panel) to match old build 18-Sep-2019 23:19:12 + # regressions. Should probably remove this whole 'else' block someday, if I don't build 18-Sep-2019 23:19:12 + # mind if future multi-panel filenames contain spw name of upper left panel. build 18-Sep-2019 23:19:12 + if (subplot != 11 or overlayBasebands): # Add only this line for CAS-8285. build 18-Sep-2019 23:19:12 + ispw = spwsToPlot[pages[pagectr][PAGE_SPW]] build 18-Sep-2019 23:19:12 + t = pages[pagectr][PAGE_TIME] # + 1 build 18-Sep-2019 23:19:12 + if (subplot == 11): build 18-Sep-2019 23:19:12 + antstring, Antstring = buildAntString(xant, msFound, msAnt) # CAS-8285 build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + antstring, Antstring = buildAntString(antennasToPlot[pages[pagectr][PAGE_ANT]], msFound, msAnt) build 18-Sep-2019 23:19:12 + figfile = figfile.split('.png')[0] build 18-Sep-2019 23:19:12 + if (figfileSequential): build 18-Sep-2019 23:19:12 + plotfilename = figfile + '.%03d' % (figfileNumber) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (msFound): build 18-Sep-2019 23:19:12 + if (overlayAntennas and overlayTimes): build 18-Sep-2019 23:19:12 + plotfilename = figfile+'.spw%02d'%(ispw) build 18-Sep-2019 23:19:12 + elif (overlayAntennas): build 18-Sep-2019 23:19:12 + plotfilename = figfile+'.spw%02d'%(ispw)+'.t%02d'%(t) build 18-Sep-2019 23:19:12 + elif (overlayTimes): build 18-Sep-2019 23:19:12 + plotfilename = figfile+'.'+antstring+'.spw%02d'%(ispw) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + plotfilename = figfile+'.'+antstring+'.spw%02d'%(ispw)+'.t%02d'%(t) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (overlayAntennas and overlayTimes): build 18-Sep-2019 23:19:12 + plotfilename = figfile+'.spw%02d'%(ispw) build 18-Sep-2019 23:19:12 + elif (overlayAntennas): build 18-Sep-2019 23:19:12 + plotfilename = figfile+'.spw%02d'%(ispw)+'.t%02d'%(t) build 18-Sep-2019 23:19:12 + elif (overlayTimes): build 18-Sep-2019 23:19:12 + plotfilename = figfile+'.ant'+antstring+'.spw%02d'%(ispw) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + plotfilename = figfile+'.ant'+antstring+'.spw%02d'%(ispw)+'.t%02d'%(t) build 18-Sep-2019 23:19:12 + if (int(resample) > 1): build 18-Sep-2019 23:19:12 + plotfilename += '.resample%d.png' % (int(resample)) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + plotfilename += '.png' build 18-Sep-2019 23:19:12 + if (interactive == False or True): build 18-Sep-2019 23:19:12 + casalogPost(debug,"Building %s" % (plotfilename)) build 18-Sep-2019 23:19:12 +# print("Building %s" % (plotfilename)) build 18-Sep-2019 23:19:12 + pb.savefig(plotfilename, format='png', dpi=density) build 18-Sep-2019 23:19:12 + return(plotfilename) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def utdatestring(mjdsec): build 18-Sep-2019 23:19:12 + (mjd, dateTimeString) = mjdSecondsToMJDandUT(mjdsec) build 18-Sep-2019 23:19:12 + tokens = dateTimeString.split() build 18-Sep-2019 23:19:12 + return(tokens[0]) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def mjdsecArrayToUTString(timerangeListTimes): build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + accepts [4866334935, 4866335281] etc. build 18-Sep-2019 23:19:12 + returns '08:04:10, 09:03:00' etc. build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + timerangeListTimesString = '' build 18-Sep-2019 23:19:12 + for t in timerangeListTimes: build 18-Sep-2019 23:19:12 + timerangeListTimesString += utstring(t,3) + ' ' build 18-Sep-2019 23:19:12 + return(timerangeListTimesString) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def utstring(mjdsec, xframeStart=110): build 18-Sep-2019 23:19:12 + (mjd, dateTimeString) = mjdSecondsToMJDandUT(mjdsec) build 18-Sep-2019 23:19:12 + tokens = dateTimeString.split() build 18-Sep-2019 23:19:12 + hoursMinutes = tokens[1][0:len(tokens[1])-3] build 18-Sep-2019 23:19:12 + hoursMinutesSeconds = tokens[1][0:len(tokens[1])] build 18-Sep-2019 23:19:12 + if (xframeStart == 110): # 2011-01-01 UT 00:00 build 18-Sep-2019 23:19:12 + return(tokens[0]+' '+tokens[2]+' '+hoursMinutes) build 18-Sep-2019 23:19:12 + elif (xframeStart == 3): build 18-Sep-2019 23:19:12 + return(hoursMinutesSeconds) build 18-Sep-2019 23:19:12 + else: # 00:00 build 18-Sep-2019 23:19:12 + return(hoursMinutes) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def openBpolyFile(caltable, debug): build 18-Sep-2019 23:19:12 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:12 + mytb.open(caltable) build 18-Sep-2019 23:19:12 + desc = mytb.getdesc() build 18-Sep-2019 23:19:12 + if ('POLY_MODE' in desc): build 18-Sep-2019 23:19:12 + polyMode = mytb.getcol('POLY_MODE') build 18-Sep-2019 23:19:12 + casalogPost(debug,"This is a BPOLY solution = %s" % (polyMode[0])) build 18-Sep-2019 23:19:12 + polyType = mytb.getcol('POLY_TYPE') build 18-Sep-2019 23:19:12 + scaleFactor = mytb.getcol('SCALE_FACTOR') build 18-Sep-2019 23:19:12 + antenna1 = mytb.getcol('ANTENNA1') build 18-Sep-2019 23:19:12 + times = mytb.getcol('TIME') build 18-Sep-2019 23:19:12 + cal_desc_id = mytb.getcol('CAL_DESC_ID') build 18-Sep-2019 23:19:12 + nRows = len(polyType) build 18-Sep-2019 23:19:12 + for pType in polyType: build 18-Sep-2019 23:19:12 + if (pType != 'CHEBYSHEV'): build 18-Sep-2019 23:19:12 + casalogPost(debug,"I do not recognized polynomial type = %s" % (pType)) build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + # Here we assume that all spws have been solved with the same mode build 18-Sep-2019 23:19:12 + uniqueTimesBP = np.unique(mytb.getcol('TIME')) build 18-Sep-2019 23:19:12 + nUniqueTimesBP = len(uniqueTimesBP) build 18-Sep-2019 23:19:12 + mystring = "There are %d unique times in the BPOLY solution: " % (nUniqueTimesBP) build 18-Sep-2019 23:19:12 + for u in uniqueTimesBP: build 18-Sep-2019 23:19:12 + mystring += '%.3f, ' % (u) build 18-Sep-2019 23:19:12 + casalogPost(debug,mystring) build 18-Sep-2019 23:19:12 + if (nUniqueTimesBP == 2): build 18-Sep-2019 23:19:12 + casalogPost(debug,"differing by %g seconds" % (uniqueTimesBP[1]-uniqueTimesBP[0])) build 18-Sep-2019 23:19:12 + nPolyAmp = mytb.getcol('N_POLY_AMP') build 18-Sep-2019 23:19:12 + nPolyPhase = mytb.getcol('N_POLY_PHASE') build 18-Sep-2019 23:19:12 + frequencyLimits = mytb.getcol('VALID_DOMAIN') build 18-Sep-2019 23:19:12 + increments = 0.001*(frequencyLimits[1,:]-frequencyLimits[0,:]) build 18-Sep-2019 23:19:12 + frequenciesGHz = [] build 18-Sep-2019 23:19:12 + for i in range(len(increments)): build 18-Sep-2019 23:19:12 + freqs = (1e-9)*np.arange(frequencyLimits[0,i],frequencyLimits[1,i],increments[i]) build 18-Sep-2019 23:19:12 + frequenciesGHz.append(freqs) build 18-Sep-2019 23:19:12 + polynomialAmplitude = [] build 18-Sep-2019 23:19:12 + polynomialPhase = [] build 18-Sep-2019 23:19:12 + for i in range(len(polyMode)): build 18-Sep-2019 23:19:12 + polynomialAmplitude.append([1]) build 18-Sep-2019 23:19:12 + polynomialPhase.append([0]) build 18-Sep-2019 23:19:12 + if (polyMode[i] == 'A&P' or polyMode[i] == 'A'): build 18-Sep-2019 23:19:12 + polynomialAmplitude[i] = mytb.getcell('POLY_COEFF_AMP',i)[0][0][0] build 18-Sep-2019 23:19:12 + if (polyMode[i] == 'A&P' or polyMode[i] == 'P'): build 18-Sep-2019 23:19:12 + polynomialPhase[i] = mytb.getcell('POLY_COEFF_PHASE',i)[0][0][0] build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + mytb.open(caltable+'/CAL_DESC') build 18-Sep-2019 23:19:12 + nSpws = len(mytb.getcol('NUM_SPW')) build 18-Sep-2019 23:19:12 + spws = mytb.getcol('SPECTRAL_WINDOW_ID') build 18-Sep-2019 23:19:12 + spwBP = [] build 18-Sep-2019 23:19:12 + for c in cal_desc_id: build 18-Sep-2019 23:19:12 + spwBP.append(spws[0][c]) build 18-Sep-2019 23:19:12 + mytb.done() build 18-Sep-2019 23:19:12 + return([polyMode, polyType, nPolyAmp, nPolyPhase, scaleFactor, nRows, nSpws, nUniqueTimesBP, build 18-Sep-2019 23:19:12 + uniqueTimesBP, frequencyLimits, increments, frequenciesGHz, build 18-Sep-2019 23:19:12 + polynomialPhase, polynomialAmplitude, times, antenna1, cal_desc_id, spwBP]) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + mytb.done() build 18-Sep-2019 23:19:12 + return([]) build 18-Sep-2019 23:19:12 + # end of openBpolyFile() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def displayTimesArray(uniqueTimesPerFieldPerSpw): build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + Builds a string from an array of MJD second timestamps as UT timestamps build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + legendString = '' build 18-Sep-2019 23:19:12 + for s in uniqueTimesPerFieldPerSpw: build 18-Sep-2019 23:19:12 + legendString += "[" build 18-Sep-2019 23:19:12 + for f in s: build 18-Sep-2019 23:19:12 + legendString += "[" build 18-Sep-2019 23:19:12 + for t in f: build 18-Sep-2019 23:19:12 + legendString += "%s" % utstring(t,2) build 18-Sep-2019 23:19:12 + if (t != f[-1]): build 18-Sep-2019 23:19:12 + legendString += ", " build 18-Sep-2019 23:19:12 + legendString += "]" build 18-Sep-2019 23:19:12 + if (f != s[-1]): build 18-Sep-2019 23:19:12 + legendString += ', ' build 18-Sep-2019 23:19:12 + legendString += "], " build 18-Sep-2019 23:19:12 + if (s != uniqueTimesPerFieldPerSpw[-1]): build 18-Sep-2019 23:19:12 + legendString += ', ' build 18-Sep-2019 23:19:12 + return(legendString) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def checkPolsToPlot(polsToPlot, corr_type_string, debug): build 18-Sep-2019 23:19:12 + firstFailure = 0 build 18-Sep-2019 23:19:12 + for pol in polsToPlot: build 18-Sep-2019 23:19:12 + if ((pol in corr_type_string) == False): build 18-Sep-2019 23:19:12 + casalogPost(debug,"Polarization product %s is not in the ms" % (pol)) build 18-Sep-2019 23:19:12 + firstFailure += 1 build 18-Sep-2019 23:19:12 + if (pol in ['XX','YY']): build 18-Sep-2019 23:19:12 + polsToPlot = ['RR','LL'] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + polsToPlot = ['XX','YY'] build 18-Sep-2019 23:19:12 + break build 18-Sep-2019 23:19:12 + if (firstFailure>0): build 18-Sep-2019 23:19:12 + casalogPost(debug,"Looking for instead: %s" % (str(polsToPlot))) build 18-Sep-2019 23:19:12 + for pol in polsToPlot: build 18-Sep-2019 23:19:12 + if ((pol in corr_type_string) == False): build 18-Sep-2019 23:19:12 + casalogPost(debug,"Polarization product %s is not in the ms" % (pol)) build 18-Sep-2019 23:19:12 + firstFailure += 1 build 18-Sep-2019 23:19:12 + if (pol in ['XX']): build 18-Sep-2019 23:19:12 + polsToPlot = ['YY'] build 18-Sep-2019 23:19:12 + elif (pol in ['YY']): build 18-Sep-2019 23:19:12 + polsToPlot = ['XX'] build 18-Sep-2019 23:19:12 + elif (pol in ['RR']): build 18-Sep-2019 23:19:12 + polsToPlot = ['LL'] build 18-Sep-2019 23:19:12 + elif (pol in ['LL']): build 18-Sep-2019 23:19:12 + polsToPlot = ['RR'] build 18-Sep-2019 23:19:12 + break build 18-Sep-2019 23:19:12 + if (firstFailure > 1): build 18-Sep-2019 23:19:12 + casalogPost(debug,"Looking for instead: %s" % (str(polsToPlot))) build 18-Sep-2019 23:19:12 + for pol in polsToPlot: build 18-Sep-2019 23:19:12 + if ((pol in corr_type_string) == False): build 18-Sep-2019 23:19:12 + casalogPost(debug,"Polarization product %s is not in the ms" % (pol)) build 18-Sep-2019 23:19:12 + return([]) build 18-Sep-2019 23:19:12 + return(polsToPlot) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def getCorrType(msName, spwsToPlot, mymsmd, debug=False): build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + Open the DATA_DESCRIPTION_ID table. Find the polarization_id of the first build 18-Sep-2019 23:19:12 + spw in the list of spwsToPlot, then read the CORR_TYPE from the POLARIZATION build 18-Sep-2019 23:19:12 + table. build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:12 + mytb.open(msName+'/DATA_DESCRIPTION') build 18-Sep-2019 23:19:12 + spws = mytb.getcol('SPECTRAL_WINDOW_ID') build 18-Sep-2019 23:19:12 + polarization_id = mytb.getcol('POLARIZATION_ID') build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + pol_id = 0 build 18-Sep-2019 23:19:12 + telescopeName = mymsmd.observatorynames()[0] build 18-Sep-2019 23:19:12 + mytb.open(msName+'/POLARIZATION') build 18-Sep-2019 23:19:12 + for myspw in spwsToPlot: build 18-Sep-2019 23:19:12 +# print("looking for %d in %s" % (myspw, str(spws))) build 18-Sep-2019 23:19:12 + row = list(spws).index(myspw) build 18-Sep-2019 23:19:12 + if (row >= 0): build 18-Sep-2019 23:19:12 + pol_id = polarization_id[row] build 18-Sep-2019 23:19:12 + corr_type = mytb.getcell('CORR_TYPE',pol_id) build 18-Sep-2019 23:19:12 + if (corr_type[0] >= 5 or (telescopeName.find('ALMA')<0 and telescopeName.find('VLA')<0)): build 18-Sep-2019 23:19:12 + # Undefined, I, Q, U, V, which ALMA and VLA never use build 18-Sep-2019 23:19:12 + # Need to allow non-VLA, non-ALMA to stop here build 18-Sep-2019 23:19:12 + break build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + corr_type_string = [] build 18-Sep-2019 23:19:12 + if (len(corr_type) == 4): build 18-Sep-2019 23:19:12 + casalogPost(debug,"This is a 4-polarization dataset.") build 18-Sep-2019 23:19:12 + if (corr_type[0] in [5,6,7,8]): build 18-Sep-2019 23:19:12 + corr_type = [5,8] build 18-Sep-2019 23:19:12 + elif (corr_type[0] in [9,10,11,12]): build 18-Sep-2019 23:19:12 + corr_type = [9,12] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + print("Unsupported polarization types = ", corr_type) build 18-Sep-2019 23:19:12 + return(corr_type, corr_type_string) build 18-Sep-2019 23:19:12 + # This overrides the len(gain_table) because it can have length=2 even when only 1 pol present build 18-Sep-2019 23:19:12 + nPolarizations = len(corr_type) build 18-Sep-2019 23:19:12 + for ct in corr_type: build 18-Sep-2019 23:19:12 + corr_type_string.append(corrTypeToString(ct)) build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("corr_types = ", corr_type, " = ", corr_type_string) build 18-Sep-2019 23:19:12 + return(corr_type, corr_type_string, nPolarizations) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def writeArgument(f,name,arg): build 18-Sep-2019 23:19:12 + if (type(arg) == str): build 18-Sep-2019 23:19:12 + s = "%-18s = '%s'" % (name,arg) build 18-Sep-2019 23:19:12 + t = "%s='%s'" % (name,arg) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + s = "%-18s = %s" % (name,str(arg)) build 18-Sep-2019 23:19:12 + t = "%s=%s" % (name,arg) build 18-Sep-2019 23:19:12 + f.write(s+'\n') build 18-Sep-2019 23:19:12 + return(t) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def channelDifferences(y, x, resample=1): build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + Takes a vector, and computes the channel-to-channel derivative. build 18-Sep-2019 23:19:12 + Optionally, it will also resample the data and compute the build 18-Sep-2019 23:19:12 + derivative. build 18-Sep-2019 23:19:12 + - Todd Hunter build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + x = np.array(x) build 18-Sep-2019 23:19:12 + y = np.array(y) build 18-Sep-2019 23:19:12 + if (len(x) > 1): build 18-Sep-2019 23:19:12 + channelWidth = x[1]-x[0] build 18-Sep-2019 23:19:12 + d = (np.diff(y)/np.diff(x)) build 18-Sep-2019 23:19:12 + newy = d*channelWidth build 18-Sep-2019 23:19:12 + newx = (x[1:]+x[:-1])/2. # midpoints of input x-axis build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + newx = x build 18-Sep-2019 23:19:12 + newy = y build 18-Sep-2019 23:19:12 + if (resample > 1): build 18-Sep-2019 23:19:12 + x,y = resampleSolution(x,y,resample) build 18-Sep-2019 23:19:12 + if (len(x) > 1): build 18-Sep-2019 23:19:12 + channelWidth = x[1]-x[0] build 18-Sep-2019 23:19:12 + d = (np.diff(y)/np.diff(x)) build 18-Sep-2019 23:19:12 + resy = d*channelWidth build 18-Sep-2019 23:19:12 + resx = (x[1:]+x[:-1])/2. # midpoints of input x-axis build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + resx = x build 18-Sep-2019 23:19:12 + resy = y build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + resy = newy build 18-Sep-2019 23:19:12 + resx = newx build 18-Sep-2019 23:19:12 + return(newy, newx, resy, resx) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def getDataColumnName(inputMs, debug): build 18-Sep-2019 23:19:12 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:12 + mytb.open(inputMs) build 18-Sep-2019 23:19:12 + colnames = mytb.colnames() build 18-Sep-2019 23:19:12 + correctedDataColumnName = '' build 18-Sep-2019 23:19:12 + modelDataColumnName = '' build 18-Sep-2019 23:19:12 + if 'FLOAT_DATA' in colnames: build 18-Sep-2019 23:19:12 + dataColumnName = 'FLOAT_DATA' build 18-Sep-2019 23:19:12 + correctedDataColumnName = 'FLOAT_DATA' build 18-Sep-2019 23:19:12 + elif 'DATA' in colnames: build 18-Sep-2019 23:19:12 + dataColumnName = 'DATA' build 18-Sep-2019 23:19:12 + if 'CORRECTED_DATA' in colnames: build 18-Sep-2019 23:19:12 + correctedDataColumnName = 'CORRECTED_DATA' build 18-Sep-2019 23:19:12 + if 'MODEL_DATA' in colnames: build 18-Sep-2019 23:19:12 + modelDataColumnName = 'MODEL_DATA' build 18-Sep-2019 23:19:12 + mytb.done() build 18-Sep-2019 23:19:12 + return(dataColumnName) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def doPolarizations(mymsmd, inputMs, debug=False) : build 18-Sep-2019 23:19:12 + # This function is obsolete. There may be no OBSERVE_TARGET intents in a dataset! build 18-Sep-2019 23:19:12 + # Determine the number of polarizations for the first OBSERVE_TARGET intent. build 18-Sep-2019 23:19:12 + # Used by plotbandpass for BPOLY plots since the number of pols cannot be inferred build 18-Sep-2019 23:19:12 + # correctly from the caltable alone. You cannot not simply use the first row, because build 18-Sep-2019 23:19:12 + # it may be a pointing scan which may have different number of polarizations than what build 18-Sep-2019 23:19:12 + # the TARGET and BANDPASS calibrator will have. build 18-Sep-2019 23:19:12 + # -- T. Hunter build 18-Sep-2019 23:19:12 + if (debug): print("doPolarizations()") build 18-Sep-2019 23:19:12 + myscan = -1 build 18-Sep-2019 23:19:12 + starttime = timeUtilities.time() build 18-Sep-2019 23:19:12 + for s in range(1,mymsmd.nscans()+1): build 18-Sep-2019 23:19:12 + if (debug): print("s = %s" % (str(s))) build 18-Sep-2019 23:19:12 + intents = mymsmd.intentsforscan(s) build 18-Sep-2019 23:19:12 + for i in intents: build 18-Sep-2019 23:19:12 + if (i.find('OBSERVE_TARGET')>=0): build 18-Sep-2019 23:19:12 + myscan = s build 18-Sep-2019 23:19:12 +# print("First OBSERVE_TARGET scan = %s" % (str(myscan))) build 18-Sep-2019 23:19:12 + break build 18-Sep-2019 23:19:12 + if (myscan >= 0): build 18-Sep-2019 23:19:12 + break build 18-Sep-2019 23:19:12 + if (myscan == -1): build 18-Sep-2019 23:19:12 + # if there is no OBSERVE_TARGET, then just use the first scan build 18-Sep-2019 23:19:12 + myscan = 0 build 18-Sep-2019 23:19:12 + dataColumnName = getDataColumnName(inputMs,debug) build 18-Sep-2019 23:19:12 + if (debug): print("dataColumnName = %s" % (dataColumnName)) build 18-Sep-2019 23:19:12 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:12 + mytb.open("%s" % inputMs) build 18-Sep-2019 23:19:12 + if (myscan == 0): build 18-Sep-2019 23:19:12 + # assume the first row in the table is for the first scan, to save time build 18-Sep-2019 23:19:12 + nPolarizations = np.shape(mytb.getcell(dataColumnName,0))[0] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + scans = mytb.getcol('SCAN_NUMBER') build 18-Sep-2019 23:19:12 + nPolarizations = 0 build 18-Sep-2019 23:19:12 + for s in range(len(scans)): build 18-Sep-2019 23:19:12 + if (scans[s]==myscan): build 18-Sep-2019 23:19:12 + nPolarizations = np.shape(mytb.getcell(dataColumnName,s))[0] build 18-Sep-2019 23:19:12 + break build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + donetime = timeUtilities.time() build 18-Sep-2019 23:19:12 + return(nPolarizations) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def getnspw(mymsmd): build 18-Sep-2019 23:19:12 +# if (casadef.subversion_revision > '22653'): build 18-Sep-2019 23:19:12 + return(mymsmd.nspw(False)) build 18-Sep-2019 23:19:12 +# else: build 18-Sep-2019 23:19:12 +# return(mymsmd.nspw()) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def drawOverlayTimeLegends(xframe,firstFrame,xstartTitle,ystartTitle,caltable,titlesize, build 18-Sep-2019 23:19:12 + fieldIndicesToPlot,ispwInCalTable,uniqueTimesPerFieldPerSpw, build 18-Sep-2019 23:19:12 + timerangeListTimes, solutionTimeThresholdSeconds,debugSloppyMatch, build 18-Sep-2019 23:19:12 + ystartOverlayLegend,debug,mysize, fieldsToPlot,myUniqueColor, build 18-Sep-2019 23:19:12 + timeHorizontalSpacing, fieldIndex,overlayColors, build 18-Sep-2019 23:19:12 + antennaVerticalSpacing, overlayAntennas, build 18-Sep-2019 23:19:12 + timerangeList, caltableTitle, build 18-Sep-2019 23:19:12 + mytime, scansToPlot, scansForUniqueTimes): build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + Draws the legend at the top of the page, if it is the correct time to do so, build 18-Sep-2019 23:19:12 + including the overlayTimes, the 'UT' label, and the caltable name. build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 +# debugSloppyMatch=True build 18-Sep-2019 23:19:12 + if (xframe == firstFrame): build 18-Sep-2019 23:19:12 + # draw title including caltable name build 18-Sep-2019 23:19:12 + pb.text(xstartTitle, ystartTitle, caltableTitle, size=titlesize, build 18-Sep-2019 23:19:12 + color='k', transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:12 + # support multi-fields with overlay='time' build 18-Sep-2019 23:19:12 + uTPFPS = [] build 18-Sep-2019 23:19:12 + uTPFPStimerange = [] build 18-Sep-2019 23:19:12 + # Find all timerange integers for all fields, not just the ones that were plotted build 18-Sep-2019 23:19:12 + allTimeranges = [] build 18-Sep-2019 23:19:12 + for f in range(len(uniqueTimesPerFieldPerSpw[ispwInCalTable])): build 18-Sep-2019 23:19:12 + for t in uniqueTimesPerFieldPerSpw[ispwInCalTable][f]: build 18-Sep-2019 23:19:12 + if (t in timerangeListTimes): build 18-Sep-2019 23:19:12 + allTimeranges.append(list(timerangeListTimes).index(t)) build 18-Sep-2019 23:19:12 + for f in fieldIndicesToPlot: build 18-Sep-2019 23:19:12 + for t in uniqueTimesPerFieldPerSpw[ispwInCalTable][f]: build 18-Sep-2019 23:19:12 + matched, mymatch = sloppyMatch(t, timerangeListTimes, solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:12 + myprint=debugSloppyMatch, whichone=True) build 18-Sep-2019 23:19:12 + if (matched): build 18-Sep-2019 23:19:12 + uTPFPS.append(t) build 18-Sep-2019 23:19:12 + uTPFPStimerange.append(mymatch) build 18-Sep-2019 23:19:12 + allTimeranges = list(np.sort(np.unique(allTimeranges))) build 18-Sep-2019 23:19:12 + idx = np.argsort(uTPFPS) build 18-Sep-2019 23:19:12 + uTPFPStimerange = np.array(uTPFPStimerange)[idx] build 18-Sep-2019 23:19:12 + uTPFPS = np.sort(uTPFPS) build 18-Sep-2019 23:19:12 + timeFormat = 3 # HH:MM:SS build 18-Sep-2019 23:19:12 + maxTimesAcross = maxTimesAcrossTheTop build 18-Sep-2019 23:19:12 + if (firstFrame == 111): build 18-Sep-2019 23:19:12 + maxTimesAcross -= 2 build 18-Sep-2019 23:19:12 + for a in range(len(uTPFPS)): build 18-Sep-2019 23:19:12 + legendString = utstring(uTPFPS[a],timeFormat) build 18-Sep-2019 23:19:12 + if (debug): print("----> Defined legendString: %s" % (legendString)) build 18-Sep-2019 23:19:12 + if (a==0): build 18-Sep-2019 23:19:12 + pb.text(xstartTitle-0.03, ystartOverlayLegend, 'UT',color='k',fontsize=mysize, build 18-Sep-2019 23:19:12 + transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:12 + if (a < maxTimesAcross): build 18-Sep-2019 23:19:12 + x0 = xstartTitle + (a*timeHorizontalSpacing) build 18-Sep-2019 23:19:12 + y0 = ystartOverlayLegend build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + # start going down the righthand side build 18-Sep-2019 23:19:12 + x0 = xstartTitle + (maxTimesAcross*timeHorizontalSpacing) build 18-Sep-2019 23:19:12 + y0 = ystartOverlayLegend-(a-maxTimesAcross)*antennaVerticalSpacing build 18-Sep-2019 23:19:12 +# for tlt in timerangeListTimes: build 18-Sep-2019 23:19:12 + if (True): build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("3)checking time %d, len(uTPFPS)=%d" % (a,len(uTPFPS))) build 18-Sep-2019 23:19:12 + if (sloppyMatch(uTPFPS[a],timerangeListTimes, build 18-Sep-2019 23:19:12 + solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:12 + mytime, scansToPlot, scansForUniqueTimes, build 18-Sep-2019 23:19:12 + myprint=debugSloppyMatch)): build 18-Sep-2019 23:19:12 + myUniqueTime = uTPFPS[a] build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("3)setting myUniqueTime to %d" % (myUniqueTime)) build 18-Sep-2019 23:19:12 + if (debug): print("----> Drawing legendString: %s" % (legendString)) build 18-Sep-2019 23:19:12 + if ((len(fieldsToPlot) > 1 or len(timerangeList) > 1) and overlayAntennas==False): build 18-Sep-2019 23:19:12 + # having overlayAntennas==False here will force all time labels to be black (as desired) build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("len(uTPFPS)=%d, a=%d, len(myUniqueColor)=%d" % (len(uTPFPS),a,len(myUniqueColor))) build 18-Sep-2019 23:19:12 +# pb.text(x0, y0, legendString,color=overlayColors[timerangeList[a]],fontsize=mysize, build 18-Sep-2019 23:19:12 +# transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("len(uTPFPStimerange)=%d, a=%d, len(myUniqueColor)=%d" % (len(uTPFPStimerange),a,len(myUniqueColor))) build 18-Sep-2019 23:19:12 + pb.text(x0, y0, legendString,color=overlayColors[timerangeList[allTimeranges.index(uTPFPStimerange[a])]], build 18-Sep-2019 23:19:12 + fontsize=mysize, transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("done text") build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pb.text(x0, y0, legendString,fontsize=mysize, transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def lineNumber(): build 18-Sep-2019 23:19:12 + """Returns the current line number in our program.""" build 18-Sep-2019 23:19:12 + return inspect.currentframe().f_back.f_lineno build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def drawAtmosphereAndFDM(showatm, showtsky, atmString, subplotRows, mysize, TebbSky, build 18-Sep-2019 23:19:12 + TebbSkyImage,plotrange, xaxis, atmchan, atmfreq, transmission, build 18-Sep-2019 23:19:12 + subplotCols, showatmPoints,xframe, channels,LO1,atmchanImage, build 18-Sep-2019 23:19:12 + atmfreqImage,transmissionImage, firstFrame,showfdm,nChannels,tableFormat, build 18-Sep-2019 23:19:12 + originalSpw_casa33, chanFreqGHz_casa33,originalSpw,chanFreqGHz, build 18-Sep-2019 23:19:12 + overlayTimes, overlayAntennas, xant, antennasToPlot, overlaySpws, build 18-Sep-2019 23:19:12 + baseband, showBasebandNumber, basebandDict, overlayBasebands, build 18-Sep-2019 23:19:12 + drewAtmosphere): build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + If requested by the user at the command line, draw the atmospheric curve build 18-Sep-2019 23:19:12 + and the FDM window locations. build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + mylineno = lineNumber() build 18-Sep-2019 23:19:12 + ylim = pb.ylim() # CAS-8655 build 18-Sep-2019 23:19:12 + if ((showatm or showtsky) and len(atmString) > 0): build 18-Sep-2019 23:19:12 + ylim = DrawAtmosphere(showatm, showtsky, subplotRows, atmString, build 18-Sep-2019 23:19:12 + mysize, TebbSky, plotrange, xaxis, atmchan, build 18-Sep-2019 23:19:12 + atmfreq, transmission, subplotCols, build 18-Sep-2019 23:19:12 + showatmPoints=showatmPoints, xframe=xframe, build 18-Sep-2019 23:19:12 + channels=channels, build 18-Sep-2019 23:19:12 + mylineno=mylineno,xant=xant, build 18-Sep-2019 23:19:12 + overlaySpws=overlaySpws, overlayBasebands=overlayBasebands, build 18-Sep-2019 23:19:12 + drewAtmosphere=drewAtmosphere) build 18-Sep-2019 23:19:12 + if (LO1 != '' and LO1 is not None): build 18-Sep-2019 23:19:12 + # Now draw the image band build 18-Sep-2019 23:19:12 + ylim = DrawAtmosphere(showatm,showtsky, subplotRows, atmString, build 18-Sep-2019 23:19:12 + mysize, TebbSkyImage, plotrange, xaxis, build 18-Sep-2019 23:19:12 + atmchanImage, atmfreqImage, transmissionImage, build 18-Sep-2019 23:19:12 + subplotCols, LO1, xframe, firstFrame, showatmPoints, build 18-Sep-2019 23:19:12 + channels=channels, mylineno=mylineno,xant=xant, build 18-Sep-2019 23:19:12 + overlaySpws=overlaySpws, overlayBasebands=overlayBasebands, build 18-Sep-2019 23:19:12 + drewAtmosphere=drewAtmosphere) build 18-Sep-2019 23:19:12 + # The following case is needed for the case that overlay='antenna,time' and build 18-Sep-2019 23:19:12 + # the final timerange is flagged on the final antenna. build 18-Sep-2019 23:19:12 +# if (overlayTimes==False or overlayAntennas==False or xant==antennasToPlot[-1]): build 18-Sep-2019 23:19:12 + # Because this function is now only called from one place, setting this to build 18-Sep-2019 23:19:12 + # True is what we want. - 18-Jun-2013 build 18-Sep-2019 23:19:12 + if (True): build 18-Sep-2019 23:19:12 + if (xaxis.find('freq')>=0 and showfdm and nChannels <= 256): build 18-Sep-2019 23:19:12 + if (tableFormat == 33): build 18-Sep-2019 23:19:12 + showFDM(originalSpw_casa33, chanFreqGHz_casa33, build 18-Sep-2019 23:19:12 + baseband, showBasebandNumber, basebandDict) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + showFDM(originalSpw, chanFreqGHz, build 18-Sep-2019 23:19:12 + baseband, showBasebandNumber, basebandDict) build 18-Sep-2019 23:19:12 + ylim = pb.ylim() # CAS-11062 need to pass the new wider limits back up to calling function build 18-Sep-2019 23:19:12 + return ylim # CAS-8655 build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def DrawPolarizationLabelsForOverlayTime(xstartPolLabel,ystartPolLabel,corr_type,polsToPlot, build 18-Sep-2019 23:19:12 + channeldiff,ystartMadLabel,subplotRows,gamp_mad,mysize, build 18-Sep-2019 23:19:12 + ampmarkstyle,markersize,ampmarkstyle2, gamp_std): build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + Currently this is only called for amp vs. X plots. The corresponding code for phase build 18-Sep-2019 23:19:12 + vs. X plots is still inside plotbandpass(). But this is okay because overlay='time' build 18-Sep-2019 23:19:12 + is mainly intended for Tsys plots. build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + x0 = xstartPolLabel build 18-Sep-2019 23:19:12 + y0 = ystartPolLabel build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[0]) in polsToPlot): build 18-Sep-2019 23:19:12 + if (channeldiff > 0): build 18-Sep-2019 23:19:12 + pb.text(x0, ystartMadLabel-0.03*subplotRows*0, build 18-Sep-2019 23:19:12 + corrTypeToString(corr_type[0])+' MAD = %.4f, St.Dev = %.4f'%(gamp_mad[0]['mad'], gamp_std[0]['std']), build 18-Sep-2019 23:19:12 + color='k',size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + if (ampmarkstyle.find('-')>=0): build 18-Sep-2019 23:19:12 + pb.text(x0, y0, corrTypeToString(corr_type[0])+' solid', color='k', build 18-Sep-2019 23:19:12 + size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pb.text(x0+0.02, y0, corrTypeToString(corr_type[0]), color='k', build 18-Sep-2019 23:19:12 + size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + pdesc = pb.plot([x0-0.1], [y0], '%sk'%ampmarkstyle, markersize=markersize, build 18-Sep-2019 23:19:12 + scalex=False,scaley=False, transform=pb.gca().transAxes,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + if (len(corr_type) > 1): build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[1]) in polsToPlot): build 18-Sep-2019 23:19:12 + if (channeldiff > 0): build 18-Sep-2019 23:19:12 + pb.text(x0, ystartMadLabel-0.03*subplotRows*1, build 18-Sep-2019 23:19:12 + corrTypeToString(corr_type[1])+' MAD = %.4f, St.Dev = %.4f'%(gamp_mad[1]['mad'], gamp_std[1]['std']), build 18-Sep-2019 23:19:12 + color='k',size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + if (ampmarkstyle2.find('--')>=0): build 18-Sep-2019 23:19:12 + pb.text(x0, y0-0.03*subplotRows, corrTypeToString(corr_type[1])+' dashed', build 18-Sep-2019 23:19:12 + color='k', size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pb.text(x0, y0-0.03*subplotRows, corrTypeToString(corr_type[1]), # removed +0.02*xrange on 11-Mar-2014 build 18-Sep-2019 23:19:12 + color='k', size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + pdesc = pb.plot([x0-0.1], [y0-0.03*subplotRows], '%sk'%ampmarkstyle2, build 18-Sep-2019 23:19:12 + markersize=markersize, scalex=False,scaley=False, transform=pb.gca().transAxes,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def plural(u): build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + If the length of the array passed is > 1, return 's', otherwise return ''. build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + if (len(u) > 1): build 18-Sep-2019 23:19:12 + return('s') build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + return('') build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def casalogPost(debug,mystring): build 18-Sep-2019 23:19:12 + casalog.post(mystring) build 18-Sep-2019 23:19:12 + if (debug): print(mystring) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +def computeHighestSpwIndexInSpwsToPlotThatHasCurrentScan(spwsToPlot, scansToPlotPerSpw, scan): build 18-Sep-2019 23:19:12 + highestSpwIndex = -1 build 18-Sep-2019 23:19:12 + for i,spw in enumerate(spwsToPlot): build 18-Sep-2019 23:19:12 + if (scan in scansToPlotPerSpw[spw]): build 18-Sep-2019 23:19:12 + highestSpwIndex = i build 18-Sep-2019 23:19:12 + return(highestSpwIndex) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +DEFAULT_PLATFORMING_THRESHOLD = 10.0 # unused if platformingSigma != 0 build 18-Sep-2019 23:19:12 +def plotbandpass(caltable='', antenna='', field='', spw='', yaxis='amp', build 18-Sep-2019 23:19:12 + xaxis='chan', figfile='', plotrange=[0,0,0,0], build 18-Sep-2019 23:19:12 + caltable2='', overlay='', showflagged=False, timeranges='', build 18-Sep-2019 23:19:12 + buildpdf=False, caltable3='', markersize=3, density=108, build 18-Sep-2019 23:19:12 + interactive=True, showpoints='auto', showlines='auto', build 18-Sep-2019 23:19:12 + subplot='22', zoom='', poln='', showatm=False, pwv='auto', build 18-Sep-2019 23:19:12 + gs='gs', convert='convert', chanrange='', build 18-Sep-2019 23:19:12 + solutionTimeThresholdSeconds=30.0, debug=False, build 18-Sep-2019 23:19:12 + phase='', vis='',showtsky=False, showfdm=False,showatmfield='', build 18-Sep-2019 23:19:12 + lo1='', showimage=False, showatmPoints=False, parentms='', build 18-Sep-2019 23:19:12 + pdftk='pdftk', channeldiff=False, edge=8, resample=1, build 18-Sep-2019 23:19:12 + platformingThreshold=DEFAULT_PLATFORMING_THRESHOLD, build 18-Sep-2019 23:19:12 + platformingSigma=5.0, basebands=[], showBasebandNumber=False, build 18-Sep-2019 23:19:12 + scans='', figfileSequential=False, chanrangeSetXrange=False): build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + This is a task to plot bandpass and Tsys calibration tables faster and more build 18-Sep-2019 23:19:12 + flexibly than plotcal, including the ability to overlay the atmospheric build 18-Sep-2019 23:19:12 + transmission, and to create multi-page plots as pngs and combine them build 18-Sep-2019 23:19:12 + into single PDF documents. build 18-Sep-2019 23:19:12 + It works with both the old style and new style cal tables. The source code build 18-Sep-2019 23:19:12 + is in task_plotbandpass.py. For more detailed help, see examples at: build 18-Sep-2019 23:19:12 + http://casaguides.nrao.edu/index.php?title=Plotbandpass build 18-Sep-2019 23:19:12 + -- Todd Hunter build 18-Sep-2019 23:19:12 + """ build 18-Sep-2019 23:19:12 + casalog.origin('plotbandpass') build 18-Sep-2019 23:19:12 + casalogPost(debug,"%s" % (PLOTBANDPASS_REVISION_STRING)) build 18-Sep-2019 23:19:12 + DEBUG = debug build 18-Sep-2019 23:19:12 + help = False build 18-Sep-2019 23:19:12 + vm = '' # unused variable, now that msmd is available in casa build 18-Sep-2019 23:19:12 + if (help): build 18-Sep-2019 23:19:12 + print("Usage: plotbandpass(caltable='', antenna='', field='', spw='', yaxis='amp',") build 18-Sep-2019 23:19:12 + print(" xaxis='chan', figfile='', plotrange=[0,0,0,0], caltable2='',") build 18-Sep-2019 23:19:12 + print(" overlay='', showflagged=False, timeranges='', buildpdf=False, caltable3='',") build 18-Sep-2019 23:19:12 + print(" markersize=3, density=108, interactive=True, showpoints='auto',") build 18-Sep-2019 23:19:12 + print(" showlines='auto', subplot='22', zoom='', poln='', showatm=False, pwv='auto',") build 18-Sep-2019 23:19:12 + print(" gs='gs', convert='convert', chanrange='', debug=False,") build 18-Sep-2019 23:19:12 + print(" solutionTimeThresholdSeconds=30.0, phase='', vis='', showtsky=False,") build 18-Sep-2019 23:19:12 + print(" showfdm=False, showatmfield='', lo1='', showimage=False,") build 18-Sep-2019 23:19:12 + print(" showatmPoints=False, parentms='', pdftk='pdftk', channeldiff=False,") build 18-Sep-2019 23:19:12 + print(" edge=8, resample=1, vis='',platformingThreshold=%f," % (DEFAULT_PLATFORMING_THRESHOLD)) build 18-Sep-2019 23:19:12 + print(" platformingSigma=%.1f, basebands=[], showBasebandNumber=False," % (5.0)) build 18-Sep-2019 23:19:12 + print(" scans='')") build 18-Sep-2019 23:19:12 + print(" antenna: must be either an ID (int or string or list), or a single antenna name or list") build 18-Sep-2019 23:19:12 + print(" basebands: show only spws from the specified baseband or list of basebands (default:None=all)") build 18-Sep-2019 23:19:12 + print(" buildpdf: True/False, if True and figfile is set, assemble pngs into a pdf") build 18-Sep-2019 23:19:12 + print(" caltable: a bandpass table, of type B or BPOLY") build 18-Sep-2019 23:19:12 + print(" caltable2: a second cal table, of type BPOLY or B, to overlay on a B table") build 18-Sep-2019 23:19:12 + print(" caltable3: a third cal table, of type BPOLY, to overlay on the first two") build 18-Sep-2019 23:19:12 + print(" chanrange: set xrange ('5~100') over which to autoscale y-axis for xaxis='freq'") build 18-Sep-2019 23:19:12 + print(" channeldiff: set to value > 0 (sigma) to plot derivatives of amplitude") build 18-Sep-2019 23:19:12 + print(" convert: full path for convert command (in case it's not found)") build 18-Sep-2019 23:19:12 + print(" density: dpi to use in creating PNGs and PDFs (default=108)") build 18-Sep-2019 23:19:12 + print(" edge: the number of edge channels to ignore in finding outliers (for channeldiff>0)") build 18-Sep-2019 23:19:12 + print(" field: must be an ID, source name, or list thereof; can use trailing *: 'J*'") build 18-Sep-2019 23:19:12 + print(" figfile: the base_name of the png files to save: base_name.antX.spwY.png") build 18-Sep-2019 23:19:12 + print(" figfileSequential: naming scheme, False: name by spw/antenna (default)") build 18-Sep-2019 23:19:12 + print(" True: figfile.1.png, figfile.2.png, etc.") build 18-Sep-2019 23:19:12 + print(" gs: full path for ghostscript command (in case it's not found)") build 18-Sep-2019 23:19:12 + print(" interactive: if False, then figfile will run to completion automatically and no gui") build 18-Sep-2019 23:19:12 + print(" lo1: specify the LO1 setting (in GHz) for the observation") build 18-Sep-2019 23:19:12 + print(" overlay: 'antenna','time','antenna,time','spw', or 'baseband'") build 18-Sep-2019 23:19:12 + print(" makes 1 plot with different items in colors") build 18-Sep-2019 23:19:12 + print(" markersize: size of points (default=3)") build 18-Sep-2019 23:19:12 + print(" vis: name of the ms for this table, in case it does not match the string in the caltable") build 18-Sep-2019 23:19:12 + print(" parentms: name of the parent ms, in case the ms has been previously split") build 18-Sep-2019 23:19:12 + print(" pdftk: full path for pdftk command (in case it's not found)") build 18-Sep-2019 23:19:12 + print(" phase: the y-axis limits to use for phase plots when yaxis='both'") build 18-Sep-2019 23:19:12 + print(" platformingSigma: declare platforming if the amplitude derivative exceeds this many times the MAD") build 18-Sep-2019 23:19:12 + print(" platformingThreshold: if platformingSigma=0, then declare platforming if the amplitude") build 18-Sep-2019 23:19:12 + print(" derivative exceeds this percentage of the median") build 18-Sep-2019 23:19:12 + print(" plotrange: define axis limits: [x0,x1,y0,y1] where 0,0 means auto") build 18-Sep-2019 23:19:12 + print(" poln: polarizations to plot (e.g. 'XX','YY','RR','LL' or '' for both)") build 18-Sep-2019 23:19:12 + print(" pwv: define the pwv to use for the showatm option: 'auto' or value in mm") build 18-Sep-2019 23:19:12 + print(" resample: channel expansion factor to use when computing MAD of derivative (for channeldiff>0)") build 18-Sep-2019 23:19:12 + print(" scans: show only solutions for the specified scans (int, list, or string)") build 18-Sep-2019 23:19:12 + print(" showatm: compute and overlay the atmospheric transmission curve") build 18-Sep-2019 23:19:12 + print(" showatmfield: for overlay='time', use first observation of this fieldID or name") build 18-Sep-2019 23:19:12 + print(" showatmPoints: draw atmospheric curve with points instead of a line") build 18-Sep-2019 23:19:12 + print(" showBasebandNumber: put the BBC_NO in the title of each plot") build 18-Sep-2019 23:19:12 + print(" showfdm: when showing TDM spws with xaxis='freq', draw locations of FDM spws") build 18-Sep-2019 23:19:12 + print(" showflagged: show the values of data, even if flagged") build 18-Sep-2019 23:19:12 + print(" showimage: also show the atmospheric curve for the image sideband (in black)") build 18-Sep-2019 23:19:12 + print(" showtsky: compute and overlay the sky temperature curve instead of transmission") build 18-Sep-2019 23:19:12 + print(" showlines: draw lines connecting the data (default=T for amp, F for phase)") build 18-Sep-2019 23:19:12 + print(" showpoints: draw points for the data (default=F for amp, T for phase)") build 18-Sep-2019 23:19:12 + print(" solutionTimeThresholdSeconds: consider 2 solutions simultaneous if within this interval (default=30)") build 18-Sep-2019 23:19:12 + print(" spw: must be single ID or list or range (e.g. 0~4, not the original ID)") build 18-Sep-2019 23:19:12 + print(" subplot: 11..81,22,32 or 42 for RowsxColumns (default=22), any 3rd digit is ignored") build 18-Sep-2019 23:19:12 + print(" timeranges: show only these timeranges, the first timerange being 0") build 18-Sep-2019 23:19:12 + print(" xaxis: 'chan' or 'freq'") build 18-Sep-2019 23:19:12 + print(" yaxis: 'amp', 'tsys', 'phase', or 'both' amp&phase == 'ap'; append 'db' for dB") build 18-Sep-2019 23:19:12 + print(" zoom: 'intersect' will zoom to overlap region of caltable with caltable2") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + mytimestamp = timeUtilities.time() build 18-Sep-2019 23:19:12 + debugSloppyMatch = debug build 18-Sep-2019 23:19:12 + doneOverlayTime = False # changed from True on 08-nov-2012 build 18-Sep-2019 23:19:12 + missingCalWVRErrorPrinted = False build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # initialize the arguments to DrawAtmosphereAndFDM() build 18-Sep-2019 23:19:12 + TebbSky = None build 18-Sep-2019 23:19:12 + TebbSkyImage = None build 18-Sep-2019 23:19:12 + atmchan = None build 18-Sep-2019 23:19:12 + atmfreq = None build 18-Sep-2019 23:19:12 + transmission = None build 18-Sep-2019 23:19:12 + atmchanImage = None build 18-Sep-2019 23:19:12 + atmfreqImage = None build 18-Sep-2019 23:19:12 + transmissionImage = None build 18-Sep-2019 23:19:12 + originalSpw_casa33 = None build 18-Sep-2019 23:19:12 + originalSpw = None build 18-Sep-2019 23:19:12 + chanFreqGHz_casa33 = None build 18-Sep-2019 23:19:12 + chanFreqGHz = None build 18-Sep-2019 23:19:12 + # initialize arguments to DrawPolarizationLabelsForOverlayTime() build 18-Sep-2019 23:19:12 + gamp_mad = None build 18-Sep-2019 23:19:12 + gamp_std = None build 18-Sep-2019 23:19:12 + figfileNumber = 0 # only used if figfileSequential == True build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (False): build 18-Sep-2019 23:19:12 + # Write a .last file build 18-Sep-2019 23:19:12 + if (os.access('plotbandpass.last',os.W_OK)): build 18-Sep-2019 23:19:12 + cmd = 'plotbandpass' build 18-Sep-2019 23:19:12 + lastfile = open('%s.last'%cmd,'w') build 18-Sep-2019 23:19:12 + lastfile.write('taskname = "%s"\n'%cmd) build 18-Sep-2019 23:19:12 + cmd += '(' + writeArgument(lastfile, "caltable", caltable) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "antenna" , antenna) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "field" , field) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "spw" , spw) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "yaxis", yaxis) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "xaxis", xaxis) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "figfile", figfile) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "plotrange" , plotrange) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "caltable2", caltable2) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "overlay", overlay) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "showflagged", showflagged) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "timeranges", timeranges) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "buildpdf", buildpdf) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "caltable3", caltable3) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "markersize", markersize) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "density", density) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "interactive", interactive) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "showpoints", showpoints) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "showlines", showlines) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "subplot", subplot) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "zoom", zoom) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "poln", poln) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "showatm", showatm) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "showatmfield", showatmfield) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "pwv", pwv) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "gs", gs) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "convert", convert) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "chanrange", chanrange) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "solutionTimeThresholdSeconds", solutionTimeThresholdSeconds) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "debug", debug) build 18-Sep-2019 23:19:12 + # cmd += ',' + writeArgument(lastfile, "vm", vm) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "phase", phase) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "vis", vis) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "parentms", parentms) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "lo1", lo1) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "showimage", showimage) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "showtsky", showtsky) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "showatmPoints", showatmPoints) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "showfdm", showfdm) build 18-Sep-2019 23:19:12 + cmd += ',' + writeArgument(lastfile, "pdftk", pdftk) + ')' build 18-Sep-2019 23:19:12 + lastfile.write('#%s\n'%(cmd)) build 18-Sep-2019 23:19:12 + lastfile.close() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + LO1 = None # Fix for SCOPS-4877 build 18-Sep-2019 23:19:12 + lo1s = None # Fix for SCOPS-4877 build 18-Sep-2019 23:19:12 + if (showimage == False): build 18-Sep-2019 23:19:12 + LO1 = lo1 = '' build 18-Sep-2019 23:19:12 + elif (lo1 != ''): build 18-Sep-2019 23:19:12 + if re.match("^\d+?\.\d+?$", lo1) is None: build 18-Sep-2019 23:19:12 + print("lo1 must be a float (entered as a string or number)") build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + lo1 = float(lo1) build 18-Sep-2019 23:19:12 + if (lo1 > 1e6): build 18-Sep-2019 23:19:12 + # convert from Hz to GHz build 18-Sep-2019 23:19:12 + lo1 *= 1e-9 build 18-Sep-2019 23:19:12 + if (showatm and showtsky): build 18-Sep-2019 23:19:12 + print("You have selected both showatm and showtsky! Defaulting to showatm=True only.") build 18-Sep-2019 23:19:12 + showtsky = False build 18-Sep-2019 23:19:12 + if (showatm==False and showtsky==False and showatmfield!=''): build 18-Sep-2019 23:19:12 + print("Defaulting to showatm=True because showatmfield was specified.") build 18-Sep-2019 23:19:12 + showatm = True build 18-Sep-2019 23:19:12 + if (showatm==False and showtsky==False and showimage==True): build 18-Sep-2019 23:19:12 + print("Defaulting to showatm=True because showimage was True.") build 18-Sep-2019 23:19:12 + showatm = True build 18-Sep-2019 23:19:12 + if (overlay.find('time') < 0 and showatmfield != ''): build 18-Sep-2019 23:19:12 + print("The showatmfield only has meaning for overlay='time'.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (plotrange=='' or plotrange==[]): build 18-Sep-2019 23:19:12 + plotrange = [0,0,0,0] build 18-Sep-2019 23:19:12 + if (type(plotrange) != list): build 18-Sep-2019 23:19:12 + print("plotrange must be an array: e.g. [0,1,-180,180]") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (len(plotrange) < 4): build 18-Sep-2019 23:19:12 + print("plotrange must be an array: e.g. [0,1,-180,180]") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (phase != ''): build 18-Sep-2019 23:19:12 + if (type(phase) != list): build 18-Sep-2019 23:19:12 + print("phase must be either '' or 2 values: [x,y]") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (len(phase) != 2): build 18-Sep-2019 23:19:12 + print("phase must be either '' or 2 values: [x,y]") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (edge < 0): build 18-Sep-2019 23:19:12 + print("edge must be >= 0") build 18-Sep-2019 23:19:12 + return(vm) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (resample < 1): build 18-Sep-2019 23:19:12 + print("resample must be an integer >= 1") build 18-Sep-2019 23:19:12 + return(vm) build 18-Sep-2019 23:19:12 + resample = int(resample) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (buildpdf and figfile==''): build 18-Sep-2019 23:19:12 + print("With buildPDF=True, you must specify figfile='yourFileName' (.png will be appended if necessary).") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (interactive==False and figfile=='' and channeldiff == False): build 18-Sep-2019 23:19:12 + print("With interactive=False and channeldiff=False, you must specify figfile='yourFileName' (.png will be appended if necessary).") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + pxl = 0 # polarization number to use for setting xlimits if plotrange=[0,0...] build 18-Sep-2019 23:19:12 + chanrangePercent = None build 18-Sep-2019 23:19:12 + if (type(chanrange) != str): build 18-Sep-2019 23:19:12 + if (type(chanrange) != list): build 18-Sep-2019 23:19:12 + print("Chanrange must be a string or list: '8~120' or [8,120]") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + elif (len(chanrange) != 2): build 18-Sep-2019 23:19:12 + print("Chanrange must be a string or list: '8~120' or [8,120]") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + elif ((type(chanrange[0]) != int) or (type(chanrange[1]) != int)): build 18-Sep-2019 23:19:12 + print("Chanrange list members must be integers, not %s, %s" % (type(chanrange[0]), type(chanrange[1]))) build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + elif (len(chanrange) < 1): build 18-Sep-2019 23:19:12 + chanrange = [0,0] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (chanrange.find('%')>0): build 18-Sep-2019 23:19:12 + chanrangePercent = float(chanrange.split('%')[0]) build 18-Sep-2019 23:19:12 + if (chanrangePercent >= 100 or chanrangePercent <= 0): build 18-Sep-2019 23:19:12 + chanrangePercent = None build 18-Sep-2019 23:19:12 + chanrange = [0,0] build 18-Sep-2019 23:19:12 + elif (chanrange.find('~')>=0): build 18-Sep-2019 23:19:12 + tokens = chanrange.split('~') build 18-Sep-2019 23:19:12 + if (len(tokens) < 2): build 18-Sep-2019 23:19:12 + print("Invalid chanrange string, too few tokens") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + chanrange = [int(tokens[0]),int(tokens[1])] build 18-Sep-2019 23:19:12 + if (DEBUG): build 18-Sep-2019 23:19:12 + print("Using chanrange = %s" % (str(chanrange))) build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("Invalid chanrange, not integers") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + print("Invalid chanrange, no tilde or percent sign found") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (xaxis.find('chan')>=0): build 18-Sep-2019 23:19:12 + print("The chanrange parameter is only valid for xaxis='freq', and only if the plotrange is [0,0,0,0].") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (chanrange[0] < 0): build 18-Sep-2019 23:19:12 + print("Invalid chanrange, cannot be negative") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if ((chanrange[0] != 0 or chanrange[1] != 0 or chanrangePercent != None) and build 18-Sep-2019 23:19:12 + (plotrange[0] != 0 or plotrange[1] != 0 or plotrange[2] != 0 or plotrange[3] != 0)): build 18-Sep-2019 23:19:12 + print("If chanrange is specified, then plotrange must be all zeros.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (pwv==''): build 18-Sep-2019 23:19:12 + pwv = 1.0 build 18-Sep-2019 23:19:12 + if (type(poln) != list): build 18-Sep-2019 23:19:12 + poln = poln.upper() build 18-Sep-2019 23:19:12 + if (poln == 'X'): build 18-Sep-2019 23:19:12 + poln = 'XX' build 18-Sep-2019 23:19:12 + if (poln == 'Y'): build 18-Sep-2019 23:19:12 + poln = 'YY' build 18-Sep-2019 23:19:12 + if (poln == 'X,Y' or poln=='Y,X'): build 18-Sep-2019 23:19:12 + poln = 'XX,YY' build 18-Sep-2019 23:19:12 + if (poln == 'R'): build 18-Sep-2019 23:19:12 + poln = 'RR' build 18-Sep-2019 23:19:12 + if (poln == 'L'): build 18-Sep-2019 23:19:12 + poln = 'LL' build 18-Sep-2019 23:19:12 + if (poln == 'R,L' or poln=='L,R'): build 18-Sep-2019 23:19:12 + poln = 'RR,LL' build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Parse the polarizations to plot from the command line build 18-Sep-2019 23:19:12 + # Prior to opening the .ms (later), we cannot tell which products are actually present build 18-Sep-2019 23:19:12 + useAllPols = False build 18-Sep-2019 23:19:12 + if (poln == ''): build 18-Sep-2019 23:19:12 + useAllPols = True build 18-Sep-2019 23:19:12 + polsToPlot = ['XX','YY'] # assume ALMA initially build 18-Sep-2019 23:19:12 + elif (type(poln) == list): build 18-Sep-2019 23:19:12 + polsToPlot = poln build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if ((poln in ['','RR','RL','LR','LL','XX','XY','YX','YY','RR,LL','XX,YY']) == False): build 18-Sep-2019 23:19:12 + print("Unrecognized polarization option = %s" % (poln)) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (poln.find(',')>0): build 18-Sep-2019 23:19:12 + polsToPlot = poln.split(',') build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + polsToPlot = [poln] build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if ((overlay in ['antenna', 'spw', 'time', 'baseband', '', build 18-Sep-2019 23:19:12 + 'antenna,time', 'time,antenna']) == False): build 18-Sep-2019 23:19:12 + print("Unrecognized option for overlay: only 'antenna', 'spw', 'baseband', 'time' and 'antenna,time' are supported.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + allowedFrames = [11,21,31,41,51,61,71,81,22,32,42] # [11,22,32,42] build 18-Sep-2019 23:19:12 + if (int(subplot) > 100): build 18-Sep-2019 23:19:12 + # This will accept 111, 221, 321, 421, etc. build 18-Sep-2019 23:19:12 + subplot /= 10 build 18-Sep-2019 23:19:12 + if ((int(subplot) in allowedFrames)==False): build 18-Sep-2019 23:19:12 + print("Subplot choice (rows x columns) must be one of %s" % (str(allowedFrames))) build 18-Sep-2019 23:19:12 + print("(with an optional trailing digit that is ignored).") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if ((int(subplot) % 2) == 1): build 18-Sep-2019 23:19:12 + timeHorizontalSpacing = 0.06*1.3 # *1.3 is for HH:MM:SS (timeFormat=3 in drawOverlayTimeLegends) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + timeHorizontalSpacing = 0.05*1.3 # *1.3 is for HH:MM:SS build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (yaxis.find('both')<0 and yaxis.find('ap')<0 and yaxis.find('tsys')<0 and build 18-Sep-2019 23:19:12 + yaxis.find('amp')<0 and yaxis.find('phase')<0): build 18-Sep-2019 23:19:12 + print("Invalid yaxis. Must be 'amp', 'tsys', 'phase' or 'both'.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (yaxis.find('tsys')>=0): build 18-Sep-2019 23:19:12 + yaxis = 'amp' build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (xaxis.find('chan')<0 and xaxis.find('freq')<0): build 18-Sep-2019 23:19:12 + print("Invalid xaxis. Must be 'chan' or 'freq'.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (showatm and showtsky): build 18-Sep-2019 23:19:12 + print("showatm=True and showtsky=True are mutually exclusive options") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (showfdm and xaxis.find('freq')<0): build 18-Sep-2019 23:19:12 + print("The option showfdm=True requires xaxis='freq'.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Plotting settings build 18-Sep-2019 23:19:12 + minPhaseRange = 0.2 build 18-Sep-2019 23:19:12 + plotfiles = [] build 18-Sep-2019 23:19:12 + if (int(subplot) % 2 == 1): build 18-Sep-2019 23:19:12 + mysize = '10' build 18-Sep-2019 23:19:12 + titlesize = 10 build 18-Sep-2019 23:19:12 + elif (int(subplot) == 22 or int(subplot) == 32): build 18-Sep-2019 23:19:12 + mysize = '8' build 18-Sep-2019 23:19:12 + titlesize = 8 build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + mysize = '7' build 18-Sep-2019 23:19:12 + titlesize = 8 build 18-Sep-2019 23:19:12 + maxCharsBeforeReducingTitleFontSize = 72 build 18-Sep-2019 23:19:12 + if (type(subplot) == str): build 18-Sep-2019 23:19:12 + subplot = int(subplot) build 18-Sep-2019 23:19:12 + if (subplot in allowedFrames == False): build 18-Sep-2019 23:19:12 + print("Invalid subplot = %d. Valid options are: %s" % (subplot,str(allowedFrames))) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + xframeStart = int(subplot)*10 # i.e. 110 or 220 or 420 build 18-Sep-2019 23:19:12 + firstFrame = xframeStart + 1 build 18-Sep-2019 23:19:12 + lastFrame = xframeStart + (subplot/10)*(subplot%10) build 18-Sep-2019 23:19:12 + bottomRowFrames = [111,212,313,414,515,616,717,818,223,224,325,326,427,428] # try to make this more general build 18-Sep-2019 23:19:12 + leftColumnFrames = [111,211,212,311,312,313,411,412,413,414,511,512,513,514,515,611,612,613,614,615,616, build 18-Sep-2019 23:19:12 + 711,712,713,714,715,716,717,811,812,813,814,815,816,817,818,221,223,321,323,325,421,423,425,427] build 18-Sep-2019 23:19:12 + rightColumnFrames = [111,211,212,311,312,313,411,412,413,414,511,512,513,514,515,611,612,613,614,615,616, build 18-Sep-2019 23:19:12 + 711,712,713,714,715,716,717,811,812,813,814,815,816,817,818,222,224,322,324,326,422,424,426,428] build 18-Sep-2019 23:19:12 + subplotCols = subplot % 10 build 18-Sep-2019 23:19:12 + subplotRows = subplot/10 build 18-Sep-2019 23:19:12 + ystartPolLabel = 1.0-0.04*subplotRows build 18-Sep-2019 23:19:12 + ystartMadLabel = 0.04*subplotRows build 18-Sep-2019 23:19:12 + if (subplotCols == 1): build 18-Sep-2019 23:19:12 + fstringLimit = 40 # character length of multi-field overlay title string build 18-Sep-2019 23:19:12 + elif (subplotCols == 2): build 18-Sep-2019 23:19:12 + fstringLimit = 12 # character length of multi-field overlay title string build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + xframe = xframeStart build 18-Sep-2019 23:19:12 + previousSubplot = xframe build 18-Sep-2019 23:19:12 + xcolor = 'b' build 18-Sep-2019 23:19:12 + ycolor = 'g' build 18-Sep-2019 23:19:12 + pcolor = ['b','g'] build 18-Sep-2019 23:19:12 + x2color = 'k' build 18-Sep-2019 23:19:12 + y2color = 'c' build 18-Sep-2019 23:19:12 + p2color = ['k','c'] build 18-Sep-2019 23:19:12 + x3color = 'm' build 18-Sep-2019 23:19:12 + y3color = 'r' build 18-Sep-2019 23:19:12 + p3color = ['m','r'] build 18-Sep-2019 23:19:12 + if (showpoints == 'auto'): build 18-Sep-2019 23:19:12 + if (showlines == 'auto'): build 18-Sep-2019 23:19:12 + ampmarkstyle = '-' build 18-Sep-2019 23:19:12 + phasemarkstyle = '.' build 18-Sep-2019 23:19:12 + if (len(polsToPlot) == 1): build 18-Sep-2019 23:19:12 + ampmarkstyle2 = '-' build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + ampmarkstyle2 = '--' build 18-Sep-2019 23:19:12 + phasemarkstyle2 = 'o' build 18-Sep-2019 23:19:12 + elif (showlines == False): build 18-Sep-2019 23:19:12 + ampmarkstyle = '.' build 18-Sep-2019 23:19:12 + ampmarkstyle2 = 'o' build 18-Sep-2019 23:19:12 + phasemarkstyle = '.' build 18-Sep-2019 23:19:12 + phasemarkstyle2 = 'o' build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + ampmarkstyle = '-' build 18-Sep-2019 23:19:12 + phasemarkstyle = '-' build 18-Sep-2019 23:19:12 + if (len(polsToPlot) == 1): build 18-Sep-2019 23:19:12 + ampmarkstyle2 = '-' build 18-Sep-2019 23:19:12 + phasemarkstyle2 = '-' build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + ampmarkstyle2 = '--' build 18-Sep-2019 23:19:12 + phasemarkstyle2 = '--' build 18-Sep-2019 23:19:12 + elif (showpoints == True): build 18-Sep-2019 23:19:12 + if (showlines == 'auto'): build 18-Sep-2019 23:19:12 + ampmarkstyle = '.-' build 18-Sep-2019 23:19:12 + phasemarkstyle = '.' build 18-Sep-2019 23:19:12 + if (len(polsToPlot) == 1): build 18-Sep-2019 23:19:12 + ampmarkstyle2 = 'o-' build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + ampmarkstyle2 = 'o--' build 18-Sep-2019 23:19:12 + phasemarkstyle2 = 'o' build 18-Sep-2019 23:19:12 + elif (showlines == False): build 18-Sep-2019 23:19:12 + ampmarkstyle = '.' build 18-Sep-2019 23:19:12 + ampmarkstyle2 = 'o' build 18-Sep-2019 23:19:12 + phasemarkstyle = '.' build 18-Sep-2019 23:19:12 + phasemarkstyle2 = 'o' build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + ampmarkstyle = '.-' build 18-Sep-2019 23:19:12 + phasemarkstyle = '.-' build 18-Sep-2019 23:19:12 + if (len(polsToPlot) == 1): build 18-Sep-2019 23:19:12 + ampmarkstyle2 = 'o-' build 18-Sep-2019 23:19:12 + phasemarkstyle2 = 'o-' build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + ampmarkstyle2 = 'o--' build 18-Sep-2019 23:19:12 + phasemarkstyle2 = 'o--' build 18-Sep-2019 23:19:12 + else: # showpoints == False build 18-Sep-2019 23:19:12 + if (showlines == False): build 18-Sep-2019 23:19:12 + print('You must have either showpoints or showlines set True or auto, assuming showlines=T') build 18-Sep-2019 23:19:12 + ampmarkstyle = '-' build 18-Sep-2019 23:19:12 + phasemarkstyle = '-' build 18-Sep-2019 23:19:12 + if (len(polsToPlot) == 1): build 18-Sep-2019 23:19:12 + ampmarkstyle2 = '-' build 18-Sep-2019 23:19:12 + phasemarkstyle2 = '-' build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + ampmarkstyle2 = '--' build 18-Sep-2019 23:19:12 + phasemarkstyle2 = '--' build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + ampmarkstyles = [ampmarkstyle,ampmarkstyle2] build 18-Sep-2019 23:19:12 + phasemarkstyles = [phasemarkstyle,phasemarkstyle2] build 18-Sep-2019 23:19:12 + # bpoly solutions should always be shown as lines, not dots or dots+lines build 18-Sep-2019 23:19:12 + bpolymarkstyle = '-' build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + amplitudeWithPhase = (yaxis.find('both')>=0 or yaxis.find('ap')>=0) build 18-Sep-2019 23:19:12 + if (amplitudeWithPhase): build 18-Sep-2019 23:19:12 + myhspace = 0.30 build 18-Sep-2019 23:19:12 + if (overlay.find('antenna')>=0 or overlay.find('time')>=0 or overlay.find('spw')>=0): build 18-Sep-2019 23:19:12 + print("Option 'overlay' is incompatible with yaxis='both'. Pick either amp or phase.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + myhspace = 0.30 build 18-Sep-2019 23:19:12 + if (subplot/10 > 2): build 18-Sep-2019 23:19:12 + myhspace = 0.4 build 18-Sep-2019 23:19:12 + if (subplot/10 > 3): build 18-Sep-2019 23:19:12 + myhspace = 0.6 build 18-Sep-2019 23:19:12 + mywspace = 0.25 build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Now open the Bandpass solution table build 18-Sep-2019 23:19:12 + if (len(caltable) < 1): build 18-Sep-2019 23:19:12 + print("You need to specify a caltable.") build 18-Sep-2019 23:19:12 + return(vm) build 18-Sep-2019 23:19:12 + if (caltable[-1] == '/'): build 18-Sep-2019 23:19:12 + print("Stripping off the trailing '/' from the caltable name.") build 18-Sep-2019 23:19:12 + caltable = caltable[:-1] build 18-Sep-2019 23:19:12 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + if (DEBUG): print("Trying to open: %s." % (caltable)) build 18-Sep-2019 23:19:12 + mytb.open(caltable) build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("Could not open the caltable = %s" % (caltable)) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (caltable[0] != '/'): build 18-Sep-2019 23:19:12 + # print(this so when someone sends me a bug report I can find their data!) build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + print("caltable = %s:%s/%s" % (os.uname()[1], os.getcwd(), caltable)) build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("caltable = localhost:%s/%s" % (os.getcwd(), caltable)) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + print("caltable = %s:%s" % (os.uname()[1], caltable)) build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("caltable = localhost:%s" % (caltable)) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (len(caltable) > 90): build 18-Sep-2019 23:19:12 + caltableTitle = '...' + caltable[-90:] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + caltableTitle = caltable build 18-Sep-2019 23:19:12 + names = mytb.colnames() build 18-Sep-2019 23:19:12 + ant = mytb.getcol('ANTENNA1') build 18-Sep-2019 23:19:12 + fields = mytb.getcol('FIELD_ID') build 18-Sep-2019 23:19:12 + if (DEBUG): build 18-Sep-2019 23:19:12 + print("FIELD_ID column = %s" % (str(fields))) build 18-Sep-2019 23:19:12 + validFields = False build 18-Sep-2019 23:19:12 + for f in fields: build 18-Sep-2019 23:19:12 + if (f != -1): build 18-Sep-2019 23:19:12 + validFields = True build 18-Sep-2019 23:19:12 + if (validFields == False): build 18-Sep-2019 23:19:12 + print("The field_id is -1 (invalid) for all rows of this caltable.") build 18-Sep-2019 23:19:12 + print("Did you remember to run assignFieldAndScanToSolution()?") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + flags = {} build 18-Sep-2019 23:19:12 + for f in range(len(fields)): build 18-Sep-2019 23:19:12 + flags[f] = mytb.getcell('FLAG',f) build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("No Flag column found. Are you sure this is a bandpass solution file, or is it the .ms?") build 18-Sep-2019 23:19:12 + print("If it is a solution file, does it contain solutions for both TDM and FDM spws?") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + times = mytb.getcol('TIME') build 18-Sep-2019 23:19:12 + intervals = mytb.getcol('INTERVAL') build 18-Sep-2019 23:19:12 + if ('SPECTRAL_WINDOW_ID' not in names): build 18-Sep-2019 23:19:12 + tableFormat = 33 build 18-Sep-2019 23:19:12 + cal_desc_id = mytb.getcol('CAL_DESC_ID') build 18-Sep-2019 23:19:12 + VisCal = (mytb.info())['subType'] build 18-Sep-2019 23:19:12 + if (VisCal == "BPOLY"): build 18-Sep-2019 23:19:12 + casalogPost(debug,"This appears to be a BPOLY cal table written in the casa 3.3/3.4 style.") build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + casalogPost(debug,"This appears to be an old-format cal table from casa 3.3 or earlier.") build 18-Sep-2019 23:19:12 + if (debug): print("VisCal = %s" % (VisCal)) build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + ParType = "unknown" # i.e. not Complex build 18-Sep-2019 23:19:12 + calDesc = mytb.open(caltable+'/CAL_DESC') build 18-Sep-2019 23:19:12 + originalSpws = mytb.getcol('SPECTRAL_WINDOW_ID') # [[0,1,2,3]] build 18-Sep-2019 23:19:12 + if debug: print("originalSpws = %s" % (str(originalSpws))) build 18-Sep-2019 23:19:12 + originalSpw = originalSpws[0] # [0,1,2,3] build 18-Sep-2019 23:19:12 + if debug: print("originalSpw = %s" % (str(originalSpw))) build 18-Sep-2019 23:19:12 + msName = mytb.getcol('MS_NAME')[0] build 18-Sep-2019 23:19:12 + if debug: print("msName in table = %s" % (msName)) build 18-Sep-2019 23:19:12 + if (vis != ''): build 18-Sep-2019 23:19:12 + msName = vis build 18-Sep-2019 23:19:12 + # This appears to be the channel range extracted from the original spw, but is build 18-Sep-2019 23:19:12 + # only present in B solutions. build 18-Sep-2019 23:19:12 + if (VisCal == "BPOLY"): build 18-Sep-2019 23:19:12 + originalChannelStart = np.zeros(len(originalSpw)) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + originalChannelRange = mytb.getcol('CHAN_RANGE') build 18-Sep-2019 23:19:12 + originalChannelStart = originalChannelRange[0][0][:][0] build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + mytb.open(msName+'/SPECTRAL_WINDOW') build 18-Sep-2019 23:19:12 + refFreq = mytb.getcol('REF_FREQUENCY') build 18-Sep-2019 23:19:12 + net_sideband = mytb.getcol('NET_SIDEBAND') build 18-Sep-2019 23:19:12 + measFreqRef = mytb.getcol('MEAS_FREQ_REF') build 18-Sep-2019 23:19:12 + originalSpw_casa33 = range(len(measFreqRef)) build 18-Sep-2019 23:19:12 + chanFreqGHz_casa33 = [] # used by showFDM build 18-Sep-2019 23:19:12 + for i in originalSpw_casa33: build 18-Sep-2019 23:19:12 + # They array shapes can vary. build 18-Sep-2019 23:19:12 + chanFreqGHz_casa33.append(1e-9 * mytb.getcell('CHAN_FREQ',i)) build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("2) Could not open the associated measurement set tables (%s). Will not translate antenna names." % (msName)) build 18-Sep-2019 23:19:12 + else: # 3.4 build 18-Sep-2019 23:19:12 + tableFormat = 34 build 18-Sep-2019 23:19:12 + cal_desc_id = mytb.getcol('SPECTRAL_WINDOW_ID') build 18-Sep-2019 23:19:12 + cal_scans = mytb.getcol('SCAN_NUMBER') build 18-Sep-2019 23:19:12 + unique_cal_scans = np.unique(cal_scans) build 18-Sep-2019 23:19:12 + cal_scans_per_spw = {} build 18-Sep-2019 23:19:12 + for myspw in np.unique(cal_desc_id): build 18-Sep-2019 23:19:12 + cal_scans_per_spw[myspw] = np.unique(cal_scans[np.where(myspw == cal_desc_id)[0]]) build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("spw %d: scans %s" % (myspw,str(cal_scans_per_spw[myspw]))) build 18-Sep-2019 23:19:12 + ParType = mytb.getkeyword('ParType') # string = 'Complex' build 18-Sep-2019 23:19:12 + msName = mytb.getkeyword('MSName') build 18-Sep-2019 23:19:12 + VisCal = mytb.getkeyword('VisCal') # string = 'B TSYS' build 18-Sep-2019 23:19:12 + PolBasis = mytb.getkeyword('PolBasis') # string = 'LINEAR' build 18-Sep-2019 23:19:12 + spectralWindowTable = mytb.getkeyword('SPECTRAL_WINDOW').split()[1] build 18-Sep-2019 23:19:12 + antennaTable = mytb.getkeyword('ANTENNA').split()[1] build 18-Sep-2019 23:19:12 + fieldTable = mytb.getkeyword('FIELD').split()[1] build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + mytb.open(spectralWindowTable) build 18-Sep-2019 23:19:12 + chanFreqGHz = [] build 18-Sep-2019 23:19:12 + originalSpws = range(len(mytb.getcol('MEAS_FREQ_REF'))) build 18-Sep-2019 23:19:12 + originalSpw = originalSpws # may need to do a global replace of this build 18-Sep-2019 23:19:12 + originalSpwNames = mytb.getcol('NAME') build 18-Sep-2019 23:19:12 + for i in originalSpws: build 18-Sep-2019 23:19:12 + # They array shapes can vary. build 18-Sep-2019 23:19:12 + chanFreqGHz.append(1e-9 * mytb.getcell('CHAN_FREQ',i)) build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + # CAS-6801 changes build 18-Sep-2019 23:19:12 + mytb.open(antennaTable) build 18-Sep-2019 23:19:12 + msAnt = mytb.getcol('NAME') build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + mytb.open(fieldTable) build 18-Sep-2019 23:19:12 + msFields = mytb.getcol('NAME') build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Now open the associated ms tables via msmd tool build 18-Sep-2019 23:19:12 +# msAnt = [] # comment this out when CAS-6801 changes are in place build 18-Sep-2019 23:19:12 + if (debug): print( "creating msmd tool") build 18-Sep-2019 23:19:12 + if (cu.compare_version('<',[4,1,0])): build 18-Sep-2019 23:19:12 + print("This version of casa is too old to use the msmd tool. Use au.plotbandpass instead.") build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + mymsmd = '' build 18-Sep-2019 23:19:12 + observatoryName = '' build 18-Sep-2019 23:19:12 + if (debug): print( "msName = %s." % (msName)) build 18-Sep-2019 23:19:12 + if (os.path.exists(msName) or os.path.exists(os.path.dirname(caltable)+'/'+msName)): build 18-Sep-2019 23:19:12 + if (os.path.exists(msName) == False): build 18-Sep-2019 23:19:12 + msName = os.path.dirname(caltable)+'/'+msName build 18-Sep-2019 23:19:12 + if (debug): print( "found msName = %s." % (msName)) build 18-Sep-2019 23:19:12 + if (cu.compare_version('<',[4,1,0])): build 18-Sep-2019 23:19:12 + print("This version of casa is too old to use the msmd tool. Use au.plotbandpass instead.") build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + if (debug): print("Running mymsmd on %s..." % (msName)) build 18-Sep-2019 23:19:12 + mymsmd = createCasaTool(msmdtool) build 18-Sep-2019 23:19:12 + mymsmd.open(msName) # this is the only open (vis not specified, but it exists) build 18-Sep-2019 23:19:12 + donetime = timeUtilities.time() build 18-Sep-2019 23:19:12 + if (debug): print("%.1f sec elapsed" % (donetime-mytimestamp)) build 18-Sep-2019 23:19:12 + mytimestamp = timeUtilities.time() build 18-Sep-2019 23:19:12 + if (debug): print("time = %s" % (str(mytimestamp))) build 18-Sep-2019 23:19:12 + msAnt = mymsmd.antennanames(range(mymsmd.nantennas())) build 18-Sep-2019 23:19:12 + if (debug): print("msAnt = %s" % (str(msAnt))) build 18-Sep-2019 23:19:12 +# msFields = mymsmd.namesforfields(range(mymsmd.nfields())) # bombs if split has been run on subset of fields build 18-Sep-2019 23:19:12 + msFields = mymsmd.namesforfields() build 18-Sep-2019 23:19:12 + observatoryName = mymsmd.observatorynames()[0] build 18-Sep-2019 23:19:12 + casalogPost(debug,"Available antennas = %s" % (str(msAnt))) build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("1)Could not open the associated measurement set tables (%s). Will not translate antenna names or frequencies." % (msName)) build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (vis=='' and tableFormat < 34): build 18-Sep-2019 23:19:12 + print("Could not find the associated measurement set (%s). Will not translate antenna names or frequencies." % (msName)) build 18-Sep-2019 23:19:12 + elif (vis != ''): build 18-Sep-2019 23:19:12 + # Use the ms name passed in from the command line build 18-Sep-2019 23:19:12 + msName = vis build 18-Sep-2019 23:19:12 +# # print("************* 2) Set msName to %s" % (msName)) build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + mymsmd = createCasaTool(msmdtool) build 18-Sep-2019 23:19:12 + if (debug): print("Running msmd.open on %s" % (msName)) build 18-Sep-2019 23:19:12 + mymsmd.open(msName) # this is the only open (vis specified) build 18-Sep-2019 23:19:12 + donetime = timeUtilities.time() build 18-Sep-2019 23:19:12 + if (debug): print("%.1f sec elapsed" % (donetime-mytimestamp)) build 18-Sep-2019 23:19:12 + mytimestamp = timeUtilities.time() build 18-Sep-2019 23:19:12 + msAnt = mymsmd.antennanames(range(mymsmd.nantennas())) build 18-Sep-2019 23:19:12 +# msFields = mymsmd.namesforfields(range(mymsmd.nfields())) # bombs if split has been run on subset of fields build 18-Sep-2019 23:19:12 + msFields = mymsmd.namesforfields() build 18-Sep-2019 23:19:12 + observatoryName = mymsmd.observatorynames()[0] build 18-Sep-2019 23:19:12 + casalogPost(debug,"Available antennas = %s" % (str(msAnt))) build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("1b) Could not open the associated measurement set tables (%s). Will not translate antenna names or channels to frequencies." % (msName)) build 18-Sep-2019 23:19:12 + msFound = False build 18-Sep-2019 23:19:12 + if (len(msAnt) > 0): build 18-Sep-2019 23:19:12 + msFound = True build 18-Sep-2019 23:19:12 + casalogPost(debug,"Fields in ms = %s" % (str(msFields))) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + msFields = [] build 18-Sep-2019 23:19:12 + if (tableFormat == 33 and msFound): # casa 3.3 build 18-Sep-2019 23:19:12 + # Now open the associated ms tables via ValueMapping to figure out channel freqs build 18-Sep-2019 23:19:12 + chanFreqGHz = [] build 18-Sep-2019 23:19:12 + for ictr in range(len(originalSpw)): build 18-Sep-2019 23:19:12 + if debug: print("ictr = %d" % (ictr)) build 18-Sep-2019 23:19:12 + if debug: print("nspw = %d, np.max(originalSpw) = %d" % (getnspw(mymsmd),np.max(originalSpw))) build 18-Sep-2019 23:19:12 + if (getnspw(mymsmd) < np.max(originalSpw)): # waiting on CAS-4285 build 18-Sep-2019 23:19:12 + # Then there was an extra split build 18-Sep-2019 23:19:12 + i = ictr build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + i = originalSpw[ictr] build 18-Sep-2019 23:19:12 + nchan = mymsmd.nchan(i) build 18-Sep-2019 23:19:12 + if (nchan > 1): build 18-Sep-2019 23:19:12 + missingFrequencyWidth = originalChannelStart[ictr]*(mymsmd.chanfreqs(i)[-1]-mymsmd.chanfreqs(i)[0])/(nchan-1) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + missingFrequencyWidth = 0 build 18-Sep-2019 23:19:12 + if (missingFrequencyWidth > 0): build 18-Sep-2019 23:19:12 + if (DEBUG): build 18-Sep-2019 23:19:12 + print("Correcting for channels flagged prior to running bandpass by %f GHz" % (missingFrequencyWidth*1e-9)) build 18-Sep-2019 23:19:12 + newfreqs = 1e-9*(mymsmd.chanfreqs(i)) + missingFrequencyWidth*1e-9 build 18-Sep-2019 23:19:12 + if debug: print("Appending onto chanFreqGHz: %s" % (str(newfreqs))) build 18-Sep-2019 23:19:12 + chanFreqGHz.append(newfreqs) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + uniqueSpwsInCalTable = np.unique(cal_desc_id) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # initial calculation for final message if not all spws appear with overlay='antenna' build 18-Sep-2019 23:19:12 + uniqueTimes = sloppyUnique(np.unique(times), 1.0) build 18-Sep-2019 23:19:12 + nUniqueTimes = len(uniqueTimes) build 18-Sep-2019 23:19:12 + if (nUniqueTimes == 1): build 18-Sep-2019 23:19:12 + solutionTimeSpread = 0 build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + solutionTimeSpread = np.max(uniqueTimes)-np.min(uniqueTimes) build 18-Sep-2019 23:19:12 + casalogPost(debug,"Found solutions with %d unique times (within a threshold of 1.0 second)." % (nUniqueTimes)) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + uniqueTimes = sloppyUnique(np.unique(times), solutionTimeThresholdSeconds) build 18-Sep-2019 23:19:12 + nUniqueTimes = len(uniqueTimes) build 18-Sep-2019 23:19:12 + if (nUniqueTimes == 1): build 18-Sep-2019 23:19:12 + casalogPost(debug,"Found solutions with %d unique time (within a threshold of %d seconds)." % (nUniqueTimes,solutionTimeThresholdSeconds)) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + casalogPost(debug,"Found solutions with %d unique times (within a threshold of %d seconds)." % (nUniqueTimes,solutionTimeThresholdSeconds)) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + scansForUniqueTimes = [] build 18-Sep-2019 23:19:12 + if (tableFormat >= 34): build 18-Sep-2019 23:19:12 + if (len(unique_cal_scans) == 1): build 18-Sep-2019 23:19:12 + casalogPost(debug,"Found solutions with %d unique scan number %s" % (len(unique_cal_scans), str(unique_cal_scans))) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + casalogPost(debug,"Found solutions with %d unique scan numbers %s" % (len(unique_cal_scans), str(unique_cal_scans))) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + scansForUniqueTimes, nUniqueTimes = computeScansForUniqueTimes(uniqueTimes, cal_scans, times, unique_cal_scans) build 18-Sep-2019 23:19:12 + elif (scans != ''): build 18-Sep-2019 23:19:12 + print("Selection by scan is not support for old-style tables that do not have the scan number filled.") build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + uniqueTimesCopy = uniqueTimes[:] build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + mystring = '' build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + for u in uniqueTimes: build 18-Sep-2019 23:19:12 + mystring += '%.6f, ' % (u) build 18-Sep-2019 23:19:12 + print(mystring) build 18-Sep-2019 23:19:12 + uniqueAntennaIds = np.unique(ant) build 18-Sep-2019 23:19:12 + uniqueFields = np.unique(fields) build 18-Sep-2019 23:19:12 + if (debug): print("uniqueFields = %s" % (str(uniqueFields))) build 18-Sep-2019 23:19:12 + nFields = len(uniqueFields) build 18-Sep-2019 23:19:12 + spwlist = [] build 18-Sep-2019 23:19:12 + uniqueTimesPerFieldPerSpw = [] build 18-Sep-2019 23:19:12 + for s in uniqueSpwsInCalTable: build 18-Sep-2019 23:19:12 + uniqueTimesPerField = [] build 18-Sep-2019 23:19:12 + for f in uniqueFields: build 18-Sep-2019 23:19:12 + timelist = [] build 18-Sep-2019 23:19:12 + for row in range(len(fields)): build 18-Sep-2019 23:19:12 + if (fields[row] == f and cal_desc_id[row] == s): build 18-Sep-2019 23:19:12 + if (sloppyMatch(times[row], timelist, solutionTimeThresholdSeconds) == False): build 18-Sep-2019 23:19:12 + timelist.append(times[row]) build 18-Sep-2019 23:19:12 + spwlist.append(cal_desc_id) build 18-Sep-2019 23:19:12 + uniqueTimesPerField.append(timelist) build 18-Sep-2019 23:19:12 + uniqueTimesPerFieldPerSpw.append(uniqueTimesPerField) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (debug): print("about to call casalogPost") build 18-Sep-2019 23:19:12 + casalogPost(debug,displayTimesArray([[uniqueTimes]])) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Parse the spws to plot from the command line build 18-Sep-2019 23:19:12 + if (spw==''): build 18-Sep-2019 23:19:12 + spwsToPlot = uniqueSpwsInCalTable build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (type(spw) == str): build 18-Sep-2019 23:19:12 + if (spw.find('!')>=0): build 18-Sep-2019 23:19:12 + print("The ! modifier is not (yet) supported") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + tokens = spw.split(',') build 18-Sep-2019 23:19:12 + spwsToPlot = [] build 18-Sep-2019 23:19:12 + for token in tokens: build 18-Sep-2019 23:19:12 + if (len(token) > 0): build 18-Sep-2019 23:19:12 + if (token.find('*')>=0): build 18-Sep-2019 23:19:12 + spwsToPlot = uniqueSpwsInCalTable build 18-Sep-2019 23:19:12 + break build 18-Sep-2019 23:19:12 + elif (token.find('~')>0): build 18-Sep-2019 23:19:12 + (start,finish) = token.split('~') build 18-Sep-2019 23:19:12 + spwsToPlot += range(int(start),int(finish)+1) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + spwsToPlot.append(int(token)) build 18-Sep-2019 23:19:12 + elif (type(spw) == list): build 18-Sep-2019 23:19:12 + spwsToPlot = np.sort(spw) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + spwsToPlot = [spw] build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + casalogPost(debug,"%d spw%s in the solution = %s" % (len(uniqueSpwsInCalTable), plural(uniqueSpwsInCalTable), str(uniqueSpwsInCalTable))) build 18-Sep-2019 23:19:12 + keepSpwsToPlot = spwsToPlot[:] build 18-Sep-2019 23:19:12 + for myspw in spwsToPlot: build 18-Sep-2019 23:19:12 + if (myspw not in uniqueSpwsInCalTable): build 18-Sep-2019 23:19:12 + print("WARNING: spw %d is not in the solution. Removing it from the list to plot." % (myspw)) build 18-Sep-2019 23:19:12 + print("Available spws = ", uniqueSpwsInCalTable) build 18-Sep-2019 23:19:12 + keepSpwsToPlot.remove(myspw) build 18-Sep-2019 23:19:12 + if (cu.compare_version('>=',[4,1,0]) and mymsmd != ''): build 18-Sep-2019 23:19:12 +# # nonwvrspws = list(set(range(mymsmd.nspw())).difference(set(mymsmd.wvrspws()))) build 18-Sep-2019 23:19:12 + if (myspw not in range(mymsmd.nspw())): build 18-Sep-2019 23:19:12 + print("FATAL: spw %d is not even in the ms. There might be a bug in your script." % (myspw)) build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + elif (myspw in mymsmd.wvrspws()): build 18-Sep-2019 23:19:12 + print("WARNING: spw %d is a WVR spw." % (myspw)) build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + spwsToPlot = keepSpwsToPlot[:] build 18-Sep-2019 23:19:12 + if (spwsToPlot == []): build 18-Sep-2019 23:19:12 + print("FATAL: no spws to plot") build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + originalSpwsToPlot = computeOriginalSpwsToPlot(spwsToPlot, originalSpw, tableFormat, debug) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Now generate the list of minimal basebands that contain the spws to be plotted build 18-Sep-2019 23:19:12 + if (cu.compare_version('>=',[4,1,0]) and msFound): build 18-Sep-2019 23:19:12 + allBasebands = [] build 18-Sep-2019 23:19:12 + if (mymsmd != ''): build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + for spw in originalSpwsToPlot: build 18-Sep-2019 23:19:12 + mybaseband = mymsmd.baseband(spw) build 18-Sep-2019 23:19:12 + if (debug): print("appending: spw=%d -> bb=%d" % (spw,mybaseband)) build 18-Sep-2019 23:19:12 + allBasebands.append(mybaseband) build 18-Sep-2019 23:19:12 + allBasebands = np.unique(allBasebands) build 18-Sep-2019 23:19:12 + basebandDict = getBasebandDict(msName,caltable=caltable,mymsmd=mymsmd) # needed later by showFDM() build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + basebandDict = {} build 18-Sep-2019 23:19:12 + print("This dataset (%s) does not have a BBC_NO column in the SPECTRAL_WINDOW_TABLE." % (msName)) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + basebandDict = {} build 18-Sep-2019 23:19:12 + telescopeName = getTelescopeNameFromCaltable(caltable) build 18-Sep-2019 23:19:12 + print("Measurement set not found.") build 18-Sep-2019 23:19:12 + if (basebandDict == {}): build 18-Sep-2019 23:19:12 + if (overlay.find('spw') >= 0): build 18-Sep-2019 23:19:12 + print("As such, since the ms cannot be found, overlay='spw' is not supported, but overlay='baseband' should work.") build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + elif (showfdm): build 18-Sep-2019 23:19:12 + print("As such, since the ms cannot be found, showfdm=True is not supported.") build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + elif (showBasebandNumber): build 18-Sep-2019 23:19:12 + print("As such, since the ms cannot be found, showBasebandNumber=True is not supported.") build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + elif (msFound==False): build 18-Sep-2019 23:19:12 + allBasebands = [1,2,3,4] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + basebandDict = getBasebandDict(msName,caltable=caltable,mymsmd=mymsmd) # needed later by showFDM() build 18-Sep-2019 23:19:12 + allBasebands = [] build 18-Sep-2019 23:19:12 + for spw in originalSpwsToPlot: build 18-Sep-2019 23:19:12 + mybaseband = [key for key in basebandDict if spw in basebandDict[key]] build 18-Sep-2019 23:19:12 + if (len(mybaseband)>0): allBasebands.append(mybaseband[0]) build 18-Sep-2019 23:19:12 + allBasebands = np.unique(allBasebands) build 18-Sep-2019 23:19:12 + if (allBasebands == []): build 18-Sep-2019 23:19:12 + allBasebands = [1,2,3,4] build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("================ allBasebands = ", allBasebands) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (basebands == None or basebands == [] or basebands == ''): build 18-Sep-2019 23:19:12 + basebands = allBasebands build 18-Sep-2019 23:19:12 + elif (type(basebands) == str): build 18-Sep-2019 23:19:12 + basebands = [int(s) for s in basebands.split(',')] build 18-Sep-2019 23:19:12 + elif (type(basebands) != list): build 18-Sep-2019 23:19:12 + # it is a single integer build 18-Sep-2019 23:19:12 + basebands = [basebands] build 18-Sep-2019 23:19:12 + for baseband in basebands: build 18-Sep-2019 23:19:12 + if (baseband not in allBasebands): build 18-Sep-2019 23:19:12 + print("Baseband %d is not in the dataset (only %s)" % (baseband,str(allBasebands))) build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (msFound): build 18-Sep-2019 23:19:12 + msFieldsList = str(np.array(msFields)[uniqueFields]) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + msFieldsList = 'unknown' build 18-Sep-2019 23:19:12 + casalogPost(debug,"%d field(s) in the solution = %s = %s" % (len(uniqueFields), uniqueFields,msFieldsList)) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Figure out which kind of Bandpass solution this is. build 18-Sep-2019 23:19:12 + bOverlay = False # Am I trying to overlay a second B-type solution? build 18-Sep-2019 23:19:12 + if (os.path.exists(caltable) == False): build 18-Sep-2019 23:19:12 + print("Caltable does not exist = %s" % (caltable)) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + ([polyMode, polyType, nPolyAmp, nPolyPhase, scaleFactor, nRows, nSpws, nUniqueTimesBP, uniqueTimesBP, build 18-Sep-2019 23:19:12 +# # nPolarizations, build 18-Sep-2019 23:19:12 + frequencyLimits, increments, frequenciesGHz, polynomialPhase, build 18-Sep-2019 23:19:12 + polynomialAmplitude, timesBP, antennasBP, cal_desc_idBP, spwBP]) = openBpolyFile(caltable,debug) build 18-Sep-2019 23:19:12 + bpoly = True build 18-Sep-2019 23:19:12 + bpolyOverlay = bpolyOverlay2 = False build 18-Sep-2019 23:19:12 + if (xaxis.find('chan') >= 0): build 18-Sep-2019 23:19:12 + print("Sorry, but BPOLY solutions cannot be plotted with xaxis='chan'. Proceeding with xaxis='freq'.") build 18-Sep-2019 23:19:12 + xaxis = 'freq' build 18-Sep-2019 23:19:12 + if (chanrange[0] != 0 or chanrange[1] != 0 or chanrangePercent != None): build 18-Sep-2019 23:19:12 + print("The chanrange parameter only applies if the first caltable is a B solution, not a BPOLY.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (len(caltable2) > 0): build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + # figure out if the next file is a BPOLY or another B solution to pick the proper error message. build 18-Sep-2019 23:19:12 + ([polyMode, polyType, nPolyAmp, nPolyPhase, scaleFactor, nRows, nSpws, nUniqueTimesBP, uniqueTimesBP, build 18-Sep-2019 23:19:12 +# # nPolarizations, build 18-Sep-2019 23:19:12 + frequencyLimits, increments, frequenciesGHz, polynomialPhase, build 18-Sep-2019 23:19:12 + polynomialAmplitude, timesBP, antennasBP, cal_desc_idBP, spwBP]) = openBpolyFile(caltable2,debug) build 18-Sep-2019 23:19:12 + print("Sorry, but you cannot overlay two BPOLY solutions (unless caltable is a B solution and caltable2 and 3 are BPOLYs).") build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("Sorry, but for overlays, caltable must be a B solution, whlie caltable2 and 3 can be either type.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + casalogPost(debug,"This is a %s solution." % (VisCal)) build 18-Sep-2019 23:19:12 + bpoly = bpolyOverlay = bpolyOverlay2 = False build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Now check if there is a second file to overlay build 18-Sep-2019 23:19:12 + if (len(caltable2) > 0): build 18-Sep-2019 23:19:12 + if (os.path.exists(caltable2) == False): build 18-Sep-2019 23:19:12 + print("Caltable2 does not exist = %s" % (caltable2)) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + # figure out if the next file is a BPOLY or another B solution build 18-Sep-2019 23:19:12 + ([polyMode, polyType, nPolyAmp, nPolyPhase, scaleFactor, nRows, nSpws, nUniqueTimesBP, uniqueTimesBP, build 18-Sep-2019 23:19:12 +# # nPolarizations, build 18-Sep-2019 23:19:12 + frequencyLimits, increments, frequenciesGHz, polynomialPhase, build 18-Sep-2019 23:19:12 + polynomialAmplitude, timesBP, antennasBP, cal_desc_idBP, spwBP]) = openBpolyFile(caltable2,debug) build 18-Sep-2019 23:19:12 + bpolyOverlay = True build 18-Sep-2019 23:19:12 + casalogPost(debug,"Overlay the BPOLY solution") build 18-Sep-2019 23:19:12 + if (xaxis.find('chan')>=0): build 18-Sep-2019 23:19:12 + print("Sorry, but overlap of BPOLY is currently possible only with xaxis='freq'") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (len(caltable3) > 0): build 18-Sep-2019 23:19:12 + if (os.path.exists(caltable3) == False): build 18-Sep-2019 23:19:12 + print("Caltable3 does not exist = %s" % (caltable3)) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + bpolyOverlay2 = True build 18-Sep-2019 23:19:12 + casalogPost(debug,"Overlay the second BPOLY solution") build 18-Sep-2019 23:19:12 + ([polyMode2, polyType2, nPolyAmp2, nPolyPhase2, scaleFactor2, nRows2, nSpws2, build 18-Sep-2019 23:19:12 + nUniqueTimesBP2, uniqueTimesBP2, build 18-Sep-2019 23:19:12 +# # nPolarizations2, build 18-Sep-2019 23:19:12 + frequencyLimits2, increments2, frequenciesGHz2, polynomialPhase2, build 18-Sep-2019 23:19:12 + polynomialAmplitude2, timesBP2, antennasBP2, cal_desc_idBP2, spwBP2]) = openBpolyFile(caltable3,debug) build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + # this is another B solution build 18-Sep-2019 23:19:12 + casalogPost(debug,"Overlay another %s solution" % (VisCal)) build 18-Sep-2019 23:19:12 + bOverlay = True build 18-Sep-2019 23:19:12 + if (xaxis.find('freq')<0): build 18-Sep-2019 23:19:12 + print("Currently, you must use xaxis='freq' to overlay two B solutions.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (len(caltable3) > 0): build 18-Sep-2019 23:19:12 + print("You cannot overlay caltable3 because caltable2 is a B solution.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + elif (len(caltable3) > 0): build 18-Sep-2019 23:19:12 + print("You cannot have a caltable3 argument without a caltable2 argument.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (overlay.find('antenna')>=0): build 18-Sep-2019 23:19:12 + overlayAntennas = True build 18-Sep-2019 23:19:12 + if (bpoly == True): build 18-Sep-2019 23:19:12 + print("The overlay of times or antennas is not supported with BPOLY solutions") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (len(caltable2)>0): build 18-Sep-2019 23:19:12 + print("The overlay of times or antennas not supported when overlaying a B or BPOLY solution") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + casalogPost(debug,"Will overlay solutions from different antennas") build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + overlayAntennas = False build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (overlay.find('time')>=0): build 18-Sep-2019 23:19:12 + overlayTimes = True build 18-Sep-2019 23:19:12 + if (bpoly == True): build 18-Sep-2019 23:19:12 + print("The overlay of times or antennas is not supported with BPOLY solutions") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (len(caltable2)>0): build 18-Sep-2019 23:19:12 + print("The overlay of times or antennas not supported when overlaying a B or BPOLY solution") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + casalogPost(debug,"Will overlay solutions from different times") build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + overlayTimes = False build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (overlay.find('spw')>=0): build 18-Sep-2019 23:19:12 + if (tableFormat < 34): build 18-Sep-2019 23:19:12 + print("Overlay spw may not work reliably for old cal tables") build 18-Sep-2019 23:19:12 + overlaySpws = True build 18-Sep-2019 23:19:12 + if (bpoly == True): build 18-Sep-2019 23:19:12 + print("The overlay of times, antennas, or spws is not supported with BPOLY solutions") build 18-Sep-2019 23:19:12 + return(vm) build 18-Sep-2019 23:19:12 + if (len(caltable2)>0): build 18-Sep-2019 23:19:12 + print("The overlay of times, antennas, or spws not supported when overlaying a B or BPOLY solution") build 18-Sep-2019 23:19:12 + return(vm) build 18-Sep-2019 23:19:12 + casalogPost(debug,"Will overlay solutions from different spws within a baseband") build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + overlaySpws = False build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (overlay.find('baseband')>=0): build 18-Sep-2019 23:19:12 + if (tableFormat < 34): build 18-Sep-2019 23:19:12 + print("Overlay baseband may not work reliably for old cal tables") build 18-Sep-2019 23:19:12 + overlayBasebands = True build 18-Sep-2019 23:19:12 + if (bpoly == True): build 18-Sep-2019 23:19:12 + print("The overlay of times, antennas, spws, or basebands is not supported with BPOLY solutions") build 18-Sep-2019 23:19:12 + return(vm) build 18-Sep-2019 23:19:12 + if (len(caltable2)>0): build 18-Sep-2019 23:19:12 + print("The overlay of times, antennas, spws, or basebands not supported when overlaying a B or BPOLY solution") build 18-Sep-2019 23:19:12 + return(vm) build 18-Sep-2019 23:19:12 + casalogPost(debug,"Will overlay solutions from all spws regardless of baseband") build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + overlayBasebands = False build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (bOverlay): build 18-Sep-2019 23:19:12 + # Now open the Bandpass solution table build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + mytb.open(caltable2) build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("Could not open the second caltable = %s" % (caltable2)) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + names = mytb.colnames() build 18-Sep-2019 23:19:12 + ant2 = mytb.getcol('ANTENNA1') build 18-Sep-2019 23:19:12 + fields2 = mytb.getcol('FIELD_ID') build 18-Sep-2019 23:19:12 + times2 = mytb.getcol('TIME') build 18-Sep-2019 23:19:12 + if ('SPECTRAL_WINDOW_ID' not in names): build 18-Sep-2019 23:19:12 + if ('SNR' not in names): build 18-Sep-2019 23:19:12 + print("This does not appear to be a cal table.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + tableFormat2 = 33 build 18-Sep-2019 23:19:12 + casalogPost(debug,"This appears to be an old-format cal table from casa 3.3 or earlier.") build 18-Sep-2019 23:19:12 + cal_desc_id2 = mytb.getcol('CAL_DESC_ID') build 18-Sep-2019 23:19:12 + VisCal2 = (mytb.info())['subType'] build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + ParType = "unknown" # i.e. not Complex build 18-Sep-2019 23:19:12 + calDesc2 = mytb.open(caltable2+'/CAL_DESC') build 18-Sep-2019 23:19:12 + originalSpws2 = mytb.getcol('SPECTRAL_WINDOW_ID') # [[0,1,2,3]] build 18-Sep-2019 23:19:12 + originalSpw2 = originalSpws2[0] # [0,1,2,3] build 18-Sep-2019 23:19:12 + msName2 = mytb.getcol('MS_NAME')[0] build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + # Now open the associated ms tables via ValueMapping to figure out channel freqs build 18-Sep-2019 23:19:12 + chanFreqGHz2 = [] build 18-Sep-2019 23:19:12 + for ictr in range(len(originalSpw2)): build 18-Sep-2019 23:19:12 + if debug: print("ictr = %d" % (ictr)) build 18-Sep-2019 23:19:12 + if debug: print("nspw = %d, np.max(originalSpw) = %d" % (getnspw(mymsmd),np.max(originalSpw2))) build 18-Sep-2019 23:19:12 + if (getnspw(mymsmd) < np.max(originalSpw2)): build 18-Sep-2019 23:19:12 + # Then there was an extra split build 18-Sep-2019 23:19:12 + i = ictr build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + i = originalSpw2[ictr] build 18-Sep-2019 23:19:12 + nchan = mymsmd.nchan(i) build 18-Sep-2019 23:19:12 + if (nchan > 1): build 18-Sep-2019 23:19:12 + missingFrequencyWidth = originalChannelStart[ictr]*(mymsmd.chanfreqs(i)[-1]-mymsmd.chanfreqs(i)[0])/(nchan-1) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + missingFrequencyWidth = 0 build 18-Sep-2019 23:19:12 + if (missingFrequencyWidth > 0): build 18-Sep-2019 23:19:12 + if (DEBUG): build 18-Sep-2019 23:19:12 + print("Correcting for channels flagged prior to running bandpass by %f GHz" % (missingFrequencyWidth*1e-9)) build 18-Sep-2019 23:19:12 + newfreqs = 1e-9*(mymsmd.chanfreqs(i)) + missingFrequencyWidth*1e-9 build 18-Sep-2019 23:19:12 + if debug: print("Appending onto chanFreqGHz2: %s" % (str(newfreqs))) build 18-Sep-2019 23:19:12 + chanFreqGHz2.append(newfreqs) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + tableFormat2 = 34 build 18-Sep-2019 23:19:12 + cal_desc_id2 = mytb.getcol('SPECTRAL_WINDOW_ID') build 18-Sep-2019 23:19:12 + msName2 = mytb.getkeyword('MSName') build 18-Sep-2019 23:19:12 + ParType2 = mytb.getkeyword('ParType') # string = 'Complex' build 18-Sep-2019 23:19:12 + VisCal2 = mytb.getkeyword('VisCal') # string = 'B TSYS' build 18-Sep-2019 23:19:12 + PolBasis2 = mytb.getkeyword('PolBasis') # string = 'LINEAR' build 18-Sep-2019 23:19:12 + spectralWindowTable2 = mytb.getkeyword('SPECTRAL_WINDOW').split()[1] build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + mytb.open(spectralWindowTable2) build 18-Sep-2019 23:19:12 + chanFreqGHz2 = [] build 18-Sep-2019 23:19:12 + originalSpws2 = range(len(mytb.getcol('MEAS_FREQ_REF'))) build 18-Sep-2019 23:19:12 + for i in originalSpws2: build 18-Sep-2019 23:19:12 + # The array shapes can vary. build 18-Sep-2019 23:19:12 + chanFreqGHz2.append(1e-9 * mytb.getcell('CHAN_FREQ',i)) build 18-Sep-2019 23:19:12 + originalSpws2 = range(len(mytb.getcol('MEAS_FREQ_REF'))) build 18-Sep-2019 23:19:12 + originalSpw2 = originalSpws2 # may want to do a global replace of this <---------------------------------- build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + uniqueSpwsInCalTable2 = np.unique(cal_desc_id2) build 18-Sep-2019 23:19:12 + mytb.open(caltable2) build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + flags2 = {} build 18-Sep-2019 23:19:12 + for f in range(len(fields2)): build 18-Sep-2019 23:19:12 + flags2[f] = mytb.getcell('FLAG',f) build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("bOverlay: No Flag column found. Are you sure this is a bandpass solution file, or is it the .ms?") build 18-Sep-2019 23:19:12 + print("If it is a solution file, does it contain solutions for both TDM and FDM spws?") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + uniqueTimes2 = sloppyUnique(np.unique(times2), solutionTimeThresholdSeconds) build 18-Sep-2019 23:19:12 + nUniqueTimes2 = len(uniqueTimes2) build 18-Sep-2019 23:19:12 +# # print("Found %d solutions in time: MJD seconds = " % (nUniqueTimes2), uniqueTimes2) build 18-Sep-2019 23:19:12 + spacing = '' build 18-Sep-2019 23:19:12 + for i in range(1,nUniqueTimes2): build 18-Sep-2019 23:19:12 + spacing += '%.0f, ' % (np.abs(uniqueTimes2[i]-uniqueTimes2[i-1])) build 18-Sep-2019 23:19:12 + casalogPost(debug,"Found %d solutions in time, spaced by seconds: %s" % (nUniqueTimes2, str(spacing))) build 18-Sep-2019 23:19:12 + casalogPost(debug,displayTimesArray([[uniqueTimes2]])) build 18-Sep-2019 23:19:12 + uniqueAntennaIds2 = np.unique(ant2) build 18-Sep-2019 23:19:12 + uniqueFields2 = np.unique(fields2) build 18-Sep-2019 23:19:12 + nFields2 = len(uniqueFields2) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + casalogPost(debug,"(boverlay) original unique spws in the second dataset = %s" % (str(np.unique(originalSpw2)))) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + uniqueTimesPerFieldPerSpw2 = [] build 18-Sep-2019 23:19:12 + for s in uniqueSpwsInCalTable2: build 18-Sep-2019 23:19:12 + uniqueTimesPerField2 = [] build 18-Sep-2019 23:19:12 + for f in uniqueFields2: build 18-Sep-2019 23:19:12 + timelist2 = [] build 18-Sep-2019 23:19:12 + for row in range(len(fields2)): build 18-Sep-2019 23:19:12 + if (fields2[row] == f and cal_desc_id2[row] == s): build 18-Sep-2019 23:19:12 + if (sloppyMatch(times2[row], timelist2, solutionTimeThresholdSeconds) == False): build 18-Sep-2019 23:19:12 + timelist2.append(times2[row]) build 18-Sep-2019 23:19:12 + uniqueTimesPerField2.append(timelist2) build 18-Sep-2019 23:19:12 + uniqueTimesPerFieldPerSpw2.append(uniqueTimesPerField2) build 18-Sep-2019 23:19:12 + casalogPost(debug,"uniqueTimesPerFieldPerSpw2 = %s" % (displayTimesArray(uniqueTimesPerFieldPerSpw2))) build 18-Sep-2019 23:19:12 + casalogPost(debug,"%d spw%s in the second solution = %s" % (len(uniqueSpwsInCalTable2), plural(uniqueSpwsInCalTable2), str(uniqueSpwsInCalTable2))) build 18-Sep-2019 23:19:12 + if (msFound): build 18-Sep-2019 23:19:12 + msFieldsList = str(np.array(msFields)[uniqueFields2]) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + msFieldsList = 'unknown' build 18-Sep-2019 23:19:12 + casalogPost(debug,"%d field(s) in the solution = %s = %s" % (len(uniqueFields2), uniqueFields2, msFieldsList)) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Parse the timeranges field from the command line build 18-Sep-2019 23:19:12 + if timeranges != '': # CAS-8439 build 18-Sep-2019 23:19:12 + timerangesWasSpecified = True build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + timerangesWasSpecified = False build 18-Sep-2019 23:19:12 + if (type(timeranges) == str): build 18-Sep-2019 23:19:12 + # a list of antenna numbers was given build 18-Sep-2019 23:19:12 + tokens = timeranges.split(',') build 18-Sep-2019 23:19:12 + timerangeList = [] build 18-Sep-2019 23:19:12 + removeTime = [] build 18-Sep-2019 23:19:12 + for token in tokens: build 18-Sep-2019 23:19:12 + if (len(token) > 0): build 18-Sep-2019 23:19:12 + if (token.find('!')==0): build 18-Sep-2019 23:19:12 + timerangeList = range(len(uniqueTimes)) build 18-Sep-2019 23:19:12 + removeTime.append(int(token[1:])) build 18-Sep-2019 23:19:12 + elif (token.find('~')>0): build 18-Sep-2019 23:19:12 + (start,finish) = token.split('~') build 18-Sep-2019 23:19:12 + timerangeList += range(int(start),int(finish)+1) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + timerangeList.append(int(token)) build 18-Sep-2019 23:19:12 + timerangeList = np.array(timerangeList) build 18-Sep-2019 23:19:12 + for rt in removeTime: build 18-Sep-2019 23:19:12 + timerangeList = timerangeList[np.where(timerangeList != rt)[0]] build 18-Sep-2019 23:19:12 + timerangeList = list(timerangeList) build 18-Sep-2019 23:19:12 + if (len(timerangeList) < 1): build 18-Sep-2019 23:19:12 + if (len(removeTime) > 0): build 18-Sep-2019 23:19:12 + print("Too many negated timeranges -- there are none left to plot.") build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + # then a blank list was specified build 18-Sep-2019 23:19:12 + timerangeList = range(len(uniqueTimes)) build 18-Sep-2019 23:19:12 + elif (type(timeranges) == list): build 18-Sep-2019 23:19:12 + # it's already a list of integers build 18-Sep-2019 23:19:12 + timerangeList = timeranges build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + # It's a single, integer entry build 18-Sep-2019 23:19:12 + timerangeList = [timeranges] build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (timerangesWasSpecified and scans != ''): # CAS-8489 build 18-Sep-2019 23:19:12 + if (type(scans) == list or type(scans) == np.ndarray): build 18-Sep-2019 23:19:12 + myscan = int(scans[0]) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + myscan = int(str(scans).split(',')[0]) build 18-Sep-2019 23:19:12 + if (myscan not in scansForUniqueTimes): build 18-Sep-2019 23:19:12 + print("No rows for scan %d, only " % (myscan), np.unique(scansForUniqueTimes)) build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + timerangeOffset = scansForUniqueTimes.index(myscan) build 18-Sep-2019 23:19:12 + timerangeList = np.array(timerangeList) + timerangeOffset build 18-Sep-2019 23:19:12 + if (debug): print("Since both timeranges and scans was specified, generated new effective timerangeList: ", timerangeList) build 18-Sep-2019 23:19:12 + if (max(timerangeList) >= len(uniqueTimes)): build 18-Sep-2019 23:19:12 + print("Invalid timerange. Solution has %d times (%d~%d)" % (len(uniqueTimes),0,len(uniqueTimes)-1)) build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + timerangeListTimes = np.array(uniqueTimes)[timerangeList] build 18-Sep-2019 23:19:12 + timerangeListTimesString = mjdsecArrayToUTString(timerangeListTimes) build 18-Sep-2019 23:19:12 + if (tableFormat == 33 or scansForUniqueTimes == []): build 18-Sep-2019 23:19:12 + # SMA data with scan numbers of -1 has empty list for scansForUniqueTimes build 18-Sep-2019 23:19:12 + scansToPlot = [] build 18-Sep-2019 23:19:12 + if (scans != ''): build 18-Sep-2019 23:19:12 + print("Selection by scan is not possible for this dataset.") build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (debug): print("scansForUniqueTimes = %s" % (str(scansForUniqueTimes))) build 18-Sep-2019 23:19:12 + scansToPlot = np.array(scansForUniqueTimes)[timerangeList] build 18-Sep-2019 23:19:12 + if (np.unique(scansToPlot)[0] == -1): build 18-Sep-2019 23:19:12 + # scan numbers are not correct in this new-style cal table build 18-Sep-2019 23:19:12 + scansToPlot = [] build 18-Sep-2019 23:19:12 + if (scans != ''): build 18-Sep-2019 23:19:12 + print("Selection by scan number is not possible with this dataset.") build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + if (scans != '' and scans != []): build 18-Sep-2019 23:19:12 + if (type(scans) == list): build 18-Sep-2019 23:19:12 + scansToPlot = scans build 18-Sep-2019 23:19:12 + elif (type(scans) == str): build 18-Sep-2019 23:19:12 + scansToPlot = [int(a) for a in scans.split(',')] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + scansToPlot = [scans] build 18-Sep-2019 23:19:12 + for scan in scansToPlot: build 18-Sep-2019 23:19:12 + if (scan not in scansForUniqueTimes): build 18-Sep-2019 23:19:12 + print("Scan %d is not in any solution" % (scan)) build 18-Sep-2019 23:19:12 + return build 18-Sep-2019 23:19:12 + scansToPlotPerSpw = {} build 18-Sep-2019 23:19:12 + for myspw in np.unique(cal_desc_id): build 18-Sep-2019 23:19:12 + scansToPlotPerSpw[myspw] = [] build 18-Sep-2019 23:19:12 + for scan in scansToPlot: build 18-Sep-2019 23:19:12 + for myspw in np.unique(cal_desc_id): build 18-Sep-2019 23:19:12 + if (scan in cal_scans_per_spw[myspw]): build 18-Sep-2019 23:19:12 + scansToPlotPerSpw[myspw].append(scan) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # remove spws that do not have any scans to be plotted build 18-Sep-2019 23:19:12 + # but only for tables that have a scan number column, and not filled with all -1 build 18-Sep-2019 23:19:12 + if (tableFormat > 33 and scansForUniqueTimes != []): build 18-Sep-2019 23:19:12 + for myspw in np.unique(cal_desc_id): build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("scans to plot for spw %d: %s" % (myspw, scansToPlotPerSpw[myspw])) build 18-Sep-2019 23:19:12 + if (scansToPlotPerSpw[myspw] == []): build 18-Sep-2019 23:19:12 + indexDelete = np.where(spwsToPlot==myspw)[0] build 18-Sep-2019 23:19:12 + if (len(indexDelete) > 0): build 18-Sep-2019 23:19:12 + spwsToPlot = np.delete(spwsToPlot, indexDelete[0]) build 18-Sep-2019 23:19:12 + print("spwsToPlot = ", spwsToPlot) build 18-Sep-2019 23:19:12 + casalogPost(debug,"scans to plot: %s" % (str(scansToPlot))) build 18-Sep-2019 23:19:12 + casalogPost(debug,"UT times to plot: %s" % (timerangeListTimesString)) build 18-Sep-2019 23:19:12 + casalogPost(debug,"Corresponding time IDs (0-based): %s" % (str(timerangeList))) build 18-Sep-2019 23:19:12 + if (len(timerangeListTimes) > len(np.unique(scansToPlot))): build 18-Sep-2019 23:19:12 + # fix for CAS-9474 build 18-Sep-2019 23:19:12 + uniqueScansToPlot, idx = np.unique(scansToPlot, return_index=True) build 18-Sep-2019 23:19:12 + if (len(uniqueScansToPlot) < len(scansToPlot)): build 18-Sep-2019 23:19:12 + # If the solution time for one spw differs by more than solutionTimeThresholdSeconds from build 18-Sep-2019 23:19:12 + # another spw, then we will get 2 identical entries for the same scan, and thus duplicate build 18-Sep-2019 23:19:12 + # plots. So, remove one. build 18-Sep-2019 23:19:12 + if debug: print("Engaging fix for CAS-9474") build 18-Sep-2019 23:19:12 + scansToPlot = uniqueScansToPlot build 18-Sep-2019 23:19:12 + timerangeListTimes = list(np.array(timerangeListTimes)[idx]) build 18-Sep-2019 23:19:12 + timerangeList = list(np.array(timerangeList)[idx]) build 18-Sep-2019 23:19:12 + timerangeListTimesString = mjdsecArrayToUTString(timerangeListTimes) build 18-Sep-2019 23:19:12 + casalogPost(debug,"Revised scans to plot: %s" % (str(scansToPlot))) build 18-Sep-2019 23:19:12 + casalogPost(debug,"Revised UT times to plot: %s" % (timerangeListTimesString)) build 18-Sep-2019 23:19:12 + casalogPost(debug,"Corresponding time IDs (0-based): %s" % (str(timerangeList))) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Check for mismatch build 18-Sep-2019 23:19:12 + if (bpolyOverlay): build 18-Sep-2019 23:19:12 + if (len(timerangeListTimes) > nUniqueTimesBP): build 18-Sep-2019 23:19:12 + print("There are more timeranges (%d) to plot from %s than exist in the caltable2=%s (%d)" % (len(timerangeListTimes), caltable,caltable2, nUniqueTimesBP)) build 18-Sep-2019 23:19:12 + for i in timerangeList: build 18-Sep-2019 23:19:12 + if (sloppyMatch(timerangeListTimes[i],uniqueTimesBP[0], build 18-Sep-2019 23:19:12 + solutionTimeThresholdSeconds, mytime, build 18-Sep-2019 23:19:12 + scansToPlot, scansForUniqueTimes, myprint=False)): build 18-Sep-2019 23:19:12 + print("Try adding 'timeranges=%d'" % (i+1)) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (bpolyOverlay2): build 18-Sep-2019 23:19:12 + if (len(timerangeListTimes) > nUniqueTimesBP2): build 18-Sep-2019 23:19:12 + print("There are more timeranges to plot (%d) from %s than exist in the caltable3=%s (%d)" % (len(timerangeListTimes), caltable, caltable3, nUniqueTimesBP2)) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Parse the antenna string to emulate plotms build 18-Sep-2019 23:19:12 + if (type(antenna) == str): build 18-Sep-2019 23:19:12 + if (len(antenna) == sum([m in myValidCharacterListWithBang for m in antenna])): build 18-Sep-2019 23:19:12 + # a simple list of antenna numbers was given build 18-Sep-2019 23:19:12 + tokens = antenna.split(',') build 18-Sep-2019 23:19:12 + antlist = [] build 18-Sep-2019 23:19:12 + removeAntenna = [] build 18-Sep-2019 23:19:12 + for token in tokens: build 18-Sep-2019 23:19:12 + if (len(token) > 0): build 18-Sep-2019 23:19:12 + if (token.find('*')==0 and len(token)==1): build 18-Sep-2019 23:19:12 + antlist = uniqueAntennaIds build 18-Sep-2019 23:19:12 + break build 18-Sep-2019 23:19:12 + elif (token.find('!')==0): build 18-Sep-2019 23:19:12 + antlist = uniqueAntennaIds build 18-Sep-2019 23:19:12 + removeAntenna.append(int(token[1:])) build 18-Sep-2019 23:19:12 + elif (token.find('~')>0): build 18-Sep-2019 23:19:12 + (start,finish) = token.split('~') build 18-Sep-2019 23:19:12 + antlist += range(int(start),int(finish)+1) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + antlist.append(int(token)) build 18-Sep-2019 23:19:12 + antlist = np.array(antlist) build 18-Sep-2019 23:19:12 + for rm in removeAntenna: build 18-Sep-2019 23:19:12 + antlist = antlist[np.where(antlist != rm)[0]] build 18-Sep-2019 23:19:12 + antlist = list(antlist) build 18-Sep-2019 23:19:12 + if (len(antlist) < 1 and len(removeAntenna)>0): build 18-Sep-2019 23:19:12 + print("Too many negated antennas -- there are no antennas left to plot.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + # The antenna name (or list of names) was specified build 18-Sep-2019 23:19:12 + tokens = antenna.split(',') build 18-Sep-2019 23:19:12 + if (msFound): build 18-Sep-2019 23:19:12 + antlist = [] build 18-Sep-2019 23:19:12 + removeAntenna = [] build 18-Sep-2019 23:19:12 + for token in tokens: build 18-Sep-2019 23:19:12 +# if (token in mymsmd.antennanames(range(mymsmd.nantennas()))): build 18-Sep-2019 23:19:12 + if (token in msAnt): build 18-Sep-2019 23:19:12 + antlist = list(antlist) # needed in case preceding antenna had ! modifier build 18-Sep-2019 23:19:12 +# antlist.append(mymsmd.antennaids(token)[0]) build 18-Sep-2019 23:19:12 + antlist.append(list(msAnt).index(token)) build 18-Sep-2019 23:19:12 + elif (token[0] == '!'): build 18-Sep-2019 23:19:12 +# if (token[1:] in mymsmd.antennanames(range(mymsmd.nantennas()))): build 18-Sep-2019 23:19:12 + if (token[1:] in msAnt): build 18-Sep-2019 23:19:12 + antlist = uniqueAntennaIds # range(mymsmd.nantennas()) build 18-Sep-2019 23:19:12 +# removeAntenna.append(mymsmd.antennaids(token[1:])[0]) build 18-Sep-2019 23:19:12 + removeAntenna.append(list(msAnt).index(token[1:])) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + print("Antenna %s is not in the ms. It contains: " % (token), mymsmd.antennanames(range(mymsmd.nantennas()))) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + print("Antenna %s is not in the ms. It contains: " % (token), mymsmd.antennanames(range(mymsmd.nantennas()))) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + antlist = np.array(antlist) build 18-Sep-2019 23:19:12 + for rm in removeAntenna: build 18-Sep-2019 23:19:12 + antlist = antlist[np.where(antlist != rm)[0]] build 18-Sep-2019 23:19:12 + antlist = list(antlist) build 18-Sep-2019 23:19:12 + if (len(antlist) < 1 and len(removeAntenna)>0): build 18-Sep-2019 23:19:12 + print("Too many negated antennas -- there are no antennas left to plot.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + print("Antennas cannot be specified my name if the ms is not found.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + elif (type(antenna) == list): build 18-Sep-2019 23:19:12 + # it's a list of integers build 18-Sep-2019 23:19:12 + antlist = antenna build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + # It's a single, integer entry build 18-Sep-2019 23:19:12 + antlist = [antenna] build 18-Sep-2019 23:19:12 + casalogPost(debug,"antlist = %s" % (str(antlist))) build 18-Sep-2019 23:19:12 + if (len(antlist) > 0): build 18-Sep-2019 23:19:12 + antennasToPlot = np.intersect1d(uniqueAntennaIds,antlist) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + antennasToPlot = uniqueAntennaIds build 18-Sep-2019 23:19:12 + if (len(antennasToPlot) < 2 and overlayAntennas): build 18-Sep-2019 23:19:12 + print("More than 1 antenna is required for overlay='antenna'.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + casalogPost(debug,"antennasToPlot = %s" % (str(antennasToPlot))) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # Parse the field string to emulate plotms build 18-Sep-2019 23:19:12 + removeField = [] build 18-Sep-2019 23:19:12 + if (type(field) == str): build 18-Sep-2019 23:19:12 + if (len(field) == sum([m in myValidCharacterListWithBang for m in field])): build 18-Sep-2019 23:19:12 + casalogPost(debug,"a list of field numbers was given") build 18-Sep-2019 23:19:12 + # a list of field numbers was given build 18-Sep-2019 23:19:12 + tokens = field.split(',') build 18-Sep-2019 23:19:12 + fieldlist = [] build 18-Sep-2019 23:19:12 + for token in tokens: build 18-Sep-2019 23:19:12 + if (token.find('*')>=0): build 18-Sep-2019 23:19:12 + fieldlist = uniqueFields build 18-Sep-2019 23:19:12 + break build 18-Sep-2019 23:19:12 + elif (token.find('!')==0): build 18-Sep-2019 23:19:12 + fieldlist = uniqueFields build 18-Sep-2019 23:19:12 + removeField.append(int(token[1:])) build 18-Sep-2019 23:19:12 + elif (len(token) > 0): build 18-Sep-2019 23:19:12 + if (token.find('~')>0): build 18-Sep-2019 23:19:12 + (start,finish) = token.split('~') build 18-Sep-2019 23:19:12 + fieldlist += range(int(start),int(finish)+1) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + fieldlist.append(int(token)) build 18-Sep-2019 23:19:12 + fieldlist = np.array(fieldlist) build 18-Sep-2019 23:19:12 + for rm in removeField: build 18-Sep-2019 23:19:12 + fieldlist = fieldlist[np.where(fieldlist != rm)[0]] build 18-Sep-2019 23:19:12 + fieldlist = list(fieldlist) build 18-Sep-2019 23:19:12 + if (len(fieldlist) < 1 and len(removeField)>0): build 18-Sep-2019 23:19:12 + print("Too many negated fields -- there are no fields left to plot.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + casalogPost(debug,"The field name, or list of names was given") build 18-Sep-2019 23:19:12 + # The field name (or list of names, or wildcard) was specified build 18-Sep-2019 23:19:12 + tokens = field.split(',') build 18-Sep-2019 23:19:12 + if (msFound): build 18-Sep-2019 23:19:12 + fieldlist = [] build 18-Sep-2019 23:19:12 + removeField = [] build 18-Sep-2019 23:19:12 + for token in tokens: build 18-Sep-2019 23:19:12 + myloc = token.find('*') build 18-Sep-2019 23:19:12 + casalogPost(debug,"token=%s, myloc=%d" % (token,myloc)) build 18-Sep-2019 23:19:12 + if (myloc > 0): build 18-Sep-2019 23:19:12 + casalogPost(debug,"Saw wildcard in the name") build 18-Sep-2019 23:19:12 + for u in uniqueFields: build 18-Sep-2019 23:19:12 + myFieldName = GetFieldNamesForFieldId(u, mymsmd, msFields) build 18-Sep-2019 23:19:12 + if (token[0:myloc]==myFieldName[0:myloc]): build 18-Sep-2019 23:19:12 + if (DEBUG): build 18-Sep-2019 23:19:12 + print("Found wildcard match = %s" % mymsmd.namesforfields(u)) build 18-Sep-2019 23:19:12 + fieldlist.append(u) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (DEBUG): build 18-Sep-2019 23:19:12 + print("No wildcard match with = %s" % mymsmd.namesforfields(u)) build 18-Sep-2019 23:19:12 + elif (myloc==0): build 18-Sep-2019 23:19:12 + casalogPost(debug,"Saw wildcard at start of name") build 18-Sep-2019 23:19:12 + for u in uniqueFields: build 18-Sep-2019 23:19:12 + fieldlist.append(u) build 18-Sep-2019 23:19:12 + elif (token in msFields): build 18-Sep-2019 23:19:12 + fieldlist = list(fieldlist) # needed in case preceding field had ! modifier build 18-Sep-2019 23:19:12 + fieldlist.append(GetFieldIdsForFieldName(token, mymsmd, msFields)) build 18-Sep-2019 23:19:12 + elif (token[0] == '!'): build 18-Sep-2019 23:19:12 + if (fieldlist == []): build 18-Sep-2019 23:19:12 + for u in uniqueFields: build 18-Sep-2019 23:19:12 + fieldlist.append(u) build 18-Sep-2019 23:19:12 + if (token[1:] in msFields): build 18-Sep-2019 23:19:12 + removeField.append(GetFieldIdsForFieldName(token[1:], mymsmd, msFields)) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + print("Field %s is not in the ms. It contains: %s, %s" % (token, str(uniqueFields), str(np.unique(msFields)))) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + casalogPost(debug,"Field not in ms") build 18-Sep-2019 23:19:12 + fieldlist = [] build 18-Sep-2019 23:19:12 + for f in mymsmd.namesforfields(): build 18-Sep-2019 23:19:12 + fieldlist.append(mymsmd.fieldsforname(f)) build 18-Sep-2019 23:19:12 + print("Field %s is not in the ms. It contains: %s, %s" % (token, str(uniqueFields), str(np.unique(msFields)))) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + fieldlist = np.array(fieldlist) build 18-Sep-2019 23:19:12 + for rm in removeField: build 18-Sep-2019 23:19:12 + fieldlist = fieldlist[np.where(fieldlist != rm)[0]] build 18-Sep-2019 23:19:12 + fieldlist = list(fieldlist) build 18-Sep-2019 23:19:12 + if (len(fieldlist) < 1 and len(removeField)>0): build 18-Sep-2019 23:19:12 + print("Too many negated fields -- there are no fields left to plot.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + print("Fields cannot be specified my name if the ms is not found.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + elif (type(field) == list): build 18-Sep-2019 23:19:12 + # it's a list of integers build 18-Sep-2019 23:19:12 + fieldlist = field build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + # It's a single, integer entry build 18-Sep-2019 23:19:12 + fieldlist = [field] build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + casalogPost(debug,"fieldlist = %s" % (str(fieldlist))) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (len(fieldlist) > 0): build 18-Sep-2019 23:19:12 + if (DEBUG): build 18-Sep-2019 23:19:12 + print("Finding intersection of %s with %s" % (str(uniqueFields), str(fieldlist))) build 18-Sep-2019 23:19:12 + fieldsToPlot = np.intersect1d(uniqueFields,np.array(fieldlist)) build 18-Sep-2019 23:19:12 + if (bOverlay): build 18-Sep-2019 23:19:12 + fieldsToPlot = np.intersect1d(np.union1d(uniqueFields,uniqueFields2),np.array(fieldlist)) build 18-Sep-2019 23:19:12 + if (len(fieldsToPlot) < 1): build 18-Sep-2019 23:19:12 + print("Requested field not found in solution") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + fieldsToPlot = uniqueFields # use all fields if none are specified build 18-Sep-2019 23:19:12 + if (bOverlay): build 18-Sep-2019 23:19:12 + fieldsToPlot = np.union1d(uniqueFields,uniqueFields2) build 18-Sep-2019 23:19:12 + if (DEBUG): build 18-Sep-2019 23:19:12 + print("bOverlay = %s" % (bOverlay)) build 18-Sep-2019 23:19:12 + print("set fieldsToPlot to uniqueFields = %s" % (str(fieldsToPlot))) build 18-Sep-2019 23:19:12 + fieldIndicesToPlot = [] build 18-Sep-2019 23:19:12 + casalogPost(debug,"fieldsToPlot = %s" % (str(fieldsToPlot))) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (showatmfield == ''): build 18-Sep-2019 23:19:12 + showatmfield = fieldsToPlot[0] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (str.isdigit(str(showatmfield))): build 18-Sep-2019 23:19:12 + showatmfield = int(str(showatmfield)) build 18-Sep-2019 23:19:12 + if (showatmfield not in fieldsToPlot): build 18-Sep-2019 23:19:12 + print("The showatmfield (%d) is not in the list of fields to plot: %s" % (showatmfield, str(fieldsToPlot))) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + showatmfieldName = showatmfield build 18-Sep-2019 23:19:12 + showatmfield = mymsmd.fieldsforname(showatmfield) build 18-Sep-2019 23:19:12 + if (list(showatmfield) == []): build 18-Sep-2019 23:19:12 + print("The showatmfield (%s) is not in the ms." %(showatmfieldName)) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (type(showatmfield) == type(np.ndarray(0))): build 18-Sep-2019 23:19:12 + # more than one field IDs exist for this source name, so pick the first build 18-Sep-2019 23:19:12 + showatmfield = showatmfield[0] build 18-Sep-2019 23:19:12 + if (showatmfield not in fieldsToPlot): build 18-Sep-2019 23:19:12 + print("The showatmfield (%d=%s) is not in the list of fields to plot: %s" % (showatmfield, showatmfieldName, str(fieldsToPlot))) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + for i in fieldsToPlot: build 18-Sep-2019 23:19:12 + match = np.where(i==uniqueFields)[0] build 18-Sep-2019 23:19:12 + if (len(match) < 1 and bOverlay): build 18-Sep-2019 23:19:12 + match = np.where(i==uniqueFields2)[0] build 18-Sep-2019 23:19:12 + fieldIndicesToPlot.append(match[0]) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + casalogPost(debug,"spws to plot = %s" % (str(spwsToPlot))) build 18-Sep-2019 23:19:12 + casalogPost(debug,"Field IDs to plot: %s" % (str(fieldsToPlot))) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + redisplay = False build 18-Sep-2019 23:19:12 + myap = 0 # this variable is necessary to make the 'b' option work for build 18-Sep-2019 23:19:12 + # subplot=11, yaxis=both. It keeps track of whether 'amp' or build 18-Sep-2019 23:19:12 + # 'phase' was the first plot on the page. build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # I added pb.ion() because Remy suggested it. build 18-Sep-2019 23:19:12 + if (interactive): build 18-Sep-2019 23:19:12 + pb.ion() # This will open a new window if not present. build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pb.ioff() # This will not destroy an existing window or prevent new plots from appearing there. build 18-Sep-2019 23:19:12 +# # The call to pb.figure() causes an additional new window everytime. build 18-Sep-2019 23:19:12 +# # pb.figure() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + newylimits = [LARGE_POSITIVE, LARGE_NEGATIVE] build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + pb.clf() build 18-Sep-2019 23:19:12 + if (bpoly): build 18-Sep-2019 23:19:12 + # The number of polarizations cannot be reliably inferred from the shape of build 18-Sep-2019 23:19:12 + # the GAIN column in the caltable. Must use the shape of the DATA column build 18-Sep-2019 23:19:12 + # in the ms. build 18-Sep-2019 23:19:12 + if (debug): print("in bpoly") build 18-Sep-2019 23:19:12 + if (msFound): build 18-Sep-2019 23:19:12 + (corr_type, corr_type_string, nPolarizations) = getCorrType(msName, spwsToPlot, mymsmd, debug) build 18-Sep-2019 23:19:12 + casalogPost(debug,"nPolarizations in first spw to plot = %s" % (str(nPolarizations))) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + print("With no ms available, I will assume ALMA data: XX, YY, and refFreq=first channel.") build 18-Sep-2019 23:19:12 + chanFreqGHz = [] build 18-Sep-2019 23:19:12 + corr_type_string = ['XX','YY'] build 18-Sep-2019 23:19:12 + corr_type = [9,12] build 18-Sep-2019 23:19:12 + nPolarizations = 2 build 18-Sep-2019 23:19:12 + nPolarizations2 = nPolarizations build 18-Sep-2019 23:19:12 + if (corr_type_string == []): build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + polsToPlot = checkPolsToPlot(polsToPlot, corr_type_string, debug) build 18-Sep-2019 23:19:12 + if (polsToPlot == []): build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + # Here we are only plotting one BPOLY solution, no overlays implemented. build 18-Sep-2019 23:19:12 + overlayAntennas = False build 18-Sep-2019 23:19:12 + # rows in the table are: antennas 0..nAnt for first spw, antennas 0..nAnt build 18-Sep-2019 23:19:12 + # for 2nd spw... build 18-Sep-2019 23:19:12 + pagectr = 0 build 18-Sep-2019 23:19:12 + pages = [] build 18-Sep-2019 23:19:12 + xctr = 0 build 18-Sep-2019 23:19:12 + newpage = 1 build 18-Sep-2019 23:19:12 + while (xctr < len(antennasToPlot)): build 18-Sep-2019 23:19:12 + xant = antennasToPlot[xctr] build 18-Sep-2019 23:19:12 + antstring, Antstring = buildAntString(xant,msFound,msAnt) build 18-Sep-2019 23:19:12 + spwctr = 0 build 18-Sep-2019 23:19:12 + spwctrFirstToPlot = spwctr build 18-Sep-2019 23:19:12 + while (spwctr < len(spwsToPlot)): build 18-Sep-2019 23:19:12 + ispw = spwsToPlot[spwctr] build 18-Sep-2019 23:19:12 + mytime = 0 build 18-Sep-2019 23:19:12 + while (mytime < nUniqueTimes): build 18-Sep-2019 23:19:12 + if (len(uniqueTimes) > 0 and (mytime not in timerangeList)): build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("@@@@@@@@@@@@@@@ Skipping mytime=%d" % (mytime)) build 18-Sep-2019 23:19:12 + mytime += 1 build 18-Sep-2019 23:19:12 + continue build 18-Sep-2019 23:19:12 + if (newpage == 1): build 18-Sep-2019 23:19:12 + pages.append([xctr,spwctr,mytime,0]) build 18-Sep-2019 23:19:12 +# print("appending [%d,%d,%d,%d]" % (xctr,spwctr,mytime,0)) build 18-Sep-2019 23:19:12 + newpage = 0 build 18-Sep-2019 23:19:12 + antennaString = 'Ant%2d: %s, ' % (xant,antstring) build 18-Sep-2019 23:19:12 + for index in range(nRows): build 18-Sep-2019 23:19:12 + # Find this antenna, spw, and timerange combination in the table build 18-Sep-2019 23:19:12 + if (xant==ant[index] and sloppyMatch(uniqueTimes[mytime],times[index],solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:12 + mytime, scansToPlotPerSpw[ispw], scansForUniqueTimes, build 18-Sep-2019 23:19:12 + myprint=debugSloppyMatch) and build 18-Sep-2019 23:19:12 + (ispw == cal_desc_id[index]) and (fields[index] in fieldsToPlot)): build 18-Sep-2019 23:19:12 + fieldIndex = np.where(fields[index] == uniqueFields)[0] build 18-Sep-2019 23:19:12 + if (type(fieldIndex) == list or type(fieldIndex) == np.ndarray): build 18-Sep-2019 23:19:12 + fieldIndex = fieldIndex[0] build 18-Sep-2019 23:19:12 + validDomain = [frequencyLimits[0,index], frequencyLimits[1,index]] build 18-Sep-2019 23:19:12 + if (msFound): build 18-Sep-2019 23:19:12 + fieldString = msFields[uniqueFields[fieldIndex]] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + fieldString = str(field) build 18-Sep-2019 23:19:12 + timeString = ', t%d/%d %s' % (mytime,nUniqueTimes-1,utstring(uniqueTimes[mytime],3)) build 18-Sep-2019 23:19:12 + if (scansForUniqueTimes != []): build 18-Sep-2019 23:19:12 + if (scansForUniqueTimes[mytime]>=0): build 18-Sep-2019 23:19:12 + timeString = ', scan%d %s' % (scansForUniqueTimes[mytime],utstring(uniqueTimes[mytime],3)) build 18-Sep-2019 23:19:12 + if ((yaxis.find('amp')>=0 or amplitudeWithPhase) and myap==0): build 18-Sep-2019 23:19:12 + xframe += 1 build 18-Sep-2019 23:19:12 + myUniqueColor = [] build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("v) incrementing xframe to %d" % xframe) build 18-Sep-2019 23:19:12 + adesc = pb.subplot(xframe) build 18-Sep-2019 23:19:12 + previousSubplot = xframe build 18-Sep-2019 23:19:12 + if (ispw==originalSpw[ispw]): build 18-Sep-2019 23:19:12 + # all this was added mistakenly here. If it causes a bug, remove it. build 18-Sep-2019 23:19:12 + if (overlayTimes and len(fieldsToPlot) > 1): build 18-Sep-2019 23:19:12 + indices = fstring = '' build 18-Sep-2019 23:19:12 + for f in fieldIndicesToPlot: build 18-Sep-2019 23:19:12 + if (f != fieldIndicesToPlot[0]): build 18-Sep-2019 23:19:12 + indices += ',' build 18-Sep-2019 23:19:12 + fstring += ',' build 18-Sep-2019 23:19:12 + indices += str(uniqueFields[f]) build 18-Sep-2019 23:19:12 + if (msFound): build 18-Sep-2019 23:19:12 + fstring += msFields[uniqueFields[f]] build 18-Sep-2019 23:19:12 + if (len(fstring) > fstringLimit): build 18-Sep-2019 23:19:12 + fstring = fstring[0:fstringLimit] + '...' build 18-Sep-2019 23:19:12 + pb.title("%sspw%2d, fields %s: %s%s" % (antennaString,ispw, build 18-Sep-2019 23:19:12 + indices, fstring, timeString), size=titlesize) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pb.title("%sspw%2d, field %d: %s%s" % (antennaString,ispw, build 18-Sep-2019 23:19:12 + uniqueFields[fieldIndex],fieldString,timeString), size=titlesize) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (overlayTimes and len(fieldsToPlot) > 1): build 18-Sep-2019 23:19:12 + indices = fstring = '' build 18-Sep-2019 23:19:12 + for f in fieldIndicesToPlot: build 18-Sep-2019 23:19:12 + if (f != fieldIndicesToPlot[0]): build 18-Sep-2019 23:19:12 + indices += ',' build 18-Sep-2019 23:19:12 + fstring += ',' build 18-Sep-2019 23:19:12 + indices += str(uniqueFields[f]) build 18-Sep-2019 23:19:12 + if (msFound): build 18-Sep-2019 23:19:12 + fstring += msFields[uniqueFields[f]] build 18-Sep-2019 23:19:12 + if (len(fstring) > fstringLimit): build 18-Sep-2019 23:19:12 + fstring = fstring[0:fstringLimit] + '...' build 18-Sep-2019 23:19:12 + pb.title("%sspw%2d (%d), fields %s: %s%s" % (antennaString,ispw,originalSpw[ispw], build 18-Sep-2019 23:19:12 + indices, fstring, timeString), size=titlesize) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pb.title("%sspw%2d (%d), field %d: %s%s" % (antennaString,ispw,originalSpw[ispw], build 18-Sep-2019 23:19:12 + uniqueFields[fieldIndex],fieldString,timeString), size=titlesize) build 18-Sep-2019 23:19:12 + amplitudeSolutionX = np.real(scaleFactor[index])+calcChebyshev(polynomialAmplitude[index][0:nPolyAmp[index]], validDomain, frequenciesGHz[index]*1e+9) build 18-Sep-2019 23:19:12 + amplitudeSolutionY = np.real(scaleFactor[index])+calcChebyshev(polynomialAmplitude[index][nPolyAmp[index]:2*nPolyAmp[index]], validDomain, frequenciesGHz[index]*1e+9) build 18-Sep-2019 23:19:12 + amplitudeSolutionX += 1 - np.mean(amplitudeSolutionX) build 18-Sep-2019 23:19:12 + amplitudeSolutionY += 1 - np.mean(amplitudeSolutionY) build 18-Sep-2019 23:19:12 + if (yaxis.lower().find('db') >= 0): build 18-Sep-2019 23:19:12 + amplitudeSolutionX = 10*np.log10(amplitudeSolutionX) build 18-Sep-2019 23:19:12 + amplitudeSolutionY = 10*np.log10(amplitudeSolutionY) build 18-Sep-2019 23:19:12 + if (nPolarizations == 1): build 18-Sep-2019 23:19:12 + pb.plot(frequenciesGHz[index], amplitudeSolutionX, '%s%s'%(xcolor,bpolymarkstyle),markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pb.plot(frequenciesGHz[index], amplitudeSolutionX, '%s%s'%(xcolor,bpolymarkstyle), frequenciesGHz[index], amplitudeSolutionY, '%s%s'%(ycolor,bpolymarkstyle),markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + if (plotrange[0] != 0 or plotrange[1] != 0): build 18-Sep-2019 23:19:12 + SetNewXLimits([plotrange[0],plotrange[1]]) build 18-Sep-2019 23:19:12 + if (plotrange[2] != 0 or plotrange[3] != 0): build 18-Sep-2019 23:19:12 + SetNewYLimits([plotrange[2],plotrange[3]]) build 18-Sep-2019 23:19:12 + xlim=pb.xlim() build 18-Sep-2019 23:19:12 + ylim=pb.ylim() build 18-Sep-2019 23:19:12 + ResizeFonts(adesc,mysize) build 18-Sep-2019 23:19:12 + adesc.xaxis.grid(True,which='major') build 18-Sep-2019 23:19:12 + adesc.yaxis.grid(True,which='major') build 18-Sep-2019 23:19:12 + if (yaxis.lower().find('db')>=0): build 18-Sep-2019 23:19:12 + pb.ylabel('Amplitude (dB)', size=mysize) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pb.ylabel('Amplitude', size=mysize) build 18-Sep-2019 23:19:12 + pb.xlabel('Frequency (GHz)', size=mysize) build 18-Sep-2019 23:19:12 + if (xframe == firstFrame): build 18-Sep-2019 23:19:12 + DrawBottomLegendPageCoords(msName, uniqueTimes[mytime], mysize, figfile) build 18-Sep-2019 23:19:12 + pb.text(xstartTitle, ystartTitle, build 18-Sep-2019 23:19:12 + '%s (degamp=%d, degphase=%d)'%(caltableTitle,nPolyAmp[index]-1, build 18-Sep-2019 23:19:12 + nPolyPhase[index]-1),size=mysize, build 18-Sep-2019 23:19:12 + transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:12 + # draw polarization labels build 18-Sep-2019 23:19:12 + x0 = xstartPolLabel build 18-Sep-2019 23:19:12 + y0 = ystartPolLabel build 18-Sep-2019 23:19:12 + for p in range(nPolarizations): build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:12 + pb.text(x0, y0-0.03*subplotRows*p, corrTypeToString(corr_type[p])+'', build 18-Sep-2019 23:19:12 + color=pcolor[p],size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + if (xframe == 111 and amplitudeWithPhase): build 18-Sep-2019 23:19:12 + if (len(figfile) > 0): build 18-Sep-2019 23:19:12 + # We need to make a new figure page build 18-Sep-2019 23:19:12 + plotfiles.append(makeplot(figfile,msFound,msAnt, build 18-Sep-2019 23:19:12 + overlayAntennas,pages,pagectr, build 18-Sep-2019 23:19:12 + density,interactive,antennasToPlot, build 18-Sep-2019 23:19:12 + spwsToPlot,overlayTimes,overlayBasebands, build 18-Sep-2019 23:19:12 + 0,xant,ispw,subplot,resample, build 18-Sep-2019 23:19:12 + debug,figfileSequential,figfileNumber)) build 18-Sep-2019 23:19:12 + figfileNumber += 1 build 18-Sep-2019 23:19:12 + donetime = timeUtilities.time() build 18-Sep-2019 23:19:12 + if (interactive): build 18-Sep-2019 23:19:12 + pb.draw() build 18-Sep-2019 23:19:12 +# # myinput = raw_input("(%.1f sec) Press return for next page (b for backwards, q to quit): "%(donetime-mytimestamp)) build 18-Sep-2019 23:19:12 + myinput = raw_input("Press return for next page (b for backwards, q to quit): ") build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + myinput = '' build 18-Sep-2019 23:19:12 + skippingSpwMessageSent = 0 build 18-Sep-2019 23:19:12 + mytimestamp = timeUtilities.time() build 18-Sep-2019 23:19:12 + if (myinput.find('q') >= 0): build 18-Sep-2019 23:19:12 + showFinalMessage(overlayAntennas, solutionTimeSpread, nUniqueTimes) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (myinput.find('b') >= 0): build 18-Sep-2019 23:19:12 + if (pagectr > 0): build 18-Sep-2019 23:19:12 + pagectr -= 1 build 18-Sep-2019 23:19:12 + #redisplay the current page by setting ctrs back to the value they had at start of that page build 18-Sep-2019 23:19:12 + xctr = pages[pagectr][PAGE_ANT] build 18-Sep-2019 23:19:12 + spwctr = pages[pagectr][PAGE_SPW] build 18-Sep-2019 23:19:12 + mytime = pages[pagectr][PAGE_TIME] build 18-Sep-2019 23:19:12 + myap = pages[pagectr][PAGE_AP] build 18-Sep-2019 23:19:12 + xant = antennasToPlot[xctr] build 18-Sep-2019 23:19:12 + antstring, Antstring = buildAntString(xant,msFound,msAnt) build 18-Sep-2019 23:19:12 + ispw = spwsToPlot[spwctr] build 18-Sep-2019 23:19:12 + redisplay = True build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pagectr += 1 build 18-Sep-2019 23:19:12 + if (pagectr >= len(pages)): build 18-Sep-2019 23:19:12 + pages.append([xctr,spwctr,mytime,1]) build 18-Sep-2019 23:19:12 +# print("appending [%d,%d,%d,%d]" % (xctr,spwctr,mytime,1)) build 18-Sep-2019 23:19:12 + newpage = 0 build 18-Sep-2019 23:19:12 + pb.clf() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (yaxis.find('phase')>=0 or amplitudeWithPhase): build 18-Sep-2019 23:19:12 + xframe += 1 build 18-Sep-2019 23:19:12 + myUniqueColor = [] build 18-Sep-2019 23:19:12 +# # print("w) incrementing xframe to %d" % xframe) build 18-Sep-2019 23:19:12 + adesc = pb.subplot(xframe) build 18-Sep-2019 23:19:12 + previousSubplot = xframe build 18-Sep-2019 23:19:12 + if (ispw==originalSpw[ispw]): build 18-Sep-2019 23:19:12 + pb.title("%sspw%2d, field %d: %s%s" % (antennaString,ispw, build 18-Sep-2019 23:19:12 + uniqueFields[fieldIndex],fieldString,timeString), size=titlesize) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pb.title("%sspw%2d (%d), field %d: %s%s" % (antennaString,ispw,originalSpw[ispw], build 18-Sep-2019 23:19:12 + uniqueFields[fieldIndex],fieldString,timeString), size=titlesize) build 18-Sep-2019 23:19:12 + phaseSolutionX = calcChebyshev(polynomialPhase[index][0:nPolyPhase[index]], validDomain, frequenciesGHz[index]*1e+9) * 180/math.pi build 18-Sep-2019 23:19:12 + phaseSolutionY = calcChebyshev(polynomialPhase[index][nPolyPhase[index]:2*nPolyPhase[index]], validDomain, frequenciesGHz[index]*1e+9) * 180/math.pi build 18-Sep-2019 23:19:12 + if (nPolarizations == 1): build 18-Sep-2019 23:19:12 + pb.plot(frequenciesGHz[index], phaseSolutionX, '%s%s'%(xcolor,bpolymarkstyle),markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pb.plot(frequenciesGHz[index], phaseSolutionX, '%s%s'%(xcolor,bpolymarkstyle), frequenciesGHz[index], phaseSolutionY, '%s%s'%(ycolor,bpolymarkstyle),markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + ResizeFonts(adesc,mysize) build 18-Sep-2019 23:19:12 + adesc.xaxis.grid(True,which='major') build 18-Sep-2019 23:19:12 + adesc.yaxis.grid(True,which='major') build 18-Sep-2019 23:19:12 + pb.ylabel('Phase (deg)', size=mysize) build 18-Sep-2019 23:19:12 + pb.xlabel('Frequency (GHz)', size=mysize) build 18-Sep-2019 23:19:12 + if (plotrange[0] != 0 or plotrange[1] != 0): build 18-Sep-2019 23:19:12 + SetNewXLimits([plotrange[0],plotrange[1]]) build 18-Sep-2019 23:19:12 + if (plotrange[2] != 0 or plotrange[3] != 0): build 18-Sep-2019 23:19:12 + SetNewYLimits([plotrange[2],plotrange[3]]) build 18-Sep-2019 23:19:12 + if (amplitudeWithPhase and phase != ''): build 18-Sep-2019 23:19:12 + if (phase[0] != 0 or phase[1] != 0): build 18-Sep-2019 23:19:12 + SetNewYLimits(phase) build 18-Sep-2019 23:19:12 + if (xframe == firstFrame): build 18-Sep-2019 23:19:12 + pb.text(xstartTitle, ystartTitle, build 18-Sep-2019 23:19:12 + '%s (degamp=%d, degphase=%d)'%(caltable, build 18-Sep-2019 23:19:12 + nPolyAmp[index]-1,nPolyPhase[index]-1), build 18-Sep-2019 23:19:12 + size=mysize, transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:12 + # draw polarization labels build 18-Sep-2019 23:19:12 + x0 = xstartPolLabel build 18-Sep-2019 23:19:12 + y0 = ystartPolLabel build 18-Sep-2019 23:19:12 + for p in range(nPolarizations): build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:12 + pb.text(x0, y0-0.03*p*subplotRows, corrTypeToString(corr_type[p])+'', build 18-Sep-2019 23:19:12 + color=pcolor[p],size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # end of 'for' loop over rows build 18-Sep-2019 23:19:12 + redisplay = False build 18-Sep-2019 23:19:12 + pb.subplots_adjust(hspace=myhspace, wspace=mywspace) build 18-Sep-2019 23:19:12 + if (xframe == lastFrame): build 18-Sep-2019 23:19:12 + if (len(figfile) > 0): build 18-Sep-2019 23:19:12 + plotfiles.append(makeplot(figfile,msFound,msAnt, build 18-Sep-2019 23:19:12 + overlayAntennas,pages,pagectr, build 18-Sep-2019 23:19:12 + density,interactive,antennasToPlot, build 18-Sep-2019 23:19:12 + spwsToPlot,overlayTimes,overlayBasebands, build 18-Sep-2019 23:19:12 + 1,xant,ispw, build 18-Sep-2019 23:19:12 + subplot,resample,debug, build 18-Sep-2019 23:19:12 + figfileSequential,figfileNumber)) build 18-Sep-2019 23:19:12 + figfileNumber += 1 build 18-Sep-2019 23:19:12 + donetime = timeUtilities.time() build 18-Sep-2019 23:19:12 + if (interactive): build 18-Sep-2019 23:19:12 + pb.draw() build 18-Sep-2019 23:19:12 +# # myinput = raw_input("(%.1f sec) Press return for next page (b for backwards, q to quit): "%(donetime-mytimestamp)) build 18-Sep-2019 23:19:12 + myinput = raw_input("Press return for next page (b for backwards, q to quit): ") build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + myinput = '' build 18-Sep-2019 23:19:12 + skippingSpwMessageSent = 0 build 18-Sep-2019 23:19:12 + mytimestamp = timeUtilities.time() build 18-Sep-2019 23:19:12 + if (myinput.find('q') >= 0): build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (myinput.find('b') >= 0): build 18-Sep-2019 23:19:12 + if (pagectr > 0): build 18-Sep-2019 23:19:12 + pagectr -= 1 build 18-Sep-2019 23:19:12 + #redisplay the current page by setting ctrs back to the value they had at start of that page build 18-Sep-2019 23:19:12 + xctr = pages[pagectr][PAGE_ANT] build 18-Sep-2019 23:19:12 + spwctr = pages[pagectr][PAGE_SPW] build 18-Sep-2019 23:19:12 + mytime = pages[pagectr][PAGE_TIME] build 18-Sep-2019 23:19:12 + myap = pages[pagectr][PAGE_AP] build 18-Sep-2019 23:19:12 + xant = antennasToPlot[xctr] build 18-Sep-2019 23:19:12 + antstring, Antstring = buildAntString(xant,msFound,msAnt) build 18-Sep-2019 23:19:12 + ispw = spwsToPlot[spwctr] build 18-Sep-2019 23:19:12 + redisplay = True build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pagectr += 1 build 18-Sep-2019 23:19:12 + if (pagectr >= len(pages)): build 18-Sep-2019 23:19:12 + newpage = 1 build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + newpage = 0 build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("1)Setting xframe to %d" % xframeStart) build 18-Sep-2019 23:19:12 + xframe = xframeStart build 18-Sep-2019 23:19:12 + if (xctr+1 < len(antennasToPlot)): build 18-Sep-2019 23:19:12 + # don't clear the final plot when finished build 18-Sep-2019 23:19:12 + pb.clf() build 18-Sep-2019 23:19:12 + if (spwctr+1 0 and pagectr 0 and buildpdf): build 18-Sep-2019 23:19:12 + pdfname = figfile+'.pdf' build 18-Sep-2019 23:19:12 + filelist = '' build 18-Sep-2019 23:19:12 + plotfiles = np.unique(plotfiles) build 18-Sep-2019 23:19:12 + for i in range(len(plotfiles)): build 18-Sep-2019 23:19:12 + cmd = '%s -density %d %s %s.pdf' % (convert,density,plotfiles[i],plotfiles[i].split('.png')[0]) build 18-Sep-2019 23:19:12 + casalogPost(debug,"Running command = %s" % (cmd)) build 18-Sep-2019 23:19:12 + mystatus = os.system(cmd) build 18-Sep-2019 23:19:12 + if (mystatus != 0): build 18-Sep-2019 23:19:12 + break build 18-Sep-2019 23:19:12 + filelist += plotfiles[i].split('.png')[0] + '.pdf ' build 18-Sep-2019 23:19:12 + if (mystatus != 0): build 18-Sep-2019 23:19:12 + print("ImageMagick is missing, no PDF created") build 18-Sep-2019 23:19:12 + buildpdf = False build 18-Sep-2019 23:19:12 + if (buildpdf): build 18-Sep-2019 23:19:12 + cmd = '%s %s cat output %s' % (pdftk, filelist, pdfname) build 18-Sep-2019 23:19:12 + casalogPost(debug,"Running command = %s" % (cmd)) build 18-Sep-2019 23:19:12 + mystatus = os.system(cmd) build 18-Sep-2019 23:19:12 + if (mystatus != 0): build 18-Sep-2019 23:19:12 + cmd = '%s -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=%s %s' % (gs,pdfname,filelist) build 18-Sep-2019 23:19:12 + casalogPost(debug,"Running command = %s" % (cmd)) build 18-Sep-2019 23:19:12 + mystatus = os.system(cmd) build 18-Sep-2019 23:19:12 + if (mystatus == 0): build 18-Sep-2019 23:19:12 + print("PDF left in %s" % (pdfname)) build 18-Sep-2019 23:19:12 + os.system("rm -f %s" % filelist) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + print("Both pdftk and ghostscript are missing, no PDF created") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +#################################################################################### build 18-Sep-2019 23:19:12 +# # bpoly == false, build 18-Sep-2019 23:19:12 +################# build 18-Sep-2019 23:19:12 + msFound = False build 18-Sep-2019 23:19:12 + mytb.open(caltable) build 18-Sep-2019 23:19:12 + uniqueScanNumbers = sorted(np.unique(mytb.getcol('SCAN_NUMBER'))) build 18-Sep-2019 23:19:12 + if (ParType == 'Complex'): # casa >= 3.4 build 18-Sep-2019 23:19:12 + gain = {} build 18-Sep-2019 23:19:12 + for f in range(len(fields)): build 18-Sep-2019 23:19:12 + gain[f] = mytb.getcell('CPARAM',f) build 18-Sep-2019 23:19:12 + else: # casa 3.3 build 18-Sep-2019 23:19:12 + gain = {} build 18-Sep-2019 23:19:12 +# # gain = mytb.getcol('FPARAM') # 2,128,576 build 18-Sep-2019 23:19:12 + if ('FPARAM' in mytb.colnames()): build 18-Sep-2019 23:19:12 + for f in range(len(fields)): build 18-Sep-2019 23:19:12 + gain[f] = mytb.getcell('FPARAM',f) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + for f in range(len(fields)): build 18-Sep-2019 23:19:12 + gain[f] = mytb.getcell('GAIN',f) build 18-Sep-2019 23:19:12 + nPolarizations = len(gain[0]) build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("(1)Set nPolarizations = %d" % nPolarizations) build 18-Sep-2019 23:19:12 + ggx = {} build 18-Sep-2019 23:19:12 + for g in range(len(gain)): build 18-Sep-2019 23:19:12 + ggx[g] = gain[g][0] build 18-Sep-2019 23:19:12 + if (nPolarizations == 2): build 18-Sep-2019 23:19:12 + ggy = {} build 18-Sep-2019 23:19:12 + for g in range(len(gain)): build 18-Sep-2019 23:19:12 + ggy[g] = gain[g][1] build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("nPolarizations = %s" % (str(nPolarizations))) build 18-Sep-2019 23:19:12 + nRows = len(gain) build 18-Sep-2019 23:19:12 + if (bOverlay): build 18-Sep-2019 23:19:12 + mytb.open(caltable2) build 18-Sep-2019 23:19:12 + gain2 = {} build 18-Sep-2019 23:19:12 + if (ParType == 'Complex'): build 18-Sep-2019 23:19:12 +# # gain2 = mytb.getcol('CPARAM') build 18-Sep-2019 23:19:12 + for f in range(len(fields2)): build 18-Sep-2019 23:19:12 + gain2[f] = mytb.getcell('CPARAM',f) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 +# # gain2 = mytb.getcol('FPARAM') build 18-Sep-2019 23:19:12 + for f in range(len(fields2)): build 18-Sep-2019 23:19:12 + if (tableFormat2 == 34): build 18-Sep-2019 23:19:12 + gain2[f] = mytb.getcell('FPARAM',f) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + gain2[f] = mytb.getcell('GAIN',f) build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + ggx2 = {} build 18-Sep-2019 23:19:12 + for g in range(len(gain2)): build 18-Sep-2019 23:19:12 +# # print("Appending to ggx: ", gain2[g][0]) build 18-Sep-2019 23:19:12 + ggx2[g] = gain2[g][0] build 18-Sep-2019 23:19:12 + nPolarizations2 = len(gain2[0]) build 18-Sep-2019 23:19:12 + if (nPolarizations == 2): build 18-Sep-2019 23:19:12 + ggy2 = {} build 18-Sep-2019 23:19:12 + for g in range(len(gain2)): build 18-Sep-2019 23:19:12 + ggy2[g] = gain2[g][1] build 18-Sep-2019 23:19:12 + nRows2 = len(gain2) build 18-Sep-2019 23:19:12 + if (debug): print("nRows2 = %s" % (str(nRows2))) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (tableFormat == 34): build 18-Sep-2019 23:19:12 + # CAS-6801, unfortunately corr_type is not available in the caltable build 18-Sep-2019 23:19:12 + mytb.open(caltable) build 18-Sep-2019 23:19:12 + spectralWindowTable = mytb.getkeyword('SPECTRAL_WINDOW').split()[1] build 18-Sep-2019 23:19:12 + if ('OBSERVATION' in mytb.getkeywords()): build 18-Sep-2019 23:19:12 + observationTable = mytb.getkeyword('OBSERVATION').split()[1] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + observationTable = None build 18-Sep-2019 23:19:12 + mytb.open(spectralWindowTable) build 18-Sep-2019 23:19:12 + refFreq = mytb.getcol('REF_FREQUENCY') build 18-Sep-2019 23:19:12 + net_sideband = mytb.getcol('NET_SIDEBAND') build 18-Sep-2019 23:19:12 + measFreqRef = mytb.getcol('MEAS_FREQ_REF') build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + corr_type = None build 18-Sep-2019 23:19:12 + if (os.path.exists(msName)): build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + (corr_type, corr_type_string, nPolarizations) = getCorrType(msName,originalSpwsToPlot,mymsmd,debug) build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("4) Could not getCorrType") build 18-Sep-2019 23:19:12 + if (corr_type is None): build 18-Sep-2019 23:19:12 + if (observationTable is None): build 18-Sep-2019 23:19:12 + corr_type, corr_type_string, nPolarizations = getCorrTypeByAntennaName(msAnt[0].lower()) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + telescope = getTelescopeNameFromCaltableObservationTable(observationTable) build 18-Sep-2019 23:19:12 + if (telescope.find('ALMA') >= 0): build 18-Sep-2019 23:19:12 + print("Using telescope name (%s) to set the polarization type." % (telescope)) build 18-Sep-2019 23:19:12 + corr_type_string = ['XX','YY'] build 18-Sep-2019 23:19:12 + corr_type = [9,12] build 18-Sep-2019 23:19:12 + elif (telescope.find('VLA') >= 0): build 18-Sep-2019 23:19:12 + print("Using telescope name (%s) to set the polarization type." % (telescope)) build 18-Sep-2019 23:19:12 + corr_type_string = ['RR','LL'] build 18-Sep-2019 23:19:12 + corr_type = [5,8] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + corr_type, corr_type_string, noPolarizations = getCorrTypeByAntennaName(msAnt[0].lower()) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + if (DEBUG): build 18-Sep-2019 23:19:12 + print("Trying to open %s" % (msName+'/SPECTRAL_WINDOW')) build 18-Sep-2019 23:19:12 + mytb.open(msName+'/SPECTRAL_WINDOW') build 18-Sep-2019 23:19:12 + refFreq = mytb.getcol('REF_FREQUENCY') build 18-Sep-2019 23:19:12 + net_sideband = mytb.getcol('NET_SIDEBAND') build 18-Sep-2019 23:19:12 + measFreqRef = mytb.getcol('MEAS_FREQ_REF') build 18-Sep-2019 23:19:12 + mytb.close() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +# (corr_type, corr_type_string, nPolarizations) = getCorrType(msName, spwsToPlot, mymsmd, debug) build 18-Sep-2019 23:19:12 + (corr_type, corr_type_string, nPolarizations) = getCorrType(msName, originalSpwsToPlot, mymsmd, debug) build 18-Sep-2019 23:19:12 + if (corr_type_string == []): build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("4) Could not open the associated measurement set tables (%s). Will not translate antenna names." % (msName)) build 18-Sep-2019 23:19:12 + mymsmd = '' build 18-Sep-2019 23:19:12 + print("I will assume ALMA data: XX, YY, and refFreq=first channel.") build 18-Sep-2019 23:19:12 +# chanFreqGHz = [] # comment out on 2014-04-08 build 18-Sep-2019 23:19:12 + corr_type_string = ['XX','YY'] build 18-Sep-2019 23:19:12 + corr_type = [9,12] build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (len(polsToPlot) > len(corr_type)): build 18-Sep-2019 23:19:12 + # Necessary for SMA (single-pol) data build 18-Sep-2019 23:19:12 + polsToPlot = corr_type_string build 18-Sep-2019 23:19:12 + casalogPost(debug,"Polarizations to plot = %s" % (str(polsToPlot))) build 18-Sep-2019 23:19:12 + polsToPlot = checkPolsToPlot(polsToPlot, corr_type_string, debug) build 18-Sep-2019 23:19:12 + if (polsToPlot == []): build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (len(msAnt) > 0): build 18-Sep-2019 23:19:12 + msFound = True build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (xaxis.find('freq')>=0 and tableFormat==33): build 18-Sep-2019 23:19:12 + print("Because I could not open the .ms, you cannot use xaxis='freq'.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + if (showatm == True or showtsky==True): build 18-Sep-2019 23:19:12 + print("Because I could not open the .ms, you cannot use showatm or showtsky.") build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (bpoly == False): build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("nPolarizations = %s" % (nPolarizations)) build 18-Sep-2019 23:19:12 + print("nFields = %d = %s" % (nFields, str(uniqueFields))) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (bOverlay and debug): build 18-Sep-2019 23:19:12 + print("nPolarizations2 = %s" % (str(nPolarizations2))) build 18-Sep-2019 23:19:12 + print("nFields2 = %d = %s" % (nFields2, str(uniqueFields2))) build 18-Sep-2019 23:19:12 + print("nRows2 = %s" % (str(nRows2))) build 18-Sep-2019 23:19:12 + uniqueAntennaIds = np.sort(np.unique(ant)) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + yPhaseLabel = 'Phase (deg)' build 18-Sep-2019 23:19:12 + tsysPercent = True build 18-Sep-2019 23:19:12 + ampPercent = True build 18-Sep-2019 23:19:12 + if (VisCal.lower().find('tsys') >= 0): build 18-Sep-2019 23:19:12 + if (channeldiff > 0): build 18-Sep-2019 23:19:12 + if (tsysPercent): build 18-Sep-2019 23:19:12 + yAmplitudeLabel = "Tsys derivative (%_of_median/channel)" build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + yAmplitudeLabel = "Tsys derivative (K/channel)" build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + yAmplitudeLabel = "Tsys (K)" build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (yaxis.lower().find('db')>=0): build 18-Sep-2019 23:19:12 + yAmplitudeLabel = "Amplitude (dB)" build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (channeldiff > 0): build 18-Sep-2019 23:19:12 + if (ampPercent): build 18-Sep-2019 23:19:12 + yAmplitudeLabel = "Amp derivative (%_of_median/channel)" build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + yAmplitudeLabel = "Amplitude derivative" build 18-Sep-2019 23:19:12 + yPhaseLabel = 'Phase derivative (deg/channel)' build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + yAmplitudeLabel = "Amplitude" build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + madsigma = channeldiff # for option channeldiff>0, sets threshold for finding outliers build 18-Sep-2019 23:19:12 + ampMin = LARGE_POSITIVE build 18-Sep-2019 23:19:12 + ampMax = LARGE_NEGATIVE build 18-Sep-2019 23:19:12 + PHASE_ABS_SUM_THRESHOLD = 2e-3 # in degrees, used to avoid printing MAD statistics for refant build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + TDMisSecond = False build 18-Sep-2019 23:19:12 + pagectr = 0 build 18-Sep-2019 23:19:12 + drewAtmosphere = False build 18-Sep-2019 23:19:12 + newpage = 1 build 18-Sep-2019 23:19:12 + pages = [] build 18-Sep-2019 23:19:12 + xctr = 0 build 18-Sep-2019 23:19:12 + myap = 0 # determines whether an amp or phase plot starts the page (in the case of 'both') build 18-Sep-2019 23:19:12 + # zero means amplitude, 1 means phase build 18-Sep-2019 23:19:12 + redisplay = False build 18-Sep-2019 23:19:12 + matchctr = 0 build 18-Sep-2019 23:19:12 + myUniqueColor = [] build 18-Sep-2019 23:19:12 + # for the overlay=antenna case, start by assuming the first antenna is not flagged build 18-Sep-2019 23:19:12 + firstUnflaggedAntennaToPlot = 0 build 18-Sep-2019 23:19:12 + lastUnflaggedAntennaToPlot = len(antennasToPlot) build 18-Sep-2019 23:19:12 + computedAtmSpw = -1 build 18-Sep-2019 23:19:12 + computedAtmTime = -1 build 18-Sep-2019 23:19:12 + computedAtmField = -1 build 18-Sep-2019 23:19:12 + skippingSpwMessageSent = 0 build 18-Sep-2019 23:19:12 + atmString = '' build 18-Sep-2019 23:19:12 + if (showimage and lo1==''): build 18-Sep-2019 23:19:12 + # We only need to run this once per execution. build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("Calling getLOs") build 18-Sep-2019 23:19:12 + getLOsReturnValue = getLOs(msName, verbose=debug) build 18-Sep-2019 23:19:12 + if (getLOsReturnValue != []): build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("Calling interpret LOs") build 18-Sep-2019 23:19:12 + lo1s = interpretLOs(msName,parentms,verbose=debug,mymsmd=mymsmd) build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("Done interpretLOs") build 18-Sep-2019 23:19:12 + foundLO1Message = [] # Initialize so that message is only displayed once per spw build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (channeldiff>0): build 18-Sep-2019 23:19:12 + # build blank dictionary: madstats['DV01']['spw']['time']['pol']['amp' or 'phase' or both] build 18-Sep-2019 23:19:12 + # where spw, time, pol are each integers build 18-Sep-2019 23:19:12 + if (len(msAnt) > 0): build 18-Sep-2019 23:19:12 + madstats = dict.fromkeys(mymsmd.antennanames(antennasToPlot)) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + madstats = dict.fromkeys(['Ant '+str(i) for i in range(len(uniqueAntennaIds))]) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + for i in range(len(madstats)): build 18-Sep-2019 23:19:12 + madstats[madstats.keys()[i]] = dict.fromkeys(spwsToPlot) build 18-Sep-2019 23:19:12 + for j in range(len(spwsToPlot)): build 18-Sep-2019 23:19:12 + madstats[madstats.keys()[i]][spwsToPlot[j]] = dict.fromkeys(timerangeList) # dict.fromkeys(range(len(uniqueTimes))) build 18-Sep-2019 23:19:12 + for k in timerangeList: # range(len(uniqueTimes)): build 18-Sep-2019 23:19:12 + madstats[madstats.keys()[i]][spwsToPlot[j]][k] = dict.fromkeys(range(nPolarizations)) build 18-Sep-2019 23:19:12 + for l in range(nPolarizations): build 18-Sep-2019 23:19:12 + if (yaxis == 'both'): build 18-Sep-2019 23:19:12 + madstats[madstats.keys()[i]][spwsToPlot[j]][k][l] = {'amp': None, 'phase': None} build 18-Sep-2019 23:19:12 + elif (yaxis == 'phase'): build 18-Sep-2019 23:19:12 + madstats[madstats.keys()[i]][spwsToPlot[j]][k][l] = {'phase': None} build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + # this includes tsys and amp build 18-Sep-2019 23:19:12 + madstats[madstats.keys()[i]][spwsToPlot[j]][k][l] = {'amp': None} build 18-Sep-2019 23:19:12 + madstats['platforming'] = {} build 18-Sep-2019 23:19:12 +# # print("madstats = ", madstats) build 18-Sep-2019 23:19:12 + myinput = '' build 18-Sep-2019 23:19:12 + atmEverBeenShown = False build 18-Sep-2019 23:19:12 + spwsToPlotInBaseband = [] build 18-Sep-2019 23:19:12 + frequencyRangeToPlotInBaseband = [] build 18-Sep-2019 23:19:12 + if (debug): print("up to basebands") build 18-Sep-2019 23:19:12 + if (basebands == []): build 18-Sep-2019 23:19:12 + # MS is too old to have BBC_NO build 18-Sep-2019 23:19:12 + if (debug): print("MS is too old to have BBC_NO") build 18-Sep-2019 23:19:12 + spwsToPlotInBaseband = [spwsToPlot] build 18-Sep-2019 23:19:12 + frequencyRangeToPlotInBaseband = [callFrequencyRangeForSpws(mymsmd, spwsToPlot, vm, caltable)] build 18-Sep-2019 23:19:12 + basebands = [0] build 18-Sep-2019 23:19:12 + elif (overlayBasebands): build 18-Sep-2019 23:19:12 + if (debug): print("overlayBaseband") build 18-Sep-2019 23:19:12 + if (list(spwsToPlot) != list(uniqueSpwsInCalTable)): build 18-Sep-2019 23:19:12 + # then spws were requested, so treat them all as if in the same baseband, and build 18-Sep-2019 23:19:12 + # ignore the basebands parameter build 18-Sep-2019 23:19:12 + print("Ignoring the basebands parameter because spws were specified = %s" % (str(spwsToPlot))) build 18-Sep-2019 23:19:12 + elif (np.array_equal(np.sort(basebands), np.sort(allBasebands)) == False): build 18-Sep-2019 23:19:12 + # Allow the basebands parameter to select the spws build 18-Sep-2019 23:19:12 + if (debug): print("Allow the basebands parameter to select the spws") build 18-Sep-2019 23:19:12 + basebandSpwsToPlot = [] build 18-Sep-2019 23:19:12 + for baseband in basebands: build 18-Sep-2019 23:19:12 + myspws = list(getSpwsForBaseband(vis=msName, mymsmd=mymsmd, bb=baseband)) build 18-Sep-2019 23:19:12 + basebandSpwsToPlot += myspws build 18-Sep-2019 23:19:12 + spwsToPlot = np.intersect1d(basebandSpwsToPlot, spwsToPlot) build 18-Sep-2019 23:19:12 + print("selected basebands %s have spwsToPlot = %s" % (str(basebands),str(spwsToPlot))) build 18-Sep-2019 23:19:12 + spwsToPlotInBaseband = [spwsToPlot] # treat all spws as if in the same baseband build 18-Sep-2019 23:19:12 + frequencyRangeToPlotInBaseband = [callFrequencyRangeForSpws(mymsmd, spwsToPlot, vm, caltable)] build 18-Sep-2019 23:19:12 + basebands = [0] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (debug): print("building spwsToPlotInBaseband") build 18-Sep-2019 23:19:12 + for baseband in basebands: build 18-Sep-2019 23:19:12 + myspwlist = [] build 18-Sep-2019 23:19:12 + for spw in spwsToPlot: build 18-Sep-2019 23:19:12 + if (cu.compare_version('>=',[4,1,0]) and msFound): build 18-Sep-2019 23:19:12 + if (mymsmd.baseband(originalSpwsToPlot[list(spwsToPlot).index(spw)]) == baseband): build 18-Sep-2019 23:19:12 + myspwlist.append(spw) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + # need to write a function to retrieve baseband build 18-Sep-2019 23:19:12 + # if (spw != 0): build 18-Sep-2019 23:19:12 + myspwlist.append(spw) build 18-Sep-2019 23:19:12 + spwsToPlotInBaseband.append(myspwlist) build 18-Sep-2019 23:19:12 + frequencyRangeToPlotInBaseband.append(callFrequencyRangeForSpws(mymsmd, myspwlist,vm,caltable)) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + firstTimeMatch = -1 # Aug 5, 2013 build 18-Sep-2019 23:19:12 + finalTimeMatch = -1 # for CAS-7820 build 18-Sep-2019 23:19:12 + groupByBaseband = False # don't activate this parameter yet build 18-Sep-2019 23:19:12 + if (overlaySpws or overlayBasebands): build 18-Sep-2019 23:19:12 + groupByBaseband = True build 18-Sep-2019 23:19:12 + if (groupByBaseband and overlaySpws==False and overlayBasebands==False): build 18-Sep-2019 23:19:12 + showBasebandNumber = True build 18-Sep-2019 23:19:12 + while (xctr < len(antennasToPlot)): build 18-Sep-2019 23:19:12 + xant = antennasToPlot[xctr] build 18-Sep-2019 23:19:12 + bbctr = 0 build 18-Sep-2019 23:19:12 + if (debug): print("---------------------- A) Setting spwctr=0") build 18-Sep-2019 23:19:12 + spwctr = 0 build 18-Sep-2019 23:19:12 + spwctrFirstToPlot = 0 build 18-Sep-2019 23:19:12 + antstring, Antstring = buildAntString(xant,msFound,msAnt) build 18-Sep-2019 23:19:12 + alreadyPlottedAmp = False # needed for (overlay='baseband', yaxis='both') CAS-6477 build 18-Sep-2019 23:19:12 + finalSpwWasFlagged = False # inserted on 22-Apr-2014 for g25.27 build 18-Sep-2019 23:19:12 + while ((bbctr < len(spwsToPlotInBaseband) and groupByBaseband) or build 18-Sep-2019 23:19:12 + (spwctr < len(spwsToPlot) and groupByBaseband==False) build 18-Sep-2019 23:19:12 + ): build 18-Sep-2019 23:19:12 + if (debug): print("at top of bbctr/spwctr loop with bbctr=%d, spwctr=%d" % (bbctr,spwctr)) build 18-Sep-2019 23:19:12 + if (groupByBaseband): build 18-Sep-2019 23:19:12 + baseband = basebands[bbctr] build 18-Sep-2019 23:19:12 + spwsToPlot = spwsToPlotInBaseband[bbctr] build 18-Sep-2019 23:19:12 + if (debug): print("setting spwsToPlot for baseband %d (bbctr=%d) to %s" % (baseband, bbctr, str(spwsToPlot))) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + baseband = 0 # add from here to "ispw=" on 2014-04-05 build 18-Sep-2019 23:19:12 + if (cu.compare_version('>=',[4,1,0])): build 18-Sep-2019 23:19:12 + if (debug): print("A, msName=%s, vis=%s" % (msName,vis)) build 18-Sep-2019 23:19:12 + if (getBasebandDict(vis=msName,caltable=caltable,mymsmd=mymsmd) != {}): build 18-Sep-2019 23:19:12 + if (debug): print("B") build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + baseband = mymsmd.baseband(originalSpwsToPlot[spwctr]) build 18-Sep-2019 23:19:12 + if (debug): print("C") build 18-Sep-2019 23:19:12 + if (baseband not in basebands): build 18-Sep-2019 23:19:12 + if (debug): print("B)incrementing spwctr") build 18-Sep-2019 23:19:12 + spwctr += 1 build 18-Sep-2019 23:19:12 + continue build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + pass build 18-Sep-2019 23:19:12 + if (debug): print("D") build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + if (overlayBasebands): build 18-Sep-2019 23:19:12 + print("Regardless of baseband (%s), plotting all spws: %s" % (basebands,str(spwsToPlot))) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + print("Showing baseband %d containing spws: %s" % (baseband,str(spwsToPlot))) build 18-Sep-2019 23:19:12 + if (bbctr < len(spwsToPlotInBaseband)): build 18-Sep-2019 23:19:12 + if (debug): print("---------------------- B) Setting spwctr=0") build 18-Sep-2019 23:19:12 + spwctr = 0 build 18-Sep-2019 23:19:12 + spwctrFirstToPlot = spwctr build 18-Sep-2019 23:19:12 + firstSpwMatch = -1 build 18-Sep-2019 23:19:12 + while (spwctr < len(spwsToPlot)): build 18-Sep-2019 23:19:12 + if (debug): print("at top of spwctr loop, spwctr=%d" % (spwctr)) build 18-Sep-2019 23:19:12 + allTimesFlaggedOnThisSpw = True # used only by overlay='time' build 18-Sep-2019 23:19:12 + if (groupByBaseband == False): build 18-Sep-2019 23:19:12 + baseband = 0 build 18-Sep-2019 23:19:12 + if (cu.compare_version('>=',[4,1,0])): build 18-Sep-2019 23:19:12 + if (getBasebandDict(vis=msName,caltable=caltable,mymsmd=mymsmd) != {}): build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + baseband = mymsmd.baseband(originalSpwsToPlot[spwctr]) build 18-Sep-2019 23:19:12 + if (baseband not in basebands): build 18-Sep-2019 23:19:12 + # print("spw %d=%d: baseband %d is not in %s" % (spwsToPlot[spwctr],originalSpwsToPlot[spwctr], baseband, basebands)) build 18-Sep-2019 23:19:12 + if (debug): print("Bb)incrementing spwctr") build 18-Sep-2019 23:19:12 + spwctr += 1 build 18-Sep-2019 23:19:12 + continue build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + pass build 18-Sep-2019 23:19:12 + ispw = spwsToPlot[spwctr] build 18-Sep-2019 23:19:12 + ispwInCalTable = list(uniqueSpwsInCalTable).index(ispw) build 18-Sep-2019 23:19:12 + mytime = 0 build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("+++++++ set mytime=0 for ispw=%d, len(chanFreqGHz) = %d" % (ispw, len(chanFreqGHz))) build 18-Sep-2019 23:19:12 + if (overlayAntennas): build 18-Sep-2019 23:19:12 + xctr = -1 build 18-Sep-2019 23:19:12 + if (overlayTimes): build 18-Sep-2019 23:19:12 + # since the times/scans can vary between spws, redefine nUniqueTimes for each spw build 18-Sep-2019 23:19:12 + nUniqueTimes = len(uniqueTimesCopy) build 18-Sep-2019 23:19:12 + uniqueTimes = uniqueTimesCopy[:] build 18-Sep-2019 23:19:12 + uniqueTimesForSpw = [] build 18-Sep-2019 23:19:12 + testtime = 0 build 18-Sep-2019 23:19:12 + while (testtime < nUniqueTimes): build 18-Sep-2019 23:19:12 + if (ispw in cal_desc_id[np.where(uniqueTimes[testtime] == times)[0]]): build 18-Sep-2019 23:19:12 + uniqueTimesForSpw.append(uniqueTimes[testtime]) build 18-Sep-2019 23:19:12 + testtime += 1 build 18-Sep-2019 23:19:12 + uniqueTimes = uniqueTimesForSpw[:] build 18-Sep-2019 23:19:12 + if (tableFormat >= 34): build 18-Sep-2019 23:19:12 + scansForUniqueTimes, nUniqueTimes = computeScansForUniqueTimes(uniqueTimes, cal_scans, times, unique_cal_scans) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + nUniqueTimes = len(uniqueTimes) build 18-Sep-2019 23:19:12 + if (overlaySpws or overlayBasebands): build 18-Sep-2019 23:19:12 + if (xctr >= firstUnflaggedAntennaToPlot): build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("xctr=%d >= firstUnflaggedAntennaToPlot=%d, decrementing spwctr to %d" % (xctr, firstUnflaggedAntennaToPlot,spwctr-1)) build 18-Sep-2019 23:19:12 + spwctr -= 1 build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + firstTimeMatch = -1 build 18-Sep-2019 23:19:12 + while (mytime < nUniqueTimes): build 18-Sep-2019 23:19:12 + finalTimerangeFlagged = False # 04-Aug-2014 build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("mytime = %d < %d, uniqueTimes[mytime] = %s" % (mytime,nUniqueTimes,str(uniqueTimes[mytime]))) build 18-Sep-2019 23:19:12 + print("timerangeList = %s" % (str(timerangeList))) build 18-Sep-2019 23:19:12 + print("timerangeListTimes = %s" % (str(timerangeListTimes))) build 18-Sep-2019 23:19:12 + print("debugSloppyMatch = %s" % (str(debugSloppyMatch))) build 18-Sep-2019 23:19:12 + print("solutionTimeThresholdSeconds = %s" % (str(solutionTimeThresholdSeconds))) build 18-Sep-2019 23:19:12 + if (len(timerangeList) > 0 and (sloppyMatch(uniqueTimes[mytime],timerangeListTimes,solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:12 + mytime, scansToPlot, scansForUniqueTimes, myprint=debugSloppyMatch)==False)): # task version build 18-Sep-2019 23:19:12 +# mytime, scansToPlotPerSpw[ispw], scansForUniqueTimes, myprint=debugSloppyMatch)==False)): # causes infinite loop on test 85 build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("Skipping time %d because it is not in the list: %s" % (mytime, str(timerangeList))) build 18-Sep-2019 23:19:12 + mytime += 1 build 18-Sep-2019 23:19:12 + if (mytime == nUniqueTimes and overlayTimes and overlayAntennas): build 18-Sep-2019 23:19:12 + # added March 14, 2013 to support the case when final timerange is flagged build 18-Sep-2019 23:19:12 + doneOverlayTime = False build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("$$$$$$$$$$$$$$$$$$$$$$ Setting doneOverlayTime=False" % (xframe)) build 18-Sep-2019 23:19:12 + continue build 18-Sep-2019 23:19:12 + if (overlayAntennas): build 18-Sep-2019 23:19:12 + xctr += 1 build 18-Sep-2019 23:19:12 + if (xctr >= len(antennasToPlot)): build 18-Sep-2019 23:19:12 + xctr = 0 build 18-Sep-2019 23:19:12 + xant = antennasToPlot[xctr] build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("mytime=%d, Set xant to %d" % (mytime,xant)) build 18-Sep-2019 23:19:12 + antennaString = '' build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + antennaString = 'Ant%2d: %s, ' % (xant,antstring) build 18-Sep-2019 23:19:12 + if (overlaySpws or overlayBasebands): build 18-Sep-2019 23:19:12 + if (debug): print("C)incrementing spwctr to %d" % (spwctr+1)) build 18-Sep-2019 23:19:12 + spwctr += 1 build 18-Sep-2019 23:19:12 + if (spwctr >= len(spwsToPlot)): build 18-Sep-2019 23:19:12 + if (debug): print("---------------------- C) Setting spwctr=0") build 18-Sep-2019 23:19:12 + spwctr = 0 build 18-Sep-2019 23:19:12 + if (xctr < firstUnflaggedAntennaToPlot): build 18-Sep-2019 23:19:12 + xctr += 1 build 18-Sep-2019 23:19:12 + if (xctr == len(antennasToPlot)): build 18-Sep-2019 23:19:12 + break build 18-Sep-2019 23:19:12 + xant = antennasToPlot[xctr] build 18-Sep-2019 23:19:12 + antstring = buildAntString(xant,msFound,msAnt) build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("mytime=%d, Set xant to %d" % (mytime,xant)) build 18-Sep-2019 23:19:12 + antennaString = 'Ant%2d: %s, ' % (xant,antstring) build 18-Sep-2019 23:19:12 + if (overlayBasebands): build 18-Sep-2019 23:19:12 + # Added on 7/29/2014 to fix infinite loop in uid___A002_X652932_X20fb bandpass build 18-Sep-2019 23:19:12 + if (mytime == nUniqueTimes): build 18-Sep-2019 23:19:12 + spwctr = len(spwsToPlot) build 18-Sep-2019 23:19:12 + break build 18-Sep-2019 23:19:12 + ispw = spwsToPlot[spwctr] build 18-Sep-2019 23:19:12 + ispwInCalTable = list(uniqueSpwsInCalTable).index(ispw) build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("----------------------------- spwctr=%d, ispw set to %d, xctr=%d" % (spwctr,ispw,xctr)) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # This used to be above the previous if/else block build 18-Sep-2019 23:19:12 + if (newpage==1): build 18-Sep-2019 23:19:12 + # add the current page (being created here) to the list build 18-Sep-2019 23:19:12 + pages.append([xctr,spwctr,mytime,0]) build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("top: appending [%d,%d,%d,%d]" % (xctr,spwctr,mytime,0)) build 18-Sep-2019 23:19:12 + newpage = 0 build 18-Sep-2019 23:19:12 + gplotx = [] build 18-Sep-2019 23:19:12 + gploty = [] build 18-Sep-2019 23:19:12 + channels = [] build 18-Sep-2019 23:19:12 + xchannels = [] build 18-Sep-2019 23:19:12 + ychannels = [] build 18-Sep-2019 23:19:12 + frequencies = [] build 18-Sep-2019 23:19:12 + xfrequencies = [] build 18-Sep-2019 23:19:12 + yfrequencies = [] build 18-Sep-2019 23:19:12 + channels2 = [] build 18-Sep-2019 23:19:12 + xchannels2 = [] build 18-Sep-2019 23:19:12 + ychannels2 = [] build 18-Sep-2019 23:19:12 + frequencies2 = [] build 18-Sep-2019 23:19:12 + xfrequencies2 = [] build 18-Sep-2019 23:19:12 + yfrequencies2 = [] build 18-Sep-2019 23:19:12 + gplotx2 = [] build 18-Sep-2019 23:19:12 + gploty2 = [] build 18-Sep-2019 23:19:12 + xflag = [] build 18-Sep-2019 23:19:12 + yflag = [] build 18-Sep-2019 23:19:12 + xflag2 = [] build 18-Sep-2019 23:19:12 + yflag2 = [] build 18-Sep-2019 23:19:12 + matchFound = False build 18-Sep-2019 23:19:12 + matchField = -1 build 18-Sep-2019 23:19:12 + matchRow = -1 build 18-Sep-2019 23:19:12 + matchTime = -1 build 18-Sep-2019 23:19:12 + if (debug): print("looping over all nRows = %d" % (nRows)) build 18-Sep-2019 23:19:12 + for i in range(nRows): build 18-Sep-2019 23:19:12 + if (overlayTimes or overlayAntennas or len(fieldsToPlot)>1 or build 18-Sep-2019 23:19:12 + (nFields>1 and len(fieldlist)= len(refFreq)): build 18-Sep-2019 23:19:12 + myspw = ispw build 18-Sep-2019 23:19:12 + if (msFound and refFreq[myspw]*1e-9 > 60): build 18-Sep-2019 23:19:12 + # Then this cannot be EVLA data. But I should really check the telescope name! build 18-Sep-2019 23:19:12 +# if (refFreq[myspw]*1e-9 > np.mean(frequencies)): build 18-Sep-2019 23:19:12 + if (refFreq[myspw]*1e-9 > np.mean(chanFreqGHz[ispw])): # this is safer (since frequencies might be []) build 18-Sep-2019 23:19:12 + sideband = -1 build 18-Sep-2019 23:19:12 + xlabelString = "%s LSB Frequency (GHz)" % refTypeToString(measFreqRef[myspw]) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + sideband = +1 build 18-Sep-2019 23:19:12 + xlabelString = "%s USB Frequency (GHz)" % refTypeToString(measFreqRef[myspw]) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + sideband = -1 build 18-Sep-2019 23:19:12 + xlabelString = "Frequency (GHz)" build 18-Sep-2019 23:19:12 + if ((len(frequencies)>0) and (chanrange[1] > len(frequencies))): build 18-Sep-2019 23:19:12 + print("Invalid chanrange (%d-%d) for spw%d in caltable1. Valid range = 0-%d" % (chanrange[0],chanrange[1],ispw,len(frequencies)-1)) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + pchannels = [xchannels,ychannels] build 18-Sep-2019 23:19:12 + pfrequencies = [xfrequencies,yfrequencies] build 18-Sep-2019 23:19:12 + gplot = [gplotx,gploty] build 18-Sep-2019 23:19:12 + # We only need to compute the atmospheric transmission if: build 18-Sep-2019 23:19:12 + # * we have been asked to show it, build 18-Sep-2019 23:19:12 + # * there is a non-trivial number of channels, build 18-Sep-2019 23:19:12 + # * the current field is the one for which we should calculate it (if times are being overlaied) build 18-Sep-2019 23:19:12 + # But this will cause no atmcurve to appear if that field is flagged on the first build 18-Sep-2019 23:19:12 + # antenna; so, I added the atmEverBeenShown flag to deal with this. build 18-Sep-2019 23:19:12 + # * the previous calculation is not identical to what this one will be build 18-Sep-2019 23:19:12 + # build 18-Sep-2019 23:19:12 + if ((showatm or showtsky) and (len(xchannels)>1 or len(ychannels)>1) and build 18-Sep-2019 23:19:12 + ((uniqueFields[fieldIndex]==showatmfield or build 18-Sep-2019 23:19:12 + (uniqueFields[fieldIndex] in fieldsToPlot and overlayTimes)) or # this insures a plot if first fieldsToPlot is missing build 18-Sep-2019 23:19:12 + overlayTimes==False or atmEverBeenShown==False) and build 18-Sep-2019 23:19:12 + ((overlayTimes==False and computedAtmField!=fieldIndex) or (computedAtmSpw!=ispw) or build 18-Sep-2019 23:19:12 + (overlayTimes==False and computedAtmTime!=mytime))): build 18-Sep-2019 23:19:12 + atmEverBeenShown = True build 18-Sep-2019 23:19:12 + # The following 'if' is used to avoid wasting time since atm is not shown for build 18-Sep-2019 23:19:12 + # overlay='antenna,time'. build 18-Sep-2019 23:19:12 + if (overlayTimes==False or overlayAntennas==False or True): # support showatm for overlay='antenna,time' build 18-Sep-2019 23:19:12 +# # if (overlayTimes==False or overlayAntennas==False): build 18-Sep-2019 23:19:12 +# # # # print("CAF, CAS, CAT = ", computedAtmField, computedAtmSpw, computedAtmTime) build 18-Sep-2019 23:19:12 + if (type(fieldIndex) == list or type(fieldIndex) == np.ndarray): build 18-Sep-2019 23:19:12 + computedAtmField = fieldIndex[0] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + computedAtmField = fieldIndex build 18-Sep-2019 23:19:12 + computedAtmSpw = ispw build 18-Sep-2019 23:19:12 + computedAtmTime = mytime build 18-Sep-2019 23:19:12 + atmtime = timeUtilities.time() build 18-Sep-2019 23:19:12 + asdm = '' build 18-Sep-2019 23:19:12 +# # # # print("A) uniqueFields[%d] = " % (fieldIndex), uniqueFields[fieldIndex]) build 18-Sep-2019 23:19:12 + uFFI = uniqueFields[fieldIndex] build 18-Sep-2019 23:19:12 + if (type(uFFI) == type(np.ndarray(0))): build 18-Sep-2019 23:19:12 + uFFI = uFFI[0] build 18-Sep-2019 23:19:12 + if (debug): print("converting uFFI from array to %s" % (str(type(uFFI)))) build 18-Sep-2019 23:19:12 + (atmfreq,atmchan,transmission,pwvmean,atmairmass,TebbSky,missingCalWVRErrorPrinted) = \ build 18-Sep-2019 23:19:12 + CalcAtmTransmission(channels, frequencies, xaxis, pwv, build 18-Sep-2019 23:19:12 + vm, mymsmd, msName, asdm, xant, uniqueTimes[mytime], build 18-Sep-2019 23:19:12 + interval, uFFI, refFreq[originalSpw[ispw]], build 18-Sep-2019 23:19:12 + net_sideband[originalSpw[ispw]], mytime, build 18-Sep-2019 23:19:12 + missingCalWVRErrorPrinted, caltable, verbose=DEBUG) build 18-Sep-2019 23:19:12 + if (showimage): build 18-Sep-2019 23:19:12 +# print("len(lo1s)=%d = " % (len(lo1s)), lo1s) build 18-Sep-2019 23:19:12 + if (lo1 != ''): build 18-Sep-2019 23:19:12 + # lo1 was specified on the command line build 18-Sep-2019 23:19:12 + LO1 = lo1 build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (getLOsReturnValue == []): build 18-Sep-2019 23:19:12 + if (lo1 == ''): build 18-Sep-2019 23:19:12 + print("Because you do not have the ASDM_RECEIVER table, if you want the showimage") build 18-Sep-2019 23:19:12 + print("option to work, then you must specify the LO1 frequency with lo1=.") build 18-Sep-2019 23:19:12 +# # # # return() build 18-Sep-2019 23:19:12 + LO1 = lo1 build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (lo1s is None or lo1s == {}): build 18-Sep-2019 23:19:12 + print("Failed to get LO1, disabling showimage. Alternatively, you can use printLOsFromASDM and supply the lo1 parameter to plotbandpass.") build 18-Sep-2019 23:19:12 + showimage = False build 18-Sep-2019 23:19:12 + LO1 = '' build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (originalSpw[ispw] not in lo1s.keys()): build 18-Sep-2019 23:19:12 + print("There is a problem in reading the LO1 values, cannot showimage for this dataset.") build 18-Sep-2019 23:19:12 + showimage = False build 18-Sep-2019 23:19:12 + LO1 = '' build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + LO1 = lo1s[originalSpw[ispw]]*1e-9 build 18-Sep-2019 23:19:12 + if (ispw not in foundLO1Message): build 18-Sep-2019 23:19:12 + casalogPost(debug,"For spw %d (%d), found LO1 = %.6f GHz" % (ispw,originalSpw[ispw],LO1)) build 18-Sep-2019 23:19:12 + foundLO1Message.append(ispw) build 18-Sep-2019 23:19:12 + if (LO1 != '' and LO1 is not None): build 18-Sep-2019 23:19:12 + frequenciesImage = list(2*LO1 - np.array(frequencies)) build 18-Sep-2019 23:19:12 + xfrequenciesImage = list(2*LO1 - np.array(pfrequencies[0])) build 18-Sep-2019 23:19:12 + yfrequenciesImage = list(2*LO1 - np.array(pfrequencies[1])) build 18-Sep-2019 23:19:12 + pfrequenciesImage = [xfrequenciesImage, yfrequenciesImage] build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("B) uniqueFields[%d] = %s" % (fieldIndex, str(uniqueFields[fieldIndex]))) build 18-Sep-2019 23:19:12 + uFFI = uniqueFields[fieldIndex] build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("type(uFFI) = %s" % (str(type(uFFI)))) build 18-Sep-2019 23:19:12 + if (type(uFFI) == list or type(uFFI) == type(np.ndarray(0))): build 18-Sep-2019 23:19:12 + uFFI = uFFI[0] build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("uFFI = %s" % (str(uFFI))) build 18-Sep-2019 23:19:12 + (atmfreqImage,atmchanImage,transmissionImage,pwvmean,atmairmass,TebbSkyImage,missingCalWVRErrorPrinted) = \ build 18-Sep-2019 23:19:12 + CalcAtmTransmission(channels, frequenciesImage, xaxis, build 18-Sep-2019 23:19:12 + pwv, vm, mymsmd, msName, asdm, xant, uniqueTimes[mytime], build 18-Sep-2019 23:19:12 + interval, uFFI, refFreq[originalSpw[ispw]], build 18-Sep-2019 23:19:12 + net_sideband[originalSpw[ispw]], mytime, build 18-Sep-2019 23:19:12 + missingCalWVRErrorPrinted, caltable, verbose=DEBUG) build 18-Sep-2019 23:19:12 + # difference between the requested Atm freq and actual Atm calcuation CAS-7715. No longer necessary after CAS-10228. build 18-Sep-2019 23:19:12 + #chanDifference = atmfreq[0]-frequencies[0] build 18-Sep-2019 23:19:12 + #chanImageDifference = atmfreqImage[0]-frequenciesImage[-1] build 18-Sep-2019 23:19:12 + #print("signal SB difference = %f, image SB difference = %f" % (chanDifference, chanImageDifference)) build 18-Sep-2019 23:19:12 + atmfreqImage = list(2*LO1 - np.array(atmfreqImage)) # + 2*chanDifference + chanImageDifference) # CAS-7715 adds final 2 terms build 18-Sep-2019 23:19:12 + atmchanImage.reverse() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (overlayTimes): build 18-Sep-2019 23:19:12 + atmString = 'PWV %.2fmm, airmass %.2f (field %d)' % (pwvmean,atmairmass,showatmfield) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + atmString = 'PWV %.2fmm, airmass %.3f' % (pwvmean,atmairmass) build 18-Sep-2019 23:19:12 + if (bOverlay): build 18-Sep-2019 23:19:12 + for i in range(nRows2): build 18-Sep-2019 23:19:12 + if (overlayTimes or overlayAntennas or len(fieldsToPlot)>1 or build 18-Sep-2019 23:19:12 + (nFields>1 and len(fieldlist)= len(uniqueTimes2)): build 18-Sep-2019 23:19:12 + # Fix for CAS-9474: avoid calling sloppyMatch because it will crash. build 18-Sep-2019 23:19:12 + # Setting sm=False will result in an abort: "no amp data found in second solution." build 18-Sep-2019 23:19:12 + sm = False build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + sm = sloppyMatch(uniqueTimes2[mytime],times2[i],solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:12 + mytime, scansToPlotPerSpw[ispw], scansForUniqueTimes, # au version build 18-Sep-2019 23:19:12 + myprint=debugSloppyMatch) build 18-Sep-2019 23:19:12 + if ((ant2[i]==xant) and (cal_desc_id2[i]==ispw) and sm build 18-Sep-2019 23:19:12 + and (mytime in timerangeList) # added to match first caltable logic on 2014-04-09 build 18-Sep-2019 23:19:12 + ): build 18-Sep-2019 23:19:12 + if (fields2[i] in fieldsToPlot): build 18-Sep-2019 23:19:12 + xflag2.append(flags2[i][0][:]) build 18-Sep-2019 23:19:12 + yflag2.append(flags2[i][1][:]) build 18-Sep-2019 23:19:12 + # With solint='2ch' or more, the following loop should not be over build 18-Sep-2019 23:19:12 + # chanFreqGHz2 but over the channels in the solution. build 18-Sep-2019 23:19:12 + for j in range(len(chanFreqGHz2[ispw])): build 18-Sep-2019 23:19:12 + channels2.append(j) build 18-Sep-2019 23:19:12 + frequencies2.append(chanFreqGHz2[ispw][j]) build 18-Sep-2019 23:19:12 +# # # # print("len(chanFreqGHz2[%d])=%d, i=%d,j=%d, len(ggx2)=%d, len(ggx2[0])=%d, shape(ggx2) = " % (ispw,len(chanFreqGHz2[ispw]),i,j,len(ggx2),len(ggx2[0])), np.shape(np.array(ggx2))) build 18-Sep-2019 23:19:12 + if (showflagged or (showflagged == False and flags2[i][0][j]==0)): build 18-Sep-2019 23:19:12 + gplotx2.append(ggx2[i][j]) build 18-Sep-2019 23:19:12 + xchannels2.append(j) build 18-Sep-2019 23:19:12 + xfrequencies2.append(chanFreqGHz2[ispw][j]) build 18-Sep-2019 23:19:12 + if (nPolarizations2 == 2): build 18-Sep-2019 23:19:12 + if (showflagged or (showflagged == False and flags2[i][1][j]==0)): build 18-Sep-2019 23:19:12 + gploty2.append(ggy2[i][j]) build 18-Sep-2019 23:19:12 + ychannels2.append(j) build 18-Sep-2019 23:19:12 + yfrequencies2.append(chanFreqGHz2[ispw][j]) build 18-Sep-2019 23:19:12 + # end 'for i' build 18-Sep-2019 23:19:12 + pchannels2 = [xchannels2,ychannels2] build 18-Sep-2019 23:19:12 + pfrequencies2 = [xfrequencies2,yfrequencies2] build 18-Sep-2019 23:19:12 + gplot2 = [gplotx2,gploty2] build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (matchFound==False): build 18-Sep-2019 23:19:12 + if ((overlayAntennas==False and overlaySpws==False and overlayBasebands==False) or build 18-Sep-2019 23:19:12 + (overlayAntennas and xctr+1 >= len(antennasToPlot)) or build 18-Sep-2019 23:19:12 + ((overlaySpws or overlayBasebands) and spwctr+1 >= len(spwsToPlot))): build 18-Sep-2019 23:19:12 + mytime += 1 build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("a) xctr=%d, Incrementing mytime to %d" % (xctr, mytime)) build 18-Sep-2019 23:19:12 + continue build 18-Sep-2019 23:19:12 + # The following variable allows color legend of UT times to match line plot build 18-Sep-2019 23:19:12 + myUniqueTime = [] build 18-Sep-2019 23:19:12 + if (True): # multiFieldsWithOverlayTime): build 18-Sep-2019 23:19:12 + # support multi-fields with overlay='time' build 18-Sep-2019 23:19:12 + uTPFPS = [] build 18-Sep-2019 23:19:12 + for f in fieldIndicesToPlot: build 18-Sep-2019 23:19:12 + for t in uniqueTimesPerFieldPerSpw[ispwInCalTable][f]: build 18-Sep-2019 23:19:12 + if (sloppyMatch(t, timerangeListTimes, solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:12 + mytime, scansToPlotPerSpw[ispw], scansForUniqueTimes, # au version build 18-Sep-2019 23:19:12 +# mytime, scansToPlot, scansForUniqueTimes, # task version build 18-Sep-2019 23:19:12 + myprint=debugSloppyMatch build 18-Sep-2019 23:19:12 + )): build 18-Sep-2019 23:19:12 + uTPFPS.append(t) build 18-Sep-2019 23:19:12 + uTPFPS = np.sort(uTPFPS) build 18-Sep-2019 23:19:12 + ctr = 0 build 18-Sep-2019 23:19:12 + for t in uTPFPS: build 18-Sep-2019 23:19:12 + if (debug and False): build 18-Sep-2019 23:19:12 + print("1)checking time %d" % (t)) build 18-Sep-2019 23:19:12 + if (overlayTimes or overlayAntennas): build 18-Sep-2019 23:19:12 + sm = sloppyMatch(uniqueTimes[mytime],times[i],solutionTimeThresholdSeconds,myprint=False) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + sm = sloppyMatch(t, uniqueTimes[mytime], solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:12 +# mytime, scansToPlot, scansForUniqueTimes, # task version build 18-Sep-2019 23:19:12 + mytime, scansToPlotPerSpw[ispw], scansForUniqueTimes, # au version build 18-Sep-2019 23:19:12 + myprint=debugSloppyMatch build 18-Sep-2019 23:19:12 + ) build 18-Sep-2019 23:19:12 + if (sm): build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("1)setting myUniqueTime to %d" % (mytime)) build 18-Sep-2019 23:19:12 + myUniqueTime = mytime build 18-Sep-2019 23:19:12 + ctr += 1 build 18-Sep-2019 23:19:12 + if (ctr > fieldIndicesToPlot and bOverlay==False): build 18-Sep-2019 23:19:12 + print("multi-field time overlay *************** why are there 2 matches?") build 18-Sep-2019 23:19:12 +# # # # if (ctr == 0): build 18-Sep-2019 23:19:12 +# # # # print("No match for %.1f in "%(t), uTPFPS) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +# # # # print("Overlay antenna %d, myUniqueTime=%d" % (xctr, myUniqueTime)) build 18-Sep-2019 23:19:12 + if (xframe == xframeStart): build 18-Sep-2019 23:19:12 + pb.clf() build 18-Sep-2019 23:19:12 + xflag = [item for sublist in xflag for item in sublist] build 18-Sep-2019 23:19:12 + yflag = [item for sublist in yflag for item in sublist] build 18-Sep-2019 23:19:12 +# # pflag = [xflag, yflag] build 18-Sep-2019 23:19:12 +# # flagfrequencies = [frequencies, frequencies2] build 18-Sep-2019 23:19:12 + antstring, Antstring = buildAntString(xant,msFound,msAnt) build 18-Sep-2019 23:19:12 + if (msFound): build 18-Sep-2019 23:19:12 + fieldString = msFields[uniqueFields[fieldIndex]] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + fieldString = str(field) build 18-Sep-2019 23:19:12 + if (overlayTimes): build 18-Sep-2019 23:19:12 + timeString ='' build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + timeString = ', t%d/%d %s' % (mytime,nUniqueTimes-1,utstring(uniqueTimes[mytime],3)) build 18-Sep-2019 23:19:12 + if (scansForUniqueTimes != []): build 18-Sep-2019 23:19:12 + if (scansForUniqueTimes[mytime]>=0): build 18-Sep-2019 23:19:12 + timeString = ', scan%d %s' % (scansForUniqueTimes[mytime],utstring(uniqueTimes[mytime],3)) build 18-Sep-2019 23:19:12 + spwString = buildSpwString(overlaySpws, overlayBasebands, spwsToPlot, build 18-Sep-2019 23:19:12 + ispw, originalSpw[ispw], observatoryName, build 18-Sep-2019 23:19:12 + baseband, showBasebandNumber) build 18-Sep-2019 23:19:12 + titleString = "%sspw%s, field %d: %s%s" % (antennaString,spwString,uniqueFields[fieldIndex],fieldString,timeString) build 18-Sep-2019 23:19:12 + if (sum(xflag)==nChannels and sum(yflag)==nChannels and showflagged==False): build 18-Sep-2019 23:19:12 + if (overlayTimes): build 18-Sep-2019 23:19:12 + print("Skip %s (%s) for time%d=%s all data flagged" % (antstring, titleString,mytime,utstring(uniqueTimes[mytime],3))) build 18-Sep-2019 23:19:12 + # need to set doneOverlayTime = True if this is the final time, build 18-Sep-2019 23:19:12 + # otherwise, we get "subplot number exceeds total subplots" at line 2427 build 18-Sep-2019 23:19:12 + # but we need to draw the labels at the top of the page, else they will not get done build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("########## uniqueTimes[%d]=%d, timerangeListTimes[-1]=%d" % (mytime,uniqueTimes[mytime],timerangeListTimes[-1])) build 18-Sep-2019 23:19:12 + if (len(scansToPlotPerSpw[ispw]) < 1): build 18-Sep-2019 23:19:12 + sTPPS = [] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 +# sTPPS = [scansToPlot[-1]]# added [[-1]] on 2014-04-04 for CAS-6394 task version build 18-Sep-2019 23:19:12 + sTPPS = [scansToPlotPerSpw[ispw][-1]]# added [[-1]] on 2014-04-04 for CAS-6394 au version build 18-Sep-2019 23:19:12 + if (sloppyMatch(timerangeListTimes[-1], uniqueTimes[mytime], build 18-Sep-2019 23:19:12 + solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:12 + mytime, sTPPS, scansForUniqueTimes, build 18-Sep-2019 23:19:12 + myprint=debugSloppyMatch build 18-Sep-2019 23:19:12 + )): build 18-Sep-2019 23:19:12 + if (overlayAntennas == False or xant==antennasToPlot[-1]): # 11-Mar-2014 build 18-Sep-2019 23:19:12 + doneOverlayTime = True # 08-Nov-2012 build 18-Sep-2019 23:19:12 + finalTimerangeFlagged = True # 04-Aug-2014 build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("###### set doneOverlayTime = %s" % (str(doneOverlayTime))) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + # draw labels build 18-Sep-2019 23:19:12 + # try adding the following 'if' statement on Jun 18, 2013; it works. build 18-Sep-2019 23:19:12 +# if (drewAtmosphere==False or overlayAntennas==False): build 18-Sep-2019 23:19:12 + # Add the 'and not' case to prevent extra atm/fdms shown if one spw's solutions are all flagged build 18-Sep-2019 23:19:12 + if (drewAtmosphere==False or (not overlayAntennas and not allTimesFlaggedOnThisSpw)): build 18-Sep-2019 23:19:12 + if (debug): print("drawOverlayTimeLegends loc 1") build 18-Sep-2019 23:19:12 + drawOverlayTimeLegends(xframe,firstFrame,xstartTitle,ystartTitle, build 18-Sep-2019 23:19:12 + caltable,titlesize,fieldIndicesToPlot, build 18-Sep-2019 23:19:12 + ispwInCalTable,uniqueTimesPerFieldPerSpw, build 18-Sep-2019 23:19:12 + timerangeListTimes, build 18-Sep-2019 23:19:12 + solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:12 + debugSloppyMatch, build 18-Sep-2019 23:19:12 + ystartOverlayLegend,debug,mysize, build 18-Sep-2019 23:19:12 + fieldsToPlot,myUniqueColor, build 18-Sep-2019 23:19:12 + timeHorizontalSpacing,fieldIndex, build 18-Sep-2019 23:19:12 + overlayColors, build 18-Sep-2019 23:19:12 + antennaVerticalSpacing, overlayAntennas, build 18-Sep-2019 23:19:12 + timerangeList, caltableTitle, mytime, build 18-Sep-2019 23:19:12 +# scansToPlot, scansForUniqueTimes) # task version build 18-Sep-2019 23:19:12 + scansToPlotPerSpw[ispw], scansForUniqueTimes) # au version build 18-Sep-2019 23:19:12 + if LO1 is None and type(lo1s) == dict: # Fix for SCOPS-4877 build 18-Sep-2019 23:19:12 + LO1 = lo1s[myspw] # Fix for SCOPS-4877 build 18-Sep-2019 23:19:12 + # CAS-8655 build 18-Sep-2019 23:19:12 + newylimits = drawAtmosphereAndFDM(showatm,showtsky,atmString,subplotRows,mysize, build 18-Sep-2019 23:19:12 + TebbSky,TebbSkyImage,plotrange, xaxis,atmchan, build 18-Sep-2019 23:19:12 + atmfreq,transmission,subplotCols,showatmPoints, build 18-Sep-2019 23:19:12 + xframe, channels,LO1,atmchanImage,atmfreqImage, build 18-Sep-2019 23:19:12 + transmissionImage, firstFrame,showfdm,nChannels, build 18-Sep-2019 23:19:12 + tableFormat,originalSpw_casa33, build 18-Sep-2019 23:19:12 + chanFreqGHz_casa33,originalSpw,chanFreqGHz, build 18-Sep-2019 23:19:12 + overlayTimes, overlayAntennas, xant, build 18-Sep-2019 23:19:12 + antennasToPlot, overlaySpws, baseband, build 18-Sep-2019 23:19:12 + showBasebandNumber, basebandDict, build 18-Sep-2019 23:19:12 + overlayBasebands, drewAtmosphere) build 18-Sep-2019 23:19:12 + drewAtmosphere = True build 18-Sep-2019 23:19:12 + if (xctr == firstUnflaggedAntennaToPlot or overlayAntennas==False): # changed xant->xctr on 11-mar-2014 build 18-Sep-2019 23:19:12 + DrawPolarizationLabelsForOverlayTime(xstartPolLabel,ystartPolLabel,corr_type,polsToPlot, build 18-Sep-2019 23:19:12 + channeldiff,ystartMadLabel,subplotRows,gamp_mad,mysize, build 18-Sep-2019 23:19:12 + ampmarkstyle,markersize,ampmarkstyle2,gamp_std) build 18-Sep-2019 23:19:12 + else: # not overlaying times build 18-Sep-2019 23:19:12 + print("Skip %s spw%d (%s) all data flagged" % (antstring, ispw, titleString)) build 18-Sep-2019 23:19:12 + if ((overlaySpws or overlayBasebands) and spwctr==spwctrFirstToPlot): build 18-Sep-2019 23:19:12 + spwctrFirstToPlot += 1 build 18-Sep-2019 23:19:12 + if ((overlaySpws or overlayBasebands) and ispw==spwsToPlotInBaseband[bbctr][-1]): build 18-Sep-2019 23:19:12 + if (debug): print("The final spw was flagged!!!!!!!!!!!!!!") build 18-Sep-2019 23:19:12 + finalSpwWasFlagged = True # inserted on 22-Apr-2014 for g25.27 build 18-Sep-2019 23:19:12 + if (myinput == 'b'): build 18-Sep-2019 23:19:12 + redisplay = False # This prevents infinite loop when htting 'b' on first screen when ant0 flagged. 2013-03-08 build 18-Sep-2019 23:19:12 + if (overlayAntennas==False and overlayBasebands==False): # 07/30/2014 added overlayBasebands==False build 18-Sep-2019 23:19:12 + if (doneOverlayTime==False or overlayTimes==False): # added on 08-Nov-2012 build 18-Sep-2019 23:19:12 + finalSpwWasFlagged = False # Added on 23-Apr-2014 for regression61 build 18-Sep-2019 23:19:12 + mytime += 1 build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("F) all solutions flagged --> incrementing mytime to %d" % mytime) build 18-Sep-2019 23:19:12 + if (overlayAntennas): build 18-Sep-2019 23:19:12 + if (xctr == firstUnflaggedAntennaToPlot): build 18-Sep-2019 23:19:12 + firstUnflaggedAntennaToPlot += 1 build 18-Sep-2019 23:19:12 + if (firstUnflaggedAntennaToPlot >= len(antennasToPlot)): build 18-Sep-2019 23:19:12 + firstUnflaggedAntennaToPlot = 0 build 18-Sep-2019 23:19:12 + if not finalSpwWasFlagged: # Added on 23-Apr-2014 for regression61 build 18-Sep-2019 23:19:12 + mytime += 1 build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("----- Resetting firstUnflaggedAntennaToPlot from %d to %d = %d" % (firstUnflaggedAntennaToPlot-1, firstUnflaggedAntennaToPlot, antennasToPlot[firstUnflaggedAntennaToPlot])) build 18-Sep-2019 23:19:12 + if (mytime < nUniqueTimes): # Add this 'if' conditional on 9-22-2015 for CAS-7839 build 18-Sep-2019 23:19:12 + continue # Try adding this statement on Apr 2, 2012 to fix bug. build 18-Sep-2019 23:19:12 + mytime -= 1 # Add this on 9-22-2015 for CAS-7839 build 18-Sep-2019 23:19:12 + if (overlaySpws or overlayBasebands): build 18-Sep-2019 23:19:12 + if (xctr == firstUnflaggedAntennaToPlot): build 18-Sep-2019 23:19:12 + firstUnflaggedAntennaToPlot += 1 build 18-Sep-2019 23:19:12 + if (firstUnflaggedAntennaToPlot >= len(antennasToPlot)): build 18-Sep-2019 23:19:12 + firstUnflaggedAntennaToPlot = 0 build 18-Sep-2019 23:19:12 + if not finalSpwWasFlagged: # Added on 22-Apr-2014 for g25.27 dataset antenna='4' build 18-Sep-2019 23:19:12 + if (overlayBasebands == False or spwctr>len(spwsToPlot)): # Added on 7/30/2014 for regression 96 build 18-Sep-2019 23:19:12 + mytime += 1 build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("----- Resetting firstUnflaggedAntennaToPlot from %d to %d" % (firstUnflaggedAntennaToPlot-1, firstUnflaggedAntennaToPlot)) build 18-Sep-2019 23:19:12 + print("----- = antenna %d" % (antennasToPlot[firstUnflaggedAntennaToPlot])) build 18-Sep-2019 23:19:12 + if (not finalSpwWasFlagged): # add this test on Apr 22, 2014 to prevent crash on g25.27 dataset with antenna='4,5' build 18-Sep-2019 23:19:12 + continue # Try this 'continue' on Apr 2, 2012 to fix bug -- works. build 18-Sep-2019 23:19:12 + if (overlayAntennas==False and subplot==11 build 18-Sep-2019 23:19:12 + and not finalSpwWasFlagged # inserted on 22-Apr-2014 for g25.27 build 18-Sep-2019 23:19:12 + and not finalTimerangeFlagged): # inserted on 04-Aug-2014 for CAS-6812 build 18-Sep-2019 23:19:12 + # added the case (subplot==11) on April 22, 2012 to prevent crash on multi-antenna subplot=421 build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("####### removing [%d,%d,%d,%d]" % (pages[len(pages)-1][PAGE_ANT], build 18-Sep-2019 23:19:12 + pages[len(pages)-1][PAGE_SPW], build 18-Sep-2019 23:19:12 + pages[len(pages)-1][PAGE_TIME], build 18-Sep-2019 23:19:12 + pages[len(pages)-1][PAGE_AP])) build 18-Sep-2019 23:19:12 + pages = pages[0:len(pages)-1] build 18-Sep-2019 23:19:12 + newpage = 1 build 18-Sep-2019 23:19:12 + if (overlayAntennas==False): build 18-Sep-2019 23:19:12 + if (doneOverlayTime==False # inserted on 08-Nov-2012 build 18-Sep-2019 23:19:12 + and not finalSpwWasFlagged): # inserted on 22-Apr-2014 for g25.27 build 18-Sep-2019 23:19:12 + continue build 18-Sep-2019 23:19:12 + elif (debug): build 18-Sep-2019 23:19:12 + print("=========== Not continuing because doneOverlayTime=%s" % (str(doneOverlayTime))) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + allTimesFlaggedOnThisSpw = False build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("Not all the data are flagged. doneOverlayTime=%s" % (str(doneOverlayTime))) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (firstSpwMatch == -1): build 18-Sep-2019 23:19:12 + firstSpwMatch = spwctr build 18-Sep-2019 23:19:12 + if (firstTimeMatch == -1): build 18-Sep-2019 23:19:12 + firstTimeMatch = mytime build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("Setting firstTimeMatch from -1 to %s" % (str(firstTimeMatch))) build 18-Sep-2019 23:19:12 + # The following was needed to support overlay='antenna,time' for showatm for QA2 report (CAS-7820) build 18-Sep-2019 23:19:12 + if (finalTimeMatch == -1 or finalTimeMatch < mytime): build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Setting finalTimeMatch from %d to %d" % (finalTimeMatch, mytime)) build 18-Sep-2019 23:19:12 + finalTimeMatch = mytime build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 +################### Here is the amplitude plotting ############ stopping here Sep 4, 2013 build 18-Sep-2019 23:19:12 + if (yaxis.find('amp')>=0 or yaxis.find('both')>=0 or yaxis.find('ap')>=0) and doneOverlayTime==False: build 18-Sep-2019 23:19:12 + if (overlayBasebands and amplitudeWithPhase): # CAS-6477 build 18-Sep-2019 23:19:12 + if (float(xframe/10) != xframe*0.1 and alreadyPlottedAmp): build 18-Sep-2019 23:19:12 + xframe -= 2 build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("amp: xctr=%d, xant=%d, myap=%d, mytime=%d(%s), firstTimeMatch=%d, bOverlay=" % (xctr, xant, myap, mytime, utstring(uniqueTimes[mytime],3), firstTimeMatch), bOverlay) build 18-Sep-2019 23:19:12 + if (myap==1): build 18-Sep-2019 23:19:12 + if (overlayTimes == False or mytime==firstTimeMatch): build 18-Sep-2019 23:19:12 + if ((overlaySpws == False and overlayBasebands==False) or spwctr==spwctrFirstToPlot or spwctr>len(spwsToPlot)): build 18-Sep-2019 23:19:12 + if (overlayAntennas==False or xctr==firstUnflaggedAntennaToPlot build 18-Sep-2019 23:19:12 + or xctr==antennasToPlot[-1]): # 2012-05-24, to fix the case where all ants flagged on one timerange build 18-Sep-2019 23:19:12 + xframe += 1 build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("y) incrementing xframe to %d" % xframe) build 18-Sep-2019 23:19:12 + print("mytime=%d == firstTimeMatch=%d" % (mytime, firstTimeMatch)) build 18-Sep-2019 23:19:12 + print("xctr=%d == firstUnflaggedAntennaToPlot=%d, antennastoPlot[-1]=%d" % (xctr, firstUnflaggedAntennaToPlot,antennasToPlot[-1])) build 18-Sep-2019 23:19:12 + myUniqueColor = [] build 18-Sep-2019 23:19:12 + newylimits = [LARGE_POSITIVE, LARGE_NEGATIVE] build 18-Sep-2019 23:19:12 + else: # (myap == 0) build 18-Sep-2019 23:19:12 + if (overlayTimes == False or mytime==firstTimeMatch): build 18-Sep-2019 23:19:12 + if ((overlaySpws == False and overlayBasebands==False) or build 18-Sep-2019 23:19:12 + spwctr==spwctrFirstToPlot or build 18-Sep-2019 23:19:12 + (overlayBasebands and amplitudeWithPhase) or # CAS-6477 build 18-Sep-2019 23:19:12 + spwctr>len(spwsToPlot)): build 18-Sep-2019 23:19:12 + if (overlayAntennas==False or xctr==firstUnflaggedAntennaToPlot build 18-Sep-2019 23:19:12 + or xctr>antennasToPlot[-1]): # 2012-05-24, to fix the case where all ants flagged on one timerange build 18-Sep-2019 23:19:12 + xframe += 1 build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("Y) incrementing xframe to %d" % xframe) build 18-Sep-2019 23:19:12 + print("mytime=%d == firstTimeMatch=%d" % (mytime, firstTimeMatch)) build 18-Sep-2019 23:19:12 + print("xctr=%d == firstUnflaggedAntennaToPlot=%d, antennasToPlot[-1]=%d" % (xctr, firstUnflaggedAntennaToPlot,antennasToPlot[-1])) build 18-Sep-2019 23:19:12 + print("spwctr=%d >? len(spwsToPlot)=%d" % (spwctr, len(spwsToPlot))) build 18-Sep-2019 23:19:12 + myUniqueColor = [] build 18-Sep-2019 23:19:12 + newylimits = [LARGE_POSITIVE, LARGE_NEGATIVE] build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("myap=%d, mytime == firstTimeMatch=%d" % (myap, firstTimeMatch)) build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("$$$$$$$$$$$$$$$$$$$$$$$ ready to plot amp on xframe %d" % (xframe)) build 18-Sep-2019 23:19:12 +# # # # print(",,,,,,,,,,,,,,,, Starting with newylimits = ", newylimits) build 18-Sep-2019 23:19:12 + adesc = pb.subplot(xframe) build 18-Sep-2019 23:19:12 + if (previousSubplot != xframe): build 18-Sep-2019 23:19:12 + drewAtmosphere = False build 18-Sep-2019 23:19:12 + previousSubplot = xframe build 18-Sep-2019 23:19:12 + alreadyPlottedAmp = True # needed for (overlay='baseband', yaxis='both') CAS-6477 build 18-Sep-2019 23:19:12 + pb.hold(overlayAntennas or overlayTimes or overlaySpws or overlayBasebands) build 18-Sep-2019 23:19:12 + gampx = np.abs(gplotx) build 18-Sep-2019 23:19:12 + if (nPolarizations == 2): build 18-Sep-2019 23:19:12 + gampy = np.abs(gploty) build 18-Sep-2019 23:19:12 + if (yaxis.lower().find('db') >= 0): build 18-Sep-2019 23:19:12 + gamp = [10*np.log10(gampx), 10*np.log10(gampy)] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (channeldiff>0): build 18-Sep-2019 23:19:12 + if (debug): print("Computing derivatives") build 18-Sep-2019 23:19:12 + if (xaxis == 'chan'): build 18-Sep-2019 23:19:12 + gamp0, newx0, gamp0res, newx0res = channelDifferences(gampx, pchannels[0], resample) build 18-Sep-2019 23:19:12 + gamp1, newx1, gamp1res, newx1res = channelDifferences(gampy, pchannels[1], resample) build 18-Sep-2019 23:19:12 + pchannels = [newx0, newx1] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + gamp0, newx0, gamp0res, newx0res = channelDifferences(gampx, pfrequencies[0], resample) build 18-Sep-2019 23:19:12 + gamp1, newx1, gamp1res, newx1res = channelDifferences(gampy, pfrequencies[1], resample) build 18-Sep-2019 23:19:12 + pfrequencies = [newx0, newx1] build 18-Sep-2019 23:19:12 + gamp = [gamp0, gamp1] build 18-Sep-2019 23:19:12 + gampres = [gamp0res, gamp1res] build 18-Sep-2019 23:19:12 + if (VisCal.lower().find('tsys') >= 0 and tsysPercent): build 18-Sep-2019 23:19:12 + gamp = [100*gamp0/np.median(gampx), 100*gamp1/np.median(gampy)] build 18-Sep-2019 23:19:12 + gampres = [100*gamp0res/np.median(gampx), 100*gamp1res/np.median(gampy)] build 18-Sep-2019 23:19:12 + elif (VisCal.lower().find('tsys') < 0 and ampPercent): build 18-Sep-2019 23:19:12 + gamp = [100*gamp0/np.median(gampx), 100*gamp1/np.median(gampy)] build 18-Sep-2019 23:19:12 + gampres = [100*gamp0res/np.median(gampx), 100*gamp1res/np.median(gampy)] build 18-Sep-2019 23:19:12 + gamp_mad = [madInfo(gamp[0],madsigma,edge), madInfo(gamp[1],madsigma,edge)] build 18-Sep-2019 23:19:12 + gamp_std = [stdInfo(gampres[0],madsigma,edge,ispw,xant,0), stdInfo(gampres[1],madsigma,edge,ispw,xant,1)] build 18-Sep-2019 23:19:12 + if (debug): print("gamp_mad done") build 18-Sep-2019 23:19:12 + if (platformingSigma > 0): build 18-Sep-2019 23:19:12 + platformingThresholdX = gamp_mad[0]['mad']*platformingSigma build 18-Sep-2019 23:19:12 + platformingThresholdY = gamp_mad[1]['mad']*platformingSigma build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + platformingThresholdX = platformingThreshold build 18-Sep-2019 23:19:12 + platformingThresholdY = platformingThreshold build 18-Sep-2019 23:19:12 + gamp_platforming = [platformingCheck(gamp[0],platformingThresholdX), build 18-Sep-2019 23:19:12 + platformingCheck(gamp[1],platformingThresholdY)] build 18-Sep-2019 23:19:12 + for p in [0,1]: build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("gamp_mad[%d] = %s" % (p, str(gamp_mad[p]))) build 18-Sep-2019 23:19:12 + print("madstats[%s][%d] = %s" % (Antstring,ispw, str(madstats[Antstring][ispw]))) build 18-Sep-2019 23:19:12 + madstats[Antstring][ispw][mytime][p]['amp'] = gamp_mad[p]['mad'] build 18-Sep-2019 23:19:12 + madstats[Antstring][ispw][mytime][p]['ampstd'] = gamp_std[p]['std'] build 18-Sep-2019 23:19:12 + if (gamp_platforming[p]): build 18-Sep-2019 23:19:12 + if (Antstring not in madstats['platforming'].keys()): build 18-Sep-2019 23:19:12 + madstats['platforming'][Antstring] = {} build 18-Sep-2019 23:19:12 + if (ispw not in madstats['platforming'][Antstring].keys()): build 18-Sep-2019 23:19:12 + madstats['platforming'][Antstring][ispw] = {} build 18-Sep-2019 23:19:12 + if (p not in madstats['platforming'][Antstring][ispw].keys()): build 18-Sep-2019 23:19:12 + madstats['platforming'][Antstring][ispw][p] = [] build 18-Sep-2019 23:19:12 + madstats['platforming'][Antstring][ispw][p].append(uniqueTimes[mytime]) build 18-Sep-2019 23:19:12 + if (gamp_mad[p]['nchan'] > 0): build 18-Sep-2019 23:19:12 + casalogPost(debug, "%s, Pol %d, spw %2d, %s, amp: %4d points exceed %.1f sigma (worst=%.2f at chan %d)" % (Antstring, p, ispw, utstring(uniqueTimes[mytime],0), gamp_mad[p]['nchan'], madsigma, gamp_mad[p]['outlierValue'], gamp_mad[p]['outlierChannel']+pchannels[p][0])) build 18-Sep-2019 23:19:12 + if (debug): print("madstats done") build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + gamp = [gampx,gampy] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (yaxis.lower().find('db') >= 0): build 18-Sep-2019 23:19:12 + gamp = [10*np.log10(gampx)] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (channeldiff>0): build 18-Sep-2019 23:19:12 + if (xaxis == 'chan'): build 18-Sep-2019 23:19:12 + gamp0, newx0, gamp0res, newx0res = channelDifferences(gampx, pchannels[0], resample) build 18-Sep-2019 23:19:12 + pchannels = [newx0] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + gamp0, newx0, gamp0res, newx0res = channelDifferences(gampx, pfrequencies[0], resample) build 18-Sep-2019 23:19:12 + pfrequencies = [newx0] build 18-Sep-2019 23:19:12 + gamp = [gamp0] build 18-Sep-2019 23:19:12 + gampres = [gamp0res] build 18-Sep-2019 23:19:12 + if (VisCal.lower().find('tsys') >= 0 and tsysPercent): build 18-Sep-2019 23:19:12 + gamp = [100*gamp0/np.median(gampx)] build 18-Sep-2019 23:19:12 + gampres = [100*gamp0res/np.median(gampx)] build 18-Sep-2019 23:19:12 + elif (VisCal.lower().find('tsys') < 0 and ampPercent): build 18-Sep-2019 23:19:12 + gamp = [100*gamp0/np.median(gampx)] build 18-Sep-2019 23:19:12 + gampres = [100*gamp0res/np.median(gampx)] build 18-Sep-2019 23:19:12 + p = 0 build 18-Sep-2019 23:19:12 + gamp_mad = [madInfo(gamp[p], madsigma,edge)] build 18-Sep-2019 23:19:12 + gamp_std = [stdInfo(gampres[p], madsigma,edge,ispw,xant,p)] build 18-Sep-2019 23:19:12 + if (platformingSigma > 0): build 18-Sep-2019 23:19:12 + platformingThresholdX = gamp_mad[0]['mad']*platformingSigma build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + platformingThresholdX = platformingThreshold build 18-Sep-2019 23:19:12 + gamp_platforming = [platformingCheck(gamp[p], platformingThresholdX)] build 18-Sep-2019 23:19:12 + madstats[Antstring][ispw][mytime][p]['amp'] = gamp_mad[p]['mad'] build 18-Sep-2019 23:19:12 + madstats[Antstring][ispw][mytime][p]['ampstd'] = gamp_std[p]['std'] build 18-Sep-2019 23:19:12 + if (gamp_platforming[p]): build 18-Sep-2019 23:19:12 + if (Antstring not in madstats['platforming'].keys()): build 18-Sep-2019 23:19:12 + madstats['platforming'][Antstring] = {} build 18-Sep-2019 23:19:12 + if (ispw not in madstats['platforming'][Antstring].keys()): build 18-Sep-2019 23:19:12 + madstats['platforming'][Antstring][ispw] = {} build 18-Sep-2019 23:19:12 + if (p not in madstats['platforming'][Antstring][ispw].keys()): build 18-Sep-2019 23:19:12 + madstats['platforming'][Antstring][ispw][p] = [] build 18-Sep-2019 23:19:12 + madstats['platforming'][Antstring][ispw][p].append(mytime) build 18-Sep-2019 23:19:12 + if (gamp_mad[p]['nchan'] > 0): build 18-Sep-2019 23:19:12 + casalogPost(debug, "%s, Pol %d, spw %2d, %s, amp: %4d points exceed %.1f sigma (worst=%.2f at chan %d)" % (Antstring, p, ispw, utstring(uniqueTimes[mytime],0), gamp_mad[p]['nchan'], madsigma, gamp_mad[p]['outlierValue'], gamp_mad[p]['outlierChannel']+pchannels[p][0])) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + gamp = [gampx] build 18-Sep-2019 23:19:12 + if (bOverlay): build 18-Sep-2019 23:19:12 + gampx2 = np.abs(gplotx2) build 18-Sep-2019 23:19:12 + if (nPolarizations2 == 2): build 18-Sep-2019 23:19:12 + gampy2 = np.abs(gploty2) build 18-Sep-2019 23:19:12 + if (yaxis.lower().find('db') >= 0): build 18-Sep-2019 23:19:12 + gamp2 = [10*np.log10(gampx2), 10*np.log10(gampy2)] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (channeldiff>0): build 18-Sep-2019 23:19:12 + if (xaxis == 'chan'): build 18-Sep-2019 23:19:12 + gamp2_0, newx0, gamp2_0res, newx0res = channelDifferences(gampx2, pchannels2[0], resample) build 18-Sep-2019 23:19:12 + gamp2_1, newx1, gamp2_1res, newx1res = channelDifferences(gampy2, pchannels2[1], resample) build 18-Sep-2019 23:19:12 + pchannels2 = [newx0, newx1] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + gamp2_0, newx0, gamp2_0res, newx0res = channelDifferences(gampx2, pfrequencies2[0], resample) build 18-Sep-2019 23:19:12 + gamp2_1, newx1, gamp2_1res, newx1res = channelDifferences(gampy2, pfrequencies2[1], resample) build 18-Sep-2019 23:19:12 + pfrequencies2 = [newx0, newx1] build 18-Sep-2019 23:19:12 + gamp2 = [gamp2_0, gamp2_1] build 18-Sep-2019 23:19:12 + gamp2res = [gamp2_0res, gamp2_1res] build 18-Sep-2019 23:19:12 + if (VisCal.lower().find('tsys') >= 0 and tsysPercent): build 18-Sep-2019 23:19:12 + gamp2 = [100*gamp2_0/np.median(gampx2), 100*gamp2_1/np.median(gampy2)] build 18-Sep-2019 23:19:12 + gamp2res = [100*gamp2_0res/np.median(gampx2), 100*gamp2_1res/np.median(gampy2)] build 18-Sep-2019 23:19:12 + elif (VisCal.lower().find('tsys') < 0 and ampPercent): build 18-Sep-2019 23:19:12 + gamp2 = [100*gamp2_0/np.median(gampx2), 100*gamp2_1/np.median(gampy2)] build 18-Sep-2019 23:19:12 + gamp2res = [100*gamp2_0res/np.median(gampx2), 100*gamp2_1res/np.median(gampy2)] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + gamp2 = [gampx2, gampy2] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (yaxis.lower().find('db') >= 0): build 18-Sep-2019 23:19:12 + gamp2 = [10*np.log10(gampx2)] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (channeldiff>0): build 18-Sep-2019 23:19:12 + if (xaxis == 'chan'): build 18-Sep-2019 23:19:12 + gamp2_0, newx0, gamp2_0res, newx0res = channelDifferences(gampx2, pchannels[0], resample) build 18-Sep-2019 23:19:12 + pchannels2 = [newx0] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + gamp2_0, newx0, gamp2_0res, newx0res = channelDifferences(gampx2, pfrequencies[0], resample) build 18-Sep-2019 23:19:12 + pfrequencies2 = [newx0] build 18-Sep-2019 23:19:12 + gamp2 = [gamp2_0] build 18-Sep-2019 23:19:12 + gamp2res = [gamp2_0res] build 18-Sep-2019 23:19:12 + if (VisCal.lower().find('tsys') >= 0 and tsysPercent): build 18-Sep-2019 23:19:12 + gamp2 = [100*gamp2_0/np.median(gampx2)] build 18-Sep-2019 23:19:12 + gamp2res = [100*gamp2_0res/np.median(gampx2)] build 18-Sep-2019 23:19:12 + elif (VisCal.lower().find('tsys') < 0 and ampPercent): build 18-Sep-2019 23:19:12 + gamp2 = [100*gamp2_0/np.median(gampx2)] build 18-Sep-2019 23:19:12 + gamp2res = [100*gamp2_0res/np.median(gampx2)] build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + gamp2 = [gampx2] build 18-Sep-2019 23:19:12 + if (xaxis.find('chan')>=0 or (msFound==False and tableFormat==33)): # 'amp' build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("amp: plot vs. channel **********************") build 18-Sep-2019 23:19:12 + pb.hold(True) build 18-Sep-2019 23:19:12 + for p in range(nPolarizations): build 18-Sep-2019 23:19:12 + if (overlayAntennas or overlayTimes): build 18-Sep-2019 23:19:12 + if (corr_type_string[p] in polsToPlot): build 18-Sep-2019 23:19:12 + pdesc = pb.plot(pchannels[p],gamp[p],'%s'%ampmarkstyles[p], build 18-Sep-2019 23:19:12 + markersize=markersize, build 18-Sep-2019 23:19:12 + markerfacecolor=overlayColors[xctr],markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + newylimits = recalcYlimits(plotrange,newylimits,gamp[p]) build 18-Sep-2019 23:19:12 + if (overlayAntennas and overlayTimes==False): build 18-Sep-2019 23:19:12 + pb.setp(pdesc, color=overlayColors[xctr]) build 18-Sep-2019 23:19:12 + elif (overlayTimes and overlayAntennas==False): build 18-Sep-2019 23:19:12 + pb.setp(pdesc, color=overlayColors[mytime]) build 18-Sep-2019 23:19:12 + elif (overlayTimes and overlayAntennas): # try to support time,antenna build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("p=%d, len(fieldsToPlot)=%d, len(timerangeList)=%d" % (p,len(fieldsToPlot),len(timerangeList))) build 18-Sep-2019 23:19:12 + if (len(fieldsToPlot) > 1 or len(timerangeList)>1): build 18-Sep-2019 23:19:12 +# pb.setp(pdesc, color=overlayColors[myUniqueTime]) build 18-Sep-2019 23:19:12 +# # # # print("pb.setp: myUniqueTime, overlayColors = ", myUniqueTime, overlayColors[myUniqueTime]) build 18-Sep-2019 23:19:12 + # The third 'or' below is needed if pol='0' is flagged on antenna 0. -- 2012/10/12 build 18-Sep-2019 23:19:12 + if (p==0 or len(polsToPlot)==1 or myUniqueColor==[]): build 18-Sep-2019 23:19:12 + myUniqueColor.append(overlayColors[len(myUniqueColor)]) build 18-Sep-2019 23:19:12 + pb.setp(pdesc, color=myUniqueColor[-1]) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (corr_type_string[p] in polsToPlot): build 18-Sep-2019 23:19:12 +# # # # print("pcolor[%d]=%s" % (p,pcolor)) build 18-Sep-2019 23:19:12 + pb.plot(pchannels[p],gamp[p],'%s%s'%(pcolor[p],ampmarkstyle), markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + newylimits = recalcYlimits(plotrange,newylimits,gamp[p]) build 18-Sep-2019 23:19:12 + if (sum(xflag)>0): build 18-Sep-2019 23:19:12 + myxrange = np.max(channels)-np.min(channels) build 18-Sep-2019 23:19:12 + SetNewXLimits([np.min(channels)-myxrange/20, np.max(channels)+myxrange/20],1) build 18-Sep-2019 23:19:12 +# # # # print("amp: Resetting xaxis channel range to counteract flagged data") build 18-Sep-2019 23:19:12 + if (xframe in bottomRowFrames or (xctr+1==len(antennasToPlot) and ispw==spwsToPlot[-1])): build 18-Sep-2019 23:19:12 + pb.xlabel("Channel", size=mysize) build 18-Sep-2019 23:19:12 + elif (xaxis.find('freq')>=0): # amp build 18-Sep-2019 23:19:12 + if (bOverlay): build 18-Sep-2019 23:19:12 + pb.hold(True) build 18-Sep-2019 23:19:12 + myxrange = np.abs(xfrequencies[0]-xfrequencies[-1]) build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + xrange2 = np.abs(xfrequencies2[0]-xfrequencies2[-1]) build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("No amp data found in second solution. Try increasing the solutionTimeThresholdSeconds above %.0f." % (solutionTimeThresholdSeconds)) build 18-Sep-2019 23:19:12 + print("If this doesn't work, email the developer (%s)." % (developerEmail)) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (np.abs(myxrange/xrange2 - 1) > 0.05 + len(xflag)/len(xchannels)): # 0.0666 is 2000/1875-1 build 18-Sep-2019 23:19:12 + # These line widths are optimal for visualizing FDM over TDM build 18-Sep-2019 23:19:12 + width1 = 1 build 18-Sep-2019 23:19:12 + width2 = 4 build 18-Sep-2019 23:19:12 + # solutions differ in frequency width build 18-Sep-2019 23:19:12 + if (myxrange < xrange2): build 18-Sep-2019 23:19:12 + for p in range(nPolarizations): build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:12 + pb.plot(pfrequencies[p], gamp[p], '%s%s'%(pcolor[p],ampmarkstyle), linewidth=width2, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gamp[p], sideband,plotrange,xchannels,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:12 + for p in range(nPolarizations): build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:12 + pb.plot(pfrequencies2[p], gamp2[p], '%s%s'%(p2color[p],ampmarkstyle), linewidth=width1, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gamp2[p], sideband,plotrange,xchannels2,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + for p in range(nPolarizations): build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:12 + pb.plot(pfrequencies2[p], gamp2[p], '%s%s'%(p2color[p],ampmarkstyle), linewidth=width2, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gamp2[p], sideband,plotrange,xchannels2,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:12 + for p in range(nPolarizations): build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:12 + pb.plot(pfrequencies[p], gamp[p], '%s%s'%(pcolor[p],ampmarkstyle), linewidth=width1, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gamp[p], sideband,plotrange,xchannels,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + width1 = 1 build 18-Sep-2019 23:19:12 + width2 = 2 # Just enough to distinguish one line from the other. build 18-Sep-2019 23:19:12 + # solutions may be different level of smoothing, so plot highest rms first build 18-Sep-2019 23:19:12 + if (MAD(gamp[0]) < MAD(gamp2[0])): build 18-Sep-2019 23:19:12 + for p in range(nPolarizations): build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:12 + pb.plot(pfrequencies2[p], gamp2[p], '%s%s'%(p2color[p],ampmarkstyle), linewidth=width1, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gamp2[p], sideband,plotrange,xchannels2,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:12 + for p in range(nPolarizations): build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:12 + pb.plot(pfrequencies[p], gamp[p], '%s%s'%(pcolor[p],ampmarkstyle), linewidth=width2, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gamp[p], sideband,plotrange,xchannels,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + for p in range(nPolarizations): build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:12 + pb.plot(pfrequencies[p], gamp[p], '%s%s'%(pcolor[p],ampmarkstyle), linewidth=width2, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gamp[p], sideband,plotrange,xchannels,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:12 + for p in range(nPolarizations): build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:12 + pb.plot(pfrequencies2[p], gamp2[p], '%s%s'%(p2color[p],ampmarkstyle), linewidth=width1, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gamp2[p], sideband,plotrange,xchannels2,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:12 + # must set new limits after plotting 'amp' build 18-Sep-2019 23:19:12 + if (zoom=='intersect'): build 18-Sep-2019 23:19:12 + if (myxrange < xrange2): build 18-Sep-2019 23:19:12 + SetNewXLimits([min(xfrequencies[0],xfrequencies[-1])-myxrange*0.1, max(xfrequencies[0],xfrequencies[-1])+myxrange*0.1],2) build 18-Sep-2019 23:19:12 + SetLimits(plotrange, chanrange, newylimits, channels, frequencies, build 18-Sep-2019 23:19:12 + pfrequencies, ampMin, ampMax, xaxis, pxl, chanrangeSetXrange, build 18-Sep-2019 23:19:12 + chanrangePercent) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 +# # # # print("len(xfrequencies2) = ", len(xfrequencies2)) build 18-Sep-2019 23:19:12 + SetNewXLimits([min(xfrequencies2[0],xfrequencies2[-1])-xrange2*0.1, max(xfrequencies2[0],xfrequencies2[-1])+xrange2*0.1],3) build 18-Sep-2019 23:19:12 + slstatus = SetLimits(plotrange, chanrange, newylimits, channels, frequencies2, build 18-Sep-2019 23:19:12 + pfrequencies2, ampMin, ampMax, xaxis, pxl, chanrangeSetXrange, build 18-Sep-2019 23:19:12 + chanrangePercent) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (myxrange < xrange2): build 18-Sep-2019 23:19:12 + SetLimits(plotrange, chanrange, newylimits, channels, frequencies, build 18-Sep-2019 23:19:12 + pfrequencies, ampMin, ampMax, xaxis, pxl, chanrangeSetXrange, build 18-Sep-2019 23:19:12 + chanrangePercent) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + SetLimits(plotrange, chanrange, newylimits, channels, frequencies2, build 18-Sep-2019 23:19:12 + pfrequencies2, ampMin, ampMax, xaxis, pxl, chanrangeSetXrange, build 18-Sep-2019 23:19:12 + chanrangePercent) build 18-Sep-2019 23:19:12 + # draw polarization and spw labels build 18-Sep-2019 23:19:12 + if (xframe == firstFrame): build 18-Sep-2019 23:19:12 + # draw title including caltable name build 18-Sep-2019 23:19:12 + caltableList = 'c1 = ' + caltable + ', c2 = ' + caltable2 # + ' (%s)'%(utstring(uniqueTimes2[mytime],3)) build 18-Sep-2019 23:19:12 + pb.text(xstartTitle, ystartTitle, caltableList, size=titlesize, build 18-Sep-2019 23:19:12 + color='k', transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:12 + elif (bpolyOverlay): build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("in bpolyOverlay **********************************") build 18-Sep-2019 23:19:12 + matches1 = [] build 18-Sep-2019 23:19:12 + for tbp in range(len(timesBP)): build 18-Sep-2019 23:19:12 + if (sloppyMatch(uniqueTimes[mytime], timesBP[tbp], solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:12 + mytime, scansToPlotPerSpw[ispw], scansForUniqueTimes, # au version build 18-Sep-2019 23:19:12 +# mytime, scansToPlot, scansForUniqueTimes, # task version build 18-Sep-2019 23:19:12 + myprint=debugSloppyMatch build 18-Sep-2019 23:19:12 + )): build 18-Sep-2019 23:19:12 + matches1.append(tbp) build 18-Sep-2019 23:19:12 + matches1 = np.array(matches1) build 18-Sep-2019 23:19:12 + if (len(matches1) < 1): build 18-Sep-2019 23:19:12 + print("No time match found between %.1f and %s" % (uniqueTimes[mytime], str(timesBP))) build 18-Sep-2019 23:19:12 + print("If you are sure the solutions correspond to the same data, you can set solutionTimeThresholdSeconds>=%.0f" % (1+np.ceil(np.abs(timesBP[0]-uniqueTimes[mytime])))) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + matches2 = np.where(xant == np.array(antennasBP))[0] build 18-Sep-2019 23:19:12 + if (len(matches2) < 1): build 18-Sep-2019 23:19:12 + print("No antenna match found: %s" % (str(xant), str(antennasBP))) build 18-Sep-2019 23:19:12 + if (tableFormat == 33): build 18-Sep-2019 23:19:12 + matches3 = np.where(ispw == np.array(cal_desc_idBP))[0] build 18-Sep-2019 23:19:12 + if (len(matches3) < 1): build 18-Sep-2019 23:19:12 + print("No spw match found: %d not in %s" % (ispw, str(cal_desc_idBP))) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + matches3 = np.where(ispw == np.array(spwBP))[0] build 18-Sep-2019 23:19:12 + if (len(matches3) < 1): build 18-Sep-2019 23:19:12 + print("No spw match found: %d not in %s" % (ispw, str(spwBP))) build 18-Sep-2019 23:19:12 + matches12 = np.intersect1d(matches1,matches2) build 18-Sep-2019 23:19:12 + if (len(matches12) < 1): build 18-Sep-2019 23:19:12 + print("No time+antenna match between: %s and %s" % (str(matches1), str(matches2))) build 18-Sep-2019 23:19:12 + matches = np.intersect1d(matches12, matches3) build 18-Sep-2019 23:19:12 + if (len(matches) < 1): build 18-Sep-2019 23:19:12 + print("No time+antenna+spw match between: %s and %s" % (str(matches12), str(matches3))) build 18-Sep-2019 23:19:12 + try: build 18-Sep-2019 23:19:12 + index = matches[0] build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("Match = %d ***********************************" % (index)) build 18-Sep-2019 23:19:12 + except: build 18-Sep-2019 23:19:12 + print("No match found for time=%.6f, xant=%d, ispw=%d" % (uniqueTimes[mytime],xant,ispw)) build 18-Sep-2019 23:19:12 + print("antennasBP = %s" % (str(antennasBP))) build 18-Sep-2019 23:19:12 + print("cal_desc_idBP = %s" % (str(cal_desc_idBP))) build 18-Sep-2019 23:19:12 + timesBPstring = 'timesBP = ' build 18-Sep-2019 23:19:12 + for i in timesBP: build 18-Sep-2019 23:19:12 + timesBPstring += "%.6f, " % i build 18-Sep-2019 23:19:12 + print(timesBPstring) build 18-Sep-2019 23:19:12 + return() build 18-Sep-2019 23:19:12 + validDomain = [frequencyLimits[0,index], frequencyLimits[1,index]] build 18-Sep-2019 23:19:12 + cc = calcChebyshev(polynomialAmplitude[index][0:nPolyAmp[index]], validDomain, frequenciesGHz[index]*1e+9) build 18-Sep-2019 23:19:12 + if (debug): print("Done calcChebyshev 1") build 18-Sep-2019 23:19:12 + fa = np.array(frequenciesGHz[index]) build 18-Sep-2019 23:19:12 + if (xfrequencies[0] < xfrequencies[-1]): build 18-Sep-2019 23:19:12 + matches = np.where(fa>xfrequencies[0])[0] build 18-Sep-2019 23:19:12 + matches2 = np.where(faxfrequencies[-1])[0] build 18-Sep-2019 23:19:12 + matches2 = np.where(fa 1): build 18-Sep-2019 23:19:12 + if (yfrequencies[0] < yfrequencies[-1]): build 18-Sep-2019 23:19:12 + matches = np.where(fa>yfrequencies[0])[0] build 18-Sep-2019 23:19:12 + matches2 = np.where(fayfrequencies[-1])[0] build 18-Sep-2019 23:19:12 + matches2 = np.where(faxfrequencies[0])[0] build 18-Sep-2019 23:19:12 + matches2 = np.where(faxfrequencies[-1])[0] build 18-Sep-2019 23:19:12 + matches2 = np.where(fayfrequencies[0])[0] build 18-Sep-2019 23:19:12 + matches2 = np.where(fayfrequencies[-1])[0] build 18-Sep-2019 23:19:12 + matches2 = np.where(fa0): build 18-Sep-2019 23:19:12 + # print("amp: Resetting xaxis frequency range to counteract flagged data") build 18-Sep-2019 23:19:12 + myxrange = np.max(frequencies)-np.min(frequencies) build 18-Sep-2019 23:19:12 + SetNewXLimits([np.min(frequencies)-0.15*myxrange, np.max(frequencies)+0.15*myxrange],4) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (1==1 or (xframe in bottomRowFrames) or (xctr+1==len(antennasToPlot) and ispw==spwsToPlot[-1])): build 18-Sep-2019 23:19:12 + # use 1==1 because spw might change between top row and bottom row of frames build 18-Sep-2019 23:19:12 + pb.xlabel(xlabelString, size=mysize) build 18-Sep-2019 23:19:12 + # endif (xaxis=='chan' elif xaxis=='freq' for 'amp') build 18-Sep-2019 23:19:12 + if (debug): print("finished 'if' block") build 18-Sep-2019 23:19:12 + if (overlayTimes): build 18-Sep-2019 23:19:12 + timeString ='' build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (len(uniqueTimes) > mytime): build 18-Sep-2019 23:19:12 + timeString = ', t%d/%d %s' % (mytime,nUniqueTimes-1,utstring(uniqueTimes[mytime],3)) build 18-Sep-2019 23:19:12 + if (scansForUniqueTimes != []): build 18-Sep-2019 23:19:12 + if (scansForUniqueTimes[mytime]>=0): build 18-Sep-2019 23:19:12 + timeString = ', scan%d %s' % (scansForUniqueTimes[mytime],utstring(uniqueTimes[mytime],3)) build 18-Sep-2019 23:19:12 + spwString = buildSpwString(overlaySpws, overlayBasebands, build 18-Sep-2019 23:19:12 + spwsToPlot, ispw, originalSpw[ispw], build 18-Sep-2019 23:19:12 + observatoryName, baseband, build 18-Sep-2019 23:19:12 + showBasebandNumber) build 18-Sep-2019 23:19:12 + if (overlayTimes and len(fieldsToPlot) > 1): build 18-Sep-2019 23:19:12 + indices = fstring = '' build 18-Sep-2019 23:19:12 + for f in fieldIndicesToPlot: build 18-Sep-2019 23:19:12 + if (f != fieldIndicesToPlot[0]): build 18-Sep-2019 23:19:12 + indices += ',' build 18-Sep-2019 23:19:12 + fstring += ',' build 18-Sep-2019 23:19:12 + indices += str(uniqueFields[f]) build 18-Sep-2019 23:19:12 + if (msFound): build 18-Sep-2019 23:19:12 + fstring += msFields[uniqueFields[f]] build 18-Sep-2019 23:19:12 + if (len(fstring) > fstringLimit): build 18-Sep-2019 23:19:12 + fstring = fstring[0:fstringLimit] + '...' build 18-Sep-2019 23:19:12 + titleString = "%sspw%s, fields %s: %s%s" % (antennaString,spwString, build 18-Sep-2019 23:19:12 + indices, fstring, timeString) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + titleString = "%sspw%s, field %d: %s%s" % (antennaString,spwString,uniqueFields[fieldIndex], build 18-Sep-2019 23:19:12 + fieldString,timeString) build 18-Sep-2019 23:19:12 + tsize = titlesize-int(len(titleString)/(maxCharsBeforeReducingTitleFontSize/subplotCols)) build 18-Sep-2019 23:19:12 + pb.title(titleString, size=tsize) build 18-Sep-2019 23:19:12 + if (abs(plotrange[0]) > 0 or abs(plotrange[1]) > 0): build 18-Sep-2019 23:19:12 + SetNewXLimits([plotrange[0],plotrange[1]],5) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + # Here is 1st place where we eliminate white space on right and left edge of the plots: 'amp' build 18-Sep-2019 23:19:12 + if (xaxis.find('chan')>=0): build 18-Sep-2019 23:19:12 + SetNewXLimits([channels[0],channels[-1]],6) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (zoom != 'intersect'): build 18-Sep-2019 23:19:12 + if (overlaySpws or overlayBasebands): build 18-Sep-2019 23:19:12 + SetNewXLimits(frequencyRangeToPlotInBaseband[bbctr],7) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + SetNewXLimits([frequencies[0], frequencies[-1]],8) build 18-Sep-2019 23:19:12 + if (bOverlay): build 18-Sep-2019 23:19:12 + if (xrange2 > myxrange+0.1 and zoom != 'intersect'): build 18-Sep-2019 23:19:12 + TDMisSecond = True build 18-Sep-2019 23:19:12 + if (abs(plotrange[2]) > 0 or abs(plotrange[3]) > 0): build 18-Sep-2019 23:19:12 + SetNewYLimits([plotrange[2],plotrange[3]]) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + ResizeFonts(adesc,mysize) build 18-Sep-2019 23:19:12 + adesc.xaxis.grid(True,which='major') build 18-Sep-2019 23:19:12 + adesc.yaxis.grid(True,which='major') build 18-Sep-2019 23:19:12 + pb.ylabel(yAmplitudeLabel, size=mysize) build 18-Sep-2019 23:19:12 + pb.subplots_adjust(hspace=myhspace, wspace=mywspace) build 18-Sep-2019 23:19:12 + xlim = pb.xlim() build 18-Sep-2019 23:19:12 + ylim = pb.ylim() build 18-Sep-2019 23:19:12 + myxrange = xlim[1]-xlim[0] build 18-Sep-2019 23:19:12 + yrange = ylim[1]-ylim[0] build 18-Sep-2019 23:19:12 + if (debug): print("amp: ylim, yrange = ", ylim, yrange) build 18-Sep-2019 23:19:12 + if (overlayAntennas == False and overlayTimes == False and bOverlay == False and build 18-Sep-2019 23:19:12 + ((overlaySpws == False and overlayBasebands == False) or spwctr==spwctrFirstToPlot)): build 18-Sep-2019 23:19:12 + # draw polarization labels for no overlay build 18-Sep-2019 23:19:12 + x0 = xstartPolLabel build 18-Sep-2019 23:19:12 + y0 = ystartPolLabel build 18-Sep-2019 23:19:12 + for p in range(nPolarizations): build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:12 + pb.text(x0, y0-subplotRows*p*0.03, corrTypeToString(corr_type[p]), build 18-Sep-2019 23:19:12 + color=pcolor[p],size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + if (channeldiff > 0): build 18-Sep-2019 23:19:12 + pb.text(x0, ystartMadLabel-0.03*subplotRows*p, build 18-Sep-2019 23:19:12 + corrTypeToString(corr_type[p])+' MAD = %.4f, St.Dev = %.4f'%(gamp_mad[p]['mad'],gamp_std[p]['std']), build 18-Sep-2019 23:19:12 + color=pcolor[p],size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + if (xframe == firstFrame): build 18-Sep-2019 23:19:12 + # draw title including caltable name build 18-Sep-2019 23:19:12 + caltableList = caltableTitle build 18-Sep-2019 23:19:12 + if (bpolyOverlay): build 18-Sep-2019 23:19:12 + caltableList += ', ' + caltable2 + ' (degamp=%d, degphase=%d)'%(nPolyAmp[index]-1,nPolyPhase[index]-1) build 18-Sep-2019 23:19:12 + if (bpolyOverlay2): build 18-Sep-2019 23:19:12 + caltableList += ', ' + caltable3 + ' (degamp=%d, degphase=%d)'%(nPolyAmp2[index]-1,nPolyPhase2[index]-1) build 18-Sep-2019 23:19:12 + pb.text(xstartTitle, ystartTitle, caltableList, size=titlesize, build 18-Sep-2019 23:19:12 + color='k', transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + elif (overlayAntennas==True and xant==antennasToPlot[-1] and bOverlay == False # ): build 18-Sep-2019 23:19:12 + and overlayTimes==False): # try to support antenna,time avoid antenna labels 'phase' build 18-Sep-2019 23:19:12 + # We do this last, because by then, the limits will be stable. build 18-Sep-2019 23:19:12 + if (debug): print("overlayAntennas=True") build 18-Sep-2019 23:19:12 + x0 = xstartPolLabel build 18-Sep-2019 23:19:12 + y0 = ystartPolLabel build 18-Sep-2019 23:19:12 + # draw polarization labels build 18-Sep-2019 23:19:12 + if (debug): print("1) overlayAntennas=True") build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[0]) in polsToPlot): build 18-Sep-2019 23:19:12 + if (channeldiff > 0): build 18-Sep-2019 23:19:12 + pb.text(x0, ystartMadLabel-0.03*subplotRows*0, build 18-Sep-2019 23:19:12 + corrTypeToString(corr_type[0])+' MAD = %.4f, St.Dev = %.4f'%(gamp_mad[0]['mad'],gamp_std[0]['std']), build 18-Sep-2019 23:19:12 + color=overlayColors[0],size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + if (ampmarkstyle.find('-')>=0): build 18-Sep-2019 23:19:12 + pb.text(x0, y0, corrTypeToString(corr_type[0])+' solid', color=overlayColors[0],size=mysize, build 18-Sep-2019 23:19:12 + transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pb.text(x0+0.02, y0, corrTypeToString(corr_type[0]), color=overlayColors[0],size=mysize, build 18-Sep-2019 23:19:12 + transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + pdesc = pb.plot([x0-0.01], [y0], '%sk'%ampmarkstyle, markersize=markersize, build 18-Sep-2019 23:19:12 + scalex=False,scaley=False, transform=pb.gca().transAxes,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + if (debug): print("2) overlayAntennas=True") build 18-Sep-2019 23:19:12 + if (len(corr_type) > 1): build 18-Sep-2019 23:19:12 + if (corrTypeToString(corr_type[1]) in polsToPlot): build 18-Sep-2019 23:19:12 + if (channeldiff > 0): build 18-Sep-2019 23:19:12 + pb.text(x0, ystartMadLabel-0.03*subplotRows*1, build 18-Sep-2019 23:19:12 + corrTypeToString(corr_type[1])+' MAD = %.4f, St.Dev = %.4f'%(gamp_mad[1]['mad'],gamp_std[1]['std']), build 18-Sep-2019 23:19:12 + color=overlayColors[0],size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + if (ampmarkstyle2.find('--')>=0): build 18-Sep-2019 23:19:12 + pb.text(x0, y0-0.03*subplotRows, corrTypeToString(corr_type[1])+' dashed', build 18-Sep-2019 23:19:12 + color=overlayColors[0],size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + pb.text(x0+0.02, y0-0.03*subplotRows, corrTypeToString(corr_type[1]), build 18-Sep-2019 23:19:12 + color=overlayColors[0],size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:12 + pdesc = pb.plot([x0-0.01], [y0-0.03*subplotRows], '%sk'%ampmarkstyle2, build 18-Sep-2019 23:19:12 + markersize=markersize, scalex=False,scaley=False,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:12 + if (debug): print("3) overlayAntennas=True") build 18-Sep-2019 23:19:12 + if (xframe == firstFrame): build 18-Sep-2019 23:19:12 + # draw title including caltable name build 18-Sep-2019 23:19:12 + if (debug): print("4) overlayAntennas=True") build 18-Sep-2019 23:19:12 + pb.text(xstartTitle, ystartTitle, caltableTitle, size=titlesize, color='k', build 18-Sep-2019 23:19:12 + transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:12 + if (debug): print("5) overlayAntennas=True") build 18-Sep-2019 23:19:12 + DrawAntennaNames(msAnt, antennasToPlot, msFound, mysize) build 18-Sep-2019 23:19:12 + if (debug): print("6) overlayAntennas=True") build 18-Sep-2019 23:19:12 + elif (overlayTimes==True and bOverlay == False build 18-Sep-2019 23:19:12 + and overlayAntennas==False): # try to support antenna,time build 18-Sep-2019 23:19:12 + doneOverlayTime = True # assumed until proven otherwise in the 'for' loop build 18-Sep-2019 23:19:12 + for f in fieldIndicesToPlot: build 18-Sep-2019 23:19:12 + if (len(uniqueTimesPerFieldPerSpw[ispwInCalTable][f]) > 0): build 18-Sep-2019 23:19:12 + if ((uniqueTimes[mytime] < uniqueTimesPerFieldPerSpw[ispwInCalTable][f][-1]-solutionTimeThresholdSeconds) and build 18-Sep-2019 23:19:12 + (uniqueTimes[mytime] < timerangeListTimes[-1])): build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("-----------Not done because %.0f < %.0f-%d for fieldIndex=%d and <%.0f" % (uniqueTimes[mytime], uniqueTimesPerFieldPerSpw[ispwInCalTable][f][-1], solutionTimeThresholdSeconds, f, timerangeListTimes[-1])) build 18-Sep-2019 23:19:12 + print("-----------ispwInCalTable=%d, mytime=%d, len(uniqueTimes) = %d" % (ispwInCalTable, mytime, len(uniqueTimes))) build 18-Sep-2019 23:19:12 + doneOverlayTime = False build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("------doneOverlayTime = %s" % (str(doneOverlayTime))) build 18-Sep-2019 23:19:12 + if (doneOverlayTime): build 18-Sep-2019 23:19:12 + # either it is the last time of any times in solution, or the last time in the list of times to plot build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("*** on last time = %d for last fieldIndex %d or %d>=%d" % (mytime,fieldIndex,mytime,timerangeList[-1])) build 18-Sep-2019 23:19:12 + mytime = nUniqueTimes-1 build 18-Sep-2019 23:19:12 + # We do this last, because by then, the limits will be broad enought and stable. build 18-Sep-2019 23:19:12 + # draw polarization labels build 18-Sep-2019 23:19:12 + DrawPolarizationLabelsForOverlayTime(xstartPolLabel,ystartPolLabel,corr_type,polsToPlot, build 18-Sep-2019 23:19:12 + channeldiff,ystartMadLabel,subplotRows,gamp_mad,mysize, build 18-Sep-2019 23:19:12 + ampmarkstyle,markersize,ampmarkstyle2, gamp_std) build 18-Sep-2019 23:19:12 + if (xframe == firstFrame): build 18-Sep-2019 23:19:12 + # draw title including caltable name build 18-Sep-2019 23:19:12 + pb.text(xstartTitle, ystartTitle, caltableTitle, size=titlesize, build 18-Sep-2019 23:19:12 + color='k', transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:12 + if (debug): print("drawOverlayTimeLegends loc 2") build 18-Sep-2019 23:19:12 + drawOverlayTimeLegends(xframe,firstFrame,xstartTitle,ystartTitle, build 18-Sep-2019 23:19:12 + caltable,titlesize,fieldIndicesToPlot, build 18-Sep-2019 23:19:12 + ispwInCalTable,uniqueTimesPerFieldPerSpw, build 18-Sep-2019 23:19:12 + timerangeListTimes, solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:12 + debugSloppyMatch,ystartOverlayLegend,debug,mysize, build 18-Sep-2019 23:19:12 + fieldsToPlot,myUniqueColor,timeHorizontalSpacing, build 18-Sep-2019 23:19:12 + fieldIndex,overlayColors, antennaVerticalSpacing, build 18-Sep-2019 23:19:12 + overlayAntennas, timerangeList, caltableTitle, build 18-Sep-2019 23:19:12 + mytime, scansToPlotPerSpw[ispw], scansForUniqueTimes) build 18-Sep-2019 23:19:12 +# mytime, scansToPlot, scansForUniqueTimes) # task version build 18-Sep-2019 23:19:12 + if (debug): print("done drawOverlayTimeLegends loc 2") build 18-Sep-2019 23:19:12 + elif (overlayAntennas and overlayTimes): # Oct 23, 2012 build 18-Sep-2019 23:19:12 + # This will only happen for overlay='antenna,time' build 18-Sep-2019 23:19:12 + if (xframe == firstFrame and mytime == firstTimeMatch and xctr==firstUnflaggedAntennaToPlot and bOverlay==False): # bug fix on 2015-08-19 for CAS-7820 build 18-Sep-2019 23:19:12 + # draw title including caltable name build 18-Sep-2019 23:19:12 + pb.text(xstartTitle, ystartTitle, caltableTitle, size=titlesize, color='k', build 18-Sep-2019 23:19:12 + transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:12 + DrawBottomLegendPageCoords(msName, uniqueTimes[mytime], mysize, figfile) build 18-Sep-2019 23:19:12 + # Adding the following 'for' loop on Mar 13, 2013 to support the case of build 18-Sep-2019 23:19:12 + # single time range with overlay='antenna,time' build 18-Sep-2019 23:19:12 + if (xant==antennasToPlot[-1]): build 18-Sep-2019 23:19:12 + doneOverlayTime = True # assumed until proven otherwise in the 'for' loop build 18-Sep-2019 23:19:12 + for f in fieldIndicesToPlot: build 18-Sep-2019 23:19:12 + if (len(uniqueTimesPerFieldPerSpw[ispwInCalTable][f]) > 0): build 18-Sep-2019 23:19:12 + if ((uniqueTimes[mytime] < uniqueTimesPerFieldPerSpw[ispwInCalTable][f][-1]-solutionTimeThresholdSeconds) and build 18-Sep-2019 23:19:12 + (uniqueTimes[mytime] < timerangeListTimes[-1])): build 18-Sep-2019 23:19:12 + if (debug): build 18-Sep-2019 23:19:12 + print("-----------Not done because %.0f < %.0f-%d for fieldIndex=%d and <%.0f" % (uniqueTimes[mytime], uniqueTimesPerFieldPerSpw[ispwInCalTable][f][-1], solutionTimeThresholdSeconds, f, timerangeListTimes[-1])) build 18-Sep-2019 23:19:12 + print("-----------ispwInCalTable=%d, mytime=%d, len(uniqueTimes) = %d" % (ispwInCalTable, mytime, len(uniqueTimes))) build 18-Sep-2019 23:19:12 + doneOverlayTime = False build 18-Sep-2019 23:19:12 + if (doneOverlayTime): build 18-Sep-2019 23:19:12 + # This is necessary for the case that no antennas were flagged for the single timerange selected build 18-Sep-2019 23:19:12 + if (debug): print("drawOverlayTimeLegends loc 3") build 18-Sep-2019 23:19:12 + drawOverlayTimeLegends(xframe,firstFrame,xstartTitle,ystartTitle,caltable,titlesize, build 18-Sep-2019 23:19:12 + fieldIndicesToPlot,ispwInCalTable,uniqueTimesPerFieldPerSpw, build 18-Sep-2019 23:19:12 + timerangeListTimes, solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:12 + debugSloppyMatch,ystartOverlayLegend,debug,mysize, build 18-Sep-2019 23:19:12 + fieldsToPlot,myUniqueColor,timeHorizontalSpacing, build 18-Sep-2019 23:19:12 + fieldIndex,overlayColors, antennaVerticalSpacing, build 18-Sep-2019 23:19:12 + overlayAntennas, timerangeList, caltableTitle, build 18-Sep-2019 23:19:12 + mytime, scansToPlotPerSpw[ispw], scansForUniqueTimes) build 18-Sep-2019 23:19:12 +# mytime, scansToPlot, scansForUniqueTimes) # task version build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + build 18-Sep-2019 23:19:12 + if (debug): print("####### 2nd place") build 18-Sep-2019 23:19:12 + # Here is 2nd place where we eliminate any white space on the right and left edge of the plots: 'amp' build 18-Sep-2019 23:19:12 + # build 18-Sep-2019 23:19:12 + if (abs(plotrange[2]) > 0 or abs(plotrange[3]) > 0): build 18-Sep-2019 23:19:12 + SetNewYLimits([plotrange[2],plotrange[3]]) build 18-Sep-2019 23:19:12 + if (plotrange[0]==0 and plotrange[1]==0): build 18-Sep-2019 23:19:12 + if (xaxis.find('chan')>=0): build 18-Sep-2019 23:19:12 + SetNewXLimits([channels[0],channels[-1]],9) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + if (zoom != 'intersect'): build 18-Sep-2019 23:19:12 + if (overlaySpws or overlayBasebands): build 18-Sep-2019 23:19:12 + SetNewXLimits(frequencyRangeToPlotInBaseband[bbctr],10) build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:12 + SetNewXLimits([frequencies[0], frequencies[-1]],11) build 18-Sep-2019 23:19:12 + if (bOverlay): build 18-Sep-2019 23:19:12 +# # # # print("Checking if %f >= %f" % (xrange2, myxrange)) build 18-Sep-2019 23:19:12 + if (xrange2 >= myxrange and zoom != 'intersect'): build 18-Sep-2019 23:19:12 + # This is necessary if caltable2=TDM and caltable=FDM build 18-Sep-2019 23:19:12 + SetNewXLimits([frequencies2[0], frequencies2[-1]],12) build 18-Sep-2019 23:19:12 + if (xrange2 > myxrange+0.1 and zoom != 'intersect'): build 18-Sep-2019 23:19:12 + TDMisSecond = True build 18-Sep-2019 23:19:12 + else: build 18-Sep-2019 23:19:13 + SetNewXLimits([plotrange[0], plotrange[1]],13) build 18-Sep-2019 23:19:13 + if (debug): print("done SetNewXLimits") build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # I need the following line for chanrange to work build 18-Sep-2019 23:19:13 + if (chanrange[0] != 0 or chanrange[1] != 0 or chanrangePercent != None): build 18-Sep-2019 23:19:13 + SetLimits(plotrange, chanrange, newylimits, channels, frequencies, pfrequencies, build 18-Sep-2019 23:19:13 + ampMin, ampMax, xaxis,pxl, chanrangeSetXrange, build 18-Sep-2019 23:19:13 + chanrangePercent) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # Finally, draw the atmosphere and FDM windows, if requested. 'amp' build 18-Sep-2019 23:19:13 + if ((overlayAntennas==False and overlayTimes==False) or build 18-Sep-2019 23:19:13 + (overlayAntennas==True and overlayTimes==False and xant==antennasToPlot[-1]) or build 18-Sep-2019 23:19:13 + (overlayTimes==True and overlayAntennas==False and doneOverlayTime) or build 18-Sep-2019 23:19:13 +# # (xant==antennasToPlot[-1] and doneOverlayTime) # support showatm with overlay='antenna,time' build 18-Sep-2019 23:19:13 + (overlayTimes and overlayAntennas and # Aug 5, 2013 build 18-Sep-2019 23:19:13 + xant==antennasToPlot[-1] and doneOverlayTime and mytime==finalTimeMatch # 2015-08-19 for CAS-7820 build 18-Sep-2019 23:19:13 + and not drewAtmosphere) # added on 2014-12-04 to support case of a flagged antenna CAS-7187 build 18-Sep-2019 23:19:13 + ): build 18-Sep-2019 23:19:13 + if ((showatm or showtsky) and len(atmString) > 0): build 18-Sep-2019 23:19:13 + DrawAtmosphere(showatm, showtsky, subplotRows, atmString, build 18-Sep-2019 23:19:13 + mysize, TebbSky, plotrange, xaxis, atmchan, build 18-Sep-2019 23:19:13 + atmfreq, transmission, subplotCols, build 18-Sep-2019 23:19:13 + showatmPoints=showatmPoints, xframe=xframe, build 18-Sep-2019 23:19:13 + channels=channels,mylineno=lineNumber(), build 18-Sep-2019 23:19:13 + overlaySpws=overlaySpws, build 18-Sep-2019 23:19:13 + overlayBasebands=overlayBasebands, build 18-Sep-2019 23:19:13 + drewAtmosphere=drewAtmosphere) build 18-Sep-2019 23:19:13 + if (LO1 != '' and LO1 is not None): build 18-Sep-2019 23:19:13 + # Now draw the image band build 18-Sep-2019 23:19:13 + DrawAtmosphere(showatm,showtsky, subplotRows, atmString, build 18-Sep-2019 23:19:13 + mysize, TebbSkyImage, plotrange, xaxis, build 18-Sep-2019 23:19:13 + atmchanImage, atmfreqImage, transmissionImage, build 18-Sep-2019 23:19:13 + subplotCols, LO1, xframe, firstFrame, build 18-Sep-2019 23:19:13 + showatmPoints, build 18-Sep-2019 23:19:13 + channels=channels,mylineno=lineNumber(), build 18-Sep-2019 23:19:13 + overlaySpws=overlaySpws, build 18-Sep-2019 23:19:13 + overlayBasebands=overlayBasebands, build 18-Sep-2019 23:19:13 + drewAtmosphere=drewAtmosphere) build 18-Sep-2019 23:19:13 + drewAtmosphere = True build 18-Sep-2019 23:19:13 + if (xaxis.find('freq')>=0 and showfdm and nChannels <= 256): build 18-Sep-2019 23:19:13 + if (tableFormat == 33): build 18-Sep-2019 23:19:13 + showFDM(originalSpw_casa33, chanFreqGHz_casa33, baseband, showBasebandNumber, basebandDict) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + showFDM(originalSpw, chanFreqGHz, baseband, showBasebandNumber, basebandDict) build 18-Sep-2019 23:19:13 + if (debug): print("done drawAtmosphere/FDM check") build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (bOverlay): build 18-Sep-2019 23:19:13 + # draw polarization labels build 18-Sep-2019 23:19:13 + x0 = xstartPolLabel build 18-Sep-2019 23:19:13 + y0 = ystartPolLabel build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + pb.text(x0, y0-p*0.03*subplotRows, corrTypeToString(corr_type[p])+'-c1', build 18-Sep-2019 23:19:13 + color=pcolor[p],size=mysize,transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + pb.text(x0, y0-p*0.03*subplotRows-0.06*subplotRows, corrTypeToString(corr_type[p])+'-c2', build 18-Sep-2019 23:19:13 + color=p2color[p],size=mysize,transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + if (debug): print("done pol labels") build 18-Sep-2019 23:19:13 + if (bpolyOverlay and xaxis.find('freq')>=0): build 18-Sep-2019 23:19:13 + # draw polarization labels build 18-Sep-2019 23:19:13 + x0 = xstartPolLabel build 18-Sep-2019 23:19:13 + y0 = ystartPolLabel build 18-Sep-2019 23:19:13 + if (x2color != xcolor): build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[0]) in polsToPlot): build 18-Sep-2019 23:19:13 + pb.text(x0+0.1, y0-p*0.03*subplotRows, corrTypeToString(corr_type[p]), color=p2color[p], build 18-Sep-2019 23:19:13 + size=mysize,transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + if (bpolyOverlay2): build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[0]) in polsToPlot): build 18-Sep-2019 23:19:13 + pb.text(x0+0.2, y0-p*0.03*subplotRows, corrTypeToString(corr_type[p]), build 18-Sep-2019 23:19:13 + color=p3color[p], size=mysize,transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +# # # # if (xframe == 111 and amplitudeWithPhase): build 18-Sep-2019 23:19:13 + myIndexTime = uniqueTimesPerFieldPerSpw[ispwInCalTable][fieldIndex][-1] build 18-Sep-2019 23:19:13 + if (debug): print("running sloppyMatch") build 18-Sep-2019 23:19:13 + matched,mymatch = sloppyMatch(myIndexTime,uniqueTimes,solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:13 + mytime, scansToPlotPerSpw[ispw], # add PerSpw[ispw] on 2014-04-05 build 18-Sep-2019 23:19:13 + scansForUniqueTimes, build 18-Sep-2019 23:19:13 + whichone=True,myprint=debug) build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("1)done sloppyMatch, mytime=%d, scansForUniqueTimes=%s" % (mytime,str(scansForUniqueTimes))) build 18-Sep-2019 23:19:13 + print("ispw=%d" % (ispw)) build 18-Sep-2019 23:19:13 + print("len(scansToPlotPerSpw)=%d" % (len(scansToPlotPerSpw))) build 18-Sep-2019 23:19:13 + if (matched == False and scansForUniqueTimes[mytime] in scansToPlotPerSpw[ispw]): build 18-Sep-2019 23:19:13 + print("---------- 1) Did not find %f in %s" % (myIndexTime,str(uniqueTimes))) build 18-Sep-2019 23:19:13 + print("Try re-running with a smaller solutionTimeThresholdSeconds (currently %f)" % (solutionTimeThresholdSeconds)) build 18-Sep-2019 23:19:13 + return build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + # we are on the final time to be plotted build 18-Sep-2019 23:19:13 + if (debug): print("on the final time") build 18-Sep-2019 23:19:13 + mytimeTest = mytime==nUniqueTimes-1 # mytime==myIndexTime # mytime==mymatch build 18-Sep-2019 23:19:13 + if ((xframe == 111 and amplitudeWithPhase) or build 18-Sep-2019 23:19:13 + # Following case is needed to make subplot=11 to work for: try to support overlay='antenna,time' build 18-Sep-2019 23:19:13 + (xframe == lastFrame and overlayTimes and overlayAntennas and build 18-Sep-2019 23:19:13 + xctr+1==len(antennasToPlot) and build 18-Sep-2019 23:19:13 +# # mytime+1==len(uniqueTimes) and # this worked for nspw <= 4 build 18-Sep-2019 23:19:13 + mytimeTest and build 18-Sep-2019 23:19:13 + spwctr 0): build 18-Sep-2019 23:19:13 + plotfiles.append(makeplot(figfile,msFound,msAnt, build 18-Sep-2019 23:19:13 + overlayAntennas,pages,pagectr, build 18-Sep-2019 23:19:13 + density,interactive,antennasToPlot, build 18-Sep-2019 23:19:13 + spwsToPlot,overlayTimes,overlayBasebands, build 18-Sep-2019 23:19:13 + 3,xant,ispw,subplot,resample, build 18-Sep-2019 23:19:13 + debug,figfileSequential,figfileNumber)) build 18-Sep-2019 23:19:13 + figfileNumber += 1 build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + donetime = timeUtilities.time() build 18-Sep-2019 23:19:13 + drewAtmosphere = False # needed for CAS-7187 (subplot=11) build 18-Sep-2019 23:19:13 + if (interactive): build 18-Sep-2019 23:19:13 + pb.draw() build 18-Sep-2019 23:19:13 +# # # # myinput = raw_input(":(%.1f sec) Press return for next page (b for backwards, q to quit): "%(donetime-mytimestamp)) build 18-Sep-2019 23:19:13 + myinput = raw_input("Press return for next page (b for backwards, q to quit): ") build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + myinput = '' build 18-Sep-2019 23:19:13 + skippingSpwMessageSent = 0 build 18-Sep-2019 23:19:13 + mytimestamp = timeUtilities.time() build 18-Sep-2019 23:19:13 + if (myinput.find('q') >= 0): build 18-Sep-2019 23:19:13 + showFinalMessage(overlayAntennas, solutionTimeSpread, nUniqueTimes) build 18-Sep-2019 23:19:13 + return() build 18-Sep-2019 23:19:13 + if (myinput.find('b') >= 0): build 18-Sep-2019 23:19:13 + if (pagectr > 0): build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("Decrementing pagectr from %d to %d" % (pagectr, pagectr-1)) build 18-Sep-2019 23:19:13 + pagectr -= 1 build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("Not decrementing pagectr=%d" % (pagectr)) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + redisplay = True build 18-Sep-2019 23:19:13 + #redisplay the current page by setting ctrs back to the value they had at start of that page build 18-Sep-2019 23:19:13 + xctr = pages[pagectr][PAGE_ANT] build 18-Sep-2019 23:19:13 + spwctr = pages[pagectr][PAGE_SPW] build 18-Sep-2019 23:19:13 + mytime = pages[pagectr][PAGE_TIME] build 18-Sep-2019 23:19:13 + myap = pages[pagectr][PAGE_AP] build 18-Sep-2019 23:19:13 + xant = antennasToPlot[xctr] build 18-Sep-2019 23:19:13 + antstring, Antstring = buildAntString(xant,msFound,msAnt) build 18-Sep-2019 23:19:13 + ispw = spwsToPlot[spwctr] build 18-Sep-2019 23:19:13 +# # # # print("Returning to [%d,%d,%d,%d]" % (xctr,spwctr,mytime,myap)) build 18-Sep-2019 23:19:13 + if (xctr==pages[0][PAGE_ANT] and spwctr==pages[0][PAGE_SPW] and mytime==pages[0][PAGE_TIME] and pages[0][PAGE_AP]==myap): build 18-Sep-2019 23:19:13 + pb.clf() build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("2)Setting xframe to %d" % xframeStart) build 18-Sep-2019 23:19:13 + xframe = xframeStart build 18-Sep-2019 23:19:13 + myUniqueColor = [] build 18-Sep-2019 23:19:13 + continue build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pagectr += 1 build 18-Sep-2019 23:19:13 + if (pagectr >= len(pages)): build 18-Sep-2019 23:19:13 + if (xframe == lastFrame and overlayTimes and overlayAntennas and xctr+1==len(antennasToPlot) and build 18-Sep-2019 23:19:13 + yaxis=='amp'): build 18-Sep-2019 23:19:13 + # I'm not sure why this works, but is needed to fix CAS-7154 build 18-Sep-2019 23:19:13 + myspwctr = spwctr+1 build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + myspwctr = spwctr build 18-Sep-2019 23:19:13 + pages.append([xctr,myspwctr,mytime,1]) build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("amp: appending [%d,%d,%d,%d]" % (xctr,myspwctr,mytime,1)) build 18-Sep-2019 23:19:13 + newpage = 0 build 18-Sep-2019 23:19:13 + pb.clf() build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("3)Setting xframe to %d" % xframeStart) build 18-Sep-2019 23:19:13 + xframe = xframeStart build 18-Sep-2019 23:19:13 + myUniqueColor = [] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("::: Not done page: Not checking whether we need to set xframe=xframeStart") build 18-Sep-2019 23:19:13 + print("::: xframe=%d ?= lastFrame=%d, amplitudeWithPhase=" % (xframe, lastFrame), amplitudeWithPhase) build 18-Sep-2019 23:19:13 + print("::: xctr+1=%d ?= len(antennasToPlot)=%d" % (xctr+1,len(antennasToPlot))) build 18-Sep-2019 23:19:13 + print(":::: mytimeTest = %s" % (mytimeTest)) build 18-Sep-2019 23:19:13 + print("::: spwctr=%d ?< len(spwsToPlot)=%d" % (spwctr,len(spwsToPlot))) build 18-Sep-2019 23:19:13 +########################################################### build 18-Sep-2019 23:19:13 +################### Here is the phase plotting ############ build 18-Sep-2019 23:19:13 +########################################################### build 18-Sep-2019 23:19:13 + if (yaxis.find('phase')>=0 or amplitudeWithPhase) and doneOverlayTime==False: build 18-Sep-2019 23:19:13 + if (channeldiff > 0): build 18-Sep-2019 23:19:13 + pchannels = [xchannels,ychannels] # this is necessary because np.diff reduces nchan by 1 build 18-Sep-2019 23:19:13 + pfrequencies = [xfrequencies,yfrequencies] # this is necessary because np.diff reduces nchan by 1 build 18-Sep-2019 23:19:13 + if (bOverlay): build 18-Sep-2019 23:19:13 + pchannels2 = [xchannels2,ychannels2] # this is necessary because np.diff reduces nchan by 1 build 18-Sep-2019 23:19:13 + pfrequencies2 = [xfrequencies2,yfrequencies2] # this is necessary because np.diff reduces nchan by 1 build 18-Sep-2019 23:19:13 + if (overlayTimes == False or mytime==firstTimeMatch): build 18-Sep-2019 23:19:13 + if ((overlaySpws == False and overlayBasebands==False) or spwctr==spwctrFirstToPlot or build 18-Sep-2019 23:19:13 + spwctr>spwsToPlot[-1] or build 18-Sep-2019 23:19:13 + (overlayBasebands and amplitudeWithPhase)): # CAS-6477 build 18-Sep-2019 23:19:13 + if (overlayAntennas==False or xctr==firstUnflaggedAntennaToPlot build 18-Sep-2019 23:19:13 + or xctr>antennasToPlot[-1]): # 2012-05-24, to fix the case where all ants flagged on one timerange build 18-Sep-2019 23:19:13 + xframe += 1 build 18-Sep-2019 23:19:13 +# # # # print("u) incrementing xframe to %d" % xframe) build 18-Sep-2019 23:19:13 + myUniqueColor = [] build 18-Sep-2019 23:19:13 + newylimits = [LARGE_POSITIVE, LARGE_NEGATIVE] build 18-Sep-2019 23:19:13 + if (phase != ''): build 18-Sep-2019 23:19:13 + if ((phase[0] != 0 or phase[1] != 0) and amplitudeWithPhase): build 18-Sep-2019 23:19:13 + newylimits = phase build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("$$$$$$$$$$$$$$$$$$$$$$$ ready to plot phase on xframe %d" % (xframe)) build 18-Sep-2019 23:19:13 + adesc = pb.subplot(xframe) build 18-Sep-2019 23:19:13 + if (previousSubplot != xframe): build 18-Sep-2019 23:19:13 + drewAtmosphere = False build 18-Sep-2019 23:19:13 + previousSubplot = xframe build 18-Sep-2019 23:19:13 + pb.hold(overlayAntennas or overlayTimes) build 18-Sep-2019 23:19:13 + gphsx = np.arctan2(np.imag(gplotx),np.real(gplotx))*180.0/math.pi build 18-Sep-2019 23:19:13 + if (nPolarizations == 2): build 18-Sep-2019 23:19:13 + gphsy = np.arctan2(np.imag(gploty),np.real(gploty))*180.0/math.pi build 18-Sep-2019 23:19:13 + if (channeldiff>0): build 18-Sep-2019 23:19:13 + if (xaxis == 'chan'): build 18-Sep-2019 23:19:13 + gphs0, newx0, gphs0res, newx0res = channelDifferences(gphsx, pchannels[0], resample) build 18-Sep-2019 23:19:13 + gphs1, newx1, gphs1res, newx1res = channelDifferences(gphsy, pchannels[1], resample) build 18-Sep-2019 23:19:13 + pchannels = [newx0,newx1] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + gphs0, newx0, gphs0res, newx0res = channelDifferences(gphsx, pfrequencies[0], resample) build 18-Sep-2019 23:19:13 + gphs1, newx1, gphs1res, newx1res = channelDifferences(gphsy, pfrequencies[1], resample) build 18-Sep-2019 23:19:13 + pfrequencies = [newx0,newx1] build 18-Sep-2019 23:19:13 + gphs = [gphs0, gphs1] build 18-Sep-2019 23:19:13 + gphsres = [gphs0res, gphs1res] build 18-Sep-2019 23:19:13 + gphs_mad = [madInfo(gphs[0],madsigma,edge), madInfo(gphs[1],madsigma,edge)] build 18-Sep-2019 23:19:13 + gphs_std = [stdInfo(gphsres[0],madsigma,edge,ispw,xant,0), stdInfo(gphsres[1],madsigma,edge,ispw,xant,1)] build 18-Sep-2019 23:19:13 + for p in [0,1]: build 18-Sep-2019 23:19:13 + madstats[Antstring][ispw][mytime][p]['phase'] = gphs_mad[p]['mad'] build 18-Sep-2019 23:19:13 + madstats[Antstring][ispw][mytime][p]['phasestd'] = gphs_std[p]['std'] build 18-Sep-2019 23:19:13 + if (gphs_mad[p]['nchan'] > 0): build 18-Sep-2019 23:19:13 + checkAbsSum = np.sum(np.abs(gphs[p])) build 18-Sep-2019 23:19:13 + if (checkAbsSum < PHASE_ABS_SUM_THRESHOLD): build 18-Sep-2019 23:19:13 + if (debug): print("%s, Pol %d, spw %d, %s, phs: not printing because abs sum of all values near zero (%f)" % (Antstring, p, ispw, utstring(uniqueTimes[mytime],0), checkAbsSum)) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + casalogPost(debug, "%s, Pol %d, spw %2d, %s, phs: %4d points exceed %.1f sigma (worst=%.2f at chan %d)" % (Antstring, p, ispw, utstring(uniqueTimes[mytime],0), gphs_mad[p]['nchan'], madsigma, gphs_mad[p]['outlierValue'], gphs_mad[p]['outlierChannel']+pchannels[p][0])) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + gphs = [gphsx,gphsy] build 18-Sep-2019 23:19:13 + else: # 1-pol build 18-Sep-2019 23:19:13 + if (channeldiff>0): build 18-Sep-2019 23:19:13 + if (xaxis == 'chan'): build 18-Sep-2019 23:19:13 + gphs0, newx0, gphs0res, newx0res = channelDifferences(gphsx, pchannels[0], resample) build 18-Sep-2019 23:19:13 + pchannels = [newx0] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + gphs0, newx0, gphs0res, newx0res = channelDifferences(gphsx, pfrequencies[0], resample) build 18-Sep-2019 23:19:13 + pfrequencies = [newx0] build 18-Sep-2019 23:19:13 + gphs = [gphs0] build 18-Sep-2019 23:19:13 + gphsres = [gphs0res] build 18-Sep-2019 23:19:13 + p = 0 build 18-Sep-2019 23:19:13 + gphs_mad = [madInfo(gphs[p], madsigma, edge)] build 18-Sep-2019 23:19:13 + gphs_std = [stdInfo(gphsres[p], madsigma, edge, ispw,xant,p)] build 18-Sep-2019 23:19:13 + madstats[Antstring][ispw][mytime][p]['phase'] = gphs_mad[p]['mad'] build 18-Sep-2019 23:19:13 + madstats[Antstring][ispw][mytime][p]['phasestd'] = gphs_mad[p]['std'] build 18-Sep-2019 23:19:13 + if (gphs_mad[p]['nchan'] > 0): build 18-Sep-2019 23:19:13 + checkAbsSum = np.sum(np.abs(gphs[p])) build 18-Sep-2019 23:19:13 + if (checkAbsSum < PHASE_ABS_SUM_THRESHOLD): build 18-Sep-2019 23:19:13 + if (debug): print("%s, Pol %d, spw %d, %s, phs: not printing because all values near zero (%f)" % (Antstring, p, ispw, utstring(uniqueTimes[mytime],0), checkAbsSum)) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + casalogPost(debug, "%s, Pol %d, spw %2d, %s, phs: %4d points exceed %.1f sigma (worst=%.2f at chan %d)" % (Antstring, p, ispw, utstring(uniqueTimes[mytime],0), gphs_mad[p]['nchan'], madsigma, gphs_mad[p]['outlierValue'], gphs_mad[p]['outlierChannel']+pchannels[p][0])) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + gphs = [gphsx] build 18-Sep-2019 23:19:13 + if (bOverlay): build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("computing phase for second table") build 18-Sep-2019 23:19:13 + gphsx2 = np.arctan2(np.imag(gplotx2),np.real(gplotx2))*180.0/math.pi build 18-Sep-2019 23:19:13 + if (nPolarizations == 2): build 18-Sep-2019 23:19:13 + gphsy2 = np.arctan2(np.imag(gploty2),np.real(gploty2))*180.0/math.pi build 18-Sep-2019 23:19:13 + if (channeldiff>0): build 18-Sep-2019 23:19:13 + if (xaxis == 'chan'): build 18-Sep-2019 23:19:13 + gphs2_0, newx0, gphs2_0res, newx0res = channelDifferences(gphsx2, pchannels2[0], resample) build 18-Sep-2019 23:19:13 + gphs2_1, newx1, gphs2_1res, newx1res = channelDifferences(gphsy2, pchannels2[1], resample) build 18-Sep-2019 23:19:13 + pchannels2 = [newx0, newx1] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + gphs2_0, newx0, gphs2_0res, newx0res = channelDifferences(gphsx2, pfrequencies2[0], resample) build 18-Sep-2019 23:19:13 + gphs2_1, newx1, gphs2_1res, newx1res = channelDifferences(gphsy2, pfrequencies2[1], resample) build 18-Sep-2019 23:19:13 + pfrequencies2 = [newx0, newx1] build 18-Sep-2019 23:19:13 + gphs2 = [gphs2_0, gphs2_1] build 18-Sep-2019 23:19:13 + gphs2res = [gphs2_0res, gphs2_1res] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + gphs2 = [gphsx2, gphsy2] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (channeldiff>0): build 18-Sep-2019 23:19:13 + if (xaxis == 'chan'): build 18-Sep-2019 23:19:13 + gphs2_0, newx0, gphs2_0res, newx0res = channelDifferences(gphsx2, pchannels2[0], resample) build 18-Sep-2019 23:19:13 + pchannels2 = [newx0] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + gphs2_0, newx0, gphs2_0res, newx0res = channelDifferences(gphsx2, pfrequencies2[0], resample) build 18-Sep-2019 23:19:13 + pfrequencies2 = [newx0] build 18-Sep-2019 23:19:13 + gphs2 = [gphs2_0] build 18-Sep-2019 23:19:13 + gphs2res = [gphs2_0res] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + gphs2 = [gphsx2] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("bOverlay is FALSE ===========================") build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (xaxis.find('chan')>=0 or len(xfrequencies) < 1): # 'phase' build 18-Sep-2019 23:19:13 + pb.hold(True) build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + if (overlayAntennas or overlayTimes): build 18-Sep-2019 23:19:13 + pdesc = pb.plot(pchannels[p],gphs[p],'%s'%(phasemarkstyles[p]),markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + newylimits = recalcYlimits(plotrange,newylimits,gphs[p]) # 10/27/2011 build 18-Sep-2019 23:19:13 + if (newylimits[1]-newylimits[0] < minPhaseRange): build 18-Sep-2019 23:19:13 + newylimits = [-minPhaseRange,minPhaseRange] build 18-Sep-2019 23:19:13 + if (phase != ''): build 18-Sep-2019 23:19:13 + if ((phase[0] != 0 or phase[1] != 0) and amplitudeWithPhase): build 18-Sep-2019 23:19:13 + newylimits = phase build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (overlayAntennas and overlayTimes==False): build 18-Sep-2019 23:19:13 + pb.setp(pdesc, color=overlayColors[xctr]) build 18-Sep-2019 23:19:13 + elif (overlayTimes and overlayAntennas==False): build 18-Sep-2019 23:19:13 + pb.setp(pdesc, color=overlayColors[mytime]) build 18-Sep-2019 23:19:13 + elif (overlayTimes): # try to support antenna,time build 18-Sep-2019 23:19:13 + if (myUniqueTime != []): build 18-Sep-2019 23:19:13 + pb.setp(pdesc, color=overlayColors[myUniqueTime]) build 18-Sep-2019 23:19:13 + # The third 'or' below is needed if pol='0' is flagged on antenna 0. -- 2012/10/12 (original spot) build 18-Sep-2019 23:19:13 + if (p==0 or len(polsToPlot)==1 or myUniqueColor==[]): build 18-Sep-2019 23:19:13 + myUniqueColor.append(overlayColors[len(myUniqueColor)]) build 18-Sep-2019 23:19:13 + pb.setp(pdesc, color=myUniqueColor[-1]) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pb.plot(pchannels[p],gphs[p],'%s%s'%(pcolor[p],phasemarkstyles[0]), markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + newylimits = recalcYlimits(plotrange,newylimits,gphs[p]) # 10/27/2011 build 18-Sep-2019 23:19:13 + if (newylimits[1]-newylimits[0] < minPhaseRange): build 18-Sep-2019 23:19:13 + newylimits = [-minPhaseRange,minPhaseRange] build 18-Sep-2019 23:19:13 + if (phase != ''): build 18-Sep-2019 23:19:13 + if ((phase[0] != 0 or phase[1] != 0) and amplitudeWithPhase): build 18-Sep-2019 23:19:13 + newylimits = phase build 18-Sep-2019 23:19:13 + if (sum(xflag)>0): build 18-Sep-2019 23:19:13 +# # # # print("phase: Resetting xaxis channel range to counteract flagged data") build 18-Sep-2019 23:19:13 + myxrange = np.max(channels)-np.min(channels) build 18-Sep-2019 23:19:13 + SetNewXLimits([np.min(channels)-myxrange/20, build 18-Sep-2019 23:19:13 + np.max(channels)+myxrange/20],14) build 18-Sep-2019 23:19:13 + if (xframe in bottomRowFrames or (xctr+1==len(antennasToPlot) and ispw==spwsToPlot[-1])): build 18-Sep-2019 23:19:13 + pb.xlabel("Channel", size=mysize) build 18-Sep-2019 23:19:13 + elif (xaxis.find('freq')>=0): # 'phase' build 18-Sep-2019 23:19:13 + if (bOverlay): build 18-Sep-2019 23:19:13 + pb.hold(True) build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("Preparing to plot phase from %f-%f for pols: %s" % (xfrequencies[0],xfrequencies[-1],str(polsToPlot))) build 18-Sep-2019 23:19:13 + print("Preparing to plot phase from %f-%f for pols: %s" % (pfrequencies[p][0],pfrequencies[p][-1],str(polsToPlot))) build 18-Sep-2019 23:19:13 + print("Preparing to plot phase from %f-%f for pols: %s" % (pfrequencies2[p][0],pfrequencies2[p][-1],str(polsToPlot))) build 18-Sep-2019 23:19:13 + myxrange = np.abs(xfrequencies[0]-xfrequencies[-1]) build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + xrange2 = np.abs(xfrequencies2[0]-xfrequencies2[-1]) build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + print("No phase data found in second solution. Try increasing the solutionTimeThresholdSeconds above %.0f." % (solutionTimeThresholdSeconds)) build 18-Sep-2019 23:19:13 + print("If this doesn't work, email the developer (%s)." % (developerEmail)) build 18-Sep-2019 23:19:13 + return() build 18-Sep-2019 23:19:13 + if (np.abs(myxrange/xrange2 - 1) > 0.05 + len(xflag)/len(xchannels)): # 0.0666 is 2000/1875-1 build 18-Sep-2019 23:19:13 + # These line widths are optimal for visualizing FDM over TDM build 18-Sep-2019 23:19:13 + width1 = 1 build 18-Sep-2019 23:19:13 + width2 = 4 build 18-Sep-2019 23:19:13 + # solutions differ in frequency width, so show the narrower one first build 18-Sep-2019 23:19:13 + if (myxrange < xrange2): build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + if (debug): print("pb.plot 1") build 18-Sep-2019 23:19:13 + pb.plot(pfrequencies[p], gphs[p], '%s%s'%(pcolor[p],phasemarkstyle), linewidth=width2, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gphs[p], sideband,plotrange,xchannels,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + if (debug): print("pb.plot 2") build 18-Sep-2019 23:19:13 + pb.plot(pfrequencies2[p], gphs2[p], '%s%s'%(p2color[p],phasemarkstyle), linewidth=width1, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gphs2[p], sideband,plotrange,xchannels2,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + if (debug): print("pb.plot 3") build 18-Sep-2019 23:19:13 + pb.plot(pfrequencies2[p], gphs2[p], '%s%s'%(p2color[p],phasemarkstyle), linewidth=width2, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gphs2[p], sideband,plotrange,xchannels2,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + if (debug): print("pb.plot 4") build 18-Sep-2019 23:19:13 + pb.plot(pfrequencies[p], gphs[p], '%s%s'%(pcolor[p],phasemarkstyle), linewidth=width1, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gphs[p], sideband,plotrange,xchannels,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + width1 = 1 build 18-Sep-2019 23:19:13 + width2 = 1 build 18-Sep-2019 23:19:13 + # solutions may be different level of smoothing, so plot highest rms first build 18-Sep-2019 23:19:13 + pb.hold(True) build 18-Sep-2019 23:19:13 + if (MAD(gphsx) < MAD(gphsx2)): build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + if (debug): print("pb.plot 5") build 18-Sep-2019 23:19:13 + pb.plot(pfrequencies2[p], gphs2[p], '%s%s'%(p2color[p],phasemarkstyle), linewidth=width1, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gphs2[p], sideband,plotrange,xchannels2,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + if (debug): print("pb.plot 6") build 18-Sep-2019 23:19:13 + pb.plot(pfrequencies[p], gphs[p], '%s%s'%(pcolor[p],phasemarkstyle), linewidth=width2, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gphs[p], sideband,plotrange,xchannels,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + if (debug): print("pb.plot 7") build 18-Sep-2019 23:19:13 + pb.plot(pfrequencies[p], gphs[p], '%s%s'%(pcolor[p],phasemarkstyle), linewidth=width2, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gphs[p], sideband,plotrange,xchannels,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + if (debug): print("pb.plot 9") build 18-Sep-2019 23:19:13 + pb.plot(pfrequencies2[p], gphs2[p], '%s%s'%(p2color[p],phasemarkstyle), linewidth=width1, markersize=markersize,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + newylimits = recalcYlimitsFreq(chanrange, newylimits, gphs2[p], sideband,plotrange,xchannels2,chanrangePercent=chanrangePercent) build 18-Sep-2019 23:19:13 + # must set new limits after plotting 'phase' build 18-Sep-2019 23:19:13 + (y0,y1) = pb.ylim() build 18-Sep-2019 23:19:13 + if (y1-y0 < minPhaseRange): build 18-Sep-2019 23:19:13 + # this must come before defining ticks build 18-Sep-2019 23:19:13 + SetNewYLimits([-minPhaseRange,minPhaseRange]) build 18-Sep-2019 23:19:13 + if (zoom=='intersect'): build 18-Sep-2019 23:19:13 + if (myxrange < xrange2): build 18-Sep-2019 23:19:13 + SetNewXLimits([min(xfrequencies[0],xfrequencies[-1])-myxrange*0.1, max(xfrequencies[0],xfrequencies[-1])+myxrange*0.1],15) build 18-Sep-2019 23:19:13 + SetLimits(plotrange, chanrange, newylimits, channels, frequencies, build 18-Sep-2019 23:19:13 + pfrequencies, ampMin, ampMax, xaxis,pxl, chanrangeSetXrange, build 18-Sep-2019 23:19:13 + chanrangePercent) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + SetNewXLimits([min(xfrequencies2[0],xfrequencies2[-1])-xrange2*0.1, max(xfrequencies2[0],xfrequencies2[-1])+xrange2*0.1],16) build 18-Sep-2019 23:19:13 + SetLimits(plotrange, chanrange, newylimits, channels, frequencies2, build 18-Sep-2019 23:19:13 + pfrequencies2, ampMin, ampMax, xaxis,pxl, chanrangeSetXrange, build 18-Sep-2019 23:19:13 + chanrangePercent) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (myxrange < xrange2): build 18-Sep-2019 23:19:13 + SetLimits(plotrange, chanrange, newylimits, channels, frequencies, build 18-Sep-2019 23:19:13 + pfrequencies, ampMin, ampMax, xaxis,pxl, chanrangeSetXrange, build 18-Sep-2019 23:19:13 + chanrangePercent) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + SetLimits(plotrange, chanrange, newylimits, channels, frequencies2, build 18-Sep-2019 23:19:13 + pfrequencies2, ampMin, ampMax, xaxis,pxl, chanrangeSetXrange, build 18-Sep-2019 23:19:13 + chanrangePercent) build 18-Sep-2019 23:19:13 + # draw polarization and spw labels build 18-Sep-2019 23:19:13 + if (xframe == firstFrame): build 18-Sep-2019 23:19:13 + # draw title including caltable name build 18-Sep-2019 23:19:13 + caltableList = 'c1 = ' + caltable + ', c2 = ' + caltable2 # + ' (%s)'%(utstring(uniqueTimes2[mytime],3)) build 18-Sep-2019 23:19:13 + pb.text(xstartTitle, ystartTitle, caltableList, size=titlesize, build 18-Sep-2019 23:19:13 + color='k', transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:13 + elif (bpolyOverlay): build 18-Sep-2019 23:19:13 + matches1 = [] build 18-Sep-2019 23:19:13 + for tbp in range(len(timesBP)): build 18-Sep-2019 23:19:13 + if (sloppyMatch(uniqueTimes[mytime], timesBP[tbp], solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:13 + mytime, scansToPlotPerSpw[ispw], scansForUniqueTimes, # au version build 18-Sep-2019 23:19:13 +# mytime, scansToPlot, scansForUniqueTimes, # task version build 18-Sep-2019 23:19:13 + myprint=debugSloppyMatch)): build 18-Sep-2019 23:19:13 + matches1.append(tbp) build 18-Sep-2019 23:19:13 + matches1 = np.array(matches1) build 18-Sep-2019 23:19:13 +# # # # print("time matches: matches1 = ", matches1) build 18-Sep-2019 23:19:13 + if (len(matches1) < 1): build 18-Sep-2019 23:19:13 + print("No time match found") build 18-Sep-2019 23:19:13 + print("If you are sure the solutions correspond to the same data, you can set solutionTimeThresholdSeconds=%.0f" % (1+np.ceil(np.abs(timesBP[0]-uniqueTimes[mytime])))) build 18-Sep-2019 23:19:13 + return() build 18-Sep-2019 23:19:13 +# # # # matches1 = np.where(np.floor(uniqueTimes[mytime]) == np.floor(np.array(timesBP)))[0] build 18-Sep-2019 23:19:13 + matches2 = np.where(xant == np.array(antennasBP))[0] build 18-Sep-2019 23:19:13 + if (len(matches2) < 1): build 18-Sep-2019 23:19:13 + print("No antenna match found between %s and %s" % (str(xant), str(antennasBP))) build 18-Sep-2019 23:19:13 +# # # # print("antenna matches: matches2 = ", matches2) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (tableFormat == 33): build 18-Sep-2019 23:19:13 + matches3 = np.where(ispw == np.array(cal_desc_idBP))[0] build 18-Sep-2019 23:19:13 + if (len(matches3) < 1): build 18-Sep-2019 23:19:13 + print("No spw match found: %d not in %s" % (ispw, str(cal_desc_idBP))) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + matches3 = np.where(ispw == np.array(spwBP))[0] build 18-Sep-2019 23:19:13 + if (len(matches3) < 1): build 18-Sep-2019 23:19:13 + print("No spw match found: %d not in %s" % (ispw, str(spwBP))) build 18-Sep-2019 23:19:13 +# # # # print("spw matches: matches3 = ", matches3) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + matches12 = np.intersect1d(matches1,matches2) build 18-Sep-2019 23:19:13 + if (len(matches12) < 1): build 18-Sep-2019 23:19:13 + print("No match between: %s and %s" % (str(matches1), str(matches2))) build 18-Sep-2019 23:19:13 +# # # # print("antenna&time matches: matches12 = ", matches12) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + matches = np.intersect1d(matches12, matches3) build 18-Sep-2019 23:19:13 + if (len(matches) < 1): build 18-Sep-2019 23:19:13 + print("No match between: %s and %s" % (str(matches12), str(matches3))) build 18-Sep-2019 23:19:13 +# # # # print("antenna&time&spw matches: matches = ", matches) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + index = matches[0] # holds the row number of the matching solution in the BPOLY table build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + print("No match found for time=%.6f, xant=%d, ispw=%d" % (uniqueTimes[mytime],xant,ispw)) build 18-Sep-2019 23:19:13 + print("antennasBP = %s" % (str(antennasBP))) build 18-Sep-2019 23:19:13 + print("cal_desc_idBP = %s" % (str(cal_desc_idBP))) build 18-Sep-2019 23:19:13 + timesBPstring = "timesBP = " build 18-Sep-2019 23:19:13 + for i in timesBP: build 18-Sep-2019 23:19:13 + timesBPstring += "%.6f, " % i build 18-Sep-2019 23:19:13 + print(timesBPstring) build 18-Sep-2019 23:19:13 + return() build 18-Sep-2019 23:19:13 +# # # # print("phase: Using index = %d/%d (mytime=%d), domain=%.3f,%.3f" % (index,len(polynomialPhase),mytime,frequencyLimits[0,index]*1e-9,frequencyLimits[1,index]*1e-9)) build 18-Sep-2019 23:19:13 + if (debug): print("BRowNumber = %d, BPolyRowNumber = %d" % (BRowNumber, index)) build 18-Sep-2019 23:19:13 + validDomain = [frequencyLimits[0,index], frequencyLimits[1,index]] build 18-Sep-2019 23:19:13 + cc = calcChebyshev(polynomialPhase[index][0:nPolyPhase[index]], validDomain, frequenciesGHz[index]*1e+9) * 180/math.pi build 18-Sep-2019 23:19:13 + fa = np.array(frequenciesGHz[index]) build 18-Sep-2019 23:19:13 + if (xfrequencies[0] < xfrequencies[-1]): build 18-Sep-2019 23:19:13 + matches = np.where(fa>xfrequencies[0])[0] build 18-Sep-2019 23:19:13 + matches2 = np.where(faxfrequencies[-1])[0] build 18-Sep-2019 23:19:13 + matches2 = np.where(fa 0): build 18-Sep-2019 23:19:13 + if (np.max(gphs[p]) < minPhaseRange and np.min(gphs[p]) > -minPhaseRange): build 18-Sep-2019 23:19:13 + SetNewYLimits([-minPhaseRange,minPhaseRange]) build 18-Sep-2019 23:19:13 + #endif bOverlay build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (1==1): build 18-Sep-2019 23:19:13 + pb.xlabel(xlabelString, size=mysize) build 18-Sep-2019 23:19:13 + #endif xaxis='chan'/freq for 'phase' build 18-Sep-2019 23:19:13 + if (overlayTimes): build 18-Sep-2019 23:19:13 + timeString ='' build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + timeString = ', t%d/%d %s' % (mytime,nUniqueTimes-1,utstring(uniqueTimes[mytime],3)) build 18-Sep-2019 23:19:13 + if (scansForUniqueTimes != []): build 18-Sep-2019 23:19:13 + if (scansForUniqueTimes[mytime]>=0): build 18-Sep-2019 23:19:13 + timeString = ', scan%d %s' % (scansForUniqueTimes[mytime],utstring(uniqueTimes[mytime],3)) build 18-Sep-2019 23:19:13 + spwString = buildSpwString(overlaySpws, overlayBasebands, build 18-Sep-2019 23:19:13 + spwsToPlot, ispw, originalSpw[ispw], build 18-Sep-2019 23:19:13 + observatoryName, baseband, build 18-Sep-2019 23:19:13 + showBasebandNumber) build 18-Sep-2019 23:19:13 + titleString = "%sspw%s, field %d: %s%s" % (antennaString, build 18-Sep-2019 23:19:13 + spwString,uniqueFields[fieldIndex],fieldString,timeString) build 18-Sep-2019 23:19:13 + pb.title(titleString,size=titlesize-int(len(titleString)/(maxCharsBeforeReducingTitleFontSize/subplotCols))) build 18-Sep-2019 23:19:13 + if (abs(plotrange[0]) > 0 or abs(plotrange[1]) > 0): build 18-Sep-2019 23:19:13 + SetNewXLimits([plotrange[0],plotrange[1]],18) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # Here is 1st place where we eliminate any white space on the right and left edge of the plots: 'phase' build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (xaxis.find('chan')>=0): build 18-Sep-2019 23:19:13 + SetNewXLimits([channels[0],channels[-1]]) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (zoom != 'intersect'): build 18-Sep-2019 23:19:13 + if (overlaySpws or overlayBasebands): build 18-Sep-2019 23:19:13 + SetNewXLimits(frequencyRangeToPlotInBaseband[bbctr]) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + SetNewXLimits([frequencies[0], frequencies[-1]]) build 18-Sep-2019 23:19:13 + if (bOverlay): build 18-Sep-2019 23:19:13 + if (xrange2 > myxrange+0.1 and zoom != 'intersect'): build 18-Sep-2019 23:19:13 + TDMisSecond = True build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (abs(plotrange[2]) > 0 or abs(plotrange[3]) > 0): build 18-Sep-2019 23:19:13 + if (amplitudeWithPhase == False or phase == ''): build 18-Sep-2019 23:19:13 + SetNewYLimits([plotrange[2],plotrange[3]]) build 18-Sep-2019 23:19:13 + if (amplitudeWithPhase and phase != ''): build 18-Sep-2019 23:19:13 + if (phase[0] != 0 or phase[1] != 0): build 18-Sep-2019 23:19:13 + SetNewYLimits(phase) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + (y0,y1) = pb.ylim() build 18-Sep-2019 23:19:13 + if (y1-y0 < minPhaseRange): build 18-Sep-2019 23:19:13 + # this must come before defining ticks build 18-Sep-2019 23:19:13 + SetNewYLimits([-minPhaseRange,minPhaseRange]) build 18-Sep-2019 23:19:13 + SetNewYLimits(newylimits) # added 10/2/2012 for the case of only 1 data point build 18-Sep-2019 23:19:13 + if (amplitudeWithPhase and phase != ''): build 18-Sep-2019 23:19:13 + if (phase[0] != 0 or phase[1] != 0): build 18-Sep-2019 23:19:13 + SetNewYLimits(phase) build 18-Sep-2019 23:19:13 + (y0,y1) = pb.ylim() build 18-Sep-2019 23:19:13 + ResizeFonts(adesc,mysize) build 18-Sep-2019 23:19:13 + adesc.xaxis.grid(True,which='major') build 18-Sep-2019 23:19:13 + adesc.yaxis.grid(True,which='major') build 18-Sep-2019 23:19:13 + pb.ylabel(yPhaseLabel, size=mysize) build 18-Sep-2019 23:19:13 + pb.subplots_adjust(hspace=myhspace, wspace=mywspace) build 18-Sep-2019 23:19:13 + ylim = pb.ylim() build 18-Sep-2019 23:19:13 + xlim = pb.xlim() build 18-Sep-2019 23:19:13 + myxrange = xlim[1]-xlim[0] build 18-Sep-2019 23:19:13 + yrange = ylim[1]-ylim[0] build 18-Sep-2019 23:19:13 +# # # # print("phase: ylim, yrange = ", ylim, yrange) build 18-Sep-2019 23:19:13 + myap = 0 build 18-Sep-2019 23:19:13 + if (overlayAntennas == False and overlayTimes == False and bOverlay == False and build 18-Sep-2019 23:19:13 + ((overlaySpws == False and overlayBasebands == False) or spwctr==spwctrFirstToPlot)): build 18-Sep-2019 23:19:13 + # draw polarization labels build 18-Sep-2019 23:19:13 + x0 = xstartPolLabel build 18-Sep-2019 23:19:13 + y0 = ystartPolLabel build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + pb.text(x0, y0-0.03*subplotRows*p, corrTypeToString(corr_type[p]), color=pcolor[p], build 18-Sep-2019 23:19:13 + size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + if (channeldiff > 0): build 18-Sep-2019 23:19:13 + pb.text(x0, ystartMadLabel-0.03*subplotRows*p, build 18-Sep-2019 23:19:13 + corrTypeToString(corr_type[p])+' MAD = %.4f, St.Dev = %.4f'%(gphs_mad[p]['mad'],gphs_std[p]['std']), build 18-Sep-2019 23:19:13 + color=pcolor[p],size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + if (xframe == firstFrame): build 18-Sep-2019 23:19:13 + # draw title including caltable name build 18-Sep-2019 23:19:13 + caltableList = caltableTitle build 18-Sep-2019 23:19:13 + if (bpolyOverlay): build 18-Sep-2019 23:19:13 + caltableList += ', ' + caltable2 + ' (degamp=%d, degphase=%d)'%(nPolyAmp[index]-1,nPolyPhase[index]-1) build 18-Sep-2019 23:19:13 + if (bpolyOverlay2): build 18-Sep-2019 23:19:13 + caltableList += ', ' + caltable3 + ' (degamp=%d, degphase=%d)'%(nPolyAmp2[index]-1,nPolyPhase2[index]-1) build 18-Sep-2019 23:19:13 + pb.text(xstartTitle, ystartTitle, caltableList, size=titlesize, build 18-Sep-2019 23:19:13 + color='k', transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:13 + elif (overlayAntennas==True and xant==antennasToPlot[-1] and bOverlay==False # ): build 18-Sep-2019 23:19:13 + and overlayTimes==False): # try to support antenna,time avoid antenna labels 'phase' build 18-Sep-2019 23:19:13 + # We do this last, because by then, the limits will be stable. build 18-Sep-2019 23:19:13 + x0 = xstartPolLabel build 18-Sep-2019 23:19:13 + y0 = ystartPolLabel build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[0]) in polsToPlot): build 18-Sep-2019 23:19:13 + if (channeldiff > 0): build 18-Sep-2019 23:19:13 + pb.text(x0, ystartMadLabel-0.03*subplotRows*p, build 18-Sep-2019 23:19:13 + corrTypeToString(corr_type[p])+' MAD = %.4f, St.Dev = %.4f'%(gphs_mad[p]['mad'],gphs_std[p]['std']), build 18-Sep-2019 23:19:13 + color=overlayColors[0], size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + if (phasemarkstyle.find('-')>=0): build 18-Sep-2019 23:19:13 + pb.text(x0, y0-0.03*subplotRows*0, corrTypeToString(corr_type[0])+' solid', color=overlayColors[0], build 18-Sep-2019 23:19:13 + fontsize=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pb.text(x0+0.02, y0-0.03*subplotRows*0, corrTypeToString(corr_type[0]), color=overlayColors[0], build 18-Sep-2019 23:19:13 + fontsize=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + pdesc = pb.plot([x0], [y0+0.015-0*0.03*subplotRows], '%sk'%phasemarkstyle, markersize=markersize, build 18-Sep-2019 23:19:13 + scalex=False,scaley=False, transform=pb.gca().transAxes,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + if (len(corr_type) > 1): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[1]) in polsToPlot): build 18-Sep-2019 23:19:13 + if (channeldiff > 0): build 18-Sep-2019 23:19:13 + pb.text(x0, ystartMadLabel-0.03*subplotRows*p, build 18-Sep-2019 23:19:13 + corrTypeToString(corr_type[p])+' MAD = %.4f, St.Dev = %.4f'%(gphs_mad[p]['mad'],gphs_std[p]['std']), build 18-Sep-2019 23:19:13 + color=overlayColors[0], size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + if (phasemarkstyle2.find('--')>=0): build 18-Sep-2019 23:19:13 + pb.text(x0, y0-0.03*subplotRows*1, corrTypeToString(corr_type[1])+' dashed', color=overlayColors[0], build 18-Sep-2019 23:19:13 + fontsize=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pb.text(x0+0.02, y0-0.03*subplotRows*1, corrTypeToString(corr_type[1]), color=overlayColors[0], build 18-Sep-2019 23:19:13 + fontsize=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + pdesc = pb.plot([x0], [y0+0.015*subplotRows-0.03*subplotRows*1],'%sk'%phasemarkstyle2, markersize=markersize, build 18-Sep-2019 23:19:13 + scalex=False,scaley=False, transform=pb.gca().transAxes,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + if (xframe == firstFrame): build 18-Sep-2019 23:19:13 + # draw title including caltable name build 18-Sep-2019 23:19:13 + pb.text(xstartTitle, ystartTitle, caltableTitle, size=titlesize, color='k', build 18-Sep-2019 23:19:13 + transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:13 + DrawAntennaNames(msAnt, antennasToPlot, msFound, mysize) build 18-Sep-2019 23:19:13 + elif (overlayTimes==True and bOverlay == False build 18-Sep-2019 23:19:13 + and overlayAntennas==False): # try to support antenna,time build 18-Sep-2019 23:19:13 + doneOverlayTime = True # assumed until proven otherwise in the 'for' loop build 18-Sep-2019 23:19:13 + for f in fieldIndicesToPlot: build 18-Sep-2019 23:19:13 + if (uniqueTimes[mytime] < uniqueTimesPerFieldPerSpw[ispwInCalTable][f][-1]-solutionTimeThresholdSeconds and build 18-Sep-2019 23:19:13 + uniqueTimes[mytime] < timerangeListTimes[-1]): build 18-Sep-2019 23:19:13 + doneOverlayTime = False build 18-Sep-2019 23:19:13 + if (doneOverlayTime): build 18-Sep-2019 23:19:13 + # either it is the last time of any times in solution, or the last time in the list of times to plot build 18-Sep-2019 23:19:13 + mytime = nUniqueTimes-1 build 18-Sep-2019 23:19:13 + # We do this last, because by then, the limits will be broad enough and stable. build 18-Sep-2019 23:19:13 + x0 = xstartPolLabel build 18-Sep-2019 23:19:13 + y0 = ystartPolLabel build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[0]) in polsToPlot): build 18-Sep-2019 23:19:13 + if (channeldiff > 0): build 18-Sep-2019 23:19:13 + p = 0 build 18-Sep-2019 23:19:13 + pb.text(x0, ystartMadLabel-0.03*subplotRows*p, build 18-Sep-2019 23:19:13 + corrTypeToString(corr_type[p])+' MAD = %.4f'%(gphs_mad[p]['mad']), build 18-Sep-2019 23:19:13 + color='k', size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + if (phasemarkstyle.find('-')>=0): build 18-Sep-2019 23:19:13 + pb.text(x0, y0, corrTypeToString(corr_type[0])+' solid', color='k', build 18-Sep-2019 23:19:13 + fontsize=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pb.text(x0+0.02, y0, corrTypeToString(corr_type[0]), color='k', build 18-Sep-2019 23:19:13 + fontsize=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + pdesc = pb.plot([x0], [y0+0.015*subplotRows], '%sk'%phasemarkstyle, markersize=markersize, build 18-Sep-2019 23:19:13 + scalex=False,scaley=False, transform=pb.gca().transAxes,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + if (len(corr_type) > 1): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[1]) in polsToPlot): build 18-Sep-2019 23:19:13 + if (channeldiff > 0): build 18-Sep-2019 23:19:13 + p = 1 build 18-Sep-2019 23:19:13 + pb.text(x0, ystartMadLabel-0.03*subplotRows*p, build 18-Sep-2019 23:19:13 + corrTypeToString(corr_type[p])+' MAD = %.4f'%(gphs_mad[p]['mad']), build 18-Sep-2019 23:19:13 + color='k', size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + if (phasemarkstyle2.find('--')>=0): build 18-Sep-2019 23:19:13 + pb.text(x0, y0-0.03*subplotRows, corrTypeToString(corr_type[1])+' dashed', build 18-Sep-2019 23:19:13 + color='k',fontsize=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pb.text(x0+0.02, y0-0.03*subplotRows, corrTypeToString(corr_type[1]), build 18-Sep-2019 23:19:13 + color='k', fontsize=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + pdesc = pb.plot([x0], [y0+0.015*subplotRows-0.03*subplotRows], '%sk'%phasemarkstyle2, build 18-Sep-2019 23:19:13 + markersize=markersize, scalex=False,scaley=False, transform=pb.gca().transAxes,markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + if (xframe == firstFrame): build 18-Sep-2019 23:19:13 + # draw title including caltable name build 18-Sep-2019 23:19:13 + pb.text(xstartTitle, ystartTitle, caltableTitle, size=titlesize, color='k', build 18-Sep-2019 23:19:13 + transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:13 + if (debug): print("drawOverlayTimeLegends loc 4") build 18-Sep-2019 23:19:13 + drawOverlayTimeLegends(xframe,firstFrame,xstartTitle,ystartTitle, build 18-Sep-2019 23:19:13 + caltable,titlesize,fieldIndicesToPlot, build 18-Sep-2019 23:19:13 + ispwInCalTable,uniqueTimesPerFieldPerSpw, build 18-Sep-2019 23:19:13 + timerangeListTimes, solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:13 + debugSloppyMatch,ystartOverlayLegend,debug,mysize, build 18-Sep-2019 23:19:13 + fieldsToPlot,myUniqueColor,timeHorizontalSpacing, build 18-Sep-2019 23:19:13 + fieldIndex,overlayColors, antennaVerticalSpacing, build 18-Sep-2019 23:19:13 + overlayAntennas, timerangeList, caltableTitle, build 18-Sep-2019 23:19:13 + mytime, scansToPlotPerSpw[ispw], scansForUniqueTimes) build 18-Sep-2019 23:19:13 +# mytime, scansToPlot, scansForUniqueTimes) # task version build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + elif (overlayAntennas and overlayTimes): # Oct 23, 2012 build 18-Sep-2019 23:19:13 + # This will only happen for: try to support overlay='antenna,time' build 18-Sep-2019 23:19:13 + if (xframe == firstFrame and mytime==0 and xctr==firstUnflaggedAntennaToPlot and bOverlay==False): build 18-Sep-2019 23:19:13 + # draw title including caltable name build 18-Sep-2019 23:19:13 + pb.text(xstartTitle, ystartTitle, caltableTitle, size=titlesize, color='k', build 18-Sep-2019 23:19:13 + transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:13 + DrawBottomLegendPageCoords(msName, uniqueTimes[mytime], mysize, figfile) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + #endif (overlayAntennas == False and overlayTimes == False and bOverlay == False) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # Here is 2nd place where we eliminate any white space on the right and left edge of the plots: 'phase' build 18-Sep-2019 23:19:13 + if (abs(plotrange[2]) > 0 or abs(plotrange[3]) > 0): build 18-Sep-2019 23:19:13 + if (amplitudeWithPhase == False or phase == ''): build 18-Sep-2019 23:19:13 + SetNewYLimits([plotrange[2],plotrange[3]]) build 18-Sep-2019 23:19:13 + if (phase != '' and amplitudeWithPhase): build 18-Sep-2019 23:19:13 + if (phase[0] != 0 or phase[1] != 0): build 18-Sep-2019 23:19:13 + SetNewYLimits(phase) build 18-Sep-2019 23:19:13 + if (plotrange[0]==0 and plotrange[1]==0): build 18-Sep-2019 23:19:13 + if (xaxis.find('chan')>=0): build 18-Sep-2019 23:19:13 + SetNewXLimits([channels[0],channels[-1]]) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (zoom != 'intersect'): build 18-Sep-2019 23:19:13 + if (overlaySpws or overlayBasebands): build 18-Sep-2019 23:19:13 + SetNewXLimits(frequencyRangeToPlotInBaseband[bbctr]) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + SetNewXLimits([frequencies[0], frequencies[-1]]) build 18-Sep-2019 23:19:13 + if (bOverlay): build 18-Sep-2019 23:19:13 + if (xrange2 >= myxrange and zoom != 'intersect'): build 18-Sep-2019 23:19:13 + # This is necessary if caltable2=TDM and caltable=FDM build 18-Sep-2019 23:19:13 + SetNewXLimits([frequencies2[0], frequencies2[-1]]) build 18-Sep-2019 23:19:13 + if (xrange2 > myxrange+0.1 and zoom != 'intersect'): build 18-Sep-2019 23:19:13 + TDMisSecond = True build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + SetNewXLimits([plotrange[0], plotrange[1]]) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # I need the following line for chanrange to work build 18-Sep-2019 23:19:13 + if (chanrange[0] != 0 or chanrange[1] != 0): build 18-Sep-2019 23:19:13 + SetLimits(plotrange, chanrange, newylimits, channels, frequencies, pfrequencies, build 18-Sep-2019 23:19:13 + ampMin, ampMax, xaxis,pxl, chanrangeSetXrange, build 18-Sep-2019 23:19:13 + chanrangePercent) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # Finally, draw the atmosphere and FDM windows, if requested. 'phase' build 18-Sep-2019 23:19:13 + if ((overlayAntennas==False and overlayTimes==False) or build 18-Sep-2019 23:19:13 + (overlayAntennas==True and overlayTimes==False and xant==antennasToPlot[-1]) or build 18-Sep-2019 23:19:13 + (overlayTimes==True and overlayAntennas==False and doneOverlayTime) or build 18-Sep-2019 23:19:13 + (xant==antennasToPlot[-1] and doneOverlayTime) build 18-Sep-2019 23:19:13 + ): build 18-Sep-2019 23:19:13 + if ((showatm or showtsky) and len(atmString)>0): build 18-Sep-2019 23:19:13 + DrawAtmosphere(showatm, showtsky, subplotRows, atmString, build 18-Sep-2019 23:19:13 + mysize, TebbSky, plotrange, xaxis, atmchan, build 18-Sep-2019 23:19:13 + atmfreq, transmission, subplotCols, build 18-Sep-2019 23:19:13 + showatmPoints=showatmPoints, xframe=xframe, build 18-Sep-2019 23:19:13 + channels=channels, mylineno=lineNumber(), build 18-Sep-2019 23:19:13 + overlaySpws=overlaySpws, build 18-Sep-2019 23:19:13 + overlayBasebands=overlayBasebands, build 18-Sep-2019 23:19:13 + drewAtmosphere=drewAtmosphere) build 18-Sep-2019 23:19:13 + if (LO1 != '' and LO1 is not None): build 18-Sep-2019 23:19:13 + DrawAtmosphere(showatm,showtsky, subplotRows, atmString, build 18-Sep-2019 23:19:13 + mysize, TebbSky, plotrange, xaxis, atmchanImage, build 18-Sep-2019 23:19:13 + atmfreqImage, transmissionImage, subplotCols, build 18-Sep-2019 23:19:13 + LO1, xframe, firstFrame, showatmPoints, build 18-Sep-2019 23:19:13 + channels=channels, mylineno=lineNumber(), build 18-Sep-2019 23:19:13 + overlaySpws=overlaySpws, build 18-Sep-2019 23:19:13 + overlayBasebands=overlayBasebands, build 18-Sep-2019 23:19:13 + drewAtmosphere=drewAtmosphere) build 18-Sep-2019 23:19:13 + drewAtmosphere = True build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (xaxis.find('freq')>=0 and showfdm and nChannels <= 256): build 18-Sep-2019 23:19:13 + if (tableFormat == 33): build 18-Sep-2019 23:19:13 + showFDM(originalSpw_casa33, chanFreqGHz_casa33, baseband, showBasebandNumber, basebandDict) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + showFDM(originalSpw, chanFreqGHz, baseband, showBasebandNumber, basebandDict) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (bOverlay): build 18-Sep-2019 23:19:13 + # draw polarization labels build 18-Sep-2019 23:19:13 + x0 = xstartPolLabel build 18-Sep-2019 23:19:13 + y0 = ystartPolLabel build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + pb.text(x0, y0-p*0.03*subplotRows, corrTypeToString(corr_type[p])+'-c1', build 18-Sep-2019 23:19:13 + color=pcolor[p],size=mysize,transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + pb.text(x0, y0-(p*0.03+0.06)*subplotRows, corrTypeToString(corr_type[p])+'-c2', build 18-Sep-2019 23:19:13 + color=p2color[p],size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + if (bpolyOverlay and xaxis.find('freq')>=0): build 18-Sep-2019 23:19:13 + x0 = xstartPolLabel build 18-Sep-2019 23:19:13 + y0 = ystartPolLabel build 18-Sep-2019 23:19:13 + if (xcolor != x2color): build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + pb.text(x0+0.1, y0-p*0.03*subplotRows, corrTypeToString(corr_type[p]), color=p2color[p], build 18-Sep-2019 23:19:13 + size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + if (bpolyOverlay2): build 18-Sep-2019 23:19:13 + for p in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (corrTypeToString(corr_type[p]) in polsToPlot): build 18-Sep-2019 23:19:13 + pb.text(x0+0.2, y0-p*0.03*subplotRows, corrTypeToString(corr_type[p]), color=p3color[p], build 18-Sep-2019 23:19:13 + size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # endif (yaxis='phase') build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + redisplay = False build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (xframe == lastFrame): build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("*** mytime+1=%d, nUniqueTimes=%d, timerangeList[-1]=%d, doneOverlayTime=%s" % (mytime+1, nUniqueTimes,timerangeList[-1],doneOverlayTime)) build 18-Sep-2019 23:19:13 + print("*** xant=%d, antennasToPlot[-1]=%d, overlayAntennas=%s, overlayTimes=%s" % (xant,antennasToPlot[-1],overlayAntennas,overlayTimes)) build 18-Sep-2019 23:19:13 + print("*** xframe=%d, lastFrame=%d, xctr=%d, spwctr=%d, len(antennasToPlot)=%d, len(spwsToPlot)=%d" % (xframe,lastFrame,xctr,spwctr,len(antennasToPlot), len(spwsToPlot))) build 18-Sep-2019 23:19:13 + myIndexTime = uniqueTimesPerFieldPerSpw[ispwInCalTable][fieldIndex][-1] build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("myIndexTime = ", myIndexTime) build 18-Sep-2019 23:19:13 + matched,mymatch = sloppyMatch(myIndexTime,uniqueTimes,solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:13 + mytime, scansToPlotPerSpw[ispw], scansForUniqueTimes, # au version build 18-Sep-2019 23:19:13 +# mytime, scansToPlot, scansForUniqueTimes, # task version build 18-Sep-2019 23:19:13 + whichone=True, myprint=False) build 18-Sep-2019 23:19:13 + if (matched==False and scansForUniqueTimes[mytime] in scansToPlotPerSpw[ispw]): build 18-Sep-2019 23:19:13 + print("---------- 2) Did not find %f within %.1f seconds of anything in %s" % (myIndexTime,solutionTimeThresholdSeconds,str(uniqueTimes))) build 18-Sep-2019 23:19:13 + print("Try re-running with a smaller solutionTimeThresholdSeconds (currently %f)" % (solutionTimeThresholdSeconds)) build 18-Sep-2019 23:19:13 + return build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + # we are on the final time to be plotted build 18-Sep-2019 23:19:13 + if (debug): print("on the final time") build 18-Sep-2019 23:19:13 + mytimeTest = mytime==nUniqueTimes-1 build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("mytimeTest = %s" % (mytimeTest)) build 18-Sep-2019 23:19:13 + if (scansForUniqueTimes == []): build 18-Sep-2019 23:19:13 + # old 3.3 cal tables will land here build 18-Sep-2019 23:19:13 + scanTest = False build 18-Sep-2019 23:19:13 + scanTest2 = False build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("ispw=%d len(scansToPlotPerSpw[ispw])=%d mytime=%d, len(scansForUniqueTimes)=%d" % (ispw,len(scansToPlotPerSpw[ispw]),mytime,len(scansForUniqueTimes))) build 18-Sep-2019 23:19:13 + print("scansToPlotPerSpw = ", scansToPlotPerSpw) build 18-Sep-2019 23:19:13 + if (len(scansToPlotPerSpw[ispw]) == 0): build 18-Sep-2019 23:19:13 + scanTest = False build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + scanTest = scansToPlotPerSpw[ispw][-1]==scansForUniqueTimes[mytime] build 18-Sep-2019 23:19:13 + highestSpwIndexInSpwsToPlotThatHasCurrentScan = \ build 18-Sep-2019 23:19:13 + computeHighestSpwIndexInSpwsToPlotThatHasCurrentScan(spwsToPlot, scansToPlotPerSpw, scansForUniqueTimes[mytime]) build 18-Sep-2019 23:19:13 + if (highestSpwIndexInSpwsToPlotThatHasCurrentScan == -1): build 18-Sep-2019 23:19:13 + scanTest2 = False build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + scanTest2 = (spwctr == highestSpwIndexInSpwsToPlotThatHasCurrentScan) build 18-Sep-2019 23:19:13 + if ((overlayAntennas==False and overlayTimes==False and overlaySpws==False and overlayBasebands==False) build 18-Sep-2019 23:19:13 + # either it is the last time of any, or the last time in the list of times to plot build 18-Sep-2019 23:19:13 + or (overlayAntennas==False and overlaySpws==False and overlayBasebands==False and (mytime+1==nUniqueTimes or mytime == timerangeList[-1])) # or mytimeTest)) # removed on July 25,2013 build 18-Sep-2019 23:19:13 + or (xant==antennasToPlot[-1] and overlayAntennas==True and overlayTimes==False and overlaySpws==False and overlayBasebands==False) build 18-Sep-2019 23:19:13 + # The following case is needed to prevent frame=225 in test86 (spectral scan dataset with overlay='spw') build 18-Sep-2019 23:19:13 + # and the lack of showing of 7 of 8 of the spws in final frame of test61. scanTest2 matches both cases. build 18-Sep-2019 23:19:13 + or (scanTest and scanTest2 and overlaySpws and overlayAntennas==False and overlayTimes==False) build 18-Sep-2019 23:19:13 + or ((spwctr==len(spwsToPlot)-1) and (overlayBasebands or overlaySpws) and overlayAntennas==False and overlayTimes==False) build 18-Sep-2019 23:19:13 + # following case is needed for scans parameter with overlay='time' build 18-Sep-2019 23:19:13 + or (overlayTimes and scanTest and overlayAntennas==False) build 18-Sep-2019 23:19:13 + # Following case is needed to make subplot=11 to work for: try to support overlay='antenna,time' : 'phase' build 18-Sep-2019 23:19:13 + or (xframe == lastFrame and overlayTimes and overlayAntennas and build 18-Sep-2019 23:19:13 + xctr+1==len(antennasToPlot) and build 18-Sep-2019 23:19:13 + mytimeTest and build 18-Sep-2019 23:19:13 + spwctr0 on July 30, 2013 to prevent crash when called with single build 18-Sep-2019 23:19:13 + # antenna and subplot=11 and all solutions flagged. build 18-Sep-2019 23:19:13 + if (len(figfile) > 0 and len(pages)>0): build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("calling makeplot") build 18-Sep-2019 23:19:13 + plotfiles.append(makeplot(figfile,msFound,msAnt, build 18-Sep-2019 23:19:13 + overlayAntennas,pages,pagectr, build 18-Sep-2019 23:19:13 + density,interactive,antennasToPlot, build 18-Sep-2019 23:19:13 + spwsToPlot,overlayTimes,overlayBasebands, build 18-Sep-2019 23:19:13 + 4,xant,ispw,subplot,resample,debug, build 18-Sep-2019 23:19:13 + figfileSequential, figfileNumber)) build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("done makeplot") build 18-Sep-2019 23:19:13 + figfileNumber += 1 build 18-Sep-2019 23:19:13 + myinput = '' build 18-Sep-2019 23:19:13 + donetime = timeUtilities.time() build 18-Sep-2019 23:19:13 + drewAtmosphere = False # needed for CAS-7187 (subplot=11) build 18-Sep-2019 23:19:13 + if (interactive): build 18-Sep-2019 23:19:13 + pb.draw() build 18-Sep-2019 23:19:13 +# # # # myinput = raw_input("(%.1f sec) Press return for next screen (b for backwards, q to quit): "%(donetime-mytimestamp)) build 18-Sep-2019 23:19:13 + myinput = raw_input("Press return for next page (b for backwards, q to quit): ") build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + myinput = '' build 18-Sep-2019 23:19:13 + skippingSpwMessageSent = 0 build 18-Sep-2019 23:19:13 + mytimestamp = timeUtilities.time() build 18-Sep-2019 23:19:13 + if (myinput.find('q') >= 0): build 18-Sep-2019 23:19:13 + mytime = len(uniqueTimes) build 18-Sep-2019 23:19:13 + spwctr = len(spwsToPlot) build 18-Sep-2019 23:19:13 + xctr = len(antennasToPlot) build 18-Sep-2019 23:19:13 + bbctr = len(spwsToPlotInBaseband) build 18-Sep-2019 23:19:13 + break build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("4)Setting xframe to %d" % (xframeStart)) build 18-Sep-2019 23:19:13 + xframe = xframeStart build 18-Sep-2019 23:19:13 + myUniqueColor = [] build 18-Sep-2019 23:19:13 + pb.subplots_adjust(hspace=myhspace, wspace=mywspace) build 18-Sep-2019 23:19:13 + if (myinput.find('b') >= 0): build 18-Sep-2019 23:19:13 + if (pagectr > 0): build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("Decrementing pagectr from %d to %d" % (pagectr, pagectr-1)) build 18-Sep-2019 23:19:13 + pagectr -= 1 build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("Not decrementing pagectr=%d" % (pagectr)) build 18-Sep-2019 23:19:13 + redisplay = True build 18-Sep-2019 23:19:13 + #redisplay the current page by setting ctrs back to the value they had at start of that page build 18-Sep-2019 23:19:13 + xctr = pages[pagectr][PAGE_ANT] build 18-Sep-2019 23:19:13 + spwctr = pages[pagectr][PAGE_SPW] build 18-Sep-2019 23:19:13 + mytime = pages[pagectr][PAGE_TIME] build 18-Sep-2019 23:19:13 + myap = pages[pagectr][PAGE_AP] build 18-Sep-2019 23:19:13 + xant = antennasToPlot[xctr] build 18-Sep-2019 23:19:13 + antstring, Antstring = buildAntString(xant,msFound,msAnt) build 18-Sep-2019 23:19:13 + ispw = spwsToPlot[spwctr] build 18-Sep-2019 23:19:13 +# # # # print("Returning to [%d,%d,%d,%d]" % (xctr,spwctr,mytime,myap)) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pagectr += 1 build 18-Sep-2019 23:19:13 + if (pagectr >= len(pages)): build 18-Sep-2019 23:19:13 + newpage = 1 build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + newpage = 0 build 18-Sep-2019 23:19:13 + if (overlayTimes==True and build 18-Sep-2019 23:19:13 + sloppyMatch(uniqueTimesPerFieldPerSpw[ispwInCalTable][fieldIndex][-1], build 18-Sep-2019 23:19:13 + uniqueTimes[mytime],solutionTimeThresholdSeconds, build 18-Sep-2019 23:19:13 + mytime, scansToPlotPerSpw[ispw], scansForUniqueTimes, # au version build 18-Sep-2019 23:19:13 +# mytime, scansToPlot, scansForUniqueTimes, # task version build 18-Sep-2019 23:19:13 + myprint=debugSloppyMatch)): build 18-Sep-2019 23:19:13 + # be sure to avoid any more loops through mytime which will cause 'b' button to fail build 18-Sep-2019 23:19:13 + mytime = nUniqueTimes build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print(">>>>>>>>>>> Not going to new page, uniqueTimes[mytime]=%.8f, uniqueTimesPerFieldPerSpw[ispwInCalTable=%d][fieldIndex=%d][-1]=%.8f" % (uniqueTimes[mytime], ispwInCalTable, fieldIndex, uniqueTimesPerFieldPerSpw[ispwInCalTable][fieldIndex][-1])) build 18-Sep-2019 23:19:13 + print("spwctr=%d ?== (len(spwsToPlot)-1)=%d, spwsToPlot=" % (spwctr,len(spwsToPlot)-1),spwsToPlot) build 18-Sep-2019 23:19:13 + print("test1: %s" % (overlayAntennas==False and overlayTimes==False and overlaySpws==False and overlayBasebands==False)) build 18-Sep-2019 23:19:13 + print("test2: %s" % (overlayAntennas==False and overlaySpws==False and overlayBasebands==False and (mytime+1==nUniqueTimes or mytime == timerangeList[-1]))) build 18-Sep-2019 23:19:13 + print("test3: %s" % (xant==antennasToPlot[-1] and overlayAntennas==True and overlayTimes==False and overlaySpws==False and overlayBasebands==False)) build 18-Sep-2019 23:19:13 + print("*test4: %s" % ((spwctr==len(spwsToPlot)-1) and (overlaySpws or overlayBasebands) and overlayAntennas==False and overlayTimes==False) ) build 18-Sep-2019 23:19:13 + print(" * = overlaySpws==True" ) build 18-Sep-2019 23:19:13 + print("test5: %s" % (overlayTimes and scanTest)) build 18-Sep-2019 23:19:13 + print("test6: %s" % (xframe == lastFrame and overlayTimes and overlayAntennas and xctr+1==len(antennasToPlot) and mytimeTest and spwctr= len(antennasToPlot)) or build 18-Sep-2019 23:19:13 + ((overlaySpws or overlayBasebands) and spwctr+1 >= len(spwsToPlot)) or build 18-Sep-2019 23:19:13 + (overlayAntennas==False and overlaySpws==False and overlayBasebands==False)): build 18-Sep-2019 23:19:13 + mytime += 1 build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("AT BOTTOM OF LOOP: Incrementing mytime to %d, setting firstUnflaggedAntennaToPlot to 0" % (mytime)) build 18-Sep-2019 23:19:13 + firstUnflaggedAntennaToPlot = 0 # try this build 18-Sep-2019 23:19:13 + doneOverlayTime = False # added on 08-nov-2012 build 18-Sep-2019 23:19:13 + if (overlayBasebands and (uniqueScanNumbers == sorted(scansToPlot))): build 18-Sep-2019 23:19:13 + if (debug): print("Breaking because scans not specified") build 18-Sep-2019 23:19:13 + break build 18-Sep-2019 23:19:13 + # end of while(mytime) loop build 18-Sep-2019 23:19:13 + if (redisplay == False): build 18-Sep-2019 23:19:13 + spwctr += 1 build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print( "---------------------------------------- Incrementing spwctr to %d, spwsToPlot=" % (spwctr), spwsToPlot) build 18-Sep-2019 23:19:13 + if (spwctr < len(spwsToPlot)): build 18-Sep-2019 23:19:13 + print("---------------------------------------- ispw = %d" % (spwsToPlot[spwctr])) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + print("---------------------------------------- done the spws in this baseband (%d)" % (baseband)) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("redisplay = True") build 18-Sep-2019 23:19:13 + # end of while(spwctr) loop build 18-Sep-2019 23:19:13 + if (debug): print("at bottom of spwctr loop, spwctr=%d, incrementing bbctr from %d to %d" % (spwctr,bbctr,bbctr+1)) build 18-Sep-2019 23:19:13 + bbctr += 1 build 18-Sep-2019 23:19:13 + # end of while(bbctr) loop build 18-Sep-2019 23:19:13 + if (debug): print("at bottom of bbctr loop") build 18-Sep-2019 23:19:13 + if (xant >= antennasToPlot[-1] and xframe != xframeStart): build 18-Sep-2019 23:19:13 + # this is the last antenna, so make a final plot build 18-Sep-2019 23:19:13 + if (len(figfile) > 0): build 18-Sep-2019 23:19:13 + plotfiles.append(makeplot(figfile,msFound,msAnt,overlayAntennas, build 18-Sep-2019 23:19:13 + pages,pagectr,density,interactive, build 18-Sep-2019 23:19:13 + antennasToPlot,spwsToPlot,overlayTimes,overlayBasebands, build 18-Sep-2019 23:19:13 + 5,xant,ispw,subplot,resample,debug, build 18-Sep-2019 23:19:13 + figfileSequential,figfileNumber)) build 18-Sep-2019 23:19:13 + figfileNumber += 1 build 18-Sep-2019 23:19:13 + if (redisplay == False): build 18-Sep-2019 23:19:13 + xctr += 1 build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("Incrementing xctr to %d" % (xctr)) build 18-Sep-2019 23:19:13 + if (overlayAntennas): build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("Breaking out of antenna loop because we are done -------------------") build 18-Sep-2019 23:19:13 + break build 18-Sep-2019 23:19:13 + # end of while(xant) loop build 18-Sep-2019 23:19:13 + if (debug): print("Finished while(xant) loop----------------") build 18-Sep-2019 23:19:13 + pb.draw() build 18-Sep-2019 23:19:13 + if (len(plotfiles) == 1 and figfileSequential): build 18-Sep-2019 23:19:13 + # rename the single file to remove ".000" build 18-Sep-2019 23:19:13 + newplotfiles = [plotfiles[0].split('.000.png')[0]+'.png'] build 18-Sep-2019 23:19:13 + print("renaming %s to %s" % (plotfiles[0],newplotfiles[0])) build 18-Sep-2019 23:19:13 + os.system('mv %s %s' % (plotfiles[0],newplotfiles[0])) build 18-Sep-2019 23:19:13 + plotfiles = newplotfiles build 18-Sep-2019 23:19:13 + if (len(plotfiles) > 0 and buildpdf): build 18-Sep-2019 23:19:13 + pdfname = figfile+'.pdf' build 18-Sep-2019 23:19:13 + filelist = '' build 18-Sep-2019 23:19:13 + plotfiles = np.unique(plotfiles) build 18-Sep-2019 23:19:13 + for i in range(len(plotfiles)): build 18-Sep-2019 23:19:13 + cmd = '%s -density %d %s %s.pdf' % (convert,density,plotfiles[i],plotfiles[i].split('.png')[0]) build 18-Sep-2019 23:19:13 + casalogPost(debug,"Running command = %s" % (cmd)) build 18-Sep-2019 23:19:13 + mystatus = os.system(cmd) build 18-Sep-2019 23:19:13 + if (mystatus != 0): build 18-Sep-2019 23:19:13 + print("ImageMagick's convert command not found, no PDF built") build 18-Sep-2019 23:19:13 + buildpdf = False build 18-Sep-2019 23:19:13 + break build 18-Sep-2019 23:19:13 + filelist += plotfiles[i].split('.png')[0] + '.pdf ' build 18-Sep-2019 23:19:13 + if (buildpdf and (len(plotfiles)>1 or not figfileSequential)): build 18-Sep-2019 23:19:13 + # The following 2 lines reduce the total number of characters on the command line, which build 18-Sep-2019 23:19:13 + # was apparently a problem at JAO for Liza. build 18-Sep-2019 23:19:13 + filelist = ' '.join(pruneFilelist(filelist.split())) build 18-Sep-2019 23:19:13 + pdfname = pruneFilelist([pdfname])[0] build 18-Sep-2019 23:19:13 + cmd = '%s %s cat output %s' % (pdftk, filelist, pdfname) build 18-Sep-2019 23:19:13 + casalogPost(debug,"Running command = %s" % (cmd)) build 18-Sep-2019 23:19:13 + mystatus = os.system(cmd) build 18-Sep-2019 23:19:13 + if (mystatus != 0): build 18-Sep-2019 23:19:13 + cmd = '%s -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=%s %s' % (gs,pdfname,filelist) build 18-Sep-2019 23:19:13 + casalogPost(debug,"Running command = %s" % (cmd)) build 18-Sep-2019 23:19:13 + mystatus = os.system(cmd) build 18-Sep-2019 23:19:13 + if (mystatus == 0): build 18-Sep-2019 23:19:13 + casalogPost(debug,"PDF left in %s" % (pdfname)) build 18-Sep-2019 23:19:13 + print("PDF left in %s" % (pdfname)) build 18-Sep-2019 23:19:13 + os.system("rm -f %s" % filelist) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + print("Both pdftk and ghostscript are missing, so no PDF built.") build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + showFinalMessage(overlayAntennas, solutionTimeSpread, nUniqueTimes) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (channeldiff>0): build 18-Sep-2019 23:19:13 + # Compute median over all antennas, or at least those completed before 'q' was hit build 18-Sep-2019 23:19:13 + madstats['median'] = dict.fromkeys(spwsToPlot) build 18-Sep-2019 23:19:13 + spwvalue = {} build 18-Sep-2019 23:19:13 + spwvalue['amp'] = [] build 18-Sep-2019 23:19:13 + spwvalue['phase'] = [] build 18-Sep-2019 23:19:13 + for j in spwsToPlot: build 18-Sep-2019 23:19:13 + madstats['median'][j] = dict.fromkeys(timerangeList) # dict.fromkeys(range(len(uniqueTimes))) build 18-Sep-2019 23:19:13 + for k in timerangeList: # range(len(uniqueTimes)): build 18-Sep-2019 23:19:13 + madstats['median'][j][k] = dict.fromkeys(range(nPolarizations)) build 18-Sep-2019 23:19:13 + for l in range(nPolarizations): build 18-Sep-2019 23:19:13 + if (yaxis == 'both'): build 18-Sep-2019 23:19:13 + madstats['median'][j][k][l] = {'amp': None, 'phase': None} build 18-Sep-2019 23:19:13 + elif (yaxis == 'phase'): build 18-Sep-2019 23:19:13 + madstats['median'][j][k][l] = {'phase': None} build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + # this includes tsys and amp build 18-Sep-2019 23:19:13 + madstats['median'][j][k][l] = {'amp': None} build 18-Sep-2019 23:19:13 + for m in madstats['median'][j][k][l].keys(): build 18-Sep-2019 23:19:13 + value = [] build 18-Sep-2019 23:19:13 + for i in madstats.keys(): # loop over antennas build 18-Sep-2019 23:19:13 + if (i != 'median' and i != 'platforming'): build 18-Sep-2019 23:19:13 + if (madstats[i][j][k][l][m] != None): build 18-Sep-2019 23:19:13 + if (debug): print("madstats[%s][%d][%d][%d][%s] = " % (i,j,k,l,m), madstats[i][j][k][l][m]) build 18-Sep-2019 23:19:13 + value.append(madstats[i][j][k][l][m]) build 18-Sep-2019 23:19:13 + spwvalue[m].append(madstats[i][j][k][l][m]) build 18-Sep-2019 23:19:13 + madstats['median'][j][k][l][m] = np.median(value) build 18-Sep-2019 23:19:13 + # now add another spw which is the median over spw,time,polarization build 18-Sep-2019 23:19:13 + if (yaxis == 'both'): build 18-Sep-2019 23:19:13 + madstats['median']['median']={'amp': np.median(spwvalue['amp']), build 18-Sep-2019 23:19:13 + 'phase': np.median(spwvalue['phase'])} build 18-Sep-2019 23:19:13 + elif (yaxis == 'phase'): build 18-Sep-2019 23:19:13 + madstats['median'][j][k][l] = {'phase': np.median(spwvalue['phase'])} build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + madstats['median']['median'] = {'amp': np.median(spwvalue['amp'])} build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + mymsmd.close() build 18-Sep-2019 23:19:13 + return(madstats) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (msFound and mymsmd != ''): build 18-Sep-2019 23:19:13 + mymsmd.close() build 18-Sep-2019 23:19:13 + return() build 18-Sep-2019 23:19:13 + # end of plotbandpass build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def GetFieldIdsForFieldName(token, mymsmd, msFields): build 18-Sep-2019 23:19:13 + if (mymsmd != '' and mymsmd != None): build 18-Sep-2019 23:19:13 + return(mymsmd.fieldsforname(token)[0]) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + return(list(msFields).index(token)) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def GetFieldNamesForFieldId(u, mymsmd, msFields): build 18-Sep-2019 23:19:13 + if (mymsmd != '' and mymsmd != None): build 18-Sep-2019 23:19:13 + return(mymsmd.namesforfields(u)[0]) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + print("B") build 18-Sep-2019 23:19:13 + return(msFields[u]) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def getTelescopeNameFromCaltable(caltable): build 18-Sep-2019 23:19:13 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:13 + mytb.open(caltable) build 18-Sep-2019 23:19:13 + if ('OBSERVATION' in mytb.getkeywords()): build 18-Sep-2019 23:19:13 + observationTable = mytb.getkeyword('OBSERVATION').split()[1] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + observationTable = None build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + if (observationTable == None): build 18-Sep-2019 23:19:13 + return('') build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + return(getTelescopeNameFromCaltableObservationTable(observationTable)) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def getTelescopeNameFromCaltableObservationTable(observationTable): build 18-Sep-2019 23:19:13 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:13 + mytb.open(observationTable) build 18-Sep-2019 23:19:13 + telescope = mytb.getcell('TELESCOPE_NAME') build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + return(telescope) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def getCorrTypeByAntennaName(firstAntenna): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + This function is used only if the OBSERVATION table of the caltable is blank and the MS is unavailable. build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + print("Using antenna name (%s) to set the polarization type." % (firstAntenna)) build 18-Sep-2019 23:19:13 + if (firstAntenna.find('ea') >= 0): build 18-Sep-2019 23:19:13 + corr_type_string = ['RR','LL'] build 18-Sep-2019 23:19:13 + corr_type = [5,8] build 18-Sep-2019 23:19:13 + elif (firstAntenna.find('dv') >= 0 or firstAntenna.find('da') >= 0 or build 18-Sep-2019 23:19:13 + firstAntenna.find('pm') >= 0 or firstAntenna.find('da') >= 0): build 18-Sep-2019 23:19:13 + corr_type_string = ['XX','YY'] build 18-Sep-2019 23:19:13 + corr_type = [9,12] build 18-Sep-2019 23:19:13 + else: # SMA build 18-Sep-2019 23:19:13 + corr_type_string = ['XX'] build 18-Sep-2019 23:19:13 + corr_type = [9] build 18-Sep-2019 23:19:13 + return(corr_type, corr_type_string, len(corr_type)) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def MAD(a, c=0.6745, axis=0): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Median Absolute Deviation along given axis of an array: build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + median(abs(a - median(a))) / c build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + c = 0.6745 is the constant to convert from MAD to std; it is used by build 18-Sep-2019 23:19:13 + default build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + a = np.array(a) build 18-Sep-2019 23:19:13 + good = (a==a) build 18-Sep-2019 23:19:13 + a = np.asarray(a, np.float64) build 18-Sep-2019 23:19:13 + if a.ndim == 1: build 18-Sep-2019 23:19:13 + d = np.median(a[good]) build 18-Sep-2019 23:19:13 + m = np.median(np.fabs(a[good] - d) / c) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + d = np.median(a[good], axis=axis) build 18-Sep-2019 23:19:13 + # I don't want the array to change so I have to copy it? build 18-Sep-2019 23:19:13 + if axis > 0: build 18-Sep-2019 23:19:13 + aswp = swapaxes(a[good],0,axis) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + aswp = a[good] build 18-Sep-2019 23:19:13 + m = np.median(np.fabs(aswp - d) / c, axis=0) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + return m build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def showFinalMessage(overlayAntennas, solutionTimeSpread, nUniqueTimes): build 18-Sep-2019 23:19:13 + if (overlayAntennas and solutionTimeSpread > 0 and nUniqueTimes==1): build 18-Sep-2019 23:19:13 + print("If not all spws were shown, then try setting solutionTimeThreshold=%.0f seconds" % (solutionTimeSpread+1)) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def computeOriginalSpwsToPlot(spwsToPlot, originalSpws, tableFormat, debug): build 18-Sep-2019 23:19:13 + if (tableFormat > 33): build 18-Sep-2019 23:19:13 + # New caltables use the same numbering as the original ms build 18-Sep-2019 23:19:13 + return(spwsToPlot) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + originalSpwsToPlot = [] build 18-Sep-2019 23:19:13 + for spw in spwsToPlot: build 18-Sep-2019 23:19:13 + originalSpwsToPlot.append(originalSpws[spw]) build 18-Sep-2019 23:19:13 + return(list(originalSpwsToPlot)) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def computeScansForUniqueTimes(uniqueTimes, cal_scans, times, unique_cal_scans, build 18-Sep-2019 23:19:13 + debug=False): build 18-Sep-2019 23:19:13 + scansForUniqueTimes = [] build 18-Sep-2019 23:19:13 + nUniqueTimes = len(uniqueTimes) build 18-Sep-2019 23:19:13 + for uT in uniqueTimes: build 18-Sep-2019 23:19:13 + if (debug): print("Checking uniqueTime = %s" % (str(uT))) build 18-Sep-2019 23:19:13 + scansForUniqueTimes.append(cal_scans[list(times).index(uT)]) build 18-Sep-2019 23:19:13 + if (len(unique_cal_scans) == 1): build 18-Sep-2019 23:19:13 + if (unique_cal_scans[0] != -1): build 18-Sep-2019 23:19:13 + if (len(scansForUniqueTimes) != len(np.unique(scansForUniqueTimes))): build 18-Sep-2019 23:19:13 + if debug: build 18-Sep-2019 23:19:13 + print("Because there are multiple timestamps per scan, I will not assume there is a one-to-one match.") build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + nUniqueTimes = len(np.unique(scansForUniqueTimes)) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + # This 3.4 table does not have the scan numbers populated build 18-Sep-2019 23:19:13 + scansForUniqueTimes = [] build 18-Sep-2019 23:19:13 + if debug: build 18-Sep-2019 23:19:13 + print("Because the scan numbers are either not filled in this table, or the solutions span multiple scans, I will use timestamps instead.") build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (len(scansForUniqueTimes) != len(np.unique(scansForUniqueTimes))): build 18-Sep-2019 23:19:13 + if debug: build 18-Sep-2019 23:19:13 + print("Because there are multiple timestamps per scan, I will not assume there is a one-to-one match.") build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + nUniqueTimes = len(np.unique(scansForUniqueTimes)) build 18-Sep-2019 23:19:13 + return(scansForUniqueTimes, nUniqueTimes) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def calcChebyshev(coeff, validDomain, x): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Given a set of coefficients, build 18-Sep-2019 23:19:13 + this method evaluates a Chebyshev approximation. build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + if (type(x) == float or type(x) == int): build 18-Sep-2019 23:19:13 + x = [x] build 18-Sep-2019 23:19:13 + myxrange = validDomain[1] - validDomain[0] build 18-Sep-2019 23:19:13 + x = -1 + 2*(x-validDomain[0])/myxrange build 18-Sep-2019 23:19:13 + coeff[0] = 0 build 18-Sep-2019 23:19:13 + if (True): build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + # python 2.7 build 18-Sep-2019 23:19:13 + v = np.polynomial.chebyshev.chebval(x,coeff) build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + # python 2.6 build 18-Sep-2019 23:19:13 + v = np.polynomial.chebval(x,coeff) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + # manual approach, before I found chebval() build 18-Sep-2019 23:19:13 + v = np.zeros(len(x)) build 18-Sep-2019 23:19:13 + if (len(coeff) > 0): build 18-Sep-2019 23:19:13 + v += coeff[0] * 1 build 18-Sep-2019 23:19:13 + if (len(coeff) > 1): build 18-Sep-2019 23:19:13 + v += coeff[1] * (x) build 18-Sep-2019 23:19:13 + if (len(coeff) > 2): build 18-Sep-2019 23:19:13 + v += coeff[2] * (2*x**2 - 1) build 18-Sep-2019 23:19:13 + if (len(coeff) > 3): build 18-Sep-2019 23:19:13 + v += coeff[3] * (4*x**3 - 3*x) build 18-Sep-2019 23:19:13 + if (len(coeff) > 4): build 18-Sep-2019 23:19:13 + v += coeff[4] * (8*x**4 - 8*x**2 + 1) build 18-Sep-2019 23:19:13 + if (len(coeff) > 5): build 18-Sep-2019 23:19:13 + v += coeff[5] * (16*x**5 - 20*x**3 + 5*x) build 18-Sep-2019 23:19:13 + if (len(coeff) > 6): build 18-Sep-2019 23:19:13 + v += coeff[6] * (32*x**6 - 48*x**4 + 18*x**2 - 1) build 18-Sep-2019 23:19:13 + if (len(coeff) > 7): build 18-Sep-2019 23:19:13 + v += coeff[7] * (64*x**7 -112*x**5 + 56*x**3 - 7*x) build 18-Sep-2019 23:19:13 + if (len(coeff) > 8): build 18-Sep-2019 23:19:13 + v += coeff[8] * (128*x**8 -256*x**6 +160*x**5 - 32*x**2 + 1) build 18-Sep-2019 23:19:13 + if (len(coeff) > 9): build 18-Sep-2019 23:19:13 + v += coeff[9] * (256*x**9 -576*x**7 +432*x**5 - 120*x**3 + 9*x) build 18-Sep-2019 23:19:13 + if (len(coeff) > 10): build 18-Sep-2019 23:19:13 + print("Chebyshev polynomials with degree > 10 are not implemented") build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + return(v) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def ResizeFonts(adesc,fontsize): build 18-Sep-2019 23:19:13 +# print("Called ResizeFonts()") build 18-Sep-2019 23:19:13 + yFormat = ScalarFormatter(useOffset=False) build 18-Sep-2019 23:19:13 + adesc.yaxis.set_major_formatter(yFormat) build 18-Sep-2019 23:19:13 + adesc.xaxis.set_major_formatter(yFormat) build 18-Sep-2019 23:19:13 + pb.setp(adesc.get_xticklabels(), fontsize=fontsize) build 18-Sep-2019 23:19:13 + pb.setp(adesc.get_yticklabels(), fontsize=fontsize) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def complexMeanRad(phases): build 18-Sep-2019 23:19:13 + # convert back to real and imaginary, take mean, then convert back to phase build 18-Sep-2019 23:19:13 + meanSin = np.mean(np.sin(phases)) build 18-Sep-2019 23:19:13 + meanCos = np.mean(np.cos(phases)) build 18-Sep-2019 23:19:13 + return(180*np.arctan2(meanSin, meanCos)/math.pi) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def complexMeanDeg(phases): build 18-Sep-2019 23:19:13 + # convert back to real and imaginary, take mean, then convert back to phase build 18-Sep-2019 23:19:13 + phases *= math.pi/180 build 18-Sep-2019 23:19:13 + meanSin = np.mean(np.sin(phases)) build 18-Sep-2019 23:19:13 + meanCos = np.mean(np.cos(phases)) build 18-Sep-2019 23:19:13 + return(180*np.arctan2(meanSin, meanCos)/math.pi) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def CalcAtmTransmission(chans,freqs,xaxis,pwv,vm, mymsmd,vis,asdm,antenna,timestamp, build 18-Sep-2019 23:19:13 + interval,field,refFreqInTable, net_sideband=0, build 18-Sep-2019 23:19:13 + mytime=0, missingCalWVRErrorPrinted=False, caltable='', build 18-Sep-2019 23:19:13 + verbose=False): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + chans: all channels, regardless of whether they are flagged build 18-Sep-2019 23:19:13 + freqs: frequencies corresponding to chans build 18-Sep-2019 23:19:13 + xaxis: what we are plotting on the xaxis: 'chan' or 'freq' build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 +# print("CalcAtm, field = ", field) build 18-Sep-2019 23:19:13 +# print("interval = ", interval) build 18-Sep-2019 23:19:13 +# print("refFreqInTable = ", refFreqInTable) build 18-Sep-2019 23:19:13 + if (type(mymsmd) == str): build 18-Sep-2019 23:19:13 + telescopeName = getTelescopeNameFromCaltable(caltable) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + telescopeName = mymsmd.observatorynames()[0] build 18-Sep-2019 23:19:13 + if (telescopeName.find('ALMA') >= 0): build 18-Sep-2019 23:19:13 + defaultPWV = 1.0 # a reasonable value for ALMA in case it cannot be found build 18-Sep-2019 23:19:13 + elif (telescopeName.find('VLA') >= 0): build 18-Sep-2019 23:19:13 + defaultPWV = 5.0 build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + defaultPWV = 5.0 build 18-Sep-2019 23:19:13 + if (type(pwv) == str): build 18-Sep-2019 23:19:13 + if (pwv.find('auto')>=0): build 18-Sep-2019 23:19:13 + if (os.path.exists(vis+'/ASDM_CALWVR') or os.path.exists(vis+'/ASDM_CALATMOSPHERE') or build 18-Sep-2019 23:19:13 + os.path.exists('CalWVR.xml')): build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("*** Computing atmospheric transmission using measured PWV, field %d, time %d (%f). ***" % (field,mytime,timestamp)) build 18-Sep-2019 23:19:13 + timerange = [timestamp-interval/2, timestamp+interval/2] build 18-Sep-2019 23:19:13 + if (os.path.exists(vis+'/ASDM_CALWVR') or os.path.exists(vis+'/ASDM_CALATMOSPHERE')): build 18-Sep-2019 23:19:13 + [pwvmean, pwvstd] = getMedianPWV(vis,timerange,asdm,verbose=False) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + [pwvmean, pwvstd] = getMedianPWV('.',timerange,asdm='',verbose=False) build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("retrieved pwvmean = %f" % pwvmean) build 18-Sep-2019 23:19:13 + retrievedPWV = pwvmean build 18-Sep-2019 23:19:13 + if (pwvmean < 0.00001): build 18-Sep-2019 23:19:13 + pwvmean = defaultPWV build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pwvmean = defaultPWV build 18-Sep-2019 23:19:13 + if (missingCalWVRErrorPrinted == False): build 18-Sep-2019 23:19:13 + missingCalWVRErrorPrinted = True build 18-Sep-2019 23:19:13 + if (telescopeName.find('ALMA')>=0): build 18-Sep-2019 23:19:13 + print("No ASDM_CALWVR, ASDM_CALATMOSPHERE, or CalWVR.xml table found. Using PWV %.1fmm." % pwvmean) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + print("This telescope has no WVR to provide a PWV measurement. Using PWV %.1fmm." % pwvmean) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + pwvmean = float(pwv) build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + pwvmean = defaultPWV build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + pwvmean = float(pwv) build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + pwvmean = defaultPWV build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Using PWV = %.2f mm" % pwvmean) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # default values in case we can't find them below build 18-Sep-2019 23:19:13 + airmass = 1.5 build 18-Sep-2019 23:19:13 + P = 563.0 build 18-Sep-2019 23:19:13 + H = 20.0 build 18-Sep-2019 23:19:13 + T = 273.0 build 18-Sep-2019 23:19:13 + roundedScanTimes = [] build 18-Sep-2019 23:19:13 + if (type(mymsmd) != str): build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Looking for scans for field integer = %d" % (field)) build 18-Sep-2019 23:19:13 + scans = mymsmd.scansforfield(field) build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("For field %s, Got scans = " % str(field),scans) build 18-Sep-2019 23:19:13 + for myscan in scans: build 18-Sep-2019 23:19:13 + roundedScanTimes.append(np.unique(np.round(mymsmd.timesforscan(myscan)))) build 18-Sep-2019 23:19:13 +# This method was much slower and not necessary. Removed for CAS-8065 build 18-Sep-2019 23:19:13 +# scantimes = mymsmd.timesforscans(scans) # is often longer than the scans array build 18-Sep-2019 23:19:13 +# roundedScanTimes = np.unique(np.round(scantimes,0)) build 18-Sep-2019 23:19:13 +# scans, roundedScanTimes = getScansForTimes(mymsmd,roundedScanTimes) # be sure that each scantime has a scan associated, round to nearest second to save time (esp. for single dish data) build 18-Sep-2019 23:19:13 +# if (verbose): print("scantimes = %s" % (str(scantimes))) build 18-Sep-2019 23:19:13 +# if (verbose): print("scans = %s" % (str(scans))) build 18-Sep-2019 23:19:13 + mindiff = 1e20 build 18-Sep-2019 23:19:13 + bestscan = 1 build 18-Sep-2019 23:19:13 + for i in range(len(roundedScanTimes)): build 18-Sep-2019 23:19:13 + stime = roundedScanTimes[i] build 18-Sep-2019 23:19:13 + meantime = np.mean(stime) build 18-Sep-2019 23:19:13 + tdiff = np.abs(meantime-timestamp) build 18-Sep-2019 23:19:13 + # if (verbose): print("tdiff = %s" % (str(tdiff))) build 18-Sep-2019 23:19:13 + if (tdiff < mindiff): build 18-Sep-2019 23:19:13 + bestscan = scans[i] build 18-Sep-2019 23:19:13 + if (verbose): print("bestscan = %s" % (str(bestscan))) build 18-Sep-2019 23:19:13 + mindiff = tdiff build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("For timestamp=%.1f, got closest scan = %d, %.0f sec away" %(timestamp, bestscan,mindiff)) build 18-Sep-2019 23:19:13 + if (verbose): print("Calling getWeather()") build 18-Sep-2019 23:19:13 + [conditions,myTimes] = getWeather(vis,bestscan,antenna,verbose,mymsmd) build 18-Sep-2019 23:19:13 + if (verbose): print("Done getWeather()") build 18-Sep-2019 23:19:13 + P = conditions['pressure'] build 18-Sep-2019 23:19:13 + H = conditions['humidity'] build 18-Sep-2019 23:19:13 + T = conditions['temperature']+273.15 build 18-Sep-2019 23:19:13 + if (P <= 0.0): build 18-Sep-2019 23:19:13 + P = 563 build 18-Sep-2019 23:19:13 + if (H <= 0.0): build 18-Sep-2019 23:19:13 + H = 20 build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + conditions = {} build 18-Sep-2019 23:19:13 + if (type(mymsmd) != str): build 18-Sep-2019 23:19:13 + if ('elevation' not in conditions.keys()): build 18-Sep-2019 23:19:13 + # Someone cleared the POINTING table, so calculate elevation from Ra/Dec/MJD build 18-Sep-2019 23:19:13 +# myfieldId = mymsmd.fieldsforname(mymsmd.fieldsforscan(bestscan)) build 18-Sep-2019 23:19:13 + myfieldId = mymsmd.fieldsforscan(bestscan)[0] build 18-Sep-2019 23:19:13 + myscantime = np.mean(mymsmd.timesforscan(bestscan)) build 18-Sep-2019 23:19:13 + mydirection = getRADecForField(vis, myfieldId, verbose) build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("myfieldId = %s" % (str(myfieldId))) build 18-Sep-2019 23:19:13 + print("mydirection = %s" % (str(mydirection))) build 18-Sep-2019 23:19:13 + print("Scan = %d, time = %.1f, Field = %d, direction = %s" % (bestscan, myscantime, myfieldId, str(mydirection))) build 18-Sep-2019 23:19:13 + telescopeName = mymsmd.observatorynames()[0] build 18-Sep-2019 23:19:13 + if (len(telescopeName) < 1): build 18-Sep-2019 23:19:13 + telescopeName = 'ALMA' build 18-Sep-2019 23:19:13 + print("telescope = %s" % (telescopeName)) build 18-Sep-2019 23:19:13 + myazel = computeAzElFromRADecMJD(mydirection, myscantime/86400., telescopeName) build 18-Sep-2019 23:19:13 + conditions['elevation'] = myazel[1] * 180/math.pi build 18-Sep-2019 23:19:13 + conditions['azimuth'] = myazel[0] * 180/math.pi build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Computed elevation = %.1f deg" % (conditions['elevation'])) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + conditions['elevation'] = 90 build 18-Sep-2019 23:19:13 + bestscan = -1 build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("CalcAtm: found elevation=%f (airmass=%.3f) for scan: %s" % (conditions['elevation'],1/np.sin(conditions['elevation']*np.pi/180.), str(bestscan))) build 18-Sep-2019 23:19:13 + print("P,H,T = %f,%f,%f" % (P,H,T)) build 18-Sep-2019 23:19:13 + if (conditions['elevation'] <= 3): build 18-Sep-2019 23:19:13 + print("Using 45 deg elevation instead") build 18-Sep-2019 23:19:13 + airmass = 1.0/math.cos(45*math.pi/180.) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + airmass = 1.0/math.cos((90-conditions['elevation'])*math.pi/180.) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + tropical = 1 build 18-Sep-2019 23:19:13 + midLatitudeSummer = 2 build 18-Sep-2019 23:19:13 + midLatitudeWinter = 3 build 18-Sep-2019 23:19:13 + numchan = len(freqs) build 18-Sep-2019 23:19:13 + # Set the reference freq to be the middle of the middle two channels build 18-Sep-2019 23:19:13 + reffreq=0.5*(freqs[numchan/2-1]+freqs[numchan/2]) build 18-Sep-2019 23:19:13 + originalnumchan = numchan build 18-Sep-2019 23:19:13 + while (numchan > MAX_ATM_CALC_CHANNELS): build 18-Sep-2019 23:19:13 + numchan /= 2 build 18-Sep-2019 23:19:13 +# print("Reducing numchan to ", numchan) build 18-Sep-2019 23:19:13 + chans = range(0,originalnumchan,(originalnumchan/numchan)) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + chansep = (freqs[-1]-freqs[0])/(numchan-1) build 18-Sep-2019 23:19:13 + nbands = 1 build 18-Sep-2019 23:19:13 + if (verbose): print("Opening casac.atmosphere()") build 18-Sep-2019 23:19:13 + myat = createCasaTool(attool) build 18-Sep-2019 23:19:13 + if (verbose): print("Opened") build 18-Sep-2019 23:19:13 + if (type(casac.Quantity) == type): # casa 3.x build 18-Sep-2019 23:19:13 + fCenter = casac.Quantity(reffreq,'GHz') build 18-Sep-2019 23:19:13 + fResolution = casac.Quantity(chansep,'GHz') build 18-Sep-2019 23:19:13 + fWidth = casac.Quantity(numchan*chansep,'GHz') build 18-Sep-2019 23:19:13 + myat.initAtmProfile(humidity=H,temperature=casac.Quantity(T,"K"),altitude=casac.Quantity(5059,"m"),pressure=casac.Quantity(P,'mbar'),atmType=midLatitudeWinter) build 18-Sep-2019 23:19:13 + myat.initSpectralWindow(nbands,fCenter,fWidth,fResolution) build 18-Sep-2019 23:19:13 + myat.setUserWH2O(casac.Quantity(pwvmean,'mm')) build 18-Sep-2019 23:19:13 + else: # casa 4.0 build 18-Sep-2019 23:19:13 + myqa = qatool() build 18-Sep-2019 23:19:13 + fCenter = myqa.quantity(reffreq,'GHz') build 18-Sep-2019 23:19:13 + fResolution = myqa.quantity(chansep,'GHz') build 18-Sep-2019 23:19:13 + fWidth = myqa.quantity(numchan*chansep,'GHz') build 18-Sep-2019 23:19:13 + myat.initAtmProfile(humidity=H,temperature=myqa.quantity(T,"K"),altitude=myqa.quantity(5059,"m"),pressure=myqa.quantity(P,'mbar'),atmType=midLatitudeWinter) build 18-Sep-2019 23:19:13 + myat.initSpectralWindow(nbands,fCenter,fWidth,fResolution) build 18-Sep-2019 23:19:13 + myat.setUserWH2O(myqa.quantity(pwvmean,'mm')) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +# myat.setAirMass() # This does not affect the opacity, but it does effect TebbSky, so do it manually. build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + n = myat.getNumChan() build 18-Sep-2019 23:19:13 + if (verbose): print("numchan = %s" % (str(n))) build 18-Sep-2019 23:19:13 + if cu.compare_version('<',[4,0,0]): build 18-Sep-2019 23:19:13 + dry = np.array(myat.getDryOpacitySpec(0)['dryOpacity']) build 18-Sep-2019 23:19:13 + wet = np.array(myat.getWetOpacitySpec(0)['wetOpacity'].value) build 18-Sep-2019 23:19:13 + TebbSky = [] build 18-Sep-2019 23:19:13 + for chan in range(n): # do NOT use numchan here, use n build 18-Sep-2019 23:19:13 + TebbSky.append(myat.getTebbSky(nc=chan, spwid=0).value) build 18-Sep-2019 23:19:13 + TebbSky = np.array(TebbSky) build 18-Sep-2019 23:19:13 + # readback the values to be sure they got set build 18-Sep-2019 23:19:13 + #rf = myat.getRefFreq().value build 18-Sep-2019 23:19:13 + #cs = myat.getChanSep().value build 18-Sep-2019 23:19:13 + else: # casa >=4.0 build 18-Sep-2019 23:19:13 + dry = np.array(myat.getDryOpacitySpec(0)[1]) build 18-Sep-2019 23:19:13 + wet = np.array(myat.getWetOpacitySpec(0)[1]['value']) build 18-Sep-2019 23:19:13 + TebbSky = myat.getTebbSkySpec(spwid=0)[1]['value'] build 18-Sep-2019 23:19:13 + # readback the values to be sure they got set build 18-Sep-2019 23:19:13 + #rf = myqa.convert(myat.getRefFreq(),'GHz')['value'] build 18-Sep-2019 23:19:13 + #cs = myqa.convert(myat.getChanSep(),'GHz')['value'] build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + transmission = np.exp(-airmass*(wet+dry)) build 18-Sep-2019 23:19:13 + TebbSky *= (1-np.exp(-airmass*(wet+dry)))/(1-np.exp(-wet-dry)) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (refFreqInTable*1e-9>np.mean(freqs)): build 18-Sep-2019 23:19:13 + if ((net_sideband % 2) == 0): build 18-Sep-2019 23:19:13 + sense = 1 build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + sense = 2 build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if ((net_sideband % 2) == 0): build 18-Sep-2019 23:19:13 + sense = 2 build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + sense = 1 build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (sense == 1): build 18-Sep-2019 23:19:13 + # The following looks right for LSB sense=1 build 18-Sep-2019 23:19:13 + if (xaxis.find('chan')>=0): build 18-Sep-2019 23:19:13 + trans = np.zeros(len(transmission)) build 18-Sep-2019 23:19:13 + Tebb = np.zeros(len(TebbSky)) build 18-Sep-2019 23:19:13 + for i in range(len(transmission)): build 18-Sep-2019 23:19:13 + trans[i] = transmission[len(transmission)-1-i] build 18-Sep-2019 23:19:13 + Tebb[i] = TebbSky[len(TebbSky)-1-i] build 18-Sep-2019 23:19:13 + transmission = trans build 18-Sep-2019 23:19:13 + TebbSky = Tebb build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # Be sure that number of frequencies matched number of transmission values - CAS-10123 build 18-Sep-2019 23:19:13 + numchan = len(transmission) build 18-Sep-2019 23:19:13 + chans = range(len(transmission)) build 18-Sep-2019 23:19:13 + # Note that getChanFreq returns units of GHz, but use convert to be sure. build 18-Sep-2019 23:19:13 + startFreq = myqa.convert(myat.getChanFreq(0),'GHz')['value'] build 18-Sep-2019 23:19:13 + endFreq = myqa.convert(myat.getChanFreq(numchan-1),'GHz')['value'] build 18-Sep-2019 23:19:13 + # print("startFreq=%f endFreq=%f " % (startFreq, endFreq)) build 18-Sep-2019 23:19:13 + freq = np.linspace(startFreq, endFreq, numchan) build 18-Sep-2019 23:19:13 +# old method that fails on spws with an even number of channels, i.e. when the integer refchan build 18-Sep-2019 23:19:13 +# is half a channel from the center of the span build 18-Sep-2019 23:19:13 +# if sense == 2: build 18-Sep-2019 23:19:13 +# freq = np.linspace(rf-((numchan-1)/2.)*chansepGHz, rf+((numchan-1)/2.)*chansepGHz, numchan) build 18-Sep-2019 23:19:13 +# else: build 18-Sep-2019 23:19:13 +# freq = np.linspace(rf+((numchan-1)/2.)*chansepGHz, build 18-Sep-2019 23:19:13 +# rf-((numchan-1)/2.)*chansepGHz, numchan) build 18-Sep-2019 23:19:13 + # Therewas a 1-channel offset in CASA 5.0.x (CAS-10228), but it was fixed. build 18-Sep-2019 23:19:13 +# if (cu.compare_version('<',[5,1,0])): build 18-Sep-2019 23:19:13 +# freq += chansepGHz build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (verbose): print("Done CalcAtmTransmission") build 18-Sep-2019 23:19:13 + return(freq, chans, transmission, pwvmean, airmass, TebbSky, missingCalWVRErrorPrinted) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def RescaleTrans(trans, lim, subplotRows, lo1='', xframe=0): build 18-Sep-2019 23:19:13 + # Input: the array of transmission or TebbSky values and current limits build 18-Sep-2019 23:19:13 + # Returns: arrays of the rescaled transmission values and the zero point build 18-Sep-2019 23:19:13 + # values in units of the frame, and in amplitude. build 18-Sep-2019 23:19:13 + debug = False build 18-Sep-2019 23:19:13 + yrange = lim[1]-lim[0] build 18-Sep-2019 23:19:13 + if (lo1 == ''): build 18-Sep-2019 23:19:13 + labelgap = 0.6 # Use this fraction of the margin for the PWV ATM label build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + labelgap = 0.5 # Use this fraction of the margin to separate the top build 18-Sep-2019 23:19:13 + # curve from the upper y-axis build 18-Sep-2019 23:19:13 + y2 = lim[1] - labelgap*yrange*TOP_MARGIN/(1.0+TOP_MARGIN) build 18-Sep-2019 23:19:13 + y1 = lim[1] - yrange*TOP_MARGIN/(1.0+TOP_MARGIN) build 18-Sep-2019 23:19:13 + transmissionRange = np.max(trans)-np.min(trans) build 18-Sep-2019 23:19:13 + if (transmissionRange < 0.05): build 18-Sep-2019 23:19:13 + # force there to be a minimum range of transmission display build 18-Sep-2019 23:19:13 + # overemphasize tiny ozone lines build 18-Sep-2019 23:19:13 + transmissionRange = 0.05 build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (transmissionRange > 1 and transmissionRange < 10): build 18-Sep-2019 23:19:13 + # force there to be a minimum range of Tebbsky (10K) to display build 18-Sep-2019 23:19:13 + transmissionRange = 10 build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # convert transmission to amplitude build 18-Sep-2019 23:19:13 + newtrans = y2 - (y2-y1)*(np.max(trans)-trans)/transmissionRange build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # Use edge values build 18-Sep-2019 23:19:13 + edgeValueTransmission = trans[-1] build 18-Sep-2019 23:19:13 + otherEdgeValueTransmission = trans[0] build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # Now convert the edge channels' transmission values into amplitude build 18-Sep-2019 23:19:13 + edgeValueAmplitude = y2 - (y2-y1)*(np.max(trans)-trans[-1])/transmissionRange build 18-Sep-2019 23:19:13 + otherEdgeValueAmplitude = y2 - (y2-y1)*(np.max(trans)-trans[0])/transmissionRange build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # Now convert amplitude to frame units, offsetting downward by half build 18-Sep-2019 23:19:13 + # the font size build 18-Sep-2019 23:19:13 + fontoffset = 0.01*subplotRows build 18-Sep-2019 23:19:13 + edgeValueFrame = (edgeValueAmplitude - lim[0])/yrange - fontoffset build 18-Sep-2019 23:19:13 + otherEdgeValueFrame = (otherEdgeValueAmplitude - lim[0])/yrange - fontoffset build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # scaleFactor is how large the plot is from the bottom x-axis build 18-Sep-2019 23:19:13 + # up to the labelgap, in units of the transmissionRange build 18-Sep-2019 23:19:13 + scaleFactor = (1+TOP_MARGIN*(1-labelgap)) / (TOP_MARGIN*(1-labelgap)) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # compute the transmission at the bottom of the plot, and label it build 18-Sep-2019 23:19:13 + y0transmission = np.max(trans) - transmissionRange*scaleFactor build 18-Sep-2019 23:19:13 + y0transmissionFrame = 0 build 18-Sep-2019 23:19:13 + y0transmissionAmplitude = lim[0] build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (y0transmission <= 0): build 18-Sep-2019 23:19:13 + # If the bottom of the plot is below zero transmission, then label build 18-Sep-2019 23:19:13 + # the location of zero transmission instead. build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("--------- y0transmission original = %f, (y1,y2)=(%f,%f)" % (y0transmission,y1,y2)) build 18-Sep-2019 23:19:13 + y0transmissionAmplitude = y1-(y2-y1)*(np.min(trans)/transmissionRange) build 18-Sep-2019 23:19:13 + y0transmissionFrame = (y0transmissionAmplitude-lim[0]) / (lim[1]-lim[0]) build 18-Sep-2019 23:19:13 + y0transmission = 0 build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("-------- xframe=%d, scaleFactor = %s" % (xframe, str(scaleFactor))) build 18-Sep-2019 23:19:13 + print("edgeValueFrame, other = %s, %s" % (str(edgeValueFrame), str(otherEdgeValueFrame))) build 18-Sep-2019 23:19:13 + print("edgeValueTransmission, other = %s, %s" % (str(edgeValueTransmission), str(otherEdgeValueTransmission))) build 18-Sep-2019 23:19:13 + print("edgeValueAmplitude, otherEdgeValueAmplitude = %s, %s" % (str(edgeValueAmplitude), str(otherEdgeValueAmplitude))) build 18-Sep-2019 23:19:13 + print("y0transmission = %f, y0transmissionFrame = %f" % (y0transmission,y0transmissionFrame)) build 18-Sep-2019 23:19:13 + print("y0transmissionAmplitude = %s" % (str(y0transmissionAmplitude))) build 18-Sep-2019 23:19:13 + print("transmissionRange = %s" % (str(transmissionRange))) build 18-Sep-2019 23:19:13 + return(newtrans, edgeValueFrame, y0transmission, y0transmissionFrame, build 18-Sep-2019 23:19:13 + otherEdgeValueFrame, edgeValueTransmission, build 18-Sep-2019 23:19:13 + otherEdgeValueTransmission, edgeValueAmplitude, build 18-Sep-2019 23:19:13 + otherEdgeValueAmplitude, y0transmissionAmplitude) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def RescaleX(chans, lim, plotrange, channels): build 18-Sep-2019 23:19:13 + # This function is now only used by DrawAtmosphere when xaxis='chan'. build 18-Sep-2019 23:19:13 + # It is only really necessary when len(chans)>MAX_ATM_CALC_CHANNELS. build 18-Sep-2019 23:19:13 + # - September 2012 build 18-Sep-2019 23:19:13 + # If the user specified a plotrange, then rescale to this range, build 18-Sep-2019 23:19:13 + # otherwise rescale to the automatically-determined range. build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # chans = 0..N where N=number of channels in the ATM_CALC build 18-Sep-2019 23:19:13 + # channels = 0..X where X=number of channels in the spw, regardless of flagging build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (len(chans) != len(channels)): build 18-Sep-2019 23:19:13 + if (chans[1] > chans[0]): build 18-Sep-2019 23:19:13 + atmchanrange = chans[-1]-chans[0] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + atmchanrange = chans[0]-chans[-1] build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (channels[1] > channels[0]): build 18-Sep-2019 23:19:13 + chanrange = channels[-1]-channels[0] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + chanrange = channels[0]-channels[-1] build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + newchans = np.array(chans)*chanrange/atmchanrange build 18-Sep-2019 23:19:13 + return(newchans) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + return(chans) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def recalcYlimitsFreq(chanrange, ylimits, amp, sideband,plotrange,xchannels, build 18-Sep-2019 23:19:13 + debug=False,location=0,chanrangePercent=None): build 18-Sep-2019 23:19:13 + # Used by plots with xaxis='freq' build 18-Sep-2019 23:19:13 + # xchannels are the actual channel numbers of unflagged data, i.e. displayed points build 18-Sep-2019 23:19:13 + # amp is actual data plotted build 18-Sep-2019 23:19:13 + ylim_debug = False build 18-Sep-2019 23:19:13 + if (len(amp) < 1): build 18-Sep-2019 23:19:13 + return(pb.ylim()) # ylimits) build 18-Sep-2019 23:19:13 + if (chanrange[0]==0 and chanrange[1] == 0 and plotrange[2] == 0 and plotrange[3]==0 build 18-Sep-2019 23:19:13 + and chanrangePercent == None): build 18-Sep-2019 23:19:13 + if (len(amp) == 1): build 18-Sep-2019 23:19:13 + if (ylim_debug): build 18-Sep-2019 23:19:13 + print("amp = %s" % (str(amp))) build 18-Sep-2019 23:19:13 + ylimits = [amp[0]-0.2, amp[0]+0.2] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + newmin = np.min(amp) build 18-Sep-2019 23:19:13 + newmax = np.max(amp) build 18-Sep-2019 23:19:13 + newmin = np.min([ylimits[0],newmin]) build 18-Sep-2019 23:19:13 + newmax = np.max([ylimits[1],newmax]) build 18-Sep-2019 23:19:13 + ylimits = [newmin, newmax] build 18-Sep-2019 23:19:13 + elif ((abs(chanrange[0]) > 0 or abs(chanrange[1]) > 0)): build 18-Sep-2019 23:19:13 + plottedChannels = np.intersect1d(xchannels, range(chanrange[0],chanrange[1]+1)) build 18-Sep-2019 23:19:13 + if (len(plottedChannels) < 1): build 18-Sep-2019 23:19:13 + return(ylimits) build 18-Sep-2019 23:19:13 + mylist = np.arange(xchannels.index(plottedChannels[0]), 1+xchannels.index(plottedChannels[-1])) build 18-Sep-2019 23:19:13 + if (mylist[-1] >= len(amp)): build 18-Sep-2019 23:19:13 + # prevent crash if many channels are flagged build 18-Sep-2019 23:19:13 + return(ylimits) build 18-Sep-2019 23:19:13 + if (ylim_debug): build 18-Sep-2019 23:19:13 + print("Starting with limits = %s" % (str(ylimits))) build 18-Sep-2019 23:19:13 + print("Examining channels: %s" % (str(mylist))) build 18-Sep-2019 23:19:13 + print("len(amp): %d" % (len(amp))) build 18-Sep-2019 23:19:13 + print("Examining values: amp[mylist] = %s" % (str(amp[mylist]))) build 18-Sep-2019 23:19:13 + newmin = np.min(amp[mylist]) build 18-Sep-2019 23:19:13 + newmax = np.max(amp[mylist]) build 18-Sep-2019 23:19:13 + newmin = np.min([ylimits[0],newmin]) build 18-Sep-2019 23:19:13 + newmax = np.max([ylimits[1],newmax]) build 18-Sep-2019 23:19:13 + # The following presents a problem with overlays, as it keeps widening forever build 18-Sep-2019 23:19:13 +# # newmin -= 0.05*(newmax-newmin) build 18-Sep-2019 23:19:13 +# # newmax += 0.05*(newmax-newmin) build 18-Sep-2019 23:19:13 + ylimits = [newmin, newmax] build 18-Sep-2019 23:19:13 + elif (chanrangePercent != None): build 18-Sep-2019 23:19:13 + startFraction = (100-chanrangePercent)*0.5*0.01 build 18-Sep-2019 23:19:13 + stopFraction = 1-(100-chanrangePercent)*0.5*0.01 build 18-Sep-2019 23:19:13 + if (xchannels == []): build 18-Sep-2019 23:19:13 + # prevent crash if many channels are flagged: 2015-04-13 build 18-Sep-2019 23:19:13 + return(ylimits) build 18-Sep-2019 23:19:13 + cr0 = int(np.round(np.max(xchannels)*startFraction)) build 18-Sep-2019 23:19:13 + cr1 = int(np.round(np.max(xchannels)*stopFraction)) build 18-Sep-2019 23:19:13 + plottedChannels = np.intersect1d(xchannels, range(cr0, cr1+1)) build 18-Sep-2019 23:19:13 + if (len(plottedChannels) < 1): build 18-Sep-2019 23:19:13 + return(ylimits) build 18-Sep-2019 23:19:13 + mylist = np.arange(xchannels.index(plottedChannels[0]), 1+xchannels.index(plottedChannels[-1])) build 18-Sep-2019 23:19:13 + if (mylist[-1] >= len(amp)): build 18-Sep-2019 23:19:13 + # prevent crash if many channels are flagged build 18-Sep-2019 23:19:13 + return(ylimits) build 18-Sep-2019 23:19:13 + if (ylim_debug): build 18-Sep-2019 23:19:13 + print("Starting with limits = ", ylimits) build 18-Sep-2019 23:19:13 + print("Examining channels: ", mylist) build 18-Sep-2019 23:19:13 + print("len(amp): %d" % (len(amp))) build 18-Sep-2019 23:19:13 + print("type(amp) = %s" % (str(type(amp)))) build 18-Sep-2019 23:19:13 + print("Examining values: amp[mylist] = %s" % (str(amp[mylist]))) build 18-Sep-2019 23:19:13 + newmin = np.min(amp[mylist]) build 18-Sep-2019 23:19:13 + newmax = np.max(amp[mylist]) build 18-Sep-2019 23:19:13 + newmin = np.min([ylimits[0],newmin]) build 18-Sep-2019 23:19:13 + newmax = np.max([ylimits[1],newmax]) build 18-Sep-2019 23:19:13 + ylimits = [newmin, newmax] build 18-Sep-2019 23:19:13 + if (ylim_debug): build 18-Sep-2019 23:19:13 + print("Returning with limits = %s" % (str(ylimits))) build 18-Sep-2019 23:19:13 + return ylimits build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def recalcYlimits(plotrange, ylimits, amp): build 18-Sep-2019 23:19:13 + # Used by plots with xaxis='chan' build 18-Sep-2019 23:19:13 + if (len(amp) < 1): build 18-Sep-2019 23:19:13 + return(pb.ylim()) build 18-Sep-2019 23:19:13 + if ((abs(plotrange[0]) > 0 or abs(plotrange[1]) > 0) and (plotrange[2] == 0 and plotrange[3] == 0)): build 18-Sep-2019 23:19:13 + x0 = plotrange[0] build 18-Sep-2019 23:19:13 + x1 = plotrange[1] build 18-Sep-2019 23:19:13 + if (x0 < 0): build 18-Sep-2019 23:19:13 + x0 = 0 build 18-Sep-2019 23:19:13 + if (x1 > len(amp)-1): build 18-Sep-2019 23:19:13 + x1 = len(amp)-1 build 18-Sep-2019 23:19:13 + if (len(amp) > x1 and x0 < x1): build 18-Sep-2019 23:19:13 + newmin = np.min(amp[x0:x1]) build 18-Sep-2019 23:19:13 + newmax = np.max(amp[x0:x1]) build 18-Sep-2019 23:19:13 + newmin = np.min([ylimits[0],newmin]) build 18-Sep-2019 23:19:13 + newmax = np.max([ylimits[1],newmax]) build 18-Sep-2019 23:19:13 + ylimits = [newmin, newmax] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + ylimits = pb.ylim() # added on 10/27/2011 build 18-Sep-2019 23:19:13 +# # print("current ylimits = ", ylimits) build 18-Sep-2019 23:19:13 + return(ylimits) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def SetNewYLimits(newylimits): build 18-Sep-2019 23:19:13 +# print("Entered SetNewYLimits with ", newylimits ) build 18-Sep-2019 23:19:13 + newrange = newylimits[1]-newylimits[0] build 18-Sep-2019 23:19:13 + if (newrange > 0): build 18-Sep-2019 23:19:13 + pb.ylim([newylimits[0]-0.0*newrange, newylimits[1]+0.0*newrange]) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def SetNewXLimits(newxlimits, loc=0): build 18-Sep-2019 23:19:13 +# print("loc=%d: Entered SetNewXLimits with range = %.3f (%f-%f)" % (loc,np.max(newxlimits)-np.min(newxlimits), newxlimits[0], newxlimits[1])) build 18-Sep-2019 23:19:13 + myxrange = np.abs(newxlimits[1]-newxlimits[0]) build 18-Sep-2019 23:19:13 + mybuffer = 0.01 build 18-Sep-2019 23:19:13 + if (newxlimits[0] < newxlimits[1]): build 18-Sep-2019 23:19:13 + pb.xlim([newxlimits[0]-myxrange*mybuffer,newxlimits[1]+myxrange*mybuffer] ) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 +# print("Swapping xlimits order") build 18-Sep-2019 23:19:13 + pb.xlim(newxlimits[1]-myxrange*mybuffer, newxlimits[0]+myxrange*mybuffer) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def sloppyMatch(newvalue, mylist, threshold, mytime=None, scansToPlot=[], build 18-Sep-2019 23:19:13 + scansForUniqueTimes=[], myprint=False, whichone=False): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + If scan numbers are present, perform an exact match, otherwise compare the build 18-Sep-2019 23:19:13 + time stamps of the solutions. build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + debug = myprint build 18-Sep-2019 23:19:13 + if (debug): build 18-Sep-2019 23:19:13 + print("sloppyMatch: scansToPlot = %s" % (str(scansToPlot))) build 18-Sep-2019 23:19:13 + mymatch = None build 18-Sep-2019 23:19:13 + if (len(scansToPlot) > 0): build 18-Sep-2019 23:19:13 + matched = scansForUniqueTimes[mytime] in scansToPlot build 18-Sep-2019 23:19:13 + if (whichone or myprint): build 18-Sep-2019 23:19:13 + myscan = scansForUniqueTimes[mytime] build 18-Sep-2019 23:19:13 + if (myscan in scansToPlot): build 18-Sep-2019 23:19:13 + mymatch = list(scansToPlot).index(myscan) build 18-Sep-2019 23:19:13 + if (matched == False and myprint==True): build 18-Sep-2019 23:19:13 + print("sloppyMatch: %d is not in %s" % (myscan, list(scansToPlot))) build 18-Sep-2019 23:19:13 + elif (myprint==True): build 18-Sep-2019 23:19:13 + print("sloppyMatch: %d is in %s" % (myscan, list(scansToPlot))) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + matched = False build 18-Sep-2019 23:19:13 + if (type(mylist) != list and type(mylist)!=np.ndarray): build 18-Sep-2019 23:19:13 + mylist = [mylist] build 18-Sep-2019 23:19:13 + mymatch = -1 build 18-Sep-2019 23:19:13 + for i in range(len(mylist)): build 18-Sep-2019 23:19:13 + v = mylist[i] build 18-Sep-2019 23:19:13 + if (abs(newvalue-v) < threshold): build 18-Sep-2019 23:19:13 + matched = True build 18-Sep-2019 23:19:13 + mymatch = i build 18-Sep-2019 23:19:13 + if (matched == False and myprint==True): build 18-Sep-2019 23:19:13 + print("sloppyMatch: %.0f is not within %.0f of anything in %s" % (newvalue,threshold, str([int(round(b)) for b in mylist]))) build 18-Sep-2019 23:19:13 + elif (myprint==True): build 18-Sep-2019 23:19:13 + print("sloppyMatch: %.0f is within %.0f of something in %s" % (newvalue,threshold, str([int(round(b)) for b in mylist]))) build 18-Sep-2019 23:19:13 + if (whichone == False): build 18-Sep-2019 23:19:13 + return(matched) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + return(matched,mymatch) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def sloppyUnique(t, thresholdSeconds): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Takes a list of numbers and returns a list of unique values, subject to a threshold difference. build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + # start with the first entry, and only add a new entry if it is more than the threshold from prior build 18-Sep-2019 23:19:13 + sloppyList = [t[0]] build 18-Sep-2019 23:19:13 + for i in range(1,len(t)): build 18-Sep-2019 23:19:13 + keepit = True build 18-Sep-2019 23:19:13 + for j in range(0,i): build 18-Sep-2019 23:19:13 + if (abs(t[i]-t[j]) < thresholdSeconds): build 18-Sep-2019 23:19:13 + keepit = False build 18-Sep-2019 23:19:13 + if (keepit): build 18-Sep-2019 23:19:13 + sloppyList.append(t[i]) build 18-Sep-2019 23:19:13 +# print("sloppyUnique returns %d values from the original %d" % (len(sloppyList), len(t))) build 18-Sep-2019 23:19:13 + return(sloppyList) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def SetLimits(plotrange, chanrange, newylimits, channels, frequencies, pfrequencies, build 18-Sep-2019 23:19:13 + ampMin, ampMax, xaxis, pxl, chanrangeSetXrange, chanrangePercent=None): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + This is the place where chanrange actually takes effect. build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + if (abs(plotrange[0]) > 0 or abs(plotrange[1]) > 0): build 18-Sep-2019 23:19:13 + SetNewXLimits([plotrange[0],plotrange[1]]) build 18-Sep-2019 23:19:13 + if (plotrange[2] == 0 and plotrange[3] == 0): build 18-Sep-2019 23:19:13 + # reset the ylimits based on the channel range shown (selected via plotrange) build 18-Sep-2019 23:19:13 + SetNewYLimits(newylimits) build 18-Sep-2019 23:19:13 + else: # set xlimits to full range build 18-Sep-2019 23:19:13 + if (xaxis.find('chan')>=0): build 18-Sep-2019 23:19:13 + SetNewXLimits([channels[0],channels[-1]]) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (chanrangeSetXrange or (chanrange[0]==0 and chanrange[1]==0 and chanrangePercent==None)): # CAS-7965 build 18-Sep-2019 23:19:13 + # print("SetLimits(): Setting x limits to full range (%f-%f)" % (frequencies[0], frequencies[-1])) build 18-Sep-2019 23:19:13 + SetNewXLimits([frequencies[0], frequencies[-1]]) build 18-Sep-2019 23:19:13 + if (chanrange[0] != 0 or chanrange[1] != 0 or chanrangePercent != None): build 18-Sep-2019 23:19:13 + # reset the ylimits based on the channel range specified (selected via chanrange) build 18-Sep-2019 23:19:13 + if (newylimits != [LARGE_POSITIVE, LARGE_NEGATIVE]): build 18-Sep-2019 23:19:13 + SetNewYLimits(newylimits) build 18-Sep-2019 23:19:13 +# print("pxl=%d, chanrange[0]=%d, chanrange[1]=%d, shape(pfreq), shape(freq)=" % (pxl, chanrange[0], chanrange[1]), np.shape(pfrequencies),np.shape(frequencies)) build 18-Sep-2019 23:19:13 + # Use frequencies instead of pfrequencies, because frequencies are not flagged and build 18-Sep-2019 23:19:13 + # will continue to work if chanranze is specified and data are flagged. build 18-Sep-2019 23:19:13 + if chanrangeSetXrange: build 18-Sep-2019 23:19:13 + if (chanrangePercent == None): build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + SetNewXLimits([frequencies[chanrange[0]], frequencies[chanrange[1]]]) # Apr 3, 2012 build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + print("a)Invalid chanrange (%d-%d). Valid range = 0-%d" % (chanrange[0],chanrange[1],len(frequencies)-1)) build 18-Sep-2019 23:19:13 + return(-1) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + startFraction = (100-chanrangePercent)*0.5*0.01 build 18-Sep-2019 23:19:13 + stopFraction = 1-(100-chanrangePercent)*0.5*0.01 build 18-Sep-2019 23:19:13 + cr0 = int(np.round(np.max(channels)*startFraction)) build 18-Sep-2019 23:19:13 + cr1 = int(np.round(np.max(channels)*stopFraction)) build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + SetNewXLimits([frequencies[cr0], frequencies[cr1]]) build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + print("b)Invalid chanrange (%d-%d). Valid range = 0-%d" % (cr0,cr1,len(frequencies)-1)) build 18-Sep-2019 23:19:13 + return(-1) build 18-Sep-2019 23:19:13 + if (abs(plotrange[2]) > 0 or abs(plotrange[3]) > 0): build 18-Sep-2019 23:19:13 + SetNewYLimits([plotrange[2],plotrange[3]]) build 18-Sep-2019 23:19:13 + return(0) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def showFDM(originalSpw, chanFreqGHz, baseband, showBasebandNumber, basebandDict): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Draws a horizontal bar indicating the location of FDM spws in the dataset. build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + Still need to limit based on the baseband -- need dictionary passed in. build 18-Sep-2019 23:19:13 + originalSpw: should contain all spws in the dataset, not just the ones build 18-Sep-2019 23:19:13 + in the caltable build 18-Sep-2019 23:19:13 + baseband: the baseband of the current spw build 18-Sep-2019 23:19:13 + showBasebandNumber: force the display of all FDM spws, and their baseband number build 18-Sep-2019 23:19:13 + basebandDict: {1:[17,19], 2:[21,23], etc.} or {} for really old datasets build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # add some space at the bottom -- Apr 25, 2012 build 18-Sep-2019 23:19:13 + ylim = pb.ylim() build 18-Sep-2019 23:19:13 + yrange = ylim[1]-ylim[0] build 18-Sep-2019 23:19:13 + pb.ylim([ylim[0]-BOTTOM_MARGIN*yrange, ylim[1]]) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + sdebug = False build 18-Sep-2019 23:19:13 + if (sdebug): build 18-Sep-2019 23:19:13 + print("Showing FDM (%d)" % (len(originalSpw)), originalSpw) build 18-Sep-2019 23:19:13 + print("baseband = %d, basebandDict = %s" % (baseband, str(basebandDict))) build 18-Sep-2019 23:19:13 + fdmctr = -1 build 18-Sep-2019 23:19:13 + x0,x1 = pb.xlim() build 18-Sep-2019 23:19:13 + y0,y1 = pb.ylim() build 18-Sep-2019 23:19:13 + yrange = y1 - y0 build 18-Sep-2019 23:19:13 + myxrange = x1 - x0 build 18-Sep-2019 23:19:13 + pb.hold(True) build 18-Sep-2019 23:19:13 + labelAbove = False # False means label to the right build 18-Sep-2019 23:19:13 + for i in range(len(originalSpw)): build 18-Sep-2019 23:19:13 + nchan = len(chanFreqGHz[i]) build 18-Sep-2019 23:19:13 + # latter 3 values are for ACA with FPS enabled build 18-Sep-2019 23:19:13 + if (nchan >= 15 and nchan not in [256,128,64,32,16,248,124,62]): build 18-Sep-2019 23:19:13 + if (originalSpw[i] in basebandDict[baseband] or showBasebandNumber): build 18-Sep-2019 23:19:13 + fdmctr += 1 build 18-Sep-2019 23:19:13 + verticalOffset = fdmctr*0.04*yrange build 18-Sep-2019 23:19:13 + y1a = y0 + 0.03*yrange + verticalOffset build 18-Sep-2019 23:19:13 + if (labelAbove): build 18-Sep-2019 23:19:13 + y2 = y1a + 0.01*yrange build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + y2 = y1a - 0.016*yrange build 18-Sep-2019 23:19:13 +# print("chan=%d: Drawing line at y=%f (y0=%f) from x=%f to %f" % (len(chanFreqGHz[i]), build 18-Sep-2019 23:19:13 +# y1a,y0,chanFreqGHz[i][0], chanFreqGHz[i][-1])) build 18-Sep-2019 23:19:13 + f0 = chanFreqGHz[i][0] build 18-Sep-2019 23:19:13 + f1 = chanFreqGHz[i][-1] build 18-Sep-2019 23:19:13 + if (f1 < f0): build 18-Sep-2019 23:19:13 + swap = f1 build 18-Sep-2019 23:19:13 + f1 = f0 build 18-Sep-2019 23:19:13 + f0 = swap build 18-Sep-2019 23:19:13 + v0 = np.max([f0,x0]) build 18-Sep-2019 23:19:13 + v1 = np.min([f1,x1]) build 18-Sep-2019 23:19:13 + if (v1 > v0): build 18-Sep-2019 23:19:13 + if (labelAbove): build 18-Sep-2019 23:19:13 + xlabel = 0.5*(v0+v1) build 18-Sep-2019 23:19:13 + if (xlabel < x0): build 18-Sep-2019 23:19:13 + xlabel = x0 build 18-Sep-2019 23:19:13 + if (xlabel > x1): build 18-Sep-2019 23:19:13 + xlabel = x1 build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + xlabel = v1+0.02*myxrange build 18-Sep-2019 23:19:13 + pb.plot([v0,v1], [y1a,y1a], '-', build 18-Sep-2019 23:19:13 + linewidth=4, color=overlayColors[fdmctr],markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + if (showBasebandNumber): build 18-Sep-2019 23:19:13 + mybaseband = [key for key in basebandDict if i in basebandDict[key]] build 18-Sep-2019 23:19:13 + if (len(mybaseband) > 0): build 18-Sep-2019 23:19:13 + pb.text(xlabel, y2, "spw%d(bb%d)"%(i,mybaseband[0]), size=7) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pb.text(xlabel, y2, "spw%d(bb?)"%(i), size=7) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pb.text(xlabel, y2, "spw%d"%(i), size=7) build 18-Sep-2019 23:19:13 + if (sdebug): print("Plotting spw %d (%d)" % (i, originalSpw[i])) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (sdebug): print("Not plotting spw %d (%d) because %f < %f" % (i,originalSpw[i],v0,v1)) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (sdebug): print("Not plotting spw %d (%d) because it is not in baseband %d (%s)" % (i,originalSpw[i],baseband,basebandDict[baseband])) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (sdebug): print("Not plotting spw %d (%d) because fewer than 256 channels (%d)" % (i,originalSpw[i],nchan)) build 18-Sep-2019 23:19:13 + if (fdmctr > -1): build 18-Sep-2019 23:19:13 + pb.ylim([y0,y1]) build 18-Sep-2019 23:19:13 + pb.xlim([x0,x1]) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def DrawAtmosphere(showatm, showtsky, subplotRows, atmString, mysize, build 18-Sep-2019 23:19:13 + TebbSky, plotrange, xaxis, atmchan, atmfreq, transmission, build 18-Sep-2019 23:19:13 + subplotCols, lo1='', xframe=0, firstFrame=0, build 18-Sep-2019 23:19:13 + showatmPoints=False, channels=[0], mylineno=-1,xant=-1, build 18-Sep-2019 23:19:13 + overlaySpws=False, overlayBasebands=False, drewAtmosphere=False): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Draws atmospheric transmission or Tsky on an amplitude vs. chan or freq plot. build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + xlim = pb.xlim() build 18-Sep-2019 23:19:13 + ylim = pb.ylim() build 18-Sep-2019 23:19:13 + myxrange = xlim[1]-xlim[0] build 18-Sep-2019 23:19:13 + yrange = ylim[1]-ylim[0] build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (not drewAtmosphere and not overlayBasebands): # CAS-8489 final build 18-Sep-2019 23:19:13 + if (lo1 == ''): build 18-Sep-2019 23:19:13 + # add some space at the top -- Apr 16, 2012 build 18-Sep-2019 23:19:13 + pb.ylim([ylim[0], ylim[1]+TOP_MARGIN*yrange]) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pb.ylim([ylim[0], ylim[1]+TOP_MARGIN*yrange*0.5]) build 18-Sep-2019 23:19:13 + ylim = pb.ylim() build 18-Sep-2019 23:19:13 + yrange = ylim[1]-ylim[0] build 18-Sep-2019 23:19:13 + # build 18-Sep-2019 23:19:13 + ystartPolLabel = 1.0-0.04*subplotRows build 18-Sep-2019 23:19:13 + if (lo1 == ''): build 18-Sep-2019 23:19:13 + transmissionColor = 'm' build 18-Sep-2019 23:19:13 + tskyColor = 'm' build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + transmissionColor = 'k' build 18-Sep-2019 23:19:13 + tskyColor = 'k' build 18-Sep-2019 23:19:13 + if (showatmPoints): build 18-Sep-2019 23:19:13 + atmline = '.' build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + atmline = '-' build 18-Sep-2019 23:19:13 + if (showatm or showtsky): build 18-Sep-2019 23:19:13 + if (showatm): build 18-Sep-2019 23:19:13 + atmcolor = transmissionColor build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + atmcolor = tskyColor build 18-Sep-2019 23:19:13 + if (lo1 == '' and not drewAtmosphere): build 18-Sep-2019 23:19:13 + pb.text(0.25, ystartPolLabel, atmString, color=atmcolor, size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (showtsky): build 18-Sep-2019 23:19:13 + rescaledY, edgeYvalue, zeroValue, zeroYValue, otherEdgeYvalue, edgeT, otherEdgeT, edgeValueAmplitude, otherEdgeValueAmplitude, zeroValueAmplitude = RescaleTrans(TebbSky, ylim, subplotRows, lo1, xframe) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + rescaledY, edgeYvalue, zeroValue, zeroYValue, otherEdgeYvalue, edgeT, otherEdgeT, edgeValueAmplitude, otherEdgeValueAmplitude, zeroValueAmplitude = RescaleTrans(transmission, ylim, subplotRows, lo1, xframe) build 18-Sep-2019 23:19:13 + if (overlayBasebands and xaxis.find('freq')>=0): build 18-Sep-2019 23:19:13 + # use axis coordinates for y-axis only so that transmission can be on common scale build 18-Sep-2019 23:19:13 + trans = matplotlib.transforms.blended_transform_factory(pb.gca().transData, pb.gca().transAxes) build 18-Sep-2019 23:19:13 + if showtsky: build 18-Sep-2019 23:19:13 + pb.plot(atmfreq, TebbSky/300., '%s%s'%(atmcolor,atmline), build 18-Sep-2019 23:19:13 + markeredgewidth=markeredgewidth, transform=trans) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pb.plot(atmfreq, transmission, '%s%s'%(atmcolor,atmline), build 18-Sep-2019 23:19:13 + markeredgewidth=markeredgewidth, transform=trans) build 18-Sep-2019 23:19:13 + if (atmfreq[0]=0): build 18-Sep-2019 23:19:13 + rescaledX = RescaleX(atmchan, xlim, plotrange, channels) build 18-Sep-2019 23:19:13 + # rescaledX = atmchan build 18-Sep-2019 23:19:13 + pb.plot(rescaledX, rescaledY,'%s%s'%(atmcolor,atmline),markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + tindex = -1 build 18-Sep-2019 23:19:13 + elif (xaxis.find('freq')>=0): build 18-Sep-2019 23:19:13 + pb.plot(atmfreq, rescaledY, '%s%s'%(atmcolor,atmline),markeredgewidth=markeredgewidth) build 18-Sep-2019 23:19:13 + if (atmfreq[0]=0): # CAS-8489 final build 18-Sep-2019 23:19:13 + trans = matplotlib.transforms.blended_transform_factory(pb.gca().transData, pb.gca().transAxes) build 18-Sep-2019 23:19:13 + zeroValue = 0 build 18-Sep-2019 23:19:13 + zeroValueAmplitude = 0 build 18-Sep-2019 23:19:13 + edgeValueAmplitude = 1 build 18-Sep-2019 23:19:13 + if (showtsky): build 18-Sep-2019 23:19:13 + edgeT = 300 build 18-Sep-2019 23:19:13 + if (lo1 == ''): build 18-Sep-2019 23:19:13 + pb.text(xlim[1]+0.06*myxrange/subplotCols, edgeValueAmplitude, build 18-Sep-2019 23:19:13 + '%.0fK'%(edgeT), color=atmcolor, size=mysize, transform=trans) build 18-Sep-2019 23:19:13 + pb.text(xlim[1]+0.06*myxrange/subplotCols, zeroValueAmplitude, build 18-Sep-2019 23:19:13 + '%.0fK'%(zeroValue), color=atmcolor, transform=trans, build 18-Sep-2019 23:19:13 + size=mysize) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pb.text(xEdgeLabel, edgeValueAmplitude,'%.0fK'%(edgeT), build 18-Sep-2019 23:19:13 + color=atmcolor, build 18-Sep-2019 23:19:13 + size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + pb.text(xEdgeLabel, zeroValueAmplitude,'%.0fK'%(zeroValue), build 18-Sep-2019 23:19:13 + color=atmcolor, build 18-Sep-2019 23:19:13 + size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + # showatm=True build 18-Sep-2019 23:19:13 + edgeT = 1 build 18-Sep-2019 23:19:13 + if (lo1 == ''): build 18-Sep-2019 23:19:13 + pb.text(xlim[1]+0.05*myxrange/subplotCols, edgeValueAmplitude, build 18-Sep-2019 23:19:13 + '%.0f%%'%(edgeT*100), color=atmcolor, size=mysize, build 18-Sep-2019 23:19:13 + transform=trans, va='center') build 18-Sep-2019 23:19:13 + pb.text(xlim[1]+0.05*myxrange/subplotCols, zeroValueAmplitude, build 18-Sep-2019 23:19:13 + '%.0f%%'%(zeroValue*100), color=atmcolor, transform=trans, build 18-Sep-2019 23:19:13 + size=mysize, va='center') build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + pb.text(xEdgeLabel, edgeValueAmplitude,'%.0f%%'%(edgeT*100), build 18-Sep-2019 23:19:13 + color=atmcolor, va='center', build 18-Sep-2019 23:19:13 + size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + pb.text(xEdgeLabel, zeroValueAmplitude,'%.0f%%'%(zeroValue*100), build 18-Sep-2019 23:19:13 + color=atmcolor, va='center', build 18-Sep-2019 23:19:13 + size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (showtsky): build 18-Sep-2019 23:19:13 + if (lo1 == ''): build 18-Sep-2019 23:19:13 + # This must be done in user coordinates since another curve build 18-Sep-2019 23:19:13 + # is plotted following this one. build 18-Sep-2019 23:19:13 + pb.text(xlim[1]+0.06*myxrange/subplotCols, edgeValueAmplitude, build 18-Sep-2019 23:19:13 + '%.0fK'%(edgeT), color=atmcolor, size=mysize) build 18-Sep-2019 23:19:13 + pb.text(xlim[1]+0.06*myxrange/subplotCols, zeroValueAmplitude, build 18-Sep-2019 23:19:13 + '%.0fK'%(zeroValue), color=atmcolor, build 18-Sep-2019 23:19:13 + size=mysize) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + # This can remain in axes units since it is the final plot. build 18-Sep-2019 23:19:13 + pb.text(xEdgeLabel, otherEdgeYvalue,'%.0fK'%(otherEdgeT), build 18-Sep-2019 23:19:13 + color=atmcolor, build 18-Sep-2019 23:19:13 + size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + pb.text(xEdgeLabel, zeroYValue,'%.0fK'%(zeroValue), build 18-Sep-2019 23:19:13 + color=atmcolor, build 18-Sep-2019 23:19:13 + size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + # showatm=True build 18-Sep-2019 23:19:13 + if (lo1 == ''): build 18-Sep-2019 23:19:13 + # This must be done in user coordinates since another curve build 18-Sep-2019 23:19:13 + # is plotted following this one. build 18-Sep-2019 23:19:13 + pb.text(xlim[1]+0.05*myxrange/subplotCols, edgeValueAmplitude, build 18-Sep-2019 23:19:13 + '%.0f%%'%(edgeT*100), color=atmcolor, size=mysize) build 18-Sep-2019 23:19:13 + pb.text(xlim[1]+0.05*myxrange/subplotCols, zeroValueAmplitude, build 18-Sep-2019 23:19:13 + '%.0f%%'%(zeroValue*100), color=atmcolor, build 18-Sep-2019 23:19:13 + size=mysize) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + # This can remain in axes units since it is the final plot. build 18-Sep-2019 23:19:13 + pb.text(xEdgeLabel, otherEdgeYvalue,'%.0f%%'%(otherEdgeT*100), build 18-Sep-2019 23:19:13 + color=atmcolor, build 18-Sep-2019 23:19:13 + size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + pb.text(xEdgeLabel, zeroYValue,'%.0f%%'%(zeroValue*100), build 18-Sep-2019 23:19:13 + color=atmcolor, build 18-Sep-2019 23:19:13 + size=mysize, transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + if (lo1 != ''): build 18-Sep-2019 23:19:13 + if (xframe == firstFrame): build 18-Sep-2019 23:19:13 + pb.text(+0.96-0.08*subplotCols, -0.07*subplotRows, build 18-Sep-2019 23:19:13 + 'Signal Sideband', color='m', size=mysize, build 18-Sep-2019 23:19:13 + transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + pb.text(-0.08*subplotCols, -0.07*subplotRows, build 18-Sep-2019 23:19:13 + 'Image Sideband', color='k', size=mysize, build 18-Sep-2019 23:19:13 + transform=pb.gca().transAxes) build 18-Sep-2019 23:19:13 + return ylim # CAS-8655 build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def DrawBottomLegendPageCoords(msName, uniqueTimesMytime, mysize, figfile): build 18-Sep-2019 23:19:13 + msName = msName.split('/')[-1] build 18-Sep-2019 23:19:13 + bottomLegend = msName + ' ObsDate=' + utdatestring(uniqueTimesMytime) build 18-Sep-2019 23:19:13 + if (os.path.basename(figfile).find('regression') == 0): build 18-Sep-2019 23:19:13 + regression = True build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + regression = False build 18-Sep-2019 23:19:13 + if (regression == False): build 18-Sep-2019 23:19:13 + bottomLegend += ' plotbandpass v' \ build 18-Sep-2019 23:19:13 + + PLOTBANDPASS_REVISION_STRING.split()[2] + ' = ' \ build 18-Sep-2019 23:19:13 + + PLOTBANDPASS_REVISION_STRING.split()[3] + ' ' \ build 18-Sep-2019 23:19:13 + + PLOTBANDPASS_REVISION_STRING.split()[4] build 18-Sep-2019 23:19:13 +# The following should be used going forward, as it is better for long VLA names build 18-Sep-2019 23:19:13 + pb.text(0.04, 0.02, bottomLegend, size=mysize, transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:13 +# pb.text(0.1, 0.02, bottomLegend, size=mysize, transform=pb.gcf().transFigure) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def DrawAntennaNames(msAnt, antennasToPlot, msFound, mysize): build 18-Sep-2019 23:19:13 + for a in range(len(antennasToPlot)): build 18-Sep-2019 23:19:13 + if (msFound): build 18-Sep-2019 23:19:13 + legendString = msAnt[antennasToPlot[a]] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + legendString = str(antennasToPlot[a]) build 18-Sep-2019 23:19:13 + if (a= len(a)/2): # protect against too large of an edge value build 18-Sep-2019 23:19:13 + originalEdge = edge build 18-Sep-2019 23:19:13 + if (len(a) == 2*(len(a)/2)): build 18-Sep-2019 23:19:13 + edge = len(a)/2 - 1 # use middle 2 points build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + edge = len(a)/2 # use central point build 18-Sep-2019 23:19:13 + if (edge < 0): build 18-Sep-2019 23:19:13 + edge = 0 build 18-Sep-2019 23:19:13 + print("stdInfo: WARNING edge value is too large for spw%d xant%d pol%d, reducing it from %d to %d." % (spw, xant, pol, originalEdge, edge)) build 18-Sep-2019 23:19:13 + info['std'] = np.std(a[edge:len(a)-edge]) build 18-Sep-2019 23:19:13 + chan = [] build 18-Sep-2019 23:19:13 + outlierValue = 0 build 18-Sep-2019 23:19:13 + outlierChannel = None build 18-Sep-2019 23:19:13 + for i in range(edge,len(a)-edge): build 18-Sep-2019 23:19:13 + if (np.abs(a[i]) > sigma*info['std']): build 18-Sep-2019 23:19:13 + chan.append(i) build 18-Sep-2019 23:19:13 + if (np.abs(a[i]) > np.abs(outlierValue)): build 18-Sep-2019 23:19:13 + outlierValue = a[i] build 18-Sep-2019 23:19:13 + outlierChannel = i build 18-Sep-2019 23:19:13 + info['nchan'] = len(chan) build 18-Sep-2019 23:19:13 + info['chan'] = chan build 18-Sep-2019 23:19:13 + info['outlierValue'] = outlierValue/info['std'] build 18-Sep-2019 23:19:13 + info['outlierChannel'] = outlierChannel build 18-Sep-2019 23:19:13 + return(info) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def madInfo(a, madsigma=3, edge=0): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Computes the MAD of a list, then returns the value, plus the number and list build 18-Sep-2019 23:19:13 + of channels that exceed madsigma*MAD, and the worst outlier. build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + info = {} build 18-Sep-2019 23:19:13 + if (edge >= len(a)/2): # protect against too large of an edge value build 18-Sep-2019 23:19:13 + originalEdge = edge build 18-Sep-2019 23:19:13 + if (len(a) == 2*(len(a)/2)): build 18-Sep-2019 23:19:13 + edge = len(a)/2 - 1 # use middle 2 points build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + edge = len(a)/2 # use central point build 18-Sep-2019 23:19:13 + print("WARNING edge value is too large, reducing it from %d to %d." % (originalEdge, edge)) build 18-Sep-2019 23:19:13 + info['mad'] = mad(a[edge:len(a)-edge]) build 18-Sep-2019 23:19:13 + chan = [] build 18-Sep-2019 23:19:13 + outlierValue = 0 build 18-Sep-2019 23:19:13 + outlierChannel = None build 18-Sep-2019 23:19:13 + for i in range(edge,len(a)-edge): build 18-Sep-2019 23:19:13 + if (np.abs(a[i]) > madsigma*info['mad']): build 18-Sep-2019 23:19:13 + chan.append(i) build 18-Sep-2019 23:19:13 + if (np.abs(a[i]) > np.abs(outlierValue)): build 18-Sep-2019 23:19:13 + outlierValue = a[i] build 18-Sep-2019 23:19:13 + outlierChannel = i build 18-Sep-2019 23:19:13 + info['nchan'] = len(chan) build 18-Sep-2019 23:19:13 + info['chan'] = chan build 18-Sep-2019 23:19:13 + info['outlierValue'] = outlierValue/info['mad'] build 18-Sep-2019 23:19:13 + info['outlierChannel'] = outlierChannel build 18-Sep-2019 23:19:13 + return(info) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def platformingCheck(a, threshold=DEFAULT_PLATFORMING_THRESHOLD): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Checks for values outside the range of +-threshold. build 18-Sep-2019 23:19:13 + Meant to be passed an amplitude spectrum. build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + info = {} build 18-Sep-2019 23:19:13 + startChan = len(a)/32. - 1 build 18-Sep-2019 23:19:13 + endChan = len(a)*31/32. + 1 build 18-Sep-2019 23:19:13 +# print("Checking channels %d-%d for platforming" % (startChan,endChan)) build 18-Sep-2019 23:19:13 + if (startChan <= 0 or endChan >= len(a)): build 18-Sep-2019 23:19:13 + return build 18-Sep-2019 23:19:13 + middleChan = (startChan+endChan)/2 build 18-Sep-2019 23:19:13 + channelRange1 = range(startChan,middleChan+1) build 18-Sep-2019 23:19:13 + channelRange2 = range(endChan,middleChan,-1) build 18-Sep-2019 23:19:13 + platforming = False build 18-Sep-2019 23:19:13 + awayFromEdge = False build 18-Sep-2019 23:19:13 + for i in channelRange1: build 18-Sep-2019 23:19:13 + if (np.abs(a[i]) > threshold): build 18-Sep-2019 23:19:13 + if (awayFromEdge): build 18-Sep-2019 23:19:13 +# print("a[%d]=%f" % (i,a[i])) build 18-Sep-2019 23:19:13 + platforming = True build 18-Sep-2019 23:19:13 + return(platforming) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + awayFromEdge = True build 18-Sep-2019 23:19:13 + awayFromEdge = False build 18-Sep-2019 23:19:13 + for i in channelRange2: build 18-Sep-2019 23:19:13 + if (np.abs(a[i]) > threshold): build 18-Sep-2019 23:19:13 + if (awayFromEdge): build 18-Sep-2019 23:19:13 + platforming = True build 18-Sep-2019 23:19:13 + return(platforming) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + awayFromEdge = True build 18-Sep-2019 23:19:13 + return(platforming) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def mad(a, c=0.6745, axis=0): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Median Absolute Deviation along given axis of an array: build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + median(abs(a - median(a))) / c build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + c = 0.6745 is the constant to convert from MAD to std; it is used by build 18-Sep-2019 23:19:13 + default build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + a = np.array(a) build 18-Sep-2019 23:19:13 + good = (a==a) build 18-Sep-2019 23:19:13 + a = np.asarray(a, np.float64) build 18-Sep-2019 23:19:13 + if a.ndim == 1: build 18-Sep-2019 23:19:13 + d = np.median(a[good]) build 18-Sep-2019 23:19:13 + m = np.median(np.fabs(a[good] - d) / c) build 18-Sep-2019 23:19:13 +# print( "mad = %f" % (m)) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + d = np.median(a[good], axis=axis) build 18-Sep-2019 23:19:13 + # I don't want the array to change so I have to copy it? build 18-Sep-2019 23:19:13 + if axis > 0: build 18-Sep-2019 23:19:13 + aswp = swapaxes(a[good],0,axis) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + aswp = a[good] build 18-Sep-2019 23:19:13 + m = np.median(np.fabs(aswp - d) / c, axis=0) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + return m build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def callFrequencyRangeForSpws(mymsmd, spwlist, vm, caltable=None): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Returns the min and max frequency of a list of spws. build 18-Sep-2019 23:19:13 + Uses msmd, unless the ms is not found, in which case it uses build 18-Sep-2019 23:19:13 + the spw information inside the (new-style) cal-table. build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + if (mymsmd != '' and cu.compare_version('>=',[4,1,0])): build 18-Sep-2019 23:19:13 + return(frequencyRangeForSpws(mymsmd,spwlist)) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + freqs = [] build 18-Sep-2019 23:19:13 + if (type(vm) != str): build 18-Sep-2019 23:19:13 + for spw in spwlist: build 18-Sep-2019 23:19:13 + freqs += list(vm.spwInfo[spw]["chanFreqs"]) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + mytb.open(caltable+'/SPECTRAL_WINDOW') build 18-Sep-2019 23:19:13 + chanfreq = [] build 18-Sep-2019 23:19:13 + if (len(spwlist) == 0): # CAS-8489b build 18-Sep-2019 23:19:13 + originalSpws = range(len(mytb.getcol('MEAS_FREQ_REF'))) build 18-Sep-2019 23:19:13 + spwlist = originalSpws build 18-Sep-2019 23:19:13 + for i in spwlist: # CAS-8489b build 18-Sep-2019 23:19:13 + # The array shapes can vary. build 18-Sep-2019 23:19:13 + chanfreq.append(mytb.getcell('CHAN_FREQ',i)) build 18-Sep-2019 23:19:13 + for cf in chanfreq: build 18-Sep-2019 23:19:13 + freqs += list(cf) build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + mytb.done() build 18-Sep-2019 23:19:13 + if (freqs == []): build 18-Sep-2019 23:19:13 + return(0,0) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + return(np.min(freqs)*1e-9, np.max(freqs)*1e-9) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def frequencyRangeForSpws(mymsmd, spwlist): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Returns the min and max frequency of a list of spws. build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + allfreqs = [] build 18-Sep-2019 23:19:13 + for spw in spwlist: build 18-Sep-2019 23:19:13 + allfreqs += list(mymsmd.chanfreqs(spw)) build 18-Sep-2019 23:19:13 + if (len(allfreqs) == 0): build 18-Sep-2019 23:19:13 + return(0,0) build 18-Sep-2019 23:19:13 + return(np.min(allfreqs)*1e-9, np.max(allfreqs)*1e-9) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def buildSpwString(overlaySpws, overlayBasebands, spwsToPlot, ispw, originalSpw, build 18-Sep-2019 23:19:13 + observatoryName, baseband, showBasebandNumber): build 18-Sep-2019 23:19:13 + if (overlayBasebands): build 18-Sep-2019 23:19:13 + spwString = ' all' build 18-Sep-2019 23:19:13 + elif (overlaySpws and len(spwsToPlot)>1): build 18-Sep-2019 23:19:13 + if (observatoryName.find('ALMA') >= 0 or observatoryName.find('ACA') >= 0): build 18-Sep-2019 23:19:13 + # show a list of all spws build 18-Sep-2019 23:19:13 + spwString = str(spwsToPlot).replace(' ','').strip('[').strip(']') build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + # show the range of spw numbers build 18-Sep-2019 23:19:13 + spwString = '%2d-%2d' % (np.min(spwsToPlot),np.max(spwsToPlot)) build 18-Sep-2019 23:19:13 + elif (ispw==originalSpw): build 18-Sep-2019 23:19:13 + spwString = '%2d' % (ispw) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + spwString = '%2d (%d)' % (ispw,originalSpw) build 18-Sep-2019 23:19:13 + if (overlayBasebands==False): build 18-Sep-2019 23:19:13 + spwString = appendBasebandNumber(spwString, baseband, showBasebandNumber) build 18-Sep-2019 23:19:13 + return(spwString) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def appendBasebandNumber(spwString, baseband, showBasebandNumber): build 18-Sep-2019 23:19:13 + if (showBasebandNumber): build 18-Sep-2019 23:19:13 + spwString += ', bb%d' % (baseband) build 18-Sep-2019 23:19:13 + return(spwString) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def getSpwsForBaseband(vis, bb, mymsmd=None): build 18-Sep-2019 23:19:13 + needToClose = False build 18-Sep-2019 23:19:13 +# if (casadef.subversion_revision >= 25753): build 18-Sep-2019 23:19:13 + if (mymsmd is None or mymsmd == ''): build 18-Sep-2019 23:19:13 + needToClose = True build 18-Sep-2019 23:19:13 + mymsmd = createCasaTool(msmdtool) build 18-Sep-2019 23:19:13 + mymsmd.open(vis) build 18-Sep-2019 23:19:13 + s = mymsmd.spwsforbaseband(bb) build 18-Sep-2019 23:19:13 + if needToClose: build 18-Sep-2019 23:19:13 + mymsmd.close() build 18-Sep-2019 23:19:13 + return(s) build 18-Sep-2019 23:19:13 +# else: build 18-Sep-2019 23:19:13 +# return(getBasebandDict(vis,caltable=caltable,mymsmd=mymsmd)) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def getBasebandDict(vis=None, spwlist=[], caltable=None, mymsmd=None): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Builds a dictionary with baseband numbers as the keys and the build 18-Sep-2019 23:19:13 + associated spws as the values. The optional parameter spwlist can build 18-Sep-2019 23:19:13 + be used to restrict the contents of the dictionary. build 18-Sep-2019 23:19:13 + Note: This is obsoleted by msmd.spwsforbaseband(-1) build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + bbdict = {} build 18-Sep-2019 23:19:13 + if (vis != None): build 18-Sep-2019 23:19:13 + if (os.path.exists(vis)): build 18-Sep-2019 23:19:13 + bbs = getBasebandNumbers(vis) build 18-Sep-2019 23:19:13 + elif (caltable != None): build 18-Sep-2019 23:19:13 + bbs = getBasebandNumbersFromCaltable(caltable) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + print("Must specify either vis or caltable") build 18-Sep-2019 23:19:13 + return build 18-Sep-2019 23:19:13 + elif (caltable != None): build 18-Sep-2019 23:19:13 + bbs = getBasebandNumbersFromCaltable(caltable) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + print("Must specify either vis or caltable") build 18-Sep-2019 23:19:13 + return build 18-Sep-2019 23:19:13 + if (type(bbs) == int): # old datasets will bomb on msmd.baseband() build 18-Sep-2019 23:19:13 + return(bbdict) build 18-Sep-2019 23:19:13 + if (cu.compare_version('>=',[4,1,0]) and vis != None): build 18-Sep-2019 23:19:13 + if (os.path.exists(vis)): build 18-Sep-2019 23:19:13 + needToClose = False build 18-Sep-2019 23:19:13 + if mymsmd is None or mymsmd == '': build 18-Sep-2019 23:19:13 + needToClose = True build 18-Sep-2019 23:19:13 + mymsmd = createCasaTool(msmdtool) build 18-Sep-2019 23:19:13 + mymsmd.open(vis) build 18-Sep-2019 23:19:13 + if (spwlist == []): build 18-Sep-2019 23:19:13 + nspws = mymsmd.nspw() build 18-Sep-2019 23:19:13 + spwlist = range(nspws) build 18-Sep-2019 23:19:13 + for spw in spwlist: build 18-Sep-2019 23:19:13 + bbc_no = mymsmd.baseband(spw) build 18-Sep-2019 23:19:13 + if (bbc_no not in bbdict.keys()): build 18-Sep-2019 23:19:13 + bbdict[bbc_no] = [spw] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + bbdict[bbc_no].append(spw) build 18-Sep-2019 23:19:13 + if needToClose: build 18-Sep-2019 23:19:13 + mymsmd.close() build 18-Sep-2019 23:19:13 + if (bbdict == {}): build 18-Sep-2019 23:19:13 + # read from spw table build 18-Sep-2019 23:19:13 + ubbs = np.unique(bbs) build 18-Sep-2019 23:19:13 + for bb in ubbs: build 18-Sep-2019 23:19:13 + bbdict[bb] = [] build 18-Sep-2019 23:19:13 + for i in range(len(bbs)): build 18-Sep-2019 23:19:13 + bbdict[bbs[i]].append(i) build 18-Sep-2019 23:19:13 + return(bbdict) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def getBasebandNumbersFromCaltable(caltable) : build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Returns the baseband numbers associated with each spw in build 18-Sep-2019 23:19:13 + the specified caltable. build 18-Sep-2019 23:19:13 + Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + if (os.path.exists(caltable) == False): build 18-Sep-2019 23:19:13 + print("getBasebandNumbersFromCaltable(): caltable set not found") build 18-Sep-2019 23:19:13 + return -1 build 18-Sep-2019 23:19:13 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:13 + mytb.open(caltable) build 18-Sep-2019 23:19:13 + spectralWindowTable = mytb.getkeyword('SPECTRAL_WINDOW').split()[1] build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + mytb.open(spectralWindowTable) build 18-Sep-2019 23:19:13 + if ("BBC_NO" in mytb.colnames()): build 18-Sep-2019 23:19:13 + bbNums = mytb.getcol("BBC_NO") build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + # until CAS-6853 is solved, need to get it from the name build 18-Sep-2019 23:19:13 +# print("BBC_NO not in colnames (CAS-6853). Using NAME column.") build 18-Sep-2019 23:19:13 + names = mytb.getcol('NAME') build 18-Sep-2019 23:19:13 + bbNums = [] build 18-Sep-2019 23:19:13 + trivial = True build 18-Sep-2019 23:19:13 + for name in names: build 18-Sep-2019 23:19:13 + if (name.find('#BB_') > 0): build 18-Sep-2019 23:19:13 + bbNums.append(int(name.split('#BB_')[1].split('#')[0])) build 18-Sep-2019 23:19:13 + trivial = False build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + bbNums.append(-1) build 18-Sep-2019 23:19:13 + if (trivial): bbNums = -1 build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + return bbNums build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def createCasaTool(mytool): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + A wrapper to handle the changing ways in which casa tools are invoked. build 18-Sep-2019 23:19:13 + Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + if (type(casac.Quantity) != type): # casa 4.x build 18-Sep-2019 23:19:13 + myt = mytool() build 18-Sep-2019 23:19:13 + else: # casa 3.x build 18-Sep-2019 23:19:13 + myt = mytool.create() build 18-Sep-2019 23:19:13 + return(myt) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def getLOs(inputMs, verbose=True): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Reads the LO information from an ms's ASDM_RECEIVER table. It returns build 18-Sep-2019 23:19:13 + a list of 7 lists: [freqLO,band,spws,names,sidebands,receiverIDs,spwnames] build 18-Sep-2019 23:19:13 + The logic for converting this raw list into sensible association with build 18-Sep-2019 23:19:13 + spw numbers is in printLOs(). These lists are longer than the true number build 18-Sep-2019 23:19:13 + of spws by Nantennas-1 due to the extra WVR spws. build 18-Sep-2019 23:19:13 + -Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + if (os.path.exists(inputMs)): build 18-Sep-2019 23:19:13 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:13 + if (os.path.exists("%s/ASDM_RECEIVER" % inputMs)): build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + mytb.open("%s/ASDM_RECEIVER" % inputMs) build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + print("Could not open the existing ASDM_RECEIVER table") build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + return([]) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (os.path.exists(inputMs+'/ASDMBinary')): build 18-Sep-2019 23:19:13 + print("This is an ASDM, not an ms! Use printLOsFromASDM.") build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("The ASDM_RECEIVER table for this ms does not exist.") build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + return([]) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + print("This ms does not exist = %s." % (inputMs)) build 18-Sep-2019 23:19:13 + return([]) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + numLO = mytb.getcol('numLO') build 18-Sep-2019 23:19:13 + freqLO = [] build 18-Sep-2019 23:19:13 + band = [] build 18-Sep-2019 23:19:13 + spws = [] build 18-Sep-2019 23:19:13 + names = [] build 18-Sep-2019 23:19:13 + sidebands = [] build 18-Sep-2019 23:19:13 + receiverIds = [] build 18-Sep-2019 23:19:13 + for i in range(len(numLO)): build 18-Sep-2019 23:19:13 + spw = int((mytb.getcell('spectralWindowId',i).split('_')[1])) build 18-Sep-2019 23:19:13 + if (spw not in spws): build 18-Sep-2019 23:19:13 + spws.append(spw) build 18-Sep-2019 23:19:13 + freqLO.append(mytb.getcell('freqLO',i)) build 18-Sep-2019 23:19:13 + band.append(mytb.getcell('frequencyBand',i)) build 18-Sep-2019 23:19:13 + names.append(mytb.getcell('name',i)) build 18-Sep-2019 23:19:13 + sidebands.append(mytb.getcell('sidebandLO',i)) build 18-Sep-2019 23:19:13 + receiverIds.append(int(mytb.getcell('receiverId',i))) build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + mytb.open("%s/SPECTRAL_WINDOW" % inputMs) build 18-Sep-2019 23:19:13 + spwNames = mytb.getcol("NAME") build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + return([freqLO,band,spws,names,sidebands,receiverIds,spwNames]) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def readPWVFromASDM_CALATMOSPHERE(vis): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Reads the PWV via the water column of the ASDM_CALATMOSPHERE table. build 18-Sep-2019 23:19:13 + - Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:13 + mytb.open("%s/ASDM_CALATMOSPHERE" % vis) build 18-Sep-2019 23:19:13 + pwvtime = mytb.getcol('startValidTime') # mjdsec build 18-Sep-2019 23:19:13 + antenna = mytb.getcol('antennaName') build 18-Sep-2019 23:19:13 + pwv = mytb.getcol('water')[0] # There seem to be 2 identical entries per row, so take first one. build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + return(pwvtime, antenna, pwv) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def getMedianPWV(vis='.', myTimes=[0,999999999999], asdm='', verbose=False): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Extracts the PWV measurements from the WVR on all antennas for the build 18-Sep-2019 23:19:13 + specified time range. The time range is input as a two-element list of build 18-Sep-2019 23:19:13 + MJD seconds (default = all times). First, it tries to find the ASDM_CALWVR build 18-Sep-2019 23:19:13 + table in the ms. If that fails, it then tries to find CalWVR.xml in the build 18-Sep-2019 23:19:13 + specified ASDM, or failing that, an ASDM of the same name (-.ms). If neither of build 18-Sep-2019 23:19:13 + these exist, then it tries to find CalWVR.xml in the present working directory. build 18-Sep-2019 23:19:13 + If it still fails, it looks for CalWVR.xml in the .ms directory. Thus, build 18-Sep-2019 23:19:13 + you only need to copy this xml file from the ASDM into your ms, rather build 18-Sep-2019 23:19:13 + than the entire ASDM. Returns the median and standard deviation in millimeters. build 18-Sep-2019 23:19:13 + For further help and examples, see https://safe.nrao.edu/wiki/bin/view/ALMA/GetMedianPWV build 18-Sep-2019 23:19:13 + -- Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + pwvmean = 0 build 18-Sep-2019 23:19:13 + success = False build 18-Sep-2019 23:19:13 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("in getMedianPWV with myTimes = %s" % (str(myTimes))) build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + if (os.path.exists("%s/ASDM_CALWVR"%vis)): build 18-Sep-2019 23:19:13 + mytb.open("%s/ASDM_CALWVR" % vis) build 18-Sep-2019 23:19:13 + pwvtime = mytb.getcol('startValidTime') # mjdsec build 18-Sep-2019 23:19:13 + antenna = mytb.getcol('antennaName') build 18-Sep-2019 23:19:13 + pwv = mytb.getcol('water') build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + success = True build 18-Sep-2019 23:19:13 + if (len(pwv) < 1): build 18-Sep-2019 23:19:13 + if (os.path.exists("%s/ASDM_CALATMOSPHERE" % vis)): build 18-Sep-2019 23:19:13 + pwvtime, antenna, pwv = readPWVFromASDM_CALATMOSPHERE(vis) build 18-Sep-2019 23:19:13 + success = True build 18-Sep-2019 23:19:13 + if (len(pwv) < 1): build 18-Sep-2019 23:19:13 + print("Found no data in ASDM_CALWVR nor ASDM_CALATMOSPHERE table") build 18-Sep-2019 23:19:13 + return(0,-1) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Did not find ASDM_CALATMOSPHERE in the ms") build 18-Sep-2019 23:19:13 + return(0,-1) build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Opened ASDM_CALWVR table, len(pwvtime)=%s" % (str(len(pwvtime)))) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Did not find ASDM_CALWVR table in the ms. Will look for ASDM_CALATMOSPHERE next.") build 18-Sep-2019 23:19:13 + if (os.path.exists("%s/ASDM_CALATMOSPHERE" % vis)): build 18-Sep-2019 23:19:13 + pwvtime, antenna, pwv = readPWVFromASDM_CALATMOSPHERE(vis) build 18-Sep-2019 23:19:13 + success = True build 18-Sep-2019 23:19:13 + if (len(pwv) < 1): build 18-Sep-2019 23:19:13 + print("Found no data in ASDM_CALATMOSPHERE table") build 18-Sep-2019 23:19:13 + return(0,-1) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Did not find ASDM_CALATMOSPHERE in the ms") build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Could not open ASDM_CALWVR table in the ms") build 18-Sep-2019 23:19:13 + finally: build 18-Sep-2019 23:19:13 + # try to find the ASDM table build 18-Sep-2019 23:19:13 + if (success == False): build 18-Sep-2019 23:19:13 + if (len(asdm) > 0): build 18-Sep-2019 23:19:13 + if (os.path.exists(asdm) == False): build 18-Sep-2019 23:19:13 + print("Could not open ASDM = %s" % (asdm)) build 18-Sep-2019 23:19:13 + mytb.done() build 18-Sep-2019 23:19:13 + return(0,-1) build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + [pwvtime,pwv,antenna] = readpwv(asdm) build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Could not open ASDM = %s" % (asdm)) build 18-Sep-2019 23:19:13 + mytb.done() build 18-Sep-2019 23:19:13 + return(pwvmean,-1) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + tryasdm = vis.split('.ms')[0] build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("No ASDM name provided, so I will try this name = %s" % (tryasdm)) build 18-Sep-2019 23:19:13 + [pwvtime,pwv,antenna] = readpwv(tryasdm) build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Still did not find it. Will look for CalWVR.xml in current directory.") build 18-Sep-2019 23:19:13 + [pwvtime, pwv, antenna] = readpwv('.') build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Still did not find it. Will look for CalWVR.xml in the .ms directory.") build 18-Sep-2019 23:19:13 + [pwvtime, pwv, antenna] = readpwv('%s/'%vis) build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("No CalWVR.xml file found, so no PWV retrieved. Copy it to this directory and try again.") build 18-Sep-2019 23:19:13 + mytb.done() build 18-Sep-2019 23:19:13 + return(pwvmean,-1) build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + matches = np.where(np.array(pwvtime)>myTimes[0])[0] build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + print("Found no times > %d" % (myTimes[0])) build 18-Sep-2019 23:19:13 + mytb.done() build 18-Sep-2019 23:19:13 + return(0,-1) build 18-Sep-2019 23:19:13 + if (len(pwv) < 1): build 18-Sep-2019 23:19:13 + print("Found no PWV data") build 18-Sep-2019 23:19:13 + return(0,-1) build 18-Sep-2019 23:19:13 + ptime = np.array(pwvtime)[matches] build 18-Sep-2019 23:19:13 + matchedpwv = np.array(pwv)[matches] build 18-Sep-2019 23:19:13 + matches2 = np.where(ptime0): build 18-Sep-2019 23:19:13 + tokens = scan.split('~') build 18-Sep-2019 23:19:13 + scan = [int(k) for k in range(int(tokens[0]),int(tokens[1])+1)] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + scan = [int(k) for k in scan.split(',')] build 18-Sep-2019 23:19:13 + if (type(scan) == type(np.ndarray(0))): build 18-Sep-2019 23:19:13 + scan = list(scan) build 18-Sep-2019 23:19:13 + if (type(scan) == list): build 18-Sep-2019 23:19:13 + myTimes = np.array([]) build 18-Sep-2019 23:19:13 + for sc in scan: build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + print("calling timesforscan") build 18-Sep-2019 23:19:13 + newTimes = mymsmd.timesforscan(sc) build 18-Sep-2019 23:19:13 + print("times = %s" % (str(newTimes))) build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + print("Error reading scan %d, is it in the data?" % (sc)) build 18-Sep-2019 23:19:13 + mytb.done() build 18-Sep-2019 23:19:13 + return([conditions,[]]) build 18-Sep-2019 23:19:13 + myTimes = np.concatenate((myTimes,newTimes)) build 18-Sep-2019 23:19:13 + elif (scan != None): build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + myTimes = mymsmd.timesforscan(scan) build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + print("Error reading scan %d, is it in the data?" % (scan)) build 18-Sep-2019 23:19:13 + mytb.done() build 18-Sep-2019 23:19:13 + return([conditions,[]]) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + mytb.done() build 18-Sep-2019 23:19:13 + return([conditions,[]]) build 18-Sep-2019 23:19:13 + if (type(scan) == str): build 18-Sep-2019 23:19:13 + scan = [int(k) for k in scan.split(',')] build 18-Sep-2019 23:19:13 + if (type(scan) == list): build 18-Sep-2019 23:19:13 + listscan = "" build 18-Sep-2019 23:19:13 + listfield = [] build 18-Sep-2019 23:19:13 + for sc in scan: build 18-Sep-2019 23:19:13 +# print("Processing scan ", sc) build 18-Sep-2019 23:19:13 + listfield.append(mymsmd.fieldsforscan(sc)) build 18-Sep-2019 23:19:13 + listscan += "%d" % sc build 18-Sep-2019 23:19:13 + if (sc != scan[-1]): build 18-Sep-2019 23:19:13 + listscan += "," build 18-Sep-2019 23:19:13 +# print("listfield = ", listfield) build 18-Sep-2019 23:19:13 + listfields = np.unique(listfield[0]) build 18-Sep-2019 23:19:13 + listfield = "" build 18-Sep-2019 23:19:13 + for field in listfields: build 18-Sep-2019 23:19:13 + listfield += "%s" % field build 18-Sep-2019 23:19:13 + if (field != listfields[-1]): build 18-Sep-2019 23:19:13 + listfield += "," build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + listscan = str(scan) build 18-Sep-2019 23:19:13 + listfield = mymsmd.fieldsforscan(scan) build 18-Sep-2019 23:19:13 + [az,el] = ComputeSolarAzElForObservatory(myTimes[0], mymsmd) build 18-Sep-2019 23:19:13 + [az2,el2] = ComputeSolarAzElForObservatory(myTimes[-1], mymsmd) build 18-Sep-2019 23:19:13 + azsun = np.mean([az,az2]) build 18-Sep-2019 23:19:13 + elsun = np.mean([el,el2]) build 18-Sep-2019 23:19:13 + direction = subtable.getcol("DIRECTION") build 18-Sep-2019 23:19:13 + azeltime = subtable.getcol("TIME") build 18-Sep-2019 23:19:13 + subtable.close() build 18-Sep-2019 23:19:13 + telescopeName = mymsmd.observatorynames()[0] build 18-Sep-2019 23:19:13 + if (len(direction) > 0 and telescopeName.find('VLA') < 0 and telescopeName.find('NRO') < 0): build 18-Sep-2019 23:19:13 + azimuth = direction[0][0]*180.0/math.pi # a list of values build 18-Sep-2019 23:19:13 + elevation = direction[1][0]*180.0/math.pi # a list of values build 18-Sep-2019 23:19:13 + npat = np.array(azeltime) build 18-Sep-2019 23:19:13 + matches = np.where(npat>myTimes[0])[0] build 18-Sep-2019 23:19:13 + matches2 = np.where(npat 0 and len(matches) > 0): build 18-Sep-2019 23:19:13 + if verbose: print("matches[0]=%d, matches2[-1]=%d" % (matches[0],matches[-1])) build 18-Sep-2019 23:19:13 + matchingIndices = range(matches[0],matches2[-1]+1) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + matchingIndices = [] build 18-Sep-2019 23:19:13 + if (len(matchingIndices) > 0): # CAS-8440 build 18-Sep-2019 23:19:13 + conditions['azimuth'] = np.mean(azimuth[matches[0]:matches2[-1]+1]) build 18-Sep-2019 23:19:13 + conditions['elevation'] = np.mean(elevation[matches[0]:matches2[-1]+1]) build 18-Sep-2019 23:19:13 + elif (len(matches) > 0): # CAS-8440 build 18-Sep-2019 23:19:13 + if verbose: print("using mean of all az/el values after time 0") build 18-Sep-2019 23:19:13 + conditions['azimuth'] = np.mean(azimuth[matches[0]]) build 18-Sep-2019 23:19:13 + conditions['elevation'] = np.mean(elevation[matches[0]]) build 18-Sep-2019 23:19:13 + else: # CAS-8440 build 18-Sep-2019 23:19:13 + if verbose: print("using mean of all az/el values") build 18-Sep-2019 23:19:13 + conditions['azimuth'] = np.mean(azimuth) build 18-Sep-2019 23:19:13 + conditions['elevation'] = np.mean(elevation) build 18-Sep-2019 23:19:13 + conditions['solarangle'] = angularSeparation(azsun,elsun,conditions['azimuth'],conditions['elevation']) build 18-Sep-2019 23:19:13 + conditions['solarelev'] = elsun build 18-Sep-2019 23:19:13 + conditions['solarazim'] = azsun build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Using antenna = %s to retrieve mean azimuth and elevation" % (antennaName)) build 18-Sep-2019 23:19:13 + print("Separation from sun = %f deg" % (abs(conditions['solarangle']))) build 18-Sep-2019 23:19:13 + if (elsun<0): build 18-Sep-2019 23:19:13 + conditions['solarangle'] = -conditions['solarangle'] build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Sun is below horizon (elev=%.1f deg)" % (elsun)) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Sun is above horizon (elev=%.1f deg)" % (elsun)) build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Average azimuth = %.2f, elevation = %.2f degrees" % (conditions['azimuth'],conditions['elevation'])) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (verbose): print("The POINTING table is either blank or does not contain Azim/Elev.") build 18-Sep-2019 23:19:13 + if (type(scan) == int or type(scan)==np.int32): build 18-Sep-2019 23:19:13 + # compute Az/El for this scan build 18-Sep-2019 23:19:13 + myfieldId = mymsmd.fieldsforscan(scan) build 18-Sep-2019 23:19:13 + if (type(myfieldId) == list or type(myfieldId) == type(np.ndarray(0))): build 18-Sep-2019 23:19:13 + myfieldId = myfieldId[0] build 18-Sep-2019 23:19:13 + fieldName = mymsmd.namesforfields(myfieldId) build 18-Sep-2019 23:19:13 + if (type(fieldName) == list or type(fieldName) == type(np.ndarray(0))): build 18-Sep-2019 23:19:13 + fieldName = fieldName[0] build 18-Sep-2019 23:19:13 +# print("A) fieldname = ", fieldName) build 18-Sep-2019 23:19:13 +# print("myfieldId = ", myfieldId) build 18-Sep-2019 23:19:13 + myscantime = np.mean(mymsmd.timesforscan(scan)) build 18-Sep-2019 23:19:13 +# print("Calling getRADecForField") build 18-Sep-2019 23:19:13 + mydirection = getRADecForField(vis, myfieldId, verbose) build 18-Sep-2019 23:19:13 + if (verbose): print("mydirection= %s" % (str(mydirection))) build 18-Sep-2019 23:19:13 + if (len(telescopeName) < 1): build 18-Sep-2019 23:19:13 + telescopeName = 'ALMA' build 18-Sep-2019 23:19:13 + myazel = computeAzElFromRADecMJD(mydirection, myscantime/86400., telescopeName) build 18-Sep-2019 23:19:13 + conditions['elevation'] = myazel[1] * 180/math.pi build 18-Sep-2019 23:19:13 + conditions['azimuth'] = myazel[0] * 180/math.pi build 18-Sep-2019 23:19:13 + conditions['solarangle'] = angularSeparation(azsun,elsun,conditions['azimuth'],conditions['elevation']) build 18-Sep-2019 23:19:13 + conditions['solarelev'] = elsun build 18-Sep-2019 23:19:13 + conditions['solarazim'] = azsun build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Separation from sun = %f deg" % (abs(conditions['solarangle']))) build 18-Sep-2019 23:19:13 + if (elsun<0): build 18-Sep-2019 23:19:13 + conditions['solarangle'] = -conditions['solarangle'] build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Sun is below horizon (elev=%.1f deg)" % (elsun)) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Sun is above horizon (elev=%.1f deg)" % (elsun)) build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Average azimuth = %.2f, elevation = %.2f degrees" % (conditions['azimuth'],conditions['elevation'])) build 18-Sep-2019 23:19:13 + elif (type(scan) == list): build 18-Sep-2019 23:19:13 + myaz = [] build 18-Sep-2019 23:19:13 + myel = [] build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Scans to loop over = %s" % (str(scan))) build 18-Sep-2019 23:19:13 + for s in scan: build 18-Sep-2019 23:19:13 + fieldName = mymsmd.fieldsforscan(s) build 18-Sep-2019 23:19:13 + if (type(fieldName) == list): build 18-Sep-2019 23:19:13 + # take only the first pointing in the mosaic build 18-Sep-2019 23:19:13 + fieldName = fieldName[0] build 18-Sep-2019 23:19:13 + myfieldId = mymsmd.fieldsforname(fieldName) build 18-Sep-2019 23:19:13 + if (type(myfieldId) == list or type(myfieldId)==type(np.ndarray(0))): build 18-Sep-2019 23:19:13 + # If the same field name has two IDs (this happens in EVLA data) build 18-Sep-2019 23:19:13 + myfieldId = myfieldId[0] build 18-Sep-2019 23:19:13 + myscantime = np.mean(mymsmd.timesforscan(s)) build 18-Sep-2019 23:19:13 + mydirection = getRADecForField(vis, myfieldId, verbose) build 18-Sep-2019 23:19:13 + telescopeName = mymsmd.observatorynames()[0] build 18-Sep-2019 23:19:13 + if (len(telescopeName) < 1): build 18-Sep-2019 23:19:13 + telescopeName = 'ALMA' build 18-Sep-2019 23:19:13 + myazel = computeAzElFromRADecMJD(mydirection, myscantime/86400., telescopeName) build 18-Sep-2019 23:19:13 + myaz.append(myazel[0]*180/math.pi) build 18-Sep-2019 23:19:13 + myel.append(myazel[1]*180/math.pi) build 18-Sep-2019 23:19:13 + conditions['azimuth'] = np.mean(myaz) build 18-Sep-2019 23:19:13 + conditions['elevation'] = np.mean(myel) build 18-Sep-2019 23:19:13 + conditions['solarangle'] = angularSeparation(azsun,elsun,conditions['azimuth'],conditions['elevation']) build 18-Sep-2019 23:19:13 + conditions['solarelev'] = elsun build 18-Sep-2019 23:19:13 + conditions['solarazim'] = azsun build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Using antenna = %s to retrieve mean azimuth and elevation" % (antennaName)) build 18-Sep-2019 23:19:13 + print("Separation from sun = %f deg" % (abs(conditions['solarangle']))) build 18-Sep-2019 23:19:13 + if (elsun<0): build 18-Sep-2019 23:19:13 + conditions['solarangle'] = -conditions['solarangle'] build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Sun is below horizon (elev=%.1f deg)" % (elsun)) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Sun is above horizon (elev=%.1f deg)" % (elsun)) build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Average azimuth = %.2f, elevation = %.2f degrees" % (conditions['azimuth'],conditions['elevation'])) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # now, get the weather build 18-Sep-2019 23:19:13 + if not os.path.exists('%s/WEATHER' % vis): build 18-Sep-2019 23:19:13 + print("There is no WEATHER table for this ms.") build 18-Sep-2019 23:19:13 + if (needToClose_mymsmd): mymsmd.close() build 18-Sep-2019 23:19:13 + return([conditions,myTimes]) build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + mytb.open("%s/WEATHER" % vis) build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + print("Could not open the WEATHER table for this ms.") build 18-Sep-2019 23:19:13 + mytb.done() build 18-Sep-2019 23:19:13 + return([conditions,myTimes]) build 18-Sep-2019 23:19:13 + if (True): build 18-Sep-2019 23:19:13 + mjdsec = mytb.getcol('TIME') build 18-Sep-2019 23:19:13 + indices = np.argsort(mjdsec) build 18-Sep-2019 23:19:13 + mjd = mjdsec/86400. build 18-Sep-2019 23:19:13 + pressure = mytb.getcol('PRESSURE') build 18-Sep-2019 23:19:13 + relativeHumidity = mytb.getcol('REL_HUMIDITY') build 18-Sep-2019 23:19:13 + temperature = mytb.getcol('TEMPERATURE') build 18-Sep-2019 23:19:13 + if (np.mean(temperature) > 100): build 18-Sep-2019 23:19:13 + # must be in units of Kelvin, so convert to C build 18-Sep-2019 23:19:13 + temperature -= 273.15 build 18-Sep-2019 23:19:13 + if 'DEW_POINT' in mytb.colnames(): build 18-Sep-2019 23:19:13 + dewPoint = mytb.getcol('DEW_POINT') build 18-Sep-2019 23:19:13 + if (np.mean(dewPoint) > 100): build 18-Sep-2019 23:19:13 + # must be in units of Kelvin, so convert to C build 18-Sep-2019 23:19:13 + dewPoint -= 273.15 build 18-Sep-2019 23:19:13 + if (np.mean(dewPoint) == 0): build 18-Sep-2019 23:19:13 + # assume it is not measured and use NOAA formula to compute from humidity: build 18-Sep-2019 23:19:13 + dewPoint = ComputeDewPointCFromRHAndTempC(relativeHumidity, temperature) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + dewPoint = None # Nobeyama measurement sets do not have a dewpoint column build 18-Sep-2019 23:19:13 + sinWindDirection = np.sin(mytb.getcol('WIND_DIRECTION')) build 18-Sep-2019 23:19:13 + cosWindDirection = np.cos(mytb.getcol('WIND_DIRECTION')) build 18-Sep-2019 23:19:13 + windSpeed = mytb.getcol('WIND_SPEED') build 18-Sep-2019 23:19:13 + mytb.done() build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # put values into time order (they mostly are, but there can be small differences) build 18-Sep-2019 23:19:13 + mjdsec = np.array(mjdsec)[indices] build 18-Sep-2019 23:19:13 + pressure = np.array(pressure)[indices] build 18-Sep-2019 23:19:13 + relativeHumidity = np.array(relativeHumidity)[indices] build 18-Sep-2019 23:19:13 + temperature = np.array(temperature)[indices] build 18-Sep-2019 23:19:13 + if dewPoint is not None: build 18-Sep-2019 23:19:13 + dewPoint = np.array(dewPoint)[indices] build 18-Sep-2019 23:19:13 + windSpeed = np.array(windSpeed)[indices] build 18-Sep-2019 23:19:13 + sinWindDirection = np.array(sinWindDirection)[indices] build 18-Sep-2019 23:19:13 + cosWindDirection = np.array(cosWindDirection)[indices] build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # find the overlap of weather measurement times and scan times build 18-Sep-2019 23:19:13 + matches = np.where(mjdsec>=np.min(myTimes))[0] build 18-Sep-2019 23:19:13 + matches2 = np.where(mjdsec<=np.max(myTimes))[0] build 18-Sep-2019 23:19:13 +# print("len(matches)=%d, len(matches2)=%d" % (len(matches), len(matches2))) build 18-Sep-2019 23:19:13 + noWeatherData = False build 18-Sep-2019 23:19:13 + if (len(matches)>0 and len(matches2) > 0): build 18-Sep-2019 23:19:13 + # average the weather points enclosed by the scan time range build 18-Sep-2019 23:19:13 + selectedValues = range(matches[0], matches2[-1]+1) build 18-Sep-2019 23:19:13 + if (selectedValues == []): build 18-Sep-2019 23:19:13 + # there was a either gap in the weather data, or an incredibly short scan duration build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("---- Finding the nearest weather value --------------------------- ") build 18-Sep-2019 23:19:13 + selectedValues = findClosestTime(mjdsec, myTimes[0]) build 18-Sep-2019 23:19:13 + elif (len(matches)>0): build 18-Sep-2019 23:19:13 + # all points are greater than myTime, so take the first one build 18-Sep-2019 23:19:13 + selectedValues = matches[0] build 18-Sep-2019 23:19:13 + elif (len(matches2)>0): build 18-Sep-2019 23:19:13 + # all points are less than myTime, so take the last one build 18-Sep-2019 23:19:13 + selectedValues = matches2[-1] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + # table has no weather data! build 18-Sep-2019 23:19:13 + noWeatherData = True build 18-Sep-2019 23:19:13 + if (noWeatherData): build 18-Sep-2019 23:19:13 + conditions['pressure'] = 563.0 build 18-Sep-2019 23:19:13 + conditions['temperature'] = 0 # Celsius is expected build 18-Sep-2019 23:19:13 + conditions['humidity'] = 20.0 build 18-Sep-2019 23:19:13 + conditions['dewpoint'] = -20.0 build 18-Sep-2019 23:19:13 + conditions['windspeed'] = 0 build 18-Sep-2019 23:19:13 + conditions['winddirection'] = 0 build 18-Sep-2019 23:19:13 + print("WARNING: No weather data found in the WEATHER table!") build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + if (type(selectedValues) == np.int64 or type(selectedValues) == np.int32 or build 18-Sep-2019 23:19:13 + type(selectedValues) == np.int): build 18-Sep-2019 23:19:13 + conditions['readings'] = 1 build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("selectedValues=%d, myTimes[0]=%.0f, myTimes[1]=%.0f, len(matches)=%d, len(matches2)=%d" % (selectedValues, build 18-Sep-2019 23:19:13 + myTimes[0],myTimes[1], len(matches), len(matches2))) build 18-Sep-2019 23:19:13 + if (len(matches) > 0): build 18-Sep-2019 23:19:13 + print("matches[0]=%f, matches[-1]=%f" % (matches[0], matches[-1])) build 18-Sep-2019 23:19:13 + if (len(matches2) > 0): build 18-Sep-2019 23:19:13 + print("matches2[0]=%f, matches2[-1]=%d" % (matches2[0], matches2[-1])) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + conditions['readings'] = len(selectedValues) build 18-Sep-2019 23:19:13 + conditions['pressure'] = np.mean(pressure[selectedValues]) build 18-Sep-2019 23:19:13 + if (conditions['pressure'] != conditions['pressure']): build 18-Sep-2019 23:19:13 + # A nan value got through, due to no selected values (should be impossible)" build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print(">>>>>>>>>>>>>>>>>>>>>>>> selectedValues = %s" % (str(selectedValues))) build 18-Sep-2019 23:19:13 + print("len(matches)=%d, len(matches2)=%d" % (len(matches), len(matches2))) build 18-Sep-2019 23:19:13 + print("matches[0]=%f, matches[-1]=%f, matches2[0]=%f, matches2[-1]=%d" % (matches[0], matches[-1], matches2[0], matches2[-1])) build 18-Sep-2019 23:19:13 + conditions['temperature'] = np.mean(temperature[selectedValues]) build 18-Sep-2019 23:19:13 + conditions['humidity'] = np.mean(relativeHumidity[selectedValues]) build 18-Sep-2019 23:19:13 + if dewPoint is not None: build 18-Sep-2019 23:19:13 + conditions['dewpoint'] = np.mean(dewPoint[selectedValues]) build 18-Sep-2019 23:19:13 + conditions['windspeed'] = np.mean(windSpeed[selectedValues]) build 18-Sep-2019 23:19:13 + conditions['winddirection'] = (180./math.pi)*np.arctan2(np.mean(sinWindDirection[selectedValues]),np.mean(cosWindDirection[selectedValues])) build 18-Sep-2019 23:19:13 + if (conditions['winddirection'] < 0): build 18-Sep-2019 23:19:13 + conditions['winddirection'] += 360 build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Mean weather values for scan %s (field %s)" % (listscan,listfield)) build 18-Sep-2019 23:19:13 + print(" Pressure = %.2f mb" % (conditions['pressure'])) build 18-Sep-2019 23:19:13 + print(" Temperature = %.2f C" % (conditions['temperature'])) build 18-Sep-2019 23:19:13 + if dewPoint is not None: build 18-Sep-2019 23:19:13 + print(" Dew point = %.2f C" % (conditions['dewpoint'])) build 18-Sep-2019 23:19:13 + print(" Relative Humidity = %.2f %%" % (conditions['humidity'])) build 18-Sep-2019 23:19:13 + print(" Wind speed = %.2f m/s" % (conditions['windspeed'])) build 18-Sep-2019 23:19:13 + print(" Wind direction = %.2f deg" % (conditions['winddirection'])) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + return([conditions,myTimes]) build 18-Sep-2019 23:19:13 + # end of getWeather build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def getBasebandNumbers(inputMs) : build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Returns the baseband numbers associated with each spw in the specified ms. build 18-Sep-2019 23:19:13 + Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + if (os.path.exists(inputMs) == False): build 18-Sep-2019 23:19:13 + print("measurement set not found") build 18-Sep-2019 23:19:13 + return -1 build 18-Sep-2019 23:19:13 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:13 + mytb.open("%s/SPECTRAL_WINDOW" % inputMs) build 18-Sep-2019 23:19:13 + if ("BBC_NO" in mytb.colnames()): build 18-Sep-2019 23:19:13 + bbNums = mytb.getcol("BBC_NO") build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + return(-1) build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + return bbNums build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def yigHarmonic(bandString): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Returns the YIG harmonic for the specified ALMA band, given as a string build 18-Sep-2019 23:19:13 + used in casa tables. build 18-Sep-2019 23:19:13 + For example: yigHarmonic('ALMA_RB_03') returns the integer 6. build 18-Sep-2019 23:19:13 + Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + # remove any leading spaces build 18-Sep-2019 23:19:13 + #bandString = bandString[bandString.find('ALMA_RB'):] build 18-Sep-2019 23:19:13 + harmonics = {'ALMA_RB_03':6, 'ALMA_RB_04':6, 'ALMA_RB_06': 18, build 18-Sep-2019 23:19:13 + 'ALMA_RB_07': 18, 'ALMA_RB_08':18, 'ALMA_RB_09':27} build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + harmonic = harmonics[bandString] build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + harmonic = -1 build 18-Sep-2019 23:19:13 + return(harmonic) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def interpretLOs(vis, parentms='', showWVR=False, build 18-Sep-2019 23:19:13 + showCentralFreq=False, verbose=False, show=False, build 18-Sep-2019 23:19:13 + alsoReturnLO2=False, showChannelAverageSpws=False, build 18-Sep-2019 23:19:13 + showOnlyScienceSpws=False, birdieFreq=None, birdieSpw=None, build 18-Sep-2019 23:19:13 + intent='OBSERVE_TARGET#ON_SOURCE', spwsForIntent=None, build 18-Sep-2019 23:19:13 + showEffective=False, showWindowFactors=False, mymsmd=None): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Copied from analysisUtils on May 16, 2017, to replace old version, in order build 18-Sep-2019 23:19:13 + to fix SCOPS-4877. build 18-Sep-2019 23:19:13 + Interpret (and optionally print) the LO settings for an MS from the build 18-Sep-2019 23:19:13 + ASDM_RECEIVER table. build 18-Sep-2019 23:19:13 + Options: build 18-Sep-2019 23:19:13 + showCentralFreq: if True, then show the mean frequency of each spw, build 18-Sep-2019 23:19:13 + otherwise show the frequency of the first channel build 18-Sep-2019 23:19:13 + showWVR: include the WVR spw in the list build 18-Sep-2019 23:19:13 + parentms: if the dataset has been split from a parent dataset, then build 18-Sep-2019 23:19:13 + you may also need to specify the name of the parent ms. build 18-Sep-2019 23:19:13 + alsoReturnLO2: if True, return a second dictionary of the LO2 values build 18-Sep-2019 23:19:13 + birdieFreq: if specified, compute the IF of this RF feature build 18-Sep-2019 23:19:13 + birdieSpw: only necessary if more than one LO1 in the science spws build 18-Sep-2019 23:19:13 + intent: which intent to use in spwsforintent (to find science spws) build 18-Sep-2019 23:19:13 + spwsForIntent: if specified, then avoid the call to spwsforintent build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + Returns: a dictionary of the LO1 values (in Hz) for each spw, keyed by build 18-Sep-2019 23:19:13 + integer. build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + A typical band 7 TDM dataset (prior to splitting) looks like this: build 18-Sep-2019 23:19:13 + SPECTRAL_WINDOW table has 39 rows: row build 18-Sep-2019 23:19:13 + WVR 0 build 18-Sep-2019 23:19:13 + 8 band 3 windows (pointing) 1-8 build 18-Sep-2019 23:19:13 + 8 band 7 windows 9-16 build 18-Sep-2019 23:19:13 + 22 WVR windows 17-38 build 18-Sep-2019 23:19:13 + The corresponding ASDM_RECEIVER table has only 18 rows: build 18-Sep-2019 23:19:13 + WVR 0 build 18-Sep-2019 23:19:13 + 8 band 3 windows 1-8 build 18-Sep-2019 23:19:13 + WVR 9 build 18-Sep-2019 23:19:13 + 8 band 7 windows 10-17 build 18-Sep-2019 23:19:13 + After splitting, the ASDM_RECEIVER table remains the same, but the build 18-Sep-2019 23:19:13 + SPECTRAL WINDOW table then has only 4 rows, as the pointing spws and build 18-Sep-2019 23:19:13 + the channel-averaged data are dropped: build 18-Sep-2019 23:19:13 + 4 band 7 windows build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + lo1s = {} # initialize dictionary to be returned build 18-Sep-2019 23:19:13 + lo2s = {} build 18-Sep-2019 23:19:13 + try: build 18-Sep-2019 23:19:13 + retval = getLOs(vis) build 18-Sep-2019 23:19:13 + [LOs,bands,spws,names,sidebands,receiverIds,spwNames] = retval build 18-Sep-2019 23:19:13 + except: build 18-Sep-2019 23:19:13 + print("getLOs failed") build 18-Sep-2019 23:19:13 + return(retval) build 18-Sep-2019 23:19:13 + if (verbose): print("len(spws) = %d: %s" % (len(spws), str(spws))) build 18-Sep-2019 23:19:13 + maxSpw = np.max(spws) build 18-Sep-2019 23:19:13 + sawWVR = False build 18-Sep-2019 23:19:13 + indices = [] # will exclude the extraneous WVR spws build 18-Sep-2019 23:19:13 + for i in range(len(spws)): build 18-Sep-2019 23:19:13 + if (names[i].find('WVR') >= 0): build 18-Sep-2019 23:19:13 + if (not sawWVR): build 18-Sep-2019 23:19:13 + indices.append(i) build 18-Sep-2019 23:19:13 + sawWVR = True build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + indices.append(i) build 18-Sep-2019 23:19:13 + LOs = np.array(LOs)[indices] build 18-Sep-2019 23:19:13 + bands = np.array(bands)[indices] build 18-Sep-2019 23:19:13 + spws = list(np.array(spws)[indices]) build 18-Sep-2019 23:19:13 + names = np.array(names)[indices] build 18-Sep-2019 23:19:13 + sidebands = np.array(sidebands)[indices] build 18-Sep-2019 23:19:13 + receiverIds = np.array(receiverIds)[indices] build 18-Sep-2019 23:19:13 + index = range(len(spws)) build 18-Sep-2019 23:19:13 + mytb = createCasaTool(tbtool) build 18-Sep-2019 23:19:13 + mytb.open(vis+'/SPECTRAL_WINDOW') build 18-Sep-2019 23:19:13 + # If the data have been split into an ms with fewer spws, then this build 18-Sep-2019 23:19:13 + # table will be smaller (in rows) than the parent MS's table. build 18-Sep-2019 23:19:13 + spwNames = mytb.getcol('NAME') build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + splitted = False build 18-Sep-2019 23:19:13 + if (maxSpw != len(spwNames)-1): build 18-Sep-2019 23:19:13 + splitted = True build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("maxSpw=%d != len(spwNames)=%d)" % (maxSpw, len(spwNames))) build 18-Sep-2019 23:19:13 + if (parentms == '' or parentms == None): build 18-Sep-2019 23:19:13 + print("You appear to have split these data. Please provide the parentms as an argument.") build 18-Sep-2019 23:19:13 + return build 18-Sep-2019 23:19:13 + mytb.open(parentms+'/SPECTRAL_WINDOW') build 18-Sep-2019 23:19:13 + parentSpwNames = mytb.getcol('NAME') build 18-Sep-2019 23:19:13 + mytb.close() build 18-Sep-2019 23:19:13 + extractedRows = [] build 18-Sep-2019 23:19:13 + index = [] build 18-Sep-2019 23:19:13 + for s in range(len(spwNames)): build 18-Sep-2019 23:19:13 + if (len(spwNames[s]) == 0): build 18-Sep-2019 23:19:13 + print("This is an old dataset lacking values in the NAME column of the SPECTRAL_WINDOW table.") build 18-Sep-2019 23:19:13 + return build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("Checking for %s in " % (spwNames[s]), parentSpwNames) build 18-Sep-2019 23:19:13 + extractedRows.append(np.where(parentSpwNames == spwNames[s])[0][0]) build 18-Sep-2019 23:19:13 + index.append(spws.index(extractedRows[-1])) build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("spw %d came from spw %d" % (s, extractedRows[-1])) build 18-Sep-2019 23:19:13 +# extractedRows = the row of the parent SPECTRAL_WINDOW table that matches build 18-Sep-2019 23:19:13 +# the split-out spw build 18-Sep-2019 23:19:13 +# index = the row of the ASDM_RECEIVER table that matches the split-out spw build 18-Sep-2019 23:19:13 + vis = parentms build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("spwNames = ", spwNames) build 18-Sep-2019 23:19:13 + print("spws = ", spws) build 18-Sep-2019 23:19:13 + print("bands = ", bands) build 18-Sep-2019 23:19:13 + output = "LOs = " build 18-Sep-2019 23:19:13 + for LO in LOs: build 18-Sep-2019 23:19:13 + output += "%.3f, " % (LO[0]*1e-9) build 18-Sep-2019 23:19:13 + print(output) build 18-Sep-2019 23:19:13 + print("names = ", names) build 18-Sep-2019 23:19:13 + print("index = ", index) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + bbc = getBasebandNumbers(vis) # does not use msmd build 18-Sep-2019 23:19:13 + if (show): build 18-Sep-2019 23:19:13 + print('Row refers to the row number in the ASDM_RECEIVER table (starting at 0).') build 18-Sep-2019 23:19:13 + if (showCentralFreq): build 18-Sep-2019 23:19:13 + myline = 'Row spw BB RxBand CenFreq Nchan LO1(GHz) LO2(GHz) Sampler YIG(GHz) TFBoffset(MHz)' build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + myline = 'Row spw BB RxBand Ch1Freq Nchan LO1(GHz) LO2(GHz) Sampler YIG(GHz) TFBoffset(MHz)' build 18-Sep-2019 23:19:13 + if (showEffective): build 18-Sep-2019 23:19:13 + myline += ' Eff.BW(MHz) Res(MHz) Width(MHz)' build 18-Sep-2019 23:19:13 + if (showWindowFactors): build 18-Sep-2019 23:19:13 + myline += ' windowFactors' build 18-Sep-2019 23:19:13 + print(myline) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # Loop over all rows in the ASDM_RECEIVER table, unless we've split, in build 18-Sep-2019 23:19:13 + # which case this will loop over the N spws in the table. build 18-Sep-2019 23:19:13 + needToClose = False build 18-Sep-2019 23:19:13 + if mymsmd is None or mymsmd == '': build 18-Sep-2019 23:19:13 + mymsmd = createCasaTool(msmdtool) build 18-Sep-2019 23:19:13 + mymsmd.open(vis) build 18-Sep-2019 23:19:13 + needToClose = True build 18-Sep-2019 23:19:13 + if (spwsForIntent == None): build 18-Sep-2019 23:19:13 + if intent in mymsmd.intents(): # prevent a warning of OBSERVE_TARGET does not exist build 18-Sep-2019 23:19:13 + scienceSpws = np.setdiff1d(mymsmd.spwsforintent(intent),mymsmd.wvrspws()) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + scienceSpws = [] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + scienceSpws = spwsForIntent build 18-Sep-2019 23:19:13 + birdieIF = 0 build 18-Sep-2019 23:19:13 + if (birdieFreq is not None): build 18-Sep-2019 23:19:13 + birdieFreq = parseFrequencyArgumentToHz(birdieFreq) build 18-Sep-2019 23:19:13 + birdieFreqGHz = parseFrequencyArgumentToGHz(birdieFreq) build 18-Sep-2019 23:19:13 + fdmSpws = mymsmd.almaspws(fdm=True) build 18-Sep-2019 23:19:13 + for i in range(len(index)): build 18-Sep-2019 23:19:13 + if (verbose): build 18-Sep-2019 23:19:13 + print("index[%d]=%d" % (i,index[i])) build 18-Sep-2019 23:19:13 + print("spws[%d] = %d" % (index[i], spws[index[i]])) build 18-Sep-2019 23:19:13 + myspw = i build 18-Sep-2019 23:19:13 + if (birdieFreq is not None and birdieIF == 0): build 18-Sep-2019 23:19:13 + if (myspw == birdieSpw): build 18-Sep-2019 23:19:13 + if verbose: build 18-Sep-2019 23:19:13 + print("spw=%d, Computing IF = %f - %f" % (myspw, birdieFreq, LOs[index[i]][0])) build 18-Sep-2019 23:19:13 + birdieIF = np.fabs(birdieFreq - LOs[index[i]][0]) build 18-Sep-2019 23:19:13 + elif (myspw in scienceSpws and birdieSpw==None): build 18-Sep-2019 23:19:13 + if verbose: build 18-Sep-2019 23:19:13 + print("spw=%d (in %s), Computing IF = %f - %f" % (myspw, str(scienceSpws), birdieFreq, LOs[index[i]][0])) build 18-Sep-2019 23:19:13 + birdieIF = np.fabs(birdieFreq - LOs[index[i]][0]) build 18-Sep-2019 23:19:13 + freqs = mymsmd.chanfreqs(myspw) build 18-Sep-2019 23:19:13 + meanFreqGHz = mymsmd.meanfreq(myspw) * (1e-9) build 18-Sep-2019 23:19:13 + if (myspw not in scienceSpws and showOnlyScienceSpws): continue build 18-Sep-2019 23:19:13 + if (len(freqs) < 2 and showChannelAverageSpws==False): build 18-Sep-2019 23:19:13 + continue build 18-Sep-2019 23:19:13 + if (bands[index[i]].split('_')[-1].isdigit()): build 18-Sep-2019 23:19:13 + rxband = bands[index[i]].split('_')[-1] build 18-Sep-2019 23:19:13 + elif (showWVR): build 18-Sep-2019 23:19:13 + rxband = 'WVR' build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + continue build 18-Sep-2019 23:19:13 + line = "%2d %2d %d %3s " % (spws[index[i]], myspw, bbc[myspw], rxband) build 18-Sep-2019 23:19:13 + if (showCentralFreq): build 18-Sep-2019 23:19:13 + line += "%10.6f %4d " % (meanFreqGHz,len(freqs)) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + line += "%10.6f %4d " % (freqs[0],len(freqs)) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (LOs[index[i]][0] < 0): build 18-Sep-2019 23:19:13 + print(line) build 18-Sep-2019 23:19:13 + continue build 18-Sep-2019 23:19:13 + if (bbc[myspw] > 0): build 18-Sep-2019 23:19:13 + if (splitted): build 18-Sep-2019 23:19:13 + lo1s[i] = LOs[index[i]][0] build 18-Sep-2019 23:19:13 + lo2s[i] = LOs[index[i]][1] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + lo1s[myspw] = LOs[index[i]][0] build 18-Sep-2019 23:19:13 + lo2s[myspw] = LOs[index[i]][1] build 18-Sep-2019 23:19:13 + for j in range(len(LOs[index[i]])): build 18-Sep-2019 23:19:13 + if (j != 2): build 18-Sep-2019 23:19:13 + line = line + '%10.6f' % (LOs[index[i]][j]*1e-9) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + line = line + '%5.2f' % (LOs[index[i]][j]*1e-9) build 18-Sep-2019 23:19:13 + yig = LOs[index[i]][0] / yigHarmonic(bands[index[i]]) build 18-Sep-2019 23:19:13 + if (yig > 0): build 18-Sep-2019 23:19:13 + line = line + ' %.6f' % (yig*1e-9) build 18-Sep-2019 23:19:13 + if (myspw in fdmSpws): build 18-Sep-2019 23:19:13 + # work out what LO4 must have been build 18-Sep-2019 23:19:13 + LO1 = LOs[index[i]][0] build 18-Sep-2019 23:19:13 + LO2 = LOs[index[i]][1] build 18-Sep-2019 23:19:13 + LO3 = LOs[index[i]][2] build 18-Sep-2019 23:19:13 + if (sidebands[index[i]][0] == 'USB'): build 18-Sep-2019 23:19:13 + IFlocation = LO3 - (LO2 - (meanFreqGHz*1e9 - LO1)) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + IFlocation = LO3 - (LO2 - (LO1 - meanFreqGHz*1e9)) build 18-Sep-2019 23:19:13 + LO4 = 2e9 + IFlocation build 18-Sep-2019 23:19:13 + TFBLOoffset = LO4-3e9 build 18-Sep-2019 23:19:13 + line += '%9.3f %+8.3f ' % (LO4 * 1e-6, TFBLOoffset * 1e-6) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + line += 19*' ' build 18-Sep-2019 23:19:13 + if (showEffective): build 18-Sep-2019 23:19:13 + line += '%9.4f %9.4f %9.4f' % (effectiveBandwidth(vis, myspw)*1e-6, build 18-Sep-2019 23:19:13 + effectiveResolution(vis, myspw)*1e-6, build 18-Sep-2019 23:19:13 + getChanWidths(mymsmd, myspw)*1e-6) build 18-Sep-2019 23:19:13 + if (showWindowFactors): build 18-Sep-2019 23:19:13 + chanwidth = abs(getChanWidths(mymsmd,myspw)) build 18-Sep-2019 23:19:13 + line += ' %.4f %.4f' % (effectiveBandwidth(vis, myspw)/chanwidth, build 18-Sep-2019 23:19:13 + effectiveResolution(vis, myspw)/chanwidth) build 18-Sep-2019 23:19:13 + if (bands[index[i]].find('ALMA_RB_06')>=0 or bands[index[i]].find('ALMA_RB_09')>=0): build 18-Sep-2019 23:19:13 + if (len(LOs[index[i]]) > 1): build 18-Sep-2019 23:19:13 + if (LOs[index[i]][1] < 11.3e9 and LOs[index[i]][1] > 10.5e9): build 18-Sep-2019 23:19:13 + line = line + ' leakage of LO2 undesired sideband may degrade dynamic range' build 18-Sep-2019 23:19:13 + if (bands[index[i]].find('ALMA_RB_06')>=0): build 18-Sep-2019 23:19:13 + line += ' (and YIG may leak in)' build 18-Sep-2019 23:19:13 + yigLeakage = LOs[index[i]][0] + (LOs[index[i]][1] - LOs[index[i]][2]) + (yig - LOs[index[i]][1]) build 18-Sep-2019 23:19:13 + if (yigLeakage > 0): build 18-Sep-2019 23:19:13 + line = line + ' at %.6f' % (yigLeakage*1e-9) build 18-Sep-2019 23:19:13 + if (show): print(line) build 18-Sep-2019 23:19:13 + if needToClose: build 18-Sep-2019 23:19:13 + mymsmd.done() build 18-Sep-2019 23:19:13 + if (birdieIF != 0): build 18-Sep-2019 23:19:13 + print("The feature at %f GHz is at IF = %f GHz." % (birdieFreqGHz, birdieIF*1e-9)) build 18-Sep-2019 23:19:13 + if (alsoReturnLO2): build 18-Sep-2019 23:19:13 + return(lo1s, lo2s) build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + return(lo1s) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def mjdSecondsToMJDandUT(mjdsec): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Converts a value of MJD seconds into MJD, and into a UT date/time string. build 18-Sep-2019 23:19:13 + example: (56000.0, '2012-03-14 00:00:00 UT') build 18-Sep-2019 23:19:13 + Caveat: only works for a scalar input value build 18-Sep-2019 23:19:13 + Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + myme = createCasaTool(metool) build 18-Sep-2019 23:19:13 + today = myme.epoch('utc','today') build 18-Sep-2019 23:19:13 + mjd = np.array(mjdsec) / 86400. build 18-Sep-2019 23:19:13 + today['m0']['value'] = mjd build 18-Sep-2019 23:19:13 + myqa = createCasaTool(qatool) build 18-Sep-2019 23:19:13 + hhmmss = myqa.time(today['m0'], form='', prec=0, showform=False)[0] build 18-Sep-2019 23:19:13 +# print("hhmmss = ", hhmmss) build 18-Sep-2019 23:19:13 + date = myqa.splitdate(today['m0']) build 18-Sep-2019 23:19:13 + myqa.done() build 18-Sep-2019 23:19:13 + utstring = "%s-%02d-%02d %s UT" % (date['year'],date['month'],date['monthday'],hhmmss) build 18-Sep-2019 23:19:13 + myme.done() build 18-Sep-2019 23:19:13 + return(mjd, utstring) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def ComputeSolarAzElForObservatory(mjdsec, mymsmd): build 18-Sep-2019 23:19:13 + pos = mymsmd.observatoryposition() build 18-Sep-2019 23:19:13 + longitude = pos['m0']['value'] * 180/np.pi build 18-Sep-2019 23:19:13 + latitude = pos['m1']['value'] * 180/np.pi build 18-Sep-2019 23:19:13 + return(ComputeSolarAzElLatLong(mjdsec,latitude,longitude)) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def ComputeSolarAzElLatLong(mjdsec,latitude,longitude): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Computes the apparent Az,El of the Sun for a specified time and location build 18-Sep-2019 23:19:13 + on Earth. Latitude and longitude must arrive in degrees, with positive build 18-Sep-2019 23:19:13 + longitude meaning east of Greenwich. build 18-Sep-2019 23:19:13 + -- Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + DEG_TO_RAD = math.pi/180. build 18-Sep-2019 23:19:13 + RAD_TO_DEG = 180/math.pi build 18-Sep-2019 23:19:13 + HRS_TO_RAD = math.pi/12. build 18-Sep-2019 23:19:13 + [RA,Dec] = ComputeSolarRADec(mjdsec) build 18-Sep-2019 23:19:13 + LST = ComputeLST(mjdsec, longitude) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + phi = latitude*DEG_TO_RAD build 18-Sep-2019 23:19:13 + hourAngle = HRS_TO_RAD*(LST - RA) build 18-Sep-2019 23:19:13 + azimuth = RAD_TO_DEG*math.atan2(math.sin(hourAngle), (math.cos(hourAngle)*math.sin(phi) - math.tan(Dec*DEG_TO_RAD)*math.cos(phi))) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + # the following is to convert from South=0 (which the French formula uses) build 18-Sep-2019 23:19:13 + # to North=0, which is what the rest of the world uses */ build 18-Sep-2019 23:19:13 + azimuth += 180.0; build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + if (azimuth > 360.0): build 18-Sep-2019 23:19:13 + azimuth -= 360.0 build 18-Sep-2019 23:19:13 + if (azimuth < 0.0): build 18-Sep-2019 23:19:13 + azimuth += 360.0 build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + argument = math.sin(phi)*math.sin(Dec*DEG_TO_RAD) + math.cos(phi)*math.cos(Dec*DEG_TO_RAD) * math.cos(hourAngle); build 18-Sep-2019 23:19:13 + elevation = RAD_TO_DEG*math.asin(argument); build 18-Sep-2019 23:19:13 + return([azimuth,elevation]) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def ComputeSolarRADec(mjdsec): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Computes the RA,Dec of the Sun for a specified time. -- Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + jd = mjdToJD(mjdsec/86400.) build 18-Sep-2019 23:19:13 + RAD_TO_DEG = 180/math.pi build 18-Sep-2019 23:19:13 + RAD_TO_HRS = (1.0/0.2617993877991509) build 18-Sep-2019 23:19:13 + DEG_TO_RAD = math.pi/180. build 18-Sep-2019 23:19:13 + T = (jd - 2451545.0) / 36525.0 build 18-Sep-2019 23:19:13 + Lo = 280.46646 + 36000.76983*T + 0.0003032*T*T build 18-Sep-2019 23:19:13 + M = 357.52911 + 35999.05029*T - 0.0001537*T*T build 18-Sep-2019 23:19:13 + Mrad = M * DEG_TO_RAD build 18-Sep-2019 23:19:13 + e = 0.016708634 - 0.000042037*T - 0.0000001267*T*T build 18-Sep-2019 23:19:13 + C = (1.914602 - 0.004817*T - 0.000014*T*T) * math.sin(Mrad) + (0.019993 - 0.000101*T) * math.sin(2*Mrad) + 0.000289*math.sin(3*Mrad) build 18-Sep-2019 23:19:13 + L = Lo + C build 18-Sep-2019 23:19:13 + nu = DEG_TO_RAD*(M + C) build 18-Sep-2019 23:19:13 + R = 1.000001018 * (1-e*e) / (1 + e*math.cos(nu)) build 18-Sep-2019 23:19:13 + Omega = DEG_TO_RAD*(125.04 - 1934.136*T) build 18-Sep-2019 23:19:13 + mylambda = DEG_TO_RAD*(L - 0.00569 - 0.00478 * math.sin(Omega)) build 18-Sep-2019 23:19:13 + epsilon0 = (84381.448 - 46.8150*T - 0.00059*T*T + 0.001813*T*T*T) / 3600. build 18-Sep-2019 23:19:13 + epsilon = (epsilon0 + 0.00256 * math.cos(Omega)) * DEG_TO_RAD build 18-Sep-2019 23:19:13 + rightAscension = RAD_TO_HRS*math.atan2(math.cos(epsilon)*math.sin(mylambda), math.cos(mylambda)) build 18-Sep-2019 23:19:13 + if (rightAscension < 0): build 18-Sep-2019 23:19:13 + rightAscension += 24.0 build 18-Sep-2019 23:19:13 + argument = math.sin(epsilon) * math.sin(mylambda) build 18-Sep-2019 23:19:13 + declination = RAD_TO_DEG*math.asin(argument) build 18-Sep-2019 23:19:13 + return([rightAscension, declination]) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def angularSeparation(ra0,dec0,ra1,dec1, returnComponents=False): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Usage: angularSeparation(ra0,dec0,ra1,dec1) build 18-Sep-2019 23:19:13 + Computes the great circle angle between two celestial coordinates. build 18-Sep-2019 23:19:13 + using the Vincenty formula (from wikipedia) which is correct for all build 18-Sep-2019 23:19:13 + angles, as long as you use atan2() to handle a zero denominator. build 18-Sep-2019 23:19:13 + See http://en.wikipedia.org/wiki/Great_circle_distance build 18-Sep-2019 23:19:13 + ra,dec must be given in degrees, as is the output. build 18-Sep-2019 23:19:13 + It also works for the az,el coordinate system. build 18-Sep-2019 23:19:13 + Comopnent separations are field_0 minus field_1. build 18-Sep-2019 23:19:13 + See also angularSeparationRadians() build 18-Sep-2019 23:19:13 + -- Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + ra0 *= math.pi/180. build 18-Sep-2019 23:19:13 + dec0 *= math.pi/180. build 18-Sep-2019 23:19:13 + ra1 *= math.pi/180. build 18-Sep-2019 23:19:13 + dec1 *= math.pi/180. build 18-Sep-2019 23:19:13 + deltaLong = ra0-ra1 build 18-Sep-2019 23:19:13 + argument1 = (((math.cos(dec1)*math.sin(deltaLong))**2) + build 18-Sep-2019 23:19:13 + ((math.cos(dec0)*math.sin(dec1)-math.sin(dec0)*math.cos(dec1)*math.cos(deltaLong))**2))**0.5 build 18-Sep-2019 23:19:13 + argument2 = math.sin(dec0)*math.sin(dec1) + math.cos(dec0)*math.cos(dec1)*math.cos(deltaLong) build 18-Sep-2019 23:19:13 + angle = math.atan2(argument1, argument2) / (math.pi/180.) build 18-Sep-2019 23:19:13 + if (returnComponents): build 18-Sep-2019 23:19:13 + radegrees = (ra0-ra1)*180/math.pi build 18-Sep-2019 23:19:13 + decdegrees = (dec0-dec1)*180/math.pi build 18-Sep-2019 23:19:13 + retval = angle,radegrees,decdegrees build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + retval = angle build 18-Sep-2019 23:19:13 + return(retval) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def ComputeDewPointCFromRHAndTempC(relativeHumidity, temperature): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + inputs: relativeHumidity in percentage, temperature in C build 18-Sep-2019 23:19:13 + output: in degrees C build 18-Sep-2019 23:19:13 + Uses formula from http://en.wikipedia.org/wiki/Dew_point#Calculating_the_dew_point build 18-Sep-2019 23:19:13 + Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + temperature = np.array(temperature) # protect against it being a list build 18-Sep-2019 23:19:13 + relativeHumidity = np.array(relativeHumidity) # protect against it being a list build 18-Sep-2019 23:19:13 + es = 6.112*np.exp(17.67*temperature/(temperature+243.5)) build 18-Sep-2019 23:19:13 + E = relativeHumidity*0.01*es build 18-Sep-2019 23:19:13 + dewPoint = 243.5*np.log(E/6.112)/(17.67-np.log(E/6.112)) build 18-Sep-2019 23:19:13 + return(dewPoint) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def ComputeLST(mjdsec, longitude): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Computes the LST (in hours) for a specified time and longitude. build 18-Sep-2019 23:19:13 + The input longitude is in degrees, where east of Greenwich is positive. build 18-Sep-2019 23:19:13 + -- Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + JD = mjdToJD(mjdsec/86400.) build 18-Sep-2019 23:19:13 + T = (JD - 2451545.0) / 36525.0 build 18-Sep-2019 23:19:13 + sidereal = 280.46061837 + 360.98564736629*(JD - 2451545.0) + 0.000387933*T*T - T*T*T/38710000. build 18-Sep-2019 23:19:13 + # now we have LST in Greenwich, need to scale back to site build 18-Sep-2019 23:19:13 + sidereal += longitude build 18-Sep-2019 23:19:13 + sidereal /= 360. build 18-Sep-2019 23:19:13 + sidereal -= np.floor(sidereal) build 18-Sep-2019 23:19:13 + sidereal *= 24.0 build 18-Sep-2019 23:19:13 + if (sidereal < 0): build 18-Sep-2019 23:19:13 + sidereal += 24 build 18-Sep-2019 23:19:13 + if (sidereal >= 24): build 18-Sep-2019 23:19:13 + sidereal -= 24 build 18-Sep-2019 23:19:13 + return(sidereal) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def mjdToJD(MJD): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Converts an MJD value to JD build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + JD = MJD + 2400000.5 build 18-Sep-2019 23:19:13 + return(JD) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def splitListIntoContiguousLists(mylist): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Converts [1,2,3,5,6,7] into [[1,2,3],[5,6,7]], etc. build 18-Sep-2019 23:19:13 + -Todd Hunter build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + mylists = [] build 18-Sep-2019 23:19:13 + newlist = [mylist[0]] build 18-Sep-2019 23:19:13 + for i in range(1,len(mylist)): build 18-Sep-2019 23:19:13 + if (mylist[i-1] != mylist[i]-1): build 18-Sep-2019 23:19:13 + mylists.append(newlist) build 18-Sep-2019 23:19:13 + newlist = [mylist[i]] build 18-Sep-2019 23:19:13 + else: build 18-Sep-2019 23:19:13 + newlist.append(mylist[i]) build 18-Sep-2019 23:19:13 + mylists.append(newlist) build 18-Sep-2019 23:19:13 + return(mylists) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +# Removed for CAS-8065 build 18-Sep-2019 23:19:13 +#def getScansForTimes(mymsmd, scantimes): build 18-Sep-2019 23:19:13 +# myscans = [] build 18-Sep-2019 23:19:13 +# myscantimes = [] build 18-Sep-2019 23:19:13 +## print("len(scantimes) = ", len(scantimes)) build 18-Sep-2019 23:19:13 +# scantimes = splitListIntoContiguousLists(scantimes) build 18-Sep-2019 23:19:13 +# for t in scantimes: build 18-Sep-2019 23:19:13 +# mean_t = np.mean(t) build 18-Sep-2019 23:19:13 +# range_t = (1+np.max(t)-np.min(t))*0.5 build 18-Sep-2019 23:19:13 +# scans_t = mymsmd.scansfortimes(mean_t, range_t) build 18-Sep-2019 23:19:13 +# if (len(scans_t) > 0): build 18-Sep-2019 23:19:13 +# scan = scans_t[0] build 18-Sep-2019 23:19:13 +# # print("scansfortime(%f) = " % (t), scan) build 18-Sep-2019 23:19:13 +# myscans.append(scan) build 18-Sep-2019 23:19:13 +# myscantimes.append(t) build 18-Sep-2019 23:19:13 +# return(myscans, myscantimes) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def pruneFilelist(filelist): build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + Reduce size of filenames in filelist to the extent that current working directory build 18-Sep-2019 23:19:13 + agrees with the path. build 18-Sep-2019 23:19:13 + """ build 18-Sep-2019 23:19:13 + mypwd = os.getcwd() + '/' build 18-Sep-2019 23:19:13 + newfilelist = [] build 18-Sep-2019 23:19:13 + for f in filelist: build 18-Sep-2019 23:19:13 + fstart = 0 build 18-Sep-2019 23:19:13 + if (f.find(mypwd) == 0): build 18-Sep-2019 23:19:13 + fstart = len(mypwd) build 18-Sep-2019 23:19:13 + newfilelist.append(f[fstart:]) build 18-Sep-2019 23:19:13 + return(newfilelist) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 diff --git a/tests/tasks/test_fringefit.py b/tests/tasks/test_fringefit.py build 18-Sep-2019 23:19:13 new file mode 100644 build 18-Sep-2019 23:19:13 index 0000000..e0c4186 build 18-Sep-2019 23:19:13 --- /dev/null build 18-Sep-2019 23:19:13 +++ b/tests/tasks/test_fringefit.py build 18-Sep-2019 23:19:13 @@ -0,0 +1,67 @@ build 18-Sep-2019 23:19:13 +from __future__ import absolute_import build 18-Sep-2019 23:19:13 +from __future__ import print_function build 18-Sep-2019 23:19:13 +import os build 18-Sep-2019 23:19:13 +import sys build 18-Sep-2019 23:19:13 +import shutil build 18-Sep-2019 23:19:13 +import unittest build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +# is_CASA6 and is_python3 build 18-Sep-2019 23:19:13 +from casatasks.private.casa_transition import * build 18-Sep-2019 23:19:13 +if is_CASA6: build 18-Sep-2019 23:19:13 + from casatools import ms, ctsys build 18-Sep-2019 23:19:13 + from casatasks import fringefit build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + ctsys_resolve = ctsys.resolve build 18-Sep-2019 23:19:13 +else: build 18-Sep-2019 23:19:13 + from __main__ import default build 18-Sep-2019 23:19:13 + from tasks import * build 18-Sep-2019 23:19:13 + from taskinit import * build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + dataRoot = os.path.join(os.environ.get('CASAPATH').split()[0],'data') build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + def ctsys_resolve(apath): build 18-Sep-2019 23:19:13 + return os.path.join(dataRoot,apath) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +if is_python3: build 18-Sep-2019 23:19:13 + ### for testhelper import build 18-Sep-2019 23:19:13 + sys.path.append(os.path.abspath(os.path.dirname(__file__))) build 18-Sep-2019 23:19:13 + import testhelper as th build 18-Sep-2019 23:19:13 +else: build 18-Sep-2019 23:19:13 + import testhelper as th build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +datapath = ctsys_resolve('regression/evn') build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +class Fringefit_tests(unittest.TestCase): build 18-Sep-2019 23:19:13 + prefix = 'n08c1' build 18-Sep-2019 23:19:13 + msfile = prefix + '.ms' build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + def setUp(self): build 18-Sep-2019 23:19:13 + shutil.copytree(os.path.join(datapath, self.msfile), self.msfile) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + def tearDown(self): build 18-Sep-2019 23:19:13 + shutil.rmtree(self.msfile) build 18-Sep-2019 23:19:13 + shutil.rmtree(self.prefix + '.sbdcal', True) build 18-Sep-2019 23:19:13 + shutil.rmtree(self.prefix + '-zerorates.sbdcal', True) build 18-Sep-2019 23:19:13 + shutil.rmtree(self.prefix + '.mbdcal', True) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + def test_sbd(self): build 18-Sep-2019 23:19:13 + sbdcal = self.prefix + '.sbdcal' build 18-Sep-2019 23:19:13 + fringefit(vis=self.msfile, caltable=sbdcal, refant='EF') build 18-Sep-2019 23:19:13 + reference = os.path.join(datapath, sbdcal) build 18-Sep-2019 23:19:13 + self.assertTrue(th.compTables(sbdcal, reference, ['WEIGHT'])) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 + def test_mbd(self): build 18-Sep-2019 23:19:13 + sbdcal = self.prefix + '-zerorates.sbdcal' build 18-Sep-2019 23:19:13 + mbdcal = self.prefix + '.mbdcal' build 18-Sep-2019 23:19:13 + fringefit(vis=self.msfile, caltable=sbdcal, field='4C39.25', build 18-Sep-2019 23:19:13 + refant='EF', zerorates=True) build 18-Sep-2019 23:19:13 + fringefit(vis=self.msfile, caltable=mbdcal, field='J0916+3854', build 18-Sep-2019 23:19:13 + combine='spw', gaintable=[sbdcal], refant='EF') build 18-Sep-2019 23:19:13 + reference = os.path.join(datapath, mbdcal) build 18-Sep-2019 23:19:13 + self.assertTrue(th.compTables(mbdcal, reference, ['WEIGHT'])) build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +def suite(): build 18-Sep-2019 23:19:13 + return [Fringefit_tests] build 18-Sep-2019 23:19:13 + build 18-Sep-2019 23:19:13 +if __name__ == '__main__': build 18-Sep-2019 23:19:13 + unittest.main() build 18-Sep-2019 23:19:14 Argument values: build 18-Sep-2019 23:19:14 casatasks build 18-Sep-2019 23:19:14 /export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1/casatasks build 18-Sep-2019 23:19:14 master build 18-Sep-2019 23:19:14 None build 18-Sep-2019 23:19:14 Last Tag: 2019.150 build 18-Sep-2019 23:19:14 New Tag: 2019.151 build 18-Sep-2019 23:19:14 Creating a new tag build 18-Sep-2019 23:19:14 build 18-Sep-2019 23:19:14 None build 18-Sep-2019 23:19:14 Push enabled. Pushing new tag upstream. build 18-Sep-2019 23:19:14 To ssh://git@open-bitbucket.nrao.edu:7999/casa/casatasks.git build 18-Sep-2019 23:19:14 * [new tag] 2019.151 -> 2019.151 build 18-Sep-2019 23:19:14 build 18-Sep-2019 23:19:14 None simple 18-Sep-2019 23:19:14 Finished task 'Create wheel' with result: Success simple 18-Sep-2019 23:19:14 Running post build plugin 'Docker Container Cleanup' command 18-Sep-2019 23:19:14 Beginning to execute external process for build 'CASA - Casa6 Tasks Wheel Build - Build and Package RHEL6 #146 (CASA-CTB-JOB1-146)'\n ... running command line: \n/bin/docker rm -f task-wheel-container\n ... in: /export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1\n build 18-Sep-2019 23:19:15 task-wheel-container simple 18-Sep-2019 23:19:15 Running post build plugin 'NCover Results Collector' simple 18-Sep-2019 23:19:15 Running post build plugin 'Clover Results Collector' simple 18-Sep-2019 23:19:15 Running post build plugin 'npm Cache Cleanup' simple 18-Sep-2019 23:19:15 Running post build plugin 'Artifact Copier' simple 18-Sep-2019 23:19:15 Publishing an artifact: EL6 wheel simple 18-Sep-2019 23:19:15 Finished publishing of artifact Non required shared artifact: [EL6 wheel], pattern: [*-any.whl] anchored at: [wheeldirectory/] in 165.7 ms simple 18-Sep-2019 23:19:15 Finalising the build... simple 18-Sep-2019 23:19:15 Stopping timer. simple 18-Sep-2019 23:19:15 Build CASA-CTB-JOB1-146 completed. simple 18-Sep-2019 23:19:15 Running on server: post build plugin 'NCover Results Collector' simple 18-Sep-2019 23:19:15 Running on server: post build plugin 'Build Hanging Detection Configuration' simple 18-Sep-2019 23:19:15 Running on server: post build plugin 'Clover Delta Calculator' simple 18-Sep-2019 23:19:15 Running on server: post build plugin 'Maven Dependencies Postprocessor' simple 18-Sep-2019 23:19:15 All post build plugins have finished simple 18-Sep-2019 23:19:15 Generating build results summary... simple 18-Sep-2019 23:19:15 Saving build results to disk... simple 18-Sep-2019 23:19:15 Logging substituted variables... simple 18-Sep-2019 23:19:15 Indexing build results... simple 18-Sep-2019 23:19:15 Finished building CASA-CTB-JOB1-146.