simple 12-Sep-2018 15:29:56 Build ARD - Build And Package - ARD-3 - Tag Branch for Packages #4 (ARD-BPT4-TBFP-4) started building on agent cbt-el7-4.cv.nrao.edu simple 12-Sep-2018 15:29:56 Remote agent on host cbt-el7-4.cv.nrao.edu simple 12-Sep-2018 15:29:56 Build working directory is /export/home/cbt-el7-4/bamboohome/xml-data/build-dir/ARD-BPT4-TBFP simple 12-Sep-2018 15:29:56 Executing build ARD - Build And Package - ARD-3 - Tag Branch for Packages #4 (ARD-BPT4-TBFP-4) simple 12-Sep-2018 15:29:56 Skipping execution of task 'Checkout Default Repository' as it is disabled simple 12-Sep-2018 15:29:56 Running pre-build action: VCS Version Collector simple 12-Sep-2018 15:29:56 Skipping execution of task 'Checkout Default Repository' as it is disabled command 12-Sep-2018 15:29:56 Substituting variable: ${bamboo.repository.branch.name} with ARD-3 command 12-Sep-2018 15:29:56 Substituting variable: ${bamboo.buildNumber} with 4 command 12-Sep-2018 15:29:56 Substituting variable: ${bamboo.planRepository.revision} with 24d0ec81f2390e8db3fbfdc1d6ce03e54cbd304d command 12-Sep-2018 15:29:56 Substituting variable: ${bamboo.planRepository.repositoryUrl} with ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git command 12-Sep-2018 15:29:56 Substituting variable: ${bamboo.planRepository.repositoryUrl} with ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git command 12-Sep-2018 15:29:56 Substituting variable: ${bamboo.build.working.directory} with /export/home/cbt-el7-4/bamboohome/xml-data/build-dir/ARD-BPT4-TBFP command 12-Sep-2018 15:29:56 Substituting variable: ${bamboo.planRepository.repositoryUrl} with ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git command 12-Sep-2018 15:29:56 Substituting variable: ${bamboo.repository.branch.name} with ARD-3 command 12-Sep-2018 15:29:56 Substituting variable: ${bamboo.build.working.directory} with /export/home/cbt-el7-4/bamboohome/xml-data/build-dir/ARD-BPT4-TBFP command 12-Sep-2018 15:29:56 Substituting variable: ${bamboo.repository.branch.name} with ARD-3 command 12-Sep-2018 15:29:56 Substituting variable: ${bamboo.build.working.directory} with /export/home/cbt-el7-4/bamboohome/xml-data/build-dir/ARD-BPT4-TBFP command 12-Sep-2018 15:29:56 Substituting variable: ${bamboo.planRepository.repositoryUrl} with ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git simple 12-Sep-2018 15:29:56 Starting task 'Script' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script' command 12-Sep-2018 15:29:56 Beginning to execute external process for build 'ARD - Build And Package - ARD-3 - Tag Branch for Packages #4 (ARD-BPT4-TBFP-4)'\n ... running command line: \n/bin/sh /export/home/cbt-el7-4/bamboohome/temp/ARD-BPT4-TBFP-4-ScriptBuildTask-8011471916225011422.sh\n ... in: /export/home/cbt-el7-4/bamboohome/xml-data/build-dir/ARD-BPT4-TBFP\n ... using extra environment variables: \nbamboo_planRepository_1_branch=ARD-3\nbamboo_capability_buildmachinetype=build\nbamboo_repository_20939039_git_branch=ARD-3\nbamboo_planRepository_2_branch=master\nbamboo_planRepository_1_branchDisplayName=ARD-3\nbamboo_repository_revision_number=24d0ec81f2390e8db3fbfdc1d6ce03e54cbd304d\nbamboo_repository_20938876_previous_revision_number=de293f6de3d7409f904a575ef3a9e4a11736ad0c\nbamboo_resultsUrl=https://open-bamboo.nrao.edu/browse/ARD-BPT4-TBFP-4\nbamboo_repository_20938876_git_username=\nbamboo_planRepository_1_name=OPEN-CASA-FULL\nbamboo_build_working_directory=/export/home/cbt-el7-4/bamboohome/xml-data/build-dir/ARD-BPT4-TBFP\nbamboo_buildKey=ARD-BPT4-TBFP\nbamboo_shortPlanName=ARD-3\nbamboo_capability_hostname=cbt-el7-4.cv.nrao.edu\nbamboo_repository_20939039_name=OPEN-CASA-FULL\nbamboo_planRepository_2_username=\nbamboo_planRepository_name=OPEN-CASA-FULL\nbamboo_buildNumber=4\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-2.b11.el7_3.x86_64\nbamboo_shortJobName=Tag Branch for Packages\nbamboo_buildResultsUrl=https://open-bamboo.nrao.edu/browse/ARD-BPT4-TBFP-4\nbamboo_planRepository_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_agentId=6160386\nbamboo_planName=ARD - Build And Package - ARD-3\nbamboo_shortPlanKey=BPT4\nbamboo_shortJobKey=TBFP\nbamboo_planRepository_2_name=OPEN-CASA-PKG\nbamboo_planRepository_revision=24d0ec81f2390e8db3fbfdc1d6ce03e54cbd304d\nbamboo_repository_previous_revision_number=786b1dc3ae141cae7d76e110084b53cedfee67ec\nbamboo_buildTimeStamp=2018-09-12T14:51:09.259-04:00\nbamboo_casaadm_password=********\nbamboo_planRepository_previousRevision=786b1dc3ae141cae7d76e110084b53cedfee67ec\nbamboo_repository_20938876_git_branch=master\nbamboo_repository_20938876_branch_name=master\nbamboo_repository_20938876_name=OPEN-CASA-PKG\nbamboo_repository_20939039_previous_revision_number=786b1dc3ae141cae7d76e110084b53cedfee67ec\nbamboo_capability_system_jdk_JDK_1_8_0_144=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64\nbamboo_buildResultKey=ARD-BPT4-TBFP-4\nbamboo_repository_git_branch=ARD-3\nbamboo_repository_branch_name=ARD-3\nbamboo_buildPlanName=ARD - Build And Package - ARD-3 - Tag Branch for Packages\nbamboo_capability_system_jdk_JDK_1_8_0_102=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.102-1.b14.el7_2.x86_64\nbamboo_planRepository_1_revision=24d0ec81f2390e8db3fbfdc1d6ce03e54cbd304d\nbamboo_capability_system_jdk_JDK_1_8_0_141=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.141-2.b16.el7_4.x86_64\nbamboo_capability_system_hg_executable=/bin/hg\nbamboo_repository_name=OPEN-CASA-PKG\nbamboo_planRepository_2_previousRevision=de293f6de3d7409f904a575ef3a9e4a11736ad0c\nbamboo_dependenciesDisabled=false\nbamboo_buildFailed=false\nbamboo_capability_isCIMachine=true\nbamboo_planRepository_branch=ARD-3\nbamboo_agentWorkingDirectory=/export/home/cbt-el7-4/bamboohome/xml-data/build-dir\nbamboo_planRepository_2_revision=e5f8bf188c0f97f776d1d09c8b4efcd543aef049\nbamboo_capability_system_git_executable=/bin/git\nbamboo_planRepository_1_previousRevision=786b1dc3ae141cae7d76e110084b53cedfee67ec\nbamboo_capability_tag=true\nbamboo_capability_system_jdk_JDK_1_8_0_111=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64\nbamboo_repository_git_username=\nbamboo_capability_operating_system=EL7\nbamboo_planRepository_branchDisplayName=ARD-3\nbamboo_capability_system_jdk_JDK_1_8_0_151=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64\nbamboo_repository_20939039_revision_number=24d0ec81f2390e8db3fbfdc1d6ce03e54cbd304d\nbamboo_planRepository_1_type=bbserver\nbamboo_planRepository_branchName=ARD-3\nbamboo_capability_project=CASA\nbamboo_planRepository_2_type=bbserver\nbamboo_repository_20939039_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_repository_20938876_revision_number=e5f8bf188c0f97f776d1d09c8b4efcd543aef049\nbamboo_capability_system_jdk_JDK=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.102-1.b14.el7_2.x86_64\nbamboo_plan_storageTag=plan-20744168\nbamboo_planRepository_2_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa-pkg.git\nbamboo_planRepository_type=bbserver\nbamboo_planRepository_1_username=\nbamboo_ManualBuildTriggerReason_userName=sbhatnag\nbamboo_repository_20939039_branch_name=ARD-3\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_working_directory=/export/home/cbt-el7-4/bamboohome/xml-data/build-dir/ARD-BPT4-TBFP\nbamboo_planKey=ARD-BPT4\nbamboo_planRepository_1_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git\nbamboo_planRepository_username=\nbamboo_repository_20939039_git_username=\nbamboo_capability_system_jdk_JDK_1_8=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.102-1.b14.el7_2.x86_64\nbamboo_repository_20938876_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa-pkg.git\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_planRepository_1_branchName=ARD-3\n build 12-Sep-2018 15:29:56 4 build 12-Sep-2018 15:29:56 24d0ec81f2390e8db3fbfdc1d6ce03e54cbd304d build 12-Sep-2018 15:29:56 ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git build 12-Sep-2018 15:29:57 Fetching origin error 12-Sep-2018 15:29:58 From https://open-bitbucket.nrao.edu/scm/casa/casa-pkg error 12-Sep-2018 15:29:58 de293f6..e5f8bf1 master -> origin/master error 12-Sep-2018 15:29:58 * [new branch] bugfix/CAS-11539 -> origin/bugfix/CAS-11539 error 12-Sep-2018 15:29:58 * [new branch] hotfix/CAS-11841 -> origin/hotfix/CAS-11841 error 12-Sep-2018 15:29:58 * [new branch] make-app-patch -> origin/make-app-patch error 12-Sep-2018 15:29:58 * [new branch] release/5.3.0 -> origin/release/5.3.0 error 12-Sep-2018 15:29:58 * [new branch] release/5.4.0 -> origin/release/5.4.0 error 12-Sep-2018 15:29:58 * [new branch] release/5.4.1 -> origin/release/5.4.1 build 12-Sep-2018 15:29:59 Updating de293f6..e5f8bf1 build 12-Sep-2018 15:29:59 Fast-forward build 12-Sep-2018 15:29:59 bambooscripts/agentcleanup.groovy | 3 + build 12-Sep-2018 15:29:59 casa6/xml-casa/scripts/xml-casa | 7 + build 12-Sep-2018 15:29:59 .../scala/edu/nrao/casa/ComponentGen/Main.scala | 5 +- build 12-Sep-2018 15:29:59 .../nrao/casa/ComponentGen/casa_conversion.scala | 28 ++-- build 12-Sep-2018 15:29:59 .../nrao/casa/ComponentGen/store_typecheck.scala | 16 +- build 12-Sep-2018 15:29:59 .../edu/nrao/casa/ComponentGen/v1_to_v2.scala | 31 ++++ build 12-Sep-2018 15:29:59 .../edu/nrao/casa/ComponentGen/xml_to_task.scala | 4 +- build 12-Sep-2018 15:29:59 .../edu/nrao/casa/ComponentGen/xml_to_tool.scala | 2 + build 12-Sep-2018 15:29:59 .../edu/nrao/gradle/casa/build/CasaApp.groovy | 4 +- build 12-Sep-2018 15:29:59 gradle/casa-build/build.git.bamboo.gradle | 46 +++++- build 12-Sep-2018 15:29:59 gradle/casa-tag/build.gradle | 10 +- build 12-Sep-2018 15:29:59 gradle/casa-test/build.gradle | 1 + build 12-Sep-2018 15:29:59 gradle/gradle.properties | 2 +- build 12-Sep-2018 15:29:59 packaging/scripts/make-app | 2 +- build 12-Sep-2018 15:29:59 .../linux/casa-distro/lib/casa/bin/casabrowser | 2 +- build 12-Sep-2018 15:29:59 .../linux/casa-distro/lib/casa/bin/qt.conf | 2 + build 12-Sep-2018 15:29:59 .../osx/CASA.app/Contents/MacOS/casabrowser | 67 +-------- build 12-Sep-2018 15:29:59 .../osx/CASA.app/Contents/MacOS/qcasabrowser | 1 - build 12-Sep-2018 15:29:59 .../Browser.app/Contents/MacOS/qcasabrowser | 1 - build 12-Sep-2018 15:29:59 .../3023_Importcasa.html} | 13 +- build 12-Sep-2018 15:29:59 .../3121_Cvel2.html} | 11 +- build 12-Sep-2018 15:29:59 .../3403_Applycal.html} | 10 +- build 12-Sep-2018 15:29:59 testing/pybot-accepted/4538_Sdsidebandsplit.html | 160 ++++++++++++++++++++ build 12-Sep-2018 15:29:59 testing/pybot-accepted/6445_Refimager.html | 4 +- build 12-Sep-2018 15:29:59 .../6909_MPI_Cvel.html} | 16 +- build 12-Sep-2018 15:29:59 testing/pybot-accepted/6945_MPI_Refimager.html | 4 +- build 12-Sep-2018 15:29:59 .../8330_Asdm-Imexport+Analysis.html | 0 build 12-Sep-2018 15:29:59 .../{3040_Importvla.html => 3045_Importvla.html} | 0 build 12-Sep-2018 15:29:59 .../{3171_Statwt2.html => 3171_Oldstatwt.html} | 9 +- build 12-Sep-2018 15:29:59 ...{4559_Tsdbaseline.html => 4559_SDbaseline.html} | 6 +- build 12-Sep-2018 15:29:59 .../{4562_Tsdcal.html => 4562_SDcal.html} | 6 +- build 12-Sep-2018 15:29:59 .../{4565_Tsdfit.html => 4565_SDfit.html} | 6 +- build 12-Sep-2018 15:29:59 .../{4568_Tsdsmooth.html => 4568_SDsmooth.html} | 6 +- build 12-Sep-2018 15:29:59 testing/pybot-regression/5150_Visstatold.html | 162 -------------------- build 12-Sep-2018 15:29:59 testing/pybot-regression/6405_Boxit.html | 163 --------------------- build 12-Sep-2018 15:29:59 testing/pybot-regression/8399_Orionmosaic.html | 162 -------------------- build 12-Sep-2018 15:29:59 testing/pybot-regression/lib/CasaRegression.py | 7 +- build 12-Sep-2018 15:29:59 37 files changed, 343 insertions(+), 636 deletions(-) build 12-Sep-2018 15:29:59 create mode 100644 packaging/template/linux/casa-distro/lib/casa/bin/qt.conf build 12-Sep-2018 15:29:59 mode change 100755 => 120000 packaging/template/osx/CASA.app/Contents/MacOS/casabrowser build 12-Sep-2018 15:29:59 delete mode 120000 packaging/template/osx/CASA.app/Contents/MacOS/qcasabrowser build 12-Sep-2018 15:29:59 delete mode 120000 packaging/template/osx/CASA.app/Contents/Resources/Browser.app/Contents/MacOS/qcasabrowser build 12-Sep-2018 15:29:59 rename testing/{pybot-regression/4715_Plotuv.html => pybot-accepted/3023_Importcasa.html} (95%) build 12-Sep-2018 15:29:59 rename testing/{pybot-regression/3025_Importevla.html => pybot-accepted/3121_Cvel2.html} (96%) build 12-Sep-2018 15:29:59 rename testing/{pybot-regression/3135_Hanningsmooth2.html => pybot-accepted/3403_Applycal.html} (96%) build 12-Sep-2018 15:29:59 create mode 100644 testing/pybot-accepted/4538_Sdsidebandsplit.html build 12-Sep-2018 15:29:59 rename testing/{pybot-regression/6425_Csvclean.html => pybot-accepted/6909_MPI_Cvel.html} (95%) build 12-Sep-2018 15:29:59 rename testing/{pybot-regression => pybot-accepted}/8330_Asdm-Imexport+Analysis.html (100%) build 12-Sep-2018 15:29:59 rename testing/pybot-regression/{3040_Importvla.html => 3045_Importvla.html} (100%) build 12-Sep-2018 15:29:59 rename testing/pybot-regression/{3171_Statwt2.html => 3171_Oldstatwt.html} (94%) build 12-Sep-2018 15:29:59 rename testing/pybot-regression/{4559_Tsdbaseline.html => 4559_SDbaseline.html} (96%) build 12-Sep-2018 15:29:59 rename testing/pybot-regression/{4562_Tsdcal.html => 4562_SDcal.html} (97%) build 12-Sep-2018 15:29:59 rename testing/pybot-regression/{4565_Tsdfit.html => 4565_SDfit.html} (97%) build 12-Sep-2018 15:29:59 rename testing/pybot-regression/{4568_Tsdsmooth.html => 4568_SDsmooth.html} (97%) build 12-Sep-2018 15:29:59 delete mode 100644 testing/pybot-regression/5150_Visstatold.html build 12-Sep-2018 15:29:59 delete mode 100644 testing/pybot-regression/6405_Boxit.html build 12-Sep-2018 15:29:59 delete mode 100644 testing/pybot-regression/8399_Orionmosaic.html build 12-Sep-2018 15:30:01 Starting a Gradle Daemon (subsequent builds will be faster) build 12-Sep-2018 15:30:04 :compileJava UP-TO-DATE build 12-Sep-2018 15:30:08 :compileGroovy build 12-Sep-2018 15:30:08 :processResources UP-TO-DATE build 12-Sep-2018 15:30:08 :classes build 12-Sep-2018 15:30:08 :jar build 12-Sep-2018 15:30:08 :compileTestJava UP-TO-DATE build 12-Sep-2018 15:30:10 :compileTestGroovy build 12-Sep-2018 15:30:10 :processTestResources UP-TO-DATE build 12-Sep-2018 15:30:10 :testClasses build 12-Sep-2018 15:30:13 :test build 12-Sep-2018 15:30:13 :uploadArchives build 12-Sep-2018 15:30:13 build 12-Sep-2018 15:30:13 BUILD SUCCESSFUL build 12-Sep-2018 15:30:13 build 12-Sep-2018 15:30:13 Total time: 14.473 secs build 12-Sep-2018 15:30:17 :createTag build 12-Sep-2018 15:30:17 workdir: /export/home/cbt-el7-4/bamboohome/xml-data/build-dir/ARD-BPT4-TBFP/taggitworkdir build 12-Sep-2018 15:30:17 sourcedir: /export/home/cbt-el7-4/bamboohome/xml-data/build-dir/ARD-BPT4-TBFP/taggitworkdir/casa build 12-Sep-2018 15:30:17 gitremote: ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git build 12-Sep-2018 15:30:17 branch: ARD-3 build 12-Sep-2018 15:30:17 Push option: true error 12-Sep-2018 15:30:18 Switched to branch 'master' build 12-Sep-2018 15:30:18 build 12-Sep-2018 15:30:18 Fetching origin error 12-Sep-2018 15:30:20 From ssh://open-bitbucket.nrao.edu:7999/casa/casa error 12-Sep-2018 15:30:20 d3eb427..532eb7e master -> origin/master error 12-Sep-2018 15:30:20 * [new branch] ARD-12-FMAWP -> origin/ARD-12-FMAWP error 12-Sep-2018 15:30:20 f5dca2a..6d8353f ARD-2 -> origin/ARD-2 error 12-Sep-2018 15:30:20 786b1dc..24d0ec8 ARD-3 -> origin/ARD-3 error 12-Sep-2018 15:30:20 * [new branch] ARD-3-CppAWVRtesting -> origin/ARD-3-CppAWVRtesting error 12-Sep-2018 15:30:20 * [new branch] ARD-3-testing-bamboo -> origin/ARD-3-testing-bamboo error 12-Sep-2018 15:30:20 * [new branch] ARD-5 -> origin/ARD-5 error 12-Sep-2018 15:30:20 * [new branch] ARD-8 -> origin/ARD-8 error 12-Sep-2018 15:30:20 2fbb405..c048aee ARD-master -> origin/ARD-master error 12-Sep-2018 15:30:20 * [new branch] ARD-master-sb -> origin/ARD-master-sb error 12-Sep-2018 15:30:20 * [new branch] CAS-10294 -> origin/CAS-10294 error 12-Sep-2018 15:30:20 * [new branch] CAS-10307 -> origin/CAS-10307 error 12-Sep-2018 15:30:20 * [new branch] CAS-10567 -> origin/CAS-10567 error 12-Sep-2018 15:30:20 * [new branch] CAS-10593 -> origin/CAS-10593 error 12-Sep-2018 15:30:20 * [new branch] CAS-11174 -> origin/CAS-11174 error 12-Sep-2018 15:30:20 034ff2c..a1b8ba7 CAS-11216 -> origin/CAS-11216 error 12-Sep-2018 15:30:20 * [new branch] CAS-11276 -> origin/CAS-11276 error 12-Sep-2018 15:30:20 * [new branch] CAS-11278 -> origin/CAS-11278 error 12-Sep-2018 15:30:20 d3eb427..d62d238 CAS-11292 -> origin/CAS-11292 error 12-Sep-2018 15:30:20 * [new branch] CAS-11303 -> origin/CAS-11303 error 12-Sep-2018 15:30:20 * [new branch] CAS-11303-refactor-rewrite-imagemetadata -> origin/CAS-11303-refactor-rewrite-imagemetadata error 12-Sep-2018 15:30:20 * [new branch] CAS-11306 -> origin/CAS-11306 error 12-Sep-2018 15:30:20 * [new branch] CAS-11360 -> origin/CAS-11360 error 12-Sep-2018 15:30:20 * [new branch] CAS-11371 -> origin/CAS-11371 error 12-Sep-2018 15:30:20 * [new branch] CAS-11390 -> origin/CAS-11390 error 12-Sep-2018 15:30:20 * [new branch] CAS-11424 -> origin/CAS-11424 error 12-Sep-2018 15:30:20 * [new branch] CAS-11427 -> origin/CAS-11427 error 12-Sep-2018 15:30:20 * [new branch] CAS-11430 -> origin/CAS-11430 error 12-Sep-2018 15:30:20 * [new branch] CAS-11432 -> origin/CAS-11432 error 12-Sep-2018 15:30:20 * [new branch] CAS-11460 -> origin/CAS-11460 error 12-Sep-2018 15:30:20 * [new branch] CAS-11469 -> origin/CAS-11469 error 12-Sep-2018 15:30:20 * [new branch] CAS-11478 -> origin/CAS-11478 error 12-Sep-2018 15:30:20 * [new branch] CAS-11490 -> origin/CAS-11490 error 12-Sep-2018 15:30:20 * [new branch] CAS-11497 -> origin/CAS-11497 error 12-Sep-2018 15:30:20 * [new branch] CAS-11501 -> origin/CAS-11501 error 12-Sep-2018 15:30:20 * [new branch] CAS-11513 -> origin/CAS-11513 error 12-Sep-2018 15:30:20 * [new branch] CAS-11523 -> origin/CAS-11523 error 12-Sep-2018 15:30:20 * [new branch] CAS-11547 -> origin/CAS-11547 error 12-Sep-2018 15:30:20 * [new branch] CAS-11549 -> origin/CAS-11549 error 12-Sep-2018 15:30:20 * [new branch] CAS-11582 -> origin/CAS-11582 error 12-Sep-2018 15:30:20 * [new branch] CAS-11587 -> origin/CAS-11587 error 12-Sep-2018 15:30:20 * [new branch] CAS-11596 -> origin/CAS-11596 error 12-Sep-2018 15:30:20 * [new branch] CAS-11597 -> origin/CAS-11597 error 12-Sep-2018 15:30:20 * [new branch] CAS-11606 -> origin/CAS-11606 error 12-Sep-2018 15:30:20 * [new branch] CAS-11608 -> origin/CAS-11608 error 12-Sep-2018 15:30:20 * [new branch] CAS-11623 -> origin/CAS-11623 error 12-Sep-2018 15:30:20 * [new branch] CAS-11632 -> origin/CAS-11632 error 12-Sep-2018 15:30:20 * [new branch] CAS-11639 -> origin/CAS-11639 error 12-Sep-2018 15:30:20 * [new branch] CAS-11640 -> origin/CAS-11640 error 12-Sep-2018 15:30:20 * [new branch] CAS-11643 -> origin/CAS-11643 error 12-Sep-2018 15:30:20 * [new branch] CAS-11648 -> origin/CAS-11648 error 12-Sep-2018 15:30:20 * [new branch] CAS-11662 -> origin/CAS-11662 error 12-Sep-2018 15:30:20 * [new branch] CAS-11668 -> origin/CAS-11668 error 12-Sep-2018 15:30:20 * [new branch] CAS-11722 -> origin/CAS-11722 error 12-Sep-2018 15:30:20 * [new branch] CAS-11726 -> origin/CAS-11726 error 12-Sep-2018 15:30:20 * [new branch] CAS-11818 -> origin/CAS-11818 error 12-Sep-2018 15:30:20 * [new branch] CAS-11850 -> origin/CAS-11850 error 12-Sep-2018 15:30:20 * [new branch] CAS-11855 -> origin/CAS-11855 error 12-Sep-2018 15:30:20 * [new branch] CAS-11868 -> origin/CAS-11868 error 12-Sep-2018 15:30:20 * [new branch] CAS-11875 -> origin/CAS-11875 error 12-Sep-2018 15:30:20 * [new branch] CAS-7555 -> origin/CAS-7555 error 12-Sep-2018 15:30:20 72ff707..8baf62f CAS-9094 -> origin/CAS-9094 error 12-Sep-2018 15:30:20 * [new branch] CppAWVR -> origin/CppAWVR error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-10337 -> origin/bugfix/CAS-10337 error 12-Sep-2018 15:30:20 ca5b5bf..602d3d9 bugfix/CAS-10487 -> origin/bugfix/CAS-10487 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-10518 -> origin/bugfix/CAS-10518 error 12-Sep-2018 15:30:20 5f23331..4bb143e bugfix/CAS-10596 -> origin/bugfix/CAS-10596 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-10692 -> origin/bugfix/CAS-10692 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-10958 -> origin/bugfix/CAS-10958 error 12-Sep-2018 15:30:20 68c3e44..7b49f63 bugfix/CAS-11139 -> origin/bugfix/CAS-11139 error 12-Sep-2018 15:30:20 c5f0911..ffe60aa bugfix/CAS-11183 -> origin/bugfix/CAS-11183 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11191 -> origin/bugfix/CAS-11191 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11210 -> origin/bugfix/CAS-11210 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11243 -> origin/bugfix/CAS-11243 error 12-Sep-2018 15:30:20 82c2ea1..87267f5 bugfix/CAS-11269 -> origin/bugfix/CAS-11269 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11316 -> origin/bugfix/CAS-11316 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11359 -> origin/bugfix/CAS-11359 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11367 -> origin/bugfix/CAS-11367 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11397 -> origin/bugfix/CAS-11397 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11503 -> origin/bugfix/CAS-11503 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11528 -> origin/bugfix/CAS-11528 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11693 -> origin/bugfix/CAS-11693 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11796 -> origin/bugfix/CAS-11796 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11805 -> origin/bugfix/CAS-11805 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11831 -> origin/bugfix/CAS-11831 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11839 -> origin/bugfix/CAS-11839 error 12-Sep-2018 15:30:20 * [new branch] bugfix/CAS-11856 -> origin/bugfix/CAS-11856 error 12-Sep-2018 15:30:20 1dd86f5..6bf71df bugfix/CAS-9968 -> origin/bugfix/CAS-9968 error 12-Sep-2018 15:30:20 4dbb3b4..0cf86cf feature/CAS-10647 -> origin/feature/CAS-10647 error 12-Sep-2018 15:30:20 a58efbf..21c6422 feature/CAS-10684 -> origin/feature/CAS-10684 error 12-Sep-2018 15:30:20 4863bb5..83c8310 feature/CAS-10758 -> origin/feature/CAS-10758 error 12-Sep-2018 15:30:20 d3b8786..5587931 feature/CAS-10768 -> origin/feature/CAS-10768 error 12-Sep-2018 15:30:20 * [new branch] feature/CAS-11280 -> origin/feature/CAS-11280 error 12-Sep-2018 15:30:20 * [new branch] feature/CAS-11317 -> origin/feature/CAS-11317 error 12-Sep-2018 15:30:20 * [new branch] feature/CAS-11590 -> origin/feature/CAS-11590 error 12-Sep-2018 15:30:20 * [new branch] feature/CAS-11701 -> origin/feature/CAS-11701 error 12-Sep-2018 15:30:20 * [new branch] feature/CAS-11872 -> origin/feature/CAS-11872 error 12-Sep-2018 15:30:20 * [new branch] feature/CAS-7341 -> origin/feature/CAS-7341 error 12-Sep-2018 15:30:20 67fa21b..2a37507 feature/CAS-8087 -> origin/feature/CAS-8087 error 12-Sep-2018 15:30:20 21e4eef..1ccb2fc feature/CAS-9538 -> origin/feature/CAS-9538 error 12-Sep-2018 15:30:20 d5334c5..1e87b8e feature/CAS-9679 -> origin/feature/CAS-9679 error 12-Sep-2018 15:30:20 * [new branch] hotfix-casa6-atcafiller-01 -> origin/hotfix-casa6-atcafiller-01 error 12-Sep-2018 15:30:20 * [new branch] hotfix_agentflagger_dtor_exception -> origin/hotfix_agentflagger_dtor_exception error 12-Sep-2018 15:30:20 * [new branch] hotfix_imval_xml_return -> origin/hotfix_imval_xml_return error 12-Sep-2018 15:30:20 * [new branch] hotfix_logsink_segv -> origin/hotfix_logsink_segv error 12-Sep-2018 15:30:20 * [new branch] hotfix_sdbaseline_types -> origin/hotfix_sdbaseline_types error 12-Sep-2018 15:30:20 * [new branch] hotfix_sdfit -> origin/hotfix_sdfit error 12-Sep-2018 15:30:20 * [new branch] hotfix_simanalyze_vector_usage -> origin/hotfix_simanalyze_vector_usage error 12-Sep-2018 15:30:20 * [new branch] release/5.3.0 -> origin/release/5.3.0 error 12-Sep-2018 15:30:20 * [new branch] release/5.4.0 -> origin/release/5.4.0 error 12-Sep-2018 15:30:20 * [new branch] release/5.4.1 -> origin/release/5.4.1 error 12-Sep-2018 15:30:20 * [new tag] 5.1.0-2-bugfix-CAS-9968-8 -> 5.1.0-2-bugfix-CAS-9968-8 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-103-bugfix-CAS-11247-1 -> 5.3.0-103-bugfix-CAS-11247-1 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-103-bugfix-CAS-11269-3 -> 5.3.0-103-bugfix-CAS-11269-3 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-106-bugfix-CAS-10487-2 -> 5.3.0-106-bugfix-CAS-10487-2 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-108-test-CAS-11254-1 -> 5.3.0-108-test-CAS-11254-1 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-108-test-CAS-11278-4 -> 5.3.0-108-test-CAS-11278-4 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-108-test-CAS-11292-1 -> 5.3.0-108-test-CAS-11292-1 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-110-feature-CAS-7341-1 -> 5.3.0-110-feature-CAS-7341-1 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-112-test-CAS-11276-4 -> 5.3.0-112-test-CAS-11276-4 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-112-test-CAS-11306-1 -> 5.3.0-112-test-CAS-11306-1 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-121-bugfix-CAS-11359-1 -> 5.3.0-121-bugfix-CAS-11359-1 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-122-bugfix-CAS-10337-1 -> 5.3.0-122-bugfix-CAS-10337-1 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-123-test-CAS-11371-2 -> 5.3.0-123-test-CAS-11371-2 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-124-bugfix-CAS-11367-7 -> 5.3.0-124-bugfix-CAS-11367-7 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-124-test-ARD-12-FMAWP-1 -> 5.3.0-124-test-ARD-12-FMAWP-1 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-124-test-ARD-3-CppAWVRtesting-1 -> 5.3.0-124-test-ARD-3-CppAWVRtesting-1 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-124-test-ARD-3-testing-bamboo-1 -> 5.3.0-124-test-ARD-3-testing-bamboo-1 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-124-test-CAS-11216-6 -> 5.3.0-124-test-CAS-11216-6 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-125-test-CAS-11390-2 -> 5.3.0-125-test-CAS-11390-2 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-129-bugfix-CAS-11316-1 -> 5.3.0-129-bugfix-CAS-11316-1 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-129-bugfix-CAS-11397-5 -> 5.3.0-129-bugfix-CAS-11397-5 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-130-test-CAS-10567-1 -> 5.3.0-130-test-CAS-10567-1 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-19-feature-CAS-10768-7 -> 5.3.0-19-feature-CAS-10768-7 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-27-feature-CAS-10758-22 -> 5.3.0-27-feature-CAS-10758-22 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-3-feature-CAS-10647-4 -> 5.3.0-3-feature-CAS-10647-4 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-61-test-CAS-9094-4 -> 5.3.0-61-test-CAS-9094-4 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-7-feature-CAS-10684-24 -> 5.3.0-7-feature-CAS-10684-24 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-79-bugfix-CAS-10596-3 -> 5.3.0-79-bugfix-CAS-10596-3 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-99-bugfix-CAS-11183-3 -> 5.3.0-99-bugfix-CAS-11183-3 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-mas-108 -> 5.3.0-mas-108 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-mas-110 -> 5.3.0-mas-110 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-mas-124 -> 5.3.0-mas-124 error 12-Sep-2018 15:30:20 * [new tag] 5.3.0-rel-143 -> 5.3.0-rel-143 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-16-bugfix-CAS-11528-4 -> 5.4.0-16-bugfix-CAS-11528-4 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-17-bugfix-CAS-11243-1 -> 5.4.0-17-bugfix-CAS-11243-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-19-test-CAS-11432-6 -> 5.4.0-19-test-CAS-11432-6 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-22-test-CAS-11174-1 -> 5.4.0-22-test-CAS-11174-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-22-test-CAS-11582-1 -> 5.4.0-22-test-CAS-11582-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-22-test-CAS-11587-1 -> 5.4.0-22-test-CAS-11587-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-26-test-CAS-11597-3 -> 5.4.0-26-test-CAS-11597-3 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-27-test-CAS-11460-4 -> 5.4.0-27-test-CAS-11460-4 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-27-test-CAS-11606-1 -> 5.4.0-27-test-CAS-11606-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-27-test-CAS-11608-2 -> 5.4.0-27-test-CAS-11608-2 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-28-feature-CAS-9679-4 -> 5.4.0-28-feature-CAS-9679-4 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-28-test-CAS-11632-1 -> 5.4.0-28-test-CAS-11632-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-29-test-CAS-11639-2 -> 5.4.0-29-test-CAS-11639-2 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-30-test-CAS-11547-1 -> 5.4.0-30-test-CAS-11547-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-30-test-CAS-11640-2 -> 5.4.0-30-test-CAS-11640-2 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-30-test-CAS-11643-3 -> 5.4.0-30-test-CAS-11643-3 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-32-test-CAS-11662-1 -> 5.4.0-32-test-CAS-11662-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-34-test-CAS-11501-7 -> 5.4.0-34-test-CAS-11501-7 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-34-test-CAS-11623-1 -> 5.4.0-34-test-CAS-11623-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-36-test-CAS-11523-2 -> 5.4.0-36-test-CAS-11523-2 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-36-test-CAS-11549-1 -> 5.4.0-36-test-CAS-11549-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-36-test-CAS-11668-4 -> 5.4.0-36-test-CAS-11668-4 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-39-bugfix-CAS-11139-2 -> 5.4.0-39-bugfix-CAS-11139-2 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-41-bugfix-CAS-11693-4 -> 5.4.0-41-bugfix-CAS-11693-4 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-43-test-CAS-10593-1 -> 5.4.0-43-test-CAS-10593-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-48-test-CAS-11722-1 -> 5.4.0-48-test-CAS-11722-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-48-test-CAS-11868-1 -> 5.4.0-48-test-CAS-11868-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-49-bugfix-CAS-10518-1 -> 5.4.0-49-bugfix-CAS-10518-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-49-bugfix-CAS-11796-1 -> 5.4.0-49-bugfix-CAS-11796-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-5-test-CAS-11478-1 -> 5.4.0-5-test-CAS-11478-1 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-7-test-CAS-7555-3 -> 5.4.0-7-test-CAS-7555-3 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-mas-13 -> 5.4.0-mas-13 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-mas-15 -> 5.4.0-mas-15 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-mas-17 -> 5.4.0-mas-17 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-mas-19 -> 5.4.0-mas-19 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-mas-32 -> 5.4.0-mas-32 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-mas-48 -> 5.4.0-mas-48 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-mas-49 -> 5.4.0-mas-49 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-rel-50 -> 5.4.0-rel-50 error 12-Sep-2018 15:30:20 * [new tag] 5.4.0-rel-66 -> 5.4.0-rel-66 error 12-Sep-2018 15:30:20 * [new tag] 5.4.1-rel-10 -> 5.4.1-rel-10 error 12-Sep-2018 15:30:20 * [new tag] 5.5.0-10-bugfix-CAS-11805-1 -> 5.5.0-10-bugfix-CAS-11805-1 error 12-Sep-2018 15:30:20 * [new tag] 5.5.0-13-test-CAS-11818-1 -> 5.5.0-13-test-CAS-11818-1 error 12-Sep-2018 15:30:20 * [new tag] 5.5.0-16-bugfix-CAS-11839-2 -> 5.5.0-16-bugfix-CAS-11839-2 error 12-Sep-2018 15:30:20 * [new tag] 5.5.0-17-feature-CAS-11701-1 -> 5.5.0-17-feature-CAS-11701-1 error 12-Sep-2018 15:30:20 * [new tag] 5.5.0-17-test-CAS-11850-2 -> 5.5.0-17-test-CAS-11850-2 error 12-Sep-2018 15:30:20 * [new tag] 5.5.0-2-test-CAS-11596-1 -> 5.5.0-2-test-CAS-11596-1 error 12-Sep-2018 15:30:20 * [new tag] 5.5.0-21-test-CAS-11875-1 -> 5.5.0-21-test-CAS-11875-1 error 12-Sep-2018 15:30:20 * [new tag] 5.5.0-7-bugfix-CAS-10692-1 -> 5.5.0-7-bugfix-CAS-10692-1 error 12-Sep-2018 15:30:20 * [new tag] 5.5.0-mas-15 -> 5.5.0-mas-15 error 12-Sep-2018 15:30:20 * [new tag] 5.5.0-mas-18 -> 5.5.0-mas-18 error 12-Sep-2018 15:30:20 * [new tag] 5.5.0-mas-20 -> 5.5.0-mas-20 error 12-Sep-2018 15:30:20 * [new tag] 5.5.0-mas-21 -> 5.5.0-mas-21 error 12-Sep-2018 15:30:21 From ssh://open-bitbucket.nrao.edu:7999/casa/casa error 12-Sep-2018 15:30:21 * [new tag] 5.1.0-2-bugfix-CAS-9968-6 -> 5.1.0-2-bugfix-CAS-9968-6 error 12-Sep-2018 15:30:21 * [new tag] 5.1.0-2-bugfix-CAS-9968-7 -> 5.1.0-2-bugfix-CAS-9968-7 error 12-Sep-2018 15:30:21 * [new tag] 5.1.0-29-feature-CAS-9089-5 -> 5.1.0-29-feature-CAS-9089-5 error 12-Sep-2018 15:30:21 * [new tag] 5.1.0-29-feature-CAS-9089-6 -> 5.1.0-29-feature-CAS-9089-6 error 12-Sep-2018 15:30:21 * [new tag] 5.1.0-57-feature-CAS-10540-3 -> 5.1.0-57-feature-CAS-10540-3 error 12-Sep-2018 15:30:21 * [new tag] 5.1.0-58-feature-CAS-10591-3 -> 5.1.0-58-feature-CAS-10591-3 error 12-Sep-2018 15:30:21 * [new tag] 5.1.0-58-feature-CAS-10591-4 -> 5.1.0-58-feature-CAS-10591-4 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-100-bugfix-CAS-11224-3 -> 5.3.0-100-bugfix-CAS-11224-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-100-feature-CAS-10060-2 -> 5.3.0-100-feature-CAS-10060-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-100-feature-CAS-10060-3 -> 5.3.0-100-feature-CAS-10060-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-100-feature-CAS-10060-4 -> 5.3.0-100-feature-CAS-10060-4 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-102-test-CAS-11259-4 -> 5.3.0-102-test-CAS-11259-4 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-102-test-CAS-11259-5 -> 5.3.0-102-test-CAS-11259-5 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-103-bugfix-CAS-11269-2 -> 5.3.0-103-bugfix-CAS-11269-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-106-bugfix-CAS-11288-2 -> 5.3.0-106-bugfix-CAS-11288-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-107-bugfix-CAS-10937-3 -> 5.3.0-107-bugfix-CAS-10937-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-107-test-CAS-11296-1 -> 5.3.0-107-test-CAS-11296-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-108-test-CAS-11278-1 -> 5.3.0-108-test-CAS-11278-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-108-test-CAS-11278-2 -> 5.3.0-108-test-CAS-11278-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-108-test-CAS-11278-3 -> 5.3.0-108-test-CAS-11278-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-109-feature-CAS-11298-1 -> 5.3.0-109-feature-CAS-11298-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-109-feature-CAS-11298-2 -> 5.3.0-109-feature-CAS-11298-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-109-feature-CAS-11298-3 -> 5.3.0-109-feature-CAS-11298-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-109-feature-CAS-11298-4 -> 5.3.0-109-feature-CAS-11298-4 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-109-feature-CAS-11298-5 -> 5.3.0-109-feature-CAS-11298-5 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-109-test-CAS-11304-1 -> 5.3.0-109-test-CAS-11304-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-110-test-CAS-11293-1 -> 5.3.0-110-test-CAS-11293-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-112-bugfix-CAS-9231-1 -> 5.3.0-112-bugfix-CAS-9231-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-112-bugfix-CAS-9231-2 -> 5.3.0-112-bugfix-CAS-9231-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-112-bugfix-CAS-9231-3 -> 5.3.0-112-bugfix-CAS-9231-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-112-feature-CAS-11312-1 -> 5.3.0-112-feature-CAS-11312-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-112-test-CAS-11276-1 -> 5.3.0-112-test-CAS-11276-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-112-test-CAS-11276-2 -> 5.3.0-112-test-CAS-11276-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-112-test-CAS-11276-3 -> 5.3.0-112-test-CAS-11276-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-112-test-CAS-11310-1 -> 5.3.0-112-test-CAS-11310-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-112-test-CAS-11315-1 -> 5.3.0-112-test-CAS-11315-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-115-test-CAS-11332-1 -> 5.3.0-115-test-CAS-11332-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-116-bugfix-CAS-11333-1 -> 5.3.0-116-bugfix-CAS-11333-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-116-bugfix-CAS-11333-2 -> 5.3.0-116-bugfix-CAS-11333-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-116-test-CAS-11262-1 -> 5.3.0-116-test-CAS-11262-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-116-test-CAS-11334-1 -> 5.3.0-116-test-CAS-11334-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-116-test-CAS-11334-2 -> 5.3.0-116-test-CAS-11334-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-118-test-CAS-10576-1 -> 5.3.0-118-test-CAS-10576-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-118-test-CAS-10576-2 -> 5.3.0-118-test-CAS-10576-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-118-test-CAS-11347-1 -> 5.3.0-118-test-CAS-11347-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-118-test-CAS-11347-2 -> 5.3.0-118-test-CAS-11347-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-119-bugfix-CAS-11349-1 -> 5.3.0-119-bugfix-CAS-11349-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-119-bugfix-CAS-11355-1 -> 5.3.0-119-bugfix-CAS-11355-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-119-bugfix-CAS-11355-2 -> 5.3.0-119-bugfix-CAS-11355-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-119-test-CAS-11009-1 -> 5.3.0-119-test-CAS-11009-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-119-test-CAS-11009-2 -> 5.3.0-119-test-CAS-11009-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-119-test-CAS-11009-3 -> 5.3.0-119-test-CAS-11009-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-119-test-CAS-11009-4 -> 5.3.0-119-test-CAS-11009-4 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-119-test-CAS-11009-5 -> 5.3.0-119-test-CAS-11009-5 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-120-test-CAS-11358-1 -> 5.3.0-120-test-CAS-11358-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-120-test-CAS-11358-2 -> 5.3.0-120-test-CAS-11358-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-120-test-CAS-11358-3 -> 5.3.0-120-test-CAS-11358-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-120-test-CAS-9139-1 -> 5.3.0-120-test-CAS-9139-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-121-test-CAS-11365-1 -> 5.3.0-121-test-CAS-11365-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-122-feature-CAS-11364-1 -> 5.3.0-122-feature-CAS-11364-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-122-test-CAS-11370-1 -> 5.3.0-122-test-CAS-11370-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-122-test-CAS-11370-2 -> 5.3.0-122-test-CAS-11370-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-122-test-CAS-11370-3 -> 5.3.0-122-test-CAS-11370-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-123-test-ARD-master-sb-1 -> 5.3.0-123-test-ARD-master-sb-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-123-test-ARD-master-sb-2 -> 5.3.0-123-test-ARD-master-sb-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-123-test-CAS-11371-1 -> 5.3.0-123-test-CAS-11371-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-124-bugfix-CAS-11367-1 -> 5.3.0-124-bugfix-CAS-11367-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-124-bugfix-CAS-11367-2 -> 5.3.0-124-bugfix-CAS-11367-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-124-bugfix-CAS-11367-3 -> 5.3.0-124-bugfix-CAS-11367-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-124-bugfix-CAS-11367-4 -> 5.3.0-124-bugfix-CAS-11367-4 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-124-bugfix-CAS-11367-5 -> 5.3.0-124-bugfix-CAS-11367-5 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-124-bugfix-CAS-11367-6 -> 5.3.0-124-bugfix-CAS-11367-6 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-124-test-CAS-11012-1 -> 5.3.0-124-test-CAS-11012-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-124-test-CAS-11012-2 -> 5.3.0-124-test-CAS-11012-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-124-test-CAS-11216-1 -> 5.3.0-124-test-CAS-11216-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-124-test-CAS-11216-2 -> 5.3.0-124-test-CAS-11216-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-124-test-CAS-11216-3 -> 5.3.0-124-test-CAS-11216-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-124-test-CAS-11216-4 -> 5.3.0-124-test-CAS-11216-4 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-124-test-CAS-11216-5 -> 5.3.0-124-test-CAS-11216-5 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-125-test-CAS-11390-1 -> 5.3.0-125-test-CAS-11390-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-128-test-CAS-11403-1 -> 5.3.0-128-test-CAS-11403-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-128-test-CAS-11403-2 -> 5.3.0-128-test-CAS-11403-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-129-bugfix-CAS-11397-1 -> 5.3.0-129-bugfix-CAS-11397-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-129-bugfix-CAS-11397-2 -> 5.3.0-129-bugfix-CAS-11397-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-129-bugfix-CAS-11397-3 -> 5.3.0-129-bugfix-CAS-11397-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-129-bugfix-CAS-11397-4 -> 5.3.0-129-bugfix-CAS-11397-4 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-129-test-CAS-11041-1 -> 5.3.0-129-test-CAS-11041-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-129-test-CAS-11041-2 -> 5.3.0-129-test-CAS-11041-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-130-test-CAS-11338-1 -> 5.3.0-130-test-CAS-11338-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-130-test-CAS-11338-2 -> 5.3.0-130-test-CAS-11338-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-130-test-CAS-11418-1 -> 5.3.0-130-test-CAS-11418-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-130-test-CAS-11418-2 -> 5.3.0-130-test-CAS-11418-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-132-bugfix-CAS-10701-1 -> 5.3.0-132-bugfix-CAS-10701-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-132-bugfix-CAS-10701-2 -> 5.3.0-132-bugfix-CAS-10701-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-132-bugfix-CAS-11297-1 -> 5.3.0-132-bugfix-CAS-11297-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-132-bugfix-CAS-11297-2 -> 5.3.0-132-bugfix-CAS-11297-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-132-bugfix-CAS-11421-1 -> 5.3.0-132-bugfix-CAS-11421-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-132-test-CAS-11375-1 -> 5.3.0-132-test-CAS-11375-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-132-test-CAS-11375-2 -> 5.3.0-132-test-CAS-11375-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-132-test-CAS-11420-1 -> 5.3.0-132-test-CAS-11420-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-132-test-CAS-11420-2 -> 5.3.0-132-test-CAS-11420-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-132-test-CAS-11420-3 -> 5.3.0-132-test-CAS-11420-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-134-test-CAS-11357-1 -> 5.3.0-134-test-CAS-11357-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-134-test-CAS-11428-1 -> 5.3.0-134-test-CAS-11428-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-134-test-CAS-11428-2 -> 5.3.0-134-test-CAS-11428-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-136-test-CAS-11422-1 -> 5.3.0-136-test-CAS-11422-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-136-test-CAS-11422-2 -> 5.3.0-136-test-CAS-11422-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-136-test-CAS-11422-3 -> 5.3.0-136-test-CAS-11422-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-136-test-CAS-11440-1 -> 5.3.0-136-test-CAS-11440-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-136-test-CAS-11440-2 -> 5.3.0-136-test-CAS-11440-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-136-test-CAS-11446-1 -> 5.3.0-136-test-CAS-11446-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-136-test-CAS-11446-2 -> 5.3.0-136-test-CAS-11446-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-136-test-CAS-11446-3 -> 5.3.0-136-test-CAS-11446-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-136-test-CAS-11470-1 -> 5.3.0-136-test-CAS-11470-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-136-test-CAS-11470-2 -> 5.3.0-136-test-CAS-11470-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-15-bugfix-CAS-10738-6 -> 5.3.0-15-bugfix-CAS-10738-6 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-15-bugfix-CAS-10738-7 -> 5.3.0-15-bugfix-CAS-10738-7 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-19-feature-CAS-10768-5 -> 5.3.0-19-feature-CAS-10768-5 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-19-feature-CAS-10768-6 -> 5.3.0-19-feature-CAS-10768-6 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-3-feature-CAS-9538-10 -> 5.3.0-3-feature-CAS-9538-10 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-3-feature-CAS-9538-7 -> 5.3.0-3-feature-CAS-9538-7 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-3-feature-CAS-9538-8 -> 5.3.0-3-feature-CAS-9538-8 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-3-feature-CAS-9538-9 -> 5.3.0-3-feature-CAS-9538-9 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-52-bugfix-CAS-10530-5 -> 5.3.0-52-bugfix-CAS-10530-5 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-52-bugfix-CAS-10530-6 -> 5.3.0-52-bugfix-CAS-10530-6 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-52-bugfix-CAS-10530-7 -> 5.3.0-52-bugfix-CAS-10530-7 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-52-bugfix-CAS-10941-3 -> 5.3.0-52-bugfix-CAS-10941-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-52-bugfix-CAS-10941-4 -> 5.3.0-52-bugfix-CAS-10941-4 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-60-feature-CAS-10516-3 -> 5.3.0-60-feature-CAS-10516-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-60-feature-CAS-10516-4 -> 5.3.0-60-feature-CAS-10516-4 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-60-feature-CAS-10516-5 -> 5.3.0-60-feature-CAS-10516-5 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-63-feature-CAS-8556-8 -> 5.3.0-63-feature-CAS-8556-8 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-63-feature-CAS-8556-9 -> 5.3.0-63-feature-CAS-8556-9 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-64-bugfix-CAS-11059-3 -> 5.3.0-64-bugfix-CAS-11059-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-64-bugfix-CAS-11059-4 -> 5.3.0-64-bugfix-CAS-11059-4 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-64-bugfix-CAS-11059-5 -> 5.3.0-64-bugfix-CAS-11059-5 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-64-bugfix-CAS-11059-6 -> 5.3.0-64-bugfix-CAS-11059-6 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-7-feature-CAS-10684-22 -> 5.3.0-7-feature-CAS-10684-22 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-7-feature-CAS-10684-23 -> 5.3.0-7-feature-CAS-10684-23 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-73-feature-CAS-2961-3 -> 5.3.0-73-feature-CAS-2961-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-73-feature-CAS-5808-3 -> 5.3.0-73-feature-CAS-5808-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-73-feature-CAS-5808-4 -> 5.3.0-73-feature-CAS-5808-4 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-73-feature-CAS-5808-5 -> 5.3.0-73-feature-CAS-5808-5 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-73-feature-CAS-5808-6 -> 5.3.0-73-feature-CAS-5808-6 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-73-feature-CAS-5808-7 -> 5.3.0-73-feature-CAS-5808-7 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-76-bugfix-CAS-10584-5 -> 5.3.0-76-bugfix-CAS-10584-5 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-76-bugfix-CAS-10584-6 -> 5.3.0-76-bugfix-CAS-10584-6 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-79-bugfix-CAS-10596-2 -> 5.3.0-79-bugfix-CAS-10596-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-79-feature-CAS-11058-6 -> 5.3.0-79-feature-CAS-11058-6 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-79-feature-CAS-11058-7 -> 5.3.0-79-feature-CAS-11058-7 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-84-test-ARD-5-1 -> 5.3.0-84-test-ARD-5-1 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-85-test-CAS-11178-2 -> 5.3.0-85-test-CAS-11178-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-85-test-CAS-11178-3 -> 5.3.0-85-test-CAS-11178-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-88-test-CAS-11135-10 -> 5.3.0-88-test-CAS-11135-10 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-88-test-CAS-11135-2 -> 5.3.0-88-test-CAS-11135-2 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-88-test-CAS-11135-3 -> 5.3.0-88-test-CAS-11135-3 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-88-test-CAS-11135-4 -> 5.3.0-88-test-CAS-11135-4 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-88-test-CAS-11135-5 -> 5.3.0-88-test-CAS-11135-5 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-88-test-CAS-11135-6 -> 5.3.0-88-test-CAS-11135-6 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-88-test-CAS-11135-7 -> 5.3.0-88-test-CAS-11135-7 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-88-test-CAS-11135-8 -> 5.3.0-88-test-CAS-11135-8 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-88-test-CAS-11135-9 -> 5.3.0-88-test-CAS-11135-9 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-109 -> 5.3.0-mas-109 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-111 -> 5.3.0-mas-111 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-112 -> 5.3.0-mas-112 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-113 -> 5.3.0-mas-113 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-114 -> 5.3.0-mas-114 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-115 -> 5.3.0-mas-115 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-116 -> 5.3.0-mas-116 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-117 -> 5.3.0-mas-117 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-118 -> 5.3.0-mas-118 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-119 -> 5.3.0-mas-119 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-120 -> 5.3.0-mas-120 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-121 -> 5.3.0-mas-121 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-122 -> 5.3.0-mas-122 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-123 -> 5.3.0-mas-123 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-125 -> 5.3.0-mas-125 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-126 -> 5.3.0-mas-126 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-127 -> 5.3.0-mas-127 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-128 -> 5.3.0-mas-128 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-129 -> 5.3.0-mas-129 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-130 -> 5.3.0-mas-130 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-131 -> 5.3.0-mas-131 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-132 -> 5.3.0-mas-132 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-133 -> 5.3.0-mas-133 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-134 -> 5.3.0-mas-134 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-135 -> 5.3.0-mas-135 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-mas-136 -> 5.3.0-mas-136 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-rel-137 -> 5.3.0-rel-137 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-rel-138 -> 5.3.0-rel-138 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-rel-139 -> 5.3.0-rel-139 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-rel-140 -> 5.3.0-rel-140 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-rel-141 -> 5.3.0-rel-141 error 12-Sep-2018 15:30:21 * [new tag] 5.3.0-rel-142 -> 5.3.0-rel-142 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-10-bugfix-CAS-11502-1 -> 5.4.0-10-bugfix-CAS-11502-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-10-bugfix-CAS-11502-2 -> 5.4.0-10-bugfix-CAS-11502-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-11-bugfix-CAS-10326-1 -> 5.4.0-11-bugfix-CAS-10326-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-11-bugfix-CAS-10326-2 -> 5.4.0-11-bugfix-CAS-10326-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-11-test-CAS-11255-1 -> 5.4.0-11-test-CAS-11255-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-11-test-CAS-11255-2 -> 5.4.0-11-test-CAS-11255-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-11-test-CAS-11255-3 -> 5.4.0-11-test-CAS-11255-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-11-test-CAS-11255-4 -> 5.4.0-11-test-CAS-11255-4 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-13-bugfix-CAS-10664-1 -> 5.4.0-13-bugfix-CAS-10664-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-13-feature-CAS-10693-1 -> 5.4.0-13-feature-CAS-10693-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-13-feature-CAS-10693-2 -> 5.4.0-13-feature-CAS-10693-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-13-feature-CAS-11531-1 -> 5.4.0-13-feature-CAS-11531-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-15-bugfix-CAS-11414-1 -> 5.4.0-15-bugfix-CAS-11414-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-15-bugfix-CAS-11414-2 -> 5.4.0-15-bugfix-CAS-11414-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-15-test-CAS-8222-1 -> 5.4.0-15-test-CAS-8222-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-15-test-CAS-8222-2 -> 5.4.0-15-test-CAS-8222-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-15-test-CAS-8222-3 -> 5.4.0-15-test-CAS-8222-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-16-bugfix-CAS-11528-1 -> 5.4.0-16-bugfix-CAS-11528-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-16-bugfix-CAS-11528-2 -> 5.4.0-16-bugfix-CAS-11528-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-16-bugfix-CAS-11528-3 -> 5.4.0-16-bugfix-CAS-11528-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-16-test-CAS-11504-1 -> 5.4.0-16-test-CAS-11504-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-16-test-CAS-11524-1 -> 5.4.0-16-test-CAS-11524-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-16-test-CAS-11535-1 -> 5.4.0-16-test-CAS-11535-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-16-test-CAS-11540-1 -> 5.4.0-16-test-CAS-11540-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-16-test-CAS-11540-2 -> 5.4.0-16-test-CAS-11540-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-17-test-CAS-11545-1 -> 5.4.0-17-test-CAS-11545-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-17-test-CAS-11545-2 -> 5.4.0-17-test-CAS-11545-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-17-test-CAS-11545-3 -> 5.4.0-17-test-CAS-11545-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-17-test-CAS-11548-1 -> 5.4.0-17-test-CAS-11548-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-17-test-CAS-11548-2 -> 5.4.0-17-test-CAS-11548-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-17-test-CAS-11548-3 -> 5.4.0-17-test-CAS-11548-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-19-test-ARD-8-1 -> 5.4.0-19-test-ARD-8-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-19-test-CAS-11432-1 -> 5.4.0-19-test-CAS-11432-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-19-test-CAS-11432-2 -> 5.4.0-19-test-CAS-11432-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-19-test-CAS-11432-3 -> 5.4.0-19-test-CAS-11432-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-19-test-CAS-11432-4 -> 5.4.0-19-test-CAS-11432-4 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-19-test-CAS-11432-5 -> 5.4.0-19-test-CAS-11432-5 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-19-test-CAS-11557-1 -> 5.4.0-19-test-CAS-11557-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-19-test-CAS-11557-2 -> 5.4.0-19-test-CAS-11557-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-2-bugfix-CAS-11429-1 -> 5.4.0-2-bugfix-CAS-11429-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-2-test-CAS-10298-1 -> 5.4.0-2-test-CAS-10298-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-2-test-CAS-10298-2 -> 5.4.0-2-test-CAS-10298-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-2-test-CAS-11394-1 -> 5.4.0-2-test-CAS-11394-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-2-test-CAS-11394-2 -> 5.4.0-2-test-CAS-11394-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-2-test-CAS-11394-3 -> 5.4.0-2-test-CAS-11394-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-20-test-CAS-11554-1 -> 5.4.0-20-test-CAS-11554-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-20-test-CAS-11554-2 -> 5.4.0-20-test-CAS-11554-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-21-bugfix-CAS-11423-1 -> 5.4.0-21-bugfix-CAS-11423-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-21-bugfix-CAS-11562-1 -> 5.4.0-21-bugfix-CAS-11562-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-21-bugfix-CAS-11571-1 -> 5.4.0-21-bugfix-CAS-11571-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-22-bugfix-CAS-11087-1 -> 5.4.0-22-bugfix-CAS-11087-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-22-bugfix-CAS-11087-2 -> 5.4.0-22-bugfix-CAS-11087-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-22-bugfix-CAS-11087-3 -> 5.4.0-22-bugfix-CAS-11087-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-22-test-CAS-11565-1 -> 5.4.0-22-test-CAS-11565-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-22-test-CAS-11565-2 -> 5.4.0-22-test-CAS-11565-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-22-test-CAS-11565-3 -> 5.4.0-22-test-CAS-11565-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-22-test-CAS-11584-1 -> 5.4.0-22-test-CAS-11584-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-22-test-CAS-11584-2 -> 5.4.0-22-test-CAS-11584-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-23-bugfix-CAS-11520-1 -> 5.4.0-23-bugfix-CAS-11520-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-23-bugfix-CAS-11520-2 -> 5.4.0-23-bugfix-CAS-11520-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-23-bugfix-CAS-11520-3 -> 5.4.0-23-bugfix-CAS-11520-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-23-bugfix-CAS-11520-4 -> 5.4.0-23-bugfix-CAS-11520-4 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-23-feature-CAS-11590-1 -> 5.4.0-23-feature-CAS-11590-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-23-test-CAS-10444-1 -> 5.4.0-23-test-CAS-10444-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-23-test-CAS-10444-2 -> 5.4.0-23-test-CAS-10444-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-23-test-CAS-10444-3 -> 5.4.0-23-test-CAS-10444-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-23-test-CAS-11592-1 -> 5.4.0-23-test-CAS-11592-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-25-test-CAS-11574-1 -> 5.4.0-25-test-CAS-11574-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-25-test-CAS-11574-2 -> 5.4.0-25-test-CAS-11574-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-25-test-CAS-11574-3 -> 5.4.0-25-test-CAS-11574-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11512-1 -> 5.4.0-26-test-CAS-11512-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11512-2 -> 5.4.0-26-test-CAS-11512-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11512-3 -> 5.4.0-26-test-CAS-11512-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11512-4 -> 5.4.0-26-test-CAS-11512-4 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11512-5 -> 5.4.0-26-test-CAS-11512-5 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11512-6 -> 5.4.0-26-test-CAS-11512-6 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11577-1 -> 5.4.0-26-test-CAS-11577-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11577-2 -> 5.4.0-26-test-CAS-11577-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11577-3 -> 5.4.0-26-test-CAS-11577-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11577-4 -> 5.4.0-26-test-CAS-11577-4 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11597-1 -> 5.4.0-26-test-CAS-11597-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11597-2 -> 5.4.0-26-test-CAS-11597-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11600-1 -> 5.4.0-26-test-CAS-11600-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-26-test-CAS-11600-2 -> 5.4.0-26-test-CAS-11600-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-bugfix-CAS-11415-1 -> 5.4.0-27-bugfix-CAS-11415-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-bugfix-CAS-11415-2 -> 5.4.0-27-bugfix-CAS-11415-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-bugfix-CAS-11482-1 -> 5.4.0-27-bugfix-CAS-11482-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-bugfix-CAS-11482-2 -> 5.4.0-27-bugfix-CAS-11482-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-bugfix-CAS-11507-1 -> 5.4.0-27-bugfix-CAS-11507-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-bugfix-CAS-11507-2 -> 5.4.0-27-bugfix-CAS-11507-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-feature-CAS-9997-1 -> 5.4.0-27-feature-CAS-9997-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-feature-CAS-9997-2 -> 5.4.0-27-feature-CAS-9997-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-feature-CAS-9997-3 -> 5.4.0-27-feature-CAS-9997-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-feature-CAS-9997-4 -> 5.4.0-27-feature-CAS-9997-4 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11460-1 -> 5.4.0-27-test-CAS-11460-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11460-2 -> 5.4.0-27-test-CAS-11460-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11460-3 -> 5.4.0-27-test-CAS-11460-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11525-1 -> 5.4.0-27-test-CAS-11525-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11525-2 -> 5.4.0-27-test-CAS-11525-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11525-3 -> 5.4.0-27-test-CAS-11525-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11579-1 -> 5.4.0-27-test-CAS-11579-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11608-1 -> 5.4.0-27-test-CAS-11608-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11609-1 -> 5.4.0-27-test-CAS-11609-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11609-2 -> 5.4.0-27-test-CAS-11609-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11610-1 -> 5.4.0-27-test-CAS-11610-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11610-2 -> 5.4.0-27-test-CAS-11610-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11613-1 -> 5.4.0-27-test-CAS-11613-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11613-2 -> 5.4.0-27-test-CAS-11613-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11613-3 -> 5.4.0-27-test-CAS-11613-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11614-1 -> 5.4.0-27-test-CAS-11614-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11628-1 -> 5.4.0-27-test-CAS-11628-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11628-2 -> 5.4.0-27-test-CAS-11628-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11628-3 -> 5.4.0-27-test-CAS-11628-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11628-4 -> 5.4.0-27-test-CAS-11628-4 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-27-test-CAS-11628-5 -> 5.4.0-27-test-CAS-11628-5 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-28-feature-CAS-9679-1 -> 5.4.0-28-feature-CAS-9679-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-28-feature-CAS-9679-2 -> 5.4.0-28-feature-CAS-9679-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-28-feature-CAS-9679-3 -> 5.4.0-28-feature-CAS-9679-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-28-test-CAS-11637-1 -> 5.4.0-28-test-CAS-11637-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-29-test-CAS-11639-1 -> 5.4.0-29-test-CAS-11639-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-3-bugfix-CAS-11223-1 -> 5.4.0-3-bugfix-CAS-11223-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-3-bugfix-CAS-11223-2 -> 5.4.0-3-bugfix-CAS-11223-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-3-bugfix-CAS-11223-3 -> 5.4.0-3-bugfix-CAS-11223-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-3-bugfix-CAS-11261-1 -> 5.4.0-3-bugfix-CAS-11261-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-3-bugfix-CAS-11261-2 -> 5.4.0-3-bugfix-CAS-11261-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-3-bugfix-CAS-11261-3 -> 5.4.0-3-bugfix-CAS-11261-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-3-test-CAS-11330-1 -> 5.4.0-3-test-CAS-11330-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-3-test-CAS-11330-2 -> 5.4.0-3-test-CAS-11330-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-3-test-CAS-11330-3 -> 5.4.0-3-test-CAS-11330-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-3-test-CAS-11452-1 -> 5.4.0-3-test-CAS-11452-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-3-test-CAS-11469-1 -> 5.4.0-3-test-CAS-11469-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-3-test-CAS-11469-2 -> 5.4.0-3-test-CAS-11469-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-30-bugfix-CAS-11642-1 -> 5.4.0-30-bugfix-CAS-11642-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-30-bugfix-CAS-11642-2 -> 5.4.0-30-bugfix-CAS-11642-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-30-feature-CAS-11462-1 -> 5.4.0-30-feature-CAS-11462-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-30-test-CAS-11640-1 -> 5.4.0-30-test-CAS-11640-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-30-test-CAS-11643-1 -> 5.4.0-30-test-CAS-11643-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-30-test-CAS-11643-2 -> 5.4.0-30-test-CAS-11643-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-30-test-CAS-9548-1 -> 5.4.0-30-test-CAS-9548-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-30-test-CAS-9548-2 -> 5.4.0-30-test-CAS-9548-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-31-test-CAS-11646-1 -> 5.4.0-31-test-CAS-11646-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-34-bugfix-CAS-11654-1 -> 5.4.0-34-bugfix-CAS-11654-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-34-feature-CAS-11508-1 -> 5.4.0-34-feature-CAS-11508-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-34-test-CAS-11501-1 -> 5.4.0-34-test-CAS-11501-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-34-test-CAS-11501-2 -> 5.4.0-34-test-CAS-11501-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-34-test-CAS-11501-3 -> 5.4.0-34-test-CAS-11501-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-34-test-CAS-11501-4 -> 5.4.0-34-test-CAS-11501-4 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-34-test-CAS-11501-5 -> 5.4.0-34-test-CAS-11501-5 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-34-test-CAS-11501-6 -> 5.4.0-34-test-CAS-11501-6 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-34-test-CAS-11534-1 -> 5.4.0-34-test-CAS-11534-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-34-test-CAS-11655-1 -> 5.4.0-34-test-CAS-11655-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-35-test-CAS-11661-1 -> 5.4.0-35-test-CAS-11661-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-35-test-CAS-11661-2 -> 5.4.0-35-test-CAS-11661-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-36-test-CAS-11523-1 -> 5.4.0-36-test-CAS-11523-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-36-test-CAS-11668-1 -> 5.4.0-36-test-CAS-11668-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-37-test-CAS-11673-1 -> 5.4.0-37-test-CAS-11673-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-38-test-CAS-11679-1 -> 5.4.0-38-test-CAS-11679-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-38-test-CAS-11682-1 -> 5.4.0-38-test-CAS-11682-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-38-test-CAS-11682-2 -> 5.4.0-38-test-CAS-11682-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-39-bugfix-CAS-11139-1 -> 5.4.0-39-bugfix-CAS-11139-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-39-test-CAS-11683-1 -> 5.4.0-39-test-CAS-11683-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-4-feature-CAS-11335-1 -> 5.4.0-4-feature-CAS-11335-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-4-feature-CAS-11335-2 -> 5.4.0-4-feature-CAS-11335-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-4-test-CAS-11472-1 -> 5.4.0-4-test-CAS-11472-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-4-test-CAS-11472-2 -> 5.4.0-4-test-CAS-11472-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-4-test-CAS-11473-1 -> 5.4.0-4-test-CAS-11473-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-4-test-CAS-11555-1 -> 5.4.0-4-test-CAS-11555-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-40-bugfix-CAS-11653-1 -> 5.4.0-40-bugfix-CAS-11653-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-41-bugfix-CAS-11620-1 -> 5.4.0-41-bugfix-CAS-11620-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-41-bugfix-CAS-11693-1 -> 5.4.0-41-bugfix-CAS-11693-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-41-bugfix-CAS-11693-2 -> 5.4.0-41-bugfix-CAS-11693-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-41-bugfix-CAS-11693-3 -> 5.4.0-41-bugfix-CAS-11693-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-41-test-CAS-11703-1 -> 5.4.0-41-test-CAS-11703-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-42-bugfix-CAS-11687-1 -> 5.4.0-42-bugfix-CAS-11687-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-42-bugfix-CAS-11705-1 -> 5.4.0-42-bugfix-CAS-11705-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-45-bugfix-CAS-11708-1 -> 5.4.0-45-bugfix-CAS-11708-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-45-bugfix-CAS-11708-2 -> 5.4.0-45-bugfix-CAS-11708-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-46-test-CAS-11694-1 -> 5.4.0-46-test-CAS-11694-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-47-test-CAS-11684-1 -> 5.4.0-47-test-CAS-11684-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-47-test-CAS-11684-2 -> 5.4.0-47-test-CAS-11684-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-10865-1 -> 5.4.0-48-test-CAS-10865-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-10865-2 -> 5.4.0-48-test-CAS-10865-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-11727-1 -> 5.4.0-48-test-CAS-11727-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-11779-1 -> 5.4.0-48-test-CAS-11779-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-11791-1 -> 5.4.0-48-test-CAS-11791-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-11791-2 -> 5.4.0-48-test-CAS-11791-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-11799-1 -> 5.4.0-48-test-CAS-11799-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-11804-1 -> 5.4.0-48-test-CAS-11804-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-11804-2 -> 5.4.0-48-test-CAS-11804-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-11807-1 -> 5.4.0-48-test-CAS-11807-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-11807-2 -> 5.4.0-48-test-CAS-11807-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-11810-1 -> 5.4.0-48-test-CAS-11810-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-11814-1 -> 5.4.0-48-test-CAS-11814-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-48-test-CAS-11814-2 -> 5.4.0-48-test-CAS-11814-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-bugfix-CAS-11619-1 -> 5.4.0-49-bugfix-CAS-11619-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-bugfix-CAS-11765-1 -> 5.4.0-49-bugfix-CAS-11765-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-bugfix-CAS-11771-1 -> 5.4.0-49-bugfix-CAS-11771-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-bugfix-CAS-11777-1 -> 5.4.0-49-bugfix-CAS-11777-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-bugfix-CAS-11787-1 -> 5.4.0-49-bugfix-CAS-11787-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-bugfix-CAS-11797-1 -> 5.4.0-49-bugfix-CAS-11797-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-bugfix-CAS-11808-1 -> 5.4.0-49-bugfix-CAS-11808-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-bugfix-CAS-11816-1 -> 5.4.0-49-bugfix-CAS-11816-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-bugfix-CAS-11816-2 -> 5.4.0-49-bugfix-CAS-11816-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-bugfix-CAS-11865-1 -> 5.4.0-49-bugfix-CAS-11865-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-test-CAS-11508-1 -> 5.4.0-49-test-CAS-11508-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-test-CAS-11508-2 -> 5.4.0-49-test-CAS-11508-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-test-CAS-11739-1 -> 5.4.0-49-test-CAS-11739-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-test-CAS-11741-1 -> 5.4.0-49-test-CAS-11741-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-test-CAS-11741-2 -> 5.4.0-49-test-CAS-11741-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-test-CAS-11744-1 -> 5.4.0-49-test-CAS-11744-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-test-CAS-11744-2 -> 5.4.0-49-test-CAS-11744-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-test-CAS-11745-1 -> 5.4.0-49-test-CAS-11745-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-test-CAS-11770-1 -> 5.4.0-49-test-CAS-11770-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-test-CAS-11774-1 -> 5.4.0-49-test-CAS-11774-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-test-CAS-11776-1 -> 5.4.0-49-test-CAS-11776-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-test-CAS-11776-2 -> 5.4.0-49-test-CAS-11776-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-49-test-CAS-11794-1 -> 5.4.0-49-test-CAS-11794-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-5-test-CAS-11475-1 -> 5.4.0-5-test-CAS-11475-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-5-test-CAS-11475-2 -> 5.4.0-5-test-CAS-11475-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-5-test-CAS-11475-3 -> 5.4.0-5-test-CAS-11475-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-6-test-CAS-11481-1 -> 5.4.0-6-test-CAS-11481-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-6-test-CAS-11481-2 -> 5.4.0-6-test-CAS-11481-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-6-test-CAS-11481-3 -> 5.4.0-6-test-CAS-11481-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-7-test-CAS-11453-1 -> 5.4.0-7-test-CAS-11453-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-7-test-CAS-11483-1 -> 5.4.0-7-test-CAS-11483-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-7-test-CAS-7555-1 -> 5.4.0-7-test-CAS-7555-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-7-test-CAS-7555-2 -> 5.4.0-7-test-CAS-7555-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-9-bugfix-CAS-11346-1 -> 5.4.0-9-bugfix-CAS-11346-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-9-bugfix-CAS-11346-2 -> 5.4.0-9-bugfix-CAS-11346-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-9-bugfix-CAS-11442-1 -> 5.4.0-9-bugfix-CAS-11442-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-9-bugfix-CAS-11442-2 -> 5.4.0-9-bugfix-CAS-11442-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-9-bugfix-CAS-11442-3 -> 5.4.0-9-bugfix-CAS-11442-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-9-test-CAS-11498-1 -> 5.4.0-9-test-CAS-11498-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-9-test-CAS-11498-2 -> 5.4.0-9-test-CAS-11498-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-9-test-CAS-11498-3 -> 5.4.0-9-test-CAS-11498-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-9-test-CAS-11499-1 -> 5.4.0-9-test-CAS-11499-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-1 -> 5.4.0-mas-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-10 -> 5.4.0-mas-10 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-11 -> 5.4.0-mas-11 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-12 -> 5.4.0-mas-12 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-14 -> 5.4.0-mas-14 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-16 -> 5.4.0-mas-16 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-18 -> 5.4.0-mas-18 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-2 -> 5.4.0-mas-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-20 -> 5.4.0-mas-20 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-21 -> 5.4.0-mas-21 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-22 -> 5.4.0-mas-22 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-23 -> 5.4.0-mas-23 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-24 -> 5.4.0-mas-24 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-25 -> 5.4.0-mas-25 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-26 -> 5.4.0-mas-26 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-27 -> 5.4.0-mas-27 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-28 -> 5.4.0-mas-28 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-29 -> 5.4.0-mas-29 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-3 -> 5.4.0-mas-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-30 -> 5.4.0-mas-30 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-31 -> 5.4.0-mas-31 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-33 -> 5.4.0-mas-33 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-34 -> 5.4.0-mas-34 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-35 -> 5.4.0-mas-35 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-36 -> 5.4.0-mas-36 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-37 -> 5.4.0-mas-37 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-38 -> 5.4.0-mas-38 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-39 -> 5.4.0-mas-39 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-4 -> 5.4.0-mas-4 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-40 -> 5.4.0-mas-40 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-41 -> 5.4.0-mas-41 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-42 -> 5.4.0-mas-42 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-43 -> 5.4.0-mas-43 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-44 -> 5.4.0-mas-44 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-45 -> 5.4.0-mas-45 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-46 -> 5.4.0-mas-46 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-47 -> 5.4.0-mas-47 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-5 -> 5.4.0-mas-5 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-6 -> 5.4.0-mas-6 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-7 -> 5.4.0-mas-7 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-8 -> 5.4.0-mas-8 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-mas-9 -> 5.4.0-mas-9 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-51 -> 5.4.0-rel-51 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-52 -> 5.4.0-rel-52 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-53 -> 5.4.0-rel-53 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-54 -> 5.4.0-rel-54 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-55 -> 5.4.0-rel-55 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-56 -> 5.4.0-rel-56 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-57 -> 5.4.0-rel-57 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-58 -> 5.4.0-rel-58 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-59 -> 5.4.0-rel-59 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-60 -> 5.4.0-rel-60 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-61 -> 5.4.0-rel-61 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-62 -> 5.4.0-rel-62 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-63 -> 5.4.0-rel-63 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-64 -> 5.4.0-rel-64 error 12-Sep-2018 15:30:21 * [new tag] 5.4.0-rel-65 -> 5.4.0-rel-65 error 12-Sep-2018 15:30:21 * [new tag] 5.4.1-rel-1 -> 5.4.1-rel-1 error 12-Sep-2018 15:30:21 * [new tag] 5.4.1-rel-2 -> 5.4.1-rel-2 error 12-Sep-2018 15:30:21 * [new tag] 5.4.1-rel-3 -> 5.4.1-rel-3 error 12-Sep-2018 15:30:21 * [new tag] 5.4.1-rel-4 -> 5.4.1-rel-4 error 12-Sep-2018 15:30:21 * [new tag] 5.4.1-rel-5 -> 5.4.1-rel-5 error 12-Sep-2018 15:30:21 * [new tag] 5.4.1-rel-6 -> 5.4.1-rel-6 error 12-Sep-2018 15:30:21 * [new tag] 5.4.1-rel-7 -> 5.4.1-rel-7 error 12-Sep-2018 15:30:21 * [new tag] 5.4.1-rel-8 -> 5.4.1-rel-8 error 12-Sep-2018 15:30:21 * [new tag] 5.4.1-rel-9 -> 5.4.1-rel-9 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-10-test-CAS-11811-1 -> 5.5.0-10-test-CAS-11811-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-10-test-CAS-11813-1 -> 5.5.0-10-test-CAS-11813-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-11-bugfix-CAS-11819-1 -> 5.5.0-11-bugfix-CAS-11819-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-11-test-CAS-11052-1 -> 5.5.0-11-test-CAS-11052-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-11-test-CAS-11426-1 -> 5.5.0-11-test-CAS-11426-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-12-test-CAS-11825-1 -> 5.5.0-12-test-CAS-11825-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-15-bugfix-CAS-11818-1 -> 5.5.0-15-bugfix-CAS-11818-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-16-bugfix-CAS-11839-1 -> 5.5.0-16-bugfix-CAS-11839-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-16-test-CAS-11844-1 -> 5.5.0-16-test-CAS-11844-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-17-test-CAS-11850-1 -> 5.5.0-17-test-CAS-11850-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-19-test-CAS-11867-1 -> 5.5.0-19-test-CAS-11867-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-6-bugfix-CAS-11748-1 -> 5.5.0-6-bugfix-CAS-11748-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-6-bugfix-CAS-11772-1 -> 5.5.0-6-bugfix-CAS-11772-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-6-bugfix-CAS-11783-1 -> 5.5.0-6-bugfix-CAS-11783-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-6-test-CAS-11768-1 -> 5.5.0-6-test-CAS-11768-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-6-test-CAS-11768-2 -> 5.5.0-6-test-CAS-11768-2 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-6-test-CAS-11769-1 -> 5.5.0-6-test-CAS-11769-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-6-test-CAS-11773-1 -> 5.5.0-6-test-CAS-11773-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-6-test-CAS-11778-1 -> 5.5.0-6-test-CAS-11778-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-7-test-CAS-11711-1 -> 5.5.0-7-test-CAS-11711-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-7-test-CAS-11788-1 -> 5.5.0-7-test-CAS-11788-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-7-test-CAS-11790-1 -> 5.5.0-7-test-CAS-11790-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-7-test-CAS-11790-2 -> 5.5.0-7-test-CAS-11790-2 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-8-bugfix-CAS-11743-1 -> 5.5.0-8-bugfix-CAS-11743-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-9-test-CAS-11803-1 -> 5.5.0-9-test-CAS-11803-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-9-test-CAS-11803-2 -> 5.5.0-9-test-CAS-11803-2 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-9-test-CAS-11806-1 -> 5.5.0-9-test-CAS-11806-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-9-test-CAS-11806-2 -> 5.5.0-9-test-CAS-11806-2 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-1 -> 5.5.0-mas-1 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-10 -> 5.5.0-mas-10 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-11 -> 5.5.0-mas-11 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-12 -> 5.5.0-mas-12 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-13 -> 5.5.0-mas-13 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-14 -> 5.5.0-mas-14 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-16 -> 5.5.0-mas-16 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-17 -> 5.5.0-mas-17 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-19 -> 5.5.0-mas-19 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-2 -> 5.5.0-mas-2 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-3 -> 5.5.0-mas-3 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-4 -> 5.5.0-mas-4 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-5 -> 5.5.0-mas-5 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-6 -> 5.5.0-mas-6 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-7 -> 5.5.0-mas-7 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-8 -> 5.5.0-mas-8 error 12-Sep-2018 15:30:21 * [new tag] 5.5.0-mas-9 -> 5.5.0-mas-9 build 12-Sep-2018 15:30:21 Updating d3eb427..532eb7e build 12-Sep-2018 15:30:21 Fast-forward build 12-Sep-2018 15:30:22 casacore | 2 +- build 12-Sep-2018 15:30:22 code/CMakeLists.txt | 62 +- build 12-Sep-2018 15:30:22 code/air_casawvr/cmdline/wvrgcal.cpp | 226 +- build 12-Sep-2018 15:30:22 code/air_casawvr/cmdline/wvrgcalargs.hpp | 65 + build 12-Sep-2018 15:30:22 code/alma/ASDM/ASDMValuesParser.h | 78 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/AlmaRadiometerTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/AnnotationTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/AntennaTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalAmpliTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalAntennaSolutionsTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalAppPhaseTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalAtmosphereTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalBandpassTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalCurveTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalDataTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalDelayTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalDeviceTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalFluxTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalFocusModelTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalFocusTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalGainTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalHolographyTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalPhaseTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalPointingModelTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalPointingTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalPositionTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalPrimaryBeamTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalReductionTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalSeeingTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CalWVRTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/ConfigDescriptionTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/CorrelatorModeTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/DataDescriptionTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/DelayModelFixedParametersTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/DelayModelTable.cc | 24 +- build 12-Sep-2018 15:30:22 .../alma/ASDM/DelayModelVariableParametersTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/DopplerTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/EntityId.cc | 23 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/EphemerisTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/ExecBlockTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/FeedTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/FieldTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/FlagCmdTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/FlagTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/FocusModelTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/FocusTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/FreqOffsetTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/GainTrackingTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/HistoryTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/HolographyTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/MainTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/Misc.cc | 153 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/Misc.h | 84 + build 12-Sep-2018 15:30:22 code/alma/ASDM/ObservationTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/Parser.cc | 85 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/Parser.h | 5 + build 12-Sep-2018 15:30:22 code/alma/ASDM/PointingModelTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/PointingTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/PolarizationTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/ProcessorTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/PulsarTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/ReceiverTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/SBSummaryTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/ScaleTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/ScanTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/SeeingTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/SourceTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/SpectralWindowTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/SquareLawDetectorTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/StateTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/StationTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/SubscanTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/SwitchCycleTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/SysCalTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/SysPowerTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/TableStreamReader.h | 107 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/Tag.cc | 25 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/Tag.h | 11 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/TotalPowerTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/WVMCalTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDM/WeatherTable.cc | 24 +- build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/SDMBinData.cc | 70 +- build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/SDMBinData.h | 12 +- build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/SDMDataObject.cc | 23 +- build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/SDMDataObject.h | 18 +- build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/SDMDataObjectParser.cc | 107 +- build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/SDMDataObjectParser.h | 45 +- build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/SDMDataObjectReader.cc | 72 +- build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/SDMDataObjectReader.h | 26 +- build 12-Sep-2018 15:30:22 .../alma/ASDMBinaries/SDMDataObjectStreamReader.cc | 82 +- build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/SDMDataObjectStreamReader.h | 5 +- build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/SDMDataObjectWriter.h | 1 - build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/SDMDataViews.h | 9 +- build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/test/tReadAllBDFs.cc | 55 +- build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/test/tReadParBDFs.cc | 161 +- build 12-Sep-2018 15:30:22 code/alma/ASDMBinaries/test/tReadSeqBDFs.cc | 130 +- build 12-Sep-2018 15:30:22 code/alma/CMakeLists.txt | 33 +- build 12-Sep-2018 15:30:22 code/alma/Options/AlmaArg.h | 100 + build 12-Sep-2018 15:30:22 code/alma/apps/MS2asdm/MS2asdm.cc | 206 +- build 12-Sep-2018 15:30:22 code/alma/apps/asdm2MS/ASDM2MSFiller.cc | 86 +- build 12-Sep-2018 15:30:22 code/alma/apps/asdm2MS/ASDM2MSFiller.h | 37 +- build 12-Sep-2018 15:30:22 code/alma/apps/asdm2MS/AnyValueMap.hpp | 5 + build 12-Sep-2018 15:30:22 code/alma/apps/asdm2MS/Name2Table.cc | 45 +- build 12-Sep-2018 15:30:22 code/alma/apps/asdm2MS/ScansParser.cc | 140 + build 12-Sep-2018 15:30:22 code/alma/apps/asdm2MS/ScansParser.h | 20 + build 12-Sep-2018 15:30:22 code/alma/apps/asdm2MS/asdm2MS.cc | 1589 +++++----- build 12-Sep-2018 15:30:22 code/alma/apps/asdm2MS/asdm2MSGeneric.h | 21 +- build 12-Sep-2018 15:30:22 code/alma/apps/asdm2MS/bdflags2MS.cc | 521 +-- build 12-Sep-2018 15:30:22 code/alma/apps/asdm2MS/parasdm2MS.cc | 426 ++- build 12-Sep-2018 15:30:22 code/alma/apps/asdmSummary/asdmSummary.cc | 122 +- build 12-Sep-2018 15:30:22 code/atnf/atca/ATAtmosphere.cc | 8 +- build 12-Sep-2018 15:30:22 code/atnf/atca/ATCAFiller.cc | 6 +- build 12-Sep-2018 15:30:22 code/casaqt/CMakeLists.txt | 3 +- build 12-Sep-2018 15:30:22 code/casaqt/QwtPlotter/QPCanvas.cc | 28 +- build 12-Sep-2018 15:30:22 code/casaqt/QwtPlotter/QPCanvasHelpers.cc | 31 +- build 12-Sep-2018 15:30:22 code/casaqt/QwtPlotter/QPScatterPlot.cc | 4 +- build 12-Sep-2018 15:30:22 .../qcasabrowser.cc => casabrowser/casabrowser.cc} | 21 - build 12-Sep-2018 15:30:22 code/casaqt/apps/qcasabrowser/casabrowser | 16 - build 12-Sep-2018 15:30:22 code/components/CMakeLists.txt | 1 + build 12-Sep-2018 15:30:22 .../ComponentModels/FluxCalcLogFreqPolynomial.cc | 21 +- build 12-Sep-2018 15:30:22 .../ComponentModels/FluxCalcLogFreqPolynomial.h | 2 + build 12-Sep-2018 15:30:22 code/components/ComponentModels/FluxCalcVQS.cc | 26 +- build 12-Sep-2018 15:30:22 code/components/ComponentModels/FluxCalcVQS.h | 3 + build 12-Sep-2018 15:30:22 .../ComponentModels/FluxCalc_SS_JPL_Butler.cc | 12 +- build 12-Sep-2018 15:30:22 code/components/ComponentModels/FluxStandard.cc | 18 + build 12-Sep-2018 15:30:22 code/components/ComponentModels/FluxStandard.h | 3 + build 12-Sep-2018 15:30:22 code/components/ComponentModels/FluxStdSrcs.cc | 53 + build 12-Sep-2018 15:30:22 code/components/ComponentModels/FluxStdSrcs.h | 13 + build 12-Sep-2018 15:30:22 code/components/ComponentModels/FluxStdsQS2.cc | 59 + build 12-Sep-2018 15:30:22 code/components/ComponentModels/FluxStdsQS2.h | 38 + build 12-Sep-2018 15:30:22 code/components/ComponentModels/SkyComponent.cc | 2 +- build 12-Sep-2018 15:30:22 code/components/ComponentModels/SkyComponent.h | 2 +- build 12-Sep-2018 15:30:22 .../ComponentModels/SkyComponentFactory.cc | 3 +- build 12-Sep-2018 15:30:22 .../ComponentModels/SkyComponentFactory.h | 19 +- build 12-Sep-2018 15:30:22 .../ComponentModels/SkyComponentFactory2.tcc | 93 + build 12-Sep-2018 15:30:22 .../ComponentModels/test/FluxStandard2_GTest.cc | 240 +- build 12-Sep-2018 15:30:22 .../ComponentModels/test/FluxStandard2_GTest.h | 31 + build 12-Sep-2018 15:30:22 .../SpectralComponents/CompiledSpectralElement.cc | 4 +- build 12-Sep-2018 15:30:22 .../SpectralComponents/GaussianSpectralElement.cc | 6 +- build 12-Sep-2018 15:30:22 .../LorentzianSpectralElement.cc | 6 +- build 12-Sep-2018 15:30:22 .../SpectralComponents/PCFSpectralElement.cc | 2 +- build 12-Sep-2018 15:30:22 .../PolynomialSpectralElement.cc | 6 +- build 12-Sep-2018 15:30:22 .../PowerLogPolynomialSpectralElement.cc | 4 +- build 12-Sep-2018 15:30:22 .../SpectralComponents/SpectralElement.cc | 6 +- build 12-Sep-2018 15:30:22 .../SpectralComponents/SpectralElement.h | 6 +- build 12-Sep-2018 15:30:22 code/crash/CMakeLists.txt | 9 +- build 12-Sep-2018 15:30:22 code/crash/apps/reporter/CrashReportPoster.cc | 28 +- build 12-Sep-2018 15:30:22 code/crash/utils/CrashReportHelper.h | 83 + build 12-Sep-2018 15:30:22 code/display/CMakeLists.txt | 4 +- build 12-Sep-2018 15:30:22 code/display/Display/DisplayCoordinateSystem.h | 2 +- build 12-Sep-2018 15:30:22 code/display/Display/{State.cc => DisplayState.cc} | 2 +- build 12-Sep-2018 15:30:22 code/display/Display/{State.h => DisplayState.h} | 0 build 12-Sep-2018 15:30:22 code/display/Display/PanelDisplay.cc | 10 +- build 12-Sep-2018 15:30:22 code/display/Display/PanelDisplay.h | 6 +- build 12-Sep-2018 15:30:22 code/display/DisplayCanvas/WCCSNLAxisLabeller.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/DisplayData.h | 4 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/LatticeAsContour.h | 4 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/LatticeAsContour.tcc | 4 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/LatticeAsMarker.h | 4 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/LatticeAsMarker.tcc | 4 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/LatticeAsRaster.h | 4 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/LatticeAsRaster.tcc | 4 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/LatticeAsVector.h | 4 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/LatticeAsVector.tcc | 4 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/LatticeAsVector2.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/LatticePADD.h | 12 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/LatticePADD.tcc | 4 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/LatticePADD2.cc | 6 +- build 12-Sep-2018 15:30:22 code/display/DisplayDatas/Profile2dDD.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/MultiEllipseTool.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/MultiEllipseTool.h | 2 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/MultiPVTool.cc | 14 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/MultiPVTool.h | 8 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/MultiPointTool.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/MultiPointTool.h | 2 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/MultiPolyTool.cc | 6 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/MultiPolyTool.h | 8 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/MultiPolylineTool.cc | 6 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/MultiPolylineTool.h | 8 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/MultiRectTool.cc | 12 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/MultiRectTool.h | 8 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/RegionTool.cc | 10 +- build 12-Sep-2018 15:30:22 code/display/DisplayEvents/RegionTool.h | 6 +- build 12-Sep-2018 15:30:22 code/display/Fit/FindSourcesDialog.cc | 4 +- build 12-Sep-2018 15:30:22 code/display/Fit/FindSourcesDialog.qo.h | 4 +- build 12-Sep-2018 15:30:22 code/display/Fit/Fit2DTool.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/Fit/Fit2DTool.qo.h | 4 +- build 12-Sep-2018 15:30:22 code/display/Fit/Gaussian2DFitter.cc | 6 +- build 12-Sep-2018 15:30:22 code/display/Fit/Gaussian2DFitter.h | 10 +- build 12-Sep-2018 15:30:22 code/display/Fit/PixelRangeDialog.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/Fit/PixelRangeDialog.qo.h | 2 +- build 12-Sep-2018 15:30:22 code/display/Fit/ResidualHistogramDialog.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/Fit/ResidualHistogramDialog.qo.h | 2 +- build 12-Sep-2018 15:30:22 code/display/QtPlotter/CanvasCurve.cc | 4 +- build 12-Sep-2018 15:30:22 .../QtPlotter/MomentSettingsWidgetOptical.cc | 4 +- build 12-Sep-2018 15:30:22 .../display/QtPlotter/MomentSettingsWidgetRadio.cc | 20 +- build 12-Sep-2018 15:30:22 .../QtPlotter/MomentSettingsWidgetRadio.qo.h | 6 +- build 12-Sep-2018 15:30:22 code/display/QtPlotter/ProfileTaskFacilitator.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/QtPlotter/ProfileTaskFacilitator.h | 2 +- build 12-Sep-2018 15:30:22 code/display/QtPlotter/ProfileTaskMonitor.h | 6 +- build 12-Sep-2018 15:30:22 code/display/QtPlotter/QtCanvas.qo.h | 2 +- build 12-Sep-2018 15:30:22 code/display/QtPlotter/QtPlotSettings.cc | 14 +- build 12-Sep-2018 15:30:22 code/display/QtPlotter/QtPlotSettings.h | 6 +- build 12-Sep-2018 15:30:22 code/display/QtPlotter/QtProfile.cc | 62 +- build 12-Sep-2018 15:30:22 code/display/QtPlotter/QtProfile.qo.h | 48 +- build 12-Sep-2018 15:30:22 .../QtPlotter/SpecFitSettingsWidgetOptical.cc | 2 +- build 12-Sep-2018 15:30:22 .../QtPlotter/SpecFitSettingsWidgetRadio.cc | 32 +- build 12-Sep-2018 15:30:22 .../QtPlotter/SpecFitSettingsWidgetRadio.qo.h | 2 +- build 12-Sep-2018 15:30:22 .../display/QtPlotter/SpectralPositioningWidget.cc | 2 +- build 12-Sep-2018 15:30:22 .../display/QtPlotter/ThresholdingBinPlotDialog.cc | 2 +- build 12-Sep-2018 15:30:22 .../QtPlotter/ThresholdingBinPlotDialog.qo.h | 2 +- build 12-Sep-2018 15:30:22 code/display/QtPlotter/Util.cc | 4 +- build 12-Sep-2018 15:30:22 code/display/QtPlotter/Util.h | 4 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/ColorHistogram.cc | 2 +- build 12-Sep-2018 15:30:22 .../QtViewer/ImageManager/ImageManagerDialog.cc | 8 +- build 12-Sep-2018 15:30:22 .../QtViewer/ImageManager/ImageManagerDialog.qo.h | 2 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/QtCleanPanelGui.cc | 4 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/QtCleanPanelGui2.cc | 4 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/QtDBusViewerAdaptor.cc | 9 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/QtDataManager.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/QtDataManager.qo.h | 4 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/QtDisplayData.cc | 8 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/QtDisplayData.qo.h | 10 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/QtDisplayPanel.cc | 22 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/QtDisplayPanelGui.cc | 78 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/QtDisplayPanelGui.qo.h | 6 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/QtExportManager.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/QtRegionManager.cc | 4 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/QtWCBox.cc | 1 + build 12-Sep-2018 15:30:22 code/display/QtViewer/RegionToolManager.cc | 26 +- build 12-Sep-2018 15:30:22 code/display/QtViewer/RegionToolManager.qo.h | 4 +- build 12-Sep-2018 15:30:22 code/display/RegionShapes/QtNewRegionShape.cc | 8 +- build 12-Sep-2018 15:30:22 code/display/RegionShapes/QtNewRegionShape.qo.h | 8 +- build 12-Sep-2018 15:30:22 code/display/Slicer/SlicePlot.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/Slicer/SlicerMainWindow.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/Slicer/SlicerMainWindow.qo.h | 2 +- build 12-Sep-2018 15:30:22 code/display/Utilities/ImageProperties.cc | 10 +- build 12-Sep-2018 15:30:22 code/display/Utilities/ImageProperties.h | 8 +- build 12-Sep-2018 15:30:22 code/display/apps/casaviewer/casaviewer.cc | 32 + build 12-Sep-2018 15:30:22 code/display/ds9/ds9context.cc | 10 +- build 12-Sep-2018 15:30:22 code/display/ds9/ds9context.h | 2 +- build 12-Sep-2018 15:30:22 code/display/region/Ellipse.cc | 12 +- build 12-Sep-2018 15:30:22 code/display/region/Ellipse.h | 2 +- build 12-Sep-2018 15:30:22 code/display/region/HistogramGraph.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/region/HistogramGraph.qo.h | 2 +- build 12-Sep-2018 15:30:22 code/display/region/HistogramTab.cc | 2 +- build 12-Sep-2018 15:30:22 code/display/region/HistogramTab.qo.h | 2 +- build 12-Sep-2018 15:30:22 code/display/region/PVLine.cc | 22 +- build 12-Sep-2018 15:30:22 code/display/region/PVLine.qo.h | 4 +- build 12-Sep-2018 15:30:22 code/display/region/Point.cc | 4 +- build 12-Sep-2018 15:30:22 code/display/region/Point.h | 2 +- build 12-Sep-2018 15:30:22 code/display/region/Polygon.cc | 12 +- build 12-Sep-2018 15:30:22 code/display/region/Polygon.h | 2 +- build 12-Sep-2018 15:30:22 code/display/region/Polyline.cc | 12 +- build 12-Sep-2018 15:30:22 code/display/region/Polyline.qo.h | 2 +- build 12-Sep-2018 15:30:22 code/display/region/QtRegionSource.cc | 46 +- build 12-Sep-2018 15:30:22 code/display/region/QtRegionSource.qo.h | 24 +- build 12-Sep-2018 15:30:22 code/display/region/QtRegionState.cc | 10 +- build 12-Sep-2018 15:30:22 code/display/region/QtRegionState.qo.h | 6 +- build 12-Sep-2018 15:30:22 code/display/region/QtRegionStats.cc | 12 +- build 12-Sep-2018 15:30:22 code/display/region/QtRegionStats.qo.h | 10 +- build 12-Sep-2018 15:30:22 code/display/region/Rectangle.cc | 10 +- build 12-Sep-2018 15:30:22 code/display/region/Rectangle.h | 2 +- build 12-Sep-2018 15:30:22 code/display/region/Region.cc | 34 +- build 12-Sep-2018 15:30:22 code/display/region/Region.qo.h | 20 +- build 12-Sep-2018 15:30:22 code/display/region/RegionInfo.h | 4 +- build 12-Sep-2018 15:30:22 code/display/region/RegionSource.h | 34 +- build 12-Sep-2018 15:30:22 code/flagging/Flagging/AgentFlagger.cc | 21 +- build 12-Sep-2018 15:30:22 code/flagging/Flagging/FlagAgentRFlag.cc | 879 +++--- build 12-Sep-2018 15:30:22 code/flagging/Flagging/FlagAgentRFlag.h | 46 +- build 12-Sep-2018 15:30:22 code/flagging/Flagging/FlagDataHandler.cc | 17 +- build 12-Sep-2018 15:30:22 code/flagging/Flagging/FlagVersion.cc | 9 +- build 12-Sep-2018 15:30:22 code/graphics/GenericPlotter/PlotOptions.cc | 3 +- build 12-Sep-2018 15:30:22 code/graphics/GenericPlotter/PlotOptions.h | 1 + build 12-Sep-2018 15:30:22 code/guitools/Histogram/BinPlotWidget.cc | 2 +- build 12-Sep-2018 15:30:22 code/guitools/Histogram/BinPlotWidget.qo.h | 4 +- build 12-Sep-2018 15:30:22 code/guitools/Histogram/Histogram.cc | 6 +- build 12-Sep-2018 15:30:22 code/guitools/Histogram/Histogram.h | 6 +- build 12-Sep-2018 15:30:22 code/guitools/Histogram/HistogramMain.cc | 6 +- build 12-Sep-2018 15:30:22 code/guitools/Histogram/HistogramMain.qo.h | 4 +- build 12-Sep-2018 15:30:22 code/guitools/Histogram/RangeControlsWidget.cc | 4 +- build 12-Sep-2018 15:30:22 code/guitools/Histogram/RangeControlsWidget.qo.h | 8 +- build 12-Sep-2018 15:30:22 code/guitools/Histogram/ZoomWidget.cc | 2 +- build 12-Sep-2018 15:30:22 code/guitools/Histogram/ZoomWidget.qo.h | 4 +- build 12-Sep-2018 15:30:22 code/imageanalysis/Annotations/AnnEllipse.cc | 7 +- build 12-Sep-2018 15:30:22 code/imageanalysis/Annotations/AnnRegion.cc | 4 +- build 12-Sep-2018 15:30:22 code/imageanalysis/Annotations/AnnRegion.h | 4 +- build 12-Sep-2018 15:30:22 code/imageanalysis/Annotations/AnnSymbol.cc | 4 +- build 12-Sep-2018 15:30:22 code/imageanalysis/Annotations/AnnSymbol.h | 2 +- build 12-Sep-2018 15:30:22 code/imageanalysis/Annotations/AnnotationBase.cc | 15 +- build 12-Sep-2018 15:30:22 code/imageanalysis/Annotations/AnnotationBase.h | 16 +- build 12-Sep-2018 15:30:22 code/imageanalysis/Annotations/RegionTextList.cc | 4 +- build 12-Sep-2018 15:30:22 code/imageanalysis/Annotations/RegionTextList.h | 6 +- build 12-Sep-2018 15:30:22 code/imageanalysis/CMakeLists.txt | 30 +- build 12-Sep-2018 15:30:22 code/imageanalysis/IO/AsciiAnnotationFileLine.cc | 4 +- build 12-Sep-2018 15:30:22 code/imageanalysis/IO/AsciiAnnotationFileLine.h | 6 +- build 12-Sep-2018 15:30:22 code/imageanalysis/IO/FitterEstimatesFileParser.cc | 98 +- build 12-Sep-2018 15:30:22 code/imageanalysis/IO/FitterEstimatesFileParser.h | 30 +- build 12-Sep-2018 15:30:22 .../IO/FitterEstimatesFileParser2.tcc | 143 + build 12-Sep-2018 15:30:22 code/imageanalysis/IO/ImageFitterResults.h | 18 +- build 12-Sep-2018 15:30:22 ...mageFitterResults.cc => ImageFitterResults.tcc} | 43 +- build 12-Sep-2018 15:30:22 code/imageanalysis/IO/ImageProfileFitterResults.cc | 18 +- build 12-Sep-2018 15:30:22 code/imageanalysis/IO/ImageProfileFitterResults.h | 18 +- build 12-Sep-2018 15:30:22 code/imageanalysis/IO/RegionTextParser.cc | 6 +- build 12-Sep-2018 15:30:22 code/imageanalysis/IO/RegionTextParser.h | 10 +- build 12-Sep-2018 15:30:22 code/imageanalysis/IO/test/tFitter5689.cc | 4 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/BeamManipulator.h | 2 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/BeamManipulator.tcc | 6 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ComplexImageRegridder.cc | 85 - build 12-Sep-2018 15:30:22 .../ImageAnalysis/ComplexImageRegridder.h | 102 - build 12-Sep-2018 15:30:22 .../imageanalysis/ImageAnalysis/ComponentImager.cc | 14 +- build 12-Sep-2018 15:30:22 .../imageanalysis/ImageAnalysis/Image2DConvolver.h | 63 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/Image2DConvolver.tcc | 373 ++- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageCollapser.h | 2 +- build 12-Sep-2018 15:30:22 .../imageanalysis/ImageAnalysis/ImageCollapser.tcc | 82 +- build 12-Sep-2018 15:30:22 .../imageanalysis/ImageAnalysis/ImageCollapser2.cc | 87 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageConcatenator.h | 15 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageConcatenator.tcc | 73 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageCropper.h | 4 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageCropper.tcc | 10 +- build 12-Sep-2018 15:30:22 .../imageanalysis/ImageAnalysis/ImageDecimator.tcc | 2 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageExprCalculator.tcc | 28 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageFFT.cc | 703 ----- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageFFT.h | 212 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageFFT.tcc | 357 +++ build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageFFTer.h | 26 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageFFTer.tcc | 110 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageFactory.h | 125 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageFactory.tcc | 158 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageFactory2.cc | 276 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageFit1D.h | 8 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageFit1D.tcc | 6 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageFitter.h | 149 +- build 12-Sep-2018 15:30:22 .../{ImageFitter.cc => ImageFitter.tcc} | 387 ++- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageHistogramsCalculator.h | 18 +- build 12-Sep-2018 15:30:22 ...Calculator.cc => ImageHistogramsCalculator.tcc} | 64 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageHistory.h | 9 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageHistory.tcc | 20 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageInputProcessor2.tcc | 3 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageMaskHandler.tcc | 13 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageMaskedPixelReplacer.tcc | 2 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageMetaData.cc | 268 -- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageMetaData.h | 120 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageMetaData.tcc | 201 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageMetaDataBase.cc | 1271 -------- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageMetaDataBase.h | 236 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageMetaDataBase.tcc | 1246 ++++++++ build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageMetaDataConstants.cc | 60 + build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageMetaDataRW.h | 33 +- build 12-Sep-2018 15:30:22 .../{ImageMetaDataRW.cc => ImageMetaDataRW.tcc} | 395 ++- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageMoments.h | 2 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageMoments.tcc | 4 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImagePadder.cc | 2 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImagePolProxy.cc | 6 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImagePolTask.h | 4 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImagePolarimetry.cc | 6 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImagePrimaryBeamCorrector.cc | 104 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImagePrimaryBeamCorrector.h | 10 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageProfileFitter.cc | 14 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageProfileFitter.h | 10 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageRegridder.h | 69 +- build 12-Sep-2018 15:30:22 .../{ImageRegridder.cc => ImageRegridder.tcc} | 548 ++-- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageRegridderBase.h | 18 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageRegridderBase.tcc | 79 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageRotator.h | 13 +- build 12-Sep-2018 15:30:22 .../{ImageRotator.cc => ImageRotator.tcc} | 31 +- build 12-Sep-2018 15:30:22 .../{ImageStatsConfigurator.h => ImageStatsBase.h} | 54 +- build 12-Sep-2018 15:30:22 ...mageStatsConfigurator.cc => ImageStatsBase.tcc} | 57 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/ImageStatsCalculator.h | 56 +- build 12-Sep-2018 15:30:22 ...StatsCalculator.cc => ImageStatsCalculator.tcc} | 199 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageStatsData.h | 52 + build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageTask.h | 13 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/ImageTask.tcc | 28 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/PVGenerator.cc | 6 +- build 12-Sep-2018 15:30:22 .../PeakIntensityFluxDensityConverter.h | 16 +- build 12-Sep-2018 15:30:22 ...er.cc => PeakIntensityFluxDensityConverter.tcc} | 62 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/PixelValueManipulator.h | 395 +-- build 12-Sep-2018 15:30:22 .../ImageAnalysis/PixelValueManipulator.tcc | 215 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/SpectralCollapser.cc | 8 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/SpectralCollapser.h | 2 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/StatImageCreator.cc | 20 +- build 12-Sep-2018 15:30:22 .../imageanalysis/ImageAnalysis/StatImageCreator.h | 43 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/SubImageFactory.h | 8 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/SubImageFactory.tcc | 14 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/test/tImageCollapser.cc | 4 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageAnalysis/test/tImageFFT.cc | 8 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/test/tImageFitter.cc | 52 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/test/tImagePolarimetry.cc | 8 +- build 12-Sep-2018 15:30:22 .../ImageAnalysis/test/tImageStatsCalculator.cc | 2 +- build 12-Sep-2018 15:30:22 code/imageanalysis/ImageTypedefs.h | 25 +- build 12-Sep-2018 15:30:22 code/imageanalysis/Images/ComponentListImage.cc | 69 +- build 12-Sep-2018 15:30:22 code/imageanalysis/Regions/CasacRegionManager.cc | 8 +- build 12-Sep-2018 15:30:22 code/imageanalysis/apps/imfit.cc | 2 +- build 12-Sep-2018 15:30:22 code/mstransform/CMakeLists.txt | 9 +- build 12-Sep-2018 15:30:22 .../MSTransform/MSTransformDataHandler.cc | 127 +- build 12-Sep-2018 15:30:22 .../MSTransform/MSTransformDataHandler.h | 52 +- build 12-Sep-2018 15:30:22 .../mstransform/MSTransform/MSTransformIterator.cc | 2 +- build 12-Sep-2018 15:30:22 code/mstransform/MSTransform/MSTransformIterator.h | 4 +- build 12-Sep-2018 15:30:22 .../MSTransform/MSTransformIteratorFactory.cc | 2 +- build 12-Sep-2018 15:30:22 .../MSTransform/MSTransformIteratorFactory.h | 2 +- build 12-Sep-2018 15:30:22 code/mstransform/MSTransform/MSTransformManager.cc | 160 +- build 12-Sep-2018 15:30:22 code/mstransform/MSTransform/MSTransformManager.h | 5 +- build 12-Sep-2018 15:30:22 code/mstransform/MSTransform/MSUVBin.cc | 15 +- build 12-Sep-2018 15:30:22 code/mstransform/MSTransform/StatWt.cc | 188 +- build 12-Sep-2018 15:30:22 code/mstransform/MSTransform/StatWt.h | 30 +- build 12-Sep-2018 15:30:22 code/mstransform/MSTransform/StatWtColConfig.cc | 258 ++ build 12-Sep-2018 15:30:22 code/mstransform/MSTransform/StatWtColConfig.h | 104 + build 12-Sep-2018 15:30:22 .../MSTransform/test/tMSTransformIterator.cc | 15 +- build 12-Sep-2018 15:30:22 .../MSTransform/test/tMSTransformIterator.h | 2 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/ChannelAverageTVI.cc | 8 - build 12-Sep-2018 15:30:22 code/mstransform/TVI/ChannelAverageTVI.h | 1 - build 12-Sep-2018 15:30:22 code/mstransform/TVI/FreqAxisTVI.cc | 77 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/StatWtTVI.cc | 151 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/StatWtTVI.h | 14 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/PolAverageTVI_GTest.cc | 2 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/TestUtilsTVI.cc | 653 ---- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/tChannelAverageTVI.cc | 65 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/tChannelAverageTVI.h | 8 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/tHanningSmoothTVI.cc | 15 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/tHanningSmoothTVI.h | 2 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/tPhaseShiftingTVI.cc | 15 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/tPhaseShiftingTVI.h | 2 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/tRegriddingTVI.cc | 15 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/tRegriddingTVI.h | 2 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/tStatWtTVI.cc | 14 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/tStatWtTVI.h | 2 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/tUVContSubTVI.cc | 15 +- build 12-Sep-2018 15:30:22 code/mstransform/TVI/test/tUVContSubTVI.h | 2 +- build 12-Sep-2018 15:30:22 code/msvis/CMakeLists.txt | 10 +- build 12-Sep-2018 15:30:22 code/msvis/MSVis/AveragingTvi2.cc | 163 +- build 12-Sep-2018 15:30:22 code/msvis/MSVis/AveragingTvi2.h | 21 + build 12-Sep-2018 15:30:22 code/msvis/MSVis/MSCalEnums.cc | 2 + build 12-Sep-2018 15:30:22 code/msvis/MSVis/MSCalEnums.h | 2 + build 12-Sep-2018 15:30:22 code/msvis/MSVis/MSIter2.cc | 2 +- build 12-Sep-2018 15:30:22 code/msvis/MSVis/MSUVWGenerator.cc | 1 + build 12-Sep-2018 15:30:22 code/msvis/MSVis/MSUtil.cc | 215 +- build 12-Sep-2018 15:30:22 code/msvis/MSVis/MSUtil.h | 18 + build 12-Sep-2018 15:30:22 code/msvis/MSVis/PassThroughTVI.cc | 81 + build 12-Sep-2018 15:30:22 code/msvis/MSVis/PassThroughTVI.h | 79 + build 12-Sep-2018 15:30:22 code/msvis/MSVis/SelectAverageSpw.cc | 2 +- build 12-Sep-2018 15:30:22 code/msvis/MSVis/TransformingVi2.cc | 4 +- build 12-Sep-2018 15:30:22 code/msvis/MSVis/TransformingVi2.h | 4 +- build 12-Sep-2018 15:30:22 code/msvis/MSVis/ViFrequencySelection.h | 2 +- build 12-Sep-2018 15:30:22 code/msvis/MSVis/VisBuffer.cc | 2 - build 12-Sep-2018 15:30:22 code/msvis/MSVis/VisBufferUtil.cc | 189 +- build 12-Sep-2018 15:30:22 code/msvis/MSVis/VisBufferUtil.h | 5 +- build 12-Sep-2018 15:30:22 code/msvis/MSVis/VisibilityIteratorImpl2.cc | 80 +- build 12-Sep-2018 15:30:22 code/msvis/MSVis/VisibilityIteratorImplAsync2.cc | 4 +- build 12-Sep-2018 15:30:22 code/msvis/MSVis/test/AveragingTvi2_Test.cc | 340 +- build 12-Sep-2018 15:30:22 code/msvis/MSVis/test/MsFactory.cc | 19 + build 12-Sep-2018 15:30:22 code/msvis/MSVis/test/MsFactory.h | 23 + build 12-Sep-2018 15:30:22 code/msvis/MSVis/test/TestUtilsTVI.cc | 615 ++++ build 12-Sep-2018 15:30:22 .../TVI => msvis/MSVis}/test/TestUtilsTVI.h | 76 +- build 12-Sep-2018 15:30:22 code/nrao/VLA/VLAADA.cc | 5 +- build 12-Sep-2018 15:30:22 code/nrao/VLA/VLAFiller.cc | 2 +- build 12-Sep-2018 15:30:22 code/plotms/Actions/ActionExport.cc | 300 +- build 12-Sep-2018 15:30:22 code/plotms/Actions/ActionInformation.cc | 27 +- build 12-Sep-2018 15:30:22 code/plotms/Actions/ActionSummary.cc | 20 + build 12-Sep-2018 15:30:22 code/plotms/CMakeLists.txt | 42 +- build 12-Sep-2018 15:30:22 code/plotms/Data/CalCache.cc | 981 +++++- build 12-Sep-2018 15:30:22 code/plotms/Data/CalCache.h | 135 +- build 12-Sep-2018 15:30:22 code/plotms/Data/MSCache.cc | 424 ++- build 12-Sep-2018 15:30:22 code/plotms/Data/PlotMSAtm.cc | 183 +- build 12-Sep-2018 15:30:22 code/plotms/Data/PlotMSAtm.h | 2 + build 12-Sep-2018 15:30:22 code/plotms/Data/PlotMSCacheBase.cc | 1102 +++---- build 12-Sep-2018 15:30:22 code/plotms/Data/PlotMSCacheBase.h | 193 +- build 12-Sep-2018 15:30:22 code/plotms/Data/PlotMSIndexer.cc | 461 ++- build 12-Sep-2018 15:30:22 code/plotms/Data/PlotMSIndexer.h | 6 +- build 12-Sep-2018 15:30:22 code/plotms/Gui/PlotMSAxisWidget.ui | 13 +- build 12-Sep-2018 15:30:22 code/plotms/Gui/PlotMSSummaryDialog.cc | 2 +- build 12-Sep-2018 15:30:22 code/plotms/GuiTabs/PlotMSExportTab.cc | 3 + build 12-Sep-2018 15:30:22 code/plotms/GuiTabs/PlotMSExportTab.ui | 53 +- build 12-Sep-2018 15:30:22 code/plotms/GuiTabs/PlotMSIterateTab.cc | 10 +- build 12-Sep-2018 15:30:22 code/plotms/GuiTabs/PlotMSOptionsTab.cc | 1 + build 12-Sep-2018 15:30:22 code/plotms/PlotMS/PlotMSConstants.cc | 10 +- build 12-Sep-2018 15:30:22 code/plotms/PlotMS/PlotMSConstants.h | 94 +- build 12-Sep-2018 15:30:22 code/plotms/PlotMS/PlotMSDBusApp.cc | 4 + build 12-Sep-2018 15:30:22 code/plotms/PlotMS/PlotMSDBusApp.h | 1 + build 12-Sep-2018 15:30:22 code/plotms/PlotMS/PlotMSLabelFormat.cc | 2 + build 12-Sep-2018 15:30:22 code/plotms/PlotMS/PlotMSSelection.cc | 373 ++- build 12-Sep-2018 15:30:22 code/plotms/PlotMS/PlotMSSelection.h | 36 +- build 12-Sep-2018 15:30:22 code/plotms/Plots/PlotMSPlot.cc | 137 +- build 12-Sep-2018 15:30:22 code/plotms/Plots/PlotMSPlot.h | 3 + build 12-Sep-2018 15:30:22 code/plotms/test/PlotMSCacheAveraging_GT.cc | 651 ++++ build 12-Sep-2018 15:30:22 code/plotms/test/PlotMSCacheCallib_GT.cc | 128 + build 12-Sep-2018 15:30:22 code/plotms/test/PlotMSCacheGeom_GT.cc | 235 ++ build 12-Sep-2018 15:30:22 code/plotms/test/PlotMSCacheInvalid_GT.cc | 91 + build 12-Sep-2018 15:30:22 code/plotms/test/PlotMSCacheLtdVis_GT.cc | 217 ++ build 12-Sep-2018 15:30:22 code/plotms/test/PlotMSCacheMetadata_GT.cc | 200 ++ build 12-Sep-2018 15:30:22 code/plotms/test/PlotMSCacheOverlays_GT.cc | 119 + build 12-Sep-2018 15:30:22 code/plotms/test/PlotMSCacheSelection_GT.cc | 514 +++ build 12-Sep-2018 15:30:22 code/plotms/test/PlotMSCacheTransform_GT.cc | 284 ++ build 12-Sep-2018 15:30:22 code/plotms/test/PlotMSCacheVis_GT.cc | 521 +++ build 12-Sep-2018 15:30:22 code/plotms/test/dAveraging.cc | 136 - build 12-Sep-2018 15:30:22 code/plotms/test/dAveragingChannel.cc | 139 - build 12-Sep-2018 15:30:22 code/plotms/test/dAveragingTime.cc | 116 - build 12-Sep-2018 15:30:22 code/plotms/test/dCacheData.cc | 78 + build 12-Sep-2018 15:30:22 code/plotms/test/dDataSelection.cc | 83 - build 12-Sep-2018 15:30:22 code/plotms/test/dExportPlot.cc | 4 +- build 12-Sep-2018 15:30:22 code/plotms/test/dExportRange.cc | 163 - build 12-Sep-2018 15:30:22 code/plotms/test/dExportRangeInternal.cc | 116 - build 12-Sep-2018 15:30:22 code/plotms/test/dExportRangeLeftBottom.cc | 121 - build 12-Sep-2018 15:30:22 code/plotms/test/dExportRangeLeftTop.cc | 121 - build 12-Sep-2018 15:30:22 code/plotms/test/dExportRangePipeline.cc | 123 - build 12-Sep-2018 15:30:22 code/plotms/test/dExportRangeRightBottom.cc | 121 - build 12-Sep-2018 15:30:22 code/plotms/test/dExportRangeRightTop.cc | 121 - build 12-Sep-2018 15:30:22 code/plotms/test/dGridPlacement.cc | 108 - build 12-Sep-2018 15:30:22 code/plotms/test/dGridPlacementMultiplePlots.cc | 116 - build 12-Sep-2018 15:30:22 code/plotms/test/dGridPlacementMultipleRuns.cc | 237 -- build 12-Sep-2018 15:30:22 code/plotms/test/dLegend.cc | 137 - build 12-Sep-2018 15:30:22 code/plotms/test/dMultiplePlotTypes.cc | 200 -- build 12-Sep-2018 15:30:22 code/plotms/test/dOverIterationPlot.cc | 140 - build 12-Sep-2018 15:30:22 code/plotms/test/dOverLeftRightPlot.cc | 124 - build 12-Sep-2018 15:30:22 code/plotms/test/dOverPlot.cc | 124 - build 12-Sep-2018 15:30:22 code/plotms/test/dOverPlot2Files.cc | 141 - build 12-Sep-2018 15:30:22 code/plotms/test/dSymbol.cc | 93 - build 12-Sep-2018 15:30:22 code/plotms/test/dTimeAveragingIteration.cc | 116 - build 12-Sep-2018 15:30:22 code/plotms/test/dTimeColorization.cc | 103 - build 12-Sep-2018 15:30:22 code/plotms/test/dTimeColorizationAveraging.cc | 109 - build 12-Sep-2018 15:30:22 code/plotms/test/dTimeIteration.cc | 110 - build 12-Sep-2018 15:30:22 code/plotms/test/tUtil.h | 68 +- build 12-Sep-2018 15:30:22 code/singledishfiller/Filler/NRO2MSReader.cc | 41 +- build 12-Sep-2018 15:30:22 code/singledishfiller/Filler/NRO2MSReader.h | 68 +- build 12-Sep-2018 15:30:22 code/singledishfiller/Filler/ReaderInterface.h | 27 +- build 12-Sep-2018 15:30:22 code/singledishfiller/Filler/SingleDishMSFiller.h | 3 - build 12-Sep-2018 15:30:22 .../singledishfiller/Filler/SingleDishMSFiller.tcc | 45 +- build 12-Sep-2018 15:30:22 code/stdcasa/CMakeLists.txt | 1 + build 12-Sep-2018 15:30:22 code/stdcasa/StdCasa/variant.cc | 6 +- build 12-Sep-2018 15:30:22 code/stdcasa/optionparser.h | 2858 +++++++++++++++++ build 12-Sep-2018 15:30:22 code/synthesis/CMakeLists.txt | 16 +- build 12-Sep-2018 15:30:22 code/synthesis/CalTables/CTPatchedInterp.cc | 152 +- build 12-Sep-2018 15:30:22 code/synthesis/CalTables/CTPatchedInterp.h | 14 +- build 12-Sep-2018 15:30:22 code/synthesis/CalTables/CTSelection.cc | 8 +- build 12-Sep-2018 15:30:22 code/synthesis/CalTables/CTSummary.cc | 6 +- build 12-Sep-2018 15:30:22 code/synthesis/CalTables/CalBuffer.cc | 2 +- build 12-Sep-2018 15:30:22 code/synthesis/CalTables/CalSet.tcc | 3 +- build 12-Sep-2018 15:30:22 code/synthesis/CalTables/CalSummary.cc | 808 +++++ build 12-Sep-2018 15:30:22 code/synthesis/CalTables/CalSummary.h | 163 + build 12-Sep-2018 15:30:22 code/synthesis/CalTables/CalTable.cc | 105 +- build 12-Sep-2018 15:30:22 code/synthesis/CalTables/CalTable.h | 14 + build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/DistSIIterBot.cc | 2 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/DistSIIterBot.h | 2 +- build 12-Sep-2018 15:30:22 .../ImagerObjects/DistributedSynthesisIterBot.h | 4 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/InteractiveMasking.cc | 6 + build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/InteractiveMasking.h | 13 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SDAlgorithmBase.cc | 58 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SDAlgorithmBase.h | 10 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SDAlgorithmMSMFS.cc | 2 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SDAlgorithmMSMFS.h | 6 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SDMaskHandler.cc | 793 ++++- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SDMaskHandler.h | 69 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SIImageStore.cc | 292 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SIImageStore.h | 113 +- build 12-Sep-2018 15:30:22 .../ImagerObjects/SIImageStoreMultiTerm.cc | 185 +- build 12-Sep-2018 15:30:22 .../ImagerObjects/SIImageStoreMultiTerm.h | 123 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SIIterBot.cc | 82 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SIIterBot.h | 57 +- build 12-Sep-2018 15:30:22 .../ImagerObjects/SIMinorCycleController.cc | 53 +- build 12-Sep-2018 15:30:22 .../ImagerObjects/SIMinorCycleController.h | 13 + build 12-Sep-2018 15:30:22 .../ImagerObjects/SynthesisDeconvolver.cc | 67 +- build 12-Sep-2018 15:30:22 .../synthesis/ImagerObjects/SynthesisDeconvolver.h | 12 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SynthesisImager.cc | 56 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SynthesisImagerVi2.cc | 53 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SynthesisImagerVi2.h | 6 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SynthesisIterBot.cc | 9 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SynthesisIterBot.h | 8 +- build 12-Sep-2018 15:30:22 .../synthesis/ImagerObjects/SynthesisNormalizer.cc | 73 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects/SynthesisNormalizer.h | 16 +- build 12-Sep-2018 15:30:22 .../ImagerObjects/SynthesisUtilMethods.cc | 366 ++- build 12-Sep-2018 15:30:22 .../synthesis/ImagerObjects/SynthesisUtilMethods.h | 35 +- build 12-Sep-2018 15:30:22 .../ImagerObjects/test/SDMaskHandler_GTest.cc | 12 +- build 12-Sep-2018 15:30:22 .../ImagerObjects/test/tSynthesisImager.cc | 10 +- build 12-Sep-2018 15:30:22 .../ImagerObjects/test/tSynthesisImagerVi2.cc | 10 +- build 12-Sep-2018 15:30:22 code/synthesis/ImagerObjects2/SynthesisImager.cc | 35 +- build 12-Sep-2018 15:30:22 code/synthesis/MeasurementComponents/AccorJones.cc | 8 - build 12-Sep-2018 15:30:22 code/synthesis/MeasurementComponents/AccorJones.h | 4 +- build 12-Sep-2018 15:30:22 code/synthesis/MeasurementComponents/Calibrater.cc | 11 +- build 12-Sep-2018 15:30:22 code/synthesis/MeasurementComponents/Calibrater.h | 4 +- build 12-Sep-2018 15:30:22 .../MeasurementComponents/CalibratingVi2.cc | 1 + build 12-Sep-2018 15:30:22 .../synthesis/MeasurementComponents/FringeJones.cc | 1983 +++++++++++- build 12-Sep-2018 15:30:22 code/synthesis/MeasurementComponents/FringeJones.h | 125 +- build 12-Sep-2018 15:30:22 code/synthesis/MeasurementComponents/GSpline.h | 2 + build 12-Sep-2018 15:30:22 code/synthesis/MeasurementComponents/KJones.cc | 2 +- build 12-Sep-2018 15:30:22 code/synthesis/MeasurementComponents/SDGrid.cc | 7 + build 12-Sep-2018 15:30:22 .../MeasurementComponents/SolvableVisCal.cc | 143 +- build 12-Sep-2018 15:30:22 .../MeasurementComponents/SolvableVisCal.h | 53 +- build 12-Sep-2018 15:30:22 .../MeasurementComponents/SolveDataBuffer.cc | 18 + build 12-Sep-2018 15:30:22 .../MeasurementComponents/SolveDataBuffer.h | 3 + build 12-Sep-2018 15:30:22 .../MeasurementComponents/StandardVisCal.cc | 18 +- build 12-Sep-2018 15:30:22 code/synthesis/MeasurementComponents/VisCal.h | 10 +- build 12-Sep-2018 15:30:22 .../MeasurementComponents/VisCalGlobals.cc | 2 +- build 12-Sep-2018 15:30:22 .../MeasurementComponents/test/tFringeJones_GT.cc | 128 +- build 12-Sep-2018 15:30:22 code/synthesis/MeasurementEquations/Imager.cc | 10 +- build 12-Sep-2018 15:30:22 code/synthesis/MeasurementEquations/Imager2.cc | 1 + build 12-Sep-2018 15:30:22 .../MeasurementEquations/SideBandSeparator.cc | 22 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines/ALMAAperture.h | 1 - build 12-Sep-2018 15:30:22 .../TransformMachines/HetArrayConvFunc.cc | 8 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines/PBMath.cc | 46 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines/PBMath.h | 14 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines/WPConvFunc.cc | 4 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines2/BeamSkyJones.cc | 8 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines2/FTMachine.cc | 244 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines2/FTMachine.h | 14 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines2/GridFT.cc | 121 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines2/GridFT.h | 4 +- build 12-Sep-2018 15:30:22 .../TransformMachines2/HetArrayConvFunc.cc | 134 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines2/MosaicFT.cc | 125 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines2/MosaicFT.h | 5 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines2/MosaicFTNew.h | 4 +- build 12-Sep-2018 15:30:22 .../synthesis/TransformMachines2/MultiTermFTNew.cc | 27 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines2/MultiTermFTNew.h | 7 + build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines2/SDGrid.cc | 7 + build 12-Sep-2018 15:30:22 .../TransformMachines2/SimplePBConvFunc.cc | 23 +- build 12-Sep-2018 15:30:22 .../TransformMachines2/SimplePBConvFunc.h | 5 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines2/WPConvFunc.cc | 4 +- build 12-Sep-2018 15:30:22 code/synthesis/TransformMachines2/WProjectFT.cc | 31 +- build 12-Sep-2018 15:30:22 .../Utilities/PointingDirectionCalculator.cc | 9 +- build 12-Sep-2018 15:30:22 code/synthesis/Utilities/SDPosInterpolator.cc | 32 + build 12-Sep-2018 15:30:22 code/synthesis/Utilities/SDPosInterpolator.h | 3 + build 12-Sep-2018 15:30:22 code/synthesis/apps/utils/imageconcat.cc | 2 +- build 12-Sep-2018 15:30:22 gcwrap/CMakeLists.txt | 83 +- build 12-Sep-2018 15:30:22 gcwrap/install/casa2pycli.xsl | 117 +- build 12-Sep-2018 15:30:22 gcwrap/install/casa2pypg.xsl | 6 +- build 12-Sep-2018 15:30:22 gcwrap/install/ui.cmake | 6 +- build 12-Sep-2018 15:30:22 gcwrap/python/CMakeLists.txt | 26 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/TelemetryLogMonitor.py | 37 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/casa.py | 17 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/casapy.py | 26 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/correct_ant_posns.py | 232 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/correct_ant_posns_alma.py | 594 ++++ build 12-Sep-2018 15:30:22 gcwrap/python/scripts/correct_ant_posns_evla.py | 202 ++ build 12-Sep-2018 15:30:22 gcwrap/python/scripts/ialib.py | 14 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/imagerhelpers/CMakeLists.txt | 2 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/imagerhelpers/imager_base.py | 26 +- build 12-Sep-2018 15:30:22 .../scripts/imagerhelpers/imager_parallel_cube.py | 31 +- build 12-Sep-2018 15:30:22 .../scripts/imagerhelpers/input_parameters.py | 18 +- build 12-Sep-2018 15:30:22 .../imagerhelpers/parallel_imager_helper.py | 20 +- build 12-Sep-2018 15:30:22 .../scripts/imagerhelpers/test_imager_helper.py | 123 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/init_crashrpt.py | 4 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/init_logger.py | 44 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/init_system.py | 5 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/init_tasks.py | 26 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/init_telemetry.py.in | 41 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/init_tools.py | 18 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/init_welcome.py | 6 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/mpi4casa/MPIEnvironment.py | 10 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/mpi4casa/MPIMonitorServer.py | 2 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/mpi4casa/task_wrappers.py | 7 +- build 12-Sep-2018 15:30:22 .../scripts/parallel/parallel_task_helper.py | 4 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/partitionhelper.py | 40 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/recipes/CMakeLists.txt | 1 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/recipes/drawmaskinimage.py | 7 +- build 12-Sep-2018 15:30:22 .../recipes/ephemerides/JPLephem_reader2.py | 17 +- build 12-Sep-2018 15:30:22 .../python/scripts/recipes/ephemerides/request.py | 5 +- build 12-Sep-2018 15:30:22 .../scripts/recipes/imager_resource_predictor.py | 184 ++ build 12-Sep-2018 15:30:22 gcwrap/python/scripts/recipes/tec_maps.py | 4 +- build 12-Sep-2018 15:30:22 .../scripts/regressions/admin/extractCASAscript.py | 76 +- build 12-Sep-2018 15:30:22 .../scripts/regressions/admin/make_mmsdata.py | 7 +- build 12-Sep-2018 15:30:22 .../alma-m100-analysis-hpc-regression-tclean.py | 2 +- build 12-Sep-2018 15:30:22 .../scripts/regressions/ic2233_regression.py | 2 +- build 12-Sep-2018 15:30:22 .../scripts/regressions/pipelineTest_regression.py | 146 +- build 12-Sep-2018 15:30:22 .../scripts/regressions/tests/CMakeLists.txt | 2 - build 12-Sep-2018 15:30:22 .../scripts/regressions/tests/orionmosaic.py | 32 - build 12-Sep-2018 15:30:22 gcwrap/python/scripts/start_casa.py | 1 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_autoclean.py | 508 --- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_boxit.py | 230 -- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_clearplot.py | 15 - build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_csvclean.py | 383 --- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_find.py | 78 - build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_flagmanager.py | 26 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_fringefit.py | 127 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_gaincal.py | 10 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_gencal.py | 2 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_imdev.py | 17 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_impbcor.py | 15 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_importevla.py | 423 --- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_imregrid.py | 98 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_initweights.py | 36 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_mosaic.py | 173 - build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_oldhanningsmooth.py | 71 - build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_oldpartition.py | 658 ---- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_oldplotants.py | 56 - build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_oldsplit.py | 53 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_oldstatwt.py | 81 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_plotms.py | 71 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_plotuv.py | 369 --- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_plotweather.py | 3 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_plotxy.py | 566 ---- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_predictcomp.py | 32 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_sdsidebandsplit.py | 4 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_ssoflux.py | 98 - build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_statwt.py | 133 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_statwt2.py | 62 - build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_tclean.py | 30 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_tclean2.py | 1 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_tsdimaging.py | 62 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_visstat2.py | 55 - build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_visstatold.py | 83 - build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_widefield.py | 221 -- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/task_wvrgcal.py | 17 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/telemetry.py | 199 ++ build 12-Sep-2018 15:30:22 gcwrap/python/scripts/testhelper.py | 23 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/CMakeLists.txt | 16 +- build 12-Sep-2018 15:30:22 .../python/scripts/tests/test_FirstLook_Imaging.py | 6 +- build 12-Sep-2018 15:30:22 .../tests/test_FirstLook_LineImageAnalysis.py | 10 +- build 12-Sep-2018 15:30:22 .../scripts/tests/test_FirstLook_LineImaging.py | 9 +- build 12-Sep-2018 15:30:22 .../tests/test_FirstLook_SelfCalibration.py | 9 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_boxit.py | 215 -- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_csvclean.py | 289 -- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_exportasdm.py | 6 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_flagcmd.py | 61 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_flagdata.py | 540 +++- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_flagmanager.py | 108 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_gencal.py | 231 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_getchunk.py | 56 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_addnoise.py | 39 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_convolve.py | 29 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_convolve2d.py | 19 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_deviation.py | 37 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_fft.py | 3 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_fromarray.py | 46 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_fromimage.py | 15 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_fromshape.py | 5 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_getregion.py | 29 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_getslice.py | 146 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_histograms.py | 142 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_imageconcat.py | 29 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_makecomplex.py | 15 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_maskhandler.py | 18 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_modify.py | 27 +- build 12-Sep-2018 15:30:22 .../scripts/tests/test_ia_newimagefromimage.py | 18 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_putregion.py | 35 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_rotate.py | 29 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_setcoordsys.py | 14 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_setmiscinfo.py | 13 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_subimage.py | 29 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_ia_summary.py | 2 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_imfit.py | 19 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_immath.py | 63 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_impbcor.py | 33 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_importasap.py | 26 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_importasdm.py | 1329 +++++++- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_importatca.py | 26 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_importcasa.py | 11 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_importevla.py | 492 --- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_importnro.py | 207 ++ build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_imregrid.py | 196 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_imstat.py | 283 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_initweights.py | 38 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_mstool.py | 2 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_mstransform.py | 1253 +++++--- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_oldstatwt.py | 120 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_plotms.py | 31 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_refimager.py | 632 +++- build 12-Sep-2018 15:30:22 .../scripts/tests/test_refimager_parallel.py | 93 +- build 12-Sep-2018 15:30:22 .../{test_tsdbaseline.py => test_sdbaseline.py} | 0 build 12-Sep-2018 15:30:22 .../tests/{test_tsdcal.py => test_sdcal.py} | 0 build 12-Sep-2018 15:30:22 .../tests/{test_tsdfit.py => test_sdfit.py} | 0 build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_sdimaging.py | 226 +- build 12-Sep-2018 15:30:22 .../python/scripts/tests/test_sdsidebandsplit.py | 48 +- build 12-Sep-2018 15:30:22 .../tests/{test_tsdsmooth.py => test_sdsmooth.py} | 0 build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_setjy.py | 274 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_split2.py | 34 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_statwt.py | 861 ++++- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_statwt2.py | 726 ----- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_tsdimaging.py | 232 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_visstat.py | 2 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_visstatold.py | 301 -- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/test_wvrgcal.py | 2 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/testutils.py | 17 + build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/uTest_list.json | 8 +- build 12-Sep-2018 15:30:22 gcwrap/python/scripts/tests/unittests_list.txt | 2 - build 12-Sep-2018 15:30:22 gcwrap/python/scripts/viewertool.py | 3 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/CMakeLists.txt | 20 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/accor.xml | 2 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/asdmsummary.xml | 8 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/autoclean.xml | 795 ----- build 12-Sep-2018 15:30:22 gcwrap/tasks/boxit.xml | 121 - build 12-Sep-2018 15:30:22 gcwrap/tasks/clearplot.xml | 31 - build 12-Sep-2018 15:30:22 gcwrap/tasks/csvclean.xml | 246 -- build 12-Sep-2018 15:30:22 gcwrap/tasks/cvel.xml | 25 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/cvel2.xml | 18 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/find.xml | 41 - build 12-Sep-2018 15:30:22 gcwrap/tasks/fixplanets.xml | 27 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/fixvis.xml | 28 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/flagdata.xml | 66 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/flagmanager.xml | 6 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/fringefit.xml | 339 ++ build 12-Sep-2018 15:30:22 gcwrap/tasks/gaincal.xml | 21 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/gencal.xml | 17 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/imcollapse.xml | 9 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/imhead.xml | 2 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/impbcor.xml | 9 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/importasap.xml | 8 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/importevla.xml | 342 -- build 12-Sep-2018 15:30:22 gcwrap/tasks/importnro.xml | 4 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/importvla.xml | 14 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/imreframe.xml | 21 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/imstat.xml | 5 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/initweights.xml | 6 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/listcal.xml | 128 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/listsdm.xml | 8 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/listvis.xml | 67 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/makemask.xml | 140 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/mosaic.xml | 605 ---- build 12-Sep-2018 15:30:22 gcwrap/tasks/mstransform.xml | 84 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/msuvbin.xml | 20 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/oldhanningsmooth.xml | 74 - build 12-Sep-2018 15:30:22 gcwrap/tasks/oldpartition.xml | 349 --- build 12-Sep-2018 15:30:22 gcwrap/tasks/oldplotants.xml | 59 - build 12-Sep-2018 15:30:22 gcwrap/tasks/oldsplit.xml | 10 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/oldstatwt.xml | 296 ++ build 12-Sep-2018 15:30:22 gcwrap/tasks/plotcal.xml | 8 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/plotms.xml | 175 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/plotuv.xml | 135 - build 12-Sep-2018 15:30:22 gcwrap/tasks/plotweather.xml | 8 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/plotxy.xml | 785 ----- build 12-Sep-2018 15:30:22 gcwrap/tasks/predictcomp.xml | 6 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/sdbaseline.xml | 10 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/sdcal.xml | 7 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/sdfit.xml | 2 + build 12-Sep-2018 15:30:22 gcwrap/tasks/sdgaincal.xml | 52 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/sdimaging.xml | 4 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/sdsidebandsplit.xml | 10 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/setjy.xml | 59 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/simalma.xml | 164 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/simanalyze.xml | 18 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/slsearch.xml | 5 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/specfit.xml | 55 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/specflux.xml | 12 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/spxfit.xml | 15 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/ssoflux.xml | 163 - build 12-Sep-2018 15:30:22 gcwrap/tasks/statwt.xml | 609 ++-- build 12-Sep-2018 15:30:22 gcwrap/tasks/statwt2.xml | 341 -- build 12-Sep-2018 15:30:22 gcwrap/tasks/tclean.xml | 913 +++--- build 12-Sep-2018 15:30:22 gcwrap/tasks/tclean2.xml | 2 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/tsdimaging.xml | 42 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/visstat.xml | 66 +- build 12-Sep-2018 15:30:22 gcwrap/tasks/visstat2.xml | 357 --- build 12-Sep-2018 15:30:22 gcwrap/tasks/visstatold.xml | 235 -- build 12-Sep-2018 15:30:22 gcwrap/tasks/widefield.xml | 655 ---- build 12-Sep-2018 15:30:22 gcwrap/tools/CMakeLists.txt | 11 +- build 12-Sep-2018 15:30:22 gcwrap/tools/atnf/atcafiller.xml | 12 +- build 12-Sep-2018 15:30:22 gcwrap/tools/casa/logsink.xml | 56 +- build 12-Sep-2018 15:30:22 gcwrap/tools/casa/logsink_cmpt.cc | 85 +- build 12-Sep-2018 15:30:22 gcwrap/tools/casa/quanta_cmpt.cc | 13 +- build 12-Sep-2018 15:30:22 gcwrap/tools/casa/telemetryhelper.xml | 23 + build 12-Sep-2018 15:30:22 gcwrap/tools/casa/telemetryhelper_cmpt.cc | 19 + build 12-Sep-2018 15:30:22 gcwrap/tools/flagging/agentflagger.xml | 45 +- build 12-Sep-2018 15:30:22 gcwrap/tools/flagging/agentflagger_cmpt.cc | 5 +- build 12-Sep-2018 15:30:22 gcwrap/tools/images/image.xml | 1440 ++++----- build 12-Sep-2018 15:30:22 gcwrap/tools/images/image_cmpt.cc | 3309 ++++++++++++-------- build 12-Sep-2018 15:30:22 gcwrap/tools/images/image_forward.h | 7 +- build 12-Sep-2018 15:30:22 gcwrap/tools/images/image_private.h | 185 +- build 12-Sep-2018 15:30:22 gcwrap/tools/images/imagemetadata_cmpt.cc | 58 +- build 12-Sep-2018 15:30:22 gcwrap/tools/images/imagemetadata_forward.h | 4 +- build 12-Sep-2018 15:30:22 gcwrap/tools/images/imagemetadata_private.h | 8 +- build 12-Sep-2018 15:30:22 gcwrap/tools/images/imagepol_cmpt.cc | 22 +- build 12-Sep-2018 15:30:22 gcwrap/tools/images/imagepol_forward.h | 15 +- build 12-Sep-2018 15:30:22 gcwrap/tools/images/imagepol_private.h | 2 +- build 12-Sep-2018 15:30:22 gcwrap/tools/ms/MSPlot/MsPlot.cc | 6 +- build 12-Sep-2018 15:30:22 gcwrap/tools/ms/ms.xml | 44 +- build 12-Sep-2018 15:30:22 gcwrap/tools/ms/ms_cmpt.cc | 38 +- build 12-Sep-2018 15:30:22 gcwrap/tools/ms/msmetadata.xml | 9 +- build 12-Sep-2018 15:30:22 gcwrap/tools/ms/msmetadata_cmpt.cc | 32 +- build 12-Sep-2018 15:30:22 gcwrap/tools/nrao/vlafillertask.xml | 2 +- build 12-Sep-2018 15:30:22 gcwrap/tools/plotms/plotms.xml | 36 +- build 12-Sep-2018 15:30:22 gcwrap/tools/plotms/plotms_cmpt.cc | 42 +- build 12-Sep-2018 15:30:22 gcwrap/tools/synthesis/CalTables/PlotCal.cc | 85 +- build 12-Sep-2018 15:30:22 gcwrap/tools/synthesis/calibrater.xml | 13 + build 12-Sep-2018 15:30:22 gcwrap/tools/synthesis/calibrater_cmpt.cc | 10 +- build 12-Sep-2018 15:30:22 gcwrap/tools/synthesis/imager_cmpt.cc | 1 - build 12-Sep-2018 15:30:22 gcwrap/tools/synthesis/simulator_cmpt.cc | 11 +- build 12-Sep-2018 15:30:22 gcwrap/tools/synthesis/simulator_private.h | 2 +- build 12-Sep-2018 15:30:22 gcwrap/tools/synthesis/synthesisdeconvolver.xml | 13 + build 12-Sep-2018 15:30:22 .../tools/synthesis/synthesisdeconvolver_cmpt.cc | 10 + build 12-Sep-2018 15:30:22 gcwrap/tools/synthesis/synthesisimager_cmpt.cc | 7 + build 12-Sep-2018 15:30:22 gcwrap/tools/synthesis/synthesismaskhandler.xml | 107 + build 12-Sep-2018 15:30:22 .../tools/synthesis/synthesismaskhandler_cmpt.cc | 136 + build 12-Sep-2018 15:30:22 .../tools/synthesis/synthesismaskhandler_forward.h | 12 + build 12-Sep-2018 15:30:22 .../tools/synthesis/synthesismaskhandler_private.h | 4 + build 12-Sep-2018 15:30:22 gcwrap/tools/tables/TablePlot/BasePlot.cc | 12 +- build 12-Sep-2018 15:30:22 gcwrap/tools/tables/TablePlot/BasePlot.h | 6 +- build 12-Sep-2018 15:30:22 gcwrap/tools/tables/table_cmpt.cc | 4 +- build 12-Sep-2018 15:30:22 gcwrap/tools/utils/utils_cmpt.cc | 6 + build 12-Sep-2018 15:30:22 885 files changed, 44414 insertions(+), 33105 deletions(-) build 12-Sep-2018 15:30:22 create mode 100644 code/air_casawvr/cmdline/wvrgcalargs.hpp build 12-Sep-2018 15:30:22 create mode 100644 code/alma/Options/AlmaArg.h build 12-Sep-2018 15:30:22 create mode 100644 code/alma/apps/asdm2MS/ScansParser.cc build 12-Sep-2018 15:30:22 create mode 100644 code/alma/apps/asdm2MS/ScansParser.h build 12-Sep-2018 15:30:22 rename code/casaqt/apps/{qcasabrowser/qcasabrowser.cc => casabrowser/casabrowser.cc} (77%) build 12-Sep-2018 15:30:22 delete mode 100755 code/casaqt/apps/qcasabrowser/casabrowser build 12-Sep-2018 15:30:22 create mode 100644 code/components/ComponentModels/SkyComponentFactory2.tcc build 12-Sep-2018 15:30:22 create mode 100644 code/crash/utils/CrashReportHelper.h build 12-Sep-2018 15:30:22 rename code/display/Display/{State.cc => DisplayState.cc} (97%) build 12-Sep-2018 15:30:22 rename code/display/Display/{State.h => DisplayState.h} (100%) build 12-Sep-2018 15:30:22 create mode 100644 code/imageanalysis/IO/FitterEstimatesFileParser2.tcc build 12-Sep-2018 15:30:22 rename code/imageanalysis/IO/{ImageFitterResults.cc => ImageFitterResults.tcc} (93%) build 12-Sep-2018 15:30:22 delete mode 100755 code/imageanalysis/ImageAnalysis/ComplexImageRegridder.cc build 12-Sep-2018 15:30:22 delete mode 100755 code/imageanalysis/ImageAnalysis/ComplexImageRegridder.h build 12-Sep-2018 15:30:22 delete mode 100644 code/imageanalysis/ImageAnalysis/ImageFFT.cc build 12-Sep-2018 15:30:22 create mode 100644 code/imageanalysis/ImageAnalysis/ImageFFT.tcc build 12-Sep-2018 15:30:22 rename code/imageanalysis/ImageAnalysis/{ImageFitter.cc => ImageFitter.tcc} (83%) build 12-Sep-2018 15:30:22 rename code/imageanalysis/ImageAnalysis/{ImageHistogramsCalculator.cc => ImageHistogramsCalculator.tcc} (69%) build 12-Sep-2018 15:30:22 delete mode 100644 code/imageanalysis/ImageAnalysis/ImageMetaData.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/imageanalysis/ImageAnalysis/ImageMetaDataBase.cc build 12-Sep-2018 15:30:22 create mode 100644 code/imageanalysis/ImageAnalysis/ImageMetaDataBase.tcc build 12-Sep-2018 15:30:22 create mode 100644 code/imageanalysis/ImageAnalysis/ImageMetaDataConstants.cc build 12-Sep-2018 15:30:22 rename code/imageanalysis/ImageAnalysis/{ImageMetaDataRW.cc => ImageMetaDataRW.tcc} (76%) build 12-Sep-2018 15:30:22 rename code/imageanalysis/ImageAnalysis/{ImageRegridder.cc => ImageRegridder.tcc} (52%) build 12-Sep-2018 15:30:22 rename code/imageanalysis/ImageAnalysis/{ImageRotator.cc => ImageRotator.tcc} (84%) build 12-Sep-2018 15:30:22 rename code/imageanalysis/ImageAnalysis/{ImageStatsConfigurator.h => ImageStatsBase.h} (76%) build 12-Sep-2018 15:30:22 rename code/imageanalysis/ImageAnalysis/{ImageStatsConfigurator.cc => ImageStatsBase.tcc} (73%) build 12-Sep-2018 15:30:22 rename code/imageanalysis/ImageAnalysis/{ImageStatsCalculator.cc => ImageStatsCalculator.tcc} (81%) build 12-Sep-2018 15:30:22 create mode 100755 code/imageanalysis/ImageAnalysis/ImageStatsData.h build 12-Sep-2018 15:30:22 rename code/imageanalysis/ImageAnalysis/{PeakIntensityFluxDensityConverter.cc => PeakIntensityFluxDensityConverter.tcc} (57%) build 12-Sep-2018 15:30:22 mode change 100755 => 100644 code/imageanalysis/ImageAnalysis/PixelValueManipulator.h build 12-Sep-2018 15:30:22 mode change 100755 => 100644 code/imageanalysis/ImageAnalysis/PixelValueManipulator.tcc build 12-Sep-2018 15:30:22 create mode 100644 code/mstransform/MSTransform/StatWtColConfig.cc build 12-Sep-2018 15:30:22 create mode 100644 code/mstransform/MSTransform/StatWtColConfig.h build 12-Sep-2018 15:30:22 delete mode 100755 code/mstransform/TVI/test/TestUtilsTVI.cc build 12-Sep-2018 15:30:22 create mode 100644 code/msvis/MSVis/PassThroughTVI.cc build 12-Sep-2018 15:30:22 create mode 100644 code/msvis/MSVis/PassThroughTVI.h build 12-Sep-2018 15:30:22 create mode 100755 code/msvis/MSVis/test/TestUtilsTVI.cc build 12-Sep-2018 15:30:22 rename code/{mstransform/TVI => msvis/MSVis}/test/TestUtilsTVI.h (58%) build 12-Sep-2018 15:30:22 create mode 100644 code/plotms/test/PlotMSCacheAveraging_GT.cc build 12-Sep-2018 15:30:22 create mode 100644 code/plotms/test/PlotMSCacheCallib_GT.cc build 12-Sep-2018 15:30:22 create mode 100644 code/plotms/test/PlotMSCacheGeom_GT.cc build 12-Sep-2018 15:30:22 create mode 100644 code/plotms/test/PlotMSCacheInvalid_GT.cc build 12-Sep-2018 15:30:22 create mode 100644 code/plotms/test/PlotMSCacheLtdVis_GT.cc build 12-Sep-2018 15:30:22 create mode 100644 code/plotms/test/PlotMSCacheMetadata_GT.cc build 12-Sep-2018 15:30:22 create mode 100644 code/plotms/test/PlotMSCacheOverlays_GT.cc build 12-Sep-2018 15:30:22 create mode 100644 code/plotms/test/PlotMSCacheSelection_GT.cc build 12-Sep-2018 15:30:22 create mode 100644 code/plotms/test/PlotMSCacheTransform_GT.cc build 12-Sep-2018 15:30:22 create mode 100644 code/plotms/test/PlotMSCacheVis_GT.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dAveraging.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dAveragingChannel.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dAveragingTime.cc build 12-Sep-2018 15:30:22 create mode 100644 code/plotms/test/dCacheData.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dDataSelection.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dExportRange.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dExportRangeInternal.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dExportRangeLeftBottom.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dExportRangeLeftTop.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dExportRangePipeline.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dExportRangeRightBottom.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dExportRangeRightTop.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dGridPlacement.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dGridPlacementMultiplePlots.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dGridPlacementMultipleRuns.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dLegend.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dMultiplePlotTypes.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dOverIterationPlot.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dOverLeftRightPlot.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dOverPlot.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dOverPlot2Files.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dSymbol.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dTimeAveragingIteration.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dTimeColorization.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dTimeColorizationAveraging.cc build 12-Sep-2018 15:30:22 delete mode 100644 code/plotms/test/dTimeIteration.cc build 12-Sep-2018 15:30:22 create mode 100644 code/stdcasa/optionparser.h build 12-Sep-2018 15:30:22 create mode 100644 code/synthesis/CalTables/CalSummary.cc build 12-Sep-2018 15:30:22 create mode 100644 code/synthesis/CalTables/CalSummary.h build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/python/scripts/TelemetryLogMonitor.py build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/python/scripts/correct_ant_posns_alma.py build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/python/scripts/correct_ant_posns_evla.py build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/python/scripts/init_telemetry.py.in build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/python/scripts/recipes/imager_resource_predictor.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/regressions/tests/orionmosaic.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_autoclean.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_boxit.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_clearplot.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_csvclean.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_find.py build 12-Sep-2018 15:30:22 create mode 100755 gcwrap/python/scripts/task_fringefit.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_importevla.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_mosaic.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_oldhanningsmooth.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_oldpartition.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_oldplotants.py build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/python/scripts/task_oldstatwt.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_plotuv.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_plotxy.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_ssoflux.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_statwt2.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_visstat2.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_visstatold.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/task_widefield.py build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/python/scripts/telemetry.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/tests/test_boxit.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/tests/test_csvclean.py build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/python/scripts/tests/test_ia_getslice.py build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/python/scripts/tests/test_importcasa.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/tests/test_importevla.py build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/python/scripts/tests/test_oldstatwt.py build 12-Sep-2018 15:30:22 rename gcwrap/python/scripts/tests/{test_tsdbaseline.py => test_sdbaseline.py} (100%) build 12-Sep-2018 15:30:22 rename gcwrap/python/scripts/tests/{test_tsdcal.py => test_sdcal.py} (100%) build 12-Sep-2018 15:30:22 rename gcwrap/python/scripts/tests/{test_tsdfit.py => test_sdfit.py} (100%) build 12-Sep-2018 15:30:22 rename gcwrap/python/scripts/tests/{test_tsdsmooth.py => test_sdsmooth.py} (100%) build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/tests/test_statwt2.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/python/scripts/tests/test_visstatold.py build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/autoclean.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/boxit.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/clearplot.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/csvclean.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/find.xml build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/tasks/fringefit.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/importevla.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/mosaic.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/oldhanningsmooth.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/oldpartition.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/oldplotants.xml build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/tasks/oldstatwt.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/plotuv.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/plotxy.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/ssoflux.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/statwt2.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/visstat2.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/visstatold.xml build 12-Sep-2018 15:30:22 delete mode 100644 gcwrap/tasks/widefield.xml build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/tools/casa/telemetryhelper.xml build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/tools/casa/telemetryhelper_cmpt.cc build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/tools/synthesis/synthesismaskhandler.xml build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/tools/synthesis/synthesismaskhandler_cmpt.cc build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/tools/synthesis/synthesismaskhandler_forward.h build 12-Sep-2018 15:30:22 create mode 100644 gcwrap/tools/synthesis/synthesismaskhandler_private.h build 12-Sep-2018 15:30:22 build 12-Sep-2018 15:30:22 edu.nrao.gradle.casa.build.GitRepository@2e863e5c build 12-Sep-2018 15:30:22 getLastTag called with build 12-Sep-2018 15:30:22 branch: ARD-3 build 12-Sep-2018 15:30:22 env: [bamboo_planRepository_1_branch=ARD-3, PATH=/bin:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin, bamboo_planRepository_2_branch=master, HISTCONTROL=ignoredups, bamboo_repository_revision_number=24d0ec81f2390e8db3fbfdc1d6ce03e54cbd304d, bamboo_planRepository_1_branchDisplayName=ARD-3, bamboo_repository_20938876_previous_revision_number=de293f6de3d7409f904a575ef3a9e4a11736ad0c, GUESTFISH_RESTORE=\e[0m, bamboo_repository_20938876_git_username=, WRAPPER_BITS=32, bamboo_buildKey=ARD-BPT4-TBFP, bamboo_repository_20939039_name=OPEN-CASA-FULL, PROMPT_COMMAND=history -a, PWD=/export/home/cbt-el7-4/bamboohome/xml-data/build-dir/ARD-BPT4-TBFP/casa-pkg/gradle/casa-tag, bamboo_capability_system_jdk_JDK_1_8_0_131=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.el7_3.x86_64, bamboo_planRepository_2_branchDisplayName=master, HISTTIMEFORMAT=%Y-%m-%d %T: , bamboo_shortJobName=Tag Branch for Packages, bamboo_buildResultsUrl=https://open-bamboo.nrao.edu/browse/ARD-BPT4-TBFP-4, bamboo_planRepository_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git, LESSOPEN=||/usr/bin/lesspipe.sh %s, QT_GRAPHICSSYSTEM_CHECKED=1, QTINC=/usr/lib64/qt-3.3/include, bamboo_agentId=6160386, GUESTFISH_INIT=\e[1;34m, bamboo_planRepository_revision=24d0ec81f2390e8db3fbfdc1d6ce03e54cbd304d, bamboo_casaadm_password=********, bamboo_planRepository_previousRevision=786b1dc3ae141cae7d76e110084b53cedfee67ec, bamboo_repository_20938876_git_branch=master, bamboo_repository_20938876_name=OPEN-CASA-PKG, bamboo_repository_20939039_previous_revision_number=786b1dc3ae141cae7d76e110084b53cedfee67ec, bamboo_capability_system_jdk_JDK_1_8_0_144=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64, bamboo_repository_branch_name=ARD-3, SHLVL=3, bamboo_capability_system_jdk_JDK_1_8_0_141=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.141-2.b16.el7_4.x86_64, QT_PLUGIN_PATH=/usr/lib64/kde4/plugins:/usr/lib/kde4/plugins, LOADEDMODULES=, WRAPPER_OS=linux, HISTSIZE=100000, TERM=xterm-256color, bamboo_dependenciesDisabled=false, XDG_SESSION_ID=4970, bamboo_capability_isCIMachine=true, GRADLE_USER_HOME=/users/casaci/.gradle.el6.cbt-el7-4, bamboo_planRepository_branch=ARD-3, bamboo_capability_tag=true, bamboo_capability_system_jdk_JDK_1_8_0_151=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64, bamboo_repository_20939039_revision_number=24d0ec81f2390e8db3fbfdc1d6ce03e54cbd304d, bamboo_planRepository_branchName=ARD-3, bamboo_planRepository_1_type=bbserver, WRAPPER_FILE_SEPARATOR=/, bamboo_repository_20938876_revision_number=e5f8bf188c0f97f776d1d09c8b4efcd543aef049, bamboo_repository_20939039_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git, bamboo_capability_system_jdk_JDK=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.102-1.b14.el7_2.x86_64, SSH_CLIENT=10.2.103.226 49818 22, SSH_TTY=/dev/pts/0, CVS_RSH=ssh, WRAPPER_PATH_SEPARATOR=:, bamboo_planRepository_type=bbserver, bamboo_planRepository_1_username=, bamboo_ManualBuildTriggerReason_userName=sbhatnag, bamboo_repository_20939039_branch_name=ARD-3, bamboo_planRepository_2_branchName=master, bamboo_capability_system_builder_ant_Ant=/usr, SSH_CONNECTION=10.2.103.226 49818 10.2.96.145 22, bamboo_planKey=ARD-BPT4, bamboo_planRepository_username=, NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat, BASH_FUNC_module()=() { eval `/usr/bin/modulecmd bash $*` build 12-Sep-2018 15:30:22 }, bamboo_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, bamboo_planRepository_1_branchName=ARD-3, bamboo_repository_20939039_git_branch=ARD-3, bamboo_capability_buildmachinetype=build, XDG_DATA_DIRS=/users/casaci/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/, bamboo_resultsUrl=https://open-bamboo.nrao.edu/browse/ARD-BPT4-TBFP-4, MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefiles, bamboo_build_working_directory=/export/home/cbt-el7-4/bamboohome/xml-data/build-dir/ARD-BPT4-TBFP, bamboo_planRepository_1_name=OPEN-CASA-FULL, QT_GRAPHICSSYSTEM=native, bamboo_shortPlanName=ARD-3, bamboo_capability_hostname=cbt-el7-4.cv.nrao.edu, MAIL=/var/spool/mail/casaci, bamboo_planRepository_2_username=, bamboo_planRepository_name=OPEN-CASA-FULL, LOGNAME=casaci, bamboo_buildNumber=4, SHELL=/bin/bash, bamboo_planName=ARD - Build And Package - ARD-3, bamboo_shortPlanKey=BPT4, OLDPWD=/usr/lib/jvm/gradle-3.2.1, bamboo_shortJobKey=TBFP, bamboo_planRepository_2_name=OPEN-CASA-PKG, SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass, bamboo_repository_previous_revision_number=786b1dc3ae141cae7d76e110084b53cedfee67ec, bamboo_buildTimeStamp=2018-09-12T14:51:09.259-04:00, bamboo_repository_20938876_branch_name=master, bamboo_buildResultKey=ARD-BPT4-TBFP-4, bamboo_repository_git_branch=ARD-3, bamboo_capability_system_jdk_JDK_1_8_0_102=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.102-1.b14.el7_2.x86_64, bamboo_buildPlanName=ARD - Build And Package - ARD-3 - Tag Branch for Packages, LS_COLORS=rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:, bamboo_planRepository_1_revision=24d0ec81f2390e8db3fbfdc1d6ce03e54cbd304d, bamboo_capability_system_hg_executable=/bin/hg, bamboo_repository_name=OPEN-CASA-PKG, bamboo_planRepository_2_previousRevision=de293f6de3d7409f904a575ef3a9e4a11736ad0c, XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt, LANG=en_US.UTF-8, bamboo_buildFailed=false, HISTFILESIZE=200000, bamboo_agentWorkingDirectory=/export/home/cbt-el7-4/bamboohome/xml-data/build-dir, bamboo_capability_system_git_executable=/bin/git, bamboo_planRepository_2_revision=e5f8bf188c0f97f776d1d09c8b4efcd543aef049, bamboo_capability_system_jdk_JDK_1_8_0_111=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64, bamboo_planRepository_1_previousRevision=786b1dc3ae141cae7d76e110084b53cedfee67ec, bamboo_repository_git_username=, bamboo_capability_operating_system=EL7, bamboo_planRepository_branchDisplayName=ARD-3, bamboo_capability_project=CASA, bamboo_planRepository_2_type=bbserver, GUESTFISH_PS1=\[\e[1;32m\]>\[\e[0;31m\] , bamboo_plan_storageTag=plan-20744168, USER=casaci, bamboo_planRepository_2_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa-pkg.git, bamboo_repository_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git, bamboo_working_directory=/export/home/cbt-el7-4/bamboohome/xml-data/build-dir/ARD-BPT4-TBFP, HOSTNAME=cbt-el7-4, QTDIR=/usr/lib64/qt-3.3, MODULESHOME=/usr/share/Modules, bamboo_planRepository_1_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git, bamboo_repository_20939039_git_username=, bamboo_capability_system_jdk_JDK_1_8=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.102-1.b14.el7_2.x86_64, WRAPPER_ARCH=x86, KDEDIRS=/usr, bamboo_repository_20938876_git_repositoryUrl=ssh://git@open-bitbucket.nrao.edu:7999/casa/casa-pkg.git, XDG_RUNTIME_DIR=/run/user/9285, GUESTFISH_OUTPUT=\e[0m, HOME=/users/casaci, QTLIB=/usr/lib64/qt-3.3/lib] build 12-Sep-2018 15:30:22 sourceDir: /export/home/cbt-el7-4/bamboohome/xml-data/build-dir/ARD-BPT4-TBFP/taggitworkdir/casa build 12-Sep-2018 15:30:22 Resolving CAS-/feature/bugfix tag build 12-Sep-2018 15:30:22 Branch parts: [ARD-3] build 12-Sep-2018 15:30:22 Checking for an existing tag for the branch build 12-Sep-2018 15:30:22 tagGrep: grep test-ARD-3 build 12-Sep-2018 15:30:22 java.lang.UNIXProcess@7df98ddb | java.lang.UNIXProcess@724a1edf | java.lang.UNIXProcess@6ae73372 | java.lang.UNIXProcess@1a99434b build 12-Sep-2018 15:30:22 Checking out ARD-3 error 12-Sep-2018 15:30:22 Switched to branch 'ARD-3' build 12-Sep-2018 15:30:23 Your branch is behind 'origin/ARD-3' by 698 commits, and can be fast-forwarded. build 12-Sep-2018 15:30:23 (use "git pull" to update your local branch) build 12-Sep-2018 15:30:23 build 12-Sep-2018 15:30:23 Updating ARD-3 build 12-Sep-2018 15:30:24 Updating 786b1dc..24d0ec8 build 12-Sep-2018 15:30:24 Fast-forward build 12-Sep-2018 15:30:24 .gitignore | 4 +- build 12-Sep-2018 15:30:24 casacore | 2 +- build 12-Sep-2018 15:30:24 code/CMakeLists.txt | 57 +- build 12-Sep-2018 15:30:24 code/air_casawvr/cmdline/wvrgcalargs.hpp | 65 + build 12-Sep-2018 15:30:24 code/alma/ASDM/ASDM.cc | 150 + build 12-Sep-2018 15:30:24 code/alma/ASDM/ASDM.h | 28 + build 12-Sep-2018 15:30:24 code/alma/ASDM/ASDMEntities.h | 8 + build 12-Sep-2018 15:30:24 code/alma/ASDM/ASDMValuesParser.h | 78 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/AlmaRadiometerTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/AlmaRadiometerTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/AnnotationTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/AnnotationTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/AntennaTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalAmpliTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalAmpliTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalAntennaSolutionsRow.cc | 3198 ++++++++++++++++++++ build 12-Sep-2018 15:30:24 code/alma/ASDM/CalAntennaSolutionsRow.h | 1365 +++++++++ build 12-Sep-2018 15:30:24 code/alma/ASDM/CalAntennaSolutionsTable.cc | 1334 ++++++++ build 12-Sep-2018 15:30:24 code/alma/ASDM/CalAntennaSolutionsTable.h | 762 +++++ build 12-Sep-2018 15:30:24 code/alma/ASDM/CalAppPhaseTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalAppPhaseTable.h | 14 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalAtmosphereTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalAtmosphereTable.h | 6 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalBandpassRow.cc | 1660 +++++++++- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalBandpassRow.h | 427 +++ build 12-Sep-2018 15:30:24 code/alma/ASDM/CalBandpassTable.cc | 52 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalBandpassTable.h | 71 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalCurveTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalCurveTable.h | 8 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalDataTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalDataTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalDelayTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalDelayTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalDeviceTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalDeviceTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalFluxTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalFluxTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalFocusModelTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalFocusModelTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalFocusTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalFocusTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalGainTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalHolographyTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalHolographyTable.h | 6 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalPhaseTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalPhaseTable.h | 6 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalPointingModelTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalPointingModelTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalPointingTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalPointingTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalPositionTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalPositionTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalPrimaryBeamTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalPrimaryBeamTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalReductionTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalReductionTable.h | 6 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalSeeingTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalSeeingTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalWVRTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CalWVRTable.h | 6 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/ConfigDescriptionTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/ConfigDescriptionTable.h | 10 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CorrelatorModeTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/CorrelatorModeTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/DataDescriptionRow.cc | 142 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/DataDescriptionRow.h | 50 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/DataDescriptionTable.cc | 22 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/DataDescriptionTable.h | 10 + build 12-Sep-2018 15:30:24 code/alma/ASDM/DelayModelFixedParametersTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/DelayModelTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/DelayModelTable.h | 6 +- build 12-Sep-2018 15:30:24 .../alma/ASDM/DelayModelVariableParametersTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/DopplerTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/EntityId.cc | 23 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/EphemerisTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/EphemerisTable.h | 6 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/ExecBlockTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/ExecBlockTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/FeedTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/FeedTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/FieldTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/FieldTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/FlagCmdTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/FlagRow.cc | 407 +++ build 12-Sep-2018 15:30:24 code/alma/ASDM/FlagRow.h | 122 + build 12-Sep-2018 15:30:24 code/alma/ASDM/FlagTable.cc | 27 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/FlagTable.h | 31 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/FocusModelTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/FocusModelTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/FocusTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/FreqOffsetTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/GainTrackingTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/GainTrackingTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/HistoryTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/HolographyTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/HolographyTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/MainTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/MainTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/Merger.cc | 90 + build 12-Sep-2018 15:30:24 code/alma/ASDM/Merger.h | 20 + build 12-Sep-2018 15:30:24 code/alma/ASDM/Misc.cc | 116 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/Misc.h | 84 + build 12-Sep-2018 15:30:24 code/alma/ASDM/ObservationTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/Parser.cc | 85 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/Parser.h | 5 + build 12-Sep-2018 15:30:24 code/alma/ASDM/PointingModelTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/PointingModelTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/PointingTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/PointingTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/PolarizationTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/PolarizationTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/ProcessorTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/PulsarRow.cc | 2300 ++++++++++++++ build 12-Sep-2018 15:30:24 code/alma/ASDM/PulsarRow.h | 1004 ++++++ build 12-Sep-2018 15:30:24 code/alma/ASDM/PulsarTable.cc | 1206 ++++++++ build 12-Sep-2018 15:30:24 code/alma/ASDM/PulsarTable.h | 615 ++++ build 12-Sep-2018 15:30:24 code/alma/ASDM/ReceiverTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/ReceiverTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SBSummaryTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SBSummaryTable.h | 8 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/ScaleTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/ScanTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/ScanTable.h | 6 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SeeingTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SeeingTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SourceTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SourceTable.h | 6 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SpectralWindowTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SpectralWindowTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SquareLawDetectorTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SquareLawDetectorTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/StateTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/StationTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SubscanTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SubscanTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SwitchCycleTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SwitchCycleTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SysCalTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SysCalTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SysPowerTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/SysPowerTable.h | 2 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/TableStreamReader.h | 107 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/Tag.cc | 25 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/Tag.h | 11 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/TagType.cc | 12 + build 12-Sep-2018 15:30:24 code/alma/ASDM/TagType.h | 15 + build 12-Sep-2018 15:30:24 code/alma/ASDM/TotalPowerTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/WVMCalTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/WVMCalTable.h | 6 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/WeatherTable.cc | 15 +- build 12-Sep-2018 15:30:24 code/alma/ASDM/WeatherTable.h | 4 +- build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/SDMBinData.cc | 26 +- build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/SDMBinData.h | 12 +- build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/SDMDataObject.cc | 23 +- build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/SDMDataObject.h | 18 +- build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/SDMDataObjectParser.cc | 107 +- build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/SDMDataObjectParser.h | 45 +- build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/SDMDataObjectReader.cc | 72 +- build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/SDMDataObjectReader.h | 26 +- build 12-Sep-2018 15:30:24 .../alma/ASDMBinaries/SDMDataObjectStreamReader.cc | 82 +- build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/SDMDataObjectStreamReader.h | 5 +- build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/SDMDataObjectWriter.h | 1 - build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/SDMDataViews.h | 9 +- build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/test/tReadAllBDFs.cc | 55 +- build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/test/tReadParBDFs.cc | 161 +- build 12-Sep-2018 15:30:24 code/alma/ASDMBinaries/test/tReadSeqBDFs.cc | 130 +- build 12-Sep-2018 15:30:24 code/alma/CMakeLists.txt | 37 +- build 12-Sep-2018 15:30:24 code/alma/Options/AlmaArg.h | 100 + build 12-Sep-2018 15:30:24 code/alma/apps/MS2asdm/MS2asdm.cc | 206 +- build 12-Sep-2018 15:30:24 code/alma/apps/asdm2MS/ASDMTables.cc | 503 +++ build 12-Sep-2018 15:30:24 code/alma/apps/asdm2MS/ASDMTables.h | 26 + build 12-Sep-2018 15:30:24 code/alma/apps/asdm2MS/AnyValueMap.hpp | 5 + build 12-Sep-2018 15:30:24 code/alma/apps/asdm2MS/Name2Table.cc | 49 +- build 12-Sep-2018 15:30:24 code/alma/apps/asdm2MS/ScansParser.cc | 140 + build 12-Sep-2018 15:30:24 code/alma/apps/asdm2MS/ScansParser.h | 20 + build 12-Sep-2018 15:30:24 code/alma/apps/asdm2MS/asdm2MS.cc | 1511 +++++---- build 12-Sep-2018 15:30:24 code/alma/apps/asdm2MS/asdm2MSGeneric.h | 21 +- build 12-Sep-2018 15:30:24 code/alma/apps/asdm2MS/bdflags2MS.cc | 444 +-- build 12-Sep-2018 15:30:24 code/alma/apps/asdm2MS/parasdm2MS.cc | 419 ++- build 12-Sep-2018 15:30:24 code/alma/apps/asdmSummary/asdmSummary.cc | 122 +- build 12-Sep-2018 15:30:24 code/atnf/atca/ATAtmosphere.cc | 8 +- build 12-Sep-2018 15:30:24 code/casaqt/CMakeLists.txt | 3 +- build 12-Sep-2018 15:30:24 code/casaqt/QwtPlotter/QPCanvasHelpers.cc | 31 +- build 12-Sep-2018 15:30:24 code/casaqt/QwtPlotter/QPScatterPlot.cc | 4 +- build 12-Sep-2018 15:30:24 .../qcasabrowser.cc => casabrowser/casabrowser.cc} | 21 - build 12-Sep-2018 15:30:24 code/casaqt/apps/qcasabrowser/casabrowser | 16 - build 12-Sep-2018 15:30:24 code/components/ComponentModels/DiskShape.cc | 7 +- build 12-Sep-2018 15:30:24 .../ComponentModels/FluxCalcLogFreqPolynomial.cc | 21 +- build 12-Sep-2018 15:30:24 .../ComponentModels/FluxCalcLogFreqPolynomial.h | 2 + build 12-Sep-2018 15:30:24 code/components/ComponentModels/FluxCalcVQS.cc | 26 +- build 12-Sep-2018 15:30:24 code/components/ComponentModels/FluxCalcVQS.h | 3 + build 12-Sep-2018 15:30:24 .../ComponentModels/FluxCalc_SS_JPL_Butler.cc | 31 +- build 12-Sep-2018 15:30:24 code/components/ComponentModels/FluxStandard.cc | 18 + build 12-Sep-2018 15:30:24 code/components/ComponentModels/FluxStandard.h | 3 + build 12-Sep-2018 15:30:24 code/components/ComponentModels/FluxStdSrcs.cc | 59 +- build 12-Sep-2018 15:30:24 code/components/ComponentModels/FluxStdSrcs.h | 13 + build 12-Sep-2018 15:30:24 code/components/ComponentModels/FluxStdsQS2.cc | 70 +- build 12-Sep-2018 15:30:24 code/components/ComponentModels/FluxStdsQS2.h | 38 + build 12-Sep-2018 15:30:24 .../test/EphemObjFluxStandard_GTest.cc | 10 +- build 12-Sep-2018 15:30:24 .../ComponentModels/test/FluxStandard2_GTest.cc | 251 +- build 12-Sep-2018 15:30:24 .../ComponentModels/test/FluxStandard2_GTest.h | 31 + build 12-Sep-2018 15:30:24 .../ComponentModels/test/tFluxStandard2.cc | 13 +- build 12-Sep-2018 15:30:24 .../ComponentModels/test/tFluxStandard3.cc | 13 +- build 12-Sep-2018 15:30:24 code/crash/apps/reporter/CrashReportPoster.cc | 4 +- build 12-Sep-2018 15:30:24 code/display/CMakeLists.txt | 4 +- build 12-Sep-2018 15:30:24 code/display/Display/DisplayCoordinateSystem.h | 2 +- build 12-Sep-2018 15:30:24 code/display/Display/{State.cc => DisplayState.cc} | 2 +- build 12-Sep-2018 15:30:24 code/display/Display/{State.h => DisplayState.h} | 0 build 12-Sep-2018 15:30:24 code/display/DisplayCanvas/WCCSNLAxisLabeller.cc | 2 +- build 12-Sep-2018 15:30:24 code/display/QtPlotter/CanvasCurve.cc | 4 +- build 12-Sep-2018 15:30:24 code/display/QtPlotter/QtCanvas.qo.h | 2 +- build 12-Sep-2018 15:30:24 code/display/QtPlotter/QtPlotSettings.cc | 14 +- build 12-Sep-2018 15:30:24 code/display/QtPlotter/QtPlotSettings.h | 6 +- build 12-Sep-2018 15:30:24 code/display/QtPlotter/QtProfile.cc | 4 +- build 12-Sep-2018 15:30:24 code/display/QtViewer/QtDBusViewerAdaptor.cc | 9 +- build 12-Sep-2018 15:30:24 code/display/QtViewer/QtDisplayData.cc | 6 +- build 12-Sep-2018 15:30:24 code/display/QtViewer/QtDisplayData.qo.h | 2 +- build 12-Sep-2018 15:30:24 code/display/QtViewer/QtWCBox.cc | 1 + build 12-Sep-2018 15:30:24 code/display/RegionShapes/QtNewRegionShape.cc | 8 +- build 12-Sep-2018 15:30:24 code/display/RegionShapes/QtNewRegionShape.qo.h | 8 +- build 12-Sep-2018 15:30:24 code/display/apps/casaviewer/casaviewer.cc | 32 + build 12-Sep-2018 15:30:24 code/flagging/Flagging/FlagDataHandler.cc | 17 +- build 12-Sep-2018 15:30:24 code/imageanalysis/Annotations/AnnEllipse.cc | 7 +- build 12-Sep-2018 15:30:24 code/imageanalysis/Annotations/AnnSymbol.cc | 4 +- build 12-Sep-2018 15:30:24 code/imageanalysis/Annotations/AnnSymbol.h | 2 +- build 12-Sep-2018 15:30:24 code/imageanalysis/Annotations/AnnotationBase.cc | 15 +- build 12-Sep-2018 15:30:24 code/imageanalysis/Annotations/AnnotationBase.h | 16 +- build 12-Sep-2018 15:30:24 code/imageanalysis/CMakeLists.txt | 10 +- build 12-Sep-2018 15:30:24 code/imageanalysis/IO/AsciiAnnotationFileLine.cc | 4 +- build 12-Sep-2018 15:30:24 code/imageanalysis/IO/AsciiAnnotationFileLine.h | 6 +- build 12-Sep-2018 15:30:24 code/imageanalysis/IO/RegionTextParser.cc | 2 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/BeamManipulator.tcc | 6 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/ComplexImageRegridder.cc | 85 - build 12-Sep-2018 15:30:24 .../ImageAnalysis/ComplexImageRegridder.h | 45 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/ComplexImageRegridder.tcc | 91 + build 12-Sep-2018 15:30:24 .../imageanalysis/ImageAnalysis/ComponentImager.cc | 14 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/Image2DConvolver.tcc | 2 +- build 12-Sep-2018 15:30:24 .../imageanalysis/ImageAnalysis/ImageCollapser.tcc | 80 + build 12-Sep-2018 15:30:24 .../imageanalysis/ImageAnalysis/ImageCollapser2.cc | 87 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/ImageConcatenator.tcc | 22 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/ImageExprCalculator.tcc | 26 +- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/ImageFactory.h | 58 +- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/ImageFactory.tcc | 95 +- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/ImageFactory2.cc | 241 +- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/ImageFitter.cc | 10 +- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/ImageHistory.h | 10 +- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/ImageHistory.tcc | 12 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/ImageInputProcessor2.tcc | 3 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/ImageMaskHandler.tcc | 13 +- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/ImageMetaData.cc | 268 -- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/ImageMetaData.h | 120 +- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/ImageMetaData.tcc | 201 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/ImageMetaDataBase.cc | 1271 -------- build 12-Sep-2018 15:30:24 .../ImageAnalysis/ImageMetaDataBase.h | 236 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/ImageMetaDataBase.tcc | 1246 ++++++++ build 12-Sep-2018 15:30:24 .../ImageAnalysis/ImageMetaDataConstants.cc | 60 + build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/ImageMetaDataRW.h | 33 +- build 12-Sep-2018 15:30:24 .../{ImageMetaDataRW.cc => ImageMetaDataRW.tcc} | 395 ++- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/ImagePolProxy.cc | 6 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/ImagePolarimetry.cc | 4 +- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/ImageRegridder.h | 69 +- build 12-Sep-2018 15:30:24 .../{ImageRegridder.cc => ImageRegridder.tcc} | 548 ++-- build 12-Sep-2018 15:30:24 .../ImageAnalysis/ImageRegridderBase.tcc | 2 +- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/ImageRotator.cc | 2 +- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageAnalysis/PVGenerator.cc | 2 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/PixelValueManipulator.h | 395 +-- build 12-Sep-2018 15:30:24 .../ImageAnalysis/PixelValueManipulator.tcc | 200 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/test/tImageCollapser.cc | 4 +- build 12-Sep-2018 15:30:24 .../ImageAnalysis/test/tImagePolarimetry.cc | 8 +- build 12-Sep-2018 15:30:24 code/imageanalysis/ImageTypedefs.h | 6 +- build 12-Sep-2018 15:30:24 code/imageanalysis/Images/ComponentListImage.cc | 69 +- build 12-Sep-2018 15:30:24 code/imageanalysis/Regions/CasacRegionManager.cc | 2 +- build 12-Sep-2018 15:30:24 code/mstransform/CMakeLists.txt | 2 + build 12-Sep-2018 15:30:24 .../MSTransform/MSTransformDataHandler.cc | 122 +- build 12-Sep-2018 15:30:24 .../MSTransform/MSTransformDataHandler.h | 50 +- build 12-Sep-2018 15:30:24 code/mstransform/MSTransform/MSTransformManager.cc | 155 +- build 12-Sep-2018 15:30:24 code/mstransform/MSTransform/MSTransformManager.h | 3 + build 12-Sep-2018 15:30:24 code/mstransform/MSTransform/MSUVBin.cc | 15 +- build 12-Sep-2018 15:30:24 code/mstransform/MSTransform/StatWt.cc | 188 +- build 12-Sep-2018 15:30:24 code/mstransform/MSTransform/StatWt.h | 30 +- build 12-Sep-2018 15:30:24 code/mstransform/MSTransform/StatWtColConfig.cc | 254 ++ build 12-Sep-2018 15:30:24 code/mstransform/MSTransform/StatWtColConfig.h | 104 + build 12-Sep-2018 15:30:24 code/mstransform/TVI/StatWtTVI.cc | 133 +- build 12-Sep-2018 15:30:24 code/mstransform/TVI/StatWtTVI.h | 12 + build 12-Sep-2018 15:30:24 code/msvis/MSVis/AveragingTvi2.cc | 4 +- build 12-Sep-2018 15:30:24 code/msvis/MSVis/MSCalEnums.cc | 2 + build 12-Sep-2018 15:30:24 code/msvis/MSVis/MSCalEnums.h | 2 + build 12-Sep-2018 15:30:24 code/msvis/MSVis/MSIter2.cc | 2 +- build 12-Sep-2018 15:30:24 code/msvis/MSVis/MSUVWGenerator.cc | 1 + build 12-Sep-2018 15:30:24 code/msvis/MSVis/MSUtil.cc | 2 + build 12-Sep-2018 15:30:24 code/msvis/MSVis/SelectAverageSpw.cc | 2 +- build 12-Sep-2018 15:30:24 code/msvis/MSVis/TransformingVi2.h | 2 +- build 12-Sep-2018 15:30:24 code/msvis/MSVis/ViFrequencySelection.h | 2 +- build 12-Sep-2018 15:30:24 code/msvis/MSVis/VisBuffer.cc | 2 - build 12-Sep-2018 15:30:24 code/msvis/MSVis/VisibilityIteratorImpl2.cc | 2 + build 12-Sep-2018 15:30:24 code/nrao/VLA/VLAADA.cc | 5 +- build 12-Sep-2018 15:30:24 code/nrao/VLA/VLAFiller.cc | 2 +- build 12-Sep-2018 15:30:24 code/plotms/Actions/ActionExport.cc | 101 +- build 12-Sep-2018 15:30:24 code/plotms/Actions/ActionSummary.cc | 20 + build 12-Sep-2018 15:30:24 code/plotms/CMakeLists.txt | 42 +- build 12-Sep-2018 15:30:24 code/plotms/Data/CalCache.cc | 982 +++++- build 12-Sep-2018 15:30:24 code/plotms/Data/CalCache.h | 135 +- build 12-Sep-2018 15:30:24 code/plotms/Data/MSCache.cc | 123 +- build 12-Sep-2018 15:30:24 code/plotms/Data/PlotMSAtm.cc | 166 +- build 12-Sep-2018 15:30:24 code/plotms/Data/PlotMSAtm.h | 2 + build 12-Sep-2018 15:30:24 code/plotms/Data/PlotMSCacheBase.cc | 132 +- build 12-Sep-2018 15:30:24 code/plotms/Data/PlotMSCacheBase.h | 127 +- build 12-Sep-2018 15:30:24 code/plotms/Data/PlotMSIndexer.cc | 327 +- build 12-Sep-2018 15:30:24 code/plotms/Data/PlotMSIndexer.h | 6 +- build 12-Sep-2018 15:30:24 code/plotms/Gui/PlotMSSummaryDialog.cc | 2 +- build 12-Sep-2018 15:30:24 code/plotms/GuiTabs/PlotMSIterateTab.cc | 10 +- build 12-Sep-2018 15:30:24 code/plotms/GuiTabs/PlotMSOptionsTab.cc | 1 + build 12-Sep-2018 15:30:24 code/plotms/PlotMS/PlotMSConstants.cc | 10 +- build 12-Sep-2018 15:30:24 code/plotms/PlotMS/PlotMSConstants.h | 2 + build 12-Sep-2018 15:30:24 code/plotms/PlotMS/PlotMSSelection.cc | 372 ++- build 12-Sep-2018 15:30:24 code/plotms/PlotMS/PlotMSSelection.h | 36 +- build 12-Sep-2018 15:30:24 code/plotms/Plots/PlotMSPlot.cc | 106 +- build 12-Sep-2018 15:30:24 code/plotms/Plots/PlotMSPlot.h | 3 + build 12-Sep-2018 15:30:24 code/plotms/test/PlotMSCacheAveraging_GT.cc | 651 ++++ build 12-Sep-2018 15:30:24 code/plotms/test/PlotMSCacheCallib_GT.cc | 128 + build 12-Sep-2018 15:30:24 code/plotms/test/PlotMSCacheGeom_GT.cc | 235 ++ build 12-Sep-2018 15:30:24 code/plotms/test/PlotMSCacheInvalid_GT.cc | 91 + build 12-Sep-2018 15:30:24 code/plotms/test/PlotMSCacheLtdVis_GT.cc | 209 ++ build 12-Sep-2018 15:30:24 code/plotms/test/PlotMSCacheMetadata_GT.cc | 200 ++ build 12-Sep-2018 15:30:24 code/plotms/test/PlotMSCacheOverlays_GT.cc | 119 + build 12-Sep-2018 15:30:24 code/plotms/test/PlotMSCacheSelection_GT.cc | 514 ++++ build 12-Sep-2018 15:30:24 code/plotms/test/PlotMSCacheTransform_GT.cc | 284 ++ build 12-Sep-2018 15:30:24 code/plotms/test/PlotMSCacheVis_GT.cc | 394 +++ build 12-Sep-2018 15:30:24 code/plotms/test/dAveraging.cc | 136 - build 12-Sep-2018 15:30:24 code/plotms/test/dAveragingChannel.cc | 139 - build 12-Sep-2018 15:30:24 code/plotms/test/dAveragingTime.cc | 116 - build 12-Sep-2018 15:30:24 code/plotms/test/dCacheData.cc | 78 + build 12-Sep-2018 15:30:24 code/plotms/test/dDataSelection.cc | 83 - build 12-Sep-2018 15:30:24 code/plotms/test/dExportPlot.cc | 4 +- build 12-Sep-2018 15:30:24 code/plotms/test/dExportRange.cc | 163 - build 12-Sep-2018 15:30:24 code/plotms/test/dExportRangeInternal.cc | 116 - build 12-Sep-2018 15:30:24 code/plotms/test/dExportRangeLeftBottom.cc | 121 - build 12-Sep-2018 15:30:24 code/plotms/test/dExportRangeLeftTop.cc | 121 - build 12-Sep-2018 15:30:24 code/plotms/test/dExportRangePipeline.cc | 123 - build 12-Sep-2018 15:30:24 code/plotms/test/dExportRangeRightBottom.cc | 121 - build 12-Sep-2018 15:30:24 code/plotms/test/dExportRangeRightTop.cc | 121 - build 12-Sep-2018 15:30:24 code/plotms/test/dGridPlacement.cc | 108 - build 12-Sep-2018 15:30:24 code/plotms/test/dGridPlacementMultiplePlots.cc | 116 - build 12-Sep-2018 15:30:24 code/plotms/test/dGridPlacementMultipleRuns.cc | 237 -- build 12-Sep-2018 15:30:24 code/plotms/test/dLegend.cc | 137 - build 12-Sep-2018 15:30:24 code/plotms/test/dMultiplePlotTypes.cc | 200 -- build 12-Sep-2018 15:30:24 code/plotms/test/dOverIterationPlot.cc | 140 - build 12-Sep-2018 15:30:24 code/plotms/test/dOverLeftRightPlot.cc | 124 - build 12-Sep-2018 15:30:24 code/plotms/test/dOverPlot.cc | 124 - build 12-Sep-2018 15:30:24 code/plotms/test/dOverPlot2Files.cc | 141 - build 12-Sep-2018 15:30:24 code/plotms/test/dSymbol.cc | 93 - build 12-Sep-2018 15:30:24 code/plotms/test/dTimeAveragingIteration.cc | 116 - build 12-Sep-2018 15:30:24 code/plotms/test/dTimeColorization.cc | 103 - build 12-Sep-2018 15:30:24 code/plotms/test/dTimeColorizationAveraging.cc | 109 - build 12-Sep-2018 15:30:24 code/plotms/test/dTimeIteration.cc | 110 - build 12-Sep-2018 15:30:24 code/plotms/test/tUtil.h | 68 +- build 12-Sep-2018 15:30:24 code/singledishfiller/Filler/NRO2MSReader.cc | 37 +- build 12-Sep-2018 15:30:24 code/singledishfiller/Filler/NRO2MSReader.h | 68 +- build 12-Sep-2018 15:30:24 code/singledishfiller/Filler/ReaderInterface.h | 27 +- build 12-Sep-2018 15:30:24 code/singledishfiller/Filler/SingleDishMSFiller.h | 3 - build 12-Sep-2018 15:30:24 .../singledishfiller/Filler/SingleDishMSFiller.tcc | 45 +- build 12-Sep-2018 15:30:24 code/spectrallines/Splatalogue/SearcherFactory.cc | 19 +- build 12-Sep-2018 15:30:24 code/stdcasa/CMakeLists.txt | 1 + build 12-Sep-2018 15:30:24 code/stdcasa/StdCasa/variant.cc | 6 +- build 12-Sep-2018 15:30:24 code/stdcasa/optionparser.h | 2858 +++++++++++++++++ build 12-Sep-2018 15:30:24 code/synthesis/CMakeLists.txt | 2 + build 12-Sep-2018 15:30:24 code/synthesis/CalTables/CTSummary.cc | 6 +- build 12-Sep-2018 15:30:24 code/synthesis/CalTables/CalBuffer.cc | 2 +- build 12-Sep-2018 15:30:24 code/synthesis/CalTables/CalSet.tcc | 3 +- build 12-Sep-2018 15:30:24 code/synthesis/CalTables/CalSummary.cc | 808 +++++ build 12-Sep-2018 15:30:24 code/synthesis/CalTables/CalSummary.h | 163 + build 12-Sep-2018 15:30:24 code/synthesis/CalTables/CalTable.cc | 105 +- build 12-Sep-2018 15:30:24 code/synthesis/CalTables/CalTable.h | 14 + build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SDAlgorithmBase.cc | 37 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SDMaskHandler.cc | 315 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SDMaskHandler.h | 14 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SIImageStore.cc | 178 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SIImageStore.h | 57 +- build 12-Sep-2018 15:30:24 .../ImagerObjects/SIImageStoreMultiTerm.cc | 120 +- build 12-Sep-2018 15:30:24 .../ImagerObjects/SIImageStoreMultiTerm.h | 57 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SIIterBot.cc | 69 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SIIterBot.h | 9 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SIMapper.cc | 30 +- build 12-Sep-2018 15:30:24 .../ImagerObjects/SIMinorCycleController.cc | 44 +- build 12-Sep-2018 15:30:24 .../ImagerObjects/SIMinorCycleController.h | 7 + build 12-Sep-2018 15:30:24 .../ImagerObjects/SynthesisDeconvolver.cc | 19 +- build 12-Sep-2018 15:30:24 .../synthesis/ImagerObjects/SynthesisDeconvolver.h | 1 + build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SynthesisImager.cc | 148 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SynthesisImager.h | 9 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SynthesisImagerVi2.cc | 184 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SynthesisImagerVi2.h | 13 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SynthesisIterBot.cc | 2 + build 12-Sep-2018 15:30:24 .../synthesis/ImagerObjects/SynthesisNormalizer.cc | 66 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects/SynthesisNormalizer.h | 6 +- build 12-Sep-2018 15:30:24 .../ImagerObjects/SynthesisUtilMethods.cc | 235 +- build 12-Sep-2018 15:30:24 .../synthesis/ImagerObjects/SynthesisUtilMethods.h | 15 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects2/SIMapper.cc | 16 +- build 12-Sep-2018 15:30:24 code/synthesis/ImagerObjects2/SynthesisImager.cc | 35 +- build 12-Sep-2018 15:30:24 code/synthesis/MeasurementComponents/AccorJones.cc | 8 - build 12-Sep-2018 15:30:24 code/synthesis/MeasurementComponents/AccorJones.h | 4 +- build 12-Sep-2018 15:30:24 code/synthesis/MeasurementComponents/Calibrater.cc | 8 +- build 12-Sep-2018 15:30:24 code/synthesis/MeasurementComponents/Calibrater.h | 3 +- build 12-Sep-2018 15:30:24 .../synthesis/MeasurementComponents/FringeJones.cc | 1983 +++++++++++- build 12-Sep-2018 15:30:24 code/synthesis/MeasurementComponents/FringeJones.h | 125 +- build 12-Sep-2018 15:30:24 code/synthesis/MeasurementComponents/GSpline.h | 2 + build 12-Sep-2018 15:30:24 code/synthesis/MeasurementComponents/KJones.cc | 2 +- build 12-Sep-2018 15:30:24 code/synthesis/MeasurementComponents/SDGrid.cc | 7 + build 12-Sep-2018 15:30:24 .../MeasurementComponents/SolvableVisCal.h | 14 +- build 12-Sep-2018 15:30:24 .../MeasurementComponents/SolveDataBuffer.cc | 18 + build 12-Sep-2018 15:30:24 .../MeasurementComponents/SolveDataBuffer.h | 3 + build 12-Sep-2018 15:30:24 code/synthesis/MeasurementComponents/VisCal.h | 10 +- build 12-Sep-2018 15:30:24 .../MeasurementComponents/VisCalGlobals.cc | 2 +- build 12-Sep-2018 15:30:24 .../MeasurementComponents/test/tFringeJones_GT.cc | 128 +- build 12-Sep-2018 15:30:24 code/synthesis/MeasurementEquations/Imager.cc | 10 +- build 12-Sep-2018 15:30:24 code/synthesis/MeasurementEquations/Imager2.cc | 1 + build 12-Sep-2018 15:30:24 .../MeasurementEquations/SideBandSeparator.cc | 22 +- build 12-Sep-2018 15:30:24 .../TransformMachines/HetArrayConvFunc.cc | 17 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines/PBMath.cc | 46 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines/PBMath.h | 14 +- build 12-Sep-2018 15:30:24 .../synthesis/TransformMachines/PBMath1DNumeric.cc | 11 + build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines/PBMath1DNumeric.h | 2 + build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines/PBMath2DImage.cc | 22 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines/PBMath2DImage.h | 2 +- build 12-Sep-2018 15:30:24 .../synthesis/TransformMachines/StokesImageUtil.cc | 44 + build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines/StokesImageUtil.h | 4 + build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines/Utils.cc | 4 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines/WPConvFunc.cc | 4 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/AWConvFunc.cc | 47 +- build 12-Sep-2018 15:30:24 .../TransformMachines2/AWConvFuncEPJones.cc | 5 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/AWProjectFT.cc | 22 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/AWProjectWBFT.cc | 33 +- build 12-Sep-2018 15:30:24 .../synthesis/TransformMachines2/AWVisResampler.cc | 361 +-- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/AWVisResampler.h | 13 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/BeamSkyJones.cc | 8 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/CFCache.cc | 6 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/FTMachine.cc | 93 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/FTMachine.h | 3 +- build 12-Sep-2018 15:30:24 .../TransformMachines2/FortranizedLoopsFromGrid.cc | 1 + build 12-Sep-2018 15:30:24 .../TransformMachines2/FortranizedLoopsToGrid.cc | 8 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/GridFT.cc | 87 +- build 12-Sep-2018 15:30:24 .../TransformMachines2/HetArrayConvFunc.cc | 100 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/MosaicFT.cc | 106 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/MosaicFT.h | 2 +- build 12-Sep-2018 15:30:24 .../synthesis/TransformMachines2/MultiTermFTNew.cc | 80 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/MultiTermFTNew.h | 11 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/SDGrid.cc | 7 + build 12-Sep-2018 15:30:24 .../TransformMachines2/SimplePBConvFunc.cc | 10 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/Utils.cc | 16 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/WPConvFunc.cc | 4 +- build 12-Sep-2018 15:30:24 code/synthesis/TransformMachines2/WProjectFT.cc | 10 +- build 12-Sep-2018 15:30:24 .../TransformMachines2/accumulateFromGrid.cc | 64 +- build 12-Sep-2018 15:30:24 .../TransformMachines2/accumulateFromGrid.inc | 61 + build 12-Sep-2018 15:30:24 .../TransformMachines2/accumulateToGrid.inc | 54 + build 12-Sep-2018 15:30:24 code/synthesis/Utilities/SDPosInterpolator.cc | 32 + build 12-Sep-2018 15:30:24 code/synthesis/Utilities/SDPosInterpolator.h | 3 + build 12-Sep-2018 15:30:24 code/synthesis/fortran/faccumulateFromGrid.f | 29 +- build 12-Sep-2018 15:30:24 gcwrap/CMakeLists.txt | 72 +- build 12-Sep-2018 15:30:24 gcwrap/install/casa2pypg.xsl | 5 +- build 12-Sep-2018 15:30:24 gcwrap/python/CMakeLists.txt | 21 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/casa.py | 17 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/imagerhelpers/CMakeLists.txt | 3 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/imagerhelpers/fixedDict.py | 41 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/imagerhelpers/imager_base.py | 27 +- build 12-Sep-2018 15:30:24 .../imagerhelpers/imager_parallel_continuum.py | 176 +- build 12-Sep-2018 15:30:24 .../scripts/imagerhelpers/input_parameters.py | 71 +- build 12-Sep-2018 15:30:24 .../imagerhelpers/parallel_imager_helper.py | 20 +- build 12-Sep-2018 15:30:24 .../scripts/imagerhelpers/test_imager_helper.py | 123 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/init_logger.py | 36 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/init_system.py | 2 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/mpi4casa/task_wrappers.py | 7 +- build 12-Sep-2018 15:30:24 .../scripts/parallel/parallel_task_helper.py | 4 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/recipes/CMakeLists.txt | 1 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/recipes/drawmaskinimage.py | 7 +- build 12-Sep-2018 15:30:24 .../scripts/recipes/imager_resource_predictor.py | 184 ++ build 12-Sep-2018 15:30:24 .../scripts/regressions/admin/extractCASAscript.py | 76 +- build 12-Sep-2018 15:30:24 .../scripts/regressions/admin/make_mmsdata.py | 1 + build 12-Sep-2018 15:30:24 .../alma-m100-analysis-hpc-regression-tclean.py | 2 +- build 12-Sep-2018 15:30:24 .../scripts/regressions/pipelineTest_regression.py | 142 +- build 12-Sep-2018 15:30:24 .../scripts/regressions/tests/CMakeLists.txt | 2 - build 12-Sep-2018 15:30:24 .../scripts/regressions/tests/orionmosaic.py | 32 - build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_autoclean.py | 508 ---- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_boxit.py | 230 -- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_clearplot.py | 15 - build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_csvclean.py | 383 --- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_find.py | 78 - build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_fringefit.py | 127 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_importevla.py | 423 --- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_imregrid.py | 98 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_initweights.py | 35 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_mosaic.py | 173 -- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_oldhanningsmooth.py | 71 - build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_oldpartition.py | 658 ---- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_oldplotants.py | 56 - build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_oldsplit.py | 53 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_oldstatwt.py | 81 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_plotms.py | 43 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_plotuv.py | 369 --- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_plotxy.py | 566 ---- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_predictcomp.py | 32 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_sdsidebandsplit.py | 4 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_ssoflux.py | 98 - build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_statwt.py | 133 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_statwt2.py | 62 - build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_tclean.py | 163 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_tclean2.py | 1 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_visstat2.py | 55 - build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_visstatold.py | 83 - build 12-Sep-2018 15:30:24 gcwrap/python/scripts/task_widefield.py | 221 -- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/testhelper.py | 23 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/CMakeLists.txt | 7 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_csvclean.py | 289 -- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_exportasdm.py | 4 - build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_flagdata.py | 315 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_gencal.py | 2 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_getchunk.py | 56 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_ia_fromarray.py | 46 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_ia_fromimage.py | 15 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_ia_fromshape.py | 5 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_ia_getregion.py | 29 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_ia_getslice.py | 146 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_ia_maskhandler.py | 18 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_ia_modify.py | 27 +- build 12-Sep-2018 15:30:24 .../scripts/tests/test_ia_newimagefromimage.py | 18 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_ia_putregion.py | 35 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_ia_subimage.py | 29 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_importasdm.py | 205 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_importcasa.py | 11 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_importevla.py | 492 --- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_importnro.py | 146 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_imregrid.py | 196 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_initweights.py | 38 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_mstransform.py | 1227 +++++--- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_oldstatwt.py | 120 + build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_plotms.py | 10 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_refimager.py | 519 +++- build 12-Sep-2018 15:30:24 .../scripts/tests/test_refimager_parallel.py | 93 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_sdimaging.py | 163 +- build 12-Sep-2018 15:30:24 .../python/scripts/tests/test_sdsidebandsplit.py | 48 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_setjy.py | 274 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_statwt.py | 861 +++++- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_statwt2.py | 726 ----- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_tsdimaging.py | 166 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/test_visstatold.py | 301 -- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/tests/uTest_list.json | 8 +- build 12-Sep-2018 15:30:24 gcwrap/python/scripts/viewertool.py | 3 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/CMakeLists.txt | 20 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/accor.xml | 2 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/asdmsummary.xml | 14 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/autoclean.xml | 795 ----- build 12-Sep-2018 15:30:24 gcwrap/tasks/boxit.xml | 121 - build 12-Sep-2018 15:30:24 gcwrap/tasks/clearplot.xml | 31 - build 12-Sep-2018 15:30:24 gcwrap/tasks/csvclean.xml | 246 -- build 12-Sep-2018 15:30:24 gcwrap/tasks/find.xml | 41 - build 12-Sep-2018 15:30:24 gcwrap/tasks/fixplanets.xml | 25 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/fixvis.xml | 28 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/flagdata.xml | 2 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/fringefit.xml | 339 +++ build 12-Sep-2018 15:30:24 gcwrap/tasks/imcollapse.xml | 9 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/imhead.xml | 2 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/importasap.xml | 8 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/importevla.xml | 342 --- build 12-Sep-2018 15:30:24 gcwrap/tasks/importnro.xml | 4 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/importvla.xml | 10 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/imreframe.xml | 21 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/imstat.xml | 5 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/initweights.xml | 6 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/listcal.xml | 128 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/listsdm.xml | 8 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/listvis.xml | 67 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/makemask.xml | 140 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/mosaic.xml | 605 ---- build 12-Sep-2018 15:30:24 gcwrap/tasks/mstransform.xml | 15 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/msuvbin.xml | 20 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/oldhanningsmooth.xml | 74 - build 12-Sep-2018 15:30:24 gcwrap/tasks/oldpartition.xml | 349 --- build 12-Sep-2018 15:30:24 gcwrap/tasks/oldplotants.xml | 59 - build 12-Sep-2018 15:30:24 gcwrap/tasks/oldsplit.xml | 10 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/oldstatwt.xml | 296 ++ build 12-Sep-2018 15:30:24 gcwrap/tasks/plotcal.xml | 8 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/plotms.xml | 81 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/plotuv.xml | 135 - build 12-Sep-2018 15:30:24 gcwrap/tasks/plotweather.xml | 8 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/plotxy.xml | 785 ----- build 12-Sep-2018 15:30:24 gcwrap/tasks/predictcomp.xml | 6 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/sdcal.xml | 7 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/sdgaincal.xml | 52 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/sdsidebandsplit.xml | 10 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/setjy.xml | 59 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/simalma.xml | 164 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/slsearch.xml | 5 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/specfit.xml | 55 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/specflux.xml | 12 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/spxfit.xml | 15 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/ssoflux.xml | 163 - build 12-Sep-2018 15:30:24 gcwrap/tasks/statwt.xml | 609 ++-- build 12-Sep-2018 15:30:24 gcwrap/tasks/statwt2.xml | 341 --- build 12-Sep-2018 15:30:24 gcwrap/tasks/tclean.xml | 865 +++--- build 12-Sep-2018 15:30:24 gcwrap/tasks/tclean2.xml | 2 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/tsdimaging.xml | 38 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/visstat.xml | 39 +- build 12-Sep-2018 15:30:24 gcwrap/tasks/visstat2.xml | 357 --- build 12-Sep-2018 15:30:24 gcwrap/tasks/visstatold.xml | 235 -- build 12-Sep-2018 15:30:24 gcwrap/tasks/widefield.xml | 655 ---- build 12-Sep-2018 15:30:24 gcwrap/tools/CMakeLists.txt | 2 + build 12-Sep-2018 15:30:24 gcwrap/tools/casa/quanta_cmpt.cc | 13 +- build 12-Sep-2018 15:30:24 gcwrap/tools/images/image.xml | 1061 ++++--- build 12-Sep-2018 15:30:24 gcwrap/tools/images/image_cmpt.cc | 1658 ++++++---- build 12-Sep-2018 15:30:24 gcwrap/tools/images/image_forward.h | 1 + build 12-Sep-2018 15:30:24 gcwrap/tools/images/image_private.h | 101 +- build 12-Sep-2018 15:30:24 gcwrap/tools/images/imagemetadata_cmpt.cc | 58 +- build 12-Sep-2018 15:30:24 gcwrap/tools/images/imagemetadata_forward.h | 4 +- build 12-Sep-2018 15:30:24 gcwrap/tools/images/imagemetadata_private.h | 8 +- build 12-Sep-2018 15:30:24 gcwrap/tools/images/imagepol_cmpt.cc | 8 +- build 12-Sep-2018 15:30:24 gcwrap/tools/ms/MSPlot/MsPlot.cc | 6 +- build 12-Sep-2018 15:30:24 gcwrap/tools/ms/ms.xml | 42 +- build 12-Sep-2018 15:30:24 gcwrap/tools/ms/ms_cmpt.cc | 23 +- build 12-Sep-2018 15:30:24 gcwrap/tools/ms/msmetadata.xml | 2 +- build 12-Sep-2018 15:30:24 gcwrap/tools/plotms/plotms.xml | 32 +- build 12-Sep-2018 15:30:24 gcwrap/tools/plotms/plotms_cmpt.cc | 9 +- build 12-Sep-2018 15:30:24 gcwrap/tools/synthesis/CalTables/PlotCal.cc | 85 +- build 12-Sep-2018 15:30:24 gcwrap/tools/synthesis/calibrater.xml | 7 + build 12-Sep-2018 15:30:24 gcwrap/tools/synthesis/calibrater_cmpt.cc | 7 +- build 12-Sep-2018 15:30:24 gcwrap/tools/synthesis/imager_cmpt.cc | 1 - build 12-Sep-2018 15:30:24 gcwrap/tools/synthesis/simulator_cmpt.cc | 11 +- build 12-Sep-2018 15:30:24 gcwrap/tools/synthesis/synthesisimager.xml | 72 + build 12-Sep-2018 15:30:24 gcwrap/tools/synthesis/synthesisimager_cmpt.cc | 31 + build 12-Sep-2018 15:30:24 gcwrap/tools/synthesis/synthesismaskhandler.xml | 107 + build 12-Sep-2018 15:30:24 .../tools/synthesis/synthesismaskhandler_cmpt.cc | 136 + build 12-Sep-2018 15:30:24 .../tools/synthesis/synthesismaskhandler_forward.h | 12 + build 12-Sep-2018 15:30:24 .../tools/synthesis/synthesismaskhandler_private.h | 4 + build 12-Sep-2018 15:30:24 gcwrap/tools/synthesis/synthesisnormalizer.xml | 13 + build 12-Sep-2018 15:30:24 gcwrap/tools/synthesis/synthesisnormalizer_cmpt.cc | 13 + build 12-Sep-2018 15:30:24 gcwrap/tools/utils/utils_cmpt.cc | 6 + build 12-Sep-2018 15:30:24 633 files changed, 46656 insertions(+), 25876 deletions(-) build 12-Sep-2018 15:30:24 create mode 100644 code/air_casawvr/cmdline/wvrgcalargs.hpp build 12-Sep-2018 15:30:24 create mode 100644 code/alma/ASDM/CalAntennaSolutionsRow.cc build 12-Sep-2018 15:30:24 create mode 100644 code/alma/ASDM/CalAntennaSolutionsRow.h build 12-Sep-2018 15:30:24 create mode 100644 code/alma/ASDM/CalAntennaSolutionsTable.cc build 12-Sep-2018 15:30:24 create mode 100644 code/alma/ASDM/CalAntennaSolutionsTable.h build 12-Sep-2018 15:30:24 create mode 100644 code/alma/ASDM/PulsarRow.cc build 12-Sep-2018 15:30:24 create mode 100644 code/alma/ASDM/PulsarRow.h build 12-Sep-2018 15:30:24 create mode 100644 code/alma/ASDM/PulsarTable.cc build 12-Sep-2018 15:30:24 create mode 100644 code/alma/ASDM/PulsarTable.h build 12-Sep-2018 15:30:24 create mode 100644 code/alma/Options/AlmaArg.h build 12-Sep-2018 15:30:24 create mode 100644 code/alma/apps/asdm2MS/ScansParser.cc build 12-Sep-2018 15:30:24 create mode 100644 code/alma/apps/asdm2MS/ScansParser.h build 12-Sep-2018 15:30:24 rename code/casaqt/apps/{qcasabrowser/qcasabrowser.cc => casabrowser/casabrowser.cc} (77%) build 12-Sep-2018 15:30:24 delete mode 100755 code/casaqt/apps/qcasabrowser/casabrowser build 12-Sep-2018 15:30:24 rename code/display/Display/{State.cc => DisplayState.cc} (97%) build 12-Sep-2018 15:30:24 rename code/display/Display/{State.h => DisplayState.h} (100%) build 12-Sep-2018 15:30:24 delete mode 100755 code/imageanalysis/ImageAnalysis/ComplexImageRegridder.cc build 12-Sep-2018 15:30:24 create mode 100755 code/imageanalysis/ImageAnalysis/ComplexImageRegridder.tcc build 12-Sep-2018 15:30:24 delete mode 100644 code/imageanalysis/ImageAnalysis/ImageMetaData.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/imageanalysis/ImageAnalysis/ImageMetaDataBase.cc build 12-Sep-2018 15:30:24 create mode 100644 code/imageanalysis/ImageAnalysis/ImageMetaDataBase.tcc build 12-Sep-2018 15:30:24 create mode 100644 code/imageanalysis/ImageAnalysis/ImageMetaDataConstants.cc build 12-Sep-2018 15:30:24 rename code/imageanalysis/ImageAnalysis/{ImageMetaDataRW.cc => ImageMetaDataRW.tcc} (76%) build 12-Sep-2018 15:30:24 rename code/imageanalysis/ImageAnalysis/{ImageRegridder.cc => ImageRegridder.tcc} (52%) build 12-Sep-2018 15:30:24 mode change 100755 => 100644 code/imageanalysis/ImageAnalysis/PixelValueManipulator.h build 12-Sep-2018 15:30:24 mode change 100755 => 100644 code/imageanalysis/ImageAnalysis/PixelValueManipulator.tcc build 12-Sep-2018 15:30:24 create mode 100644 code/mstransform/MSTransform/StatWtColConfig.cc build 12-Sep-2018 15:30:24 create mode 100644 code/mstransform/MSTransform/StatWtColConfig.h build 12-Sep-2018 15:30:24 create mode 100644 code/plotms/test/PlotMSCacheAveraging_GT.cc build 12-Sep-2018 15:30:24 create mode 100644 code/plotms/test/PlotMSCacheCallib_GT.cc build 12-Sep-2018 15:30:24 create mode 100644 code/plotms/test/PlotMSCacheGeom_GT.cc build 12-Sep-2018 15:30:24 create mode 100644 code/plotms/test/PlotMSCacheInvalid_GT.cc build 12-Sep-2018 15:30:24 create mode 100644 code/plotms/test/PlotMSCacheLtdVis_GT.cc build 12-Sep-2018 15:30:24 create mode 100644 code/plotms/test/PlotMSCacheMetadata_GT.cc build 12-Sep-2018 15:30:24 create mode 100644 code/plotms/test/PlotMSCacheOverlays_GT.cc build 12-Sep-2018 15:30:24 create mode 100644 code/plotms/test/PlotMSCacheSelection_GT.cc build 12-Sep-2018 15:30:24 create mode 100644 code/plotms/test/PlotMSCacheTransform_GT.cc build 12-Sep-2018 15:30:24 create mode 100644 code/plotms/test/PlotMSCacheVis_GT.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dAveraging.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dAveragingChannel.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dAveragingTime.cc build 12-Sep-2018 15:30:24 create mode 100644 code/plotms/test/dCacheData.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dDataSelection.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dExportRange.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dExportRangeInternal.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dExportRangeLeftBottom.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dExportRangeLeftTop.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dExportRangePipeline.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dExportRangeRightBottom.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dExportRangeRightTop.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dGridPlacement.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dGridPlacementMultiplePlots.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dGridPlacementMultipleRuns.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dLegend.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dMultiplePlotTypes.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dOverIterationPlot.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dOverLeftRightPlot.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dOverPlot.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dOverPlot2Files.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dSymbol.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dTimeAveragingIteration.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dTimeColorization.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dTimeColorizationAveraging.cc build 12-Sep-2018 15:30:24 delete mode 100644 code/plotms/test/dTimeIteration.cc build 12-Sep-2018 15:30:24 create mode 100644 code/stdcasa/optionparser.h build 12-Sep-2018 15:30:24 create mode 100644 code/synthesis/CalTables/CalSummary.cc build 12-Sep-2018 15:30:24 create mode 100644 code/synthesis/CalTables/CalSummary.h build 12-Sep-2018 15:30:24 create mode 100644 code/synthesis/TransformMachines2/accumulateFromGrid.inc build 12-Sep-2018 15:30:24 create mode 100644 code/synthesis/TransformMachines2/accumulateToGrid.inc build 12-Sep-2018 15:30:24 create mode 100644 gcwrap/python/scripts/imagerhelpers/fixedDict.py build 12-Sep-2018 15:30:24 create mode 100644 gcwrap/python/scripts/recipes/imager_resource_predictor.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/regressions/tests/orionmosaic.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_autoclean.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_boxit.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_clearplot.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_csvclean.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_find.py build 12-Sep-2018 15:30:24 create mode 100755 gcwrap/python/scripts/task_fringefit.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_importevla.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_mosaic.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_oldhanningsmooth.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_oldpartition.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_oldplotants.py build 12-Sep-2018 15:30:24 create mode 100644 gcwrap/python/scripts/task_oldstatwt.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_plotuv.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_plotxy.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_ssoflux.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_statwt2.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_visstat2.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_visstatold.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/task_widefield.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/tests/test_csvclean.py build 12-Sep-2018 15:30:24 create mode 100644 gcwrap/python/scripts/tests/test_ia_getslice.py build 12-Sep-2018 15:30:24 create mode 100644 gcwrap/python/scripts/tests/test_importcasa.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/tests/test_importevla.py build 12-Sep-2018 15:30:24 create mode 100644 gcwrap/python/scripts/tests/test_oldstatwt.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/tests/test_statwt2.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/python/scripts/tests/test_visstatold.py build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/autoclean.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/boxit.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/clearplot.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/csvclean.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/find.xml build 12-Sep-2018 15:30:24 create mode 100644 gcwrap/tasks/fringefit.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/importevla.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/mosaic.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/oldhanningsmooth.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/oldpartition.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/oldplotants.xml build 12-Sep-2018 15:30:24 create mode 100644 gcwrap/tasks/oldstatwt.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/plotuv.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/plotxy.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/ssoflux.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/statwt2.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/visstat2.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/visstatold.xml build 12-Sep-2018 15:30:24 delete mode 100644 gcwrap/tasks/widefield.xml build 12-Sep-2018 15:30:24 create mode 100644 gcwrap/tools/synthesis/synthesismaskhandler.xml build 12-Sep-2018 15:30:24 create mode 100644 gcwrap/tools/synthesis/synthesismaskhandler_cmpt.cc build 12-Sep-2018 15:30:24 create mode 100644 gcwrap/tools/synthesis/synthesismaskhandler_forward.h build 12-Sep-2018 15:30:24 create mode 100644 gcwrap/tools/synthesis/synthesismaskhandler_private.h build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Constructing a new tag based on 5.3.0-124-test-ARD-3-CppAWVRtesting-1 build 12-Sep-2018 15:30:24 Branch: ARD-3 build 12-Sep-2018 15:30:24 ARD- detected build 12-Sep-2018 15:30:24 Prefix: 5.3.0-124-test-ARD-3-CppAWVRtesting build 12-Sep-2018 15:30:24 5.3.0-124-test-ARD-3-CppAWVRtesting-2 build 12-Sep-2018 15:30:24 Last tag: 5.3.0-124-test-ARD-3-CppAWVRtesting-1 build 12-Sep-2018 15:30:24 Branch: ARD-3 build 12-Sep-2018 15:30:24 Comparing tag to branch with: git diff --exit-code 5.3.0-124-test-ARD-3-CppAWVRtesting-1 ARD-3 build 12-Sep-2018 15:30:24 diff --git a/.gitignore b/.gitignore build 12-Sep-2018 15:30:24 index 87f40a3..6d51250 100644 build 12-Sep-2018 15:30:24 --- a/.gitignore build 12-Sep-2018 15:30:24 +++ b/.gitignore build 12-Sep-2018 15:30:24 @@ -8,7 +8,7 @@ build 12-Sep-2018 15:30:24 code/.cproject build 12-Sep-2018 15:30:24 code/.project build 12-Sep-2018 15:30:24 code/.settings build 12-Sep-2018 15:30:24 -code/build build 12-Sep-2018 15:30:24 +code/build* build 12-Sep-2018 15:30:24 code/casadbus/plotserver/PlotServerProxy.dbusproxy.h build 12-Sep-2018 15:30:24 code/casadbus/session/DBusSession.dbusproxy.h build 12-Sep-2018 15:30:24 code/casadbus/viewer/ViewerProxy.dbusproxy.h build 12-Sep-2018 15:30:24 @@ -78,7 +78,7 @@ code/xmlcasa/build.log.0415 build 12-Sep-2018 15:30:24 gcwrap/apps/module_paramgui/Debug build 12-Sep-2018 15:30:24 gcwrap/apps/module_paramgui/build build 12-Sep-2018 15:30:24 gcwrap/apps/module_paramgui/setup.py build 12-Sep-2018 15:30:24 -gcwrap/build build 12-Sep-2018 15:30:24 +gcwrap/build* build 12-Sep-2018 15:30:24 gcwrap/python/implement/QtParamGui/*.moc.cc build 12-Sep-2018 15:30:24 gcwrap/python/implement/QtParamGui/*.qrc.cc build 12-Sep-2018 15:30:24 gcwrap/python/implement/QtParamGui/*.ui.h build 12-Sep-2018 15:30:24 diff --git a/casacore b/casacore build 12-Sep-2018 15:30:24 index d3ec348..f39fb63 160000 build 12-Sep-2018 15:30:24 --- a/casacore build 12-Sep-2018 15:30:24 +++ b/casacore build 12-Sep-2018 15:30:24 @@ -1 +1 @@ build 12-Sep-2018 15:30:24 -Subproject commit d3ec34825e7fa0c1324b642f3a6e83544f654c19 build 12-Sep-2018 15:30:24 +Subproject commit f39fb63992dbf93b27da8ee13ab50ffa5bd1fb91 build 12-Sep-2018 15:30:24 diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt build 12-Sep-2018 15:30:24 index db4cf2f..bb49d45 100644 build 12-Sep-2018 15:30:24 --- a/code/CMakeLists.txt build 12-Sep-2018 15:30:24 +++ b/code/CMakeLists.txt build 12-Sep-2018 15:30:24 @@ -34,6 +34,7 @@ if (UseCcache) build 12-Sep-2018 15:30:24 endif() build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 add_definitions ("-DUseCasacoreNamespace") build 12-Sep-2018 15:30:24 +add_definitions ("-DWITHOUT_BOOST") build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/install ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -69,7 +70,7 @@ include( target ) build 12-Sep-2018 15:30:24 include( CASA ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 set( CASA_VERSION_MAJOR 5 ) build 12-Sep-2018 15:30:24 -set( CASA_VERSION_MINOR 3 ) build 12-Sep-2018 15:30:24 +set( CASA_VERSION_MINOR 4 ) build 12-Sep-2018 15:30:24 set( CASA_VERSION_PATCH 0 ) build 12-Sep-2018 15:30:24 set( CASA_VERSION_FEATURE 0 CACHE STRING "feature version" ) build 12-Sep-2018 15:30:24 set( CASA_VERSION_DESC "" ) build 12-Sep-2018 15:30:24 @@ -867,7 +868,6 @@ casa_find( CFITSIO build 12-Sep-2018 15:30:24 INCLUDES_SUFFIXES cfitsio build 12-Sep-2018 15:30:24 LIBS cfitsio build 12-Sep-2018 15:30:24 PREFIX_HINTS ${CFITSIO_ROOT_DIR} build 12-Sep-2018 15:30:24 - DEPENDS Boost build 12-Sep-2018 15:30:24 CPP_VERSION CFITSIO_VERSION build 12-Sep-2018 15:30:24 RUN_VERSION "(ffvers(&v), v)" ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1054,7 +1054,7 @@ endif() build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 casa_find( CASACORE build 12-Sep-2018 15:30:24 VERSION 2.0.2 build 12-Sep-2018 15:30:24 - PREFIX_HINTS ${CASACORE_ROOT_DIR} ${Boost_INCLUDE_DIR} build 12-Sep-2018 15:30:24 + PREFIX_HINTS ${CASACORE_ROOT_DIR} build 12-Sep-2018 15:30:24 DEFINITIONS "-DUseCasacoreNamespace" build 12-Sep-2018 15:30:24 INCLUDES casa/aips.h build 12-Sep-2018 15:30:24 casa/version.h build 12-Sep-2018 15:30:24 @@ -1063,7 +1063,7 @@ casa_find( CASACORE build 12-Sep-2018 15:30:24 PREFIX_HINTS ${casacore_prefix} build 12-Sep-2018 15:30:24 CPP_VERSION CASACORE_VERSION build 12-Sep-2018 15:30:24 RUN_VERSION "casacore::getVersionCASA()" build 12-Sep-2018 15:30:24 - DEPENDS LAPACK CFITSIO WCSLIB FFTW3 DL Boost) build 12-Sep-2018 15:30:24 + DEPENDS LAPACK CFITSIO WCSLIB FFTW3 DL) build 12-Sep-2018 15:30:24 # Listing explicitly CASACore's dependency libraries is not necessary if the CASACore libraries build 12-Sep-2018 15:30:24 # were built with correct linking information, which they are not. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1114,7 +1114,7 @@ casa_find( GSL build 12-Sep-2018 15:30:24 # build 12-Sep-2018 15:30:24 if(CMAKE_SYSTEM_NAME STREQUAL Linux AND GSL_LIBRARIES) build 12-Sep-2018 15:30:24 if(EXISTS "/usr/lib64/atlas/libsatlas.so") build 12-Sep-2018 15:30:24 - set( Boost_LIBRARIES "${GSL_LIBRARIES};/usr/lib64/atlas/libsatlas.so" ) build 12-Sep-2018 15:30:24 + set( GSL_LIBRARIES "${GSL_LIBRARIES};/usr/lib64/atlas/libsatlas.so" ) build 12-Sep-2018 15:30:24 endif( ) build 12-Sep-2018 15:30:24 endif( ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1399,40 +1399,40 @@ casa_config_end() build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 # for linux RPM & binary distros libgraphics contains pgplot (linked in)... build 12-Sep-2018 15:30:24 if( APPLE ) build 12-Sep-2018 15:30:24 - casa_add_module( graphics CASACORE PGPLOT WCSLIB Boost) build 12-Sep-2018 15:30:24 + casa_add_module( graphics CASACORE PGPLOT WCSLIB ) build 12-Sep-2018 15:30:24 else() build 12-Sep-2018 15:30:24 if( NOT SKIP_PGPLOT ) build 12-Sep-2018 15:30:24 - casa_add_module( graphics CASACORE PGPLOT X11 WCSLIB Boost) build 12-Sep-2018 15:30:24 + casa_add_module( graphics CASACORE PGPLOT X11 WCSLIB ) build 12-Sep-2018 15:30:24 else() build 12-Sep-2018 15:30:24 - casa_add_module( graphics CASACORE X11 WCSLIB Boost) build 12-Sep-2018 15:30:24 + casa_add_module( graphics CASACORE X11 WCSLIB ) build 12-Sep-2018 15:30:24 endif() build 12-Sep-2018 15:30:24 endif() build 12-Sep-2018 15:30:24 casa_add_module( atmosphere ) build 12-Sep-2018 15:30:24 casa_add_module( casatools CASACORE ) build 12-Sep-2018 15:30:24 -casa_add_module( stdcasa CASACORE Boost ) build 12-Sep-2018 15:30:24 -casa_add_module( parallel CASACORE Boost ) build 12-Sep-2018 15:30:24 -casa_add_module( casadbus CASACORE DBUS Boost) build 12-Sep-2018 15:30:24 -casa_add_module( casaqt CASACORE QT4 QWT XERCES graphics stdcasa Boost) build 12-Sep-2018 15:30:24 +casa_add_module( stdcasa CASACORE ) build 12-Sep-2018 15:30:24 +casa_add_module( parallel CASACORE ) build 12-Sep-2018 15:30:24 +casa_add_module( casadbus CASACORE DBUS ) build 12-Sep-2018 15:30:24 +casa_add_module( casaqt CASACORE QT4 QWT XERCES graphics stdcasa ) build 12-Sep-2018 15:30:24 ###casa_add_module ( CasaDataObjects CASACORE) build 12-Sep-2018 15:30:24 -casa_add_module( components stdcasa casatools CASACORE Boost GSL) build 12-Sep-2018 15:30:24 +casa_add_module( components stdcasa casatools CASACORE GSL ) build 12-Sep-2018 15:30:24 casa_add_module( imageanalysis CASACORE components) build 12-Sep-2018 15:30:24 -casa_add_module( asdmstman CASACORE Boost ) build 12-Sep-2018 15:30:24 -casa_add_module( msvis CASACORE Boost asdmstman ) # WarningsAsErrors) build 12-Sep-2018 15:30:24 +casa_add_module( asdmstman CASACORE ) build 12-Sep-2018 15:30:24 +casa_add_module( msvis CASACORE asdmstman ) # WarningsAsErrors) build 12-Sep-2018 15:30:24 casa_add_module( mstransform CASACORE stdcasa imageanalysis msvis) build 12-Sep-2018 15:30:24 -casa_add_module( synthesis CASACORE atmosphere stdcasa casadbus asdmstman Boost SQLITE ${CASAMPI} imageanalysis msvis mstransform LIBSAKURA) build 12-Sep-2018 15:30:24 -casa_add_module( flagging CASACORE Boost stdcasa casadbus synthesis casaqt QT4 msvis mstransform) build 12-Sep-2018 15:30:24 -casa_add_module( spectrallines CASACORE imageanalysis Boost SQLITE) build 12-Sep-2018 15:30:24 +casa_add_module( synthesis CASACORE atmosphere stdcasa casadbus asdmstman SQLITE ${CASAMPI} imageanalysis msvis mstransform LIBSAKURA) build 12-Sep-2018 15:30:24 +casa_add_module( flagging CASACORE stdcasa casadbus synthesis casaqt QT4 msvis mstransform) build 12-Sep-2018 15:30:24 +casa_add_module( spectrallines CASACORE imageanalysis SQLITE) build 12-Sep-2018 15:30:24 casa_add_module( guitools CASACORE QT4 QWT synthesis) build 12-Sep-2018 15:30:24 -casa_add_module( display CASACORE WCSLIB QT4 casaqt guitools synthesis imageanalysis Boost stdcasa casadbus spectrallines components) build 12-Sep-2018 15:30:24 -casa_add_module( plotms CASACORE QT4 casaqt synthesis Boost ) build 12-Sep-2018 15:30:24 -casa_add_module( calanalysis CASACORE synthesis Boost) build 12-Sep-2018 15:30:24 -casa_add_module( alma CASACORE LIBXML2 LIBXSLT Boost synthesis msvis) build 12-Sep-2018 15:30:24 -#casa_add_module( alma_v3 CASACORE LIBXML2 LIBXSLT Boost synthesis) build 12-Sep-2018 15:30:24 -#casa_add_module( oldalma CASACORE LIBXML2 Boost ) build 12-Sep-2018 15:30:24 -casa_add_module( nrao CASACORE Boost) build 12-Sep-2018 15:30:24 -casa_add_module( atnf CASACORE Boost RPFITS) build 12-Sep-2018 15:30:24 -casa_add_module( miriad CASACORE Boost components) build 12-Sep-2018 15:30:24 -casa_add_module( casa_sakura CASACORE Boost LIBSAKURA) build 12-Sep-2018 15:30:24 +casa_add_module( display CASACORE WCSLIB QT4 casaqt guitools synthesis imageanalysis stdcasa casadbus spectrallines components) build 12-Sep-2018 15:30:24 +casa_add_module( plotms CASACORE QT4 casaqt synthesis ) build 12-Sep-2018 15:30:24 +casa_add_module( calanalysis CASACORE synthesis ) build 12-Sep-2018 15:30:24 +casa_add_module( alma CASACORE LIBXML2 LIBXSLT synthesis msvis) build 12-Sep-2018 15:30:24 +#casa_add_module( alma_v3 CASACORE LIBXML2 LIBXSLT synthesis) build 12-Sep-2018 15:30:24 +#casa_add_module( oldalma CASACORE LIBXML2 ) build 12-Sep-2018 15:30:24 +casa_add_module( nrao CASACORE ) build 12-Sep-2018 15:30:24 +casa_add_module( atnf CASACORE RPFITS) build 12-Sep-2018 15:30:24 +casa_add_module( miriad CASACORE components) build 12-Sep-2018 15:30:24 +casa_add_module( casa_sakura CASACORE LIBSAKURA) build 12-Sep-2018 15:30:24 casa_add_module( singledishfiller CASACORE ) build 12-Sep-2018 15:30:24 casa_add_module( singledish CASACORE casa_sakura singledishfiller msvis mstransform) build 12-Sep-2018 15:30:24 casa_add_module( bnmin1 Boost GSL GSLCBLAS CASACORE ) build 12-Sep-2018 15:30:24 @@ -1478,7 +1478,6 @@ file( WRITE ${CMAKE_INSTALL_PREFIX}/makedefs build 12-Sep-2018 15:30:24 CORELIB = ${_cc}\n build 12-Sep-2018 15:30:24 WCSLIBLIB = ${WCSLIB_wcs}\n build 12-Sep-2018 15:30:24 WCSLIBLIBD = .\n build 12-Sep-2018 15:30:24 - BOOSTROOT = ${BOOST_ROOT}\n build 12-Sep-2018 15:30:24 RPFITSLIBD = ${rpfitslibd}\n build 12-Sep-2018 15:30:24 CFITSIOLIBD = ${cfitsiolibd}\n build 12-Sep-2018 15:30:24 CFITSIOINCD = ${CFITSIO_INCLUDE_DIRS}\n build 12-Sep-2018 15:30:24 diff --git a/code/air_casawvr/cmdline/wvrgcalargs.hpp b/code/air_casawvr/cmdline/wvrgcalargs.hpp build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..cc7734d build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/air_casawvr/cmdline/wvrgcalargs.hpp build 12-Sep-2018 15:30:24 @@ -0,0 +1,65 @@ build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +namespace wvr { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + namespace arg { build 12-Sep-2018 15:30:24 + namespace index { build 12-Sep-2018 15:30:24 + enum optionIndex { UNKNOWN, HELP, MS, OUTPUT, TOFFSET, NSOL, SEGFIELD, build 12-Sep-2018 15:30:24 + SEGSOURCE, REVERSE, REVERSESPW, DISPERSE, CONT, WVRFLAG, build 12-Sep-2018 15:30:24 + SOURCEFLAG, STATFIELD, STATSOURCE, TIE, SMOOTH, build 12-Sep-2018 15:30:24 + SCALE, MAXDISTM, MINNUMANTS, MINGOODFRAC, USEFIELDTAB, build 12-Sep-2018 15:30:24 + SPW, WVRSPW, REFANT, OFFSETS }; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + struct check : public option::Arg { build 12-Sep-2018 15:30:24 + static void printError(const char* msg1, const option::Option& opt, const char* msg2) { build 12-Sep-2018 15:30:24 + std::cerr << msg1 << std::string(opt.name,opt.namelen) << msg2 << std::endl; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + static option::ArgStatus Unknown(const option::Option& option, bool msg) { build 12-Sep-2018 15:30:24 + if (msg) printError("Unknown option '", option, "'\n"); build 12-Sep-2018 15:30:24 + return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // an associated value is required and must be a valid floating point (double) build 12-Sep-2018 15:30:24 + static option::ArgStatus Float(const option::Option& option, bool msg) { build 12-Sep-2018 15:30:24 + char* endptr = 0; build 12-Sep-2018 15:30:24 + if (option.arg != 0 && strtod(option.arg, &endptr)){}; build 12-Sep-2018 15:30:24 + if (endptr != option.arg && *endptr == 0) build 12-Sep-2018 15:30:24 + return option::ARG_OK; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (msg) printError("Option '", option, "' requires a floating point argument\n"); build 12-Sep-2018 15:30:24 + return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // an associated value is required and must be an integer build 12-Sep-2018 15:30:24 + static option::ArgStatus Int(const option::Option& option, bool msg) { build 12-Sep-2018 15:30:24 + char* endptr = 0; build 12-Sep-2018 15:30:24 + if (option.arg != 0 && strtol(option.arg, &endptr, 10)){}; build 12-Sep-2018 15:30:24 + if (endptr != option.arg && *endptr == 0) build 12-Sep-2018 15:30:24 + return option::ARG_OK; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (msg) printError("Option '", option, "' requires an integer argument\n"); build 12-Sep-2018 15:30:24 + return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // an associated value is required opt=arg, no constraints on type build 12-Sep-2018 15:30:24 + static option::ArgStatus Required(const option::Option& option, bool msg) { build 12-Sep-2018 15:30:24 + if (option.arg != 0) build 12-Sep-2018 15:30:24 + return option::ARG_OK; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (msg) printError("Option '", option, "' requires an argument\n"); build 12-Sep-2018 15:30:24 + return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // option that is no longer supported build 12-Sep-2018 15:30:24 + static option::ArgStatus Deprecated(const option::Option& option, bool msg) { build 12-Sep-2018 15:30:24 + printError("Option '", option, "' is no longer valid, see options with --help\n"); build 12-Sep-2018 15:30:24 + return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + }; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/ASDMValuesParser.h b/code/alma/ASDM/ASDMValuesParser.h build 12-Sep-2018 15:30:24 index 144c88e..e3be60c 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/ASDMValuesParser.h build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/ASDMValuesParser.h build 12-Sep-2018 15:30:24 @@ -28,9 +28,17 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 +// regex not currently used here, in commented out code build 12-Sep-2018 15:30:24 +//#include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +//#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 /** build 12-Sep-2018 15:30:24 @@ -302,7 +310,12 @@ namespace asdm { build 12-Sep-2018 15:30:24 static std::vector parseQuoted(const std::string& s); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 private: build 12-Sep-2018 15:30:24 - static boost::regex quotedStringRegex; build 12-Sep-2018 15:30:24 + // this value is not currently used anywhere build 12-Sep-2018 15:30:24 + //#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + // static boost::regex quotedStringRegex; build 12-Sep-2018 15:30:24 + //#else build 12-Sep-2018 15:30:24 + // static std::regex quotedStringRegex; build 12-Sep-2018 15:30:24 + //#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -328,7 +341,11 @@ namespace asdm { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 string remains; getline(iss,remains); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 std::vector result = parseQuoted(boost::trim_left_copy(remains)); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::vector result = parseQuoted(asdm::ltrim_copy(remains)); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 if (nvalue > (int) result.size()) { build 12-Sep-2018 15:30:24 oss.str(""); build 12-Sep-2018 15:30:24 oss << "Error while reading the string to be parsed : '" << iss.str() << "'."; build 12-Sep-2018 15:30:24 @@ -366,7 +383,11 @@ namespace asdm { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 string remains; getline(iss,remains); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 std::vector v_s = parseQuoted(boost::trim_left_copy(remains)); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::vector v_s = parseQuoted(asdm::ltrim_copy(remains)); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 if (nvalue1 * nvalue2 > (int) v_s.size()) { build 12-Sep-2018 15:30:24 oss.str(""); build 12-Sep-2018 15:30:24 oss << "Error while reading the string to be parsed : '" << iss.str() << "'."; build 12-Sep-2018 15:30:24 @@ -419,7 +440,11 @@ namespace asdm { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 string remains; getline(iss,remains); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 std::vector v_s = parseQuoted(boost::trim_left_copy(remains)); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::vector v_s = parseQuoted(asdm::ltrim_copy(remains)); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 if (nvalue1 * nvalue2 * nvalue3 > (int) v_s.size()) { build 12-Sep-2018 15:30:24 oss.str(""); build 12-Sep-2018 15:30:24 oss << "Error while reading the string to be parsed : '" << iss.str() << "'."; build 12-Sep-2018 15:30:24 @@ -439,6 +464,7 @@ namespace asdm { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 inline std::vector ASDMValuesParser::parseQuoted(const std::string& s) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 string separator1("\\");// let quoted arguments escape themselves build 12-Sep-2018 15:30:24 string separator2(" "); // split on spaces build 12-Sep-2018 15:30:24 string separator3("\"");// let it have quoted arguments build 12-Sep-2018 15:30:24 @@ -446,6 +472,52 @@ namespace asdm { build 12-Sep-2018 15:30:24 boost::escaped_list_separator els(separator1,separator2,separator3); build 12-Sep-2018 15:30:24 boost::tokenizer > tok(s, els); build 12-Sep-2018 15:30:24 std::vector result(tok.begin(), tok.end()); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // there is no c++ equivalent to the boost tokenizer, parse the start by character build 12-Sep-2018 15:30:24 + std::vector result; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // an empty string has no tokens build 12-Sep-2018 15:30:24 + if (s.empty()) { build 12-Sep-2018 15:30:24 + return result; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + string token; build 12-Sep-2018 15:30:24 + string nullString; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + bool quoted, escaped; build 12-Sep-2018 15:30:24 + quoted = escaped = false; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + for (string::const_iterator it=s.begin(); it!=s.end(); ++it) { build 12-Sep-2018 15:30:24 + if (escaped) { build 12-Sep-2018 15:30:24 + token += *it; build 12-Sep-2018 15:30:24 + escaped = false; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + if (*it=='\\') { build 12-Sep-2018 15:30:24 + escaped = true; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + if (quoted) { build 12-Sep-2018 15:30:24 + if (*it=='\"') { build 12-Sep-2018 15:30:24 + quoted = false; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + token += *it; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + if (*it == ' ') { build 12-Sep-2018 15:30:24 + result.push_back(token); build 12-Sep-2018 15:30:24 + token = nullString; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + if (*it=='\"') { build 12-Sep-2018 15:30:24 + quoted = true; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + token += *it; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + result.push_back(token); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 return result; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } // End namespace asdm. build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/AlmaRadiometerTable.cc b/code/alma/ASDM/AlmaRadiometerTable.cc build 12-Sep-2018 15:30:24 index 5126cdd..eb4c5a8 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/AlmaRadiometerTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/AlmaRadiometerTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -830,11 +833,19 @@ AlmaRadiometerRow* AlmaRadiometerTable::newRow(AlmaRadiometerRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void AlmaRadiometerTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void AlmaRadiometerTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/AlmaRadiometer.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/AlmaRadiometer.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/AlmaRadiometer.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/AlmaRadiometer.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the AlmaRadiometer table", "AlmaRadiometer"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/AnnotationTable.cc b/code/alma/ASDM/AnnotationTable.cc build 12-Sep-2018 15:30:24 index 4ff0ff6..4d0b42e 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/AnnotationTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/AnnotationTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -957,11 +960,19 @@ AnnotationRow* AnnotationTable::lookup(ArrayTime time, string issue, string deta build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void AnnotationTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void AnnotationTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Annotation.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Annotation.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Annotation.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Annotation.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Annotation table", "Annotation"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/AntennaTable.cc b/code/alma/ASDM/AntennaTable.cc build 12-Sep-2018 15:30:24 index 9609336..5f61777 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/AntennaTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/AntennaTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -982,11 +985,19 @@ AntennaRow* AntennaTable::lookup(string name, AntennaMakeMod::AntennaMake antenn build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void AntennaTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void AntennaTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Antenna.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Antenna.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Antenna.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Antenna.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Antenna table", "Antenna"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalAmpliTable.cc b/code/alma/ASDM/CalAmpliTable.cc build 12-Sep-2018 15:30:24 index 2379bee..5ad4eff 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalAmpliTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalAmpliTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1043,11 +1046,19 @@ CalAmpliRow* CalAmpliTable::lookup(string antennaName, AtmPhaseCorrectionMod::At build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalAmpliTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalAmpliTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalAmpli.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalAmpli.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalAmpli.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalAmpli.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalAmpli table", "CalAmpli"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalAntennaSolutionsTable.cc b/code/alma/ASDM/CalAntennaSolutionsTable.cc build 12-Sep-2018 15:30:24 index f48d55e..aec35f0 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalAntennaSolutionsTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalAntennaSolutionsTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1104,11 +1107,19 @@ CalAntennaSolutionsRow* CalAntennaSolutionsTable::lookup(string antennaName, Atm build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalAntennaSolutionsTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalAntennaSolutionsTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalAntennaSolutions.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalAntennaSolutions.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalAntennaSolutions.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalAntennaSolutions.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalAntennaSolutions table", "CalAntennaSolutions"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalAppPhaseTable.cc b/code/alma/ASDM/CalAppPhaseTable.cc build 12-Sep-2018 15:30:24 index bbb58e2..2540b06 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalAppPhaseTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalAppPhaseTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1161,11 +1164,19 @@ CalAppPhaseRow* CalAppPhaseTable::lookup(BasebandNameMod::BasebandName basebandN build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalAppPhaseTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalAppPhaseTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalAppPhase.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalAppPhase.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalAppPhase.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalAppPhase.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalAppPhase table", "CalAppPhase"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalAtmosphereTable.cc b/code/alma/ASDM/CalAtmosphereTable.cc build 12-Sep-2018 15:30:24 index 6ac440c..7096794 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalAtmosphereTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalAtmosphereTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1243,11 +1246,19 @@ CalAtmosphereRow* CalAtmosphereTable::lookup(string antennaName, ReceiverBandMod build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalAtmosphereTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalAtmosphereTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalAtmosphere.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalAtmosphere.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalAtmosphere.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalAtmosphere.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalAtmosphere table", "CalAtmosphere"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalBandpassTable.cc b/code/alma/ASDM/CalBandpassTable.cc build 12-Sep-2018 15:30:24 index 20d3753..9a7f427 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalBandpassTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalBandpassTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1150,11 +1153,19 @@ CalBandpassRow* CalBandpassTable::lookup(BasebandNameMod::BasebandName basebandN build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalBandpassTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalBandpassTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalBandpass.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalBandpass.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalBandpass.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalBandpass.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalBandpass table", "CalBandpass"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalCurveTable.cc b/code/alma/ASDM/CalCurveTable.cc build 12-Sep-2018 15:30:24 index 28ad119..8bee118 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalCurveTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalCurveTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1069,11 +1072,19 @@ CalCurveRow* CalCurveTable::lookup(AtmPhaseCorrectionMod::AtmPhaseCorrection atm build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalCurveTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalCurveTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalCurve.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalCurve.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalCurve.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalCurve.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalCurve table", "CalCurve"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalDataTable.cc b/code/alma/ASDM/CalDataTable.cc build 12-Sep-2018 15:30:24 index 8b9f0db..33b4c3b 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalDataTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalDataTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -992,11 +995,19 @@ CalDataRow* CalDataTable::lookup(ArrayTime startTimeObserved, ArrayTime endTimeO build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalDataTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalDataTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalData.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalData.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalData.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalData.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalData table", "CalData"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalDelayTable.cc b/code/alma/ASDM/CalDelayTable.cc build 12-Sep-2018 15:30:24 index 2d0d3eb..4a58cf0 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalDelayTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalDelayTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1090,11 +1093,19 @@ CalDelayRow* CalDelayTable::lookup(string antennaName, AtmPhaseCorrectionMod::At build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalDelayTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalDelayTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalDelay.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalDelay.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalDelay.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalDelay.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalDelay table", "CalDelay"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalDeviceTable.cc b/code/alma/ASDM/CalDeviceTable.cc build 12-Sep-2018 15:30:24 index f815f50..29800a5 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalDeviceTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalDeviceTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -998,11 +1001,19 @@ CalDeviceRow* CalDeviceTable::newRow(CalDeviceRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalDeviceTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalDeviceTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalDevice.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalDevice.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalDevice.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalDevice.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalDevice table", "CalDevice"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalFluxTable.cc b/code/alma/ASDM/CalFluxTable.cc build 12-Sep-2018 15:30:24 index 794034e..d144ceb 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalFluxTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalFluxTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1031,11 +1034,19 @@ CalFluxRow* CalFluxTable::lookup(string sourceName, Tag calDataId, Tag calReduct build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalFluxTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalFluxTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalFlux.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalFlux.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalFlux.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalFlux.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalFlux table", "CalFlux"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalFocusModelTable.cc b/code/alma/ASDM/CalFocusModelTable.cc build 12-Sep-2018 15:30:24 index 5ca9da4..96bb9e9 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalFocusModelTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalFocusModelTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1081,11 +1084,19 @@ CalFocusModelRow* CalFocusModelTable::lookup(string antennaName, ReceiverBandMod build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalFocusModelTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalFocusModelTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalFocusModel.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalFocusModel.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalFocusModel.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalFocusModel.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalFocusModel table", "CalFocusModel"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalFocusTable.cc b/code/alma/ASDM/CalFocusTable.cc build 12-Sep-2018 15:30:24 index 69edf84..cdaaf38 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalFocusTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalFocusTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1165,11 +1168,19 @@ CalFocusRow* CalFocusTable::lookup(string antennaName, ReceiverBandMod::Receiver build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalFocusTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalFocusTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalFocus.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalFocus.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalFocus.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalFocus.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalFocus table", "CalFocus"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalGainTable.cc b/code/alma/ASDM/CalGainTable.cc build 12-Sep-2018 15:30:24 index f837c88..ffbf29b 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalGainTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalGainTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -968,11 +971,19 @@ CalGainRow* CalGainTable::lookup(Tag calDataId, Tag calReductionId, ArrayTime st build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalGainTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalGainTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalGain.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalGain.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalGain.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalGain.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalGain table", "CalGain"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalHolographyTable.cc b/code/alma/ASDM/CalHolographyTable.cc build 12-Sep-2018 15:30:24 index 905bc9d..7a44304 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalHolographyTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalHolographyTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1108,11 +1111,19 @@ CalHolographyRow* CalHolographyTable::lookup(string antennaName, Tag calDataId, build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalHolographyTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalHolographyTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalHolography.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalHolography.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalHolography.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalHolography.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalHolography table", "CalHolography"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalPhaseTable.cc b/code/alma/ASDM/CalPhaseTable.cc build 12-Sep-2018 15:30:24 index bbf38c1..4edf75f 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalPhaseTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalPhaseTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1133,11 +1136,19 @@ CalPhaseRow* CalPhaseTable::lookup(BasebandNameMod::BasebandName basebandName, R build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalPhaseTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalPhaseTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalPhase.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalPhase.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalPhase.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalPhase.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalPhase table", "CalPhase"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalPointingModelTable.cc b/code/alma/ASDM/CalPointingModelTable.cc build 12-Sep-2018 15:30:24 index a33ff72..12cfc04 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalPointingModelTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalPointingModelTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1079,11 +1082,19 @@ CalPointingModelRow* CalPointingModelTable::lookup(string antennaName, ReceiverB build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalPointingModelTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalPointingModelTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalPointingModel.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalPointingModel.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalPointingModel.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalPointingModel.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalPointingModel table", "CalPointingModel"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalPointingTable.cc b/code/alma/ASDM/CalPointingTable.cc build 12-Sep-2018 15:30:24 index 91dbf94..cb80a17 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalPointingTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalPointingTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1156,11 +1159,19 @@ CalPointingRow* CalPointingTable::lookup(string antennaName, ReceiverBandMod::Re build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalPointingTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalPointingTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalPointing.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalPointing.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalPointing.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalPointing.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalPointing table", "CalPointing"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalPositionTable.cc b/code/alma/ASDM/CalPositionTable.cc build 12-Sep-2018 15:30:24 index de9e984..6444c82 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalPositionTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalPositionTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1090,11 +1093,19 @@ CalPositionRow* CalPositionTable::lookup(string antennaName, AtmPhaseCorrectionM build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalPositionTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalPositionTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalPosition.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalPosition.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalPosition.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalPosition.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalPosition table", "CalPosition"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalPrimaryBeamTable.cc b/code/alma/ASDM/CalPrimaryBeamTable.cc build 12-Sep-2018 15:30:24 index 9c1cbd7..f15c3d4 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalPrimaryBeamTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalPrimaryBeamTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1091,11 +1094,19 @@ CalPrimaryBeamRow* CalPrimaryBeamTable::lookup(string antennaName, ReceiverBandM build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalPrimaryBeamTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalPrimaryBeamTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalPrimaryBeam.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalPrimaryBeam.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalPrimaryBeam.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalPrimaryBeam.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalPrimaryBeam table", "CalPrimaryBeam"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalReductionTable.cc b/code/alma/ASDM/CalReductionTable.cc build 12-Sep-2018 15:30:24 index 0e8958c..1f110e3 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalReductionTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalReductionTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1007,11 +1010,19 @@ CalReductionRow* CalReductionTable::lookup(int numApplied, vector appli build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalReductionTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalReductionTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalReduction.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalReduction.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalReduction.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalReduction.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalReduction table", "CalReduction"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalSeeingTable.cc b/code/alma/ASDM/CalSeeingTable.cc build 12-Sep-2018 15:30:24 index 8ef7c36..143da15 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalSeeingTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalSeeingTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1006,11 +1009,19 @@ CalSeeingRow* CalSeeingTable::lookup(AtmPhaseCorrectionMod::AtmPhaseCorrection a build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalSeeingTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalSeeingTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalSeeing.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalSeeing.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalSeeing.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalSeeing.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalSeeing table", "CalSeeing"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CalWVRTable.cc b/code/alma/ASDM/CalWVRTable.cc build 12-Sep-2018 15:30:24 index 3b32585..7562ac3 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CalWVRTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CalWVRTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1057,11 +1060,19 @@ CalWVRRow* CalWVRTable::lookup(string antennaName, Tag calDataId, Tag calReducti build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void CalWVRTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void CalWVRTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalWVR.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/CalWVR.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/CalWVR.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/CalWVR.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the CalWVR table", "CalWVR"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/ConfigDescriptionTable.cc b/code/alma/ASDM/ConfigDescriptionTable.cc build 12-Sep-2018 15:30:24 index b3f55ba..3669589 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/ConfigDescriptionTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/ConfigDescriptionTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1072,11 +1075,19 @@ ConfigDescriptionRow* ConfigDescriptionTable::lookup(int numAntenna, int numData build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void ConfigDescriptionTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void ConfigDescriptionTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/ConfigDescription.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/ConfigDescription.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/ConfigDescription.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/ConfigDescription.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the ConfigDescription table", "ConfigDescription"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/CorrelatorModeTable.cc b/code/alma/ASDM/CorrelatorModeTable.cc build 12-Sep-2018 15:30:24 index c5710be..d742766 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/CorrelatorModeTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/CorrelatorModeTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -992,11 +995,19 @@ CorrelatorModeRow* CorrelatorModeTable::lookup(int numBaseband, vector build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -892,11 +895,19 @@ DataDescriptionRow* DataDescriptionTable::lookup(Tag polOrHoloId, Tag spectralWi build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void DataDescriptionTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void DataDescriptionTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/DataDescription.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/DataDescription.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/DataDescription.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/DataDescription.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the DataDescription table", "DataDescription"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/DelayModelFixedParametersTable.cc b/code/alma/ASDM/DelayModelFixedParametersTable.cc build 12-Sep-2018 15:30:24 index 5b8ab7e..bbd5b41 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/DelayModelFixedParametersTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/DelayModelFixedParametersTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -972,11 +975,19 @@ DelayModelFixedParametersRow* DelayModelFixedParametersTable::lookup(string dela build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void DelayModelFixedParametersTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void DelayModelFixedParametersTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/DelayModelFixedParameters.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/DelayModelFixedParameters.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/DelayModelFixedParameters.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/DelayModelFixedParameters.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the DelayModelFixedParameters table", "DelayModelFixedParameters"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/DelayModelTable.cc b/code/alma/ASDM/DelayModelTable.cc build 12-Sep-2018 15:30:24 index b644f2e..f41af07 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/DelayModelTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/DelayModelTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1102,11 +1105,19 @@ DelayModelRow* DelayModelTable::newRow(DelayModelRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void DelayModelTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void DelayModelTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/DelayModel.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/DelayModel.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/DelayModel.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/DelayModel.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the DelayModel table", "DelayModel"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/DelayModelVariableParametersTable.cc b/code/alma/ASDM/DelayModelVariableParametersTable.cc build 12-Sep-2018 15:30:24 index 13ff017..dad5094 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/DelayModelVariableParametersTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/DelayModelVariableParametersTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1012,11 +1015,19 @@ DelayModelVariableParametersRow* DelayModelVariableParametersTable::lookup(Array build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void DelayModelVariableParametersTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void DelayModelVariableParametersTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/DelayModelVariableParameters.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/DelayModelVariableParameters.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/DelayModelVariableParameters.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/DelayModelVariableParameters.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the DelayModelVariableParameters table", "DelayModelVariableParameters"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/DopplerTable.cc b/code/alma/ASDM/DopplerTable.cc build 12-Sep-2018 15:30:24 index a944ad2..d3148f8 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/DopplerTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/DopplerTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -963,11 +966,19 @@ DopplerRow* DopplerTable::lookup(int sourceId, int transitionIndex, DopplerRefer build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void DopplerTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void DopplerTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Doppler.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Doppler.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Doppler.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Doppler.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Doppler table", "Doppler"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/EntityId.cc b/code/alma/ASDM/EntityId.cc build 12-Sep-2018 15:30:24 index 9839290..f1468b3 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/EntityId.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/EntityId.cc build 12-Sep-2018 15:30:24 @@ -25,9 +25,11 @@ build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 //#define _POSIX_C_SOURCE build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -//#include build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -59,10 +61,12 @@ namespace asdm { build 12-Sep-2018 15:30:24 cout << "EntityId::validate. Validating '" << x << "'." << endl; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Here we use the boost machinery for the regular expressions, assuming its thread safety. build 12-Sep-2018 15:30:24 + // std::regex (optionally used here) is as thread-safe in this context build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // We will test two possible syntaxes for the EntityId, since EVLA did not want to follow build 12-Sep-2018 15:30:24 // the rules established by ALMA. build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 boost::regex ALMAbasicUIDRegex("^[uU][iI][dD]://[0-9a-zA-Z]+(/[xX][0-9a-fA-F]+){2}(#\\w{1,}){0,}$"); build 12-Sep-2018 15:30:24 boost::regex EVLAbasicUIDRegex("^[uU][iI][dD]:///?evla/[0-9a-zA-Z]+/.+$"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -74,7 +78,20 @@ namespace asdm { build 12-Sep-2018 15:30:24 boost::regex_match(theUID_p, whatEVLA, EVLAbasicUIDRegex)) build 12-Sep-2018 15:30:24 ) build 12-Sep-2018 15:30:24 result = "Invalid format for EntityId: " + x; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::regex ALMAbasicUIDRegex("^[uU][iI][dD]://[0-9a-zA-Z]+(/[xX][0-9a-fA-F]+){2}(#\\w{1,}){0,}$"); build 12-Sep-2018 15:30:24 + std::regex EVLAbasicUIDRegex("^[uU][iI][dD]:///?evla/[0-9a-zA-Z]+/.+$"); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + const char * theUID_p = x.c_str(); build 12-Sep-2018 15:30:24 + std::cmatch whatALMA, whatEVLA; build 12-Sep-2018 15:30:24 + string result = ""; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (!(std::regex_match(theUID_p, whatALMA, ALMAbasicUIDRegex) || build 12-Sep-2018 15:30:24 + std::regex_match(theUID_p, whatEVLA, EVLAbasicUIDRegex)) build 12-Sep-2018 15:30:24 + ) build 12-Sep-2018 15:30:24 + result = "Invalid format for EntityId: " + x; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 if (EntityIdVerbose) build 12-Sep-2018 15:30:24 cout << "EntityId::validate. Validation message is '" << result << "'. (An empty message is a good sign.)" << endl; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/EphemerisTable.cc b/code/alma/ASDM/EphemerisTable.cc build 12-Sep-2018 15:30:24 index a9ce685..6b37627 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/EphemerisTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/EphemerisTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1003,11 +1006,19 @@ EphemerisRow* EphemerisTable::newRow(EphemerisRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void EphemerisTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void EphemerisTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Ephemeris.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Ephemeris.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Ephemeris.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Ephemeris.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Ephemeris table", "Ephemeris"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/ExecBlockTable.cc b/code/alma/ASDM/ExecBlockTable.cc build 12-Sep-2018 15:30:24 index 173d394..1147388 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/ExecBlockTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/ExecBlockTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1197,11 +1200,19 @@ ExecBlockRow* ExecBlockTable::lookup(ArrayTime startTime, ArrayTime endTime, int build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void ExecBlockTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void ExecBlockTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/ExecBlock.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/ExecBlock.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/ExecBlock.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/ExecBlock.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the ExecBlock table", "ExecBlock"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/FeedTable.cc b/code/alma/ASDM/FeedTable.cc build 12-Sep-2018 15:30:24 index ddda6bf..1566bba 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/FeedTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/FeedTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1177,11 +1180,19 @@ FeedRow* FeedTable::lookup(Tag antennaId, Tag spectralWindowId, ArrayTimeInterva build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void FeedTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void FeedTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Feed.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Feed.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Feed.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Feed.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Feed table", "Feed"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/FieldTable.cc b/code/alma/ASDM/FieldTable.cc build 12-Sep-2018 15:30:24 index 0569c77..14d6656 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/FieldTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/FieldTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -972,11 +975,19 @@ FieldRow* FieldTable::lookup(string fieldName, int numPoly, vector build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -870,11 +873,19 @@ FlagCmdRow* FlagCmdTable::newRow(FlagCmdRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void FlagCmdTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void FlagCmdTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/FlagCmd.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/FlagCmd.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/FlagCmd.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/FlagCmd.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the FlagCmd table", "FlagCmd"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/FlagTable.cc b/code/alma/ASDM/FlagTable.cc build 12-Sep-2018 15:30:24 index 2005cea..8e70718 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/FlagTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/FlagTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -972,11 +975,19 @@ FlagRow* FlagTable::lookup(ArrayTime startTime, ArrayTime endTime, string reason build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void FlagTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void FlagTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Flag.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Flag.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Flag.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Flag.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Flag table", "Flag"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/FocusModelTable.cc b/code/alma/ASDM/FocusModelTable.cc build 12-Sep-2018 15:30:24 index 7d61b76..39215d9 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/FocusModelTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/FocusModelTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1053,11 +1056,19 @@ FocusModelRow* FocusModelTable::lookup(Tag antennaId, PolarizationTypeMod::Polar build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void FocusModelTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void FocusModelTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/FocusModel.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/FocusModel.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/FocusModel.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/FocusModel.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the FocusModel table", "FocusModel"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/FocusTable.cc b/code/alma/ASDM/FocusTable.cc build 12-Sep-2018 15:30:24 index 461f944..db78f81 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/FocusTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/FocusTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -967,11 +970,19 @@ FocusRow* FocusTable::newRow(FocusRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void FocusTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void FocusTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Focus.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Focus.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Focus.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Focus.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Focus table", "Focus"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/FreqOffsetTable.cc b/code/alma/ASDM/FreqOffsetTable.cc build 12-Sep-2018 15:30:24 index e9ca0a1..394e46b 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/FreqOffsetTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/FreqOffsetTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -964,11 +967,19 @@ FreqOffsetRow* FreqOffsetTable::newRow(FreqOffsetRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void FreqOffsetTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void FreqOffsetTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/FreqOffset.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/FreqOffset.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/FreqOffset.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/FreqOffset.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the FreqOffset table", "FreqOffset"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/GainTrackingTable.cc b/code/alma/ASDM/GainTrackingTable.cc build 12-Sep-2018 15:30:24 index 1a6a745..21f6aed 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/GainTrackingTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/GainTrackingTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1002,11 +1005,19 @@ GainTrackingRow* GainTrackingTable::newRow(GainTrackingRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void GainTrackingTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void GainTrackingTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/GainTracking.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/GainTracking.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/GainTracking.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/GainTracking.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the GainTracking table", "GainTracking"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/HistoryTable.cc b/code/alma/ASDM/HistoryTable.cc build 12-Sep-2018 15:30:24 index 8394cbd..8d8fed1 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/HistoryTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/HistoryTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -962,11 +965,19 @@ HistoryRow* HistoryTable::newRow(HistoryRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void HistoryTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void HistoryTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/History.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/History.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/History.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/History.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the History table", "History"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/HolographyTable.cc b/code/alma/ASDM/HolographyTable.cc build 12-Sep-2018 15:30:24 index df64eba..23e0318 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/HolographyTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/HolographyTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -917,11 +920,19 @@ HolographyRow* HolographyTable::lookup(Length distance, Length focus, int numCor build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void HolographyTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void HolographyTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Holography.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Holography.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Holography.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Holography.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Holography table", "Holography"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/MainTable.cc b/code/alma/ASDM/MainTable.cc build 12-Sep-2018 15:30:24 index 599b67c..0d32776 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/MainTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/MainTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1006,11 +1009,19 @@ MainRow* MainTable::newRow(MainRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void MainTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void MainTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Main.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Main.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Main.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Main.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Main table", "Main"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/Misc.cc b/code/alma/ASDM/Misc.cc build 12-Sep-2018 15:30:24 index 03c5105..63e5f6b 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/Misc.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/Misc.cc build 12-Sep-2018 15:30:24 @@ -35,6 +35,9 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +// string.h provides strcpy, strtok and strcat build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -50,9 +53,6 @@ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using namespace std; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -using namespace boost::filesystem; build 12-Sep-2018 15:30:24 -using namespace boost::algorithm; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 extern int xmlLoadExtDtdDefaultValue; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "ASDMValuesParser.h" build 12-Sep-2018 15:30:24 @@ -169,13 +169,15 @@ namespace asdm { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 const string& ASDMUtilsException::getMessage() { return message; } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 ASDMUtils::DotXMLFilter::DotXMLFilter(vector& filenames) {this->filenames = &filenames;} build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void ASDMUtils::DotXMLFilter::operator()(directory_entry& p) { build 12-Sep-2018 15:30:24 + void ASDMUtils::DotXMLFilter::operator()(boost::filesystem::directory_entry& p) { build 12-Sep-2018 15:30:24 if (!extension(p).compare(".xml")) { build 12-Sep-2018 15:30:24 filenames->push_back(p.path().string()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 set ASDMUtils::evlaValidNames; build 12-Sep-2018 15:30:24 set ASDMUtils::almaValidNames; build 12-Sep-2018 15:30:24 @@ -205,12 +207,21 @@ namespace asdm { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 string result; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + string ASDMPath = boost::algorithm::trim_copy(asdmPath); build 12-Sep-2018 15:30:24 + if (!boost::algorithm::ends_with(ASDMPath, "/")) ASDMPath+="/"; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 string ASDMPath = trim_copy(asdmPath); build 12-Sep-2018 15:30:24 - if (!ends_with(ASDMPath, "/")) ASDMPath+="/"; build 12-Sep-2018 15:30:24 + if (ASDMPath.back()!='/') ASDMPath+="/"; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 ASDMPath += "ASDM.xml"; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Does ASDMPath exist ? build 12-Sep-2018 15:30:24 - if (!exists(path(ASDMPath))) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + if (!boost::filesystem::exists(boost::filesystem::path(ASDMPath))) { build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + if (!file_exists(ASDMPath)) { build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 throw ASDMUtilsException("File not found '"+ASDMPath+"'."); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -240,13 +251,22 @@ namespace asdm { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // No ? then try another approach ... Can we find a dataUID element in the row elements of the Main table and in such a case build 12-Sep-2018 15:30:24 // make the assumption that it's a v3 ASDM. build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + string MainPath = boost::algorithm::trim_copy(asdmPath); build 12-Sep-2018 15:30:24 + if (!boost::algorithm::ends_with(MainPath, "/")) MainPath+="/"; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 string MainPath = trim_copy(asdmPath); build 12-Sep-2018 15:30:24 - if (!ends_with(MainPath, "/")) MainPath+="/"; build 12-Sep-2018 15:30:24 + if (MainPath.back()!='/') MainPath+="/"; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 MainPath += "Main.xml"; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 result = "UNKNOWN"; build 12-Sep-2018 15:30:24 // Does MainPath exist ? build 12-Sep-2018 15:30:24 - if (exists(path(MainPath))) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + if (boost::filesystem::exists(boost::filesystem::path(MainPath))) { build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + if (file_exists(MainPath)) { build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 xmlDocPtr MainDoc = xmlParseFile(MainPath.c_str()); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (MainDoc == NULL ) { build 12-Sep-2018 15:30:24 @@ -319,12 +339,21 @@ namespace asdm { build 12-Sep-2018 15:30:24 vector ASDMUtils::telescopeNames(const string& asdmPath) { build 12-Sep-2018 15:30:24 vector result; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + string execBlockPath = boost::algorithm::trim_copy(asdmPath); build 12-Sep-2018 15:30:24 + if (!boost::algorithm::ends_with(execBlockPath, "/")) execBlockPath+="/"; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 string execBlockPath = trim_copy(asdmPath); build 12-Sep-2018 15:30:24 - if (!ends_with(execBlockPath, "/")) execBlockPath+="/"; build 12-Sep-2018 15:30:24 + if (execBlockPath.back()!='/') execBlockPath+="/"; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 execBlockPath += "ExecBlock.xml"; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Does execBlockPath exist ? build 12-Sep-2018 15:30:24 - if (!exists(path(execBlockPath))) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + if (!boost::filesystem::exists(boost::filesystem::path(execBlockPath))) { build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + if (!file_exists(execBlockPath)) { build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 throw ASDMUtilsException("File not found '"+execBlockPath+"'."); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -340,7 +369,11 @@ namespace asdm { build 12-Sep-2018 15:30:24 cur = xmlDocGetRootElement(execBlockDoc)->xmlChildrenNode; build 12-Sep-2018 15:30:24 while (cur != NULL) { build 12-Sep-2018 15:30:24 if (!xmlStrcmp(cur->name, (const xmlChar*) "row")) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + result.push_back(boost::algorithm::trim_copy(parseRow(execBlockDoc, cur, (const xmlChar *) "telescopeName"))); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 result.push_back(trim_copy(parseRow(execBlockDoc, cur, (const xmlChar *) "telescopeName"))); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 cur = cur -> next; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -370,9 +403,30 @@ namespace asdm { build 12-Sep-2018 15:30:24 vector ASDMUtils::xmlFilenames ( const string & asdmPath ) { build 12-Sep-2018 15:30:24 vector result; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - path p(asdmPath); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::filesystem::path p(asdmPath); build 12-Sep-2018 15:30:24 DotXMLFilter dotXMLFilter(result); build 12-Sep-2018 15:30:24 - std::for_each(directory_iterator(p), directory_iterator(), dotXMLFilter); build 12-Sep-2018 15:30:24 + std::for_each(boost::filesystem::directory_iterator(p), boost::filesystem::directory_iterator(), dotXMLFilter); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + DIR *dir; build 12-Sep-2018 15:30:24 + if ((dir = opendir(asdmPath.c_str())) != NULL) { build 12-Sep-2018 15:30:24 + struct dirent *ent; build 12-Sep-2018 15:30:24 + string dirSep="/"; build 12-Sep-2018 15:30:24 + if (asdmPath.back()=='/') dirSep=""; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + while ((ent = readdir(dir)) != NULL) { build 12-Sep-2018 15:30:24 + string thisFile = ent->d_name; build 12-Sep-2018 15:30:24 + if (thisFile.size() > 4) { build 12-Sep-2018 15:30:24 + if (thisFile.compare((thisFile.size()-4),4,".xml")==0) { build 12-Sep-2018 15:30:24 + result.push_back(asdmPath+dirSep+thisFile); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + closedir(dir); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + throw ASDMUtilsException("Could not open ASDM directory to retrieve xml files: "+asdmPath); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 return result; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -383,32 +437,58 @@ namespace asdm { build 12-Sep-2018 15:30:24 if ((rootDir_p = getenv(envVars[i])) != 0) { build 12-Sep-2018 15:30:24 string rootPath(rootDir_p); build 12-Sep-2018 15:30:24 vector rootPathElements; build 12-Sep-2018 15:30:24 - split(rootPathElements, rootPath, is_any_of(" ")); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::algorithm::split(rootPathElements, rootPath, boost::algorithm::is_any_of(" ")); build 12-Sep-2018 15:30:24 for ( vector::iterator iter = rootPathElements.begin(); iter != rootPathElements.end(); iter++) { build 12-Sep-2018 15:30:24 string xsltPath = *iter; build 12-Sep-2018 15:30:24 - if (!ends_with(xsltPath, "/")) xsltPath+="/"; build 12-Sep-2018 15:30:24 + if (!boost::algorithm::ends_with(xsltPath, "/")) xsltPath+="/"; build 12-Sep-2018 15:30:24 xsltPath+=rootSubdir[string(envVars[i])]+ xsltFilename; build 12-Sep-2018 15:30:24 if (getenv("ASDM_DEBUG")) build 12-Sep-2018 15:30:24 cout << "pathToxslTransform tries to locate '" << xsltPath << "'." << endl; build 12-Sep-2018 15:30:24 - if (exists(path(xsltPath))) build 12-Sep-2018 15:30:24 + if (boost::filesystem::exists(boost::filesystem::path(xsltPath))) build 12-Sep-2018 15:30:24 return xsltPath; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + strsplit(rootPath,' ',rootPathElements); build 12-Sep-2018 15:30:24 + for ( vector::iterator iter = rootPathElements.begin(); iter != rootPathElements.end(); iter++) { build 12-Sep-2018 15:30:24 + string xsltPath = *iter; build 12-Sep-2018 15:30:24 + if (xsltPath.back()!='/') xsltPath+="/"; build 12-Sep-2018 15:30:24 + xsltPath+=rootSubdir[string(envVars[i])]+ xsltFilename; build 12-Sep-2018 15:30:24 + if (getenv("ASDM_DEBUG")) build 12-Sep-2018 15:30:24 + cout << "pathToxslTransform tries to locate '" << xsltPath << "'." << endl; build 12-Sep-2018 15:30:24 + if (file_exists(xsltPath)) build 12-Sep-2018 15:30:24 + return xsltPath; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Ok it seems that we are not in an ALMA/ACS environment, then look for $CASAPATH/data. build 12-Sep-2018 15:30:24 if ((rootDir_p = getenv("CASAPATH")) != 0) { build 12-Sep-2018 15:30:24 string rootPath(rootDir_p); build 12-Sep-2018 15:30:24 vector rootPathElements; build 12-Sep-2018 15:30:24 - split(rootPathElements, rootPath, is_any_of(" ")); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::algorithm::split(rootPathElements, rootPath, boost::algorithm::is_any_of(" ")); build 12-Sep-2018 15:30:24 string xsltPath = rootPathElements[0]; build 12-Sep-2018 15:30:24 - if (!ends_with(xsltPath, "/")) xsltPath+="/"; build 12-Sep-2018 15:30:24 + if (!boost::algorithm::ends_with(xsltPath, "/")) xsltPath+="/"; build 12-Sep-2018 15:30:24 xsltPath+="data/alma/asdm/"; build 12-Sep-2018 15:30:24 xsltPath+=xsltFilename; build 12-Sep-2018 15:30:24 if (getenv("ASDM_DEBUG")) build 12-Sep-2018 15:30:24 cout << "pathToxslTransform tries to locate '" << xsltPath << "'." << endl; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (exists(path(xsltPath))) build 12-Sep-2018 15:30:24 + if (boost::filesystem::exists(boost::filesystem::path(xsltPath))) build 12-Sep-2018 15:30:24 return xsltPath; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + strsplit(rootPath, ' ', rootPathElements); build 12-Sep-2018 15:30:24 + string xsltPath = rootPathElements[0]; build 12-Sep-2018 15:30:24 + if (xsltPath.back()!='/') xsltPath+="/"; build 12-Sep-2018 15:30:24 + xsltPath+="data/alma/asdm/"; build 12-Sep-2018 15:30:24 + xsltPath+=xsltFilename; build 12-Sep-2018 15:30:24 + if (getenv("ASDM_DEBUG")) build 12-Sep-2018 15:30:24 + cout << "pathToxslTransform tries to locate '" << xsltPath << "'." << endl; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (file_exists(xsltPath)) build 12-Sep-2018 15:30:24 + return xsltPath; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (getenv("ASDM_DEBUG")) build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/Misc.h b/code/alma/ASDM/Misc.h build 12-Sep-2018 15:30:24 index 8ae73dc..eb380cf 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/Misc.h build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/Misc.h build 12-Sep-2018 15:30:24 @@ -34,11 +34,20 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 typedef unsigned char xmlChar; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -146,6 +155,79 @@ namespace asdm { build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 std::string uniqSlashes(const std::string& s); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#ifdef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + // string trimming functions to be used in place of boost functions build 12-Sep-2018 15:30:24 + // uses lambdas (c++11) build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // trim from start (in place) build 12-Sep-2018 15:30:24 + inline void ltrim(std::string &s) { build 12-Sep-2018 15:30:24 + s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int ch) { build 12-Sep-2018 15:30:24 + return !std::isspace(ch); build 12-Sep-2018 15:30:24 + })); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // trim from end (in place) build 12-Sep-2018 15:30:24 + inline void rtrim(std::string &s) { build 12-Sep-2018 15:30:24 + s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) { build 12-Sep-2018 15:30:24 + return !std::isspace(ch); build 12-Sep-2018 15:30:24 + }).base(), s.end()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // trim from both ends (in place) build 12-Sep-2018 15:30:24 + inline void trim(std::string &s) { build 12-Sep-2018 15:30:24 + ltrim(s); build 12-Sep-2018 15:30:24 + rtrim(s); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // trim from start (copying) build 12-Sep-2018 15:30:24 + inline std::string ltrim_copy(std::string s) { build 12-Sep-2018 15:30:24 + ltrim(s); build 12-Sep-2018 15:30:24 + return s; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // trim from end (copying) build 12-Sep-2018 15:30:24 + inline std::string rtrim_copy(std::string s) { build 12-Sep-2018 15:30:24 + rtrim(s); build 12-Sep-2018 15:30:24 + return s; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // trim from both ends (copying) build 12-Sep-2018 15:30:24 + inline std::string trim_copy(std::string s) { build 12-Sep-2018 15:30:24 + trim(s); build 12-Sep-2018 15:30:24 + return s; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // return a copy of str with everything transformed to upper case build 12-Sep-2018 15:30:24 + inline std::string str_toupper(std::string s) { build 12-Sep-2018 15:30:24 + std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c) { return std::toupper(c); }); build 12-Sep-2018 15:30:24 + return s; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // return a copy of str with everything transformed to lower case build 12-Sep-2018 15:30:24 + inline std::string str_tolower(std::string s) { build 12-Sep-2018 15:30:24 + std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c) { return std::tolower(c); }); build 12-Sep-2018 15:30:24 + return s; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // split a string into vector using provided character as the delimiter build 12-Sep-2018 15:30:24 + // resuls are added to the pre-existing results vector build 12-Sep-2018 15:30:24 + inline void strsplit(const std::string &str, char delim, std::vector &result) { build 12-Sep-2018 15:30:24 + std::stringstream ss(str); build 12-Sep-2018 15:30:24 + std::string token; build 12-Sep-2018 15:30:24 + while(std::getline(ss,token,delim)) { build 12-Sep-2018 15:30:24 + result.push_back(token); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // check to see if a file exists using posix 'stat(...)' build 12-Sep-2018 15:30:24 + inline bool file_exists(const std::string &filename) { build 12-Sep-2018 15:30:24 + struct stat statbuf; build 12-Sep-2018 15:30:24 + return (stat(filename.c_str(),&statbuf)==0); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 class ASDMUtilsException { build 12-Sep-2018 15:30:24 public: build 12-Sep-2018 15:30:24 ASDMUtilsException(); build 12-Sep-2018 15:30:24 @@ -169,6 +251,7 @@ namespace asdm { build 12-Sep-2018 15:30:24 static std::string pathToV2V3EVLAxslTransform() ; build 12-Sep-2018 15:30:24 static std::string nameOfV2V3xslTransform(ASDMUtils::Origin origin); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 struct DotXMLFilter { build 12-Sep-2018 15:30:24 public: build 12-Sep-2018 15:30:24 DotXMLFilter(std::vector& filenames); build 12-Sep-2018 15:30:24 @@ -177,6 +260,7 @@ namespace asdm { build 12-Sep-2018 15:30:24 private: build 12-Sep-2018 15:30:24 std::vector* filenames; build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 private : build 12-Sep-2018 15:30:24 static bool initialize(); build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/ObservationTable.cc b/code/alma/ASDM/ObservationTable.cc build 12-Sep-2018 15:30:24 index 39130c0..b176cd5 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/ObservationTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/ObservationTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -820,11 +823,19 @@ ObservationRow* ObservationTable::newRow(ObservationRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void ObservationTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void ObservationTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Observation.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Observation.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Observation.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Observation.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Observation table", "Observation"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/Parser.cc b/code/alma/ASDM/Parser.cc build 12-Sep-2018 15:30:24 index b5e7110..87eff96 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/Parser.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/Parser.cc build 12-Sep-2018 15:30:24 @@ -35,7 +35,9 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -76,6 +78,61 @@ namespace asdm { build 12-Sep-2018 15:30:24 --j; build 12-Sep-2018 15:30:24 return substring(s,i,j + 1); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + string Parser::encode(const string &s) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + return boost::property_tree::xml_parser::encode_char_entities(s); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + string result; build 12-Sep-2018 15:30:24 + for (string::const_iterator it=s.begin(); it!=s.end();++it) { build 12-Sep-2018 15:30:24 + switch(*it) { build 12-Sep-2018 15:30:24 + case '&': result += "&"; break; build 12-Sep-2018 15:30:24 + case '<': result += ">"; break; build 12-Sep-2018 15:30:24 + case '>': result += "<"; break; build 12-Sep-2018 15:30:24 + case '\"': result += """; break; build 12-Sep-2018 15:30:24 + case '\'': result += "'"; break; build 12-Sep-2018 15:30:24 + default: result += *it; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return result; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + string Parser::decode(const string &s, const string &/* tableName */) { build 12-Sep-2018 15:30:24 + return boost::property_tree::xml_parser::decode_char_entities(s); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + string Parser::decode(const string &s, const string &tableName) { build 12-Sep-2018 15:30:24 + string result; build 12-Sep-2018 15:30:24 + for (string::const_iterator it=s.begin(); it!=s.end();++it) { build 12-Sep-2018 15:30:24 + // is this the start of a special set of characters to be decoded build 12-Sep-2018 15:30:24 + if (*it == '&') { build 12-Sep-2018 15:30:24 + // is it correctly terminated build 12-Sep-2018 15:30:24 + string::const_iterator term = find(it+1,s.end(),';'); build 12-Sep-2018 15:30:24 + if (term == s.end()) build 12-Sep-2018 15:30:24 + throw ConversionException("Error: Missing semi-colon after start of special characters in \"" + build 12-Sep-2018 15:30:24 + s + "\" : Invalid XML syntax", tableName); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + string thing(it+1,term); build 12-Sep-2018 15:30:24 + if (thing == "amp") result += '&'; build 12-Sep-2018 15:30:24 + else if (thing == "gt") result += '>'; build 12-Sep-2018 15:30:24 + else if (thing == "lt") result += '<'; build 12-Sep-2018 15:30:24 + else if (thing == "quot") result += '\"'; build 12-Sep-2018 15:30:24 + else if (thing == "apos") result += '\''; build 12-Sep-2018 15:30:24 + else build 12-Sep-2018 15:30:24 + throw ConversionException("Error: Unrecognized special characters in \"" + build 12-Sep-2018 15:30:24 + s + "\" : Invalid XML syntax", tableName); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + it = term; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + result += *it; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return result; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 /** build 12-Sep-2018 15:30:24 * Get the portion of the string bounded by s1 and s2, inclusive. build 12-Sep-2018 15:30:24 @@ -136,16 +193,15 @@ namespace asdm { build 12-Sep-2018 15:30:24 // The follwing is a special case. build 12-Sep-2018 15:30:24 ////////////////////////////////////////////////////// build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - string Parser::getString(const string &name, const string & /* tableName */, const string &xmlDoc) build 12-Sep-2018 15:30:24 + string Parser::getString(const string &name, const string &tableName, const string &xmlDoc) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 string xmlField = Parser::getField(xmlDoc,name); build 12-Sep-2018 15:30:24 - // uncomment tableName argument if this code is ever used build 12-Sep-2018 15:30:24 /* build 12-Sep-2018 15:30:24 if (xmlField == "") build 12-Sep-2018 15:30:24 throw ConversionException("Error: Missing field \"" + build 12-Sep-2018 15:30:24 name + "\" or invalid syntax",tableName); build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 - return boost::property_tree::xml_parser::decode_char_entities(xmlField); build 12-Sep-2018 15:30:24 + return Parser::decode(xmlField,tableName); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 vector Parser::get1DString(const string &name, const string &tableName, const string &xmlDoc) build 12-Sep-2018 15:30:24 @@ -170,8 +226,9 @@ namespace asdm { build 12-Sep-2018 15:30:24 t.nextToken("\""); // the space build 12-Sep-2018 15:30:24 value[0] = t.nextToken(); build 12-Sep-2018 15:30:24 for (int i = 1; i < dim0; ++i) { build 12-Sep-2018 15:30:24 - t.nextToken(); // the space build 12-Sep-2018 15:30:24 - value[i] = boost::property_tree::xml_parser::decode_char_entities(t.nextToken()); build 12-Sep-2018 15:30:24 + t.nextToken(); // the space build 12-Sep-2018 15:30:24 + string thisToken = t.nextToken(); build 12-Sep-2018 15:30:24 + value[i] = Parser::decode(thisToken,tableName); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 if (t.hasMoreTokens()) { build 12-Sep-2018 15:30:24 throw ConversionException("Error: Field \"" + build 12-Sep-2018 15:30:24 @@ -213,7 +270,7 @@ namespace asdm { build 12-Sep-2018 15:30:24 for (int i = 0; i < dim0; ++i) { build 12-Sep-2018 15:30:24 v_aux.clear(); build 12-Sep-2018 15:30:24 for (int j = 0; j < dim1; ++j) { build 12-Sep-2018 15:30:24 - v_aux.push_back( boost::property_tree::xml_parser::decode_char_entities(t.nextToken())); build 12-Sep-2018 15:30:24 + v_aux.push_back(Parser::decode(t.nextToken(),tableName)); build 12-Sep-2018 15:30:24 if (i != dim0 - 1 || j != dim1 - 1) build 12-Sep-2018 15:30:24 t.nextToken(); // the space build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -262,7 +319,7 @@ namespace asdm { build 12-Sep-2018 15:30:24 for (int j = 0; j < dim1; ++j) { build 12-Sep-2018 15:30:24 v_aux.clear(); build 12-Sep-2018 15:30:24 for (int k = 0; k < dim2; ++k) { build 12-Sep-2018 15:30:24 - v_aux.push_back( boost::property_tree::xml_parser::decode_char_entities(t.nextToken())); build 12-Sep-2018 15:30:24 + v_aux.push_back( Parser::decode(t.nextToken(),tableName)); build 12-Sep-2018 15:30:24 if (i != dim0 - 1 || j != dim1 - 1 || k != dim2 - 1) build 12-Sep-2018 15:30:24 t.nextToken(); // the space build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -2876,7 +2933,7 @@ namespace asdm { build 12-Sep-2018 15:30:24 buf.append("<" + name + "> "); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (data.size()>0) build 12-Sep-2018 15:30:24 - buf.append(boost::property_tree::xml_parser::encode_char_entities(data)); build 12-Sep-2018 15:30:24 + buf.append(Parser::encode(data)); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 buf.append(" "); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -2893,7 +2950,7 @@ namespace asdm { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 buf.append("\""); build 12-Sep-2018 15:30:24 if (data[i].size()>0) build 12-Sep-2018 15:30:24 - buf.append(boost::property_tree::xml_parser::encode_char_entities(data[i])); build 12-Sep-2018 15:30:24 + buf.append(Parser::encode(data[i])); build 12-Sep-2018 15:30:24 buf.append("\""); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 buf.append(" "); build 12-Sep-2018 15:30:24 @@ -2913,7 +2970,8 @@ namespace asdm { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 buf.append("\""); build 12-Sep-2018 15:30:24 if(data[i][j].size()>0) build 12-Sep-2018 15:30:24 - buf.append(boost::property_tree::xml_parser::encode_char_entities(data[i][j])); build 12-Sep-2018 15:30:24 + buf.append(Parser::encode(data[i][j])); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 buf.append("\""); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 buf.append(" "); build 12-Sep-2018 15:30:24 @@ -2937,7 +2995,8 @@ namespace asdm { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 buf.append("\""); build 12-Sep-2018 15:30:24 if (data[i][j][k].size() > 0) build 12-Sep-2018 15:30:24 - buf.append(boost::property_tree::xml_parser::encode_char_entities(data[i][j][k])); build 12-Sep-2018 15:30:24 + buf.append(Parser::encode(data[i][j][k])); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 buf.append("\""); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 buf.append(" "); build 12-Sep-2018 15:30:24 @@ -2964,8 +3023,8 @@ namespace asdm { build 12-Sep-2018 15:30:24 for (unsigned int l = 0; l < data[i][j][k].size(); l++) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 buf.append("\""); build 12-Sep-2018 15:30:24 - if (data[i][j][k][l].size() > 0) build 12-Sep-2018 15:30:24 - buf.append(boost::property_tree::xml_parser::encode_char_entities(data[i][j][k][l])); build 12-Sep-2018 15:30:24 + if (data[i][j][k][l].size() > 0) build 12-Sep-2018 15:30:24 + Parser::encode(data[i][j][k][l]); build 12-Sep-2018 15:30:24 buf.append("\""); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 buf.append(" "); build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/Parser.h b/code/alma/ASDM/Parser.h build 12-Sep-2018 15:30:24 index 291665c..23b7031 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/Parser.h build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/Parser.h build 12-Sep-2018 15:30:24 @@ -1636,6 +1636,11 @@ public: build 12-Sep-2018 15:30:24 static string substring(const string &s, int a, int b); build 12-Sep-2018 15:30:24 static string trim(const string &s); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + // encode special characters for use in XML build 12-Sep-2018 15:30:24 + static string encode(const string &s); build 12-Sep-2018 15:30:24 + // decode special characters used in XML build 12-Sep-2018 15:30:24 + static string decode(const string &s, const string &tableName); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 }; // End class Parser build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 inline Parser::Parser(const string &s) : str(s), pos(0), beg(0), end(0) { build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/PointingModelTable.cc b/code/alma/ASDM/PointingModelTable.cc build 12-Sep-2018 15:30:24 index 66022af..d784892 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/PointingModelTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/PointingModelTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1043,11 +1046,19 @@ PointingModelRow* PointingModelTable::lookup(Tag antennaId, int numCoeff, vector build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void PointingModelTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void PointingModelTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/PointingModel.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/PointingModel.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/PointingModel.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/PointingModel.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the PointingModel table", "PointingModel"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/PointingTable.cc b/code/alma/ASDM/PointingTable.cc build 12-Sep-2018 15:30:24 index 72c8ab5..d8bcb84 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/PointingTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/PointingTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1034,11 +1037,19 @@ PointingRow* PointingTable::newRow(PointingRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void PointingTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void PointingTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Pointing.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Pointing.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Pointing.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Pointing.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Pointing table", "Pointing"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/PolarizationTable.cc b/code/alma/ASDM/PolarizationTable.cc build 12-Sep-2018 15:30:24 index 054c6d2..0832548 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/PolarizationTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/PolarizationTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -902,11 +905,19 @@ PolarizationRow* PolarizationTable::lookup(int numCorr, vector build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -902,11 +905,19 @@ ProcessorRow* ProcessorTable::lookup(Tag modeId, ProcessorTypeMod::ProcessorType build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void ProcessorTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void ProcessorTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Processor.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Processor.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Processor.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Processor.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Processor table", "Processor"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/PulsarTable.cc b/code/alma/ASDM/PulsarTable.cc build 12-Sep-2018 15:30:24 index ba7d92d..3908748 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/PulsarTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/PulsarTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -952,11 +955,19 @@ PulsarRow* PulsarTable::lookup(ArrayTime refTime, Frequency refPulseFreq, double build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void PulsarTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void PulsarTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Pulsar.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Pulsar.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Pulsar.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Pulsar.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Pulsar table", "Pulsar"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/ReceiverTable.cc b/code/alma/ASDM/ReceiverTable.cc build 12-Sep-2018 15:30:24 index 09b1207..3e5d54d 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/ReceiverTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/ReceiverTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1111,11 +1114,19 @@ ReceiverRow* ReceiverTable::lookup(Tag spectralWindowId, ArrayTimeInterval timeI build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void ReceiverTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void ReceiverTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Receiver.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Receiver.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Receiver.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Receiver.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Receiver table", "Receiver"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/SBSummaryTable.cc b/code/alma/ASDM/SBSummaryTable.cc build 12-Sep-2018 15:30:24 index 2bcbf32..78cbf8d 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/SBSummaryTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/SBSummaryTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1082,11 +1085,19 @@ SBSummaryRow* SBSummaryTable::lookup(EntityRef sbSummaryUID, EntityRef projectUI build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void SBSummaryTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void SBSummaryTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/SBSummary.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/SBSummary.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/SBSummary.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/SBSummary.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the SBSummary table", "SBSummary"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/ScaleTable.cc b/code/alma/ASDM/ScaleTable.cc build 12-Sep-2018 15:30:24 index 45b9b70..df5f595 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/ScaleTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/ScaleTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -917,11 +920,19 @@ ScaleRow* ScaleTable::lookup(TimeScaleMod::TimeScale timeScale, DataScaleMod::Da build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void ScaleTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void ScaleTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Scale.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Scale.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Scale.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Scale.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Scale table", "Scale"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/ScanTable.cc b/code/alma/ASDM/ScanTable.cc build 12-Sep-2018 15:30:24 index a34719a..3007d7c 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/ScanTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/ScanTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -976,11 +979,19 @@ ScanRow* ScanTable::lookup(Tag execBlockId, int scanNumber, ArrayTime startTime, build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void ScanTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void ScanTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Scan.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Scan.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Scan.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Scan.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Scan table", "Scan"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/SeeingTable.cc b/code/alma/ASDM/SeeingTable.cc build 12-Sep-2018 15:30:24 index 61cc828..1d54159 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/SeeingTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/SeeingTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -861,11 +864,19 @@ SeeingRow* SeeingTable::newRow(SeeingRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void SeeingTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void SeeingTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Seeing.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Seeing.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Seeing.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Seeing.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Seeing table", "Seeing"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/SourceTable.cc b/code/alma/ASDM/SourceTable.cc build 12-Sep-2018 15:30:24 index b3d0fe2..0b10dfa 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/SourceTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/SourceTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1207,11 +1210,19 @@ SourceRow* SourceTable::lookup(ArrayTimeInterval timeInterval, Tag spectralWindo build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void SourceTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void SourceTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Source.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Source.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Source.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Source.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Source table", "Source"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/SpectralWindowTable.cc b/code/alma/ASDM/SpectralWindowTable.cc build 12-Sep-2018 15:30:24 index dd3fb13..3eb8a70 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/SpectralWindowTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/SpectralWindowTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1077,11 +1080,19 @@ SpectralWindowRow* SpectralWindowTable::lookup(BasebandNameMod::BasebandName bas build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void SpectralWindowTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void SpectralWindowTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/SpectralWindow.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/SpectralWindow.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/SpectralWindow.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/SpectralWindow.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the SpectralWindow table", "SpectralWindow"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/SquareLawDetectorTable.cc b/code/alma/ASDM/SquareLawDetectorTable.cc build 12-Sep-2018 15:30:24 index b1fa13a..112ac66 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/SquareLawDetectorTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/SquareLawDetectorTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -887,11 +890,19 @@ SquareLawDetectorRow* SquareLawDetectorTable::lookup(int numBand, DetectorBandTy build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void SquareLawDetectorTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void SquareLawDetectorTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/SquareLawDetector.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/SquareLawDetector.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/SquareLawDetector.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/SquareLawDetector.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the SquareLawDetector table", "SquareLawDetector"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/StateTable.cc b/code/alma/ASDM/StateTable.cc build 12-Sep-2018 15:30:24 index 50c28ae..eaa5472 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/StateTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/StateTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -922,11 +925,19 @@ StateRow* StateTable::lookup(CalibrationDeviceMod::CalibrationDevice calDeviceNa build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void StateTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void StateTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/State.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/State.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/State.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/State.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the State table", "State"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/StationTable.cc b/code/alma/ASDM/StationTable.cc build 12-Sep-2018 15:30:24 index 02cfa93..5d9b7e3 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/StationTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/StationTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -907,11 +910,19 @@ StationRow* StationTable::lookup(string name, vector position, StationT build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void StationTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void StationTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Station.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Station.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Station.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Station.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Station table", "Station"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/SubscanTable.cc b/code/alma/ASDM/SubscanTable.cc build 12-Sep-2018 15:30:24 index 907008b..bb0d87e 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/SubscanTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/SubscanTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -968,11 +971,19 @@ SubscanRow* SubscanTable::lookup(Tag execBlockId, int scanNumber, int subscanNum build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void SubscanTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void SubscanTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Subscan.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Subscan.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Subscan.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Subscan.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Subscan table", "Subscan"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/SwitchCycleTable.cc b/code/alma/ASDM/SwitchCycleTable.cc build 12-Sep-2018 15:30:24 index 93cb1c6..2e38f6e 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/SwitchCycleTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/SwitchCycleTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -942,11 +945,19 @@ SwitchCycleRow* SwitchCycleTable::lookup(int numStep, vector weightArray build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void SwitchCycleTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void SwitchCycleTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/SwitchCycle.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/SwitchCycle.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/SwitchCycle.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/SwitchCycle.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the SwitchCycle table", "SwitchCycle"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/SysCalTable.cc b/code/alma/ASDM/SysCalTable.cc build 12-Sep-2018 15:30:24 index 2912e0f..0142a5f 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/SysCalTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/SysCalTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1043,11 +1046,19 @@ SysCalRow* SysCalTable::newRow(SysCalRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void SysCalTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void SysCalTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/SysCal.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/SysCal.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/SysCal.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/SysCal.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the SysCal table", "SysCal"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/SysPowerTable.cc b/code/alma/ASDM/SysPowerTable.cc build 12-Sep-2018 15:30:24 index 6147514..2d40200 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/SysPowerTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/SysPowerTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -979,11 +982,19 @@ SysPowerRow* SysPowerTable::newRow(SysPowerRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void SysPowerTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void SysPowerTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/SysPower.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/SysPower.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/SysPower.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/SysPower.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the SysPower table", "SysPower"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/TableStreamReader.h b/code/alma/ASDM/TableStreamReader.h build 12-Sep-2018 15:30:24 index cac2137..bff2b54 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/TableStreamReader.h build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/TableStreamReader.h build 12-Sep-2018 15:30:24 @@ -275,7 +275,14 @@ namespace asdm { build 12-Sep-2018 15:30:24 int numSkips = 0; build 12-Sep-2018 15:30:24 std::string line; build 12-Sep-2018 15:30:24 do { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + // not sure where this trim is coming from build 12-Sep-2018 15:30:24 line = trim(nextLine()); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // using function in Misc.h build 12-Sep-2018 15:30:24 + line = nextLine(); build 12-Sep-2018 15:30:24 + trim(line); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 numSkips++; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 while (line.size() != 0 && numSkips <= maxSkips); build 12-Sep-2018 15:30:24 @@ -322,37 +329,56 @@ namespace asdm { build 12-Sep-2018 15:30:24 std::string requireMIMEHeader() { build 12-Sep-2018 15:30:24 // MIME-Version build 12-Sep-2018 15:30:24 pairname_value(headerField2Pair(nextLine())); build 12-Sep-2018 15:30:24 -// cout << name_value.first << "=" << name_value.second << endl; build 12-Sep-2018 15:30:24 -// if (currentLine != "MIME-Version: 1.0") // a work around for the case when the very first character is not the expected "M" (happened with some corrupted data). build 12-Sep-2018 15:30:24 -if (! boost::algorithm::iends_with(currentLine, "IME-Version: 1.0")) build 12-Sep-2018 15:30:24 - throw asdm::ConversionException("'MIME-Version: 1.0' missing at the very beginning of the file '"+ tablePath +"'.", T::name()); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -// Content-Type build 12-Sep-2018 15:30:24 -boundary_1 = requireBoundaryInCT(requireHeaderField("CONTENT-TYPE").second); build 12-Sep-2018 15:30:24 + // cout << name_value.first << "=" << name_value.second << endl; build 12-Sep-2018 15:30:24 + // if (currentLine != "MIME-Version: 1.0") // a work around for the case when the very first character is not the expected "M" (happened with some corrupted data). build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + if (! boost::algorithm::iends_with(currentLine, "IME-Version: 1.0")) build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::string versionEnd = "IME-Version: 1.0"; build 12-Sep-2018 15:30:24 + if ((currentLine.size()<=versionEnd.size()) || (currentLine.compare((currentLine.size()-versionEnd.size()),versionEnd.size(),versionEnd)!=0)) build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + throw asdm::ConversionException("'MIME-Version: 1.0' missing at the very beginning of the file '"+ tablePath +"'.", T::name()); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -// cout << "boundary_1 =" << boundary_1 << endl; build 12-Sep-2018 15:30:24 + // Content-Type build 12-Sep-2018 15:30:24 + boundary_1 = requireBoundaryInCT(requireHeaderField("CONTENT-TYPE").second); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -// Content-Description build 12-Sep-2018 15:30:24 -//name_value = requireHeaderField("CONTENT-DESCRIPTION"); build 12-Sep-2018 15:30:24 + // cout << "boundary_1 =" << boundary_1 << endl; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Content-Description build 12-Sep-2018 15:30:24 + //name_value = requireHeaderField("CONTENT-DESCRIPTION"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -// Content-Location build 12-Sep-2018 15:30:24 -//name_value = requireHeaderField("CONTENT-LOCATION"); build 12-Sep-2018 15:30:24 + // Content-Location build 12-Sep-2018 15:30:24 + //name_value = requireHeaderField("CONTENT-LOCATION"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -// Look for an empty line in the at most 10 subsequent lines. build 12-Sep-2018 15:30:24 -skipUntilEmptyLine(20); build 12-Sep-2018 15:30:24 + // Look for an empty line in the at most 10 subsequent lines. build 12-Sep-2018 15:30:24 + skipUntilEmptyLine(20); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -return boundary_1; build 12-Sep-2018 15:30:24 + return boundary_1; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 pair requireHeaderField(const std::string & hf) { build 12-Sep-2018 15:30:24 - std::string s = trim_copy(nextLine()); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + std::string s = boost::trim_copy(nextLine()); build 12-Sep-2018 15:30:24 while (boost::algorithm::iends_with(s, ";")) { build 12-Sep-2018 15:30:24 - s += trim_copy(nextLine()); build 12-Sep-2018 15:30:24 + s += boost::trim_copy(nextLine()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::string s = asdm::trim_copy(nextLine()); build 12-Sep-2018 15:30:24 + while (s.back()==';') { build 12-Sep-2018 15:30:24 + s += asdm::trim_copy(nextLine()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 pair hf2pair(headerField2Pair(s)); build 12-Sep-2018 15:30:24 -if (to_upper_copy(hf2pair.first) != hf) build 12-Sep-2018 15:30:24 - throw asdm::ConversionException("read '" + currentLine + "'. Was expecting '" + hf + "'...", T::name()); build 12-Sep-2018 15:30:24 -return hf2pair; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + if (boost::algorithm::to_upper_copy(hf2pair.first) != hf) build 12-Sep-2018 15:30:24 + throw asdm::ConversionException("read '" + currentLine + "'. Was expecting '" + hf + "'...", T::name()); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + if (asdm::str_toupper(hf2pair.first) != hf) build 12-Sep-2018 15:30:24 + throw asdm::ConversionException("read '" + currentLine + "'. Was expecting '" + hf + "'...", T::name()); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + return hf2pair; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void requireBoundary(const std::string& boundary, int maxLines) { build 12-Sep-2018 15:30:24 @@ -377,10 +403,24 @@ std::string accumulateUntilBoundary(const std::string& boundary, int maxLines) { build 12-Sep-2018 15:30:24 int numLines = 0; build 12-Sep-2018 15:30:24 std::string line ; build 12-Sep-2018 15:30:24 std::string result; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + // not sure where this trim is coming from build 12-Sep-2018 15:30:24 line=trim(nextLine()); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // using function in Misc.h build 12-Sep-2018 15:30:24 + line = nextLine(); build 12-Sep-2018 15:30:24 + trim(line); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 while ( numLines <= maxLines && line.find("--"+boundary) == std::string::npos ) { build 12-Sep-2018 15:30:24 result += line; build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 line=trim(nextLine()); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + line = nextLine(); build 12-Sep-2018 15:30:24 + trim(line); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 numLines++; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -395,14 +435,25 @@ std::string accumulateUntilBoundary(const std::string& boundary, int maxLines) { build 12-Sep-2018 15:30:24 std::string requireBoundaryInCT(const std::string& ctValue) { build 12-Sep-2018 15:30:24 vector cvValueItems; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -split (cvValueItems, ctValue, is_any_of(";")); build 12-Sep-2018 15:30:24 -vector cvValueItemsNameValue; build 12-Sep-2018 15:30:24 -for ( vector::const_iterator iter = cvValueItems.begin(); iter != cvValueItems.end() ; iter++ ) { build 12-Sep-2018 15:30:24 - cvValueItemsNameValue.clear(); build 12-Sep-2018 15:30:24 - split(cvValueItemsNameValue, *iter, is_any_of("=")); build 12-Sep-2018 15:30:24 - string boundary; build 12-Sep-2018 15:30:24 - if ((cvValueItemsNameValue.size() > 1) && (to_upper_copy(trim_copy(cvValueItemsNameValue[0])) == "BOUNDARY") && (unquote(cvValueItemsNameValue[1], boundary).size() > 0)) build 12-Sep-2018 15:30:24 - return boundary; build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::algorithm::split (cvValueItems, ctValue, boost::algorithm::is_any_of(";")); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + asdm::strsplit(ctValue,';',cvValueItems); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + vector cvValueItemsNameValue; build 12-Sep-2018 15:30:24 + for ( vector::const_iterator iter = cvValueItems.begin(); iter != cvValueItems.end() ; iter++ ) { build 12-Sep-2018 15:30:24 + cvValueItemsNameValue.clear(); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::algorithm::split(cvValueItemsNameValue, *iter, boost::algorithm::is_any_of("=")); build 12-Sep-2018 15:30:24 + string boundary; build 12-Sep-2018 15:30:24 + if ((cvValueItemsNameValue.size() > 1) && (boost::to_upper_copy(boost::trim_copy(cvValueItemsNameValue[0])) == "BOUNDARY") && (unquote(cvValueItemsNameValue[1], boundary).size() > 0)) build 12-Sep-2018 15:30:24 + return boundary; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + asdm::strsplit(*iter,'=',cvValueItemsNameValue); build 12-Sep-2018 15:30:24 + string boundary; build 12-Sep-2018 15:30:24 + if ((cvValueItemsNameValue.size() > 1) && (asdm::str_toupper(asdm::trim_copy(cvValueItemsNameValue[0])) == "BOUNDARY") && (unquote(cvValueItemsNameValue[1], boundary).size() > 0)) build 12-Sep-2018 15:30:24 + return boundary; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 throw asdm::ConversionException("could not find a boundary definition in '" + ctValue + "'.", T::name()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/Tag.cc b/code/alma/ASDM/Tag.cc build 12-Sep-2018 15:30:24 index 2e17dc4..d749ffa 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/Tag.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/Tag.cc build 12-Sep-2018 15:30:24 @@ -27,7 +27,9 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using asdm::OutOfBoundsException; build 12-Sep-2018 15:30:24 using asdm::InvalidArgumentException; build 12-Sep-2018 15:30:24 @@ -36,7 +38,11 @@ using namespace std; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - regex Tag::tagSyntax = regex("([A-Z][a-zA-Z]+)_([0-9]+)"); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::regex Tag::tagSyntax = boost::regex("([A-Z][a-zA-Z]+)_([0-9]+)"); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::regex Tag::tagSyntax = std::regex("([A-Z][a-zA-Z]+)_([0-9]+)"); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Tag::Tag() : tag(""), type(0) { } build 12-Sep-2018 15:30:24 Tag::Tag(unsigned int i) { build 12-Sep-2018 15:30:24 @@ -128,12 +134,25 @@ namespace asdm { build 12-Sep-2018 15:30:24 string s; build 12-Sep-2018 15:30:24 is.clear(); build 12-Sep-2018 15:30:24 is >> s; build 12-Sep-2018 15:30:24 - trim(s); build 12-Sep-2018 15:30:24 - cmatch what ; build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::trim(s); build 12-Sep-2018 15:30:24 + boost::cmatch what ; build 12-Sep-2018 15:30:24 if (!regex_match(s.c_str(), what, Tag::tagSyntax)) { build 12-Sep-2018 15:30:24 is.setstate(ios::failbit); build 12-Sep-2018 15:30:24 return is; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // using std and asdm namespaces explicitly here may not be necessary, build 12-Sep-2018 15:30:24 + // but it keep until boost is completely gone build 12-Sep-2018 15:30:24 + // to improve readability and make sure the expected version is being used build 12-Sep-2018 15:30:24 + // this comes from Misc.h build 12-Sep-2018 15:30:24 + asdm::trim(s); build 12-Sep-2018 15:30:24 + std::cmatch what ; build 12-Sep-2018 15:30:24 + if (!std::regex_match(s.c_str(), what, Tag::tagSyntax)) { build 12-Sep-2018 15:30:24 + is.setstate(ios::failbit); build 12-Sep-2018 15:30:24 + return is; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 string stype; stype.assign(what[1].first, what[1].second); build 12-Sep-2018 15:30:24 const TagType* tagType = TagType::getTagType(stype); build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/Tag.h b/code/alma/ASDM/Tag.h build 12-Sep-2018 15:30:24 index 8a61702..1ce1595 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/Tag.h build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/Tag.h build 12-Sep-2018 15:30:24 @@ -39,7 +39,12 @@ using namespace std; build 12-Sep-2018 15:30:24 using asdmIDLTypes::IDLTag; build 12-Sep-2018 15:30:24 #endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -54,8 +59,6 @@ using asdm::InvalidArgumentException; build 12-Sep-2018 15:30:24 using asdm::EndianOSStream; build 12-Sep-2018 15:30:24 using asdm::EndianIStream; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 class Tag; build 12-Sep-2018 15:30:24 @@ -262,7 +265,11 @@ protected: build 12-Sep-2018 15:30:24 TagType* type; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 private: build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 static boost::regex tagSyntax; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + static std::regex tagSyntax; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // End namespace asdm build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/TotalPowerTable.cc b/code/alma/ASDM/TotalPowerTable.cc build 12-Sep-2018 15:30:24 index 56b75c0..1366ba4 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/TotalPowerTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/TotalPowerTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1029,11 +1032,19 @@ TotalPowerRow* TotalPowerTable::newRow(TotalPowerRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void TotalPowerTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void TotalPowerTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/TotalPower.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/TotalPower.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/TotalPower.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/TotalPower.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the TotalPower table", "TotalPower"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/WVMCalTable.cc b/code/alma/ASDM/WVMCalTable.cc build 12-Sep-2018 15:30:24 index 838062a..e79747e 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/WVMCalTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/WVMCalTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -1010,11 +1013,19 @@ WVMCalRow* WVMCalTable::newRow(WVMCalRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void WVMCalTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void WVMCalTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/WVMCal.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/WVMCal.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/WVMCal.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/WVMCal.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the WVMCal table", "WVMCal"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDM/WeatherTable.cc b/code/alma/ASDM/WeatherTable.cc build 12-Sep-2018 15:30:24 index d7a88d5..7a25492 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDM/WeatherTable.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDM/WeatherTable.cc build 12-Sep-2018 15:30:24 @@ -62,9 +62,12 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdm { build 12-Sep-2018 15:30:24 // The name of the entity we will store in this table. build 12-Sep-2018 15:30:24 @@ -991,11 +994,19 @@ WeatherRow* WeatherTable::newRow(WeatherRow* row) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void WeatherTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 + void WeatherTable::setFromFile(const string& directory) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Weather.xml")))) build 12-Sep-2018 15:30:24 setFromXMLFile(directory); build 12-Sep-2018 15:30:24 else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(directory + "/Weather.bin")))) build 12-Sep-2018 15:30:24 setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + // alternative in Misc.h build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(directory + "/Weather.xml"))) build 12-Sep-2018 15:30:24 + setFromXMLFile(directory); build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(directory + "/Weather.bin"))) build 12-Sep-2018 15:30:24 + setFromMIMEFile(directory); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw ConversionException("No file found for the Weather table", "Weather"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/SDMBinData.cc b/code/alma/ASDMBinaries/SDMBinData.cc build 12-Sep-2018 15:30:24 index 8e44d9c..c85f27e 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/SDMBinData.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/SDMBinData.cc build 12-Sep-2018 15:30:24 @@ -2671,17 +2671,6 @@ namespace sdmbin { build 12-Sep-2018 15:30:24 return getNextMSMainCols( e_qcm, es_qapc, nDataSubset); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void SDMBinData::getNextMSMainCols(unsigned int nDataSubset, boost::shared_ptr& vmsData_p_sp) { build 12-Sep-2018 15:30:24 - Enum e_qcm; build 12-Sep-2018 15:30:24 - EnumSet es_qapc; build 12-Sep-2018 15:30:24 - if(canSelect_){ build 12-Sep-2018 15:30:24 - cout<<"INFORM: context allow to select"< e_qcm, EnumSet es_qapc, unsigned int nDataSubset) { build 12-Sep-2018 15:30:24 if (verbose_) cout << "SDMBinData::getNextMSMainCols : entering" << endl; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -2833,6 +2822,20 @@ namespace sdmbin { build 12-Sep-2018 15:30:24 return vmsDataPtr_; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + // shared_ptr not needed by CASA, do not compile this for the WITHOUT_BOOST option build 12-Sep-2018 15:30:24 + // It may be needed by ALMA code, so do not elimiate it yet. build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + void SDMBinData::getNextMSMainCols(unsigned int nDataSubset, boost::shared_ptr& vmsData_p_sp) { build 12-Sep-2018 15:30:24 + Enum e_qcm; build 12-Sep-2018 15:30:24 + EnumSet es_qapc; build 12-Sep-2018 15:30:24 + if(canSelect_){ build 12-Sep-2018 15:30:24 + cout<<"INFORM: context allow to select"< e_qcm, EnumSet es_qapc, unsigned int nDataSubset, boost::shared_ptr& vmsData_p_sp ) { build 12-Sep-2018 15:30:24 if (verbose_) cout << "SDMBinData::getNextMSMainCols (with VMSDataSharedPtr) : entering" << endl; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -2968,6 +2971,7 @@ namespace sdmbin { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 if (verbose_) cout << "SDMBinData::getNextMSMainCols : exiting" << endl; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 vector SDMBinData::getMSDataFromBDFData(Enum e_qcm, EnumSet es_qapc, unsigned int nDataSubsets) { build 12-Sep-2018 15:30:24 if (verbose_) cout << "SDMBinData::getMSDataFromBDFData: entering (e_qcm="< build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using namespace asdmbinaries; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -266,10 +270,14 @@ class SDMBinData{ build 12-Sep-2018 15:30:24 * @return a pointer to a VMSData containing the values to populate MS rows. build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 const VMSData* getNextMSMainCols(unsigned int n); build 12-Sep-2018 15:30:24 - void getNextMSMainCols(unsigned int n, boost::shared_ptr& vmsData_p_sp); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 const VMSData* getNextMSMainCols(Enum e_qcm, EnumSet es_qapc, unsigned int n); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // shared_ptr not needed by CASA, do not compile this for the WITHOUT_BOOST option build 12-Sep-2018 15:30:24 + // It may be needed by ALMA code, so do not elimiate it yet. build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + void getNextMSMainCols(unsigned int n, boost::shared_ptr& vmsData_p_sp); build 12-Sep-2018 15:30:24 void getNextMSMainCols(Enum e_qcm, EnumSet es_qapc, unsigned int n, boost::shared_ptr& vmsData_p_sp); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 vector getMSDataFromBDFData(Enum e_qcm, EnumSet es_qapc, unsigned int n); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/SDMDataObject.cc b/code/alma/ASDMBinaries/SDMDataObject.cc build 12-Sep-2018 15:30:24 index 7b075b6..302dd85 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/SDMDataObject.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/SDMDataObject.cc build 12-Sep-2018 15:30:24 @@ -6,11 +6,10 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using namespace asdmbinaries; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -29,7 +28,11 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // A regular expression to define the syntax of a spectral window identifier. build 12-Sep-2018 15:30:24 - const regex SDMDataObject::SPWID("[0-9]+"); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + const boost::regex SDMDataObject::SPWID("[0-9]+"); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + const std::regex SDMDataObject::SPWID("[0-9]+"); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // SDMDataObject::SpectralWindow:: methods build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 @@ -107,7 +110,11 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 NetSidebandMod::NetSideband SDMDataObject::SpectralWindow::sideband() const { return sideband_; } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void SDMDataObject::SpectralWindow::strImage(const string& s) { build 12-Sep-2018 15:30:24 - cmatch what; build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::cmatch what; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::cmatch what; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 if ((s.size() == 0) || regex_match(s.c_str(), what, SDMDataObject::SPWID)) { build 12-Sep-2018 15:30:24 strImage_ = s; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -118,7 +125,11 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 const string& SDMDataObject::SpectralWindow::strImage() const { return strImage_; } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void SDMDataObject::SpectralWindow::strSw(const string& s) { build 12-Sep-2018 15:30:24 - cmatch what; build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::cmatch what; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::cmatch what; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 if ((s.size() == 0) || regex_match(s.c_str(), what, SDMDataObject::SPWID)) { build 12-Sep-2018 15:30:24 strSw_ = s; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/SDMDataObject.h b/code/alma/ASDMBinaries/SDMDataObject.h build 12-Sep-2018 15:30:24 index 7cd1f03..cdcc582 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/SDMDataObject.h build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/SDMDataObject.h build 12-Sep-2018 15:30:24 @@ -38,7 +38,11 @@ using namespace NetSidebandMod; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using namespace std; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #ifdef REG_BASIC build 12-Sep-2018 15:30:24 #undef REG_BASIC build 12-Sep-2018 15:30:24 @@ -94,16 +98,6 @@ using namespace std; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -/* build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -using namespace boost::posix_time; build 12-Sep-2018 15:30:24 -using namespace boost::gregorian; build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 /** build 12-Sep-2018 15:30:24 * @mainpage build 12-Sep-2018 15:30:24 * build 12-Sep-2018 15:30:24 @@ -1267,7 +1261,11 @@ form an SDMDataObject which is in turn converted into a MIME message, build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void updateIdImageSPW(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 const static boost::regex SPWID; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + const static std::regex SPWID; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 // SDMDataObject:: build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/SDMDataObjectParser.cc b/code/alma/ASDMBinaries/SDMDataObjectParser.cc build 12-Sep-2018 15:30:24 index e5d98c7..1a7302b 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/SDMDataObjectParser.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/SDMDataObjectParser.cc build 12-Sep-2018 15:30:24 @@ -12,7 +12,11 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Names of XML elements/attributes in an sdmDataHeader. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - const regex HeaderParser::PROJECTPATH3("([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + const boost::regex HeaderParser::PROJECTPATH3("([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + const std::regex HeaderParser::PROJECTPATH3("([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 const string HeaderParser::SDMDATAHEADER = "sdmDataHeader"; build 12-Sep-2018 15:30:24 const string HeaderParser::SCHEMAVERSION = "schemaVersion"; build 12-Sep-2018 15:30:24 const string HeaderParser::BYTEORDER = "byteOrder"; build 12-Sep-2018 15:30:24 @@ -61,9 +65,15 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Names of XML elements/attributes in an sdmSubsetDataHeader with dimensionality==1 (Correlator) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - const regex SDMDataObjectParser::PROJECTPATH3("([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 - const regex SDMDataObjectParser::PROJECTPATH4("([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 - const regex SDMDataObjectParser::PROJECTPATH5("([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + const boost::regex SDMDataObjectParser::PROJECTPATH3("([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 + const boost::regex SDMDataObjectParser::PROJECTPATH4("([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 + const boost::regex SDMDataObjectParser::PROJECTPATH5("([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + const std::regex SDMDataObjectParser::PROJECTPATH3("([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 + const std::regex SDMDataObjectParser::PROJECTPATH4("([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 + const std::regex SDMDataObjectParser::PROJECTPATH5("([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 const string CorrSubsetHeaderParser::SDMDATASUBSETHEADER = "sdmDataSubsetHeader"; build 12-Sep-2018 15:30:24 @@ -87,7 +97,11 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 const string CorrSubsetHeaderParser::TYPE = "type"; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Names of XML elements/attributes in an sdmSubsetDataHeader with dimensionality==0 (TP) build 12-Sep-2018 15:30:24 - const regex TPSubsetHeaderParser::PROJECTPATH3("([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + const boost::regex TPSubsetHeaderParser::PROJECTPATH3("([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + const std::regex TPSubsetHeaderParser::PROJECTPATH3("([0-9]+)/([0-9]+)/([0-9]+)/"); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 const string TPSubsetHeaderParser::SDMDATASUBSETHEADER = "sdmDataSubsetHeader"; build 12-Sep-2018 15:30:24 const string TPSubsetHeaderParser::PROJECTPATH = "projectPath"; build 12-Sep-2018 15:30:24 const string TPSubsetHeaderParser::SCHEDULEPERIODTIME = "schedulePeriodTime"; build 12-Sep-2018 15:30:24 @@ -211,9 +225,9 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 // void HeaderParser::parseProjectPath(xmlNode* a_node, SDMDataObject& sdmDataObject) { build 12-Sep-2018 15:30:24 // string projectPath = SDMDataObjectParser::parseStringAttr(a_node, HeaderParser::PROJECTPATH); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -// cmatch what; build 12-Sep-2018 15:30:24 +// boost::cmatch what; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -// if (regex_match(projectPath.c_str(), what,PROJECTPATH3) && what[0].matched) { build 12-Sep-2018 15:30:24 +// if (boost::regex_match(projectPath.c_str(), what,PROJECTPATH3) && what[0].matched) { build 12-Sep-2018 15:30:24 // sdmDataObject.execBlockNum(::atoi(what[1].first)); build 12-Sep-2018 15:30:24 // sdmDataObject.scanNum(::atoi(what[2].first)); build 12-Sep-2018 15:30:24 // sdmDataObject.subscanNum(::atoi(what[3].first)); build 12-Sep-2018 15:30:24 @@ -699,13 +713,13 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 // void CorrSubsetHeaderParser::parseProjectPath (xmlNode* a_node, SDMDataSubset& sdmCorrDataSubset) { build 12-Sep-2018 15:30:24 // string projectPath = SDMDataObjectParser::parseStringAttr(a_node,CorrSubsetHeaderParser::PROJECTPATH); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -// cmatch what; build 12-Sep-2018 15:30:24 +// boost::cmatch what; build 12-Sep-2018 15:30:24 // unsigned int execBlockNum = 0; build 12-Sep-2018 15:30:24 // unsigned int scanNum = 0; build 12-Sep-2018 15:30:24 // unsigned int subscanNum = 0; build 12-Sep-2018 15:30:24 // switch (sdmCorrDataSubset.owner()->spectralResolutionType()) { build 12-Sep-2018 15:30:24 // case FULL_RESOLUTION: build 12-Sep-2018 15:30:24 -// if (regex_match(projectPath.c_str(), what, SDMDataObjectParser::PROJECTPATH4) && what[0].matched) { build 12-Sep-2018 15:30:24 +// if (boost::regex_match(projectPath.c_str(), what, SDMDataObjectParser::PROJECTPATH4) && what[0].matched) { build 12-Sep-2018 15:30:24 // execBlockNum = ::atoi(what[1].first); build 12-Sep-2018 15:30:24 // scanNum = ::atoi(what[2].first); build 12-Sep-2018 15:30:24 // subscanNum = ::atoi(what[3].first); build 12-Sep-2018 15:30:24 @@ -716,7 +730,7 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 // break; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // case CHANNEL_AVERAGE: build 12-Sep-2018 15:30:24 -// if (regex_match(projectPath.c_str(), what, SDMDataObjectParser::PROJECTPATH5) && what[0].matched) { build 12-Sep-2018 15:30:24 +// if (boost::regex_match(projectPath.c_str(), what, SDMDataObjectParser::PROJECTPATH5) && what[0].matched) { build 12-Sep-2018 15:30:24 // execBlockNum = ::atoi(what[1].first); build 12-Sep-2018 15:30:24 // scanNum = ::atoi(what[2].first); build 12-Sep-2018 15:30:24 // subscanNum = ::atoi(what[3].first); build 12-Sep-2018 15:30:24 @@ -882,12 +896,20 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 void TPSubsetHeaderParser::parseProjectPath(xmlNode* a_node, SDMDataSubset& sdmTPDataSubset) { build 12-Sep-2018 15:30:24 string projectPath = SDMDataObjectParser::parseStringAttr(a_node,TPSubsetHeaderParser::PROJECTPATH); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - cmatch what; build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::cmatch what; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::cmatch what; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 unsigned int execBlockNum = 0; build 12-Sep-2018 15:30:24 unsigned int scanNum = 0; build 12-Sep-2018 15:30:24 unsigned int subscanNum = 0; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (regex_match(projectPath.c_str(), what, PROJECTPATH3) && what[0].matched) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + if (boost::regex_match(projectPath.c_str(), what, PROJECTPATH3) && what[0].matched) { build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + if (std::regex_match(projectPath.c_str(), what, PROJECTPATH3) && what[0].matched) { build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 execBlockNum = ::atoi(what[1].first); build 12-Sep-2018 15:30:24 scanNum = ::atoi(what[2].first); build 12-Sep-2018 15:30:24 subscanNum = ::atoi(what[3].first); build 12-Sep-2018 15:30:24 @@ -1052,11 +1074,19 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 int SDMDataObjectParser::parseInt(xmlNode* a_node) { build 12-Sep-2018 15:30:24 //cout << "Entering parseInt with " << a_node->content << endl; build 12-Sep-2018 15:30:24 if ((a_node != NULL) && (a_node->next == NULL)) { build 12-Sep-2018 15:30:24 - const regex UINT("[0-9]+"); build 12-Sep-2018 15:30:24 - cmatch what; build 12-Sep-2018 15:30:24 - if (regex_match((char*)a_node->content, what, UINT)) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + const boost::regex UINT("[0-9]+"); build 12-Sep-2018 15:30:24 + boost::cmatch what; build 12-Sep-2018 15:30:24 + if (boost::regex_match((char*)a_node->content, what, UINT)) { build 12-Sep-2018 15:30:24 + return (::atoi(what[0].first)); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + const std::regex UINT("[0-9]+"); build 12-Sep-2018 15:30:24 + std::cmatch what; build 12-Sep-2018 15:30:24 + if (std::regex_match((char*)a_node->content, what, UINT)) { build 12-Sep-2018 15:30:24 return (::atoi(what[0].first)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw SDMDataObjectParserException("failed to parse '"+string((const char*)a_node->content)+"' as an int in " + string((const char*)a_node->parent->name)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -1066,11 +1096,19 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 bool SDMDataObjectParser::parseBool(xmlNode* a_node) { build 12-Sep-2018 15:30:24 if ((a_node != NULL) && (a_node->next == NULL)) { build 12-Sep-2018 15:30:24 - const regex TORF("true|false"); build 12-Sep-2018 15:30:24 - cmatch what; build 12-Sep-2018 15:30:24 - if (regex_match((char*)a_node->content, what, TORF)) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + const boost::regex TORF("true|false"); build 12-Sep-2018 15:30:24 + boost::cmatch what; build 12-Sep-2018 15:30:24 + if (boost::regex_match((char*)a_node->content, what, TORF)) { build 12-Sep-2018 15:30:24 return ( *(what[0].first) == 't') ? true:false; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + const std::regex TORF("true|false"); build 12-Sep-2018 15:30:24 + std::cmatch what; build 12-Sep-2018 15:30:24 + if (std::regex_match((char*)a_node->content, what, TORF)) { build 12-Sep-2018 15:30:24 + return ( *(what[0].first) == 't') ? true:false; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 throw SDMDataObjectParserException("failed to parse '"+string((const char*)a_node->content)+"' as an int in " + string((const char*)a_node->parent->name)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -1166,11 +1204,19 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 string projectPath = SDMDataObjectParser::parseStringAttr(a_node, HeaderParser::PROJECTPATH); build 12-Sep-2018 15:30:24 vector result; build 12-Sep-2018 15:30:24 bool matched = true; build 12-Sep-2018 15:30:24 - cmatch what; build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::cmatch what; build 12-Sep-2018 15:30:24 + switch (len) { build 12-Sep-2018 15:30:24 + case 3: matched = boost::regex_match(projectPath.c_str(), what, PROJECTPATH3); break; build 12-Sep-2018 15:30:24 + case 4: matched = boost::regex_match(projectPath.c_str(), what, PROJECTPATH4); break; build 12-Sep-2018 15:30:24 + case 5: matched = boost::regex_match(projectPath.c_str(), what, PROJECTPATH5); break; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::cmatch what; build 12-Sep-2018 15:30:24 switch (len) { build 12-Sep-2018 15:30:24 - case 3: matched = regex_match(projectPath.c_str(), what, PROJECTPATH3); break; build 12-Sep-2018 15:30:24 - case 4: matched = regex_match(projectPath.c_str(), what, PROJECTPATH4); break; build 12-Sep-2018 15:30:24 - case 5: matched = regex_match(projectPath.c_str(), what, PROJECTPATH5); break; build 12-Sep-2018 15:30:24 + case 3: matched = std::regex_match(projectPath.c_str(), what, PROJECTPATH3); break; build 12-Sep-2018 15:30:24 + case 4: matched = std::regex_match(projectPath.c_str(), what, PROJECTPATH4); break; build 12-Sep-2018 15:30:24 + case 5: matched = std::regex_match(projectPath.c_str(), what, PROJECTPATH5); break; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 default: throw SDMDataObjectParserException ("internal error in method 'parseProjectPath'. The parameter 'len' has a value out of the range [3,5]"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1183,15 +1229,24 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 return result; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - const regex SDMDataObjectParser::PROJECTPATH4OR5("([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+/)?"); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + const boost::regex SDMDataObjectParser::PROJECTPATH4OR5("([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+/)?"); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + const std::regex SDMDataObjectParser::PROJECTPATH4OR5("([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+/)?"); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 vector SDMDataObjectParser::parseProjectPath(xmlNode* a_node) { build 12-Sep-2018 15:30:24 string projectPath = SDMDataObjectParser::parseStringAttr(a_node, HeaderParser::PROJECTPATH); build 12-Sep-2018 15:30:24 vector result; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 bool matched = true; build 12-Sep-2018 15:30:24 - cmatch what; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - matched = regex_match(projectPath.c_str(), what, PROJECTPATH4OR5); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::cmatch what; build 12-Sep-2018 15:30:24 + matched = boost::regex_match(projectPath.c_str(), what, PROJECTPATH4OR5); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::cmatch what; build 12-Sep-2018 15:30:24 + matched = std::regex_match(projectPath.c_str(), what, PROJECTPATH4OR5); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (!matched) build 12-Sep-2018 15:30:24 throw SDMDataObjectException("'" + projectPath + "' is an invalid string for a 'projectPath' attribute."); build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/SDMDataObjectParser.h b/code/alma/ASDMBinaries/SDMDataObjectParser.h build 12-Sep-2018 15:30:24 index 98fd006..4bd1bd9 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/SDMDataObjectParser.h build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/SDMDataObjectParser.h build 12-Sep-2018 15:30:24 @@ -41,8 +41,11 @@ build 12-Sep-2018 15:30:24 #undef REG_STARTEND build 12-Sep-2018 15:30:24 #endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "SDMDataObject.h" build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -152,8 +155,12 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 // SDMDataObject::TypedBinaryPart parseTypedBinaryPart(xmlNode* a_node, const string& attachmentName); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 xmlDoc *doc; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - static const regex PROJECTPATH3; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + static const boost::regex PROJECTPATH3; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + static const std::regex PROJECTPATH3; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 const static string SDMDATAHEADER; build 12-Sep-2018 15:30:24 const static string SCHEMAVERSION; build 12-Sep-2018 15:30:24 const static string BYTEORDER; build 12-Sep-2018 15:30:24 @@ -222,8 +229,13 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 private: build 12-Sep-2018 15:30:24 // Regular expressions used to decipher the content of projectPath attribute. build 12-Sep-2018 15:30:24 - static const regex PROJECTPATH4; build 12-Sep-2018 15:30:24 - static const regex PROJECTPATH5; build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + static const boost::regex PROJECTPATH4; build 12-Sep-2018 15:30:24 + static const boost::regex PROJECTPATH5; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + static const std::regex PROJECTPATH4; build 12-Sep-2018 15:30:24 + static const std::regex PROJECTPATH5; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void parseSDMDataSubsetHeader(xmlNode* a_node, SDMDataSubset& sdmCorrDataSubset); build 12-Sep-2018 15:30:24 // void parseProjectPath(xmlNode* a_node, SDMDataSubset& sdmCorrDataSubset); build 12-Sep-2018 15:30:24 @@ -268,7 +280,11 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 private: build 12-Sep-2018 15:30:24 // Regular expressions used to decipher the content of projectPath attribute. build 12-Sep-2018 15:30:24 - static const regex PROJECTPATH3; build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + static const boost::regex PROJECTPATH3; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + static const std::regex PROJECTPATH3; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void parseSDMDataSubsetHeader(xmlNode* a_node,SDMDataSubset& sdmTPDataSubset); build 12-Sep-2018 15:30:24 void parseProjectPath(xmlNode* a_node, SDMDataSubset& sdmTPDataSubset); build 12-Sep-2018 15:30:24 @@ -403,10 +419,17 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 private: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - static const regex PROJECTPATH3; build 12-Sep-2018 15:30:24 - static const regex PROJECTPATH4; build 12-Sep-2018 15:30:24 - static const regex PROJECTPATH5; build 12-Sep-2018 15:30:24 - static const regex PROJECTPATH4OR5; build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + static const boost::regex PROJECTPATH3; build 12-Sep-2018 15:30:24 + static const boost::regex PROJECTPATH4; build 12-Sep-2018 15:30:24 + static const boost::regex PROJECTPATH5; build 12-Sep-2018 15:30:24 + static const boost::regex PROJECTPATH4OR5; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + static const std::regex PROJECTPATH3; build 12-Sep-2018 15:30:24 + static const std::regex PROJECTPATH4; build 12-Sep-2018 15:30:24 + static const std::regex PROJECTPATH5; build 12-Sep-2018 15:30:24 + static const std::regex PROJECTPATH4OR5; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 HeaderParser headerParser; build 12-Sep-2018 15:30:24 CorrSubsetHeaderParser corrSubsetHeaderParser; build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/SDMDataObjectReader.cc b/code/alma/ASDMBinaries/SDMDataObjectReader.cc build 12-Sep-2018 15:30:24 index 122cb8c..797c55e 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/SDMDataObjectReader.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/SDMDataObjectReader.cc build 12-Sep-2018 15:30:24 @@ -28,12 +28,21 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 const string SDMDataObjectReader::MIMEBOUNDARY_1 = $MIMEBOUNDARY1; build 12-Sep-2018 15:30:24 const string SDMDataObjectReader::MIMEBOUNDARY_2 = $MIMEBOUNDARY2; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - const regex SDMDataObjectReader::CONTENTIDBINREGEXP(" <([a-zA-Z]+)_([_0-9]+)\\.bin>"); build 12-Sep-2018 15:30:24 - const regex SDMDataObjectReader::CONTENTIDBINREGEXP1(" <([a-zA-Z]+)_([0-9]+)\\.bin>"); build 12-Sep-2018 15:30:24 - const regex SDMDataObjectReader::CONTENTIDBINREGEXP2(" <([a-zA-Z]+)_([0-9]+)_([0-9]+)\\.bin>"); build 12-Sep-2018 15:30:24 - // const regex SDMDataObjectReader::CONTENTIDSUBSETREGEXP(" <(Subset)_([0-9]+)\\.xml>"); build 12-Sep-2018 15:30:24 - const regex SDMDataObjectReader::CONTENTIDSUBSETREGEXP(" <(Subset)_([0-9]+)(_[0-9]+)?\\.xml>"); build 12-Sep-2018 15:30:24 - const regex SDMDataObjectReader::CONTENTIDDATASTRUCTUREREGEXP(" "); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + const boost::regex SDMDataObjectReader::CONTENTIDBINREGEXP(" <([a-zA-Z]+)_([_0-9]+)\\.bin>"); build 12-Sep-2018 15:30:24 + const boost::regex SDMDataObjectReader::CONTENTIDBINREGEXP1(" <([a-zA-Z]+)_([0-9]+)\\.bin>"); build 12-Sep-2018 15:30:24 + const boost::regex SDMDataObjectReader::CONTENTIDBINREGEXP2(" <([a-zA-Z]+)_([0-9]+)_([0-9]+)\\.bin>"); build 12-Sep-2018 15:30:24 + // const boost::regex SDMDataObjectReader::CONTENTIDSUBSETREGEXP(" <(Subset)_([0-9]+)\\.xml>"); build 12-Sep-2018 15:30:24 + const boost::regex SDMDataObjectReader::CONTENTIDSUBSETREGEXP(" <(Subset)_([0-9]+)(_[0-9]+)?\\.xml>"); build 12-Sep-2018 15:30:24 + const boost::regex SDMDataObjectReader::CONTENTIDDATASTRUCTUREREGEXP(" "); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + const std::regex SDMDataObjectReader::CONTENTIDBINREGEXP(" <([a-zA-Z]+)_([_0-9]+)\\.bin>"); build 12-Sep-2018 15:30:24 + const std::regex SDMDataObjectReader::CONTENTIDBINREGEXP1(" <([a-zA-Z]+)_([0-9]+)\\.bin>"); build 12-Sep-2018 15:30:24 + const std::regex SDMDataObjectReader::CONTENTIDBINREGEXP2(" <([a-zA-Z]+)_([0-9]+)_([0-9]+)\\.bin>"); build 12-Sep-2018 15:30:24 + // const std::regex SDMDataObjectReader::CONTENTIDSUBSETREGEXP(" <(Subset)_([0-9]+)\\.xml>"); build 12-Sep-2018 15:30:24 + const std::regex SDMDataObjectReader::CONTENTIDSUBSETREGEXP(" <(Subset)_([0-9]+)(_[0-9]+)?\\.xml>"); build 12-Sep-2018 15:30:24 + const std::regex SDMDataObjectReader::CONTENTIDDATASTRUCTUREREGEXP(" "); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 set SDMDataObjectReader::BINATTACHNAMES; build 12-Sep-2018 15:30:24 map SDMDataObjectReader::name2code; build 12-Sep-2018 15:30:24 const bool SDMDataObjectReader::initClass_ = SDMDataObjectReader::initClass(); build 12-Sep-2018 15:30:24 @@ -237,11 +246,17 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 string contentLocation = getContentLocation(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Extract the attachment name and the integration number. build 12-Sep-2018 15:30:24 - cmatch what; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - regex r(" *" + sdmDataSubset.projectPath()+"(actualDurations|actualTimes|autoData|flags|crossData|zeroLags)\\.bin"); build 12-Sep-2018 15:30:24 - if (regex_match(contentLocation.c_str(), what, r)) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::cmatch what; build 12-Sep-2018 15:30:24 + boost::regex r(" *" + sdmDataSubset.projectPath()+"(actualDurations|actualTimes|autoData|flags|crossData|zeroLags)\\.bin"); build 12-Sep-2018 15:30:24 + if (boost::regex_match(contentLocation.c_str(), what, r)) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::cmatch what; build 12-Sep-2018 15:30:24 + std::regex r(" *" + sdmDataSubset.projectPath()+"(actualDurations|actualTimes|autoData|flags|crossData|zeroLags)\\.bin"); build 12-Sep-2018 15:30:24 + if (std::regex_match(contentLocation.c_str(), what, r)) { build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 ostringstream oss; build 12-Sep-2018 15:30:24 oss << "Invalid Content-Location field '" << contentLocation <<"' in MIME header of an attachment (approx. char position = " << position_ << ")."; build 12-Sep-2018 15:30:24 @@ -358,16 +373,29 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 // We are 1 character beyond the end of -- build 12-Sep-2018 15:30:24 string contentLocation = getContentLocation(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - regex r(" *" + sdmDataObject_.projectPath() + "([[:digit:]]+/){1,2}" + "desc.xml");; build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::regex r(" *" + sdmDataObject_.projectPath() + "([[:digit:]]+/){1,2}" + "desc.xml");; build 12-Sep-2018 15:30:24 ostringstream oss; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Extract the Subset name and the integration [, subintegration] number. build 12-Sep-2018 15:30:24 - cmatch what; build 12-Sep-2018 15:30:24 - if (!regex_match(contentLocation.c_str(), what, r)) { build 12-Sep-2018 15:30:24 + boost::cmatch what; build 12-Sep-2018 15:30:24 + if (!boost::regex_match(contentLocation.c_str(), what, r)) { build 12-Sep-2018 15:30:24 ostringstream oss; build 12-Sep-2018 15:30:24 oss << "Invalid Content-Location field '" << contentLocation <<"' in MIME header of a Subset (approx. char position = " << position_ << ")."; build 12-Sep-2018 15:30:24 throw SDMDataObjectReaderException(oss.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::regex r(" *" + sdmDataObject_.projectPath() + "([[:digit:]]+/){1,2}" + "desc.xml");; build 12-Sep-2018 15:30:24 + ostringstream oss; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Extract the Subset name and the integration [, subintegration] number. build 12-Sep-2018 15:30:24 + std::cmatch what; build 12-Sep-2018 15:30:24 + if (!std::regex_match(contentLocation.c_str(), what, r)) { build 12-Sep-2018 15:30:24 + ostringstream oss; build 12-Sep-2018 15:30:24 + oss << "Invalid Content-Location field '" << contentLocation <<"' in MIME header of a Subset (approx. char position = " << position_ << ")."; build 12-Sep-2018 15:30:24 + throw SDMDataObjectReaderException(oss.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 SDMDataSubset integration(&sdmDataObject_); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -663,15 +691,27 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 string contentLocation = getContentLocation(); build 12-Sep-2018 15:30:24 // cout << contentLocation << endl; build 12-Sep-2018 15:30:24 - regex r(" *"+sdmDataObject_.projectPath() + "desc.xml"); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::regex r(" *"+sdmDataObject_.projectPath() + "desc.xml"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Extract the Subset name and the suffix number (which must be equal to 1). build 12-Sep-2018 15:30:24 - cmatch what; build 12-Sep-2018 15:30:24 - if (!regex_match(contentLocation.c_str(), what, r)) { build 12-Sep-2018 15:30:24 + boost::cmatch what; build 12-Sep-2018 15:30:24 + if (!boost::regex_match(contentLocation.c_str(), what, r)) { build 12-Sep-2018 15:30:24 ostringstream oss; build 12-Sep-2018 15:30:24 oss << "Invalid Content-Location field '" << contentLocation <<"' in MIME header of the subset"; build 12-Sep-2018 15:30:24 throw SDMDataObjectReaderException(oss.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::regex r(" *"+sdmDataObject_.projectPath() + "desc.xml"); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Extract the Subset name and the suffix number (which must be equal to 1). build 12-Sep-2018 15:30:24 + std::cmatch what; build 12-Sep-2018 15:30:24 + if (!std::regex_match(contentLocation.c_str(), what, r)) { build 12-Sep-2018 15:30:24 + ostringstream oss; build 12-Sep-2018 15:30:24 + oss << "Invalid Content-Location field '" << contentLocation <<"' in MIME header of the subset"; build 12-Sep-2018 15:30:24 + throw SDMDataObjectReaderException(oss.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 SDMDataSubset subscan(&sdmDataObject_); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/SDMDataObjectReader.h b/code/alma/ASDMBinaries/SDMDataObjectReader.h build 12-Sep-2018 15:30:24 index ae6ec90..47dc38b 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/SDMDataObjectReader.h build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/SDMDataObjectReader.h build 12-Sep-2018 15:30:24 @@ -39,15 +39,16 @@ build 12-Sep-2018 15:30:24 #undef REG_STARTEND build 12-Sep-2018 15:30:24 #endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "SDMDataObjectParser.h" build 12-Sep-2018 15:30:24 #include "SDMDataObject.h" build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using namespace std; build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 /* build 12-Sep-2018 15:30:24 typedef long long ACTUALDURATIONSTYPE; build 12-Sep-2018 15:30:24 @@ -189,12 +190,19 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 static const string MIMEBOUNDARY_2; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Regular expressions used to identify a Content-ID field in a MIME header build 12-Sep-2018 15:30:24 - static const regex CONTENTIDDATASTRUCTUREREGEXP; build 12-Sep-2018 15:30:24 - static const regex CONTENTIDSUBSETREGEXP; build 12-Sep-2018 15:30:24 - static const regex CONTENTIDBINREGEXP; build 12-Sep-2018 15:30:24 - static const regex CONTENTIDBINREGEXP1; build 12-Sep-2018 15:30:24 - static const regex CONTENTIDBINREGEXP2; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + static const boost::regex CONTENTIDDATASTRUCTUREREGEXP; build 12-Sep-2018 15:30:24 + static const boost::regex CONTENTIDSUBSETREGEXP; build 12-Sep-2018 15:30:24 + static const boost::regex CONTENTIDBINREGEXP; build 12-Sep-2018 15:30:24 + static const boost::regex CONTENTIDBINREGEXP1; build 12-Sep-2018 15:30:24 + static const boost::regex CONTENTIDBINREGEXP2; build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + static const std::regex CONTENTIDDATASTRUCTUREREGEXP; build 12-Sep-2018 15:30:24 + static const std::regex CONTENTIDSUBSETREGEXP; build 12-Sep-2018 15:30:24 + static const std::regex CONTENTIDBINREGEXP; build 12-Sep-2018 15:30:24 + static const std::regex CONTENTIDBINREGEXP1; build 12-Sep-2018 15:30:24 + static const std::regex CONTENTIDBINREGEXP2; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 // Set of valid binary attachment names build 12-Sep-2018 15:30:24 static set BINATTACHNAMES; build 12-Sep-2018 15:30:24 enum BINATTACHCODES {ACTUALDURATIONS=0, ACTUALTIMES=1, AUTODATA=2, FLAGS=3, CROSSDATA=4, ZEROLAGS=5}; build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/SDMDataObjectStreamReader.cc b/code/alma/ASDMBinaries/SDMDataObjectStreamReader.cc build 12-Sep-2018 15:30:24 index 7d928a1..b669186 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/SDMDataObjectStreamReader.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/SDMDataObjectStreamReader.cc build 12-Sep-2018 15:30:24 @@ -1,5 +1,10 @@ build 12-Sep-2018 15:30:24 #include "SDMDataObjectStreamReader.h" build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifdef WITHOUT_BOOST build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include "Misc.h" build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 namespace asdmbinaries { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 SDMDataObjectStreamReaderException::SDMDataObjectStreamReaderException():message("SDMDataObjectStreamReaderException:") {;} build 12-Sep-2018 15:30:24 @@ -231,12 +236,20 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (colonIndex > 0) { build 12-Sep-2018 15:30:24 name = hf.substr(0, colonIndex); build 12-Sep-2018 15:30:24 - trim(name); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::algorithm::trim(name); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + asdm::trim(name); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (colonIndex < hf.size()) { build 12-Sep-2018 15:30:24 value = hf.substr(colonIndex+1); build 12-Sep-2018 15:30:24 - trim(value); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::algorithm::trim(value); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + asdm::trim(value); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 return make_pair(name, value); build 12-Sep-2018 15:30:24 @@ -245,8 +258,13 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 pair SDMDataObjectStreamReader::requireHeaderField(const string & hf) { build 12-Sep-2018 15:30:24 pair hf2pair(headerField2Pair(nextLine())); build 12-Sep-2018 15:30:24 // cout << hf2pair.first << ", " << hf2pair.second << endl; build 12-Sep-2018 15:30:24 - if (to_upper_copy(hf2pair.first) != hf) build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + if (boost::algorithm::to_upper_copy(hf2pair.first) != hf) build 12-Sep-2018 15:30:24 + throw SDMDataObjectStreamReaderException("read '" + currentLine + "'. Was expecting '" + hf + "'..."); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + if (asdm::str_toupper(hf2pair.first) != hf) build 12-Sep-2018 15:30:24 throw SDMDataObjectStreamReaderException("read '" + currentLine + "'. Was expecting '" + hf + "'..."); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 return hf2pair; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -270,15 +288,27 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 string SDMDataObjectStreamReader::requireBoundaryInCT(const string& ctValue) { build 12-Sep-2018 15:30:24 vector cvValueItems; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - split (cvValueItems, ctValue, is_any_of(";")); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::algorithm::split (cvValueItems, ctValue, boost::algorithm::is_any_of(";")); build 12-Sep-2018 15:30:24 + vector cvValueItemsNameValue; build 12-Sep-2018 15:30:24 + for ( vector::const_iterator iter = cvValueItems.begin(); iter != cvValueItems.end() ; iter++ ) { build 12-Sep-2018 15:30:24 + cvValueItemsNameValue.clear(); build 12-Sep-2018 15:30:24 + boost::algorithm::split(cvValueItemsNameValue, *iter, boost::algorithm::is_any_of("=")); build 12-Sep-2018 15:30:24 + string boundary; build 12-Sep-2018 15:30:24 + if ((cvValueItemsNameValue.size() > 1) && (boost::algorithm::to_upper_copy(boost::algorithm::trim_copy(cvValueItemsNameValue[0])) == "BOUNDARY") && (unquote(cvValueItemsNameValue[1], boundary).size() > 0)) build 12-Sep-2018 15:30:24 + return boundary; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + asdm::strsplit (ctValue, ';', cvValueItems); build 12-Sep-2018 15:30:24 vector cvValueItemsNameValue; build 12-Sep-2018 15:30:24 for ( vector::const_iterator iter = cvValueItems.begin(); iter != cvValueItems.end() ; iter++ ) { build 12-Sep-2018 15:30:24 cvValueItemsNameValue.clear(); build 12-Sep-2018 15:30:24 - split(cvValueItemsNameValue, *iter, is_any_of("=")); build 12-Sep-2018 15:30:24 + asdm::strsplit(*iter,'=',cvValueItemsNameValue); build 12-Sep-2018 15:30:24 string boundary; build 12-Sep-2018 15:30:24 - if ((cvValueItemsNameValue.size() > 1) && (to_upper_copy(trim_copy(cvValueItemsNameValue[0])) == "BOUNDARY") && (unquote(cvValueItemsNameValue[1], boundary).size() > 0)) build 12-Sep-2018 15:30:24 + if ((cvValueItemsNameValue.size() > 1) && (asdm::str_toupper(asdm::trim_copy(cvValueItemsNameValue[0])) == "BOUNDARY") && (unquote(cvValueItemsNameValue[1], boundary).size() > 0)) build 12-Sep-2018 15:30:24 return boundary; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 throw SDMDataObjectStreamReaderException("could not find a boundary definition in '" + ctValue + "'."); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -316,7 +346,12 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 pairname_value(headerField2Pair(nextLine())); build 12-Sep-2018 15:30:24 // cout << name_value.first << "=" << name_value.second << endl; build 12-Sep-2018 15:30:24 // if (currentLine != "MIME-Version: 1.0") // a work around for the case when the very first character is not the expected "M" (happened with some corrupted data). build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 if (! boost::algorithm::iends_with(currentLine, "IME-Version: 1.0")) build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::string versionEnd = "IME-Version: 1.0"; build 12-Sep-2018 15:30:24 + if ((currentLine.size()<=versionEnd.size()) || (currentLine.compare((currentLine.size()-versionEnd.size()),versionEnd.size(),versionEnd)!=0)) build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 throw SDMDataObjectStreamReaderException("'MIME-Version: 1.0' missing at the very beginning of the file '"+path+"'."); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Content-Type build 12-Sep-2018 15:30:24 @@ -374,7 +409,11 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void SDMDataObjectStreamReader::lookForBinaryPartSize(xmlNode* aNode) { build 12-Sep-2018 15:30:24 - const regex UINT("[0-9]+"); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + const boost::regex UINT("[0-9]+"); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + const std::regex UINT("[0-9]+"); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 xmlNode *curNode = NULL; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 for (curNode = aNode; curNode ; curNode = curNode->next) { build 12-Sep-2018 15:30:24 @@ -382,8 +421,13 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 if (s_partNames.find(string((char *)curNode->name)) != s_partNames.end()){ build 12-Sep-2018 15:30:24 if (xmlHasProp(curNode, (const xmlChar*) "size")) { build 12-Sep-2018 15:30:24 xmlChar * value = xmlGetProp(curNode, (const xmlChar *) "size"); build 12-Sep-2018 15:30:24 - cmatch what; build 12-Sep-2018 15:30:24 - if (regex_match((char*) value, what, UINT)) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::cmatch what; build 12-Sep-2018 15:30:24 + if (boost::regex_match((char*) value, what, UINT)) { build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::cmatch what; build 12-Sep-2018 15:30:24 + if (std::regex_match((char*) value, what, UINT)) { build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 int64_t result = ::atoi(what[0].first); build 12-Sep-2018 15:30:24 xmlFree(value); build 12-Sep-2018 15:30:24 binaryPartSize[string((char *) curNode->name)] = result; build 12-Sep-2018 15:30:24 @@ -518,17 +562,29 @@ namespace asdmbinaries { build 12-Sep-2018 15:30:24 parser.parseMemoryTPSubsetHeader(sdmDataSubsetHeader, sdmDataSubset); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 attachmentFlags.reset(); build 12-Sep-2018 15:30:24 - regex BINARYPARTLOC("([0-9]+/)+(actualDurations|actualTimes|autoData|crossData|zeroLags|flags)\\.bin"); build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::regex BINARYPARTLOC("([0-9]+/)+(actualDurations|actualTimes|autoData|crossData|zeroLags|flags)\\.bin"); build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::regex BINARYPARTLOC("([0-9]+/)+(actualDurations|actualTimes|autoData|crossData|zeroLags|flags)\\.bin"); build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 bool done = false; build 12-Sep-2018 15:30:24 while (!done) { build 12-Sep-2018 15:30:24 name_value = requireHeaderField("CONTENT-TYPE"); build 12-Sep-2018 15:30:24 name_value = requireHeaderField("CONTENT-LOCATION"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - smatch what; build 12-Sep-2018 15:30:24 - const string contentLocation = trim_copy(name_value.second); build 12-Sep-2018 15:30:24 - if (!regex_search(contentLocation, what, BINARYPARTLOC)) { build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 + boost::smatch what; build 12-Sep-2018 15:30:24 + const string contentLocation = boost::algorithm::trim_copy(name_value.second); build 12-Sep-2018 15:30:24 + if (!boost::regex_search(contentLocation, what, BINARYPARTLOC)) { build 12-Sep-2018 15:30:24 throw SDMDataObjectStreamReaderException("Invalid field : '" + name_value.first + ":" + name_value.second + "'."); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 +#else build 12-Sep-2018 15:30:24 + std::smatch what; build 12-Sep-2018 15:30:24 + const string contentLocation = asdm::trim_copy(name_value.second); build 12-Sep-2018 15:30:24 + if (!std::regex_search(contentLocation, what, BINARYPARTLOC)) { build 12-Sep-2018 15:30:24 + throw SDMDataObjectStreamReaderException("Invalid field : '" + name_value.first + ":" + name_value.second + "'."); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 // cout << "Binary part name = " << what[2] << "..."; build 12-Sep-2018 15:30:24 string binaryPartName = string(what[2]); build 12-Sep-2018 15:30:24 if (binaryPartSize.find(binaryPartName) == binaryPartSize.end()) build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/SDMDataObjectStreamReader.h b/code/alma/ASDMBinaries/SDMDataObjectStreamReader.h build 12-Sep-2018 15:30:24 index c2d44be..f6fff42 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/SDMDataObjectStreamReader.h build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/SDMDataObjectStreamReader.h build 12-Sep-2018 15:30:24 @@ -8,19 +8,22 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include "boost/filesystem/operations.hpp" build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "SDMDataObjectParser.h" build 12-Sep-2018 15:30:24 #include "SDMDataObject.h" build 12-Sep-2018 15:30:24 #include "CPrimitiveDataType.h" build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using namespace std; build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace asdmbinaries { build 12-Sep-2018 15:30:24 class SDMDataObjectStreamReaderException { build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/SDMDataObjectWriter.h b/code/alma/ASDMBinaries/SDMDataObjectWriter.h build 12-Sep-2018 15:30:24 index db135dd..5365b88 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/SDMDataObjectWriter.h build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/SDMDataObjectWriter.h build 12-Sep-2018 15:30:24 @@ -6,7 +6,6 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -//#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/SDMDataViews.h b/code/alma/ASDMBinaries/SDMDataViews.h build 12-Sep-2018 15:30:24 index 6f4bc54..fbb56b7 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/SDMDataViews.h build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/SDMDataViews.h build 12-Sep-2018 15:30:24 @@ -5,7 +5,9 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using asdm::ArrayTime; build 12-Sep-2018 15:30:24 using asdm::Interval; build 12-Sep-2018 15:30:24 @@ -121,9 +123,13 @@ namespace sdmbin{ build 12-Sep-2018 15:30:24 vector v_flag; //!< from BINARIES build 12-Sep-2018 15:30:24 } VMSData; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // This struct, using boost::shared_array, is not used by CASA. It is not available when WITHOUT_BOOST is set. build 12-Sep-2018 15:30:24 + // It may be used by ALMA code and so has not been eliminated. build 12-Sep-2018 15:30:24 +#ifndef WITHOUT_BOOST build 12-Sep-2018 15:30:24 /** build 12-Sep-2018 15:30:24 * A structure containing the data from a single SDM BLOB. build 12-Sep-2018 15:30:24 - * The *big* difference with the previous definition (VMSData) is that the visibilities are referred to by a boost::shared_ptr instead build 12-Sep-2018 15:30:24 + * The *big* difference with the previous definition (VMSData) is that the visibilities are referred to by a boost::shared_array instead build 12-Sep-2018 15:30:24 * of a plain old pointer. build 12-Sep-2018 15:30:24 * build 12-Sep-2018 15:30:24 * \note build 12-Sep-2018 15:30:24 @@ -160,6 +166,7 @@ namespace sdmbin{ build 12-Sep-2018 15:30:24 vector v_msState; //!< from SDM MS state tuples build 12-Sep-2018 15:30:24 vector v_flag; //!< from BINARIES build 12-Sep-2018 15:30:24 } VMSDataWithSharedPtr; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #define _SDMDATAVIEWS_H build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/test/tReadAllBDFs.cc b/code/alma/ASDMBinaries/test/tReadAllBDFs.cc build 12-Sep-2018 15:30:24 index 3244048..2c45cb9 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/test/tReadAllBDFs.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/test/tReadAllBDFs.cc build 12-Sep-2018 15:30:24 @@ -2,9 +2,39 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 using namespace std; build 12-Sep-2018 15:30:24 -using namespace boost::filesystem; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +// replacing boost functions not available in c++11 using stat build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +inline bool file_exists(const string &filename) { build 12-Sep-2018 15:30:24 + struct stat statbuf; build 12-Sep-2018 15:30:24 + return (stat(filename.c_str(),&statbuf)==0); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +inline bool is_regular_file(const string &filename) { build 12-Sep-2018 15:30:24 + struct stat statbuf; build 12-Sep-2018 15:30:24 + bool result = (stat(filename.c_str(),&statbuf)==0); build 12-Sep-2018 15:30:24 + if (result) result = S_ISREG(statbuf.st_mode); build 12-Sep-2018 15:30:24 + return result; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +inline bool is_directory(const string &filename) { build 12-Sep-2018 15:30:24 + struct stat statbuf; build 12-Sep-2018 15:30:24 + bool result = (stat(filename.c_str(),&statbuf)==0); build 12-Sep-2018 15:30:24 + if (result) result = S_ISDIR(statbuf.st_mode); build 12-Sep-2018 15:30:24 + return result; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +inline off_t file_size(const string &filename) { build 12-Sep-2018 15:30:24 + struct stat statbuf; build 12-Sep-2018 15:30:24 + off_t result = 0; build 12-Sep-2018 15:30:24 + if (stat(filename.c_str(),&statbuf)==0) { build 12-Sep-2018 15:30:24 + result = statbuf.st_size; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return result; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 int main(int argc, char* argv[]) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 @@ -14,11 +44,11 @@ int main(int argc, char* argv[]) build 12-Sep-2018 15:30:24 return 1; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - path p (argv[1]); // p reads clearer than argv[1] in the following code build 12-Sep-2018 15:30:24 + string p (argv[1]); // p reads clearer than argv[1] in the following code build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 try build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - if (exists(p)) // does p actually exist? build 12-Sep-2018 15:30:24 + if (file_exists(p)) // does p actually exist? build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 if (is_regular_file(p)) // is p a regular file? build 12-Sep-2018 15:30:24 cout << p << " size is " << file_size(p) << '\n'; build 12-Sep-2018 15:30:24 @@ -27,13 +57,18 @@ int main(int argc, char* argv[]) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 cout << p << " is a directory containing:\n"; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - typedef vector vec; // store paths, build 12-Sep-2018 15:30:24 + typedef vector vec; // store paths, build 12-Sep-2018 15:30:24 vec v; // so we can sort them later build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - copy(directory_iterator(p), directory_iterator(), back_inserter(v)); build 12-Sep-2018 15:30:24 + DIR *dir; build 12-Sep-2018 15:30:24 + if ((dir = opendir(p.c_str())) != NULL) { build 12-Sep-2018 15:30:24 + struct dirent *ent; build 12-Sep-2018 15:30:24 + while ((ent=readdir(dir)) != NULL) { build 12-Sep-2018 15:30:24 + v.push_back(string(ent->d_name)); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - sort(v.begin(), v.end()); // sort, since directory iteration build 12-Sep-2018 15:30:24 - // is not ordered on some file systems build 12-Sep-2018 15:30:24 + sort(v.begin(), v.end()); // sort, in case readdir did not proceed in sorted order build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 for (vec::const_iterator it(v.begin()), it_end(v.end()); it != it_end; ++it) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 @@ -47,9 +82,9 @@ int main(int argc, char* argv[]) build 12-Sep-2018 15:30:24 cout << p << " does not exist\n"; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - catch (const filesystem_error& ex) build 12-Sep-2018 15:30:24 + catch ( exception & ex) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - cout << ex.what() << '\n'; build 12-Sep-2018 15:30:24 + cout << ex.what() << endl; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 return 0; build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/test/tReadParBDFs.cc b/code/alma/ASDMBinaries/test/tReadParBDFs.cc build 12-Sep-2018 15:30:24 index 0656879..2e16418 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/test/tReadParBDFs.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/test/tReadParBDFs.cc build 12-Sep-2018 15:30:24 @@ -7,27 +7,14 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -namespace po = boost::program_options; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost::filesystem; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost::lambda; build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +using namespace alma; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "SDMBinData.h" build 12-Sep-2018 15:30:24 using namespace sdmbin; build 12-Sep-2018 15:30:24 @@ -41,6 +28,8 @@ using namespace asdm; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "asdmstman/AsdmStMan.h" build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 void* scanBDF (void * pathToBDF_p ) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 SDMDataObjectStreamReader sdosr; build 12-Sep-2018 15:30:24 @@ -48,11 +37,13 @@ void* scanBDF (void * pathToBDF_p ) { build 12-Sep-2018 15:30:24 sdosr.open(pathToBDF); build 12-Sep-2018 15:30:24 ProcessorType processorType = sdosr.processorType(); build 12-Sep-2018 15:30:24 if (processorType == RADIOMETER) { build 12-Sep-2018 15:30:24 - const SDMDataSubset& sdmDataSubset = sdosr.getSubset(); build 12-Sep-2018 15:30:24 + // returned SDMDataSubset value is not used, ok to ignore build 12-Sep-2018 15:30:24 + sdosr.getSubset(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else if (processorType == CORRELATOR) { build 12-Sep-2018 15:30:24 while (sdosr.hasSubset()) { build 12-Sep-2018 15:30:24 - const SDMDataSubset& sdmDataSubset = sdosr.getSubset(); build 12-Sep-2018 15:30:24 + // returned SDMDataSubset value is not used, ok to ignore build 12-Sep-2018 15:30:24 + sdosr.getSubset(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 @@ -69,51 +60,100 @@ int main ( int argc, char * argv[] ) { build 12-Sep-2018 15:30:24 string dsName; build 12-Sep-2018 15:30:24 unsigned int nThreads; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - po::variables_map vm; build 12-Sep-2018 15:30:24 + enum optionIndex { UNKNOWN, HELP, ASDMDIR, NUMTHREAD }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 try { build 12-Sep-2018 15:30:24 - // Declare the supported options. build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::options_description generic("Read sequentially all the BDFs of ASDM dataset without any processing. It's just an application to measure the time reading the BDFs by using the class SDMDataObjectStreamReader. \n" build 12-Sep-2018 15:30:24 - "Usage : " + appName +" asdm-directory number-of-threads \n\n" build 12-Sep-2018 15:30:24 - "Command parameters: \n" build 12-Sep-2018 15:30:24 - " asdm-directory : the pathname to the ASDM dataset containing the BFDs to be read. \n" build 12-Sep-2018 15:30:24 - " number-of-threads : the number of threads to be launched in parallel (> 0) \n\n" build 12-Sep-2018 15:30:24 - ".\n\n" build 12-Sep-2018 15:30:24 - "Allowed options:"); build 12-Sep-2018 15:30:24 - generic.add_options() build 12-Sep-2018 15:30:24 - ("help", "produces help message."); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Hidden options, will be allowed both on command line and build 12-Sep-2018 15:30:24 - // in config file, but will not be shown to the user. build 12-Sep-2018 15:30:24 - po::options_description hidden("Hidden options"); build 12-Sep-2018 15:30:24 - hidden.add_options() build 12-Sep-2018 15:30:24 - ("asdm-directory", po::value< string >(), "asdm directory") build 12-Sep-2018 15:30:24 - ("number-of-threads", po::value(&nThreads)->default_value(2), "number of threads") build 12-Sep-2018 15:30:24 - ; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::options_description cmdline_options; build 12-Sep-2018 15:30:24 - cmdline_options.add(generic).add(hidden); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::positional_options_description p; build 12-Sep-2018 15:30:24 - p.add("asdm-directory", 1); build 12-Sep-2018 15:30:24 - p.add("number-of-threads", 1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Parse the command line and retrieve the options and parameters. build 12-Sep-2018 15:30:24 - po::store(po::command_line_parser(argc, argv).options(cmdline_options).positional(p).run(), vm); build 12-Sep-2018 15:30:24 + // remove the program name build 12-Sep-2018 15:30:24 + argc--; build 12-Sep-2018 15:30:24 + argv++; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + string usageIntro = build 12-Sep-2018 15:30:24 + "Read sequentially all the BDFs of an ASDM dataset without any processing. " build 12-Sep-2018 15:30:24 + "It's just an application to measure the time reading the BDFs by using the class SDMDataObjectStreamReader. \n" build 12-Sep-2018 15:30:24 + "Usage : " + appName +" asdm-directory number-of-threads \n\n" build 12-Sep-2018 15:30:24 + "Command parameters: \n"; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Descriptor elements are: OptionIndex, OptionType, shortopt, longopt, check_arg, help build 12-Sep-2018 15:30:24 + option::Descriptor usage[] = { build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, usageIntro.c_str()}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, " \tasdm-directory : \tthe pathname to the ASDM dataset containing the BFDs to be read."}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, " \tnumber-of-threads : \tthe number of threads to be launched in parallel (> 0)."}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, "\nAllowed options:\n"}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, 0 }, // helps with formatting build 12-Sep-2018 15:30:24 + // help is the only visible option build 12-Sep-2018 15:30:24 + { HELP, 0, "", "help", AlmaArg::None, " --help \tproduces help message."}, build 12-Sep-2018 15:30:24 + // Hidden options, will be allowed both on command line and build 12-Sep-2018 15:30:24 + // in config file, but will not be shown to the user. build 12-Sep-2018 15:30:24 + { ASDMDIR, 0, "", "asdm-directory", AlmaArg::Required, 0}, build 12-Sep-2018 15:30:24 + { NUMTHREAD, 0, "", "number-of-threads", AlmaArg::uInt, "number of threads"}, build 12-Sep-2018 15:30:24 + { 0, 0, 0, 0, 0, 0} }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - po::notify(vm); build 12-Sep-2018 15:30:24 + // Set default value for number-of-threads build 12-Sep-2018 15:30:24 + const char *defaults[] = { "--number-of-threads=2", build 12-Sep-2018 15:30:24 + (const char *)-1}; build 12-Sep-2018 15:30:24 + int defaultCount = 1; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Parse the defaults and the command line build 12-Sep-2018 15:30:24 + // establish sizes build 12-Sep-2018 15:30:24 + option::Stats stats; build 12-Sep-2018 15:30:24 + stats.add(true, usage, defaultCount, defaults); build 12-Sep-2018 15:30:24 + stats.add(true, usage, argc, argv); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // size the buffers to hold the parsed options build 12-Sep-2018 15:30:24 + option::Option options[stats.options_max], buffer[stats.buffer_max]; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // and parse things build 12-Sep-2018 15:30:24 + option::Parser parse; build 12-Sep-2018 15:30:24 + parse.parse(true, usage, defaultCount, defaults, options, buffer); build 12-Sep-2018 15:30:24 + parse.parse(true, usage, argc, argv, options, buffer); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (parse.error()) { build 12-Sep-2018 15:30:24 + cerr << "Problem parsing the command line arguments" << endl; build 12-Sep-2018 15:30:24 + exit(1); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("asdm-directory")) { build 12-Sep-2018 15:30:24 - dsName = vm["asdm-directory"].as< string >(); build 12-Sep-2018 15:30:24 - cout << "dsName = " << dsName << endl; build 12-Sep-2018 15:30:24 - boost::algorithm::trim(dsName); build 12-Sep-2018 15:30:24 - if (boost::algorithm::ends_with(dsName,"/")) dsName.erase(dsName.size()-1); build 12-Sep-2018 15:30:24 + if (options[HELP] || (argc==0)) { build 12-Sep-2018 15:30:24 + option::printUsage(cout, usage, 80); build 12-Sep-2018 15:30:24 + exit(1); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - cout << generic << endl; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 0 || options[ASDMDIR]) { build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 0) { build 12-Sep-2018 15:30:24 + dsName = string(parse.nonOption(0)); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + dsName = string(options[ASDMDIR].last()->arg); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + cout << "dsName = " << dsName << endl; build 12-Sep-2018 15:30:24 + trim(dsName); build 12-Sep-2018 15:30:24 + if (dsName.back()=='/') dsName.pop_back(); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + option::printUsage(cout, usage, 80); build 12-Sep-2018 15:30:24 exit (1); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // get NUMTHREAD build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 1) { build 12-Sep-2018 15:30:24 + unsigned long ulval; build 12-Sep-2018 15:30:24 + char *endptr = 0; build 12-Sep-2018 15:30:24 + ulval = strtoul(parse.nonOption(1), &endptr, 10); build 12-Sep-2018 15:30:24 + if (*endptr == 0 and ulval <= UINT_MAX) { build 12-Sep-2018 15:30:24 + // value is OK to use, no conversion problems build 12-Sep-2018 15:30:24 + nThreads = (unsigned int)ulval; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + cerr << "number-of-threads must be an unsigned integer" << endl; build 12-Sep-2018 15:30:24 + exit(1); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // from NUMTHREAD, which is always set because of defaults build 12-Sep-2018 15:30:24 + // and also known to be a valid unsigned integer build 12-Sep-2018 15:30:24 + stringstream str(options[NUMTHREAD].last()->arg); build 12-Sep-2018 15:30:24 + str >> nThreads; build 12-Sep-2018 15:30:24 + if (!str) { build 12-Sep-2018 15:30:24 + // very unlikely build 12-Sep-2018 15:30:24 + cerr << "There was an error converting the number-of-threads value to an unsigned integer" << endl; build 12-Sep-2018 15:30:24 + exit(1); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 catch (std::exception& e) { build 12-Sep-2018 15:30:24 cout << e.what() << endl; build 12-Sep-2018 15:30:24 @@ -142,7 +182,10 @@ int main ( int argc, char * argv[] ) { build 12-Sep-2018 15:30:24 vector bdfNames; build 12-Sep-2018 15:30:24 for ( vector::const_iterator iter_v = v.begin(); iter_v != v.end(); iter_v++) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - string abspath = complete(path(dsName)).string() + "/ASDMBinary/" + replace_all_copy(replace_all_copy((*iter_v)->getDataUID().getEntityId().toString(), ":", "_"), "/", "_"); build 12-Sep-2018 15:30:24 + string dataUID = (*iter_v)->getDataUID().getEntityId().toString(); build 12-Sep-2018 15:30:24 + replace(dataUID.begin(),dataUID.end(),':','_'); build 12-Sep-2018 15:30:24 + replace(dataUID.begin(),dataUID.end(),'/','_'); build 12-Sep-2018 15:30:24 + string abspath = casacore::Path(dsName + "/ASDMBinary/" + dataUID).absoluteName(); build 12-Sep-2018 15:30:24 cout << abspath << endl; build 12-Sep-2018 15:30:24 bdfNames.push_back(abspath); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/ASDMBinaries/test/tReadSeqBDFs.cc b/code/alma/ASDMBinaries/test/tReadSeqBDFs.cc build 12-Sep-2018 15:30:24 index 7bfe9c8..f2c9e21 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/ASDMBinaries/test/tReadSeqBDFs.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/ASDMBinaries/test/tReadSeqBDFs.cc build 12-Sep-2018 15:30:24 @@ -7,27 +7,14 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -namespace po = boost::program_options; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost::filesystem; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost::lambda; build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +using namespace alma; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "SDMBinData.h" build 12-Sep-2018 15:30:24 using namespace sdmbin; build 12-Sep-2018 15:30:24 @@ -41,6 +28,8 @@ using namespace asdm; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "asdmstman/AsdmStMan.h" build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void scanBDF(const string & pathToBDF) { build 12-Sep-2018 15:30:24 SDMDataObjectStreamReader sdosr; build 12-Sep-2018 15:30:24 @@ -48,11 +37,13 @@ void scanBDF(const string & pathToBDF) { build 12-Sep-2018 15:30:24 sdosr.open(pathToBDF); build 12-Sep-2018 15:30:24 ProcessorType processorType = sdosr.processorType(); build 12-Sep-2018 15:30:24 if (processorType == RADIOMETER) { build 12-Sep-2018 15:30:24 - const SDMDataSubset& sdmDataSubset = sdosr.getSubset(); build 12-Sep-2018 15:30:24 + // returned SDMDataSubset value is not used, ok to ignore build 12-Sep-2018 15:30:24 + sdosr.getSubset(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else if (processorType == CORRELATOR) { build 12-Sep-2018 15:30:24 while (sdosr.hasSubset()) { build 12-Sep-2018 15:30:24 - const SDMDataSubset& sdmDataSubset = sdosr.getSubset(); build 12-Sep-2018 15:30:24 + // returned SDMDataSubset value is not used, ok to ignore build 12-Sep-2018 15:30:24 + sdosr.getSubset(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 @@ -66,47 +57,67 @@ int main ( int argc, char * argv[] ) { build 12-Sep-2018 15:30:24 string dsName; build 12-Sep-2018 15:30:24 string appName = string(argv[0]); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - po::variables_map vm; build 12-Sep-2018 15:30:24 + enum optionIndex { UNKNOWN, HELP, ASDMDIR}; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 try { build 12-Sep-2018 15:30:24 - // Declare the supported options. build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::options_description generic("Read sequentially all the BDFs of ASDM dataset without any processing. It's just an application to measure the time reading the BDFs by using the class SDMDataObjectStreamReader. \n" build 12-Sep-2018 15:30:24 - "Usage : " + appName +" asdm-directory \n\n" build 12-Sep-2018 15:30:24 - "Command parameters: \n" build 12-Sep-2018 15:30:24 - " asdm-directory : the pathname to the ASDM dataset containing the BFDs to be read. \n" build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - ".\n\n" build 12-Sep-2018 15:30:24 - "Allowed options:"); build 12-Sep-2018 15:30:24 - generic.add_options() build 12-Sep-2018 15:30:24 - ("help", "produces help message."); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Hidden options, will be allowed both on command line and build 12-Sep-2018 15:30:24 - // in config file, but will not be shown to the user. build 12-Sep-2018 15:30:24 - po::options_description hidden("Hidden options"); build 12-Sep-2018 15:30:24 - hidden.add_options() build 12-Sep-2018 15:30:24 - ("asdm-directory", po::value< string >(), "asdm directory") build 12-Sep-2018 15:30:24 - ; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::options_description cmdline_options; build 12-Sep-2018 15:30:24 - cmdline_options.add(generic).add(hidden); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::positional_options_description p; build 12-Sep-2018 15:30:24 - p.add("asdm-directory", 1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Parse the command line and retrieve the options and parameters. build 12-Sep-2018 15:30:24 - po::store(po::command_line_parser(argc, argv).options(cmdline_options).positional(p).run(), vm); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::notify(vm); build 12-Sep-2018 15:30:24 + // remove the program name build 12-Sep-2018 15:30:24 + argc--; build 12-Sep-2018 15:30:24 + argv++; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + string usageIntro = build 12-Sep-2018 15:30:24 + "Read sequentially all the BDFs of ASDM dataset without any processing. " build 12-Sep-2018 15:30:24 + "It's just an application to measure the time reading the BDFs by using the class SDMDataObjectStreamReader. \n" build 12-Sep-2018 15:30:24 + "Usage : " + appName +" asdm-directory \n\n" build 12-Sep-2018 15:30:24 + "Command parameters: \n"; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Descriptor elements are: OptionIndex, OptionType, shortopt, longopt, check_arg, help build 12-Sep-2018 15:30:24 + option::Descriptor usage[] = { build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, usageIntro.c_str()}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, " \tasdm-directory : \tthe pathname to the ASDM dataset containing the BFDs to be read."}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, "\nAllowed options:\n"}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, 0 }, // helps with formatting build 12-Sep-2018 15:30:24 + // help is the only visible option build 12-Sep-2018 15:30:24 + { HELP, 0, "", "help", AlmaArg::None, " --help \tproduces help message."}, build 12-Sep-2018 15:30:24 + // Hidden options, will be allowed both on command line and build 12-Sep-2018 15:30:24 + // in config file, but will not be shown to the user. build 12-Sep-2018 15:30:24 + { ASDMDIR, 0, "", "asdm-directory", AlmaArg::Required, 0}, build 12-Sep-2018 15:30:24 + { 0, 0, 0, 0, 0, 0} }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // there are no defaults build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // parse the command line build 12-Sep-2018 15:30:24 + // establish sizes build 12-Sep-2018 15:30:24 + option::Stats stats; build 12-Sep-2018 15:30:24 + stats.add(true, usage, argc, argv); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // size the buffers to hold the parsed options build 12-Sep-2018 15:30:24 + option::Option options[stats.options_max], buffer[stats.buffer_max]; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // and parse things build 12-Sep-2018 15:30:24 + option::Parser parse; build 12-Sep-2018 15:30:24 + parse.parse(true, usage, argc, argv, options, buffer); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (parse.error()) { build 12-Sep-2018 15:30:24 + cerr << "Problem parsing the command line arguments" << endl; build 12-Sep-2018 15:30:24 + exit(1); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("asdm-directory")) { build 12-Sep-2018 15:30:24 - dsName = vm["asdm-directory"].as< string >(); build 12-Sep-2018 15:30:24 - cout << "dsName = " << dsName << endl; build 12-Sep-2018 15:30:24 - boost::algorithm::trim(dsName); build 12-Sep-2018 15:30:24 - if (boost::algorithm::ends_with(dsName,"/")) dsName.erase(dsName.size()-1); build 12-Sep-2018 15:30:24 + if (options[HELP] || (argc==0)) { build 12-Sep-2018 15:30:24 + option::printUsage(cout, usage, 80); build 12-Sep-2018 15:30:24 + exit(1); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - cout << generic << endl; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 0 || options[ASDMDIR]) { build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 0) { build 12-Sep-2018 15:30:24 + dsName = string(parse.nonOption(0)); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + dsName = string(options[ASDMDIR].last()->arg); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + cout << "dsName = " << dsName << endl; build 12-Sep-2018 15:30:24 + trim(dsName); build 12-Sep-2018 15:30:24 + if (dsName.back()=='/') dsName.pop_back(); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + option::printUsage(cout, usage, 80); build 12-Sep-2018 15:30:24 exit (1); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -135,7 +146,10 @@ int main ( int argc, char * argv[] ) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 vector bdfNames; build 12-Sep-2018 15:30:24 for ( vector::const_iterator iter_v = v.begin(); iter_v != v.end(); iter_v++) { build 12-Sep-2018 15:30:24 - string abspath = complete(path(dsName)).string() + "/ASDMBinary/" + replace_all_copy(replace_all_copy((*iter_v)->getDataUID().getEntityId().toString(), ":", "_"), "/", "_"); build 12-Sep-2018 15:30:24 + string dataUID = (*iter_v)->getDataUID().getEntityId().toString(); build 12-Sep-2018 15:30:24 + replace(dataUID.begin(),dataUID.end(),':','_'); build 12-Sep-2018 15:30:24 + replace(dataUID.begin(),dataUID.end(),'/','_'); build 12-Sep-2018 15:30:24 + string abspath = casacore::Path(dsName + "/ASDMBinary/" + dataUID).absoluteName(); build 12-Sep-2018 15:30:24 cout << abspath << endl; build 12-Sep-2018 15:30:24 bdfNames.push_back(abspath); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/CMakeLists.txt b/code/alma/CMakeLists.txt build 12-Sep-2018 15:30:24 index 8d23553..8bc9eca 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/CMakeLists.txt build 12-Sep-2018 15:30:24 +++ b/code/alma/CMakeLists.txt build 12-Sep-2018 15:30:24 @@ -18,12 +18,11 @@ build 12-Sep-2018 15:30:24 # along with this program. If not, see . build 12-Sep-2018 15:30:24 # build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#add_definitions( -DWITHOUT_ACS -pg ) build 12-Sep-2018 15:30:24 #set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg" ) build 12-Sep-2018 15:30:24 #set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg" ) build 12-Sep-2018 15:30:24 #set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -pg" ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -add_definitions( -DWITHOUT_ACS ) build 12-Sep-2018 15:30:24 +add_definitions( -DWITHOUT_ACS -DWITHOUT_BOOST ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 casa_add_library( alma build 12-Sep-2018 15:30:24 ASDM/AlmaRadiometerRow.cc build 12-Sep-2018 15:30:24 @@ -706,6 +705,11 @@ install (FILES build 12-Sep-2018 15:30:24 DESTINATION include/casacode/alma/Enumtcl build 12-Sep-2018 15:30:24 ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +install (FILES build 12-Sep-2018 15:30:24 + Options/AlmaArg.h build 12-Sep-2018 15:30:24 + DESTINATION include/casacode/alma/Options build 12-Sep-2018 15:30:24 + ) build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 casa_add_executable( alma asdm2MS build 12-Sep-2018 15:30:24 apps/asdm2MS/asdm2MS.cc build 12-Sep-2018 15:30:24 apps/asdm2MS/ASDM2MSFiller.cc build 12-Sep-2018 15:30:24 @@ -715,8 +719,21 @@ casa_add_executable( alma asdm2MS build 12-Sep-2018 15:30:24 apps/asdm2MS/ASDMVerbatimFiller.cc build 12-Sep-2018 15:30:24 apps/asdm2MS/Name2Table.cc build 12-Sep-2018 15:30:24 apps/asdm2MS/UvwCoords.cc build 12-Sep-2018 15:30:24 + apps/asdm2MS/ScansParser.cc build 12-Sep-2018 15:30:24 ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +# casa_add_executable( alma parasdm2MS build 12-Sep-2018 15:30:24 +# apps/asdm2MS/parasdm2MS.cc build 12-Sep-2018 15:30:24 +# apps/asdm2MS/ASDM2MSFiller.cc build 12-Sep-2018 15:30:24 +# apps/asdm2MS/BDF2AsdmStManIndex.cc build 12-Sep-2018 15:30:24 +# apps/asdm2MS/ASDMTableBase.cc build 12-Sep-2018 15:30:24 +# apps/asdm2MS/ASDMTables.cc build 12-Sep-2018 15:30:24 +# apps/asdm2MS/ASDMVerbatimFiller.cc build 12-Sep-2018 15:30:24 +# apps/asdm2MS/Name2Table.cc build 12-Sep-2018 15:30:24 +# apps/asdm2MS/UvwCoords.cc build 12-Sep-2018 15:30:24 +# apps/asdm2MS/ScansParser.cc build 12-Sep-2018 15:30:24 +# ) build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 casa_add_executable( alma MS2asdm build 12-Sep-2018 15:30:24 apps/MS2asdm/MS2asdm.cc build 12-Sep-2018 15:30:24 ) build 12-Sep-2018 15:30:24 @@ -727,19 +744,9 @@ casa_add_executable( alma asdmSummary build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 casa_add_executable( alma bdflags2MS build 12-Sep-2018 15:30:24 apps/asdm2MS/bdflags2MS.cc build 12-Sep-2018 15:30:24 + apps/asdm2MS/ScansParser.cc build 12-Sep-2018 15:30:24 ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#casa_add_executable( alma parasdm2MS build 12-Sep-2018 15:30:24 -# apps/asdm2MS/parasdm2MS.cc build 12-Sep-2018 15:30:24 -# apps/asdm2MS/ASDM2MSFiller.cc build 12-Sep-2018 15:30:24 -# apps/asdm2MS/BDF2AsdmStManIndex.cc build 12-Sep-2018 15:30:24 -# apps/asdm2MS/ASDMTableBase.cc build 12-Sep-2018 15:30:24 -# apps/asdm2MS/ASDMTables.cc build 12-Sep-2018 15:30:24 -# apps/asdm2MS/ASDMVerbatimFiller.cc build 12-Sep-2018 15:30:24 -# apps/asdm2MS/Name2Table.cc build 12-Sep-2018 15:30:24 -# apps/asdm2MS/UvwCoords.cc build 12-Sep-2018 15:30:24 -# ) build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 casa_add_assay(alma ASDMBinaries/test/tReadBigBDF.cc) build 12-Sep-2018 15:30:24 casa_add_assay(alma ASDMBinaries/test/tReadAllBDFs.cc) build 12-Sep-2018 15:30:24 casa_add_assay(alma ASDM/test/tTableStreamReader.cc) build 12-Sep-2018 15:30:24 diff --git a/code/alma/Options/AlmaArg.h b/code/alma/Options/AlmaArg.h build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..cbeadb9 build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/alma/Options/AlmaArg.h build 12-Sep-2018 15:30:24 @@ -0,0 +1,100 @@ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#if !defined(ALMAARG_H) build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +namespace alma { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + using namespace asdm; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // extend the option::Arg struct to provide the necessary argument checking for the alma apps build 12-Sep-2018 15:30:24 + // for use with the optionparser suite build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + struct AlmaArg: public option::Arg build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + static void printError(const char* msg1, const option::Option& opt, const char* msg2) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + std::cerr << msg1 << std::string(opt.name,opt.namelen) << msg2 << std::endl; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // unknown argument build 12-Sep-2018 15:30:24 + static option::ArgStatus Unknown(const option::Option& option, bool msg) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (msg) printError("Unknown option '", option, "'\n"); build 12-Sep-2018 15:30:24 + return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // an associated value is required opt=arg, no constraints on type build 12-Sep-2018 15:30:24 + static option::ArgStatus Required(const option::Option& option, bool msg) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (option.arg != 0) build 12-Sep-2018 15:30:24 + return option::ARG_OK; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (msg) printError("Option '", option, "' requires an argument\n"); build 12-Sep-2018 15:30:24 + return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // an associated value is required and must be an a long integer build 12-Sep-2018 15:30:24 + static option::ArgStatus Long(const option::Option& option, bool msg) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + char* endptr = 0; build 12-Sep-2018 15:30:24 + if (option.arg != 0 && strtol(option.arg, &endptr, 10)){}; build 12-Sep-2018 15:30:24 + if (endptr != option.arg && *endptr == 0) build 12-Sep-2018 15:30:24 + return option::ARG_OK; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (msg) printError("Option '", option, "' requires a long integer argument\n"); build 12-Sep-2018 15:30:24 + return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // an associated value is required and must be an unsigned int build 12-Sep-2018 15:30:24 + static option::ArgStatus uInt(const option::Option& option, bool msg) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + char* endptr = 0; build 12-Sep-2018 15:30:24 + unsigned long ulval = 0; build 12-Sep-2018 15:30:24 + // uses strtoul, but must also check that converted value would fit in an unsigned int build 12-Sep-2018 15:30:24 + if (option.arg != 0 && (ulval=strtoul(option.arg, &endptr, 10))){}; build 12-Sep-2018 15:30:24 + if (endptr != option.arg && *endptr == 0 && ulval <= UINT_MAX) build 12-Sep-2018 15:30:24 + return option::ARG_OK; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (msg) printError("Option '", option, "' requires an unsigned integer argument\n"); build 12-Sep-2018 15:30:24 + return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // an associated value is required and must be a valid floating point (double) build 12-Sep-2018 15:30:24 + static option::ArgStatus Float(const option::Option& option, bool msg) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + char* endptr = 0; build 12-Sep-2018 15:30:24 + if (option.arg != 0 && strtod(option.arg, &endptr)){}; build 12-Sep-2018 15:30:24 + if (endptr != option.arg && *endptr == 0) build 12-Sep-2018 15:30:24 + return option::ARG_OK; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (msg) printError("Option '", option, "' requires a floating point argument\n"); build 12-Sep-2018 15:30:24 + return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // an associated value is required and must be either "true" or "false" build 12-Sep-2018 15:30:24 + // ignores case build 12-Sep-2018 15:30:24 + static option::ArgStatus Bool(const option::Option& option, bool msg) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (option.arg != 0) { build 12-Sep-2018 15:30:24 + std::string argVal(option.arg); build 12-Sep-2018 15:30:24 + trim(argVal); build 12-Sep-2018 15:30:24 + argVal = str_tolower(argVal); build 12-Sep-2018 15:30:24 + if (argVal == "true" || argVal == "false") build 12-Sep-2018 15:30:24 + return option::ARG_OK; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (msg) printError("Option '", option, "' requires a value of 'true' or 'false'\n"); build 12-Sep-2018 15:30:24 + return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#define ALMAARG_H build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 diff --git a/code/alma/apps/MS2asdm/MS2asdm.cc b/code/alma/apps/MS2asdm/MS2asdm.cc build 12-Sep-2018 15:30:24 index 22f2f9c..2f9a2df 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/apps/MS2asdm/MS2asdm.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/apps/MS2asdm/MS2asdm.cc build 12-Sep-2018 15:30:24 @@ -28,17 +28,11 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -namespace po = boost::program_options; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +using namespace alma; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -77,12 +71,13 @@ string lrtrim(std::string& s,const std::string& drop = " ") build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 /** build 12-Sep-2018 15:30:24 * The main function. build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + ostringstream errstream; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 String asdmfile = ""; build 12-Sep-2018 15:30:24 String msfile = ""; build 12-Sep-2018 15:30:24 String datacolumn = "DATA"; build 12-Sep-2018 15:30:24 @@ -90,103 +85,162 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 String rangeid = "X1"; build 12-Sep-2018 15:30:24 bool verbose = false; build 12-Sep-2018 15:30:24 bool showversion = false; build 12-Sep-2018 15:30:24 + // these two defaults must also appear in the defaults array below build 12-Sep-2018 15:30:24 double subscanduration = 24.*3600.; // default is one day build 12-Sep-2018 15:30:24 double schedblockduration = 2700.; // default is 45 minutes build 12-Sep-2018 15:30:24 bool apcorrected = true; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - boost::filesystem::path msPath; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 appName = string(argv[0]); build 12-Sep-2018 15:30:24 ofstream ofs; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Process command line options and parameters. build 12-Sep-2018 15:30:24 - po::variables_map vm; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + enum optionIndex { UNKNOWN, HELP, DATACOLUMN, ARCHIVEID, RANGEID, SUBSCANDUR, build 12-Sep-2018 15:30:24 + SCHEDBLOCKDUR, LOGFILE, APUNCORR, VERBOSE, REVISION, MSDIR, ASDMDIR }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Declare the supported options. build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::options_description generic("Converts an ASDM dataset into a CASA measurement set.\n" build 12-Sep-2018 15:30:24 - "Usage : " + appName +" [options] ms-directory asdm-directory\n\n" build 12-Sep-2018 15:30:24 - "Allowed options:"); build 12-Sep-2018 15:30:24 - generic.add_options() build 12-Sep-2018 15:30:24 - ("datacolumn,d", po::value(), "specifies the datacolumn.") build 12-Sep-2018 15:30:24 - ("archiveid,a", po::value(), "specifies the log filename. If the option is not used then the logged informations are written to the standard error stream.") build 12-Sep-2018 15:30:24 - ("rangeid,g", po::value(), "specifies the log filename. If the option is not used then the logged informations are written to the standard error stream.") build 12-Sep-2018 15:30:24 - ("subscanduration,s", po::value(), "specifies the maximum duration of a subscan in the output ASDM (seconds). Default: 86400") build 12-Sep-2018 15:30:24 - ("schedblockduration,s", po::value(), "specifies the maximum duration of a scheduling block in the output ASDM (seconds). Default: 2700") build 12-Sep-2018 15:30:24 - ("logfile,l", po::value(), "specifies the log filename. If the option is not used then the logged informations are written to the standard error stream.") build 12-Sep-2018 15:30:24 - ("apuncorrected,u", "the data given by datacolumn should be regarded as not having an atmospheric phase correction. Default: data is AP corrected.") build 12-Sep-2018 15:30:24 - ("verbose,v", "logs numerous informations as the filler is working.") build 12-Sep-2018 15:30:24 - ("revision,r", "logs information about the revision of this application."); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Hidden options, will be allowed both on command line and build 12-Sep-2018 15:30:24 - // in config file, but will not be shown to the user. build 12-Sep-2018 15:30:24 - po::options_description hidden("Hidden options"); build 12-Sep-2018 15:30:24 - hidden.add_options() build 12-Sep-2018 15:30:24 - ("ms-directory", po::value< string >(), "ms directory") build 12-Sep-2018 15:30:24 - ; build 12-Sep-2018 15:30:24 - hidden.add_options() build 12-Sep-2018 15:30:24 - ("asdm-directory", po::value< string >(), "asdm directory") build 12-Sep-2018 15:30:24 - ; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::options_description cmdline_options; build 12-Sep-2018 15:30:24 - cmdline_options.add(generic).add(hidden); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::positional_options_description p; build 12-Sep-2018 15:30:24 - p.add("ms-directory", 1); build 12-Sep-2018 15:30:24 - p.add("asdm-directory", 1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Parse the command line and retrieve the options and parameters. build 12-Sep-2018 15:30:24 - po::store(po::command_line_parser(argc, argv).options(cmdline_options).positional(p).run(), vm); build 12-Sep-2018 15:30:24 + // remove the program name build 12-Sep-2018 15:30:24 + argc--; build 12-Sep-2018 15:30:24 + argv++; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + string usageIntro = build 12-Sep-2018 15:30:24 + "Converts an ASDM dataset into a CASA measurement set.\n" build 12-Sep-2018 15:30:24 + "Usage : " + appName +" [options] ms-directory asdm-directory\n\n" build 12-Sep-2018 15:30:24 + "Command parameters: \n"; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Descriptor elements are: OptionIndex, OptionType, shortopt, longopt, check_arg, help build 12-Sep-2018 15:30:24 + option::Descriptor usage[] = { build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, usageIntro.c_str()}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, " \tms-directory : \tms directory"}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, " \tasdm-directory : \tasdm directory"}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, "\nAllowed options:\n"}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, 0}, // helps with formatting build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // these are the non-positional options build 12-Sep-2018 15:30:24 + { HELP, 0, "", "help", AlmaArg::None, " --help \tproduces this help message."}, build 12-Sep-2018 15:30:24 + { DATACOLUMN, 0, "d", "datacolumn", AlmaArg::Required, " -d [--datacolumn] arg (=DATA) \tspecifies the datacolumn."}, build 12-Sep-2018 15:30:24 + { ARCHIVEID, 0, "a", "archiveid", AlmaArg::Required, " -a [--archiveid] arg (=S0) \tspecifies the archive ID."}, build 12-Sep-2018 15:30:24 + { RANGEID, 0, "g", "rangeid", AlmaArg::Required, " -g [--rangeid] arg (=X1) \tspecifies the range ID."}, build 12-Sep-2018 15:30:24 + { SUBSCANDUR, 0, "s", "subscanduration", AlmaArg::Float, " -s [--subscanduration] arg (=86400) \tspecifies the maximum duration of a subscan in the output ASDM (seconds). Default: 86400"}, build 12-Sep-2018 15:30:24 + { SCHEDBLOCKDUR, 0, "", "schedblockduration", AlmaArg::Float, " --schedblockduration arg (=2700) \tspecifies the maximum duration of a scheduling block in the output ASDM (seconds). Default: 2700"}, build 12-Sep-2018 15:30:24 + { LOGFILE, 0, "l", "logfile", AlmaArg::Required, " -l [--logfile] arg \tspecifies the log filename. If the option is not used then the logged informations are written to the standard error stream."}, build 12-Sep-2018 15:30:24 + { APUNCORR, 0, "u", "apuncorrected", AlmaArg::None, " -u [--apuncorrected] \tthe data given by datacolumn should be regarded as not having an atmospheric phase correction. Default: data is AP corrected."}, build 12-Sep-2018 15:30:24 + { VERBOSE, 0, "v", "verbose", AlmaArg::None, " -v [--verbose] \tlogs numerous informations as the filler is working."}, build 12-Sep-2018 15:30:24 + { REVISION, 0, "r", "revision", AlmaArg::None, " -r [--revision] \tlogs information about the revision of this application."}, build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // hidden options, allowed on the command line but do not show up in help. build 12-Sep-2018 15:30:24 + // the positional options take precendence build 12-Sep-2018 15:30:24 + { MSDIR, 0, "", "ms-directory", AlmaArg::Required, 0}, build 12-Sep-2018 15:30:24 + { ASDMDIR, 0, "", "asdm-directory", AlmaArg::Required, 0}, build 12-Sep-2018 15:30:24 + { 0, 0, 0, 0, 0, 0} }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - po::notify(vm); build 12-Sep-2018 15:30:24 + // Defaults are set by parsing an argv-like set of options where the values are the defaults build 12-Sep-2018 15:30:24 + const char *defaults[] = { "--subscanduration=86400", build 12-Sep-2018 15:30:24 + "--schedblockduration=2700", build 12-Sep-2018 15:30:24 + (const char *)-1}; // unambiguously signal the end build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // count defaults, more robust than setting a value here that must be changed when defaults changes build 12-Sep-2018 15:30:24 + int defaultCount = 0; build 12-Sep-2018 15:30:24 + while (defaults[defaultCount] != (const char *) -1) ++defaultCount; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // parse defaults, argv build 12-Sep-2018 15:30:24 + // establish sizes build 12-Sep-2018 15:30:24 + option::Stats stats; build 12-Sep-2018 15:30:24 + // true here turns on re-ordering of args so that positional argument are always seen last build 12-Sep-2018 15:30:24 + stats.add(true, usage, defaultCount, defaults); build 12-Sep-2018 15:30:24 + stats.add(true, usage, argc, argv); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // buffers to hold the parsed options build 12-Sep-2018 15:30:24 + // options has one element per optionIndex, last value is the last time it was set build 12-Sep-2018 15:30:24 + // buffer has one element for each option encountered, in order. Not used here. build 12-Sep-2018 15:30:24 + option::Option options[stats.options_max], buffer[stats.buffer_max]; build 12-Sep-2018 15:30:24 + option::Parser parse; build 12-Sep-2018 15:30:24 + // parse the defaults first, then argv. User set options always come last build 12-Sep-2018 15:30:24 + // true here has same meaning as in stats above. This may not be necessary here, I think build 12-Sep-2018 15:30:24 + // the stats usage above has already reorderded argv in place. build 12-Sep-2018 15:30:24 + parse.parse(true, usage, defaultCount, defaults, options, buffer); build 12-Sep-2018 15:30:24 + parse.parse(true, usage, argc, argv, options, buffer); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (parse.error()) { build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + errstream << "Problem parsing the command line arguments"; build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Where do the log messages go ? build 12-Sep-2018 15:30:24 - if (vm.count("logfile")) { build 12-Sep-2018 15:30:24 - //LogSinkInterface *theSink; build 12-Sep-2018 15:30:24 - ofs.open(vm["logfile"].as().c_str(), ios_base::app); build 12-Sep-2018 15:30:24 + if (options[LOGFILE] != NULL && options[LOGFILE].last()->arg != NULL) { build 12-Sep-2018 15:30:24 + ofs.open(options[LOGFILE].last()->arg, ios_base::app); build 12-Sep-2018 15:30:24 LogSinkInterface *theSink = new casacore::StreamLogSink(&ofs); build 12-Sep-2018 15:30:24 LogSink::globalSink(theSink); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (options[HELP] || (argc==0)) { build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + option::printUsage(errstream, usage, 80); build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // AP corrected? build 12-Sep-2018 15:30:24 - apcorrected = !(vm.count("apuncorrected") > 0); build 12-Sep-2018 15:30:24 + // AP corrected will be true unless APUNCORR has been set build 12-Sep-2018 15:30:24 + apcorrected = (options[APUNCORR]==NULL); build 12-Sep-2018 15:30:24 // Verbose or quiet ? build 12-Sep-2018 15:30:24 - verbose = vm.count("verbose") > 0; build 12-Sep-2018 15:30:24 + verbose = (options[VERBOSE]!=NULL); build 12-Sep-2018 15:30:24 // showversion ? build 12-Sep-2018 15:30:24 - showversion = vm.count("revision") > 0; build 12-Sep-2018 15:30:24 + showversion = (options[REVISION]!=NULL); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("datacolumn")) { build 12-Sep-2018 15:30:24 - datacolumn = String(vm["datacolumn"].as< string >()); build 12-Sep-2018 15:30:24 + if (options[DATACOLUMN] != NULL && options[DATACOLUMN].last()->arg != NULL) { build 12-Sep-2018 15:30:24 + datacolumn = String(options[DATACOLUMN].last()->arg); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("archiveid")) { build 12-Sep-2018 15:30:24 - archiveid = String(vm["archiveid"].as< string >()); build 12-Sep-2018 15:30:24 + if (options[ARCHIVEID] != NULL && options[ARCHIVEID].last()->arg != NULL) { build 12-Sep-2018 15:30:24 + archiveid = String(options[ARCHIVEID].last()->arg); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("rangeid")) { build 12-Sep-2018 15:30:24 - msfile = String(vm["rangeid"].as< string >()); build 12-Sep-2018 15:30:24 + if (options[RANGEID] != NULL && options[RANGEID].last()->arg != NULL) { build 12-Sep-2018 15:30:24 + msfile = String(options[RANGEID].last()->arg); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("subscanduration")) { build 12-Sep-2018 15:30:24 - subscanduration = vm["subscanduration"].as< double >(); build 12-Sep-2018 15:30:24 + // this always has a value because of defaults build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + stringstream str(options[SUBSCANDUR].last()->arg); build 12-Sep-2018 15:30:24 + str >> subscanduration; build 12-Sep-2018 15:30:24 + if (!str) { build 12-Sep-2018 15:30:24 + // unlikely given that any value was already checked by AlmaArg::Float build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + errstream << "There was an error converting the subscanduration value to a double"; build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("schedblockduration")) { build 12-Sep-2018 15:30:24 - schedblockduration = vm["schedblockduration"].as< double >(); build 12-Sep-2018 15:30:24 + // this always has a value because of defaults build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + stringstream str(options[SCHEDBLOCKDUR].last()->arg); build 12-Sep-2018 15:30:24 + str >> schedblockduration; build 12-Sep-2018 15:30:24 + if (!str) { build 12-Sep-2018 15:30:24 + // unlikely given that any value was already checked by AlmaArg::Float build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + errstream << "There was an error converting the schedblockduration value to a double"; build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("ms-directory")) { build 12-Sep-2018 15:30:24 - msfile = String(vm["ms-directory"].as< string >()); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else if(!showversion){ build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 0 || options[MSDIR]) { build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 0) { build 12-Sep-2018 15:30:24 + msfile = String(parse.nonOption(0)); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // MSDIR must have been set build 12-Sep-2018 15:30:24 + msfile = String(options[MSDIR].last()->arg); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } else if (!showversion) { build 12-Sep-2018 15:30:24 error("Error: Need to provide name of input Measurement Set."); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("asdm-directory")) { build 12-Sep-2018 15:30:24 - asdmfile = String(vm["asdm-directory"].as< string >()); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else if(!showversion){ build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 1 || options[ASDMDIR]) { build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 1) { build 12-Sep-2018 15:30:24 + asdmfile = String(parse.nonOption(1)); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // ASDMDIR must have been set build 12-Sep-2018 15:30:24 + asdmfile = String(options[ASDMDIR].last()->arg); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } else if(!showversion){ build 12-Sep-2018 15:30:24 error("Error: Need to provide name of output ASDM."); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/alma/apps/asdm2MS/AnyValueMap.hpp b/code/alma/apps/asdm2MS/AnyValueMap.hpp build 12-Sep-2018 15:30:24 index dbee664..d309e57 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/apps/asdm2MS/AnyValueMap.hpp build 12-Sep-2018 15:30:24 +++ b/code/alma/apps/asdm2MS/AnyValueMap.hpp build 12-Sep-2018 15:30:24 @@ -5,12 +5,17 @@ build 12-Sep-2018 15:30:24 * Author: alvaro build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +// Only used by parasdm2MS, could possibly be replaced by a casacore::Record? build 12-Sep-2018 15:30:24 +// boost::any is in c++17 build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 #ifndef ANYVALUEMAP_HPP_ build 12-Sep-2018 15:30:24 #define ANYVALUEMAP_HPP_ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +// only used by build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 using namespace std; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 template build 12-Sep-2018 15:30:24 diff --git a/code/alma/apps/asdm2MS/Name2Table.cc b/code/alma/apps/asdm2MS/Name2Table.cc build 12-Sep-2018 15:30:24 index 247781a..303e77d 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/apps/asdm2MS/Name2Table.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/apps/asdm2MS/Name2Table.cc build 12-Sep-2018 15:30:24 @@ -32,18 +32,18 @@ build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 #include "ASDMTables.h" build 12-Sep-2018 15:30:24 #include "Name2Table.h" build 12-Sep-2018 15:30:24 -#include "boost/regex.hpp" build 12-Sep-2018 15:30:24 -#include "boost/tokenizer.hpp" build 12-Sep-2018 15:30:24 -#include "boost/algorithm/string.hpp" build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 using namespace std; build 12-Sep-2018 15:30:24 using namespace casacore; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -typedef tokenizer > my_tok; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 map Name2Table::name2Table_; build 12-Sep-2018 15:30:24 bool Name2Table::init_ = Name2Table::init(); build 12-Sep-2018 15:30:24 set Name2Table::table_; build 12-Sep-2018 15:30:24 @@ -198,29 +198,34 @@ const set& Name2Table::find (const vector& name, bool build 12-Sep-2018 15:30:24 table_.clear(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Process each string given as input build 12-Sep-2018 15:30:24 - string wildcard = "*"; build 12-Sep-2018 15:30:24 for (unsigned int i = 0; i < name.size(); i++) { build 12-Sep-2018 15:30:24 // Replace any possible wildcard (*) by a sequences '(.)*' build 12-Sep-2018 15:30:24 - string name_ = name.at(i); build 12-Sep-2018 15:30:24 - char_separator sep("*", "", boost::keep_empty_tokens); build 12-Sep-2018 15:30:24 - my_tok tokens(name_, sep); build 12-Sep-2018 15:30:24 + stringstream ss(name.at(i)); build 12-Sep-2018 15:30:24 + string token; build 12-Sep-2018 15:30:24 + bool first = true; build 12-Sep-2018 15:30:24 ostringstream oss; build 12-Sep-2018 15:30:24 - my_tok::iterator tok_iter = tokens.begin(); build 12-Sep-2018 15:30:24 - oss << *tok_iter ; build 12-Sep-2018 15:30:24 - ++tok_iter; build 12-Sep-2018 15:30:24 - for (; tok_iter != tokens.end(); ++tok_iter) build 12-Sep-2018 15:30:24 - oss << "(.)*" << *tok_iter ; build 12-Sep-2018 15:30:24 + while (getline(ss,token,'*')) { build 12-Sep-2018 15:30:24 + if (!first) { build 12-Sep-2018 15:30:24 + oss << "(.)*"; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + first = false; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + oss << token; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + // watch for a trailing wildcard, will be missed by the above build 12-Sep-2018 15:30:24 + if (name.back()=='*') oss << "(.)*"; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Build a boost regexp out of this string written onto oss. build 12-Sep-2018 15:30:24 - regex expression(oss.str().c_str()); build 12-Sep-2018 15:30:24 + // Build a regexp out of this string written onto oss. build 12-Sep-2018 15:30:24 + std::regex expression(oss.str().c_str()); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // For each table name build 12-Sep-2018 15:30:24 for (map::const_iterator iter = name2Table_.begin(); build 12-Sep-2018 15:30:24 iter!= name2Table_.end(); iter++) { build 12-Sep-2018 15:30:24 // Is there a match between the string and the name of the table ? build 12-Sep-2018 15:30:24 - cmatch what; build 12-Sep-2018 15:30:24 - if(regex_match(iter->first.c_str(), what, expression)) { build 12-Sep-2018 15:30:24 - string uppername = iter->first; to_upper(uppername); build 12-Sep-2018 15:30:24 + std::cmatch what; build 12-Sep-2018 15:30:24 + if(std::regex_match(iter->first.c_str(), what, expression)) { build 12-Sep-2018 15:30:24 + string uppername = iter->first; build 12-Sep-2018 15:30:24 + std::transform(uppername.begin(),uppername.end(), uppername.begin(), [](unsigned char c) { return std::toupper(c);}); build 12-Sep-2018 15:30:24 if (verbose) { build 12-Sep-2018 15:30:24 infostream.str(""); build 12-Sep-2018 15:30:24 infostream << "An ASDM_" << uppername << " table will be added to the MS" << endl; build 12-Sep-2018 15:30:24 diff --git a/code/alma/apps/asdm2MS/ScansParser.cc b/code/alma/apps/asdm2MS/ScansParser.cc build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..2c50c71 build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/alma/apps/asdm2MS/ScansParser.cc build 12-Sep-2018 15:30:24 @@ -0,0 +1,140 @@ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include "ScansParser.h" build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +using namespace std; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include "Misc.h" // asdm::trim_copy comes from here build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +int strToInt(const string& valStr, int &status) { build 12-Sep-2018 15:30:24 + // strip any leading and trailing whitespace. build 12-Sep-2018 15:30:24 + string numStr = asdm::trim_copy(valStr); build 12-Sep-2018 15:30:24 + int result = -1; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // and empty string is a problem build 12-Sep-2018 15:30:24 + if (numStr.size() == 0) { build 12-Sep-2018 15:30:24 + status = 0; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // make sure it really is just digits build 12-Sep-2018 15:30:24 + if (numStr.find_first_not_of("0123456789") == string::npos) { build 12-Sep-2018 15:30:24 + // and just convert it build 12-Sep-2018 15:30:24 + result = atoi(numStr.c_str()); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // not allowed build 12-Sep-2018 15:30:24 + status = 0; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + return result; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +// returns 1 on success, 0 on failure. Adds the scan range to scanSet build 12-Sep-2018 15:30:24 +int parseScanRange(const string& scanRange, set &scanSet) { build 12-Sep-2018 15:30:24 + int status = 1; build 12-Sep-2018 15:30:24 + // does it have a tilde build 12-Sep-2018 15:30:24 + size_t tilPos = scanRange.find("~"); build 12-Sep-2018 15:30:24 + if (tilPos == 0) { build 12-Sep-2018 15:30:24 + // that's a problem build 12-Sep-2018 15:30:24 + status = 0; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + int scanNumber0, scanNumber1; build 12-Sep-2018 15:30:24 + scanNumber0 = scanNumber1 = -1; build 12-Sep-2018 15:30:24 + if (tilPos != string::npos) { build 12-Sep-2018 15:30:24 + scanNumber0 = strToInt(scanRange.substr(0,tilPos),status); build 12-Sep-2018 15:30:24 + if (status > 0) scanNumber1 = strToInt(scanRange.substr(tilPos+1),status); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + scanNumber0 = scanNumber1 = strToInt(scanRange,status); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (status > 0) { build 12-Sep-2018 15:30:24 + for (int i=scanNumber0;i<(scanNumber1+1);i++) { build 12-Sep-2018 15:30:24 + scanSet.insert(i); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return status; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +// returns 1 on success, 0 on failure. Always clears scanSet before setting in from the list. build 12-Sep-2018 15:30:24 +int parseScanList(const string& scanList, set& scanSet) { build 12-Sep-2018 15:30:24 + int status=1; build 12-Sep-2018 15:30:24 + scanSet.clear(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + string strippedScanList = asdm::trim_copy(scanList); build 12-Sep-2018 15:30:24 + // an empty list is OK here, empty scan set will be associated with the current EB number build 12-Sep-2018 15:30:24 + // so only do something if it has size build 12-Sep-2018 15:30:24 + if (strippedScanList.size() > 0) { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + size_t last=0; build 12-Sep-2018 15:30:24 + size_t next=0; build 12-Sep-2018 15:30:24 + while ((status>0) && (next = scanList.find(",",last)) != string::npos) { build 12-Sep-2018 15:30:24 + // this also inserts the range into scanSet build 12-Sep-2018 15:30:24 + status = parseScanRange(scanList.substr(last,(next-last)),scanSet); build 12-Sep-2018 15:30:24 + last = next+1; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (status>0) status = parseScanRange(scanList.substr(last),scanSet); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return status; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +// find the optional EB number and associated scan list from ebScan build 12-Sep-2018 15:30:24 +// Add the resulting scan set to ebScanMap, keyed on the EB number (-1 if no EB number) build 12-Sep-2018 15:30:24 +// returns 1 on success, 0 on failure build 12-Sep-2018 15:30:24 +int parseEBScan(const string &ebScan, map> &ebScanMap) { build 12-Sep-2018 15:30:24 + set scanSet; build 12-Sep-2018 15:30:24 + int status = 1; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // start from the generic build 12-Sep-2018 15:30:24 + int ebNumber = -1; build 12-Sep-2018 15:30:24 + string scanList = ""; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // is there a colon ? build 12-Sep-2018 15:30:24 + size_t colPos = ebScan.find(":"); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (colPos == 0) { build 12-Sep-2018 15:30:24 + // that's a problem build 12-Sep-2018 15:30:24 + status = 0; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + if (colPos != string::npos) { build 12-Sep-2018 15:30:24 + string ebString = ebScan.substr(0,colPos); build 12-Sep-2018 15:30:24 + ebNumber = strToInt(ebString,status); build 12-Sep-2018 15:30:24 + scanList = ebScan.substr(colPos+1); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + scanList = ebScan; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (status >0 ) { build 12-Sep-2018 15:30:24 + // parseScanList always clears scanSet before adding to it build 12-Sep-2018 15:30:24 + status = parseScanList(scanList, scanSet); build 12-Sep-2018 15:30:24 + if (status > 0) { build 12-Sep-2018 15:30:24 + ebScanMap[ebNumber].insert(scanSet.begin(),scanSet.end()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return status; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +// associates EB number with a set of scans using the scansOptionsValue build 12-Sep-2018 15:30:24 +// ebScanMap is always cleared before being set build 12-Sep-2018 15:30:24 +// returns 1 if OK and 0 if there was a problem parsing scansOptionsValue build 12-Sep-2018 15:30:24 +// ebScanMap will always be empty if the returned status is 0 build 12-Sep-2018 15:30:24 +int scansParser(const string &scansOptionValue, map> &ebScansMap) { build 12-Sep-2018 15:30:24 + int status = 1; // set to 0 on failure build 12-Sep-2018 15:30:24 + ebScansMap.clear(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // break up the string by semi-colon, parsing each piece in turn build 12-Sep-2018 15:30:24 + size_t last=0; build 12-Sep-2018 15:30:24 + size_t next=0; build 12-Sep-2018 15:30:24 + while ((status>0) && (next = scansOptionValue.find(";",last)) != string::npos) { build 12-Sep-2018 15:30:24 + status = parseEBScan(scansOptionValue.substr(last,(next-last)),ebScansMap); build 12-Sep-2018 15:30:24 + last = next+1; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (status>0) { build 12-Sep-2018 15:30:24 + status = parseEBScan(scansOptionValue.substr(last),ebScansMap); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (status<=0) { build 12-Sep-2018 15:30:24 + ebScansMap.clear(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return status; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 diff --git a/code/alma/apps/asdm2MS/ScansParser.h b/code/alma/apps/asdm2MS/ScansParser.h build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..934df55 build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/alma/apps/asdm2MS/ScansParser.h build 12-Sep-2018 15:30:24 @@ -0,0 +1,20 @@ build 12-Sep-2018 15:30:24 +// Boost grammer code to handle the scan selection argument to asdm2MS and bdflags2MS build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +// build 12-Sep-2018 15:30:24 +// A collection of declarations and functions used for the parsing of the 'scans' option. build 12-Sep-2018 15:30:24 +// build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#if !defined(ALMA_SCANSPARSER_H) build 12-Sep-2018 15:30:24 +#define ALMA_SCANSPARSER_H build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +// Parse the scans options string used by asdm2MS and bdflags2MS. build 12-Sep-2018 15:30:24 +// sets a map of scans set associated with Execution Block numbers using the scansOptionsValue build 12-Sep-2018 15:30:24 +// returns 1 on success and 0 on failure. build 12-Sep-2018 15:30:24 +// ebScansMap is always empty on failure build 12-Sep-2018 15:30:24 +int scansParser(const std::string &scansOptionValue, std::map > &ebScansMap); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 diff --git a/code/alma/apps/asdm2MS/asdm2MS.cc b/code/alma/apps/asdm2MS/asdm2MS.cc build 12-Sep-2018 15:30:24 index 0004482..010f157 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/apps/asdm2MS/asdm2MS.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/apps/asdm2MS/asdm2MS.cc build 12-Sep-2018 15:30:24 @@ -21,25 +21,17 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -namespace po = boost::program_options; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost::filesystem; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +using namespace alma; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "SDMBinData.h" build 12-Sep-2018 15:30:24 using namespace sdmbin; build 12-Sep-2018 15:30:24 @@ -59,8 +51,9 @@ using namespace casacore; build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 #include "CBasebandName.h" build 12-Sep-2018 15:30:24 #include "CCalibrationDevice.h" build 12-Sep-2018 15:30:24 using namespace CalibrationDeviceMod; build 12-Sep-2018 15:30:24 @@ -85,6 +78,8 @@ using namespace SubscanIntentMod; build 12-Sep-2018 15:30:24 #include "asdmstman/AsdmStMan.h" build 12-Sep-2018 15:30:24 #include "BDF2AsdmStManIndex.h" build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#include "ScansParser.h" build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 #include "ASDM2MSException.h" build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "time.h" /* */ build 12-Sep-2018 15:30:24 @@ -167,6 +162,8 @@ bool verbose = true; build 12-Sep-2018 15:30:24 bool isEVLA = false; build 12-Sep-2018 15:30:24 bool lazy = false; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +double au_m = Quantity(1.0, "AU").getValue("m"); // AU in meters build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 //LogIO os; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -189,6 +186,7 @@ void warning (const string& message) { build 12-Sep-2018 15:30:24 void error(const string& message, int status=1) { build 12-Sep-2018 15:30:24 LogSink::postGlobally(LogMessage(message, LogOrigin(appName,WHERE), LogMessage::NORMAL)); build 12-Sep-2018 15:30:24 //os << LogIO::POST; build 12-Sep-2018 15:30:24 + // cout << message << endl; build 12-Sep-2018 15:30:24 exit(status); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -239,7 +237,6 @@ string lrtrim(std::string& s,const std::string& drop = " ") build 12-Sep-2018 15:30:24 return r.erase(0,r.find_first_not_of(drop)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // These classes provide mappings from some ALMA Enumerations to their CASA counterparts. build 12-Sep-2018 15:30:24 class StokesMapper { build 12-Sep-2018 15:30:24 private : build 12-Sep-2018 15:30:24 @@ -862,79 +859,11 @@ EnumSet es_apc; build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 bool withCompression = false; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -// build 12-Sep-2018 15:30:24 +//s build 12-Sep-2018 15:30:24 // A function to determine if overTheTop is present in a given row of the Pointing table. build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 bool overTheTopExists(PointingRow* row) { return row->isOverTheTopExists(); } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -// build 12-Sep-2018 15:30:24 -// A collection of declarations and functions used for the parsing of the 'scans' option. build 12-Sep-2018 15:30:24 -// build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost::spirit::classic; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -vector eb_v; build 12-Sep-2018 15:30:24 -int allEbs = -1; build 12-Sep-2018 15:30:24 -int ebNumber = allEbs; build 12-Sep-2018 15:30:24 -int readEb = allEbs; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -set scan_s; build 12-Sep-2018 15:30:24 -int scanNumber0, scanNumber1; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -map > eb_scan_m; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/* build 12-Sep-2018 15:30:24 -** Inserts all the integer values in the range [scanNumber0, scanNumber1] in the set referred build 12-Sep-2018 15:30:24 -** to by the global variable scan_s. build 12-Sep-2018 15:30:24 -** The two parameters begin and end are not used and here only to comply with the Spirit parser's convention. build 12-Sep-2018 15:30:24 -** build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 -void fillScanSet(const char* , const char* ) { build 12-Sep-2018 15:30:24 - for (int i = scanNumber0; i < (scanNumber1+1); i++) build 12-Sep-2018 15:30:24 - scan_s.insert(i); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/* build 12-Sep-2018 15:30:24 -** Inserts all the elements of the set referred to by the global variable scan_s into build 12-Sep-2018 15:30:24 -** the set associated with the (int) key equal to the last value of the global vector eb_v build 12-Sep-2018 15:30:24 -** in the global map eb_scan_m. build 12-Sep-2018 15:30:24 -** The two parameters begin and end are not used and here only to comply with the Spirit parser's convention. build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 -void mergeScanSet(const char* , const char*) { build 12-Sep-2018 15:30:24 - int key = eb_v.back(); build 12-Sep-2018 15:30:24 - eb_scan_m[key].insert(scan_s.begin(), scan_s.end()); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/* build 12-Sep-2018 15:30:24 -** Empties the global set scan_s. build 12-Sep-2018 15:30:24 -** The two parameters begin and end are not used and here only to comply with the Spirit parser's convention. build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 -void clearScanSet(const char*, const char*) { build 12-Sep-2018 15:30:24 - scan_s.clear(); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/* build 12-Sep-2018 15:30:24 -** Defines the grammar and the behaviour of a Spirit parser build 12-Sep-2018 15:30:24 -** able to process a scan selection. build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 -struct eb_scan_selection : public grammar { build 12-Sep-2018 15:30:24 - template struct definition { build 12-Sep-2018 15:30:24 - definition (eb_scan_selection const& /* self */) { build 12-Sep-2018 15:30:24 - eb_scan_list = eb_scan >> *(';' >> eb_scan); build 12-Sep-2018 15:30:24 - eb_scan = (eb[push_back_a(eb_v, ebNumber)][assign_a(ebNumber, allEbs)] >> scan_list)[&mergeScanSet][&clearScanSet]; build 12-Sep-2018 15:30:24 - eb = !(int_p[assign_a(readEb)] >> ':')[assign_a(ebNumber, readEb)]; build 12-Sep-2018 15:30:24 - scan_list = !((scan_selection >> *(',' >> scan_selection))); build 12-Sep-2018 15:30:24 - scan_selection = (int_p[assign_a(scanNumber0)][assign_a(scanNumber1)] >> !('~' >> int_p[assign_a(scanNumber1)])) build 12-Sep-2018 15:30:24 - [&fillScanSet] build 12-Sep-2018 15:30:24 - [assign_a(scanNumber0, -1)] build 12-Sep-2018 15:30:24 - [assign_a(scanNumber1, -1)]; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - rule eb_scan_list, eb_scan, eb, scan_list, scan_selection; build 12-Sep-2018 15:30:24 - rule const& start() const { return eb_scan_list ; } build 12-Sep-2018 15:30:24 - }; build 12-Sep-2018 15:30:24 -}; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 map swIdx2Idx ; // A map which associates old and new index of Spectral Windows before/after reordering. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1102,6 +1031,18 @@ map stateIdx2Idx; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 set SwIdUsed; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +double radian2degree(double radian) { build 12-Sep-2018 15:30:24 + return radian / M_PI * 180.0; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +double m2au(double m) { build 12-Sep-2018 15:30:24 + return m / au_m; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +double mpers2auperd(double mpers) { build 12-Sep-2018 15:30:24 + return m2au(mpers) * 24. * 3600.; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 /** build 12-Sep-2018 15:30:24 * This function creates a table dedicated to the storage of Ephemeris informations and attaches it to an existing measurement set. build 12-Sep-2018 15:30:24 @@ -1118,8 +1059,8 @@ Table * buildAndAttachEphemeris(const string & name, vector observerLoc build 12-Sep-2018 15:30:24 tableDesc.rwKeywordSet().define("MJD0", casacore::Double(0.0)); build 12-Sep-2018 15:30:24 tableDesc.rwKeywordSet().define("dMJD", casacore::Double(0.0)); build 12-Sep-2018 15:30:24 tableDesc.rwKeywordSet().define("NAME", "T.B.D"); build 12-Sep-2018 15:30:24 - tableDesc.rwKeywordSet().define("GeoLong", casacore::Double(observerLocation[0] / 3.14159265 * 180.0)); build 12-Sep-2018 15:30:24 - tableDesc.rwKeywordSet().define("GeoLat", casacore::Double(observerLocation[1] / 3.14159265 * 180.0)); build 12-Sep-2018 15:30:24 + tableDesc.rwKeywordSet().define("GeoLong", casacore::Double(radian2degree(observerLocation[0]))); build 12-Sep-2018 15:30:24 + tableDesc.rwKeywordSet().define("GeoLat", casacore::Double(radian2degree(observerLocation[1]))); build 12-Sep-2018 15:30:24 tableDesc.rwKeywordSet().define("GeoDist", casacore::Double(observerLocation[2])); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Then the fields definitions and keywords. build 12-Sep-2018 15:30:24 @@ -1191,6 +1132,8 @@ void solveTridiagonalSystem(unsigned int n, build 12-Sep-2018 15:30:24 LOGEXIT("solveTridiagonalSystem"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#define LOG_EPHEM(message) if (getenv("FILLER_LOG_EPHEM")) cout << message; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 void linearInterpCoeff(uint32_t npoints, build 12-Sep-2018 15:30:24 const vector& time_v, build 12-Sep-2018 15:30:24 const vector& k_v, build 12-Sep-2018 15:30:24 @@ -1198,12 +1141,16 @@ void linearInterpCoeff(uint32_t npoints, build 12-Sep-2018 15:30:24 LOGENTER("linearInterpCoeff"); build 12-Sep-2018 15:30:24 coeff_vv.clear(); build 12-Sep-2018 15:30:24 coeff_vv.resize(npoints-1); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + LOG_EPHEM("linearInterpCoeff for npoints = " + TO_STRING(npoints)); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 for (uint32_t i = 0; i < npoints-1; i++) { build 12-Sep-2018 15:30:24 vector coeff_v (2); build 12-Sep-2018 15:30:24 coeff_v[0] = k_v[i]; build 12-Sep-2018 15:30:24 coeff_v[1] = (k_v[i+1] - k_v[i]) / (time_v[i+1] - time_v[i]); build 12-Sep-2018 15:30:24 coeff_vv[i] = coeff_v; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + LOG_EPHEM(TO_STRING(i) + " : " + TO_STRING(k_v[i]) + ", " + TO_STRING(k_v[i+1]) + ", " + TO_STRING(time_v[i]) + ", " + TO_STRING(time_v[i+1]) + ": " + TO_STRING(coeff_v[0]) + ", " + TO_STRING(coeff_v[1]) + "\n"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 LOGEXIT("linearInterpCoeff"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -1264,28 +1211,14 @@ double evalPoly (unsigned int numCoeff, build 12-Sep-2018 15:30:24 return result; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#define LOG_EPHEM(message) if (getenv("FILLER_LOG_EPHEM")) cout << message; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 void deleteEphemeris(map& apc2EphemTable_m) { build 12-Sep-2018 15:30:24 for ( map::iterator iter = apc2EphemTable_m.begin(); iter!=apc2EphemTable_m.end(); ++iter) build 12-Sep-2018 15:30:24 if (apc2EphemTable_m[iter->first] != NULL) delete apc2EphemTable_m[iter->first]; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -double radian2degree(double radian) { build 12-Sep-2018 15:30:24 - return radian / M_PI * 180.0; build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -double m2au(double m) { build 12-Sep-2018 15:30:24 - return m / 1.4959787066e11; build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -double mpers2auperd(double mpers) { build 12-Sep-2018 15:30:24 - return mpers * 24. * 3600. / 1.4959787066e11; build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 std::mapephemStartTime_m; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -void fillEphemeris(ASDM* ds_p, uint64_t timeStepInNanoSecond, bool interpolate_ephemeris, bool tabulate_ephemeris_polynomials, string telescopeName) { build 12-Sep-2018 15:30:24 +void fillEphemeris(ASDM* ds_p, uint64_t timeStepInNanoSecond, bool interpolate_ephemeris, string telescopeName) { build 12-Sep-2018 15:30:24 LOGENTER("fillEphemeris"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 try { build 12-Sep-2018 15:30:24 @@ -1350,30 +1283,29 @@ void fillEphemeris(ASDM* ds_p, uint64_t timeStepInNanoSecond, bool interpolate_e build 12-Sep-2018 15:30:24 * build 12-Sep-2018 15:30:24 * We derive these values from the informations found in the first element of i2e_m[ephemerisId] build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 - vector& v = i2e_m[ephemerisId]; build 12-Sep-2018 15:30:24 - vector observerLocation = v[0]->getObserverLocation(); build 12-Sep-2018 15:30:24 - double geoLong = observerLocation[0] / 3.14159265 * 180.0; // in order to get degrees. build 12-Sep-2018 15:30:24 - double geoLat = observerLocation[1] / 3.14159265 * 180.0; // in order to get degrees. build 12-Sep-2018 15:30:24 + vector& ephRow_v = i2e_m[ephemerisId]; build 12-Sep-2018 15:30:24 + vector observerLocation = ephRow_v[0]->getObserverLocation(); build 12-Sep-2018 15:30:24 + double geoLong = radian2degree(observerLocation[0]); // in order to get degrees. build 12-Sep-2018 15:30:24 + double geoLat = radian2degree(observerLocation[1]); // in order to get degrees. build 12-Sep-2018 15:30:24 double geoDist = observerLocation[2] / 1000.0; // in order to get km (supposedly above the reference ellipsoid) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - int64_t t0ASDM = v[0]->getTimeInterval().getStart().get(); // The first time recorded for this ephemerisId. build 12-Sep-2018 15:30:24 + int64_t t0ASDM = ephRow_v[0]->getTimeInterval().getStart().get(); // The first time recorded for this ephemerisId. build 12-Sep-2018 15:30:24 int64_t q = t0ASDM / timeStepInNanoSecond; build 12-Sep-2018 15:30:24 int64_t r = t0ASDM % timeStepInNanoSecond; build 12-Sep-2018 15:30:24 int64_t t0MS = t0ASDM; build 12-Sep-2018 15:30:24 if ( r != 0 ) { build 12-Sep-2018 15:30:24 - q = q + 1; build 12-Sep-2018 15:30:24 - t0MS = q * timeStepInNanoSecond; build 12-Sep-2018 15:30:24 + q = q + 1; build 12-Sep-2018 15:30:24 + t0MS = q * timeStepInNanoSecond; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 double mjd0 = ArrayTime(t0MS).getMJD(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - double dmjd = interpolate_ephemeris ? 0.001 : v[0]->getTimeInterval().getDuration().get() / 1000000000LL / 86400.0; // Grid time step == 0.001 if ephemeris interpolation requested build 12-Sep-2018 15:30:24 + double dmjd = interpolate_ephemeris ? 0.001 : ephRow_v[0]->getTimeInterval().getDuration().get() / 1000000000LL / 86400.0; // Grid time step == 0.001 if ephemeris interpolation requested build 12-Sep-2018 15:30:24 // otherwise == the interval of time of the first element of ephemeris converted in days. build 12-Sep-2018 15:30:24 // *SUPPOSEDLY* constant over all the ephemeris. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // determine the position reference system build 12-Sep-2018 15:30:24 - double equator = v[0]->getEquinoxEquator(); build 12-Sep-2018 15:30:24 + double equator = ephRow_v[0]->getEquinoxEquator(); build 12-Sep-2018 15:30:24 string posref = "unknown"; build 12-Sep-2018 15:30:24 if (equator == 2000.) { // the Ephemeris table presently only stores the equator build 12-Sep-2018 15:30:24 posref = "ICRF/ICRS"; build 12-Sep-2018 15:30:24 @@ -1382,7 +1314,7 @@ void fillEphemeris(ASDM* ds_p, uint64_t timeStepInNanoSecond, bool interpolate_e build 12-Sep-2018 15:30:24 // Prepare the table keywords with the values computed above. build 12-Sep-2018 15:30:24 TableDesc tableDesc; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - tableDesc.comment() = v[0]->getOrigin(); build 12-Sep-2018 15:30:24 + tableDesc.comment() = ephRow_v[0]->getOrigin(); build 12-Sep-2018 15:30:24 time_t now = time(0); build 12-Sep-2018 15:30:24 struct tm tstruct; build 12-Sep-2018 15:30:24 char buf[80]; build 12-Sep-2018 15:30:24 @@ -1447,8 +1379,9 @@ void fillEphemeris(ASDM* ds_p, uint64_t timeStepInNanoSecond, bool interpolate_e build 12-Sep-2018 15:30:24 + TO_STRING(mjd0) build 12-Sep-2018 15:30:24 + ".tab"; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - boost::regex e("[\\[\\]\\(\\)\\{\\}\\/ ]"); build 12-Sep-2018 15:30:24 - tableName = replace_all_regex_copy(tableName, e, std::string("_")); build 12-Sep-2018 15:30:24 + // The following characters are replaced with "_" : (){}[]/ and " " (space) build 12-Sep-2018 15:30:24 + std::regex e("[\\[\\]\\(\\)\\{\\}\\/ ]"); build 12-Sep-2018 15:30:24 + tableName = std::regex_replace(tableName, e, "_"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 map apc2EphemTable_m; build 12-Sep-2018 15:30:24 @@ -1484,403 +1417,530 @@ void fillEphemeris(ASDM* ds_p, uint64_t timeStepInNanoSecond, bool interpolate_e build 12-Sep-2018 15:30:24 vector distanceMS_v; build 12-Sep-2018 15:30:24 vector radVelMS_v; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - bool numPolyDirIsOne = v[0]->getNumPolyDir() == 1; build 12-Sep-2018 15:30:24 - bool numPolyDistIsOne = v[0]->getNumPolyDist() == 1; build 12-Sep-2018 15:30:24 - bool radVelExists = v[0]->isRadVelExists() && v[0]->isNumPolyRadVelExists(); build 12-Sep-2018 15:30:24 - bool numPolyRadVelIsOne = radVelExists ? v[0]->getNumPolyRadVel() == 1 : false; build 12-Sep-2018 15:30:24 + bool numPolyDirIsOne = ephRow_v[0]->getNumPolyDir() == 1; build 12-Sep-2018 15:30:24 + bool numPolyDistIsOne = ephRow_v[0]->getNumPolyDist() == 1; build 12-Sep-2018 15:30:24 + bool radVelExists = ephRow_v[0]->isRadVelExists() && ephRow_v[0]->isNumPolyRadVelExists(); build 12-Sep-2018 15:30:24 + bool numPolyRadVelIsOne = radVelExists ? ephRow_v[0]->getNumPolyRadVel() == 1 : false; build 12-Sep-2018 15:30:24 + bool anyNumPolyIsOne = numPolyDirIsOne || numPolyDistIsOne || (radVelExists && numPolyRadVelIsOne); build 12-Sep-2018 15:30:24 + bool allNumPolyIsOne = numPolyDirIsOne && numPolyDistIsOne && (!radVelExists || numPolyRadVelIsOne); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + LOG ("numPolyDirIsOne = " + TO_STRING(numPolyDirIsOne)); build 12-Sep-2018 15:30:24 + LOG ("numPolyDistIsOne = " + TO_STRING(numPolyDistIsOne)); build 12-Sep-2018 15:30:24 + LOG ("radVelExists = " + TO_STRING(radVelExists)); build 12-Sep-2018 15:30:24 + LOG ("numPolyRadVelIsOne = " + TO_STRING(numPolyRadVelIsOne)); build 12-Sep-2018 15:30:24 + LOG ("anyNumPolyIsOne = " + TO_STRING(anyNumPolyIsOne)); build 12-Sep-2018 15:30:24 + LOG ("allNumPolyIsOne = " + TO_STRING(allNumPolyIsOne)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // the single row case build 12-Sep-2018 15:30:24 + if (ephRow_v.size()==1) { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (timeStepInNanoSecond <= 0.0) { build 12-Sep-2018 15:30:24 + timeStepInNanoSecond = 0.001; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + infostream.str(""); build 12-Sep-2018 15:30:24 + infostream << "The MS Ephemeris table for ephemerisId = '" << ephemerisId build 12-Sep-2018 15:30:24 + << "' will be produced by tabulating the polynomials found in the single row for 'dir', 'distance' and optionally 'radVel' with a timestep of '" build 12-Sep-2018 15:30:24 + << timeStepInNanoSecond / 1.e9 / 86400. << "' days"; build 12-Sep-2018 15:30:24 + info(infostream.str()); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + dmjd = timeStepInNanoSecond / 1.e9 / 86400.; // to be written in the keyword DMJD build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // build 12-Sep-2018 15:30:24 + // Calculate the grid of times where the polynomials will be tabulated. build 12-Sep-2018 15:30:24 + // This grid contains all the times which : build 12-Sep-2018 15:30:24 + // - are multiple of the tabulation time steps, build 12-Sep-2018 15:30:24 + // - contained in the arraytime interval of validity of the current ASDM Ephemeris row. build 12-Sep-2018 15:30:24 + // build 12-Sep-2018 15:30:24 + // At this point times are expressed in nanoseconds. build 12-Sep-2018 15:30:24 + // build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + // this case has just one element in ephRow_v build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - if (interpolate_ephemeris) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + int64_t tstartASDM = ephRow_v[0]->getTimeInterval().getStart().get(); build 12-Sep-2018 15:30:24 + int64_t tendASDM = tstartASDM + ephRow_v[0]->getTimeInterval().getDuration().get(); build 12-Sep-2018 15:30:24 + int64_t q = tstartASDM / timeStepInNanoSecond; build 12-Sep-2018 15:30:24 + int64_t r = tstartASDM % timeStepInNanoSecond; build 12-Sep-2018 15:30:24 + int64_t tstartMS = tstartASDM; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if ( r!= 0 ) { build 12-Sep-2018 15:30:24 + q = q + 1; build 12-Sep-2018 15:30:24 + tstartMS = q * timeStepInNanoSecond; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + vector tabulation_time_v; build 12-Sep-2018 15:30:24 + int64_t t = tstartMS - timeStepInNanoSecond; // One extra timestep before the beginning of the interval of validity. build 12-Sep-2018 15:30:24 + do { build 12-Sep-2018 15:30:24 + tabulation_time_v.push_back(t); build 12-Sep-2018 15:30:24 + t += timeStepInNanoSecond; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + while (t <= tendASDM); build 12-Sep-2018 15:30:24 + tabulation_time_v.push_back(t); // One extra timestep after the end of the interval of validity. build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 - // Check that for each polynomial column the degree is always null or never null and that the optional fields are always present or always absent. build 12-Sep-2018 15:30:24 - // And also verify that there is no "hole" in the time range covered by the sequence of ArrayTime intervals when the degree is == 0. build 12-Sep-2018 15:30:24 + // Tabulate the MS Ephemeris columns for each tabulation time, in s. build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 - vector duration_v; // In seconds build 12-Sep-2018 15:30:24 - vector time_v; // " " build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - time_v.push_back(1.0e-09*v[0]->getTimeInterval().getStart().get()); build 12-Sep-2018 15:30:24 + double timeOrigin = ephRow_v[0]->getTimeOrigin().get() * 1.0e-09 / 86400. ; // to "days" build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Convert from `radians to degrees. build 12-Sep-2018 15:30:24 + const vector >& dir_v = ephRow_v[0]->getDir(); build 12-Sep-2018 15:30:24 + vector ra_coeff_v; build 12-Sep-2018 15:30:24 + vector dec_coeff_v; build 12-Sep-2018 15:30:24 + for (unsigned int idir = 0; idir < dir_v.size(); idir++) { build 12-Sep-2018 15:30:24 + ra_coeff_v.push_back(dir_v[idir][0]); build 12-Sep-2018 15:30:24 + dec_coeff_v.push_back(dir_v[idir][1]); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + LOG(" There are " + TO_STRING(ra_coeff_v.size()) + " RA coeffs and " + TO_STRING(dec_coeff_v.size()) + " DEC coeffs"); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Convert radian to degree. build 12-Sep-2018 15:30:24 + std::transform(ra_coeff_v.begin(), ra_coeff_v.end(), ra_coeff_v.begin(), radian2degree); build 12-Sep-2018 15:30:24 + std::transform(dec_coeff_v.begin(), dec_coeff_v.end(), dec_coeff_v.begin(), radian2degree); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Convert from m to AU. build 12-Sep-2018 15:30:24 + vector distance_coeff_v = ephRow_v[0]->getDistance(); build 12-Sep-2018 15:30:24 + std::transform(distance_coeff_v.begin(), distance_coeff_v.end(), distance_coeff_v.begin(), m2au); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + vector radvel_coeff_v; build 12-Sep-2018 15:30:24 + if (ephRow_v[0]->isRadVelExists()) { build 12-Sep-2018 15:30:24 + radvel_coeff_v = ephRow_v[0]->getRadVel(); build 12-Sep-2018 15:30:24 + // Convert from m per s to AU per day. build 12-Sep-2018 15:30:24 + std::transform(radvel_coeff_v.begin(), radvel_coeff_v.end(), radvel_coeff_v.begin(), mpers2auperd); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // And proceed... build 12-Sep-2018 15:30:24 + LOG ("There will be " + TO_STRING(tabulation_time_v.size()) + " time steps used to tabulate the polynomials."); build 12-Sep-2018 15:30:24 + for (unsigned int itab = 0; itab < tabulation_time_v.size(); itab++) { build 12-Sep-2018 15:30:24 + double tabulation_time = tabulation_time_v[itab] * 1.0e-09 / 86400.0 ; // It appeared that times should be expressed in "day" !! build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // MJD build 12-Sep-2018 15:30:24 + mjdMS_v.push_back(ArrayTime(tabulation_time_v[itab]).getMJD()); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // RA / DEC build 12-Sep-2018 15:30:24 + raMS_v.push_back(evalPoly(ra_coeff_v.size(), build 12-Sep-2018 15:30:24 + ra_coeff_v, build 12-Sep-2018 15:30:24 + timeOrigin, build 12-Sep-2018 15:30:24 + tabulation_time)); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + decMS_v.push_back(evalPoly(dec_coeff_v.size(), build 12-Sep-2018 15:30:24 + dec_coeff_v, build 12-Sep-2018 15:30:24 + timeOrigin, build 12-Sep-2018 15:30:24 + tabulation_time)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // DISTANCE build 12-Sep-2018 15:30:24 + distanceMS_v.push_back(evalPoly(distance_coeff_v.size(), build 12-Sep-2018 15:30:24 + distance_coeff_v, build 12-Sep-2018 15:30:24 + timeOrigin, build 12-Sep-2018 15:30:24 + tabulation_time)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // RADVEL build 12-Sep-2018 15:30:24 + if (radVelExists) { build 12-Sep-2018 15:30:24 + radVelMS_v.push_back(evalPoly(radvel_coeff_v.size(), build 12-Sep-2018 15:30:24 + radvel_coeff_v, build 12-Sep-2018 15:30:24 + timeOrigin, build 12-Sep-2018 15:30:24 + tabulation_time)); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // both of these cases require that the numPoly* is either all 1 or always greater than 1. Check here. build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 - for (unsigned int i = 1; i < v.size(); i++) { build 12-Sep-2018 15:30:24 - if (numPolyDirIsOne != (v[i]->getNumPolyDir() == 1)) { build 12-Sep-2018 15:30:24 - errstream << "In the table Ephemeris the value of the field 'numPolyDir' is expected to be whether always equal to 1 or always greater than 1. This rule is violated at line #" << i <<"."; build 12-Sep-2018 15:30:24 + for (unsigned int i = 1; i < ephRow_v.size(); i++) { build 12-Sep-2018 15:30:24 + if (numPolyDirIsOne != (ephRow_v[i]->getNumPolyDir() == 1)) { build 12-Sep-2018 15:30:24 + errstream << "In the table Ephemeris the value of the field 'numPolyDir' is expected to be always equal to 1 or always greater than 1. This rule is violated at line #" << i <<"."; build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - if (numPolyDistIsOne != (v[i]->getNumPolyDist() == 1)) { build 12-Sep-2018 15:30:24 - errstream << "In the table Ephemeris the value of the field 'numPolyDist' is expected to be whether always equal to 1 or always greater than 1. This rule is violated at line #" << i <<"."; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (numPolyDistIsOne != (ephRow_v[i]->getNumPolyDist() == 1)) { build 12-Sep-2018 15:30:24 + errstream << "In the table Ephemeris the value of the field 'numPolyDist' is expected to be always equal to 1 or always greater than 1. This rule is violated at line #" << i <<"."; build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - if (radVelExists != (v[i]->isRadVelExists() && v[i]->isNumPolyRadVelExists())) { build 12-Sep-2018 15:30:24 - errstream << "In the table Ephemeris the fields 'radVel' and 'numPolyRadVel' are expected to be whether always absent or always present. This rule is violated at line #" << i <<"."; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (radVelExists != (ephRow_v[i]->isRadVelExists() && ephRow_v[i]->isNumPolyRadVelExists())) { build 12-Sep-2018 15:30:24 + errstream << "In the table Ephemeris the fields 'radVel' and 'numPolyRadVel' are expected to be always absent or always present. This rule is violated at line #" << i <<"."; build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 if (radVelExists) { build 12-Sep-2018 15:30:24 - if (numPolyRadVelIsOne != (v[i]->getNumPolyRadVel() == 1)) { build 12-Sep-2018 15:30:24 - errstream << "In the table Ephemeris the value of the field 'numPolyRadVel' is expected to be whether always equal to 1 or always greater than 1. This rule is violated at line #" << i <<"."; build 12-Sep-2018 15:30:24 + if (numPolyRadVelIsOne != (ephRow_v[i]->getNumPolyRadVel() == 1)) { build 12-Sep-2018 15:30:24 + errstream << "In the table Ephemeris the value of the field 'numPolyRadVel' is expected to be always equal to 1 or always greater than 1. This rule is violated at line #" << i <<"."; build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - if (numPolyDirIsOne || numPolyDistIsOne || (radVelExists && numPolyRadVelIsOne)) { build 12-Sep-2018 15:30:24 - int64_t start_i = v[i]->getTimeInterval().getStart().get() ; build 12-Sep-2018 15:30:24 - int64_t start_i_1 = v[i-1]->getTimeInterval().getStart().get(); build 12-Sep-2018 15:30:24 - int64_t duration_i_1 = v[i-1]->getTimeInterval().getDuration().get(); build 12-Sep-2018 15:30:24 - if (start_i != (start_i_1 + duration_i_1)) { build 12-Sep-2018 15:30:24 - infostream.str(""); build 12-Sep-2018 15:30:24 - infostream << "The value of 'timeInterval' at row #" << i-1 << " does not cover the time range up to the start time of the next row. The polynomial will be evaluated despite the presence of this 'hole'"; build 12-Sep-2018 15:30:24 - info(infostream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (!interpolate_ephemeris && allNumPolyIsOne) { build 12-Sep-2018 15:30:24 + // interpolation is NOT requested and all possible polynomial columns are simple scalars, numPoly==1 build 12-Sep-2018 15:30:24 + // Just copy ephemeris without any interpolation. Just adapt the units. build 12-Sep-2018 15:30:24 + infostream.str(""); build 12-Sep-2018 15:30:24 + infostream << "The MS Ephemeris table for ephemerisId = '" << ephemerisId build 12-Sep-2018 15:30:24 + << "' will be produced by copying the values found in the ASDM with no interpolation"; build 12-Sep-2018 15:30:24 + info(infostream.str()); build 12-Sep-2018 15:30:24 + for(const EphemerisRow *eR_p: ephRow_v) { build 12-Sep-2018 15:30:24 + mjdMS_v.push_back(eR_p->getTimeInterval().getMidPoint().getMJD()); // MJD build 12-Sep-2018 15:30:24 + vector > dir = eR_p->getDir(); build 12-Sep-2018 15:30:24 + raMS_v.push_back(radian2degree(dir[0][0])); // deg build 12-Sep-2018 15:30:24 + decMS_v.push_back(radian2degree(dir[0][1])); // deg build 12-Sep-2018 15:30:24 + distanceMS_v.push_back(m2au(eR_p->getDistance()[0])); // AU build 12-Sep-2018 15:30:24 + if (radVelExists) { build 12-Sep-2018 15:30:24 + radVelMS_v.push_back(mpers2auperd(eR_p->getRadVel()[0])); // AU/d build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - duration_v.push_back(1.0e-09*(start_i - start_i_1)); build 12-Sep-2018 15:30:24 - time_v.push_back(1.0e-09*start_i); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - LOG ("numPolyDirIsOne = " + TO_STRING(numPolyDirIsOne)); build 12-Sep-2018 15:30:24 - LOG ("numPolyDistIsOne = " + TO_STRING(numPolyDistIsOne)); build 12-Sep-2018 15:30:24 - LOG ("radVelExists = " + TO_STRING(radVelExists)); build 12-Sep-2018 15:30:24 - LOG ("numPolyRadVelIsOne = " + TO_STRING(numPolyRadVelIsOne)); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // The number of tabulated values (i.e. the number of rows in the MS Ephemerides) table depend on the build 12-Sep-2018 15:30:24 - // degrees of each polynomial column. If there is at least one such degree which is equal to 1 then build 12-Sep-2018 15:30:24 - // we exclude the last element of the vector v, i.e. the last ArrayTimeInterval, since on this time interval build 12-Sep-2018 15:30:24 - // we would miss one end value for the interpolation (so far extrapolation is excluded). build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - if (numPolyDirIsOne || numPolyDistIsOne || (radVelExists && numPolyRadVelIsOne)) { build 12-Sep-2018 15:30:24 - // Then just "forget" the last element. build 12-Sep-2018 15:30:24 - LOG("Erasing the last element of v (size before = '" + TO_STRING(v.size()) + "')"); build 12-Sep-2018 15:30:24 - v.erase(v.begin() + v.size() - 1); build 12-Sep-2018 15:30:24 - LOG("Erasing the last element of v (size after = '" + TO_STRING(v.size()) + "')"); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - LOG("Erasing the last element of duration_v (size before = '" + TO_STRING(duration_v.size()) + "')"); build 12-Sep-2018 15:30:24 - duration_v.erase(duration_v.begin() + duration_v.size() - 1); build 12-Sep-2018 15:30:24 - LOG("Erasing the last element of duration_v (size after = '" + TO_STRING(duration_v.size()) + "')"); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // the general case, polynomials are evaluated and scalars are interpolated to the same timesteps. build 12-Sep-2018 15:30:24 + infostream.str(""); build 12-Sep-2018 15:30:24 + infostream << "The MS Ephemeris table for ephemerisId = '" << ephemerisId build 12-Sep-2018 15:30:24 + << "' will be produced by tabulating the polynomials found in the 'dir', 'distance' and optionally 'radVel' columns with a timestep of '" build 12-Sep-2018 15:30:24 + << timeStepInNanoSecond / 1.e9 / 86400. << "' days"; build 12-Sep-2018 15:30:24 + info(infostream.str()); build 12-Sep-2018 15:30:24 + if (anyNumPolyIsOne) { build 12-Sep-2018 15:30:24 + infostream.str(""); build 12-Sep-2018 15:30:24 + infostream << "the polynomials of order 0 will be interpolated between mid-interval values using the same timestep."; build 12-Sep-2018 15:30:24 + info(infostream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // Determine the timely ordered sequence of indexes in v which will be used to tabulate the ephemeris data to be put into the MS table. build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - LOG("Prepare the time ordered sequence of indexes used to tabulate the ephemeris data to be written in the MS table."); build 12-Sep-2018 15:30:24 - typedef pair atiIdxMStime_pair; build 12-Sep-2018 15:30:24 - vector atiIdxMStime_v; build 12-Sep-2018 15:30:24 + // the times that will be used depends on whether there are any numPoly*IsOne cases. In that case, build 12-Sep-2018 15:30:24 + // times must run from the first interval mid-point through the last interval mid-point. Otherwise build 12-Sep-2018 15:30:24 + // it's all evaluating the existing polynomials and the times can run from the first start time to the end build 12-Sep-2018 15:30:24 + // of the last interval. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - uint32_t index = 0; build 12-Sep-2018 15:30:24 - int64_t tMS = t0MS; build 12-Sep-2018 15:30:24 + // Check that for each polynomial column the degree is always null or never null and that the optional fields are always present or always absent. build 12-Sep-2018 15:30:24 + // And also verify that there is no "hole" in the time range covered by the sequence of ArrayTime intervals when the degree is == 0. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - atiIdxMStime_v.push_back(atiIdxMStime_pair(index, tMS)); build 12-Sep-2018 15:30:24 - LOG ("size of atiIdxMStime_v="+TO_STRING(atiIdxMStime_v.size())+", index = "+TO_STRING(index)+", tMS = "+TO_STRING(tMS)); build 12-Sep-2018 15:30:24 - tMS += timeStepInNanoSecond; build 12-Sep-2018 15:30:24 + // this vector is only used in the linear interpolation case build 12-Sep-2018 15:30:24 + vector time_v; // " " build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (anyNumPolyIsOne) { build 12-Sep-2018 15:30:24 + // need to recalculate t0MS using the midPoint build 12-Sep-2018 15:30:24 + t0ASDM = ephRow_v[0]->getTimeInterval().getMidPoint().get(); build 12-Sep-2018 15:30:24 + q = t0ASDM / timeStepInNanoSecond; build 12-Sep-2018 15:30:24 + r = t0ASDM % timeStepInNanoSecond; build 12-Sep-2018 15:30:24 + t0MS = t0ASDM; build 12-Sep-2018 15:30:24 + if (r != 0) { build 12-Sep-2018 15:30:24 + q = q+1; build 12-Sep-2018 15:30:24 + t0MS = q * timeStepInNanoSecond; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - int64_t start = v[index]->getTimeInterval().getStart().get(); build 12-Sep-2018 15:30:24 - int64_t end = start + v[index]->getTimeInterval().getDuration().get(); build 12-Sep-2018 15:30:24 - do { build 12-Sep-2018 15:30:24 - if (tMS < end) { build 12-Sep-2018 15:30:24 - atiIdxMStime_v.push_back(atiIdxMStime_pair(index, tMS)); build 12-Sep-2018 15:30:24 - tMS += timeStepInNanoSecond; build 12-Sep-2018 15:30:24 - LOG ("size of atiIdxMStime_v="+TO_STRING(atiIdxMStime_v.size())+", index = "+TO_STRING(index)+", tMS = "+TO_STRING(tMS)); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - index++; build 12-Sep-2018 15:30:24 - end = v[index]->getTimeInterval().getStart().get() + v[index]->getTimeInterval().getDuration().get(); build 12-Sep-2018 15:30:24 + // and populate time_v and look for gaps build 12-Sep-2018 15:30:24 + time_v.push_back(1.0e-09*t0ASDM); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + for (unsigned int i = 1; i < ephRow_v.size(); i++) { build 12-Sep-2018 15:30:24 + int64_t midPoint_i = ephRow_v[i]->getTimeInterval().getMidPoint().get() ; build 12-Sep-2018 15:30:24 + int64_t midPoint_i_1 = ephRow_v[i-1]->getTimeInterval().getMidPoint().get(); build 12-Sep-2018 15:30:24 + int64_t duration_i_1 = ephRow_v[i-1]->getTimeInterval().getDuration().get(); build 12-Sep-2018 15:30:24 + // look for gaps build 12-Sep-2018 15:30:24 + // comparing midPoint times should be equivalent to start times for this purpose, and we need the mid points for time_v build 12-Sep-2018 15:30:24 + if (midPoint_i != (midPoint_i_1 + duration_i_1)) { build 12-Sep-2018 15:30:24 + infostream.str(""); build 12-Sep-2018 15:30:24 + infostream << "The value of 'timeInterval' at row #" << i-1 << " does not cover the time range up to the start time of the next row. The polynomial will be evaluated despite the presence of this 'hole'"; build 12-Sep-2018 15:30:24 + info(infostream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + time_v.push_back(1.0e-09*midPoint_i); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - } while (index < v.size()-1); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - LOG("atiIdxMStime_v has " + TO_STRING(atiIdxMStime_v.size()) + " elements."); build 12-Sep-2018 15:30:24 + // Determine the timely ordered sequence of indexes in ephRow_v which will be used to tabulate the ephemeris data to be put into the MS table. build 12-Sep-2018 15:30:24 + LOG("Prepare the time ordered sequence of indexes used to tabulate the ephemeris data to be written in the MS table."); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // The polynomials change at the interval boundaries, the linear interpolations change at the interval mid-points build 12-Sep-2018 15:30:24 + // It may be necessary to have both sets of (index,time) pairs. build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + typedef pair atiIdxMStime_pair; build 12-Sep-2018 15:30:24 + vector atiIdxMStimePoly_v; build 12-Sep-2018 15:30:24 + vector atiIdxMStimeLine_v; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // BUT - the time values used in each pair MUST be the same, starting from t0MS through either build 12-Sep-2018 15:30:24 + // the end of the final interval OR through the midpoint of the final interval build 12-Sep-2018 15:30:24 + // all times here the integer times in nano seconds build 12-Sep-2018 15:30:24 + vector intMStimes_v; build 12-Sep-2018 15:30:24 + int64_t tMS = t0MS; build 12-Sep-2018 15:30:24 + int32_t lastIntIndx = ephRow_v.size()-1; build 12-Sep-2018 15:30:24 + int64_t end = ephRow_v[lastIntIndx]->getTimeInterval().getStart().get() + ephRow_v[lastIntIndx]->getTimeInterval().getDuration().get(); build 12-Sep-2018 15:30:24 + // there must be a vector way to do this - revisit this part later, and even a for loop would be better build 12-Sep-2018 15:30:24 + do { build 12-Sep-2018 15:30:24 + intMStimes_v.push_back(tMS); build 12-Sep-2018 15:30:24 + tMS += timeStepInNanoSecond; build 12-Sep-2018 15:30:24 + } while (tMS < end); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // populate the pairs as needed build 12-Sep-2018 15:30:24 + if (!allNumPolyIsOne) { build 12-Sep-2018 15:30:24 + // some polynomials exist build 12-Sep-2018 15:30:24 + uint32_t index = 0; build 12-Sep-2018 15:30:24 + int64_t start = ephRow_v[index]->getTimeInterval().getStart().get(); build 12-Sep-2018 15:30:24 + int64_t end = start + ephRow_v[index]->getTimeInterval().getDuration().get(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // position index so that t0MS is < end build 12-Sep-2018 15:30:24 + while ((t0MS >= end) && (index < ephRow_v.size())) { build 12-Sep-2018 15:30:24 + index++; build 12-Sep-2018 15:30:24 + end = ephRow_v[index]->getTimeInterval().getStart().get() + ephRow_v[index]->getTimeInterval().getDuration().get(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // Prepare the coefficients which will be used for the tabulation. build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - LOG("Prepare the coefficients which will be used for the tabulations."); build 12-Sep-2018 15:30:24 - vector > raASDM_vv; build 12-Sep-2018 15:30:24 - vector raASDM_v; build 12-Sep-2018 15:30:24 - vector > decASDM_vv; build 12-Sep-2018 15:30:24 - vector decASDM_v; build 12-Sep-2018 15:30:24 - vector > distanceASDM_vv; build 12-Sep-2018 15:30:24 - vector distanceASDM_v; build 12-Sep-2018 15:30:24 - vector > radVelASDM_vv; build 12-Sep-2018 15:30:24 - vector radVelASDM_v; build 12-Sep-2018 15:30:24 - vector empty_v; build 12-Sep-2018 15:30:24 - vector temp_v; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - cout.precision(10); build 12-Sep-2018 15:30:24 - for (unsigned int i = 0; i < v.size(); i++) { build 12-Sep-2018 15:30:24 - LOG_EPHEM("original " + TO_STRING (ArrayTime(v[i]->getTimeInterval().getStart().get()).getMJD())); build 12-Sep-2018 15:30:24 - vector > temp_vv = v[i]->getDir(); build 12-Sep-2018 15:30:24 - if (numPolyDistIsOne) { build 12-Sep-2018 15:30:24 - raASDM_v.push_back(temp_vv[0][0]/3.14159265*180.0); build 12-Sep-2018 15:30:24 - decASDM_v.push_back(temp_vv[0][1]/3.14159265*180.0); build 12-Sep-2018 15:30:24 - LOG_EPHEM (" " + TO_STRING(raASDM_v.back()) + " " + TO_STRING(decASDM_v.back())); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - raASDM_vv.push_back(empty_v); build 12-Sep-2018 15:30:24 - decASDM_vv.push_back(empty_v); build 12-Sep-2018 15:30:24 - for (int j = 0; j < v[i]->getNumPolyDir(); j++) { build 12-Sep-2018 15:30:24 - raASDM_vv.back().push_back(temp_vv[j][0]/3.14159265*180.0); build 12-Sep-2018 15:30:24 - decASDM_vv.back().push_back(temp_vv[j][1]/3.14159265*180.0); build 12-Sep-2018 15:30:24 + if (index >= ephRow_v.size()) { build 12-Sep-2018 15:30:24 + // this might happen if the user chose a time step that's really bad for the ephemeris table being interpolated build 12-Sep-2018 15:30:24 + // can not continue build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + errstream << "The ephemeris table can't be evaluated or interpolated using the chosen timestep : " build 12-Sep-2018 15:30:24 + << timeStepInNanoSecond / 1.e9 / 86400. << "' days. Choose a smaller value."; build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - temp_v = v[i]->getDistance(); build 12-Sep-2018 15:30:24 - if (numPolyDistIsOne) { build 12-Sep-2018 15:30:24 - distanceASDM_v.push_back(temp_v[0] / 1.4959787066e11); // AU build 12-Sep-2018 15:30:24 - LOG_EPHEM (" " + TO_STRING(distanceASDM_v.back())); build 12-Sep-2018 15:30:24 + for (int64_t tMS : intMStimes_v) { build 12-Sep-2018 15:30:24 + // make sure this index is appropriate for tMS build 12-Sep-2018 15:30:24 + // there may be a gap so it's important to keep advancing index until there's nothing left build 12-Sep-2018 15:30:24 + while ((tMS >= end) && (index < ephRow_v.size())) { build 12-Sep-2018 15:30:24 + index++; build 12-Sep-2018 15:30:24 + end = ephRow_v[index]->getTimeInterval().getStart().get() + ephRow_v[index]->getTimeInterval().getDuration().get(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (index < ephRow_v.size()) { build 12-Sep-2018 15:30:24 + atiIdxMStimePoly_v.push_back(atiIdxMStime_pair(index, tMS)); build 12-Sep-2018 15:30:24 + LOG ("size of atiIdxMStimePoly_v="+TO_STRING(atiIdxMStimePoly_v.size())+", index = "+TO_STRING(index)+", tMS = "+TO_STRING(tMS)); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - distanceASDM_vv.push_back(empty_v); build 12-Sep-2018 15:30:24 - for (int j = 0; j < v[i]->getNumPolyDist(); j++) build 12-Sep-2018 15:30:24 - distanceASDM_vv.back().push_back(temp_v[j] / 1.4959787066e11); // AU build 12-Sep-2018 15:30:24 + if (anyNumPolyIsOne) { build 12-Sep-2018 15:30:24 + // some linear interpolation is needed - breaks at the interval midpoint build 12-Sep-2018 15:30:24 + uint32_t index = 0; build 12-Sep-2018 15:30:24 + int64_t start = ephRow_v[index]->getTimeInterval().getMidPoint().get(); build 12-Sep-2018 15:30:24 + int64_t end = start + ephRow_v[index]->getTimeInterval().getDuration().get(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // the linear interpolation can't ever start with the final index number, that would required interpolating beyond the end build 12-Sep-2018 15:30:24 + // position index so that t0MS is < end build 12-Sep-2018 15:30:24 + while ((t0MS >= end) && (index < (ephRow_v.size()-1))) { build 12-Sep-2018 15:30:24 + index++; build 12-Sep-2018 15:30:24 + end = ephRow_v[index]->getTimeInterval().getMidPoint().get() + ephRow_v[index]->getTimeInterval().getDuration().get(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (index >= (ephRow_v.size()-1)) { build 12-Sep-2018 15:30:24 + // this might happen if the user chose a time step that's really bad for the ephemeris table being interpolated build 12-Sep-2018 15:30:24 + // can not continue build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + errstream << "The ephemeris table can't be evaluated or interpolated using the chosen timestep : " build 12-Sep-2018 15:30:24 + << timeStepInNanoSecond / 1.e9 / 86400. << "' days. Choose a smaller value."; build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + for (int64_t tMS : intMStimes_v) { build 12-Sep-2018 15:30:24 + // make sure this index is appropriate for tMS build 12-Sep-2018 15:30:24 + // there may be a gap, so keep advancing until there's nothing left build 12-Sep-2018 15:30:24 + while (tMS >= end && (index < (ephRow_v.size()-1))) { build 12-Sep-2018 15:30:24 + index++; build 12-Sep-2018 15:30:24 + end = ephRow_v[index]->getTimeInterval().getMidPoint().get() + ephRow_v[index]->getTimeInterval().getDuration().get(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (index < (ephRow_v.size()-1)) { build 12-Sep-2018 15:30:24 + atiIdxMStimeLine_v.push_back(atiIdxMStime_pair(index, tMS)); build 12-Sep-2018 15:30:24 + LOG ("size of atiIdxMStimeLine_v="+TO_STRING(atiIdxMStimeLine_v.size())+", index = "+TO_STRING(index)+", tMS = "+TO_STRING(tMS)); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + LOG("atiIdxMStimePoly_v has " + TO_STRING(atiIdxMStimePoly_v.size()) + " elements."); build 12-Sep-2018 15:30:24 + LOG("atiIdxMStimeLine_v has " + TO_STRING(atiIdxMStimeLine_v.size()) + " elements."); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (radVelExists) { build 12-Sep-2018 15:30:24 - temp_v = v[i]->getRadVel(); build 12-Sep-2018 15:30:24 - if (numPolyRadVelIsOne) { build 12-Sep-2018 15:30:24 - radVelASDM_v.push_back(temp_v[0] / 1.4959787066e11 * 24. * 3600.); // AU/d build 12-Sep-2018 15:30:24 - LOG_EPHEM(" " + TO_STRING(radVelASDM_v.back())); build 12-Sep-2018 15:30:24 + // Prepare the coefficients which will be used for the tabulation. build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + LOG("Prepare the coefficients which will be used for the tabulations."); build 12-Sep-2018 15:30:24 + vector > raASDM_vv; build 12-Sep-2018 15:30:24 + vector raASDM_v; build 12-Sep-2018 15:30:24 + vector > decASDM_vv; build 12-Sep-2018 15:30:24 + vector decASDM_v; build 12-Sep-2018 15:30:24 + vector > distanceASDM_vv; build 12-Sep-2018 15:30:24 + vector distanceASDM_v; build 12-Sep-2018 15:30:24 + vector > radVelASDM_vv; build 12-Sep-2018 15:30:24 + vector radVelASDM_v; build 12-Sep-2018 15:30:24 + vector empty_v; build 12-Sep-2018 15:30:24 + vector temp_v; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + cout.precision(10); build 12-Sep-2018 15:30:24 + for (unsigned int i = 0; i < ephRow_v.size(); i++) { build 12-Sep-2018 15:30:24 + LOG_EPHEM("original " + TO_STRING (ArrayTime(ephRow_v[i]->getTimeInterval().getStart().get()).getMJD())); build 12-Sep-2018 15:30:24 + vector > temp_vv = ephRow_v[i]->getDir(); build 12-Sep-2018 15:30:24 + if (numPolyDirIsOne) { build 12-Sep-2018 15:30:24 + raASDM_v.push_back(radian2degree(temp_vv[0][0])); build 12-Sep-2018 15:30:24 + decASDM_v.push_back(radian2degree(temp_vv[0][1])); build 12-Sep-2018 15:30:24 + LOG_EPHEM (" " + TO_STRING(raASDM_v.back()) + " " + TO_STRING(decASDM_v.back())); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + raASDM_vv.push_back(empty_v); build 12-Sep-2018 15:30:24 + decASDM_vv.push_back(empty_v); build 12-Sep-2018 15:30:24 + for (int j = 0; j < ephRow_v[i]->getNumPolyDir(); j++) { build 12-Sep-2018 15:30:24 + raASDM_vv.back().push_back(radian2degree(temp_vv[j][0])); build 12-Sep-2018 15:30:24 + decASDM_vv.back().push_back(radian2degree(temp_vv[j][1])); ; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + temp_v = ephRow_v[i]->getDistance(); build 12-Sep-2018 15:30:24 + if (numPolyDistIsOne) { build 12-Sep-2018 15:30:24 + distanceASDM_v.push_back(m2au(temp_v[0])); // AU build 12-Sep-2018 15:30:24 + LOG_EPHEM (" " + TO_STRING(distanceASDM_v.back())); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 - radVelASDM_vv.push_back(empty_v); build 12-Sep-2018 15:30:24 - for (int j = 0; j < v[i]->getNumPolyRadVel(); j++) build 12-Sep-2018 15:30:24 - radVelASDM_vv.back().push_back(temp_v[j]/ 1.4959787066e11 * 24. * 3600.); // AU/d build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 + distanceASDM_vv.push_back(empty_v); build 12-Sep-2018 15:30:24 + for (int j = 0; j < ephRow_v[i]->getNumPolyDist(); j++) build 12-Sep-2018 15:30:24 + distanceASDM_vv.back().push_back(m2au(temp_v[j])); // AU build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (radVelExists) { build 12-Sep-2018 15:30:24 + temp_v = ephRow_v[i]->getRadVel(); build 12-Sep-2018 15:30:24 + if (numPolyRadVelIsOne) { build 12-Sep-2018 15:30:24 + radVelASDM_v.push_back(mpers2auperd(temp_v[0])); // AU/d build 12-Sep-2018 15:30:24 + LOG_EPHEM(" " + TO_STRING(radVelASDM_v.back())); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + radVelASDM_vv.push_back(empty_v); build 12-Sep-2018 15:30:24 + for (int j = 0; j < ephRow_v[i]->getNumPolyRadVel(); j++) build 12-Sep-2018 15:30:24 + radVelASDM_vv.back().push_back(mpers2auperd(temp_v[j])); // AU/d build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + LOG_EPHEM("\n"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - LOG_EPHEM("\n"); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Preparing the coefficients of piecewise polynomial of degree 1. build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // The calculations below are done only once and will be useful for all the columns build 12-Sep-2018 15:30:24 - // requiring the cubic spline interpolation. build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - if (numPolyDirIsOne || numPolyDistIsOne || (radVelExists && numPolyRadVelIsOne)) { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Preparing the coefficients of piecewise polynomial of degree 1. build 12-Sep-2018 15:30:24 if (numPolyDirIsOne) { build 12-Sep-2018 15:30:24 LOG("Compute the linear interpolation coefficients for RAD"); build 12-Sep-2018 15:30:24 - linearInterpCoeff(v.size(), build 12-Sep-2018 15:30:24 + linearInterpCoeff(ephRow_v.size(), build 12-Sep-2018 15:30:24 time_v, build 12-Sep-2018 15:30:24 raASDM_v, build 12-Sep-2018 15:30:24 raASDM_vv); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 LOG("Compute the linear interpolation coefficients for DEC"); build 12-Sep-2018 15:30:24 - linearInterpCoeff(v.size(), build 12-Sep-2018 15:30:24 + linearInterpCoeff(ephRow_v.size(), build 12-Sep-2018 15:30:24 time_v, build 12-Sep-2018 15:30:24 decASDM_v, build 12-Sep-2018 15:30:24 decASDM_vv); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 if (numPolyDistIsOne) { build 12-Sep-2018 15:30:24 LOG("Compute the linear interolation coefficients for Dist"); build 12-Sep-2018 15:30:24 - linearInterpCoeff(v.size(), build 12-Sep-2018 15:30:24 + linearInterpCoeff(ephRow_v.size(), build 12-Sep-2018 15:30:24 time_v, build 12-Sep-2018 15:30:24 distanceASDM_v, build 12-Sep-2018 15:30:24 distanceASDM_vv); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 if (radVelExists && numPolyRadVelIsOne) { build 12-Sep-2018 15:30:24 LOG("Compute the linear interpolation coefficients for RadVel"); build 12-Sep-2018 15:30:24 - linearInterpCoeff(v.size(), build 12-Sep-2018 15:30:24 + linearInterpCoeff(ephRow_v.size(), build 12-Sep-2018 15:30:24 time_v, build 12-Sep-2018 15:30:24 radVelASDM_v, build 12-Sep-2018 15:30:24 radVelASDM_vv); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - // End of interpolating with piecewise polynomial of degree 1. build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - for (atiIdxMStime_pair atiIdxMStime: atiIdxMStime_v) { build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // MJD build 12-Sep-2018 15:30:24 - mjdMS_v.push_back(ArrayTime(atiIdxMStime.second).getMJD()); build 12-Sep-2018 15:30:24 - LOG_EPHEM( "resampled " + TO_STRING(mjdMS_v.back())); build 12-Sep-2018 15:30:24 - LOG("mjdMS_v -> "+TO_STRING(mjdMS_v.back())); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - double timeOrigin = 1.0e-09 * v[atiIdxMStime.first]->getTimeOrigin().get(); build 12-Sep-2018 15:30:24 - double time = 1.0e-09 * atiIdxMStime.second; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - LOG("timeOrigin="+TO_STRING(timeOrigin)+", time="+TO_STRING(time)); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // RA / DEC build 12-Sep-2018 15:30:24 - LOG("Eval poly for RA"); build 12-Sep-2018 15:30:24 - LOG("atiIdxMStime.first = " + TO_STRING(atiIdxMStime.first)); build 12-Sep-2018 15:30:24 - raMS_v.push_back(evalPoly(raASDM_vv[atiIdxMStime.first].size(), build 12-Sep-2018 15:30:24 - raASDM_vv[atiIdxMStime.first], build 12-Sep-2018 15:30:24 - timeOrigin, build 12-Sep-2018 15:30:24 - time)); build 12-Sep-2018 15:30:24 - LOG_EPHEM(" " + TO_STRING(raMS_v.back())); build 12-Sep-2018 15:30:24 - LOG("raMS_v -> "+TO_STRING(raMS_v.back())); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - LOG("Eval poly for DEC"); build 12-Sep-2018 15:30:24 - decMS_v.push_back(evalPoly(decASDM_vv[atiIdxMStime.first].size(), build 12-Sep-2018 15:30:24 - decASDM_vv[atiIdxMStime.first], build 12-Sep-2018 15:30:24 - timeOrigin, build 12-Sep-2018 15:30:24 - time)); build 12-Sep-2018 15:30:24 - LOG_EPHEM(" " + TO_STRING(decMS_v.back())); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // Distance build 12-Sep-2018 15:30:24 - LOG("Eval poly for distance"); build 12-Sep-2018 15:30:24 - distanceMS_v.push_back(evalPoly(distanceASDM_vv[atiIdxMStime.first].size(), build 12-Sep-2018 15:30:24 - distanceASDM_vv[atiIdxMStime.first], build 12-Sep-2018 15:30:24 - timeOrigin, build 12-Sep-2018 15:30:24 - time)); build 12-Sep-2018 15:30:24 - LOG_EPHEM(" " + TO_STRING(distanceMS_v.back())); build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // Radvel build 12-Sep-2018 15:30:24 - if (radVelExists) { build 12-Sep-2018 15:30:24 - LOG("Eval poly for radvel"); build 12-Sep-2018 15:30:24 - radVelMS_v.push_back(evalPoly(radVelASDM_vv[atiIdxMStime.first].size(), build 12-Sep-2018 15:30:24 - radVelASDM_vv[atiIdxMStime.first], build 12-Sep-2018 15:30:24 - timeOrigin, build 12-Sep-2018 15:30:24 - time)); build 12-Sep-2018 15:30:24 - LOG_EPHEM(" " + TO_STRING(radVelMS_v.back())); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - LOG_EPHEM("\n"); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } // end if interpolate_ephemeris build 12-Sep-2018 15:30:24 - else if (tabulate_ephemeris_polynomials && build 12-Sep-2018 15:30:24 - v.size()==1 && build 12-Sep-2018 15:30:24 - timeStepInNanoSecond > 0 build 12-Sep-2018 15:30:24 - ) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - infostream << "The MS Ephemeris table for ephemerisId = '" << ephemerisId build 12-Sep-2018 15:30:24 - << "' will be produced by tabulating the polynomials found in the columns 'dir', 'distance' and optionally 'radVel' with a timestep of '" build 12-Sep-2018 15:30:24 - << timeStepInNanoSecond / 1.e9 / 86400. << "' days"; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - dmjd = timeStepInNanoSecond / 1.e9 / 86400.; // to be written in the keyword DMJD build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - for (unsigned int i = 0; i < v.size(); i++) { build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // Calculate the grid of times where the polynomials will be tabulated. build 12-Sep-2018 15:30:24 - // This grid contains all the times which : build 12-Sep-2018 15:30:24 - // - are multiple of the tabulation time steps, build 12-Sep-2018 15:30:24 - // - contained in the arraytime interval of validity of the current ASDM Ephemeris row. build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // At this point times are expressed in nanoseconds. build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - int64_t tstartASDM = v[i]->getTimeInterval().getStart().get(); build 12-Sep-2018 15:30:24 - int64_t tendASDM = tstartASDM + v[i]->getTimeInterval().getDuration().get(); build 12-Sep-2018 15:30:24 - int64_t q = tstartASDM / timeStepInNanoSecond; build 12-Sep-2018 15:30:24 - int64_t r = tstartASDM % timeStepInNanoSecond; build 12-Sep-2018 15:30:24 - int64_t tstartMS = tstartASDM; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - if ( r!= 0 ) { build 12-Sep-2018 15:30:24 - q = q + 1; build 12-Sep-2018 15:30:24 - tstartMS = q * timeStepInNanoSecond; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - vector tabulation_time_v; build 12-Sep-2018 15:30:24 - int64_t t = tstartMS - timeStepInNanoSecond; // One extra timestep before the beginning of the interval of validity. build 12-Sep-2018 15:30:24 - do { build 12-Sep-2018 15:30:24 - tabulation_time_v.push_back(t); build 12-Sep-2018 15:30:24 - t += timeStepInNanoSecond; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - while (t <= tendASDM); build 12-Sep-2018 15:30:24 - tabulation_time_v.push_back(t); // One extra timestep after the end of the interval of validity. build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // Let's tabulate the MS Ephemeris column for each tabulation time, in s. build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - double timeOrigin = v[i]->getTimeOrigin().get() * 1.0e-09 / 86400. ; // It appeared that time must be expressed in "days" !! build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Convert from radians to degrees. build 12-Sep-2018 15:30:24 - const vector >& dir_v = v[i]->getDir(); build 12-Sep-2018 15:30:24 - vector ra_coeff_v; build 12-Sep-2018 15:30:24 - vector dec_coeff_v; build 12-Sep-2018 15:30:24 - for (unsigned int idir = 0; idir < dir_v.size(); idir++) { build 12-Sep-2018 15:30:24 - ra_coeff_v.push_back(dir_v[idir][0]); build 12-Sep-2018 15:30:24 - dec_coeff_v.push_back(dir_v[idir][1]); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - LOG(" There are " + TO_STRING(ra_coeff_v.size()) + " RA coeffs and " + TO_STRING(dec_coeff_v.size()) + " DEC coeffs"); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Convert radian to degree. build 12-Sep-2018 15:30:24 - std::transform(ra_coeff_v.begin(), ra_coeff_v.end(), ra_coeff_v.begin(), radian2degree); build 12-Sep-2018 15:30:24 - std::transform(dec_coeff_v.begin(), dec_coeff_v.end(), dec_coeff_v.begin(), radian2degree); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Convert from m to AU. build 12-Sep-2018 15:30:24 - vector distance_coeff_v = v[i]->getDistance(); build 12-Sep-2018 15:30:24 - std::transform(distance_coeff_v.begin(), distance_coeff_v.end(), distance_coeff_v.begin(), m2au); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - vector radvel_coeff_v; build 12-Sep-2018 15:30:24 - if (v[i]->isRadVelExists()) { build 12-Sep-2018 15:30:24 - radvel_coeff_v = v[i]->getRadVel(); build 12-Sep-2018 15:30:24 - // Convert from m per s to AU per day. build 12-Sep-2018 15:30:24 - std::transform(radvel_coeff_v.begin(), radvel_coeff_v.end(), radvel_coeff_v.begin(), mpers2auperd); build 12-Sep-2018 15:30:24 - } else { build 12-Sep-2018 15:30:24 - // Let's derivate the polynomial in distance. build 12-Sep-2018 15:30:24 - for (unsigned int iDistance=1; iDistance < distance_coeff_v.size(); iDistance++) build 12-Sep-2018 15:30:24 - radvel_coeff_v.push_back(distance_coeff_v[iDistance]*iDistance); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // And proceed... build 12-Sep-2018 15:30:24 - LOG ("There will be " + TO_STRING(tabulation_time_v.size()) + " time steps used to tabulate the polynomials."); build 12-Sep-2018 15:30:24 - for (unsigned int itab = 0; itab < tabulation_time_v.size(); itab++) { build 12-Sep-2018 15:30:24 - double tabulation_time = tabulation_time_v[itab] * 1.0e-09 / 86400.0 ; // It appeared that times should be expressed in "day" !! build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + // loops over the two vectors of pairs build 12-Sep-2018 15:30:24 + // the polynomials build 12-Sep-2018 15:30:24 + for (atiIdxMStime_pair atiIdxMStime: atiIdxMStimePoly_v) { build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 // MJD build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - mjdMS_v.push_back(ArrayTime(tabulation_time_v[itab]).getMJD()); build 12-Sep-2018 15:30:24 + // mjdMS_v is always unfilled at this point, this is always appropriate here build 12-Sep-2018 15:30:24 + mjdMS_v.push_back(ArrayTime(atiIdxMStime.second).getMJD()); build 12-Sep-2018 15:30:24 + LOG_EPHEM(TO_STRING(mjdMS_v.size()) + ": "); build 12-Sep-2018 15:30:24 + LOG_EPHEM( "resampled " + TO_STRING(mjdMS_v.back())); build 12-Sep-2018 15:30:24 + LOG("mjdMS_v -> "+TO_STRING(mjdMS_v.back())); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // RA / DEC build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - raMS_v.push_back(evalPoly(ra_coeff_v.size(), build 12-Sep-2018 15:30:24 - ra_coeff_v, build 12-Sep-2018 15:30:24 - timeOrigin, build 12-Sep-2018 15:30:24 - tabulation_time)); build 12-Sep-2018 15:30:24 + double timeOrigin = 1.0e-09 * ephRow_v[atiIdxMStime.first]->getTimeOrigin().get(); build 12-Sep-2018 15:30:24 + double time = 1.0e-09 * atiIdxMStime.second; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - decMS_v.push_back(evalPoly(dec_coeff_v.size(), build 12-Sep-2018 15:30:24 - dec_coeff_v, build 12-Sep-2018 15:30:24 - timeOrigin, build 12-Sep-2018 15:30:24 - tabulation_time)); build 12-Sep-2018 15:30:24 + LOG("timeOrigin="+TO_STRING(timeOrigin)+", time="+TO_STRING(time)); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + // RA / DEC build 12-Sep-2018 15:30:24 + if (!numPolyDirIsOne) { build 12-Sep-2018 15:30:24 + LOG("Eval poly for RA"); build 12-Sep-2018 15:30:24 + LOG("atiIdxMStime.first = " + TO_STRING(atiIdxMStime.first)); build 12-Sep-2018 15:30:24 + raMS_v.push_back(evalPoly(raASDM_vv[atiIdxMStime.first].size(), build 12-Sep-2018 15:30:24 + raASDM_vv[atiIdxMStime.first], build 12-Sep-2018 15:30:24 + timeOrigin, build 12-Sep-2018 15:30:24 + time)); build 12-Sep-2018 15:30:24 + LOG_EPHEM(" " + TO_STRING(raMS_v.back())); build 12-Sep-2018 15:30:24 + LOG("raMS_v -> "+TO_STRING(raMS_v.back())); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // DISTANCE build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - distanceMS_v.push_back(evalPoly(distance_coeff_v.size(), build 12-Sep-2018 15:30:24 - distance_coeff_v, build 12-Sep-2018 15:30:24 - timeOrigin, build 12-Sep-2018 15:30:24 - tabulation_time)); build 12-Sep-2018 15:30:24 + LOG("Eval poly for DEC"); build 12-Sep-2018 15:30:24 + decMS_v.push_back(evalPoly(decASDM_vv[atiIdxMStime.first].size(), build 12-Sep-2018 15:30:24 + decASDM_vv[atiIdxMStime.first], build 12-Sep-2018 15:30:24 + timeOrigin, build 12-Sep-2018 15:30:24 + time)); build 12-Sep-2018 15:30:24 + LOG_EPHEM(" " + TO_STRING(decMS_v.back())); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + // Distance build 12-Sep-2018 15:30:24 + if (!numPolyDistIsOne) { build 12-Sep-2018 15:30:24 + LOG("Eval poly for distance"); build 12-Sep-2018 15:30:24 + distanceMS_v.push_back(evalPoly(distanceASDM_vv[atiIdxMStime.first].size(), build 12-Sep-2018 15:30:24 + distanceASDM_vv[atiIdxMStime.first], build 12-Sep-2018 15:30:24 + timeOrigin, build 12-Sep-2018 15:30:24 + time)); build 12-Sep-2018 15:30:24 + LOG_EPHEM(" " + TO_STRING(distanceMS_v.back())); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Radvel build 12-Sep-2018 15:30:24 + if (radVelExists && !numPolyRadVelIsOne) { build 12-Sep-2018 15:30:24 + LOG("Eval poly for radvel"); build 12-Sep-2018 15:30:24 + radVelMS_v.push_back(evalPoly(radVelASDM_vv[atiIdxMStime.first].size(), build 12-Sep-2018 15:30:24 + radVelASDM_vv[atiIdxMStime.first], build 12-Sep-2018 15:30:24 + timeOrigin, build 12-Sep-2018 15:30:24 + time)); build 12-Sep-2018 15:30:24 + LOG_EPHEM(" " + TO_STRING(radVelMS_v.back())); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + LOG_EPHEM("\n"); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } // end of polynomial evaluations build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // the linear interpolations build 12-Sep-2018 15:30:24 + for (atiIdxMStime_pair atiIdxMStime: atiIdxMStimeLine_v) { build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 - // RADVEL build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - if (radVelExists) { build 12-Sep-2018 15:30:24 - radVelMS_v.push_back(evalPoly(radvel_coeff_v.size(), build 12-Sep-2018 15:30:24 - radvel_coeff_v, build 12-Sep-2018 15:30:24 - timeOrigin, build 12-Sep-2018 15:30:24 - tabulation_time)); build 12-Sep-2018 15:30:24 + // MJD build 12-Sep-2018 15:30:24 + // mjdMS_v has already been filled if the poly pair vector has a non-zero size build 12-Sep-2018 15:30:24 + if (atiIdxMStimePoly_v.size() == 0) { build 12-Sep-2018 15:30:24 + mjdMS_v.push_back(ArrayTime(atiIdxMStime.second).getMJD()); build 12-Sep-2018 15:30:24 + LOG_EPHEM(TO_STRING(mjdMS_v.size()) + ": "); build 12-Sep-2018 15:30:24 + LOG_EPHEM( "resampled " + TO_STRING(mjdMS_v.back())); build 12-Sep-2018 15:30:24 + LOG("mjdMS_v -> "+TO_STRING(mjdMS_v.back())); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // linear interpolations are evaluated relative to the mid point build 12-Sep-2018 15:30:24 + double timeMidPoint = 1.0e-09 * ephRow_v[atiIdxMStime.first]->getTimeInterval().getMidPoint().get(); build 12-Sep-2018 15:30:24 + double time = 1.0e-09 * atiIdxMStime.second; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + LOG("timeMidPoint="+TO_STRING(timeMidPoint)+", time="+TO_STRING(time)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // RA / DEC build 12-Sep-2018 15:30:24 + if (numPolyDirIsOne) { build 12-Sep-2018 15:30:24 + LOG("Eval line for RA"); build 12-Sep-2018 15:30:24 + LOG("atiIdxMStime.first = " + TO_STRING(atiIdxMStime.first)); build 12-Sep-2018 15:30:24 + raMS_v.push_back(evalPoly(raASDM_vv[atiIdxMStime.first].size(), build 12-Sep-2018 15:30:24 + raASDM_vv[atiIdxMStime.first], build 12-Sep-2018 15:30:24 + timeMidPoint, build 12-Sep-2018 15:30:24 + time)); build 12-Sep-2018 15:30:24 + LOG_EPHEM(" " + TO_STRING(raMS_v.back())); build 12-Sep-2018 15:30:24 + LOG("raMS_v -> "+TO_STRING(raMS_v.back())); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + LOG("Eval line for DEC"); build 12-Sep-2018 15:30:24 + decMS_v.push_back(evalPoly(decASDM_vv[atiIdxMStime.first].size(), build 12-Sep-2018 15:30:24 + decASDM_vv[atiIdxMStime.first], build 12-Sep-2018 15:30:24 + timeMidPoint, build 12-Sep-2018 15:30:24 + time)); build 12-Sep-2018 15:30:24 + LOG_EPHEM(" " + TO_STRING(decMS_v.back())); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Distance build 12-Sep-2018 15:30:24 + if (numPolyDistIsOne) { build 12-Sep-2018 15:30:24 + LOG("Eval line for distance"); build 12-Sep-2018 15:30:24 + distanceMS_v.push_back(evalPoly(distanceASDM_vv[atiIdxMStime.first].size(), build 12-Sep-2018 15:30:24 + distanceASDM_vv[atiIdxMStime.first], build 12-Sep-2018 15:30:24 + timeMidPoint, build 12-Sep-2018 15:30:24 + time)); build 12-Sep-2018 15:30:24 + LOG_EPHEM(" " + TO_STRING(distanceMS_v.back())); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Radvel build 12-Sep-2018 15:30:24 + if (radVelExists && numPolyRadVelIsOne) { build 12-Sep-2018 15:30:24 + LOG("Eval line for radvel"); build 12-Sep-2018 15:30:24 + radVelMS_v.push_back(evalPoly(radVelASDM_vv[atiIdxMStime.first].size(), build 12-Sep-2018 15:30:24 + radVelASDM_vv[atiIdxMStime.first], build 12-Sep-2018 15:30:24 + timeMidPoint, build 12-Sep-2018 15:30:24 + time)); build 12-Sep-2018 15:30:24 + LOG_EPHEM(" " + TO_STRING(radVelMS_v.back())); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + LOG_EPHEM("\n"); build 12-Sep-2018 15:30:24 + } // end of linear evaluations build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - // Just copy ephemeris without any interpolation. Just adapt the units. build 12-Sep-2018 15:30:24 - for(const EphemerisRow *eR_p: v) { build 12-Sep-2018 15:30:24 - mjdMS_v.push_back(eR_p->getTimeInterval().getStart().getMJD()); // MJD build 12-Sep-2018 15:30:24 - vector > dir = eR_p->getDir(); build 12-Sep-2018 15:30:24 - raMS_v.push_back(dir[0][0]/3.14159265*180.0); // deg build 12-Sep-2018 15:30:24 - decMS_v.push_back(dir[0][1]/3.14159265*180.0); // deg build 12-Sep-2018 15:30:24 - distanceMS_v.push_back(eR_p->getDistance()[0] / 1.4959787066e11); // AU build 12-Sep-2018 15:30:24 - if (radVelExists) build 12-Sep-2018 15:30:24 - radVelMS_v.push_back(eR_p->getRadVel()[0] / 1.4959787066e11 * 24. * 3600. ); // AU/d build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } // end not if interpolate_ephemeris build 12-Sep-2018 15:30:24 + } // end of the general interpolation case build 12-Sep-2018 15:30:24 + } // end of the non-single row case, everything is ready to push to the MS now build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 // Record the starting time + one time step so that Field can use it if needed. build 12-Sep-2018 15:30:24 @@ -1889,7 +1949,6 @@ void fillEphemeris(ASDM* ds_p, uint64_t timeStepInNanoSecond, bool interpolate_e build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Now the data are ready to be written to the MS Ephemeris table. build 12-Sep-2018 15:30:24 // Let's proceed, using Slicers. build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 unsigned int numRows = raMS_v.size(); build 12-Sep-2018 15:30:24 Slicer slicer(IPosition(1, 0), build 12-Sep-2018 15:30:24 @@ -2028,8 +2087,8 @@ void fillField(ASDM* ds_p, bool considerEphemeris) { build 12-Sep-2018 15:30:24 * about this replacement. build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 string fieldName = r->getFieldName(); build 12-Sep-2018 15:30:24 - if (find_first(fieldName, "&")) { build 12-Sep-2018 15:30:24 - replace_all(fieldName, "&", "#"); build 12-Sep-2018 15:30:24 + if (fieldName.front()=='&') { build 12-Sep-2018 15:30:24 + replace(fieldName.begin(), fieldName.end(), '&', '#'); build 12-Sep-2018 15:30:24 infostream.str(""); build 12-Sep-2018 15:30:24 infostream << "ATTENTION !!! In row #" << i << " of the Field table, the character '&' has been replaced by the character '#' in the field name." << endl; build 12-Sep-2018 15:30:24 info(infostream.str()); build 12-Sep-2018 15:30:24 @@ -2565,7 +2624,7 @@ void fillMainLazily(const string& dsName, build 12-Sep-2018 15:30:24 std::map >& selected_eb_scan_m, build 12-Sep-2018 15:30:24 std::map& effectiveBwPerDD_m, build 12-Sep-2018 15:30:24 Enum e_query_cm, build 12-Sep-2018 15:30:24 - bool checkDupInts) { build 12-Sep-2018 15:30:24 + bool checkdupints) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 LOGENTER("fillMainLazily"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -2592,8 +2651,10 @@ void fillMainLazily(const string& dsName, build 12-Sep-2018 15:30:24 for ( vector::const_iterator iter_v = temp.begin(); iter_v != temp.end(); iter_v++) { build 12-Sep-2018 15:30:24 map >::iterator iter_m = selected_eb_scan_m.find((*iter_v)->getExecBlockId().getTagValue()); build 12-Sep-2018 15:30:24 if ( iter_m != selected_eb_scan_m.end() && iter_m->second.find((*iter_v)->getScanNumber()) != iter_m->second.end() ) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - string abspath = complete(path(dsName)).string() + "/ASDMBinary/" + replace_all_copy(replace_all_copy((*iter_v)->getDataUID().getEntityId().toString(), ":", "_"), "/", "_"); build 12-Sep-2018 15:30:24 + string dataUID = (*iter_v)->getDataUID().getEntityId().toString(); build 12-Sep-2018 15:30:24 + replace(dataUID.begin(),dataUID.end(),':','_'); build 12-Sep-2018 15:30:24 + replace(dataUID.begin(),dataUID.end(),'/','_'); build 12-Sep-2018 15:30:24 + string abspath = Path(dsName + "/ASDMBinary/" + dataUID).absoluteName(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Are these data radiometric , if yes consider them both for corrected and uncorrected ms? build 12-Sep-2018 15:30:24 // ProcessorType processorType = procT.getRowByKey(cfgDscT.getRowByKey((*iter_v)->getConfigDescriptionId())->getProcessorId())->getProcessorType(); build 12-Sep-2018 15:30:24 @@ -2942,7 +3003,7 @@ void fillMainLazily(const string& dsName, build 12-Sep-2018 15:30:24 double interval = deltaTime / 1000000000.0; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // should the first integration be skipped? Any actual skipping happens later. build 12-Sep-2018 15:30:24 - bool skipFirstIntegration = checkDupInts && lastTimeMap[mR_p->getConfigDescriptionId()] == ArrayTime(startTime).getMJD(); build 12-Sep-2018 15:30:24 + bool skipFirstIntegration = checkdupints && lastTimeMap[mR_p->getConfigDescriptionId()] == ArrayTime(startTime).getMJD(); build 12-Sep-2018 15:30:24 if (debug && skipFirstIntegration) { build 12-Sep-2018 15:30:24 cout << "Duplicate time seen in Row : " << mainRowIndex build 12-Sep-2018 15:30:24 << " cdId : " << mR_p->getConfigDescriptionId() build 12-Sep-2018 15:30:24 @@ -4186,7 +4247,7 @@ void fillSysPower(const string asdmDirectory, ASDM* ds_p, bool ignoreTime, const build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 // We can assume that there is an SysPower table , but we don't know yet if it's stored in a binary or an XML file. build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 - if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(asdmDirectory + "/SysPower.bin")))) { build 12-Sep-2018 15:30:24 + if (file_exists(uniqSlashes(asdmDirectory + "/SysPower.bin"))) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 LOG("fillSysPower : working with SysPower.bin by successive slices."); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -4217,7 +4278,7 @@ void fillSysPower(const string asdmDirectory, ASDM* ds_p, bool ignoreTime, const build 12-Sep-2018 15:30:24 tsrSysPower.close(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - else if (boost::filesystem::exists(boost::filesystem::path(uniqSlashes(asdmDirectory + "/SysPower.xml")))) { build 12-Sep-2018 15:30:24 + else if (file_exists(uniqSlashes(asdmDirectory + "/SysPower.xml"))) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 LOG("fillSysPower : working with SysPower.xml read with a TableSAXReader"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -4378,6 +4439,7 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 string msNameExtension; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 appName = string(argv[0]); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 ofstream ofs; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 //LogSinkInterface& lsif = LogSink::globalSink(); build 12-Sep-2018 15:30:24 @@ -4387,136 +4449,270 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 bool mute = false; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - bool doparallel = false; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 bool ac_xc_per_timestamp = false; // for the time being the option is 'preserve the old order' build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - bool interpolate_ephemeris = false ; build 12-Sep-2018 15:30:24 + bool interpolate_ephemeris = false; build 12-Sep-2018 15:30:24 bool tabulate_ephemeris_polynomials = false; build 12-Sep-2018 15:30:24 - double polyephem_tabtimestep = 0.0; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkDupInts = true; build 12-Sep-2018 15:30:24 + double polyephem_tabtimestep = 0.001; build 12-Sep-2018 15:30:24 + bool checkRowUniqueness = false; build 12-Sep-2018 15:30:24 + string scansOptionInfo; build 12-Sep-2018 15:30:24 + string asisOption; build 12-Sep-2018 15:30:24 + bool ignoreTime = false; build 12-Sep-2018 15:30:24 + bool processSysPower = true; build 12-Sep-2018 15:30:24 + bool processCalDevice = true; build 12-Sep-2018 15:30:24 + bool processPointing = true; build 12-Sep-2018 15:30:24 + bool withPointingCorrection = false; build 12-Sep-2018 15:30:24 + bool processEphemeris = true; build 12-Sep-2018 15:30:24 + bool checkdupints = true; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Process command line options and parameters. build 12-Sep-2018 15:30:24 - po::variables_map vm; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - try { build 12-Sep-2018 15:30:24 + // all of the non-positional options need to be enumerated here build 12-Sep-2018 15:30:24 + // note that asdm-directory and ms-directory-prefix can be specified as both build 12-Sep-2018 15:30:24 + // positional arguments and as named arguments. The positional argument takes build 12-Sep-2018 15:30:24 + // precedence. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + enum optionIndex { UNKNOWN, HELP, ICM, ISRT, ITS, OCM, COMPRESSION, build 12-Sep-2018 15:30:24 + ASIS, WVRCORRDATA, SCANS, LOGFILE, VERBOSE, REVISION, build 12-Sep-2018 15:30:24 + DRYRUN, IGNORETIME, NOCALDEV, NOEPHEMERIS, NOSYSPOWER, build 12-Sep-2018 15:30:24 + NOPOINTING, CHECKROWUNIQ, BDFSLICESIZE, LAZY, build 12-Sep-2018 15:30:24 + WITHPCORR, ACXCPERTIME, POLYEPHTSTEP, INTEPHEM, build 12-Sep-2018 15:30:24 + ASDMDIR, MSDIRPREFIX, CHECKDUPINTS }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Declare the supported options. build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::options_description generic("Converts an ASDM dataset into a CASA measurement set.\n" build 12-Sep-2018 15:30:24 - "Usage : " + appName +" [options] asdm-directory [ms-directory-prefix]\n\n" build 12-Sep-2018 15:30:24 - "Command parameters: \n" build 12-Sep-2018 15:30:24 - " asdm-directory : the pathname to the ASDM dataset to be converted \n" build 12-Sep-2018 15:30:24 - " ms-directory-prefix : the prefix of the pathname(s) of the measurement set(s ) to be created,\n" build 12-Sep-2018 15:30:24 - " this prefis is completed by a suffix to form the name(s) of the resulting measurement set(s), \n" build 12-Sep-2018 15:30:24 - " this suffix depends on the selected options (see options compression and wvr-corrected-data) \n" build 12-Sep-2018 15:30:24 - ".\n\n" build 12-Sep-2018 15:30:24 - "Allowed options:"); build 12-Sep-2018 15:30:24 - generic.add_options() build 12-Sep-2018 15:30:24 - ("help", "produces help message.") build 12-Sep-2018 15:30:24 - ("icm", po::value()->default_value("all"), "specifies the correlation mode to be considered on input. A quoted string containing a sequence of 'ao' 'co' 'ac' 'all' separated by whitespaces is expected") build 12-Sep-2018 15:30:24 - ("isrt", po::value()->default_value("all"), "specifies the spectral resolution type to be considered on input. A quoted string containing a sequence of 'fr' 'ca' 'bw' 'all' separated by whitespaces is expected") build 12-Sep-2018 15:30:24 - ("its", po::value()->default_value("all"), "specifies the time sampling (INTEGRATION and/or SUBINTEGRATION) to be considered on input. A quoted string containing a sequence of 'i' 'si' 'all' separated by whitespaces is expected") build 12-Sep-2018 15:30:24 - ("ocm", po::value()->default_value("ca"), "output data for correlation mode AUTO_ONLY (ao) or CROSS_ONLY (co) or CROSS_AND_AUTO (ca)") build 12-Sep-2018 15:30:24 - ("compression,c", "produces compressed columns in the resulting measurement set (not set by default). When this option is selected the string '-compressed' is inserted in the pathname of the resulting measurement set.") build 12-Sep-2018 15:30:24 - ("asis", po::value(), "creates verbatim copies of the ASDM tables in the output measurement set. The value given to this option must be a quoted string containing a list of table names separated by space characters; the wildcard character '*' is allowed in table names.") build 12-Sep-2018 15:30:24 - ("wvr-corrected-data", po::value()->default_value("no"), "specifies wich values are considered in the ASDM binary data to fill the DATA column in the MAIN table of the MS. Expected values for this option are 'no' for the uncorrected data (this is the default), 'yes' for the corrected data and 'both' for corrected and uncorrected data. In the latter case, two measurement sets are created, one containing the uncorrected data and the other one, whose name is suffixed by '-wvr-corrected', containing the corrected data.") build 12-Sep-2018 15:30:24 - ("scans,s", po::value(), "processes only the scans specified in the option's value. This value is a semicolon separated list of scan specifications. A scan specification consists in an exec bock index followed by the character ':' followed by a comma separated list of scan indexes or scan index ranges. A scan index is relative to the exec block it belongs to. Scan indexes are 1-based while exec blocks's are 0-based. \"0:1\" or \"2:2~6\" or \"0:1,1:2~6,8;2:,3:24~30\" \"1,2\" are valid values for the option. \"3:\" alone will be interpreted as 'all the scans of the exec block#3'. An scan index or a scan index range not preceded by an exec block index will be interpreted as 'all the scans with such indexes in all the exec blocks'. By default all the scans are considered.") build 12-Sep-2018 15:30:24 - ("logfile,l", po::value(), "specifies the log filename. If the option is not used then the logged informations are written to the standard error stream.") build 12-Sep-2018 15:30:24 - ("verbose,v", "logs numerous informations as the filler is working.") build 12-Sep-2018 15:30:24 - ("revision,r", "logs information about the revision of this application.") build 12-Sep-2018 15:30:24 - ("dry-run,m", "does not fill the MS MAIN table.") build 12-Sep-2018 15:30:24 - ("ignore-time,t", "all the rows of the tables Feed, History, Pointing, Source, SysCal, CalDevice, SysPower and Weather are processed independently of the time range of the selected exec block / scan.") build 12-Sep-2018 15:30:24 - ("no-caldevice", "The CalDevice table will be ignored.") build 12-Sep-2018 15:30:24 - ("no-ephemeris", "The ephemeris table will be ignored.") build 12-Sep-2018 15:30:24 - ("no-syspower", "the SysPower table will be ignored.") build 12-Sep-2018 15:30:24 - ("no-pointing", "The Pointing table will be ignored.") build 12-Sep-2018 15:30:24 - ("check-row-uniqueness", "The row uniqueness constraint will be checked in the tables where it's defined") build 12-Sep-2018 15:30:24 - ("bdf-slice-size", po::value(&bdfSliceSizeInMb)->default_value(500), "The maximum amount of memory expressed as an integer in units of megabytes (1024*1024) allocated for BDF data. The default is 500 (megabytes)") build 12-Sep-2018 15:30:24 - //("parallel", "run with multithreading mode.") build 12-Sep-2018 15:30:24 - ("lazy", "defers the production of the observational data in the MS Main table (DATA column) - Purely experimental, don't use in production !") build 12-Sep-2018 15:30:24 - ("with-pointing-correction", "add (ASDM::Pointing::encoder - ASDM::Pointing::pointingDirection) to the value to be written in MS::Pointing::direction - (related with JIRA tickets CSV-2878 and ICT-1532))") build 12-Sep-2018 15:30:24 - ("ac-xc-per-timestamp", po::value()->default_value("no"), "if set to yes, then the filler writes in that order autocorrelations and cross correlations rows for one given data description and timestamp. Otherwise auto correlations data are grouped for a sequence of time stamps and then come the cross correlations data for the same sequence of timestamps.") build 12-Sep-2018 15:30:24 - ("polyephem-tabtimestep", po::value(&polyephem_tabtimestep)->default_value(0.001), "Defines the time step used to tabulate the polynomials found in the columns 'dir', 'distance' and optionally 'radVel' of the ASDM Ephemeris table. The unit to express the time step is the day and the default value is 0.001. If 'radvel' is not present then the radial velocity will be obtained by tabulating the derivative the polynomial found in 'distance'.") build 12-Sep-2018 15:30:24 - ("interpolate-ephemeris", po::value()->default_value("no"), "if set to 'yes' then the filler will resample the sequence of times found in the ASDM Ephemeris table into an evenly spaced sequence of times on which the ephemeris paarameters will obtained by an interpolation of degree 1. Otherwise (!= 'yes') the ephemeris parameters will be copies of what's in the ASDM Ephemeris table on the same sequence of times"); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Hidden options, will be allowed both on command line and build 12-Sep-2018 15:30:24 - // in config file, but will not be shown to the user. build 12-Sep-2018 15:30:24 - po::options_description hidden("Hidden options"); build 12-Sep-2018 15:30:24 - hidden.add_options() build 12-Sep-2018 15:30:24 - ("asdm-directory", po::value< string >(), "asdm directory") build 12-Sep-2018 15:30:24 - ; build 12-Sep-2018 15:30:24 - hidden.add_options() build 12-Sep-2018 15:30:24 - ("ms-directory-prefix", po::value< string >(), "ms directory prefix") build 12-Sep-2018 15:30:24 - ; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // This is only used by the test programs. Not indended for general use. build 12-Sep-2018 15:30:24 - hidden.add_options() build 12-Sep-2018 15:30:24 - ("checkdupints", po::value()->default_value("true"),"a value of false turns off checks for duplicate integration times in RADIOMETER data") build 12-Sep-2018 15:30:24 - ; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::options_description cmdline_options; build 12-Sep-2018 15:30:24 - cmdline_options.add(generic).add(hidden); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::positional_options_description p; build 12-Sep-2018 15:30:24 - p.add("asdm-directory", 1); build 12-Sep-2018 15:30:24 - p.add("ms-directory-prefix", 1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Parse the command line and retrieve the options and parameters. build 12-Sep-2018 15:30:24 - po::store(po::command_line_parser(argc, argv).options(cmdline_options).positional(p).run(), vm); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - po::notify(vm); build 12-Sep-2018 15:30:24 + try { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // remove the program name build 12-Sep-2018 15:30:24 + argc--; build 12-Sep-2018 15:30:24 + argv++; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + string usageIntro = build 12-Sep-2018 15:30:24 + "Converts an ASDM dataset into a CASA measurement set.\n" build 12-Sep-2018 15:30:24 + "Usage : " + appName + " [options] asdm-directory [ms-directory-prefix]\n\n" build 12-Sep-2018 15:30:24 + "Command parameters: \n"; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Descriptor elements are: OptionIndex, OptionType, shortopt, longopt, check_arg, help build 12-Sep-2018 15:30:24 + option::Descriptor usage[] = { build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, usageIntro.c_str()}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, " \tasdm-directory : \tthe pathname to the ASDM dataset to be converted"}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, build 12-Sep-2018 15:30:24 + " \tms-directory-prefix : \tthe prefix of the pathname(s) of the measurement " build 12-Sep-2018 15:30:24 + "set(s) to be created. This prefix is completed by a suffix to form the " build 12-Sep-2018 15:30:24 + "name(s) of the resulting measurement set(s). " build 12-Sep-2018 15:30:24 + "this suffix depends on the selected options (see options compression and wvr-corrected-data)."}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, "\nAllowed options:\n"}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, 0 }, // helps with formatting build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // these are the actual options build 12-Sep-2018 15:30:24 + { HELP, 0, "", "help", AlmaArg::None, " --help \tproduces this help message."}, build 12-Sep-2018 15:30:24 + { ICM, 0, "", "icm", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " --icm arg (=all) \tspecifies the correlation mode to be considered on input. " build 12-Sep-2018 15:30:24 + "A quoted string containing a sequence of 'ao' 'co' 'ac' 'all' separated by whitespaces is expected"}, build 12-Sep-2018 15:30:24 + { ISRT, 0, "", "isrt", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " --isrt arg (=all) \tspecifies the spectral resolution type to be considered on input. " build 12-Sep-2018 15:30:24 + "A quoted string containing a sequence of 'fr' 'ca' 'bw' 'all' separated by whitespaces is expected"}, build 12-Sep-2018 15:30:24 + { ITS, 0, "", "its", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " --its arg (=all) \tspecifies the time sampling (INTEGRATION and/or SUBINTEGRATION) to be considered on input. " build 12-Sep-2018 15:30:24 + "A quoted string containing a sequence of 'i' 'si' 'all' separated by whitespaces is expected"}, build 12-Sep-2018 15:30:24 + { OCM, 0, "", "ocm", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " --ocm arg (=ca) \toutput data for correlation mode AUTO_ONLY (ao) or CROSS_ONLY (co) or CROSS_AND_AUTO (ca)"}, build 12-Sep-2018 15:30:24 + { COMPRESSION, 0, "c", "compression", AlmaArg::None, build 12-Sep-2018 15:30:24 + " --c [--compression] \tproduces compressed columns in the resulting measurement set " build 12-Sep-2018 15:30:24 + "(not set by default). When this option is selected the string '-compressed' is inserted " build 12-Sep-2018 15:30:24 + "in the pathname of the resulting measurement set."}, build 12-Sep-2018 15:30:24 + { ASIS, 0, "", "asis", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " --asis arg \tcreates verbatim copies of the ASDM tables in the output measurement set. " build 12-Sep-2018 15:30:24 + "The value given to this option must be a quoted string containing a list of table names " build 12-Sep-2018 15:30:24 + "separated by space characters; the wildcard character '*' is allowed in table names."}, build 12-Sep-2018 15:30:24 + { WVRCORRDATA, 0, "", "wvr-corrected-data", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " --wvr-corrected-data arg (=no) \tspecifies wich values are considered in the ASDM binary data " build 12-Sep-2018 15:30:24 + "to fill the DATA column in the MAIN table of the MS. Expected values for this option are " build 12-Sep-2018 15:30:24 + "'no' for the uncorrected data (this is the default), 'yes' for the corrected data and " build 12-Sep-2018 15:30:24 + "'both' for corrected and uncorrected data. In the latter case, two measurement sets are " build 12-Sep-2018 15:30:24 + "created, one containing the uncorrected data and the other one, whose name is suffixed " build 12-Sep-2018 15:30:24 + "by '-wvr-corrected', containing the corrected data."}, build 12-Sep-2018 15:30:24 + { SCANS, 0, "s", "scans", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " --s [--scans] arg \tprocesses only the scans specified in the option's value. " build 12-Sep-2018 15:30:24 + "This value is a semicolon separated list of scan specifications. A scan specification " build 12-Sep-2018 15:30:24 + "consists of an exec bock index followed by the character ':' followed by a comma separated " build 12-Sep-2018 15:30:24 + "list of scan indexes or scan index ranges. A scan index is relative to the exec block it " build 12-Sep-2018 15:30:24 + "belongs to. Scan indexes are 1-based while exec blocks's are 0-based. " build 12-Sep-2018 15:30:24 + "\"0:1\" or \"2:2~6\" or \"0:1,1:2~6,8;2:,3:24~30\" \"1,2\" are valid values for the option. " build 12-Sep-2018 15:30:24 + "\"3:\" alone will be interpreted as 'all the scans of the exec block#3'. A scan index or a " build 12-Sep-2018 15:30:24 + "scan index range not preceded by an exec block index will be interpreted as 'all the scans with " build 12-Sep-2018 15:30:24 + "such indexes in all the exec blocks'. By default all the scans are considered."}, build 12-Sep-2018 15:30:24 + { LOGFILE, 0, "l", "logfile", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " -l [--logfile] arg \tspecifies the log filename. If the option is not used then the " build 12-Sep-2018 15:30:24 + "logged informations are written to the standard error stream."}, build 12-Sep-2018 15:30:24 + { VERBOSE, 0, "v", "verbose", AlmaArg::None, " -v [--verbose] \tlogs numerous informations as the filler is working."}, build 12-Sep-2018 15:30:24 + { REVISION, 0, "r", "revision", AlmaArg::None, " -r [--revision] \tlogs information about the revision of this application."}, build 12-Sep-2018 15:30:24 + { DRYRUN, 0, "m", "dry-run", AlmaArg::None, " -m [--dry-run] \tdoes not fill the MS MAIN table."}, build 12-Sep-2018 15:30:24 + { IGNORETIME, 0, "t", "ignore-time", AlmaArg::None, build 12-Sep-2018 15:30:24 + " -t [--ignore-time] \tall the rows of the tables Feed, History, Pointing, Source, " build 12-Sep-2018 15:30:24 + "SysCal, CalDevice, SysPower and Weather are processed independently of the time range of the " build 12-Sep-2018 15:30:24 + "selected exec block / scan."}, build 12-Sep-2018 15:30:24 + { NOCALDEV, 0, "", "no-caldevice", AlmaArg::None, " --no-caldevice \tThe CalDevice table will be ignored."}, build 12-Sep-2018 15:30:24 + { NOEPHEMERIS, 0, "", "no-ephemeris", AlmaArg::None, " --no-ephemeris \tThe ephemeris table will be ignored."}, build 12-Sep-2018 15:30:24 + { NOSYSPOWER, 0, "", "no-syspower", AlmaArg::None, " --no-syspower \tThe SysPower table will be ignored."}, build 12-Sep-2018 15:30:24 + { NOPOINTING, 0, "", "no-pointing", AlmaArg::None, " --no-pointing \tThe Pointing table will be ignored."}, build 12-Sep-2018 15:30:24 + { CHECKROWUNIQ, 0, "", "check-row-uniqueness", AlmaArg::None, " --check-row-uniqueness \tThe row uniqueness constraint will be checked in the tables where it's defined"}, build 12-Sep-2018 15:30:24 + { BDFSLICESIZE, 0, "", "bdf-slice-size", AlmaArg::Long, build 12-Sep-2018 15:30:24 + " --bdf-slice-size arg (=500) \tThe maximum amount of memory expressed as an integer " build 12-Sep-2018 15:30:24 + "in units of megabytes (1024*1024) allocated for BDF data. The default is 500 (megabytes)"}, build 12-Sep-2018 15:30:24 + { LAZY, 0, "", "lazy", AlmaArg::None, " --lazy \tdefers the production of the observational data in the MS Main table (DATA column) - Purely experimental, don't use in production !"}, build 12-Sep-2018 15:30:24 + { WITHPCORR, 0, "", "with-pointing-correction", AlmaArg::None, build 12-Sep-2018 15:30:24 + " --with-pointing-correction \tadd (ASDM::Pointing::encoder - ASDM::Pointing::pointingDirection) " build 12-Sep-2018 15:30:24 + "to the value to be written in MS::Pointing::direction - (related with JIRA tickets CSV-2878 and ICT-1532))"}, build 12-Sep-2018 15:30:24 + { ACXCPERTIME, 0, "", "ac-xc-per-timestamp", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " --ac-xc-per-timestamp arg (=no) \tif set to yes, then the filler writes in that order autocorrelations " build 12-Sep-2018 15:30:24 + "and cross correlations rows for one given data description and timestamp. Otherwise auto " build 12-Sep-2018 15:30:24 + "correlations data are grouped for a sequence of time stamps and then come the cross correlations " build 12-Sep-2018 15:30:24 + "data for the same sequence of timestamps."}, build 12-Sep-2018 15:30:24 + { POLYEPHTSTEP, 0, "", "polyephem-tabtimestep", AlmaArg::Float, build 12-Sep-2018 15:30:24 + " --polyephem-tabtimestep arg (=0.001) \tDefines the time step used to tabulate the polynomials " build 12-Sep-2018 15:30:24 + "found in the columns 'dir', 'distance' and optionally 'radVel' of the ASDM Ephemeris table. " build 12-Sep-2018 15:30:24 + "The unit to express the time step is the day and the default value is 0.001. If 'radvel' " build 12-Sep-2018 15:30:24 + "is not present then the radial velocity will be obtained by tabulating the derivative of " build 12-Sep-2018 15:30:24 + "the polynomial found in 'distance'."}, build 12-Sep-2018 15:30:24 + { INTEPHEM, 0, "", "interpolate-ephemeris", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " --interpolate-ephemeris arg (=no) \tif set to 'yes' then the filler will resample the sequence " build 12-Sep-2018 15:30:24 + "of times found in the ASDM Ephemeris table into an evenly spaced sequence of times on which " build 12-Sep-2018 15:30:24 + "the ephemeris paarameters will obtained by an interpolation of degree 1. Otherwise (!= 'yes') " build 12-Sep-2018 15:30:24 + "the ephemeris parameters will be copies of what's in the ASDM Ephemeris table on the same " build 12-Sep-2018 15:30:24 + "sequence of times"}, build 12-Sep-2018 15:30:24 + // these can be set by the command line, but are not shown the user. A config file may set these to be used as a parameter. build 12-Sep-2018 15:30:24 + { ASDMDIR, 0, "", "asdm-directory", AlmaArg::Required, 0 }, build 12-Sep-2018 15:30:24 + { MSDIRPREFIX, 0, "", "ms-directory-prefix", AlmaArg::Required, 0}, build 12-Sep-2018 15:30:24 + // checkdupints is used by the unit tests to turn off checks for duplicate integration times in RADIOMETER data, not intended for normal use build 12-Sep-2018 15:30:24 + { CHECKDUPINTS, 0, "", "checkdupints", AlmaArg::Bool, 0}, build 12-Sep-2018 15:30:24 + { 0, 0, 0, 0, 0, 0 } }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Defaults are set by parsing an argv-like set of options where the values are the defaults build 12-Sep-2018 15:30:24 + const char *defaults[] = { "--icm=all", build 12-Sep-2018 15:30:24 + "--isrt=all", build 12-Sep-2018 15:30:24 + "--its=all", build 12-Sep-2018 15:30:24 + "--ocm=ca", build 12-Sep-2018 15:30:24 + "--wvr-corrected-data=no", build 12-Sep-2018 15:30:24 + "--bdf-slice-size=500", build 12-Sep-2018 15:30:24 + "--ac-xc-per-timestamp=no", build 12-Sep-2018 15:30:24 + "--polyephem-tabtimestep=0.001", build 12-Sep-2018 15:30:24 + "--interpolate-ephemeris=no", build 12-Sep-2018 15:30:24 + "--checkdupints=true", build 12-Sep-2018 15:30:24 + (const char *)-1}; // unambiguously signal the end build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // count defaults, more robust than setting a value here that must be changed when defaults changes build 12-Sep-2018 15:30:24 + int defaultCount = 0; build 12-Sep-2018 15:30:24 + while (defaults[defaultCount] != (const char *) -1) ++defaultCount; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // parse defaults, argv build 12-Sep-2018 15:30:24 + // establish sizes build 12-Sep-2018 15:30:24 + option::Stats stats; build 12-Sep-2018 15:30:24 + // true here turns on re-ordering of args so that positional argument are always seen last build 12-Sep-2018 15:30:24 + stats.add(true, usage, defaultCount, defaults); build 12-Sep-2018 15:30:24 + stats.add(true, usage, argc, argv); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // buffers to hold the parsed options build 12-Sep-2018 15:30:24 + // options has one element per optionIndex, last value is the last time it was set build 12-Sep-2018 15:30:24 + // buffer has one element for each option encountered, in order. Not used here. build 12-Sep-2018 15:30:24 + option::Option options[stats.options_max], buffer[stats.buffer_max]; build 12-Sep-2018 15:30:24 + option::Parser parse; build 12-Sep-2018 15:30:24 + // parse the defaults first, then argv. User set options always come last build 12-Sep-2018 15:30:24 + // true here has same meaning as in stats above. This may not be necessary here, I think build 12-Sep-2018 15:30:24 + // the stats usage above has already reorderded argv in place. build 12-Sep-2018 15:30:24 + parse.parse(true, usage, defaultCount, defaults, options, buffer); build 12-Sep-2018 15:30:24 + parse.parse(true, usage, argc, argv, options, buffer); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Where do the log messages should go ? build 12-Sep-2018 15:30:24 - if (vm.count("logfile")) { build 12-Sep-2018 15:30:24 - //LogSinkInterface *theSink; build 12-Sep-2018 15:30:24 + if (parse.error()) { build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + errstream << "Problem parsing the command line arguments"; build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // User-specified logfile? build 12-Sep-2018 15:30:24 + if (options[LOGFILE] != NULL && options[LOGFILE].last()->arg != NULL) { build 12-Sep-2018 15:30:24 #if 0 build 12-Sep-2018 15:30:24 // Replaced the change at the LogSink level ... build 12-Sep-2018 15:30:24 - ofs.open(vm["logfile"].as().c_str(), ios_base::app); build 12-Sep-2018 15:30:24 + ofs.open(options[LOGFILE].last()->arg, ios_base::app); build 12-Sep-2018 15:30:24 LogSinkInterface *theSink = new casacore::StreamLogSink(&ofs); build 12-Sep-2018 15:30:24 LogSink::globalSink(theSink); build 12-Sep-2018 15:30:24 #else build 12-Sep-2018 15:30:24 // ... with a change at the cerr (stderr) level since by default global logs are going to cerr (stderr). build 12-Sep-2018 15:30:24 - freopen(vm["logfile"].as().c_str(), "a", stderr); build 12-Sep-2018 15:30:24 + freopen(options[LOGFILE].last()->arg, "a", stderr); build 12-Sep-2018 15:30:24 #endif build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Help ? displays help's content and don't go further. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("help")) { build 12-Sep-2018 15:30:24 + if (options[HELP] || (argc==0) ) { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 - errstream << generic << "\n" ; build 12-Sep-2018 15:30:24 + option::printUsage(errstream, usage,80); build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // too many positional arguments? build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 2) { build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + errstream << "Too many positional options" << endl; build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Verbose or quiet ? build 12-Sep-2018 15:30:24 - verbose = vm.count("verbose") > 0; build 12-Sep-2018 15:30:24 + verbose = options[VERBOSE] != NULL; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Revision ? displays revision's info and don't go further if there is no dataset to process otherwise proceed.... build 12-Sep-2018 15:30:24 string revision = "$Id: asdm2MS.cpp,v 1.84 2011/10/25 14:56:48 mcaillat Exp $\n"; build 12-Sep-2018 15:30:24 - if (vm.count("revision")) { build 12-Sep-2018 15:30:24 - if (!vm.count("asdm-directory")) { build 12-Sep-2018 15:30:24 + if (options[REVISION]) { build 12-Sep-2018 15:30:24 + if (options[ASDMDIR] || parse.nonOptionsCount() > 0) { build 12-Sep-2018 15:30:24 + // don't judge the validity of any asdm-directory here, just that it's set somewhere build 12-Sep-2018 15:30:24 + infostream.str(""); build 12-Sep-2018 15:30:24 + infostream << revision ; build 12-Sep-2018 15:30:24 + info(infostream.str()); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 errstream << revision ; build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - infostream.str(""); build 12-Sep-2018 15:30:24 - infostream << revision ; build 12-Sep-2018 15:30:24 - info(infostream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set the non-string options with required values - always available because of defaults build 12-Sep-2018 15:30:24 + // just make sure the last one provided is always the one used build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + stringstream str(options[BDFSLICESIZE].last()->arg); build 12-Sep-2018 15:30:24 + str >> bdfSliceSizeInMb; build 12-Sep-2018 15:30:24 + if (!str) { build 12-Sep-2018 15:30:24 + // unlikely given that any value was already checked by AlmaArg::Long build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + errstream << "There was an error converting the bdf-slice-size value to an integer."; build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + stringstream str(options[POLYEPHTSTEP].last()->arg); build 12-Sep-2018 15:30:24 + str >> polyephem_tabtimestep; build 12-Sep-2018 15:30:24 + if (!str) { build 12-Sep-2018 15:30:24 + // unlikely given that any value was already checked by AlmaArg::Float build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + errstream << "There was an error converting the polyephem-tabtimestep value to a double"; build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // non-default input data selection is incompatible with the lazy mode build 12-Sep-2018 15:30:24 bool lazyModeOK = true; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + // this always has a value because of defaults build 12-Sep-2018 15:30:24 + string checkdupintsOpt(options[CHECKDUPINTS].last()->arg); build 12-Sep-2018 15:30:24 + trim(checkdupintsOpt); build 12-Sep-2018 15:30:24 + checkdupintsOpt = str_tolower(checkdupintsOpt); build 12-Sep-2018 15:30:24 + // AlmaArg::Bool already guarantees this is either "true" or "false" build 12-Sep-2018 15:30:24 + checkdupints = (checkdupintsOpt == "true"); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // Selection of correlation mode of data to be considered on input. build 12-Sep-2018 15:30:24 istringstream iss; build 12-Sep-2018 15:30:24 string token; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - string icm_opt = vm["icm"].as< string >(); build 12-Sep-2018 15:30:24 + // this always has a value because of defaults build 12-Sep-2018 15:30:24 + string icm_opt = string(options[ICM].last()->arg); build 12-Sep-2018 15:30:24 iss.clear(); build 12-Sep-2018 15:30:24 iss.str(icm_opt); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -4535,14 +4731,15 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 } else { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 errstream << "Token '" << token << "' invalid for --icm option." << endl; build 12-Sep-2018 15:30:24 - errstream << generic << endl; build 12-Sep-2018 15:30:24 + option::printUsage(errstream, usage); build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Selection of spectral resolution type of data to be considered. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - string isrt_opt = vm["isrt"].as< string >(); build 12-Sep-2018 15:30:24 + // this always has a value because of defaults build 12-Sep-2018 15:30:24 + string isrt_opt = string(options[ISRT].last()->arg); build 12-Sep-2018 15:30:24 iss.clear(); build 12-Sep-2018 15:30:24 iss.str(isrt_opt); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -4561,15 +4758,15 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 } else { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 errstream << "Token '" << token << "' invalid for --isrt option." << endl; build 12-Sep-2018 15:30:24 - errstream << generic; build 12-Sep-2018 15:30:24 + option::printUsage(errstream, usage); build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Selection of the time sampling of data to be considered (integration and/or subintegration) build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - string its_opt = vm["its"].as < string >(); build 12-Sep-2018 15:30:24 + // this always has a value because of defaults build 12-Sep-2018 15:30:24 + string its_opt = string(options[ITS].last()->arg); build 12-Sep-2018 15:30:24 iss.clear(); build 12-Sep-2018 15:30:24 iss.str(its_opt); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -4585,14 +4782,14 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 } else { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 errstream << "Token '" << token << "' invalid for its option." << endl; build 12-Sep-2018 15:30:24 - errstream << generic ; build 12-Sep-2018 15:30:24 + option::printUsage(errstream, usage); build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Selection of the correlation mode of data to be produced in the measurement set. build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - string ocm_opt = vm["ocm"].as< string >(); build 12-Sep-2018 15:30:24 + // this always has a value because of defaults build 12-Sep-2018 15:30:24 + string ocm_opt = string(options[OCM].last()->arg); build 12-Sep-2018 15:30:24 if ( ocm_opt.compare("co") == 0 ) build 12-Sep-2018 15:30:24 e_query_cm = CROSS_ONLY; build 12-Sep-2018 15:30:24 else if ( ocm_opt.compare("ao") == 0 ) build 12-Sep-2018 15:30:24 @@ -4602,35 +4799,51 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 errstream << "Token '" << ocm_opt << "' invalid for ocm option." << endl; build 12-Sep-2018 15:30:24 - errstream << generic ; build 12-Sep-2018 15:30:24 + option::printUsage(errstream, usage); build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("asdm-directory")) { build 12-Sep-2018 15:30:24 - string dummy = vm["asdm-directory"].as< string >(); build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 0 || options[ASDMDIR]) { build 12-Sep-2018 15:30:24 + string dummy; build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 0) { build 12-Sep-2018 15:30:24 + dummy = string(parse.nonOption(0)); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // ASDMDIR must have been set build 12-Sep-2018 15:30:24 + dummy = string(options[ASDMDIR].last()->arg); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 dsName = lrtrim(dummy) ; build 12-Sep-2018 15:30:24 - if (boost::algorithm::ends_with(dsName,"/")) dsName.erase(dsName.size()-1); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 + if (dsName.back()=='/') dsName.erase(dsName.size()-1); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 - errstream << generic ; build 12-Sep-2018 15:30:24 + option::printUsage(errstream, usage); build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - if (vm.count("ms-directory-prefix")) { build 12-Sep-2018 15:30:24 - string dummyMSName = vm["ms-directory-prefix"].as< string >(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 1 || options[MSDIRPREFIX]) { build 12-Sep-2018 15:30:24 + string dummyMSName; build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 1) { build 12-Sep-2018 15:30:24 + dummyMSName = string(parse.nonOption(1)); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // MSDIRPREFIX must be set build 12-Sep-2018 15:30:24 + dummyMSName = string(options[MSDIRPREFIX].last()->arg); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 dummyMSName = lrtrim(dummyMSName); build 12-Sep-2018 15:30:24 - if (boost::algorithm::ends_with(dummyMSName, "/")) dummyMSName.erase(dummyMSName.size()-1); build 12-Sep-2018 15:30:24 -#if (BOOST_FILESYSTEM_VERSION == 3) build 12-Sep-2018 15:30:24 - boost::filesystem::path msPath(lrtrim(dummyMSName)); build 12-Sep-2018 15:30:24 -#else build 12-Sep-2018 15:30:24 - boost::filesystem::path msPath(lrtrim(dummyMSName),&boost::filesystem::no_check); build 12-Sep-2018 15:30:24 -#endif build 12-Sep-2018 15:30:24 - string msDirectory = msPath.branch_path().string(); build 12-Sep-2018 15:30:24 - msDirectory = lrtrim(msDirectory); build 12-Sep-2018 15:30:24 + if (dummyMSName.back()=='/') dummyMSName.erase(dummyMSName.size()-1); build 12-Sep-2018 15:30:24 + Path msPath(dummyMSName); build 12-Sep-2018 15:30:24 + string msDirectory = msPath.dirName(); build 12-Sep-2018 15:30:24 if (msDirectory.size() == 0) msDirectory = "."; build 12-Sep-2018 15:30:24 - msNamePrefix = msDirectory + "/" + boost::filesystem::basename(msPath); build 12-Sep-2018 15:30:24 - msNameExtension = boost::filesystem::extension(msPath); build 12-Sep-2018 15:30:24 + // extract the prefix and extension. Prefix is everything before any final "." build 12-Sep-2018 15:30:24 + // extension is everything after any final ".", including that final dot. build 12-Sep-2018 15:30:24 + string msPathBasename = msPath.baseName(); build 12-Sep-2018 15:30:24 + size_t rdot = msPathBasename.find_last_of('.'); build 12-Sep-2018 15:30:24 + if (rdot != std::string::npos) { build 12-Sep-2018 15:30:24 + msNameExtension = msPathBasename.substr(rdot,msPathBasename.size()-rdot); build 12-Sep-2018 15:30:24 + msNamePrefix = msPathBasename.substr(0,rdot); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + msNameExtension = ""; build 12-Sep-2018 15:30:24 + msNamePrefix = msPathBasename; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + msNamePrefix = msDirectory + "/" + msNamePrefix; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 msNamePrefix = dsName; build 12-Sep-2018 15:30:24 @@ -4638,19 +4851,19 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Does the user want compressed columns in the resulting MS ? build 12-Sep-2018 15:30:24 - if ((withCompression = (vm.count("compression") != 0))) { build 12-Sep-2018 15:30:24 + if ((withCompression = (options[COMPRESSION] != NULL))) { build 12-Sep-2018 15:30:24 infostream.str(""); build 12-Sep-2018 15:30:24 infostream << "Compressed columns in the resulting MS(s) : Yes" ; build 12-Sep-2018 15:30:24 info(infostream.str()); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 infostream.str(""); build 12-Sep-2018 15:30:24 infostream << "Compressed columns in the resulting MS(s) : No" ; build 12-Sep-2018 15:30:24 info(infostream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // WVR uncorrected and|or corrected data required ? build 12-Sep-2018 15:30:24 - string wvr_corrected_data = vm["wvr-corrected-data"].as(); build 12-Sep-2018 15:30:24 + // always available because of defaults build 12-Sep-2018 15:30:24 + string wvr_corrected_data = string(options[WVRCORRDATA].last()->arg); build 12-Sep-2018 15:30:24 if (wvr_corrected_data.compare("no") == 0) build 12-Sep-2018 15:30:24 es_query_apc.fromString("AP_UNCORRECTED"); build 12-Sep-2018 15:30:24 else if (wvr_corrected_data.compare("yes") == 0) build 12-Sep-2018 15:30:24 @@ -4660,12 +4873,12 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 errstream << "Token '" << wvr_corrected_data << "' invalid for wvr-corrected-data." << endl; build 12-Sep-2018 15:30:24 - errstream << generic; build 12-Sep-2018 15:30:24 + option::printUsage(errstream, usage); build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Do we want an MS Main table to be filled or not ? build 12-Sep-2018 15:30:24 - mute = vm.count("dry-run") != 0; build 12-Sep-2018 15:30:24 + mute = (options[DRYRUN] != NULL); build 12-Sep-2018 15:30:24 if (mute) { build 12-Sep-2018 15:30:24 infostream.str(""); build 12-Sep-2018 15:30:24 infostream << "option dry-run is used, the MS Main table will not be filled" << endl; build 12-Sep-2018 15:30:24 @@ -4677,15 +4890,7 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 infostream << "the BDF slice size is set to " << bdfSliceSizeInMb << " megabytes." << endl; build 12-Sep-2018 15:30:24 info(infostream.str()); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Do we process in parallel ? build 12-Sep-2018 15:30:24 - doparallel = vm.count("parallel") != 0; build 12-Sep-2018 15:30:24 - if (doparallel) { build 12-Sep-2018 15:30:24 - infostream.str(""); build 12-Sep-2018 15:30:24 - infostream << "run in multithreading mode" << endl; build 12-Sep-2018 15:30:24 - info(infostream.str()); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - lazy = vm.count("lazy") != 0; build 12-Sep-2018 15:30:24 + lazy = options[LAZY] != NULL; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (lazy && !lazyModeOK) { build 12-Sep-2018 15:30:24 lazy = false; build 12-Sep-2018 15:30:24 @@ -4696,18 +4901,20 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 warning(infostream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // check for duplicate integrations in RADIOMETER data? build 12-Sep-2018 15:30:24 - checkDupInts = vm["checkdupints"].as< bool >(); build 12-Sep-2018 15:30:24 if (debug) { build 12-Sep-2018 15:30:24 - cout << "checkDupInts : " << checkDupInts << endl; build 12-Sep-2018 15:30:24 + cout << "checkdupints : " << checkdupints << endl; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Do we consider another order than ac_xc_per_timestamp ? build 12-Sep-2018 15:30:24 - ac_xc_per_timestamp = (vm.count("ac-xc-per-timestamp") == 0) ? false : build 12-Sep-2018 15:30:24 - boost::algorithm::to_lower_copy(vm["ac-xc-per-timestamp"].as()) == "yes"; build 12-Sep-2018 15:30:24 + // always available because of defaults build 12-Sep-2018 15:30:24 + string acXcOpt = string(options[ACXCPERTIME].last()->arg); build 12-Sep-2018 15:30:24 + ac_xc_per_timestamp = str_tolower(acXcOpt) == "yes"; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Do we want to tabulate polynomial present in the ephemeris table ? build 12-Sep-2018 15:30:24 - tabulate_ephemeris_polynomials = (vm.count("polyephem-tabtimestep") != 0); build 12-Sep-2018 15:30:24 + // This is inferred by seeing if the user specifically set this. build 12-Sep-2018 15:30:24 + // But it's set at least once because of defaults, so, look for there being build 12-Sep-2018 15:30:24 + // more than one of these in options. build 12-Sep-2018 15:30:24 + tabulate_ephemeris_polynomials = (options[POLYEPHTSTEP].count() > 1); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (tabulate_ephemeris_polynomials) { build 12-Sep-2018 15:30:24 // If we tabluate then ignore all the other options about ephemeris build 12-Sep-2018 15:30:24 @@ -4717,8 +4924,9 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 // info(infostream.str()); build 12-Sep-2018 15:30:24 } else { build 12-Sep-2018 15:30:24 // Do we want interpolate the values found in the ASDM Ephemeris table or not ? build 12-Sep-2018 15:30:24 - interpolate_ephemeris = (vm.count("interpolate-ephemeris") == 0) ? false : build 12-Sep-2018 15:30:24 - boost::algorithm::to_lower_copy(vm["interpolate-ephemeris"].as()) == "yes"; build 12-Sep-2018 15:30:24 + // always available because of defaults build 12-Sep-2018 15:30:24 + string intEphOpt = string(options[INTEPHEM].last()->arg); build 12-Sep-2018 15:30:24 + interpolate_ephemeris = str_tolower(intEphOpt) == "yes"; build 12-Sep-2018 15:30:24 infostream.str(""); build 12-Sep-2018 15:30:24 if (interpolate_ephemeris) { build 12-Sep-2018 15:30:24 infostream << "the MS Ephemeris table(s) will be produced by interpolation of the values present in the ASDM Ephemeris table on a resampled time grid."; build 12-Sep-2018 15:30:24 @@ -4728,22 +4936,27 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 info(infostream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + checkRowUniqueness = options[CHECKROWUNIQ] != NULL; build 12-Sep-2018 15:30:24 + if (options[SCANS]) { build 12-Sep-2018 15:30:24 + scansOptionInfo = string(options[SCANS].last()->arg); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (options[ASIS]) { build 12-Sep-2018 15:30:24 + asisOption = string(options[ASIS].last()->arg); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + ignoreTime = options[IGNORETIME] != NULL; build 12-Sep-2018 15:30:24 + processSysPower = options[NOSYSPOWER] == NULL; build 12-Sep-2018 15:30:24 + processCalDevice = options[NOCALDEV] == NULL; build 12-Sep-2018 15:30:24 + processPointing = options[NOPOINTING] == NULL; build 12-Sep-2018 15:30:24 + withPointingCorrection = options[WITHPCORR] != NULL; build 12-Sep-2018 15:30:24 + processEphemeris = options[NOEPHEMERIS] == NULL; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 catch (std::exception& e) { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 errstream << e.what(); build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - // this just a dummy number for now (innthread may build 12-Sep-2018 15:30:24 - // come from user input in future..) build 12-Sep-2018 15:30:24 - // Also setting environment variable, OMP_NUM_THREADS=1 build 12-Sep-2018 15:30:24 - // one can excute multiwrite part in a single thread. build 12-Sep-2018 15:30:24 - int innthread = 4; build 12-Sep-2018 15:30:24 - if (doparallel && innthread > 1) { build 12-Sep-2018 15:30:24 - doparallel = true; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - //if(doparallel) cerr<<"DO PARALLEL...."< selectedScanRow_v; build 12-Sep-2018 15:30:24 map > selected_eb_scan_m; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - string scansOptionInfo; build 12-Sep-2018 15:30:24 - if (vm.count("scans")) { build 12-Sep-2018 15:30:24 - string scansOptionValue = vm["scans"].as< string >(); build 12-Sep-2018 15:30:24 - eb_scan_selection ebs; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - int status = parse(scansOptionValue.c_str(), ebs, space_p).full; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + if (scansOptionInfo.size()>0) { build 12-Sep-2018 15:30:24 + map > eb_scan_m; build 12-Sep-2018 15:30:24 + int status = scansParser(scansOptionInfo, eb_scan_m); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 if (status == 0) { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 - errstream << "'" << scansOptionValue << "' is an invalid scans selection." << endl; build 12-Sep-2018 15:30:24 + errstream << "'" << scansOptionInfo << "' is an invalid scans selection." << endl; build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -4909,12 +5118,6 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 scansOptionInfo = "All scans of all exec blocks will be processed \n"; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - bool ignoreTime = vm.count("ignore-time") != 0; build 12-Sep-2018 15:30:24 - bool processSysPower = vm.count("no-syspower") == 0; build 12-Sep-2018 15:30:24 - bool processCalDevice = vm.count("no-caldevice") == 0; build 12-Sep-2018 15:30:24 - bool processPointing = vm.count("no-pointing") == 0; build 12-Sep-2018 15:30:24 - bool withPointingCorrection = vm.count("with-pointing-correction") != 0; build 12-Sep-2018 15:30:24 - bool processEphemeris = vm.count("no-ephemeris") == 0; build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 // Report the selection's parameters. build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 @@ -5050,40 +5253,19 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 // Create the measurement set(s). build 12-Sep-2018 15:30:24 if (!false) { build 12-Sep-2018 15:30:24 try { build 12-Sep-2018 15:30:24 - if(doparallel) { build 12-Sep-2018 15:30:24 - // should use pass vec. of spectral ids build 12-Sep-2018 15:30:24 - // partitionMS(SwIds, build 12-Sep-2018 15:30:24 - // msNames, build 12-Sep-2018 15:30:24 - // complexData, build 12-Sep-2018 15:30:24 - // withCompression, build 12-Sep-2018 15:30:24 - // telName, build 12-Sep-2018 15:30:24 - // maxNumCorr, build 12-Sep-2018 15:30:24 - // maxNumChan); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - /*** build 12-Sep-2018 15:30:24 - for (int i=0; i < msFillers_v.size(); i++) { build 12-Sep-2018 15:30:24 - for (map::iterator iter = msFillers_v[i].begin(); build 12-Sep-2018 15:30:24 - iter != msFillers_v[i].end(); ++iter) { build 12-Sep-2018 15:30:24 - //cerr<<"ms name: "<second->msPath()<::iterator iter = msNames.begin(); iter != msNames.end(); ++iter) { build 12-Sep-2018 15:30:24 - info("About to create a filler for the measurement set '" + msNames[iter->first] + "'"); build 12-Sep-2018 15:30:24 - msFillers[iter->first] = new ASDM2MSFiller(msNames[iter->first], build 12-Sep-2018 15:30:24 - 0.0, build 12-Sep-2018 15:30:24 - false, build 12-Sep-2018 15:30:24 - complexData, build 12-Sep-2018 15:30:24 - withCompression, build 12-Sep-2018 15:30:24 - telName, build 12-Sep-2018 15:30:24 - maxNumCorr, build 12-Sep-2018 15:30:24 - maxNumChan, build 12-Sep-2018 15:30:24 - false, build 12-Sep-2018 15:30:24 - lazy); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 + if (lazy) casa::AsdmStMan::registerClass(); build 12-Sep-2018 15:30:24 + for (map::iterator iter = msNames.begin(); iter != msNames.end(); ++iter) { build 12-Sep-2018 15:30:24 + info("About to create a filler for the measurement set '" + msNames[iter->first] + "'"); build 12-Sep-2018 15:30:24 + msFillers[iter->first] = new ASDM2MSFiller(msNames[iter->first], build 12-Sep-2018 15:30:24 + 0.0, build 12-Sep-2018 15:30:24 + false, build 12-Sep-2018 15:30:24 + complexData, build 12-Sep-2018 15:30:24 + withCompression, build 12-Sep-2018 15:30:24 + telName, build 12-Sep-2018 15:30:24 + maxNumCorr, build 12-Sep-2018 15:30:24 + maxNumChan, build 12-Sep-2018 15:30:24 + false, build 12-Sep-2018 15:30:24 + lazy); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 catch(AipsError & e) { build 12-Sep-2018 15:30:24 @@ -5097,13 +5279,7 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // if (doparallel) { build 12-Sep-2018 15:30:24 - // msFillers = msFillers_v[0]; build 12-Sep-2018 15:30:24 - // } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - msFiller = msFillers.begin()->second; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + msFiller = msFillers.begin()->second; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 @@ -5248,7 +5424,7 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 ** "&" are not recommanded in antenna names in order to avoid bumps with MS Selection syntax. build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 string aName = r->getName(); build 12-Sep-2018 15:30:24 - if (find_first(aName, "&")) replace_all(aName, "&", "#"); build 12-Sep-2018 15:30:24 + if (aName.find_first_of('&')) replace(aName.begin(), aName.end(), '&', '#'); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 static_cast(iter->second->addAntenna(aName, build 12-Sep-2018 15:30:24 r->getStationUsingStationId()->getName(), build 12-Sep-2018 15:30:24 @@ -5620,7 +5796,7 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 // Create and fill the MS ephemeris table(s) with a time interpolation time step set to 86400000000 nanoseconds ( 1/1000 day). build 12-Sep-2018 15:30:24 if (processEphemeris) { build 12-Sep-2018 15:30:24 uint64_t timeStepInNanoSeconds = polyephem_tabtimestep * 86400 * 1.e09; build 12-Sep-2018 15:30:24 - fillEphemeris(ds, timeStepInNanoSeconds, interpolate_ephemeris, tabulate_ephemeris_polynomials, telescopeName); build 12-Sep-2018 15:30:24 + fillEphemeris(ds, timeStepInNanoSeconds, interpolate_ephemeris, telescopeName); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Process the Field table. build 12-Sep-2018 15:30:24 @@ -6708,7 +6884,7 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 // And then finally process the state and the main table. build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 if (lazy) { build 12-Sep-2018 15:30:24 - fillMainLazily(dsName, ds, selected_eb_scan_m,effectiveBwPerDD_m,e_query_cm,checkDupInts); build 12-Sep-2018 15:30:24 + fillMainLazily(dsName, ds, selected_eb_scan_m,effectiveBwPerDD_m,e_query_cm,checkdupints); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -6771,7 +6947,10 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 infostream << "ASDM Main row #" << mainRowIndex[i] << " contains data produced by a '" << CProcessorType::name(processorType) << "'." ; build 12-Sep-2018 15:30:24 info(infostream.str()); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - string absBDFpath = complete(path(dsName)).string() + "/ASDMBinary/" + replace_all_copy(replace_all_copy(v[i]->getDataUID().getEntityId().toString(), ":", "_"), "/", "_"); build 12-Sep-2018 15:30:24 + string dataUID = v[i]->getDataUID().getEntityId().toString(); build 12-Sep-2018 15:30:24 + replace(dataUID.begin(),dataUID.end(),':','_'); build 12-Sep-2018 15:30:24 + replace(dataUID.begin(),dataUID.end(),'/','_'); build 12-Sep-2018 15:30:24 + string absBDFpath = Path(dsName + "/ASDMBinary/" + dataUID).absoluteName(); build 12-Sep-2018 15:30:24 infostream.str(""); build 12-Sep-2018 15:30:24 infostream << "ASDM Main row #" << mainRowIndex[i] build 12-Sep-2018 15:30:24 << " (scan #" << v[i]->getScanNumber() build 12-Sep-2018 15:30:24 @@ -6807,7 +6986,7 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 continue; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 vmsDataPtr = sdmBinData.getDataCols(); build 12-Sep-2018 15:30:24 - bool skipFirstIntegration = checkDupInts && lastTimeMap[cdId] == vmsDataPtr->v_time[0]; build 12-Sep-2018 15:30:24 + bool skipFirstIntegration = checkdupints && lastTimeMap[cdId] == vmsDataPtr->v_time[0]; build 12-Sep-2018 15:30:24 unsigned int skipValues = 0; build 12-Sep-2018 15:30:24 // useful just for debugging build 12-Sep-2018 15:30:24 if (skipFirstIntegration) { build 12-Sep-2018 15:30:24 @@ -6981,10 +7160,10 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Do we also want to store the verbatim copies of some tables of the ASDM dataset ? build 12-Sep-2018 15:30:24 - if (vm.count("asis")) { build 12-Sep-2018 15:30:24 + if (asisOption.size() > 0) { build 12-Sep-2018 15:30:24 try { build 12-Sep-2018 15:30:24 istringstream iss; build 12-Sep-2018 15:30:24 - iss.str(vm["asis"].as()); build 12-Sep-2018 15:30:24 + iss.str(asisOption); build 12-Sep-2018 15:30:24 string word; build 12-Sep-2018 15:30:24 vector tablenames; build 12-Sep-2018 15:30:24 while (iss>>word) build 12-Sep-2018 15:30:24 diff --git a/code/alma/apps/asdm2MS/asdm2MSGeneric.h b/code/alma/apps/asdm2MS/asdm2MSGeneric.h build 12-Sep-2018 15:30:24 index a8e9ab5..3d06b9d 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/apps/asdm2MS/asdm2MSGeneric.h build 12-Sep-2018 15:30:24 +++ b/code/alma/apps/asdm2MS/asdm2MSGeneric.h build 12-Sep-2018 15:30:24 @@ -8,6 +8,7 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -383,14 +384,8 @@ template build 12-Sep-2018 15:30:24 std::ostringstream oss; build 12-Sep-2018 15:30:24 oss.str(""); build 12-Sep-2018 15:30:24 oss << "Appended " << filteredRows.size() << " rows to the MS SYSPOWER table." << endl; build 12-Sep-2018 15:30:24 -#if (BOOST_FILESYSTEM_VERSION == 3) build 12-Sep-2018 15:30:24 - casacore::LogSink::postGlobally(casacore::LogMessage(oss.str(), casacore::LogOrigin((boost::filesystem::path(getexepath())).filename().string(), WHERE), build 12-Sep-2018 15:30:24 -#else build 12-Sep-2018 15:30:24 - casacore::LogSink::postGlobally(casacore::LogMessage(oss.str(), casacore::LogOrigin((boost::filesystem::path(getexepath())).filename(), WHERE), build 12-Sep-2018 15:30:24 -#endif build 12-Sep-2018 15:30:24 - casacore::LogMessage::NORMAL build 12-Sep-2018 15:30:24 - ) build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 + casacore::LogSink::postGlobally(casacore::LogMessage(oss.str(), casacore::LogOrigin((casacore::Path(getexepath())).baseName(), WHERE), build 12-Sep-2018 15:30:24 + casacore::LogMessage::NORMAL)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 @@ -435,14 +430,8 @@ template build 12-Sep-2018 15:30:24 std::ostringstream oss; build 12-Sep-2018 15:30:24 oss.str(""); build 12-Sep-2018 15:30:24 oss << "Appended " << filteredRows.size() << " rows to the MS SYSPOWER table." << endl; build 12-Sep-2018 15:30:24 -#if (BOOST_FILESYSTEM_VERSION == 3) build 12-Sep-2018 15:30:24 - casacore::LogSink::postGlobally(casacore::LogMessage(oss.str(), casacore::LogOrigin((boost::filesystem::path(getexepath())).filename().string(), WHERE), build 12-Sep-2018 15:30:24 -#else build 12-Sep-2018 15:30:24 - casacore::LogSink::postGlobally(casacore::LogMessage(oss.str(), casacore::LogOrigin((boost::filesystem::path(getexepath())).filename(), WHERE), build 12-Sep-2018 15:30:24 -#endif build 12-Sep-2018 15:30:24 - casacore::LogMessage::NORMAL build 12-Sep-2018 15:30:24 - ) build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 + casacore::LogSink::postGlobally(casacore::LogMessage(oss.str(), casacore::LogOrigin((casacore::Path(getexepath())).baseName(), WHERE), build 12-Sep-2018 15:30:24 + casacore::LogMessage::NORMAL)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 V2CTX_P(v_p)->rows.clear(); build 12-Sep-2018 15:30:24 diff --git a/code/alma/apps/asdm2MS/bdflags2MS.cc b/code/alma/apps/asdm2MS/bdflags2MS.cc build 12-Sep-2018 15:30:24 index 1a64f4c..42260fb 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/apps/asdm2MS/bdflags2MS.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/apps/asdm2MS/bdflags2MS.cc build 12-Sep-2018 15:30:24 @@ -3,10 +3,17 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +using namespace alma; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 using namespace std; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "ASDMAll.h" build 12-Sep-2018 15:30:24 @@ -31,24 +38,11 @@ using namespace ProcessorTypeMod; build 12-Sep-2018 15:30:24 #include "SDMDataObjectStreamReader.h" build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using namespace asdmbinaries; build 12-Sep-2018 15:30:24 +using namespace casacore; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "asdm2MSGeneric.h" build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost::filesystem; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -namespace po = boost::program_options; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include // for 'operator+=()' build 12-Sep-2018 15:30:24 -using namespace boost::assign; // bring 'operator+=()' into scope build 12-Sep-2018 15:30:24 +#include "ScansParser.h" build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 bool verbose = false; // By default, let's stay quiet. build 12-Sep-2018 15:30:24 bool ddebug = false; build 12-Sep-2018 15:30:24 @@ -110,8 +104,6 @@ ostringstream infostream; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -using namespace casacore; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 string appName; // The name of the application. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -528,75 +520,6 @@ public: build 12-Sep-2018 15:30:24 }; // end of class MSFlagAccumulator build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -// build 12-Sep-2018 15:30:24 -// A collection of declarations and functions used for the parsing of the 'scans' option. build 12-Sep-2018 15:30:24 -// build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost::spirit::classic; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -vector eb_v; build 12-Sep-2018 15:30:24 -int allEbs = -1; build 12-Sep-2018 15:30:24 -int ebNumber = allEbs; build 12-Sep-2018 15:30:24 -int readEb = allEbs; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -set scan_s; build 12-Sep-2018 15:30:24 -int scanNumber0, scanNumber1; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -map > eb_scan_m; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/* build 12-Sep-2018 15:30:24 -** Inserts all the integer values in the range [scanNumber0, scanNumber1] in the set referred build 12-Sep-2018 15:30:24 -** to by the global variable scan_s. build 12-Sep-2018 15:30:24 -** The two parameters begin and end are not used and here only to comply with the Spirit parser's convention. build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 -void fillScanSet(const char* , const char* ) { build 12-Sep-2018 15:30:24 - for (int i = scanNumber0; i < (scanNumber1+1); i++) build 12-Sep-2018 15:30:24 - scan_s.insert(i); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/* build 12-Sep-2018 15:30:24 -** Inserts all the elements of the set referred to by the global variable scan_s into build 12-Sep-2018 15:30:24 -** the set associated with the (int) key equal to the last value of the global vector eb_v build 12-Sep-2018 15:30:24 -** in the global map eb_scan_m. build 12-Sep-2018 15:30:24 -** The two parameters begin and end are not used and here only to comply with the Spirit parser's convention. build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 -void mergeScanSet(const char* , const char* ) { build 12-Sep-2018 15:30:24 - int key = eb_v.back(); build 12-Sep-2018 15:30:24 - eb_scan_m[key].insert(scan_s.begin(), scan_s.end()); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/* build 12-Sep-2018 15:30:24 -** Empties the global set scan_s. build 12-Sep-2018 15:30:24 -** The two parameters begin and end are not used and here only to comply with the Spirit parser's convention. build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 -void clearScanSet(const char* , const char* ) { build 12-Sep-2018 15:30:24 - scan_s.clear(); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/* build 12-Sep-2018 15:30:24 -** Defines the grammar and the behaviour of a Spirit parser build 12-Sep-2018 15:30:24 -** able to process a scan selection. build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 -struct eb_scan_selection : public grammar { build 12-Sep-2018 15:30:24 - template struct definition { build 12-Sep-2018 15:30:24 - definition (eb_scan_selection const& ) { build 12-Sep-2018 15:30:24 - eb_scan_list = eb_scan >> *(';' >> eb_scan); build 12-Sep-2018 15:30:24 - eb_scan = (eb[push_back_a(eb_v, ebNumber)][assign_a(ebNumber, allEbs)] >> scan_list)[&mergeScanSet][&clearScanSet]; build 12-Sep-2018 15:30:24 - eb = !(int_p[assign_a(readEb)] >> ':')[assign_a(ebNumber, readEb)]; build 12-Sep-2018 15:30:24 - scan_list = !((scan_selection >> *(',' >> scan_selection))); build 12-Sep-2018 15:30:24 - scan_selection = (int_p[assign_a(scanNumber0)][assign_a(scanNumber1)] >> !('~' >> int_p[assign_a(scanNumber1)])) build 12-Sep-2018 15:30:24 - [&fillScanSet] build 12-Sep-2018 15:30:24 - [assign_a(scanNumber0, -1)] build 12-Sep-2018 15:30:24 - [assign_a(scanNumber1, -1)]; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - rule eb_scan_list, eb_scan, eb, scan_list, scan_selection; build 12-Sep-2018 15:30:24 - rule const& start() const { return eb_scan_list ; } build 12-Sep-2018 15:30:24 - }; build 12-Sep-2018 15:30:24 -}; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 /* build 12-Sep-2018 15:30:24 ** The following functions drive the processing of the BDF flags build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 @@ -941,13 +864,13 @@ void loadBDFlags(map& abbrev2bitpos) { build 12-Sep-2018 15:30:24 if ((rootDir_p = getenv("CASAPATH")) != 0) { build 12-Sep-2018 15:30:24 string rootPath(rootDir_p); build 12-Sep-2018 15:30:24 vector rootPathElements; build 12-Sep-2018 15:30:24 - split(rootPathElements, rootPath, is_any_of(" ")); build 12-Sep-2018 15:30:24 + asdm::strsplit(rootPath, ' ', rootPathElements); build 12-Sep-2018 15:30:24 string bdflagsPath = rootPathElements[0]; build 12-Sep-2018 15:30:24 - if (!ends_with(bdflagsPath, "/")) bdflagsPath+="/"; build 12-Sep-2018 15:30:24 + if (bdflagsPath.back()!='/') bdflagsPath+="/"; build 12-Sep-2018 15:30:24 bdflagsPath+="data/alma/asdm/"; build 12-Sep-2018 15:30:24 bdflagsPath+=bdflagsFilename; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (!exists(path(bdflagsPath))) { build 12-Sep-2018 15:30:24 + if (!file_exists(bdflagsPath)) { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 errstream << "The file '" << bdflagsPath << "' containing the collection of BDF flags can't be found." << endl; build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 @@ -1045,7 +968,7 @@ void processCorrelatorFlags(unsigned int numIntegration, build 12-Sep-2018 15:30:24 ScalarColumn& flagRow, build 12-Sep-2018 15:30:24 CorrelationModeMod::CorrelationMode ocorrelationMode build 12-Sep-2018 15:30:24 ) { build 12-Sep-2018 15:30:24 - boost::regex ALMACorrelatorFlagsAxesRegex("(BAL )?ANT (BAB )?(SPW )?(POL )?"); build 12-Sep-2018 15:30:24 + std::regex ALMACorrelatorFlagsAxesRegex("(BAL )?ANT (BAB )?(SPW )?(POL )?"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 uInt numFlaggedRows = 0; build 12-Sep-2018 15:30:24 SDMDataObjectStreamReader sdosr; build 12-Sep-2018 15:30:24 @@ -1083,7 +1006,7 @@ void processCorrelatorFlags(unsigned int numIntegration, build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Check the validity of the sequence of flags axes. build 12-Sep-2018 15:30:24 - if (!regex_match(axes_s, ALMACorrelatorFlagsAxesRegex)) { build 12-Sep-2018 15:30:24 + if (!std::regex_match(axes_s, ALMACorrelatorFlagsAxesRegex)) { build 12-Sep-2018 15:30:24 throw ProcessFlagsException("'" + oss.str() + "' is not a valid sequence of flags axes for an ALMA correlator."); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1142,7 +1065,7 @@ void processCorrelatorFlagsPerSlices(MainRow* mR_p, build 12-Sep-2018 15:30:24 CorrelationModeMod::CorrelationMode ocorrelationMode build 12-Sep-2018 15:30:24 ) { build 12-Sep-2018 15:30:24 // Regular expressions for the correct sequences of axes in the flags in the case of ALMA data. build 12-Sep-2018 15:30:24 - boost::regex ALMACorrelatorFlagsAxesRegex("(BAL )?ANT (BAB )?(SPW )?(POL )?"); build 12-Sep-2018 15:30:24 + std::regex ALMACorrelatorFlagsAxesRegex("(BAL )?ANT (BAB )?(SPW )?(POL )?"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 uInt numFlaggedRows = 0; build 12-Sep-2018 15:30:24 SDMDataObjectStreamReader sdosr; build 12-Sep-2018 15:30:24 @@ -1180,7 +1103,7 @@ void processCorrelatorFlagsPerSlices(MainRow* mR_p, build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Check the validity of the sequence of flags axes. build 12-Sep-2018 15:30:24 - if (!regex_match(axes_s, ALMACorrelatorFlagsAxesRegex)) { build 12-Sep-2018 15:30:24 + if (!std::regex_match(axes_s, ALMACorrelatorFlagsAxesRegex)) { build 12-Sep-2018 15:30:24 throw ProcessFlagsException("'" + oss.str() + "' is not a valid sequence of flags axes for an ALMA correlator."); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1287,16 +1210,22 @@ void processCorrelatorFlagsPerSlices(MainRow* mR_p, build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 - LOGENTER("int main (int argC, char * argV[])"); build 12-Sep-2018 15:30:24 +int main (int argc, char * argv[]) { build 12-Sep-2018 15:30:24 + LOGENTER("int main (int argc, char * argv[])"); build 12-Sep-2018 15:30:24 string dsName; build 12-Sep-2018 15:30:24 string msName; build 12-Sep-2018 15:30:24 bitset<32> flagmask; build 12-Sep-2018 15:30:24 map abbrev2bitpos; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - appName = string(argV[0]); build 12-Sep-2018 15:30:24 + appName = string(argv[0]); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 uint64_t bdfSliceSizeInMb = 500; // The default size of the BDF slice hold in memory. build 12-Sep-2018 15:30:24 + bool lazy = false; // must be set to true with the option "--lazy=true" if the MS has been produced by asdm2MS with the option --lazy !!! build 12-Sep-2018 15:30:24 + bool checkdupints = true; // hidden option, used to turn off duplicate integration checks for RADIOMETER data during unit tests. build 12-Sep-2018 15:30:24 + bool processUncorrectedData = true; build 12-Sep-2018 15:30:24 + string scansOptionValue; build 12-Sep-2018 15:30:24 + CorrelationModeMod::CorrelationMode ocorrelationMode = CorrelationModeMod::CROSS_AND_AUTO; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 LogSink::globalSink(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Load the BDF flags abbreviations. build 12-Sep-2018 15:30:24 @@ -1306,97 +1235,181 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 hack02 hack02_instance(abbrevList); build 12-Sep-2018 15:30:24 for_each (abbrev2bitpos.begin(), abbrev2bitpos.end(), hack02_instance); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - po::variables_map vm; build 12-Sep-2018 15:30:24 + // process command line options and parameters build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // all of the non-positional options are enumerated here build 12-Sep-2018 15:30:24 + // also note that asdm-directory and ms-directory can be specified as named options build 12-Sep-2018 15:30:24 + // those are hidden in the usage output by supplying empty help strings build 12-Sep-2018 15:30:24 + // The positional argument version of each takes precedence. build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + enum optionIndex { UNKNOWN, HELP, FLAGCOND, SCANS, WVRCORRDATA, LAZY, OCM, build 12-Sep-2018 15:30:24 + VERBOSE, LOGFILE, ASDMDIR, MSDIR, CHECKDUPINTS }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - bool lazy = false; // must be set to true with the option "--lazy=true" if the MS has been produced by asdm2MS with the option --lazy !!! build 12-Sep-2018 15:30:24 - string ocm("ac") ; // A default value for the option --ocm. build 12-Sep-2018 15:30:24 try { build 12-Sep-2018 15:30:24 - string flagcondDoc = "specifies the list of flagging conditions to consider. The list must be a white space separated list of valid flagging conditions names. Note that the flag names can be shortened as long as there is no ambiguity (i.e. \"FFT, SI\" is valid and will be interpreted as \"FFT_OVERFLOW , SIGMA_OVERFLOW\"). If no flagging condition is provided the application exits immediately. A flag is set at the appropriate location in the MS Main row whenever at least one of the flagging conditions present in the option --flagcond is read at the relevant location in the relevant BDF file. The flagging conditions are :\n" + abbrevList + "\n\n. Note that the special value \"ALL\" to set all the flagging conditions."; build 12-Sep-2018 15:30:24 - po::options_description generic("Generates MS Flag information from the flagging conditions contained in the BDF files of an ASDM dataset.\n\n" build 12-Sep-2018 15:30:24 - "Usage : \n" + appName + "[options] asdm-directory ms-directory \n\n" build 12-Sep-2018 15:30:24 - "Command parameters : \n" build 12-Sep-2018 15:30:24 - "asdm-directory : the pathname to the ASDM dataset to read \n" build 12-Sep-2018 15:30:24 - "ms-directory : the pathname of the MS where the flagging information will be written. \n" build 12-Sep-2018 15:30:24 - "\n\n" build 12-Sep-2018 15:30:24 - "Allowed options:"); build 12-Sep-2018 15:30:24 - generic.add_options() build 12-Sep-2018 15:30:24 - ("help", "produces help message.") build 12-Sep-2018 15:30:24 - ("flagcond,f", po::value()->default_value(""), flagcondDoc.c_str()) build 12-Sep-2018 15:30:24 - ("scans,s", po::value(), "processes only the scans specified in the option's value. This value is a semicolon separated list of scan specifications. A scan specification consists in an exec bock index followed by the character ':' followed by a comma separated list of scan indexes or scan index ranges. A scan index is relative to the exec block it belongs to. Scan indexes are 1-based while exec blocks's are 0-based. \"0:1\" or \"2:2~6\" or \"0:1,1:2~6,8;2:,3:24~30\" \"1,2\" are valid values for the option. \"3:\" alone will be interpreted as 'all the scans of the exec block#3'. An scan index or a scan index range not preceded by an exec block index will be interpreted as 'all the scans with such indexes in all the exec blocks'. By default all the scans are considered.") build 12-Sep-2018 15:30:24 - ("wvr-corrected-data", po::value()->default_value(false), "must be set to True (resp. False) whenever the MS to be populated contains corrected (resp. uncorrected) data (default==false)") build 12-Sep-2018 15:30:24 - ("lazy", po::value()->default_value(false), "must be set to True if the measurement set has been produced by asdm2MS run with the option --lazy (default==false") build 12-Sep-2018 15:30:24 - ("ocm", po::value(&ocm)->default_value("ca"), "specifies the output correlation mode, i.e. the correlation mode of the ASDM/BDF's data for which the MS flags will be written. The value given to this option must *imperatively* be the same than the one given to the --ocm option for the execution of the filler which produced the MS. Valid values are 'ca' for CROSS_AND_AUTO, 'ao' for AUTO_ONLY and 'co' for CROSS_ONLY.") build 12-Sep-2018 15:30:24 - ("verbose,v", "logs numerous informations as the application is running.") build 12-Sep-2018 15:30:24 - ("logfile,l", po::value(), "specifies the log filename. If the option is not used then the logged informations are written to the standard error stream.") build 12-Sep-2018 15:30:24 - ; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // nocheckdupints is used during testing but should not be visible to users build 12-Sep-2018 15:30:24 - po::options_description hidden("Hidden options"); build 12-Sep-2018 15:30:24 - hidden.add_options() build 12-Sep-2018 15:30:24 - ("asdm-directory", po::value(), "asdm directory") build 12-Sep-2018 15:30:24 - ("ms-directory", po::value(), "ms directory") build 12-Sep-2018 15:30:24 - ("checkdupints", po::value()->default_value(true), "a value of false turns off checks for duplicate integration times in RADIOMETER data") build 12-Sep-2018 15:30:24 - ; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::options_description cmdline_options; build 12-Sep-2018 15:30:24 - cmdline_options.add(generic).add(hidden); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::positional_options_description p; build 12-Sep-2018 15:30:24 - p.add("asdm-directory", 1); build 12-Sep-2018 15:30:24 - p.add("ms-directory", 1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Parse the command line and retrieve the options and parameters. build 12-Sep-2018 15:30:24 - po::store(po::command_line_parser(argC, argV).options(cmdline_options).positional(p).run(), vm); build 12-Sep-2018 15:30:24 - po::notify(vm); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Where do the log messages should go ? build 12-Sep-2018 15:30:24 - if (vm.count("logfile")) { build 12-Sep-2018 15:30:24 - freopen(vm["logfile"].as().c_str(), "a", stderr); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // remove the program name build 12-Sep-2018 15:30:24 + argc--; build 12-Sep-2018 15:30:24 + argv++; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + string flagcondDoc = build 12-Sep-2018 15:30:24 + " --f [--flagcond] arg \tspecifies the list of flagging conditions to consider. " build 12-Sep-2018 15:30:24 + "The list must be a white space separated list of valid flagging conditions names. " build 12-Sep-2018 15:30:24 + "Note that the flag names can be shortened as long as there is no ambiguity " build 12-Sep-2018 15:30:24 + "(i.e. \"FFT, SI\" is valid and will be interpreted as \"FFT_OVERFLOW , SIGMA_OVERFLOW\"). " build 12-Sep-2018 15:30:24 + "If no flagging condition is provided the application exits immediately. " build 12-Sep-2018 15:30:24 + "A flag is set at the appropriate location in the MS Main row whenever at least " build 12-Sep-2018 15:30:24 + "one of the flagging conditions present in the option --flagcond is read at the " build 12-Sep-2018 15:30:24 + "relevant location in the relevant BDF file. The flagging conditions are :\n" + abbrevList + "\n\n" build 12-Sep-2018 15:30:24 + "\tNote the special value \"ALL\" used to set all the flagging conditions.\n"; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + string usageIntro = build 12-Sep-2018 15:30:24 + "Generates MS Flag information from the flagging conditions contained in the BDF files of an ASDM dataset.\n\n" build 12-Sep-2018 15:30:24 + "Usage : \n" + appName + "[options] asdm-directory ms-directory \n\n" build 12-Sep-2018 15:30:24 + "Command parameters : \n"; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Descriptor elements are: OptionIndex, OptionType, shortopt, longopt, check_arg, help build 12-Sep-2018 15:30:24 + option::Descriptor usage[] = { build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, usageIntro.c_str()}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, " \tasdm-directory : \tthe pathname to the ASDM dataset to read"}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, " \tms-directory : \tthe pathname of the MS where the flagging information will be written."}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, "\nAllowed options:\n"}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, 0}, // helps with formatting build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // these are the non-positional options build 12-Sep-2018 15:30:24 + { HELP, 0, "", "help", AlmaArg::None, " --help \tproduces this help message."}, build 12-Sep-2018 15:30:24 + { FLAGCOND, 0, "f", "flagcond", AlmaArg::Required, flagcondDoc.c_str()}, build 12-Sep-2018 15:30:24 + { SCANS, 0, "s", "scans", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " -s [--scans] arg \tprocesses only the scans specified in the option's value." build 12-Sep-2018 15:30:24 + "This value is a semicolon separated list of scan specifications. " build 12-Sep-2018 15:30:24 + "A scan specification consists in an exec bock index followed by the character ':' " build 12-Sep-2018 15:30:24 + "followed by a comma separated list of scan indexes or scan index ranges. " build 12-Sep-2018 15:30:24 + "A scan index is relative to the exec block it belongs to. Scan indexes are " build 12-Sep-2018 15:30:24 + "1-based while exec blocks's are 0-based. \"0:1\" or \"2:2~6\" or \"0:1,1:2~6,8;2:,3:24~30\" \"1,2\" " build 12-Sep-2018 15:30:24 + "are valid values for the option. \"3:\" alone will be interpreted as 'all the scans of " build 12-Sep-2018 15:30:24 + "the exec block#3'. An scan index or a scan index range not preceded by an exec block " build 12-Sep-2018 15:30:24 + "index will be interpreted as 'all the scans with such indexes in all the exec blocks'. " build 12-Sep-2018 15:30:24 + "By default all the scans are considered."}, build 12-Sep-2018 15:30:24 + { WVRCORRDATA, 0, "", "wvr-corrected-data", AlmaArg::Bool, build 12-Sep-2018 15:30:24 + " --wvr-corrected-data arg (=false) \tmust be set to true (resp. false) whenever " build 12-Sep-2018 15:30:24 + "the MS to be populated contains corrected (resp. uncorrected) data (default==false)"}, build 12-Sep-2018 15:30:24 + { LAZY, 0, "", "lazy", AlmaArg::Bool, " --lazy arg (=false) \tmust be set to True if the measurement set has been produced by asdm2MS using the option --lazy (default==false"}, build 12-Sep-2018 15:30:24 + { OCM, 0, "", "ocm", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " --ocm arg (=ca) \tspecifies the output correlation mode, " build 12-Sep-2018 15:30:24 + "i.e. the correlation mode of the ASDM/BDF's data for which the " build 12-Sep-2018 15:30:24 + "MS flags will be written. The value given to this option must *imperatively* " build 12-Sep-2018 15:30:24 + "be the same than the one given to the --ocm option for the execution of the " build 12-Sep-2018 15:30:24 + "filler which produced the MS. Valid values are 'ca' for CROSS_AND_AUTO, " build 12-Sep-2018 15:30:24 + "'ao' for AUTO_ONLY and 'co' for CROSS_ONLY (default=='ca')."}, build 12-Sep-2018 15:30:24 + { VERBOSE, 0, "v", "verbose", AlmaArg::None, " -v [--verbose] \tlogs numerous information as the application is running."}, build 12-Sep-2018 15:30:24 + { LOGFILE, 0, "l", "logfile", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " -l [--logfile] arg \tspecifies the log filename. " build 12-Sep-2018 15:30:24 + "If the option is not used then the logged information is written to the standard error stream."}, build 12-Sep-2018 15:30:24 + // these can be set by the command line, but are not shown to the user. build 12-Sep-2018 15:30:24 + { ASDMDIR, 0, "", "asdm-directory", AlmaArg::Required, 0}, build 12-Sep-2018 15:30:24 + { MSDIR, 0, "", "ms-directory", AlmaArg::Required, 0}, build 12-Sep-2018 15:30:24 + // used in unit tests to turn off duplicate integration time checks for RADIOMETER data, not intended for normal use, hidden from the user. build 12-Sep-2018 15:30:24 + { CHECKDUPINTS, 0, "", "checkdupints", AlmaArg::Bool, 0}, build 12-Sep-2018 15:30:24 + { 0, 0, 0, 0, 0, 0 } }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // defaults are set by parsing an argv-like set of options where the values are the defaults build 12-Sep-2018 15:30:24 + const char * defaults[] = { "--wvr-corrected-data=false", build 12-Sep-2018 15:30:24 + "--lazy=false", build 12-Sep-2018 15:30:24 + "--ocm=ca", build 12-Sep-2018 15:30:24 + "--checkdupints=true", build 12-Sep-2018 15:30:24 + (const char *)-1}; // unambiguously signal the end build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // count defaults, more robust than setting a value here that must be changed when defaults changes build 12-Sep-2018 15:30:24 + int defaultCount = 0; build 12-Sep-2018 15:30:24 + while (defaults[defaultCount] != (const char *)-1) ++defaultCount; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // parse defaults, argv build 12-Sep-2018 15:30:24 + // establish sizes build 12-Sep-2018 15:30:24 + option::Stats stats; build 12-Sep-2018 15:30:24 + // true here turns on re-ordering of args so that positional arguments are always seen last build 12-Sep-2018 15:30:24 + stats.add(true, usage, defaultCount, defaults); build 12-Sep-2018 15:30:24 + stats.add(true, usage, argc,argv); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // buffers to hold the parsed options build 12-Sep-2018 15:30:24 + // options has one element per optionIndex, last value is the last time that option was set build 12-Sep-2018 15:30:24 + // buffer has one element for each option encountered, in order. Not used here. build 12-Sep-2018 15:30:24 + option::Option options[stats.options_max], buffer[stats.buffer_max]; build 12-Sep-2018 15:30:24 + option::Parser parse; build 12-Sep-2018 15:30:24 + // parse the defaults first, then argv. User set options always come last. build 12-Sep-2018 15:30:24 + // true here has same meaning as in stats above. This may not be necessary here, I think build 12-Sep-2018 15:30:24 + // the stats usage above has already reordered argv in place. build 12-Sep-2018 15:30:24 + parse.parse(true, usage, defaultCount, defaults, options, buffer); build 12-Sep-2018 15:30:24 + parse.parse(true, usage, argc, argv, options, buffer); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (parse.error()) { build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + errstream << "Problem parsing the command line arguments"; build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // User-specified logfile? build 12-Sep-2018 15:30:24 + if (options[LOGFILE] != NULL && options[LOGFILE].last()->arg != NULL) { build 12-Sep-2018 15:30:24 + freopen(options[LOGFILE].last()->arg, "a", stderr); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Help ? displays help's content and don't go further. build 12-Sep-2018 15:30:24 - if (vm.count("help")) { build 12-Sep-2018 15:30:24 + if (options[HELP] || (argc==0) ) { build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + option::printUsage(errstream, usage, 80); build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // too many positional arguments? build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 2) { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 - errstream << generic << "\n" ; build 12-Sep-2018 15:30:24 + errstream << "Too many positinal options" << endl; build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Verbose or quiet ? build 12-Sep-2018 15:30:24 - verbose = vm.count("verbose") > 0; build 12-Sep-2018 15:30:24 + verbose = options[VERBOSE] != NULL; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // What's the dataset to use ? build 12-Sep-2018 15:30:24 - if (vm.count("asdm-directory")) { build 12-Sep-2018 15:30:24 - string dummy = vm["asdm-directory"].as< string >(); build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 0 || options[ASDMDIR]) { build 12-Sep-2018 15:30:24 + string dummy; build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 0) { build 12-Sep-2018 15:30:24 + dummy = string(parse.nonOption(0)); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // ASDMDIR must have been set build 12-Sep-2018 15:30:24 + dummy = string(options[ASDMDIR].last()->arg); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 dsName = trim_copy(dummy) ; build 12-Sep-2018 15:30:24 - if (boost::algorithm::ends_with(dsName,"/")) dsName.erase(dsName.size()-1); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 + if (dsName.back()=='/') dsName.erase(dsName.size()-1); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 - errstream << generic ; build 12-Sep-2018 15:30:24 + option::printUsage(errstream, usage); build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Which MS the flagging informations build 12-Sep-2018 15:30:24 // should be written into ? build 12-Sep-2018 15:30:24 - if (vm.count("ms-directory")) { build 12-Sep-2018 15:30:24 - string dummy = vm["ms-directory"].as< string >(); build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 1 || options[MSDIR]) { build 12-Sep-2018 15:30:24 + string dummy; build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount()>1) { build 12-Sep-2018 15:30:24 + dummy = string(parse.nonOption(1)); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + dummy = string(options[MSDIR].last()->arg); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 msName = trim_copy(dummy) ; build 12-Sep-2018 15:30:24 - if (boost::algorithm::ends_with(msName,"/")) msName.erase(msName.size()-1); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 + if (msName.back()=='/') msName.erase(msName.size()-1); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 - errstream << generic ; build 12-Sep-2018 15:30:24 + option::printUsage(errstream, usage); build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("flagcond")) { build 12-Sep-2018 15:30:24 + if (options[FLAGCOND]) { build 12-Sep-2018 15:30:24 istringstream iss; build 12-Sep-2018 15:30:24 string token; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 flagmask.reset(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - string flagcond_opt = vm["flagcond"].as(); build 12-Sep-2018 15:30:24 + string flagcond_opt = string(options[FLAGCOND].last()->arg); build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 // Stop here if no flag mask was given. build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 @@ -1412,7 +1425,7 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 iss.clear(); build 12-Sep-2018 15:30:24 iss.str(flagcond_opt); build 12-Sep-2018 15:30:24 while (iss >> token) { build 12-Sep-2018 15:30:24 - if ( to_upper_copy(token) == "ALL") { build 12-Sep-2018 15:30:24 + if ( str_toupper(token) == "ALL") { build 12-Sep-2018 15:30:24 for ( s_ui p: abbrev2bitpos ) { build 12-Sep-2018 15:30:24 flagmask.set(p.second, true); build 12-Sep-2018 15:30:24 infostream << " " << p.first; build 12-Sep-2018 15:30:24 @@ -1423,7 +1436,8 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 unsigned hits = 0; build 12-Sep-2018 15:30:24 unsigned int bitpos = 0; build 12-Sep-2018 15:30:24 for ( s_ui p: abbrev2bitpos ) { build 12-Sep-2018 15:30:24 - if (starts_with(p.first, to_upper_copy(trim_copy(token)))) { build 12-Sep-2018 15:30:24 + string tokenToTest = str_toupper(trim_copy(token)); build 12-Sep-2018 15:30:24 + if (p.first.compare(0,tokenToTest.size(),tokenToTest)) { build 12-Sep-2018 15:30:24 bitpos = p.second; build 12-Sep-2018 15:30:24 hits++; build 12-Sep-2018 15:30:24 infostream << " " << p.first; build 12-Sep-2018 15:30:24 @@ -1452,11 +1466,52 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 info(infostream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("lazy")) { build 12-Sep-2018 15:30:24 - lazy=vm["lazy"].as(); build 12-Sep-2018 15:30:24 + // this always has a value because of defaults build 12-Sep-2018 15:30:24 + string lazyOpt(options[LAZY].last()->arg); build 12-Sep-2018 15:30:24 + trim(lazyOpt); build 12-Sep-2018 15:30:24 + lazyOpt = str_tolower(lazyOpt); build 12-Sep-2018 15:30:24 + // AlmaArg::Bool already guarantees this is either "true" or "false" build 12-Sep-2018 15:30:24 + lazy = (lazyOpt == "true"); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // this always has a value because of defaults build 12-Sep-2018 15:30:24 + string checkdupintsOpt(options[CHECKDUPINTS].last()->arg); build 12-Sep-2018 15:30:24 + trim(checkdupintsOpt); build 12-Sep-2018 15:30:24 + checkdupintsOpt = str_tolower(checkdupintsOpt); build 12-Sep-2018 15:30:24 + // AlmaArg::Bool already guarantees this is either "true" or "false" build 12-Sep-2018 15:30:24 + checkdupints = (checkdupintsOpt == "true"); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // this always has a value because of defaults build 12-Sep-2018 15:30:24 + string wvrCorrDataOpt(options[WVRCORRDATA].last()->arg); build 12-Sep-2018 15:30:24 + trim(wvrCorrDataOpt); build 12-Sep-2018 15:30:24 + wvrCorrDataOpt = str_tolower(wvrCorrDataOpt); build 12-Sep-2018 15:30:24 + // AlmaArg::Bool already guarantees this is either "true" or "false" build 12-Sep-2018 15:30:24 + processUncorrectedData = (wvrCorrDataOpt != "true"); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (options[SCANS]) { build 12-Sep-2018 15:30:24 + scansOptionValue = string(options[SCANS].last()->arg); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - catch (std::exception& e) { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // build 12-Sep-2018 15:30:24 + // Selection of the output correlation mode, i.e. the correlation mode of the data for which the flag are evaluated. build 12-Sep-2018 15:30:24 + // This works if and only the value given to the option --ocm is equal to the value given to the same option of asdm2MS build 12-Sep-2018 15:30:24 + // when the filler which produced the MS of interest was run. build 12-Sep-2018 15:30:24 + // build 12-Sep-2018 15:30:24 + // this always has a value because of defaults build 12-Sep-2018 15:30:24 + string ocm = string(options[OCM].last()->arg); build 12-Sep-2018 15:30:24 + ocm = str_tolower(ocm); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (ocm == "ca") build 12-Sep-2018 15:30:24 + ocorrelationMode = CorrelationModeMod::CROSS_AND_AUTO; build 12-Sep-2018 15:30:24 + else if (ocm == "ao") build 12-Sep-2018 15:30:24 + ocorrelationMode = CorrelationModeMod::AUTO_ONLY; build 12-Sep-2018 15:30:24 + else if (ocm == "co") build 12-Sep-2018 15:30:24 + ocorrelationMode = CorrelationModeMod::CROSS_ONLY; build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + errstream << "The value given to the option ocm ('" << ocm << "') is invalid. Expecting one of {'ca', 'ao'}" << endl; build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } catch (std::exception& e) { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 errstream << e.what(); build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 @@ -1496,29 +1551,22 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 ExecBlockRow * ebR = ebRs[0]; build 12-Sep-2018 15:30:24 - string telescopeName = to_upper_copy(trim_copy(ebR->getTelescopeName())); build 12-Sep-2018 15:30:24 - vector telescopeNames; build 12-Sep-2018 15:30:24 - telescopeNames += "ALMA", "OSF", "AOS"; build 12-Sep-2018 15:30:24 + string telescopeName = str_toupper(trim_copy(ebR->getTelescopeName())); build 12-Sep-2018 15:30:24 + vector telescopeNames = {"ALMA", "OSF", "AOS"}; build 12-Sep-2018 15:30:24 if (find(telescopeNames.begin(), telescopeNames.end(), telescopeName) == telescopeNames.end()) { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 errstream << "This dataset announces telescopeName == '" << telescopeName << "', which is not ALMA. Flags can't be processed." << endl; build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // check for duplicate integrations build 12-Sep-2018 15:30:24 - bool checkDupInts = vm["checkdupints"].as< bool >(); build 12-Sep-2018 15:30:24 if (debug) { build 12-Sep-2018 15:30:24 - cout << "checkDupInts : " << checkDupInts << endl; build 12-Sep-2018 15:30:24 + cout << "checkdupints : " << checkdupints << endl; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 // Selection of the kind of data - uncorrected or corrected - to consider. build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 infostream.str(""); build 12-Sep-2018 15:30:24 - bool processUncorrectedData = true; build 12-Sep-2018 15:30:24 - if (vm.count("wvr-corrected-data")) { build 12-Sep-2018 15:30:24 - processUncorrectedData = !vm["wvr-corrected-data"].as< bool >(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 infostream << "only " << (processUncorrectedData ? "uncorrected" : "corrected") << " data will be considered." << endl; build 12-Sep-2018 15:30:24 info(infostream.str()); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1534,11 +1582,9 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 map > selected_eb_scan_m; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 string scansOptionInfo; build 12-Sep-2018 15:30:24 - if (vm.count("scans")) { build 12-Sep-2018 15:30:24 - string scansOptionValue = vm["scans"].as< string >(); build 12-Sep-2018 15:30:24 - eb_scan_selection ebs; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - int status = parse(scansOptionValue.c_str(), ebs, space_p).full; build 12-Sep-2018 15:30:24 + if (scansOptionValue.size()>0) { build 12-Sep-2018 15:30:24 + map > eb_scan_m; build 12-Sep-2018 15:30:24 + int status = scansParser(scansOptionValue, eb_scan_m); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (status == 0) { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 @@ -1590,28 +1636,6 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 infostream << scansOptionInfo; build 12-Sep-2018 15:30:24 info(infostream.str()); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // Selection of the output correlation mode, i.e. the correlation mode of the data for which the flag are evaluated. build 12-Sep-2018 15:30:24 - // This works if and only the value given to the option --ocm is equal to the value given to the same option of asdm2MS build 12-Sep-2018 15:30:24 - // when the filler which produced the MS of interest was run. build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - CorrelationModeMod::CorrelationMode ocorrelationMode = CorrelationModeMod::CROSS_AND_AUTO; build 12-Sep-2018 15:30:24 - if (vm.count("ocm")) { build 12-Sep-2018 15:30:24 - // Let's filter the value given to ocm build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - ocm = to_lower_copy(ocm); build 12-Sep-2018 15:30:24 - if (ocm == "ca") build 12-Sep-2018 15:30:24 - ocorrelationMode = CorrelationModeMod::CROSS_AND_AUTO; build 12-Sep-2018 15:30:24 - else if (ocm == "ao") build 12-Sep-2018 15:30:24 - ocorrelationMode = CorrelationModeMod::AUTO_ONLY; build 12-Sep-2018 15:30:24 - else if (ocm == "co") build 12-Sep-2018 15:30:24 - ocorrelationMode = CorrelationModeMod::CROSS_ONLY; build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - errstream.str(""); build 12-Sep-2018 15:30:24 - errstream << "The value given to the option ocm ('" << ocm << "') is invalid. Expecting one of {'ca', 'ao'}" << endl; build 12-Sep-2018 15:30:24 - error(errstream.str()); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 infostream.str(""); build 12-Sep-2018 15:30:24 infostream << "The MS FLAG column will be calculated for the correlation mode '" << CCorrelationMode::toString(ocorrelationMode) << "'." << endl; build 12-Sep-2018 15:30:24 info(infostream.str()); build 12-Sep-2018 15:30:24 @@ -1637,8 +1661,8 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Regular expressions for the correct sequences of axes in the flags in the case of ALMA data. build 12-Sep-2018 15:30:24 - boost::regex ALMARadiometerPackedFlagsAxesRegex("(TIM ANT )?(BAB BIN POL )?"); build 12-Sep-2018 15:30:24 - boost::regex ALMARadiometerFlagsAxesRegex("(ANT )?(BAB BIN POL )?"); build 12-Sep-2018 15:30:24 + std::regex ALMARadiometerPackedFlagsAxesRegex("(TIM ANT )?(BAB BIN POL )?"); build 12-Sep-2018 15:30:24 + std::regex ALMARadiometerFlagsAxesRegex("(ANT )?(BAB BIN POL )?"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 ConfigDescriptionTable & cfgT = ds.getConfigDescription(); build 12-Sep-2018 15:30:24 @@ -1728,7 +1752,10 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 ddRs.end(), build 12-Sep-2018 15:30:24 hack05_instance); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - string bdfPath = dsName+"/ASDMBinary/"+replace_all_copy(replace_all_copy(mR->getDataUID().getEntityId().toString(), "/", "_"), ":", "_"); build 12-Sep-2018 15:30:24 + string dataUID = mR->getDataUID().getEntityId().toString(); build 12-Sep-2018 15:30:24 + replace(dataUID.begin(),dataUID.end(),':','_'); build 12-Sep-2018 15:30:24 + replace(dataUID.begin(),dataUID.end(),'/','_'); build 12-Sep-2018 15:30:24 + string bdfPath = dsName+"/ASDMBinary/"+dataUID; build 12-Sep-2018 15:30:24 if (debug) cout << "BDF " << bdfPath << endl; build 12-Sep-2018 15:30:24 ProcessorType pt = cfgR->getProcessorType(); build 12-Sep-2018 15:30:24 uInt numFlaggedRows = 0; build 12-Sep-2018 15:30:24 @@ -1798,6 +1825,7 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 case ProcessorTypeMod::RADIOMETER : build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 const SDMDataObject& sdo = sdor.read(bdfPath); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // should this correlationMode be skipped? This is probably always AUTO_ONLY, but this is a general test just in case build 12-Sep-2018 15:30:24 if ((sdo.correlationMode()==CorrelationModeMod::AUTO_ONLY and ocorrelationMode==CorrelationModeMod::CROSS_ONLY) || build 12-Sep-2018 15:30:24 (sdo.correlationMode()==CorrelationModeMod::CROSS_ONLY and ocorrelationMode==CorrelationModeMod::AUTO_ONLY)) { build 12-Sep-2018 15:30:24 @@ -1816,7 +1844,7 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 // must be known before accumulator is instantiated. build 12-Sep-2018 15:30:24 bool skipFirstIntegration = false; build 12-Sep-2018 15:30:24 if (sdo.hasPackedData()) { build 12-Sep-2018 15:30:24 - if (!regex_match(oss.str(), ALMARadiometerPackedFlagsAxesRegex)) build 12-Sep-2018 15:30:24 + if (!std::regex_match(oss.str(), ALMARadiometerPackedFlagsAxesRegex)) build 12-Sep-2018 15:30:24 throw ProcessFlagsException("'" + oss.str() + "' is not a valid sequence of flags axes for an ALMA radiometer."); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // determine if the first integration should be skipped due a duplicate time from a subscan. build 12-Sep-2018 15:30:24 @@ -1825,7 +1853,7 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 int64_t startTime = (int64_t)sdmDataSubset.time() - (int64_t)sdmDataSubset.interval()/2LL + deltaTime/2LL; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // should the first integration be skipped? Any actual skipping happens later. build 12-Sep-2018 15:30:24 - skipFirstIntegration = checkDupInts && lastTimeMap[mR->getConfigDescriptionId()] == ArrayTime(startTime).getMJD(); build 12-Sep-2018 15:30:24 + skipFirstIntegration = checkdupints && lastTimeMap[mR->getConfigDescriptionId()] == ArrayTime(startTime).getMJD(); build 12-Sep-2018 15:30:24 if (debug && skipFirstIntegration) { build 12-Sep-2018 15:30:24 cout << "Duplicate time seen in Row : " << mainRowIndex[iASDMIndex] build 12-Sep-2018 15:30:24 << " cdId : " << mR->getConfigDescriptionId() build 12-Sep-2018 15:30:24 @@ -1836,7 +1864,7 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 lastTimeMap[mR->getConfigDescriptionId()] = ArrayTime(startTime+(sdo.numTime()-1)*deltaTime).getMJD(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 - if (!regex_match(oss.str(), ALMARadiometerFlagsAxesRegex)) build 12-Sep-2018 15:30:24 + if (!std::regex_match(oss.str(), ALMARadiometerFlagsAxesRegex)) build 12-Sep-2018 15:30:24 throw ProcessFlagsException("'" + oss.str() + "' is not a valid sequence of flags axes for an ALMA radiometer."); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 unsigned int numIntegrations = sdo.hasPackedData() ? sdo.numTime() : sdo.sdmDataSubsets().size(); build 12-Sep-2018 15:30:24 @@ -1950,5 +1978,5 @@ int main (int argC, char * argV[]) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 mainTable.flush(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - LOGEXIT("int main (int argC, char * argV[])"); build 12-Sep-2018 15:30:24 + LOGEXIT("int main (int argc, char * argv[])"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/apps/asdm2MS/parasdm2MS.cc b/code/alma/apps/asdm2MS/parasdm2MS.cc build 12-Sep-2018 15:30:24 index fdf4d4b..7872273 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/apps/asdm2MS/parasdm2MS.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/apps/asdm2MS/parasdm2MS.cc build 12-Sep-2018 15:30:24 @@ -1,3 +1,8 @@ build 12-Sep-2018 15:30:24 +// NOTE: this code is not currently being used or developed. It _may_ have been checked to see if build 12-Sep-2018 15:30:24 +// it still compiles but it should not be trusted as being up to date or remotely correct. It is build 12-Sep-2018 15:30:24 +// being kept around as an an example of a previous attempt to do something like this. build 12-Sep-2018 15:30:24 +// Use with extreme caution. build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // #ifdef _OPENMP build 12-Sep-2018 15:30:24 // #include build 12-Sep-2018 15:30:24 // #endif build 12-Sep-2018 15:30:24 @@ -17,28 +22,14 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 namespace po = boost::program_options; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost::filesystem; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost::lambda; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "SDMBinData.h" build 12-Sep-2018 15:30:24 using namespace sdmbin; build 12-Sep-2018 15:30:24 @@ -53,12 +44,17 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include "measures/Measures/Stokes.h" build 12-Sep-2018 15:30:24 #include "measures/Measures/MFrequency.h" build 12-Sep-2018 15:30:24 using namespace casacore; build 12-Sep-2018 15:30:24 -using namespace casa; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include "CBasebandName.h" build 12-Sep-2018 15:30:24 @@ -93,6 +89,8 @@ using namespace asdmbinaries; build 12-Sep-2018 15:30:24 #include "asdmstman/AsdmStMan.h" build 12-Sep-2018 15:30:24 #include "BDF2AsdmStManIndex.h" build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#include "ScansParser.h" build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 #include "time.h" /* */ build 12-Sep-2018 15:30:24 #if defined(__sysv__) build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -724,7 +722,7 @@ void spher(const vector& x, vector& s) { build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 void topo2geomat(double lambda, double phi, vector >& mat) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - double cpsi, spsi, clam, slam, cphi, sphi; build 12-Sep-2018 15:30:24 + double clam, slam, cphi, sphi; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 clam = cos(lambda); build 12-Sep-2018 15:30:24 slam = sin(lambda); build 12-Sep-2018 15:30:24 @@ -883,75 +881,6 @@ bool withCompression = false; build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 bool overTheTopExists(PointingRow* row) { return row->isOverTheTopExists(); } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -// build 12-Sep-2018 15:30:24 -// A collection of declarations and functions used for the parsing of the 'scans' option. build 12-Sep-2018 15:30:24 -// build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -using namespace boost::spirit::classic; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -vector eb_v; build 12-Sep-2018 15:30:24 -int allEbs = -1; build 12-Sep-2018 15:30:24 -int ebNumber = allEbs; build 12-Sep-2018 15:30:24 -int readEb = allEbs; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -set scan_s; build 12-Sep-2018 15:30:24 -int scanNumber0, scanNumber1; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -map > eb_scan_m; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/* build 12-Sep-2018 15:30:24 -** Inserts all the integer values in the range [scanNumber0, scanNumber1] in the set referred build 12-Sep-2018 15:30:24 -** to by the global variable scan_s. build 12-Sep-2018 15:30:24 -** The two parameters begin and end are not used and here only to comply with the Spirit parser's convention. build 12-Sep-2018 15:30:24 -** build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 -void fillScanSet(const char* begin, const char* end) { build 12-Sep-2018 15:30:24 - for (int i = scanNumber0; i < (scanNumber1+1); i++) build 12-Sep-2018 15:30:24 - scan_s.insert(i); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/* build 12-Sep-2018 15:30:24 -** Inserts all the elements of the set referred to by the global variable scan_s into build 12-Sep-2018 15:30:24 -** the set associated with the (int) key equal to the last value of the global vector eb_v build 12-Sep-2018 15:30:24 -** in the global map eb_scan_m. build 12-Sep-2018 15:30:24 -** The two parameters begin and end are not used and here only to comply with the Spirit parser's convention. build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 -void mergeScanSet(const char* begin, const char* end) { build 12-Sep-2018 15:30:24 - int key = eb_v.back(); build 12-Sep-2018 15:30:24 - eb_scan_m[key].insert(scan_s.begin(), scan_s.end()); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/* build 12-Sep-2018 15:30:24 -** Empties the global set scan_s. build 12-Sep-2018 15:30:24 -** The two parameters begin and end are not used and here only to comply with the Spirit parser's convention. build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 -void clearScanSet(const char* begin, const char* end) { build 12-Sep-2018 15:30:24 - scan_s.clear(); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/* build 12-Sep-2018 15:30:24 -** Defines the grammar and the behaviour of a Spirit parser build 12-Sep-2018 15:30:24 -** able to process a scan selection. build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 -struct eb_scan_selection : public grammar { build 12-Sep-2018 15:30:24 - template struct definition { build 12-Sep-2018 15:30:24 - definition (eb_scan_selection const& self) { build 12-Sep-2018 15:30:24 - eb_scan_list = eb_scan >> *(';' >> eb_scan); build 12-Sep-2018 15:30:24 - eb_scan = (eb[push_back_a(eb_v, ebNumber)][assign_a(ebNumber, allEbs)] >> scan_list)[&mergeScanSet][&clearScanSet]; build 12-Sep-2018 15:30:24 - eb = !(int_p[assign_a(readEb)] >> ':')[assign_a(ebNumber, readEb)]; build 12-Sep-2018 15:30:24 - scan_list = !((scan_selection >> *(',' >> scan_selection))); build 12-Sep-2018 15:30:24 - scan_selection = (int_p[assign_a(scanNumber0)][assign_a(scanNumber1)] >> !('~' >> int_p[assign_a(scanNumber1)])) build 12-Sep-2018 15:30:24 - [&fillScanSet] build 12-Sep-2018 15:30:24 - [assign_a(scanNumber0, -1)] build 12-Sep-2018 15:30:24 - [assign_a(scanNumber1, -1)]; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - rule eb_scan_list, eb_scan, eb, scan_list, scan_selection; build 12-Sep-2018 15:30:24 - rule const& start() const { return eb_scan_list ; } build 12-Sep-2018 15:30:24 - }; build 12-Sep-2018 15:30:24 -}; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 map swIdx2Idx ; // A map which associates old and new index of Spectral Windows before/after reordering. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ build 12-Sep-2018 15:30:24 @@ -1131,39 +1060,39 @@ Table * buildAndAttachEphemeris(const string & name, vector observerLoc build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // The table keywords firstly. build 12-Sep-2018 15:30:24 tableDesc.comment() = "An ephemeris table."; build 12-Sep-2018 15:30:24 - tableDesc.rwKeywordSet().define("MJD0", casa::Double(0.0)); build 12-Sep-2018 15:30:24 - tableDesc.rwKeywordSet().define("dMJD", casa::Double(0.0)); build 12-Sep-2018 15:30:24 + tableDesc.rwKeywordSet().define("MJD0", casacore::Double(0.0)); build 12-Sep-2018 15:30:24 + tableDesc.rwKeywordSet().define("dMJD", casacore::Double(0.0)); build 12-Sep-2018 15:30:24 tableDesc.rwKeywordSet().define("NAME", "T.B.D"); build 12-Sep-2018 15:30:24 - tableDesc.rwKeywordSet().define("GeoLong", casa::Double(observerLocation[0] / 3.14159265 * 180.0)); build 12-Sep-2018 15:30:24 - tableDesc.rwKeywordSet().define("GeoLat", casa::Double(observerLocation[1] / 3.14159265 * 180.0)); build 12-Sep-2018 15:30:24 - tableDesc.rwKeywordSet().define("GeoDist", casa::Double(observerLocation[2])); build 12-Sep-2018 15:30:24 + tableDesc.rwKeywordSet().define("GeoLong", casacore::Double(observerLocation[0] / 3.14159265 * 180.0)); build 12-Sep-2018 15:30:24 + tableDesc.rwKeywordSet().define("GeoLat", casacore::Double(observerLocation[1] / 3.14159265 * 180.0)); build 12-Sep-2018 15:30:24 + tableDesc.rwKeywordSet().define("GeoDist", casacore::Double(observerLocation[2])); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Then the fields definitions and keywords. build 12-Sep-2018 15:30:24 - ScalarColumnDesc mjdColumn("MJD"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc mjdColumn("MJD"); build 12-Sep-2018 15:30:24 mjdColumn.rwKeywordSet().define("UNIT", "d"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(mjdColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ScalarColumnDesc raColumn("RA"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc raColumn("RA"); build 12-Sep-2018 15:30:24 raColumn.rwKeywordSet().define("UNIT", "deg"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(raColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ScalarColumnDesc decColumn("DEC"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc decColumn("DEC"); build 12-Sep-2018 15:30:24 decColumn.rwKeywordSet().define("UNIT", "deg"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(decColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ScalarColumnDesc rhoColumn("Rho"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc rhoColumn("Rho"); build 12-Sep-2018 15:30:24 rhoColumn.rwKeywordSet().define("UNIT", "AU"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(rhoColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ScalarColumnDesc radVelColumn("RadVel"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc radVelColumn("RadVel"); build 12-Sep-2018 15:30:24 radVelColumn.rwKeywordSet().define("UNIT", "AU/d"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(radVelColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ScalarColumnDesc diskLongColumn("diskLong"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc diskLongColumn("diskLong"); build 12-Sep-2018 15:30:24 diskLongColumn.rwKeywordSet().define("UNIT", "deg"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(diskLongColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ScalarColumnDesc diskLatColumn("diskLat"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc diskLatColumn("diskLat"); build 12-Sep-2018 15:30:24 diskLatColumn.rwKeywordSet().define("UNIT", "deg"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(diskLatColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1301,7 +1230,7 @@ private: build 12-Sep-2018 15:30:24 template build 12-Sep-2018 15:30:24 vector dd2v(vector dataDescriptionId_v, S s) { build 12-Sep-2018 15:30:24 vector result_v; build 12-Sep-2018 15:30:24 - transform(dataDescriptionId_v.begin(), dataDescriptionId_v.end(), back_inserter(result_v), s); build 12-Sep-2018 15:30:24 + std::transform(dataDescriptionId_v.begin(), dataDescriptionId_v.end(), std::back_inserter(result_v), s); build 12-Sep-2018 15:30:24 return result_v; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1319,12 +1248,15 @@ map > msGroup(ASDM * ds_p) { build 12-Sep-2018 15:30:24 vector empty_v; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 const vector & mR_v = ds_p->getMain().get(); build 12-Sep-2018 15:30:24 - for (int i = 0; i < mR_v.size(); i++) { build 12-Sep-2018 15:30:24 + for (unsigned int i = 0; i < mR_v.size(); i++) { build 12-Sep-2018 15:30:24 Tag cfgId = mR_v[i]->getConfigDescriptionId(); build 12-Sep-2018 15:30:24 cfgR_s.insert(ds_p->getConfigDescription().getRowByKey(cfgId)); build 12-Sep-2018 15:30:24 if (bdfNamesPerCfgId_m.find(cfgId) == bdfNamesPerCfgId_m.end() ) build 12-Sep-2018 15:30:24 bdfNamesPerCfgId_m[cfgId] = empty_v; build 12-Sep-2018 15:30:24 - bdfNamesPerCfgId_m[cfgId].push_back( replace_all_copy(replace_all_copy(mR_v[i]->getDataUID().getEntityId().toString(), ":", "_"), "/", "_") ); build 12-Sep-2018 15:30:24 + string dataUID = mR_v[i]->getDataUID().getEntityId().toString(); build 12-Sep-2018 15:30:24 + replace(dataUID.begin(),dataUID.end(),':','_'); build 12-Sep-2018 15:30:24 + replace(dataUID.begin(),dataUID.end(),'/','_'); build 12-Sep-2018 15:30:24 + bdfNamesPerCfgId_m[cfgId].push_back(dataUID); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 map > msGroupPerConfigDesc_m; build 12-Sep-2018 15:30:24 @@ -1419,7 +1351,8 @@ void fillAntenna(ASDM * ds_p) { build 12-Sep-2018 15:30:24 for (map::iterator iter = msFillers.begin(); build 12-Sep-2018 15:30:24 iter != msFillers.end(); build 12-Sep-2018 15:30:24 ++iter) { build 12-Sep-2018 15:30:24 - int antenna_id = iter->second->addAntenna(r->getName(), build 12-Sep-2018 15:30:24 + // the return value here is not used build 12-Sep-2018 15:30:24 + /* int antenna_id = */ iter->second->addAntenna(r->getName(), build 12-Sep-2018 15:30:24 r->getStationUsingStationId()->getName(), build 12-Sep-2018 15:30:24 xPosition, build 12-Sep-2018 15:30:24 yPosition, build 12-Sep-2018 15:30:24 @@ -1514,7 +1447,7 @@ void fillCalDevice(ASDM* ds_p, bool ignoreTime, vector& selectedScanRo build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 calLoadNames.resize(temp.size()); build 12-Sep-2018 15:30:24 - transform(temp.begin(), temp.end(), calLoadNames.begin(), stringValue); build 12-Sep-2018 15:30:24 + std::transform(temp.begin(), temp.end(), calLoadNames.begin(), stringValue); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 @@ -1643,7 +1576,7 @@ void fillCalDevice(ASDM* ds_p, bool ignoreTime, vector& selectedScanRo build 12-Sep-2018 15:30:24 coupledNoiseCal.resize(numReceptor); build 12-Sep-2018 15:30:24 for (unsigned int iReceptor = 0; iReceptor < numReceptor; iReceptor++) { build 12-Sep-2018 15:30:24 coupledNoiseCal[iReceptor].resize(numCalload); build 12-Sep-2018 15:30:24 - transform(noiseCal.begin(), noiseCal.begin()+numCalload, coupledNoiseCal[iReceptor].begin(), d2f); build 12-Sep-2018 15:30:24 + std::transform(noiseCal.begin(), noiseCal.begin()+numCalload, coupledNoiseCal[iReceptor].begin(), d2f); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -1664,7 +1597,7 @@ void fillCalDevice(ASDM* ds_p, bool ignoreTime, vector& selectedScanRo build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 temperatureLoad.resize(temp.size()); build 12-Sep-2018 15:30:24 - transform(temp.begin(), temp.end(), temperatureLoad.begin(), basicTypeValue); build 12-Sep-2018 15:30:24 + std::transform(temp.begin(), temp.end(), temperatureLoad.begin(), basicTypeValue); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1708,7 +1641,7 @@ void fillCalDevice(ASDM* ds_p, bool ignoreTime, vector& selectedScanRo build 12-Sep-2018 15:30:24 temperatureLoad); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - unsigned int numMSCalDevices = (const_cast(msFillers.begin()->second->ms()))->rwKeywordSet().asTable("CALDEVICE").nrow(); build 12-Sep-2018 15:30:24 + unsigned int numMSCalDevices = (const_cast(msFillers.begin()->second->ms()))->rwKeywordSet().asTable("CALDEVICE").nrow(); build 12-Sep-2018 15:30:24 if (numMSCalDevices > 0) { build 12-Sep-2018 15:30:24 infostream.str(""); build 12-Sep-2018 15:30:24 infostream << "converted in " << numMSCalDevices << " caldevice(s) in the measurement set."; build 12-Sep-2018 15:30:24 @@ -1864,45 +1797,45 @@ void fillEphemeris(ASDM* ds_p, uint64_t timeStepInNanoSecond) { build 12-Sep-2018 15:30:24 TableDesc tableDesc; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 tableDesc.comment() = v[0]->getOrigin(); build 12-Sep-2018 15:30:24 - tableDesc.rwKeywordSet().define("MJD0", casa::Double(mjd0)); build 12-Sep-2018 15:30:24 - tableDesc.rwKeywordSet().define("dMJD", casa::Double(dmjd)); build 12-Sep-2018 15:30:24 + tableDesc.rwKeywordSet().define("MJD0", casacore::Double(mjd0)); build 12-Sep-2018 15:30:24 + tableDesc.rwKeywordSet().define("dMJD", casacore::Double(dmjd)); build 12-Sep-2018 15:30:24 tableDesc.rwKeywordSet().define("NAME", fieldName); build 12-Sep-2018 15:30:24 - tableDesc.rwKeywordSet().define("GeoLong", casa::Double(geoLong)); build 12-Sep-2018 15:30:24 - tableDesc.rwKeywordSet().define("GeoLat", casa::Double(geoLat)); build 12-Sep-2018 15:30:24 - tableDesc.rwKeywordSet().define("GeoDist", casa::Double(geoDist)); build 12-Sep-2018 15:30:24 + tableDesc.rwKeywordSet().define("GeoLong", casacore::Double(geoLong)); build 12-Sep-2018 15:30:24 + tableDesc.rwKeywordSet().define("GeoLat", casacore::Double(geoLat)); build 12-Sep-2018 15:30:24 + tableDesc.rwKeywordSet().define("GeoDist", casacore::Double(geoDist)); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Then the fields definitions and keywords. build 12-Sep-2018 15:30:24 - ScalarColumnDesc mjdColumn("MJD"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc mjdColumn("MJD"); build 12-Sep-2018 15:30:24 mjdColumn.rwKeywordSet().define("UNIT", "d"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(mjdColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ScalarColumnDesc raColumn("RA"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc raColumn("RA"); build 12-Sep-2018 15:30:24 raColumn.rwKeywordSet().define("UNIT", "deg"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(raColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ScalarColumnDesc decColumn("DEC"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc decColumn("DEC"); build 12-Sep-2018 15:30:24 decColumn.rwKeywordSet().define("UNIT", "deg"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(decColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ScalarColumnDesc rhoColumn("Rho"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc rhoColumn("Rho"); build 12-Sep-2018 15:30:24 rhoColumn.rwKeywordSet().define("UNIT", "AU"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(rhoColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ScalarColumnDesc radVelColumn("RadVel"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc radVelColumn("RadVel"); build 12-Sep-2018 15:30:24 radVelColumn.rwKeywordSet().define("UNIT", "km/s"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(radVelColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ScalarColumnDesc diskLongColumn("diskLong"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc diskLongColumn("diskLong"); build 12-Sep-2018 15:30:24 diskLongColumn.rwKeywordSet().define("UNIT", "deg"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(diskLongColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ScalarColumnDesc diskLatColumn("diskLat"); build 12-Sep-2018 15:30:24 + ScalarColumnDesc diskLatColumn("diskLat"); build 12-Sep-2018 15:30:24 diskLatColumn.rwKeywordSet().define("UNIT", "deg"); build 12-Sep-2018 15:30:24 tableDesc.addColumn(diskLatColumn); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 string tableName = "EPHEM" build 12-Sep-2018 15:30:24 - + boost::lexical_cast(ephemerisId) build 12-Sep-2018 15:30:24 + + TO_STRING(ephemerisId) build 12-Sep-2018 15:30:24 + "_" build 12-Sep-2018 15:30:24 + fieldName build 12-Sep-2018 15:30:24 + "_" build 12-Sep-2018 15:30:24 @@ -1920,7 +1853,7 @@ void fillEphemeris(ASDM* ds_p, uint64_t timeStepInNanoSecond) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Table* table_p = new Table(tableSetup, TableLock(TableLock::PermanentLockingWait)); build 12-Sep-2018 15:30:24 AlwaysAssert(table_p, AipsError); build 12-Sep-2018 15:30:24 - (const_cast(iter->second->ms()))->rwKeywordSet().defineTable(tableName, *table_p); build 12-Sep-2018 15:30:24 + (const_cast(iter->second->ms()))->rwKeywordSet().defineTable(tableName, *table_p); build 12-Sep-2018 15:30:24 table_p->flush(); build 12-Sep-2018 15:30:24 apc2EphemTable_m[iter->first] = table_p; build 12-Sep-2018 15:30:24 LOG("Empty ephemeris table '" + tablePath + "' created"); build 12-Sep-2018 15:30:24 @@ -2063,7 +1996,7 @@ void fillEphemeris(ASDM* ds_p, uint64_t timeStepInNanoSecond) { build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 raASDM_vv.push_back(empty_v); build 12-Sep-2018 15:30:24 decASDM_vv.push_back(empty_v); build 12-Sep-2018 15:30:24 - for (unsigned int j = 0; j < v[i]->getNumPolyDir(); j++) { build 12-Sep-2018 15:30:24 + for (int j = 0; j < v[i]->getNumPolyDir(); j++) { build 12-Sep-2018 15:30:24 raASDM_vv.back().push_back(temp_vv[j][0]/3.14159265*180.0); build 12-Sep-2018 15:30:24 decASDM_vv.back().push_back(temp_vv[j][1]/3.14159265*180.0); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -2076,7 +2009,7 @@ void fillEphemeris(ASDM* ds_p, uint64_t timeStepInNanoSecond) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 distanceASDM_vv.push_back(empty_v); build 12-Sep-2018 15:30:24 - for (unsigned int j = 0; j < v[i]->getNumPolyDist(); j++) build 12-Sep-2018 15:30:24 + for (int j = 0; j < v[i]->getNumPolyDist(); j++) build 12-Sep-2018 15:30:24 distanceASDM_vv.back().push_back(temp_v[j] / 1.4959787066e11); // AU build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -2088,7 +2021,7 @@ void fillEphemeris(ASDM* ds_p, uint64_t timeStepInNanoSecond) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 radVelASDM_vv.push_back(empty_v); build 12-Sep-2018 15:30:24 - for (unsigned int j = 0; j < v[i]->getNumPolyRadVel(); j++) build 12-Sep-2018 15:30:24 + for (int j = 0; j < v[i]->getNumPolyRadVel(); j++) build 12-Sep-2018 15:30:24 radVelASDM_vv.back().push_back(temp_v[j]/1000); // km/s build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -2308,29 +2241,29 @@ void fillEphemeris(ASDM* ds_p, uint64_t timeStepInNanoSecond) { build 12-Sep-2018 15:30:24 LOG ("Added "+TO_STRING(numRows)+" rows to table "+((string)table_p->tableName())); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 LOG("Filling column MJD"); build 12-Sep-2018 15:30:24 - Vector MJD_V(IPosition(1, numRows), &mjdMS_v[0], SHARE); build 12-Sep-2018 15:30:24 - ScalarColumn MJD(*table_p, "MJD"); build 12-Sep-2018 15:30:24 + Vector MJD_V(IPosition(1, numRows), &mjdMS_v[0], SHARE); build 12-Sep-2018 15:30:24 + ScalarColumn MJD(*table_p, "MJD"); build 12-Sep-2018 15:30:24 MJD.putColumnRange(slicer, MJD_V); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 LOG("Filling column RA"); build 12-Sep-2018 15:30:24 - Vector RA_V(IPosition(1, numRows), &raMS_v[0], SHARE); build 12-Sep-2018 15:30:24 - ScalarColumn RA(*table_p, "RA"); build 12-Sep-2018 15:30:24 + Vector RA_V(IPosition(1, numRows), &raMS_v[0], SHARE); build 12-Sep-2018 15:30:24 + ScalarColumn RA(*table_p, "RA"); build 12-Sep-2018 15:30:24 RA.putColumnRange(slicer, RA_V); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 LOG("Filling column DEC"); build 12-Sep-2018 15:30:24 - Vector DEC_V(IPosition(1, numRows), &decMS_v[0], SHARE); build 12-Sep-2018 15:30:24 - ScalarColumn DEC(*table_p, "DEC"); build 12-Sep-2018 15:30:24 + Vector DEC_V(IPosition(1, numRows), &decMS_v[0], SHARE); build 12-Sep-2018 15:30:24 + ScalarColumn DEC(*table_p, "DEC"); build 12-Sep-2018 15:30:24 DEC.putColumnRange(slicer, DEC_V); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 LOG ("Filling column Rho"); build 12-Sep-2018 15:30:24 - Vector Rho_V(IPosition(1, numRows), &distanceMS_v[0], SHARE); build 12-Sep-2018 15:30:24 - ScalarColumn Rho(*table_p, "Rho"); build 12-Sep-2018 15:30:24 + Vector Rho_V(IPosition(1, numRows), &distanceMS_v[0], SHARE); build 12-Sep-2018 15:30:24 + ScalarColumn Rho(*table_p, "Rho"); build 12-Sep-2018 15:30:24 Rho.putColumnRange(slicer, Rho_V); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (radVelExists) { build 12-Sep-2018 15:30:24 LOG ("Filling column RadVel"); build 12-Sep-2018 15:30:24 - Vector RadVel_V(IPosition(1, numRows), &radVelMS_v[0], SHARE); build 12-Sep-2018 15:30:24 - ScalarColumn RadVel(*table_p, "RadVel"); build 12-Sep-2018 15:30:24 + Vector RadVel_V(IPosition(1, numRows), &radVelMS_v[0], SHARE); build 12-Sep-2018 15:30:24 + ScalarColumn RadVel(*table_p, "RadVel"); build 12-Sep-2018 15:30:24 RadVel.putColumnRange(slicer, RadVel_V); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -3389,7 +3322,7 @@ void fillSpectralWindow(ASDM* ds_p) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // To answer JIRA ticket CAS-3265 / Dirk Petry build 12-Sep-2018 15:30:24 if (chanFreq1D[chanFreq1D.size() - 1] < chanFreq1D[0] ) build 12-Sep-2018 15:30:24 - transform(chanWidth1D.begin(), chanWidth1D.end(), chanWidth1D.begin(), negateFunctor()); build 12-Sep-2018 15:30:24 + std::transform(chanWidth1D.begin(), chanWidth1D.end(), chanWidth1D.begin(), negateFunctor()); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 /* Processing the effectiveBwXXX build 12-Sep-2018 15:30:24 * build 12-Sep-2018 15:30:24 @@ -3826,7 +3759,7 @@ string complexifyCrossData_s (float* data, uint32_t numData, uint32_t numCorr, u build 12-Sep-2018 15:30:24 return oss.str().substr(0, numChar); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -void complexifyCrossData_f(float* data, uint32_t numData, uint32_t numCorr, vector& result) { build 12-Sep-2018 15:30:24 +void complexifyCrossData_f(float* data, uint32_t numData, uint32_t /* numCorr */, vector& result) { build 12-Sep-2018 15:30:24 LOGENTER("complexifyCrossData_f"); build 12-Sep-2018 15:30:24 result.resize(numData); build 12-Sep-2018 15:30:24 copy(data, data+numData, result.begin()); build 12-Sep-2018 15:30:24 @@ -3834,21 +3767,21 @@ void complexifyCrossData_f(float* data, uint32_t numData, uint32_t numCorr, vect build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 template build 12-Sep-2018 15:30:24 -void listCrossData(int64_t midpoint, int64_t interval, uint32_t numCrossData, T * data_p, vector >& bb_spw_v, AnyValueMap& msGroup_avm, uint32_t dataDescIndex, vector& binaryDataPath_p_v, bool mute) { build 12-Sep-2018 15:30:24 +void listCrossData(int64_t /* midpoint */, int64_t /* interval */, uint32_t numCrossData, T * data_p, vector >& bb_spw_v, AnyValueMap& msGroup_avm, uint32_t dataDescIndex, vector& binaryDataPath_p_v, bool mute) { build 12-Sep-2018 15:30:24 LOGENTER("listCrossData"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 LOG("ici_1"); build 12-Sep-2018 15:30:24 float oneOverScaleFactor = 1.0 / bb_spw_v[dataDescIndex].getValue("scaleFactor"); build 12-Sep-2018 15:30:24 vector cdSlice; build 12-Sep-2018 15:30:24 - transform ( data_p, build 12-Sep-2018 15:30:24 - data_p+numCrossData, build 12-Sep-2018 15:30:24 - back_inserter(cdSlice), build 12-Sep-2018 15:30:24 - oneOverScaleFactor * _1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + std::transform ( data_p, build 12-Sep-2018 15:30:24 + data_p+numCrossData, build 12-Sep-2018 15:30:24 + std::back_inserter(cdSlice), build 12-Sep-2018 15:30:24 + [oneOverScaleFactor](int i){return i*oneOverScaleFactor;}); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 vector antennaId_v = msGroup_avm.getValue >("antennas"); build 12-Sep-2018 15:30:24 unsigned int blIndex = 0; build 12-Sep-2018 15:30:24 unsigned int numCrossPolProducts = bb_spw_v[dataDescIndex].getValue >("crossPolProducts").size(); build 12-Sep-2018 15:30:24 - unsigned int numDD = msGroup_avm.getValue >("ddId").size(); build 12-Sep-2018 15:30:24 + // unsigned int numDD = msGroup_avm.getValue >("ddId").size(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 unsigned int base = 0; build 12-Sep-2018 15:30:24 unsigned int sliceStart = 0; build 12-Sep-2018 15:30:24 @@ -3892,7 +3825,7 @@ string complexifyAutoData_s (const AUTODATATYPE* data, uint32_t numAutoData, uin build 12-Sep-2018 15:30:24 switch (numCorr) { build 12-Sep-2018 15:30:24 case 1: build 12-Sep-2018 15:30:24 case 2: build 12-Sep-2018 15:30:24 - for_each (data, data+numAutoData, oss << "(" << _1 << ")"); build 12-Sep-2018 15:30:24 + for_each (data, data+numAutoData, [&oss](int i){oss << "(" << i << ")";}); build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 case 3 : build 12-Sep-2018 15:30:24 @@ -3965,12 +3898,12 @@ void complexifyAutoData_f (const AUTODATATYPE* data, uint32_t numAutoData, uint3 build 12-Sep-2018 15:30:24 LOGEXIT("complexifyCrossData_f"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -void listAutoData(int64_t midpoint, int64_t interval, uint32_t numAutoData, const AUTODATATYPE * data_p, vector >& bb_spw_v, AnyValueMap& msGroup_avm, uint32_t dataDescIndex, vector& binaryDataPath_p_v, bool mute) { build 12-Sep-2018 15:30:24 +void listAutoData(int64_t /* midpoint */, int64_t /* interval */, uint32_t /* numAutoData */, const AUTODATATYPE * data_p, vector >& bb_spw_v, AnyValueMap& msGroup_avm, uint32_t dataDescIndex, vector& binaryDataPath_p_v, bool mute) { build 12-Sep-2018 15:30:24 LOGENTER("listAutoData"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 vector antennaId_v = msGroup_avm.getValue >("antennas"); build 12-Sep-2018 15:30:24 unsigned int numSdPolProducts = bb_spw_v[dataDescIndex].getValue >("sdPolProducts").size(); build 12-Sep-2018 15:30:24 - uint32_t numDD = msGroup_avm.getValue >("ddId").size(); build 12-Sep-2018 15:30:24 + // uint32_t numDD = msGroup_avm.getValue >("ddId").size(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 unsigned int sliceStart = 0; build 12-Sep-2018 15:30:24 unsigned int sliceEnd = 0; build 12-Sep-2018 15:30:24 @@ -4020,15 +3953,15 @@ void complexifyRadiometricData_f(const AUTODATATYPE* data, uint32_t numRadiometr build 12-Sep-2018 15:30:24 LOGEXIT("complexifyRadiometricData_f"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -void listRadiometricData(int64_t midpoint, int64_t interval, uint32_t numTime, uint32_t numRadiometricData, const AUTODATATYPE * data_p, vector >& bb_spw_v, AnyValueMap& msGroup_avm, uint32_t dataDescIndex, vector& binaryDataPath_p_v, bool mute) { build 12-Sep-2018 15:30:24 +void listRadiometricData(int64_t /* midpoint */, int64_t /* interval */, uint32_t numTime, uint32_t /* numRadiometricData */, const AUTODATATYPE * data_p, vector >& bb_spw_v, AnyValueMap& msGroup_avm, uint32_t dataDescIndex, vector& binaryDataPath_p_v, bool mute) { build 12-Sep-2018 15:30:24 LOGENTER("listRadiometricData"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 vector antennaId_v = msGroup_avm.getValue >("antennas"); build 12-Sep-2018 15:30:24 unsigned int numSdPolProducts = bb_spw_v[dataDescIndex].getValue >("sdPolProducts").size(); build 12-Sep-2018 15:30:24 - uint32_t numDD = msGroup_avm.getValue >("ddId").size(); build 12-Sep-2018 15:30:24 + // uint32_t numDD = msGroup_avm.getValue >("ddId").size(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - float deltaTime = interval / ((float) numTime); build 12-Sep-2018 15:30:24 - float startTime = midpoint - (interval - deltaTime) / 2.0; build 12-Sep-2018 15:30:24 + // float deltaTime = interval / ((float) numTime); build 12-Sep-2018 15:30:24 + // float startTime = midpoint - (interval - deltaTime) / 2.0; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 uint32_t antOffset = msGroup_avm.getValue("antOffset"); build 12-Sep-2018 15:30:24 uint32_t rmdOffset = msGroup_avm.getValue >("rmdBBOffset")[dataDescIndex]; build 12-Sep-2018 15:30:24 @@ -4071,20 +4004,20 @@ void fillMainPar( const string& dsPath, ASDM * ds_p, bool doparallel, bool mute build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 map > msGroup_m = msGroup(ds_p); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - boost::regex crossDataAxesRE("BAL( +BAB)?( +APC)?( +SPP)?( +POL)?"); build 12-Sep-2018 15:30:24 - boost::regex autoDataAxesRE("ANT( +BAB)?( +SPP)?( +POL)?"); build 12-Sep-2018 15:30:24 - boost::regex radiometerAxesRE("TIM ANT( +SPP)?"); build 12-Sep-2018 15:30:24 + std::regex crossDataAxesRE("BAL( +BAB)?( +APC)?( +SPP)?( +POL)?"); build 12-Sep-2018 15:30:24 + std::regex autoDataAxesRE("ANT( +BAB)?( +SPP)?( +POL)?"); build 12-Sep-2018 15:30:24 + std::regex radiometerAxesRE("TIM ANT( +SPP)?"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 /* build 12-Sep-2018 15:30:24 * Now process the bdf files grouped by configDescriptionId. build 12-Sep-2018 15:30:24 * build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 vector keys_v; build 12-Sep-2018 15:30:24 - transform( msGroup_m.begin(), build 12-Sep-2018 15:30:24 - msGroup_m.end(), build 12-Sep-2018 15:30:24 - back_inserter(keys_v), build 12-Sep-2018 15:30:24 - bind (&std::map >::value_type::first, _1) build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 + std::transform( msGroup_m.begin(), build 12-Sep-2018 15:30:24 + msGroup_m.end(), build 12-Sep-2018 15:30:24 + std::back_inserter(keys_v), build 12-Sep-2018 15:30:24 + std::bind (&std::map >::value_type::first, std::placeholders::_1) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // cout << "Size of keys = " << keys_v.size() << endl; build 12-Sep-2018 15:30:24 // copy ( keys_v.begin(), keys_v.end(), std::ostream_iterator(std::cout, "\n") ); build 12-Sep-2018 15:30:24 @@ -4259,7 +4192,7 @@ void fillMainPar( const string& dsPath, ASDM * ds_p, bool doparallel, bool mute build 12-Sep-2018 15:30:24 const AUTODATATYPE * autoData_p; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #pragma omp parallel for schedule(dynamic) if(doparallel) build 12-Sep-2018 15:30:24 - for (int32_t dataDescIndex = 0; dataDescIndex < dataDescriptionId_v.size(); dataDescIndex++) { build 12-Sep-2018 15:30:24 + for (uint32_t dataDescIndex = 0; dataDescIndex < dataDescriptionId_v.size(); dataDescIndex++) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // if (omp_get_thread_num() == 1) build 12-Sep-2018 15:30:24 //cout << "Number of threads=" + TO_STRING(omp_get_num_threads()) + "\n"; build 12-Sep-2018 15:30:24 @@ -4369,7 +4302,7 @@ void fillMainPar( const string& dsPath, ASDM * ds_p, bool doparallel, bool mute build 12-Sep-2018 15:30:24 * !!!!! One must be carefull to the fact that fillState must have been called before fillMain. During the execution of fillState , the global vector msStateID build 12-Sep-2018 15:30:24 * is filled and will be used by fillMain. build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 -void fillMain(int rowNum, build 12-Sep-2018 15:30:24 +void fillMain(int /* rowNum */, build 12-Sep-2018 15:30:24 MainRow* r_p, build 12-Sep-2018 15:30:24 SDMBinData& sdmBinData, build 12-Sep-2018 15:30:24 const VMSData* vmsData_p, build 12-Sep-2018 15:30:24 @@ -4409,7 +4342,7 @@ void fillMain(int rowNum, build 12-Sep-2018 15:30:24 /* compute the UVW */ build 12-Sep-2018 15:30:24 vector uvw(3*vmsData_p->v_time.size()); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - vector > vv_uvw; build 12-Sep-2018 15:30:24 + vector > vv_uvw; build 12-Sep-2018 15:30:24 #if DDPRIORITY build 12-Sep-2018 15:30:24 uvwCoords.uvw_bl(r_p, sdmBinData.timeSequence(), e_query_cm, build 12-Sep-2018 15:30:24 sdmbin::SDMBinData::dataOrder(), build 12-Sep-2018 15:30:24 @@ -4540,6 +4473,9 @@ void fillMain(int rowNum, build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (uncorrectedData.size() > 0 && (msFillers.find(AP_UNCORRECTED) != msFillers.end())) { build 12-Sep-2018 15:30:24 if (! mute) { build 12-Sep-2018 15:30:24 + // when found, missing weight and sigma arguments, added here to set default values to check with compiler build 12-Sep-2018 15:30:24 + vector weight_v(vmsData_p->v_time.size(),1.0); build 12-Sep-2018 15:30:24 + vector sigma_v(vmsData_p->v_time.size(),1.0); build 12-Sep-2018 15:30:24 msFillers[AP_UNCORRECTED]->addData(complexData, build 12-Sep-2018 15:30:24 (vector&) vmsData_p->v_time, // this is already time midpoint build 12-Sep-2018 15:30:24 (vector&) vmsData_p->v_antennaId1, build 12-Sep-2018 15:30:24 @@ -4559,12 +4495,18 @@ void fillMain(int rowNum, build 12-Sep-2018 15:30:24 uvw, build 12-Sep-2018 15:30:24 filteredShape, // vmsData_p->vv_dataShape after filtering the case numCorr == 3 build 12-Sep-2018 15:30:24 uncorrectedData, build 12-Sep-2018 15:30:24 - (vector&)vmsData_p->v_flag); build 12-Sep-2018 15:30:24 + (vector&)vmsData_p->v_flag, build 12-Sep-2018 15:30:24 + weight_v, build 12-Sep-2018 15:30:24 + sigma_v); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (correctedData.size() > 0 && (msFillers.find(AP_CORRECTED) != msFillers.end())) { build 12-Sep-2018 15:30:24 if (! mute) { build 12-Sep-2018 15:30:24 + // missing correctedWeight and correctedSigma, added default values here to build 12-Sep-2018 15:30:24 + // check compiler. Not correct build 12-Sep-2018 15:30:24 + vector correctedWeight(correctedTime.size(),1.0); build 12-Sep-2018 15:30:24 + vector correctedSigma(correctedTime.size(),1.0); build 12-Sep-2018 15:30:24 msFillers[AP_CORRECTED]->addData(complexData, build 12-Sep-2018 15:30:24 correctedTime, // this is already time midpoint build 12-Sep-2018 15:30:24 correctedAntennaId1, build 12-Sep-2018 15:30:24 @@ -4584,7 +4526,9 @@ void fillMain(int rowNum, build 12-Sep-2018 15:30:24 correctedUvw, build 12-Sep-2018 15:30:24 filteredShape, // vmsData_p->vv_dataShape after filtering the case numCorr == 3 build 12-Sep-2018 15:30:24 correctedData, build 12-Sep-2018 15:30:24 - correctedFlag); build 12-Sep-2018 15:30:24 + correctedFlag, build 12-Sep-2018 15:30:24 + correctedWeight, build 12-Sep-2018 15:30:24 + correctedSigma); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 if (debug) cout << "fillMain : exiting" << endl; build 12-Sep-2018 15:30:24 @@ -4604,9 +4548,9 @@ void calcUVW(MainRow* r_p, build 12-Sep-2018 15:30:24 SDMBinData& sdmBinData, build 12-Sep-2018 15:30:24 const VMSData* vmsData_p, build 12-Sep-2018 15:30:24 UvwCoords& uvwCoords, build 12-Sep-2018 15:30:24 - casa::Matrix< casa::Double >& mat_uvw) { build 12-Sep-2018 15:30:24 + casacore::Matrix< casacore::Double >& mat_uvw) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - vector< casa::Vector > vv_uvw; build 12-Sep-2018 15:30:24 + vector< casacore::Vector > vv_uvw; build 12-Sep-2018 15:30:24 mat_uvw.resize(3,vmsData_p->v_time.size()); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #if DDPRIORITY build 12-Sep-2018 15:30:24 @@ -4702,11 +4646,11 @@ void fillSysPower_aux (const vector& sysPowers, map(msFillers_m.begin()->second->ms()))->rwKeywordSet().asTable("SYSPOWER").nrow(); build 12-Sep-2018 15:30:24 + unsigned int numMSSysPowers = (const_cast(msFillers_m.begin()->second->ms()))->rwKeywordSet().asTable("SYSPOWER").nrow(); build 12-Sep-2018 15:30:24 if (numMSSysPowers > 0) { build 12-Sep-2018 15:30:24 infostream.str(""); build 12-Sep-2018 15:30:24 infostream << "converted in " << numMSSysPowers << " syspower(s) in the measurement set."; build 12-Sep-2018 15:30:24 @@ -4991,7 +4935,7 @@ void fillTopMS(ASDM* ds_p, build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ASDM2MSFiller* msFiller_p = msFillers.begin()->second; build 12-Sep-2018 15:30:24 + /* ASDM2MSFiller* msFiller_p = msFillers.begin()->second; */ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 // Firstly convert the basic tables. build 12-Sep-2018 15:30:24 @@ -5087,7 +5031,7 @@ void fillTopMS(ASDM* ds_p, build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Do we also want to store the verbatim copies of some tables of the ASDM dataset ? build 12-Sep-2018 15:30:24 if (asis) { build 12-Sep-2018 15:30:24 - ASDMVerbatimFiller avf(const_cast(msFillers.begin()->second->ms()), Name2Table::find(asisTablenames_v, verbose)); build 12-Sep-2018 15:30:24 + ASDMVerbatimFiller avf(const_cast(msFillers.begin()->second->ms()), Name2Table::find(asisTablenames_v, verbose)); build 12-Sep-2018 15:30:24 avf.fill(*ds_p); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -5222,7 +5166,7 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 appName = string(argv[0]); build 12-Sep-2018 15:30:24 ofstream ofs; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - LogSinkInterface& lsif = LogSink::globalSink(); build 12-Sep-2018 15:30:24 + // LogSinkInterface& lsif = LogSink::globalSink(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 uint64_t bdfSliceSizeInMb = 0; // The default size of the BDF slice hold in memory. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -5301,7 +5245,7 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 #if 0 build 12-Sep-2018 15:30:24 // Replaced the change at the LogSink level ... build 12-Sep-2018 15:30:24 ofs.open(vm["logfile"].as().c_str(), ios_base::app); build 12-Sep-2018 15:30:24 - LogSinkInterface *theSink = new casa::StreamLogSink(&ofs); build 12-Sep-2018 15:30:24 + LogSinkInterface *theSink = new casacore::StreamLogSink(&ofs); build 12-Sep-2018 15:30:24 LogSink::globalSink(theSink); build 12-Sep-2018 15:30:24 #else build 12-Sep-2018 15:30:24 // ... with a change at the cerr (stderr) level since by default global logs are going to cerr (stderr). build 12-Sep-2018 15:30:24 @@ -5424,7 +5368,7 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 if (vm.count("asdm-directory")) { build 12-Sep-2018 15:30:24 string dummy = vm["asdm-directory"].as< string >(); build 12-Sep-2018 15:30:24 dsPath = lrtrim(dummy) ; build 12-Sep-2018 15:30:24 - if (boost::algorithm::ends_with(dsPath,"/")) dsPath.erase(dsPath.size()-1); build 12-Sep-2018 15:30:24 + if (dsPath.back()=='/') dsPath.erase(dsPath.size()-1); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 @@ -5435,13 +5379,21 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 if (vm.count("ms-directory-prefix")) { build 12-Sep-2018 15:30:24 string dummyMSName = vm["ms-directory-prefix"].as< string >(); build 12-Sep-2018 15:30:24 dummyMSName = lrtrim(dummyMSName); build 12-Sep-2018 15:30:24 - if (boost::algorithm::ends_with(dummyMSName, "/")) dummyMSName.erase(dummyMSName.size()-1); build 12-Sep-2018 15:30:24 - boost::filesystem::path msPath(lrtrim(dummyMSName),&boost::filesystem::no_check); build 12-Sep-2018 15:30:24 - string msDirectory = msPath.branch_path().string(); build 12-Sep-2018 15:30:24 - msDirectory = lrtrim(msDirectory); build 12-Sep-2018 15:30:24 + if (dummyMSName.back()=='/') dummyMSName.erase(dummyMSName.size()-1); build 12-Sep-2018 15:30:24 + Path msPath(dummyMSName); build 12-Sep-2018 15:30:24 + string msDirectory = msPath.dirName(); build 12-Sep-2018 15:30:24 if (msDirectory.size() == 0) msDirectory = "."; build 12-Sep-2018 15:30:24 - msNamePrefix = msDirectory + "/" + boost::filesystem::basename(msPath); build 12-Sep-2018 15:30:24 - msNameExtension = boost::filesystem::extension(msPath); build 12-Sep-2018 15:30:24 + // extract the prefix and extension. Prefix is everything before any final "." build 12-Sep-2018 15:30:24 + // etension is everything after any final ".", including that final dot. build 12-Sep-2018 15:30:24 + string msPathBasename = msPath.baseName(); build 12-Sep-2018 15:30:24 + size_t rdot = msPathBasename.find_last_of('.'); build 12-Sep-2018 15:30:24 + if (rdot != std::string::npos) { build 12-Sep-2018 15:30:24 + msNameExtension = msPathBasename.substr(rdot,msPathBasename.size()-rdot); build 12-Sep-2018 15:30:24 + msNamePrefix = msPathBasename.substr(0,rdot); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + msNameExtension = ""; build 12-Sep-2018 15:30:24 + msNamePrefix = msPathBasename; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 msNamePrefix = dsPath; build 12-Sep-2018 15:30:24 @@ -5606,9 +5558,9 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 string scansOptionInfo; build 12-Sep-2018 15:30:24 if (vm.count("scans")) { build 12-Sep-2018 15:30:24 string scansOptionValue = vm["scans"].as< string >(); build 12-Sep-2018 15:30:24 - eb_scan_selection ebs; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - int status = parse(scansOptionValue.c_str(), ebs, space_p).full; build 12-Sep-2018 15:30:24 + map > eb_scan_m; build 12-Sep-2018 15:30:24 + int status = scansParser(scansOptionValue, eb_scan_m); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (status == 0) { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 @@ -5626,14 +5578,16 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 selected_eb_scan_m[iterr_m->first] = SetAndSet(iter_m->second, iterr_m->second); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - for (map >::iterator iterr_m = all_eb_scan_m.begin(); iterr_m != all_eb_scan_m.end(); iterr_m++) build 12-Sep-2018 15:30:24 - if ((iter_m=eb_scan_m.find(iterr_m->first)) != eb_scan_m.end()) build 12-Sep-2018 15:30:24 - if ((iter_m->second).empty()) build 12-Sep-2018 15:30:24 + for (map >::iterator iterr_m = all_eb_scan_m.begin(); iterr_m != all_eb_scan_m.end(); iterr_m++) { build 12-Sep-2018 15:30:24 + if ((iter_m=eb_scan_m.find(iterr_m->first)) != eb_scan_m.end()) { build 12-Sep-2018 15:30:24 + if ((iter_m->second).empty()) { build 12-Sep-2018 15:30:24 selected_eb_scan_m[iterr_m->first].insert((iterr_m->second).begin(), (iterr_m->second).end()); build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 set s = SetAndSet(iter_m->second, iterr_m->second); build 12-Sep-2018 15:30:24 selected_eb_scan_m[iterr_m->first].insert(s.begin(), s.end()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 ostringstream oss; build 12-Sep-2018 15:30:24 oss << "The following scans will be processed : " << endl; build 12-Sep-2018 15:30:24 @@ -5832,14 +5786,14 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Collect the configuration description ids in a vector. build 12-Sep-2018 15:30:24 vector keys_v; build 12-Sep-2018 15:30:24 - transform( msGroup_avm.begin(), build 12-Sep-2018 15:30:24 - msGroup_avm.end(), build 12-Sep-2018 15:30:24 - back_inserter(keys_v), build 12-Sep-2018 15:30:24 - bind (&std::map >::value_type::first, _1) build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 + std::transform( msGroup_avm.begin(), build 12-Sep-2018 15:30:24 + msGroup_avm.end(), build 12-Sep-2018 15:30:24 + std::back_inserter(keys_v), build 12-Sep-2018 15:30:24 + std::bind (&std::map >::value_type::first, std::placeholders::_1) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Iterate over the vector elements. build 12-Sep-2018 15:30:24 - vector subMSpath_v; build 12-Sep-2018 15:30:24 + vector subMSpath_v; build 12-Sep-2018 15:30:24 for(Tag configDescriptionId: keys_v) { build 12-Sep-2018 15:30:24 ostringstream oss; build 12-Sep-2018 15:30:24 oss << msNames_m.begin()->second << "/"; build 12-Sep-2018 15:30:24 @@ -5848,40 +5802,50 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 << CSpectralResolutionType::toString(msGroup_avm[configDescriptionId].getValue("spectralResolution")); build 12-Sep-2018 15:30:24 vector dataDescriptionId_v = msGroup_avm[configDescriptionId].getValue >("ddId"); build 12-Sep-2018 15:30:24 for (Tag dataDescriptionId: dataDescriptionId_v ) { build 12-Sep-2018 15:30:24 - subMSpath_v.push_back(boost::filesystem::path(oss.str()+"_"+dataDescriptionId.toString())); build 12-Sep-2018 15:30:24 + subMSpath_v.push_back(Path(oss.str()+"_"+dataDescriptionId.toString())); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - for(boost::filesystem::path path: subMSpath_v) { build 12-Sep-2018 15:30:24 - if (boost::filesystem::exists(boost::filesystem::status(path))) { build 12-Sep-2018 15:30:24 - int nRemoved = boost::filesystem::remove_all(path); build 12-Sep-2018 15:30:24 - cout << "removing directory " << path << " (" << nRemoved << " files deleted.)" << endl; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - cout << "directory " << path << " does not exist." << endl; build 12-Sep-2018 15:30:24 + for(Path path: subMSpath_v) { build 12-Sep-2018 15:30:24 + File subMSfile(path); build 12-Sep-2018 15:30:24 + if (subMSfile.isDirectory()) { build 12-Sep-2018 15:30:24 + Directory subMSdir(path); build 12-Sep-2018 15:30:24 + int nRemoved = subMSdir.nEntries()+1; // count itself build 12-Sep-2018 15:30:24 + subMSdir.removeRecursive(); build 12-Sep-2018 15:30:24 + cout << "removing directory " << path.originalName() << " (" << nRemoved << " files deleted.)" << endl; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + cout << "directory " << path.originalName() << " does not exist." << endl; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (bool created = boost::filesystem::create_directory(path)) build 12-Sep-2018 15:30:24 - cout << "successfully created directory " << path << endl; build 12-Sep-2018 15:30:24 - else build 12-Sep-2018 15:30:24 - cout << "failed to create directory" << path << endl; build 12-Sep-2018 15:30:24 + Directory subMSdir(path); build 12-Sep-2018 15:30:24 + subMSdir.create(); build 12-Sep-2018 15:30:24 + cout << "successfully created directory " << path.originalName() << endl; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 // Let's create symbolic links to the toplevel MS subtables in each subMS directory. build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 - vector subTablePath_v; build 12-Sep-2018 15:30:24 - directory_iterator end_iter; build 12-Sep-2018 15:30:24 - for (directory_iterator iter(path(msNames_m.begin()->second)); iter != end_iter; ++iter) { build 12-Sep-2018 15:30:24 - if (boost::filesystem::exists(iter->path() / path("table.dat"))) { build 12-Sep-2018 15:30:24 - subTablePath_v.push_back(*iter); build 12-Sep-2018 15:30:24 - cout << subTablePath_v.back() << endl; build 12-Sep-2018 15:30:24 + vector subTablePath_v; build 12-Sep-2018 15:30:24 + Directory msDir(msNames_m.begin()->second); build 12-Sep-2018 15:30:24 + DirectoryIterator msDirIter(msDir); build 12-Sep-2018 15:30:24 + while (!msDirIter.pastEnd()) { build 12-Sep-2018 15:30:24 + if (msDirIter.file().isDirectory()) { build 12-Sep-2018 15:30:24 + Path tabPath(msDirIter.file().path()); build 12-Sep-2018 15:30:24 + tabPath.append("table.dat"); build 12-Sep-2018 15:30:24 + File tabDat(tabPath); build 12-Sep-2018 15:30:24 + if (tabDat.exists()) { build 12-Sep-2018 15:30:24 + subTablePath_v.push_back(msDirIter.file().path()); build 12-Sep-2018 15:30:24 + cout << subTablePath_v.back().originalName() << endl; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + msDirIter++; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - for(boost::filesystem::path subMSPath: subMSpath_v) { build 12-Sep-2018 15:30:24 - for(boost::filesystem::path subTablePath: subTablePath_v) { build 12-Sep-2018 15:30:24 - boost::filesystem::create_symlink(subTablePath, subMSPath / subTablePath.leaf()); build 12-Sep-2018 15:30:24 + for(Path subMSPath: subMSpath_v) { build 12-Sep-2018 15:30:24 + for(Path subTablePath: subTablePath_v) { build 12-Sep-2018 15:30:24 + Path newSubTabPath(subMSPath); build 12-Sep-2018 15:30:24 + newSubTabPath.append(subTablePath.baseName()); build 12-Sep-2018 15:30:24 + SymLink(newSubTabPath).create(subTablePath); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -5891,12 +5855,19 @@ int main(int argc, char *argv[]) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 // Determine the MS main table files. build 12-Sep-2018 15:30:24 - for (directory_iterator iter(path(msNames_m.begin()->second)); iter != end_iter; ++iter) { build 12-Sep-2018 15:30:24 - string filename = iter->path().leaf(); build 12-Sep-2018 15:30:24 - if (boost::starts_with(filename, "table")) build 12-Sep-2018 15:30:24 - for(boost::filesystem::path subMSPath: subMSpath_v) { build 12-Sep-2018 15:30:24 - cout << "Trying to copy " << iter->path() << " to " << subMSPath << endl; build 12-Sep-2018 15:30:24 - boost::filesystem::copy_file(iter->path(), subMSPath / iter->path().leaf()); build 12-Sep-2018 15:30:24 + DirectoryIterator dirIter(Path(msNames_m.begin()->second)); build 12-Sep-2018 15:30:24 + while (!dirIter.pastEnd()) { build 12-Sep-2018 15:30:24 + string filename = dirIter.name(); build 12-Sep-2018 15:30:24 + string tabPrefix = "table"; build 12-Sep-2018 15:30:24 + if (filename.compare(0, tabPrefix.size(), tabPrefix)) { build 12-Sep-2018 15:30:24 + for(Path subMSPath: subMSpath_v) { build 12-Sep-2018 15:30:24 + cout << "Trying to copy " << dirIter.file().path().originalName() << " to " << subMSPath.originalName() << endl; build 12-Sep-2018 15:30:24 + RegularFile origFile(dirIter.file()); build 12-Sep-2018 15:30:24 + Path newCopyPath(subMSPath); build 12-Sep-2018 15:30:24 + newCopyPath.append(filename); build 12-Sep-2018 15:30:24 + origFile.copy(newCopyPath); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + dirIter++; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/alma/apps/asdmSummary/asdmSummary.cc b/code/alma/apps/asdmSummary/asdmSummary.cc build 12-Sep-2018 15:30:24 index 4e58868..864ef12 100644 build 12-Sep-2018 15:30:24 --- a/code/alma/apps/asdmSummary/asdmSummary.cc build 12-Sep-2018 15:30:24 +++ b/code/alma/apps/asdmSummary/asdmSummary.cc build 12-Sep-2018 15:30:24 @@ -22,7 +22,6 @@ using namespace asdm; build 12-Sep-2018 15:30:24 #include "SubscanRow.h" build 12-Sep-2018 15:30:24 #include "SubscanTable.h" build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 #include "CAntennaMake.h" build 12-Sep-2018 15:30:24 using namespace AntennaMakeMod; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -50,14 +49,16 @@ using namespace SubscanIntentMod; build 12-Sep-2018 15:30:24 #include "CTimeSampling.h" build 12-Sep-2018 15:30:24 using namespace TimeSamplingMod; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -namespace po = boost::program_options; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 using namespace casacore; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using namespace std; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +using namespace alma; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 string appName; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // A facility to get rid of blanks at start and end of a string. build 12-Sep-2018 15:30:24 @@ -362,61 +363,98 @@ void summary(const ASDM& ds, const string& dsPath) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -int main (int argC, char* argV[]) { build 12-Sep-2018 15:30:24 +int main (int argc, char* argv[]) { build 12-Sep-2018 15:30:24 string dsName; build 12-Sep-2018 15:30:24 - string appName = string(argV[0]); build 12-Sep-2018 15:30:24 + string appName = string(argv[0]); build 12-Sep-2018 15:30:24 ofstream ofs; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - //Commented out as lsif is never used. JSK Dec. 2013 build 12-Sep-2018 15:30:24 - //LogSinkInterface& lsif = LogSink::globalSink(); build 12-Sep-2018 15:30:24 - po::variables_map vm; build 12-Sep-2018 15:30:24 + // process command line otpions and parameters build 12-Sep-2018 15:30:24 + // asdm-directory may be given as a named parameter=value, but that usage is hidden from the user build 12-Sep-2018 15:30:24 + // the positional version of asdm-directory takes precedence over any named parameter use when both are present build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - try { build 12-Sep-2018 15:30:24 - po::options_description generic("Displays a summary of the content of an ASDM dataset .\n" build 12-Sep-2018 15:30:24 - "Usage : " + appName +" asdm-directory \n\n" build 12-Sep-2018 15:30:24 - "Command parameters: \n" build 12-Sep-2018 15:30:24 - " asdm-directory : the pathname to the ASDM dataset to be reported on. \n\n" build 12-Sep-2018 15:30:24 - "Allowed options:"); build 12-Sep-2018 15:30:24 - generic.add_options() build 12-Sep-2018 15:30:24 - ("logfile,l", po::value(), "specifies the log filename. If the option is not used then the logged informations are written to the standard error stream.") build 12-Sep-2018 15:30:24 - ("help", "produces help message."); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::options_description hidden("Hidden options"); build 12-Sep-2018 15:30:24 - hidden.add_options() build 12-Sep-2018 15:30:24 - ("asdm-directory", po::value< string >(), "asdm directory") build 12-Sep-2018 15:30:24 - ; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::options_description cmdline_options; build 12-Sep-2018 15:30:24 - cmdline_options.add(generic).add(hidden); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - po::positional_options_description p; build 12-Sep-2018 15:30:24 - p.add("asdm-directory", 1); build 12-Sep-2018 15:30:24 + enum optionIndex { UNKNOWN, HELP, LOGFILE, ASDMDIR }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - po::store(po::command_line_parser(argC, argV).options(cmdline_options).positional(p).run(), vm); build 12-Sep-2018 15:30:24 - po::notify(vm); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - if (vm.count("help")) { build 12-Sep-2018 15:30:24 + try { build 12-Sep-2018 15:30:24 + // remove the program name build 12-Sep-2018 15:30:24 + argc--; build 12-Sep-2018 15:30:24 + argv++; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + string usageIntro = build 12-Sep-2018 15:30:24 + "Displays a summary of the content of an ASDM dataset .\n" build 12-Sep-2018 15:30:24 + "Usage : " + appName +" + [optiopns] asdm-directory \n\n" build 12-Sep-2018 15:30:24 + "Command parameters: \n"; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Descriptor elements are : OptionIndex, OptionType, shortopt, longopt, check_arg, help build 12-Sep-2018 15:30:24 + option::Descriptor usage[] = { build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, usageIntro.c_str()}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, " \tasdm-directory : \tthe pathname to the ASDM dataset to be reported on."}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, "\nAllowed options:\n"}, build 12-Sep-2018 15:30:24 + { UNKNOWN, 0, "", "", AlmaArg::Unknown, 0}, // helps with formatting build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // these are the non-positional options build 12-Sep-2018 15:30:24 + { HELP, 0, "", "help", AlmaArg::None, " --help \tproduces this help message."}, build 12-Sep-2018 15:30:24 + { LOGFILE, 0, "l", "logfile", AlmaArg::Required, build 12-Sep-2018 15:30:24 + " -l [--logfile] arg \tspecifies the log filename. " build 12-Sep-2018 15:30:24 + "If the option is not used then the logged informations are written to the standard error stream."}, build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // hidden non-positional option, the positional one takes precedence when both are set build 12-Sep-2018 15:30:24 + { ASDMDIR, 0, "", "asdm-directory", AlmaArg::Required, 0}, build 12-Sep-2018 15:30:24 + { 0, 0, 0, 0, 0, 0} }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // there are no defaults to set here build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // parse argv build 12-Sep-2018 15:30:24 + // establish sizes build 12-Sep-2018 15:30:24 + option::Stats stats; build 12-Sep-2018 15:30:24 + // true here turns on re-ordering of args so that positional arguments are always seen last build 12-Sep-2018 15:30:24 + stats.add(true, usage, argc, argv); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // buffers to hold the parsed options build 12-Sep-2018 15:30:24 + // options has one element per optionIndex, last value is the last time that option was set build 12-Sep-2018 15:30:24 + // buffer has one element for each option encountered, in order. Not used here. build 12-Sep-2018 15:30:24 + option::Option options[stats.options_max], buffer[stats.buffer_max]; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + option::Parser parse; build 12-Sep-2018 15:30:24 + // true has the same meaning as in stats above. This may not be necessary here. build 12-Sep-2018 15:30:24 + parse.parse(true, usage, argc, argv, options, buffer); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (parse.error()) { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 - errstream << generic << "\n" ; build 12-Sep-2018 15:30:24 + errstream << "Problem parsing the command line arguments"; build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Where do the log messages should go ? build 12-Sep-2018 15:30:24 - if (vm.count("logfile")) { build 12-Sep-2018 15:30:24 + // User-specified logfile? build 12-Sep-2018 15:30:24 + cout << "checking on LOGFILE" << endl; build 12-Sep-2018 15:30:24 + if (options[LOGFILE] != NULL && options[LOGFILE].last()->arg != NULL) { build 12-Sep-2018 15:30:24 + cout << " arg = " << options[LOGFILE].last()->arg << endl; build 12-Sep-2018 15:30:24 //LogSinkInterface *theSink; build 12-Sep-2018 15:30:24 - ofs.open(vm["logfile"].as().c_str(), ios_base::app); build 12-Sep-2018 15:30:24 + ofs.open(options[LOGFILE].last()->arg, ios_base::app); build 12-Sep-2018 15:30:24 LogSinkInterface *theSink = new casacore::StreamLogSink(&ofs); build 12-Sep-2018 15:30:24 LogSink::globalSink(theSink); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (vm.count("asdm-directory")) { build 12-Sep-2018 15:30:24 - string dummy = vm["asdm-directory"].as< string >(); build 12-Sep-2018 15:30:24 - dsName = lrtrim(dummy) ; build 12-Sep-2018 15:30:24 - if (boost::algorithm::ends_with(dsName,"/")) dsName.erase(dsName.size()-1); build 12-Sep-2018 15:30:24 + // Help ? display help's content and don't go further build 12-Sep-2018 15:30:24 + if (options[HELP] || (argc==0)) { build 12-Sep-2018 15:30:24 + errstream.str(""); build 12-Sep-2018 15:30:24 + option::printUsage(errstream, usage, 80); build 12-Sep-2018 15:30:24 + error(errstream.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 0 || options[ASDMDIR]) { build 12-Sep-2018 15:30:24 + string dummy; build 12-Sep-2018 15:30:24 + if (parse.nonOptionsCount() > 0) { build 12-Sep-2018 15:30:24 + dummy = string(parse.nonOption(0)); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // ASDMDIR must have been set build 12-Sep-2018 15:30:24 + dummy = string(options[ASDMDIR].last()->arg); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + dsName = trim_copy(dummy) ; build 12-Sep-2018 15:30:24 + if (dsName.back()=='/') dsName.erase(dsName.size()-1); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 errstream.str(""); build 12-Sep-2018 15:30:24 - errstream << generic ; build 12-Sep-2018 15:30:24 + option::printUsage(errstream, usage); build 12-Sep-2018 15:30:24 error(errstream.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/casaqt/CMakeLists.txt b/code/casaqt/CMakeLists.txt build 12-Sep-2018 15:30:24 index 0cbeeee..31cd914 100644 build 12-Sep-2018 15:30:24 --- a/code/casaqt/CMakeLists.txt build 12-Sep-2018 15:30:24 +++ b/code/casaqt/CMakeLists.txt build 12-Sep-2018 15:30:24 @@ -349,8 +349,7 @@ casa_add_executable( casaqt casalogger apps/casalogger/casalogger.cc ) build 12-Sep-2018 15:30:24 casa_add_executable( casaqt casapictureviewer apps/casapictureviewer/casapictureviewer.cc ) build 12-Sep-2018 15:30:24 casa_add_executable( casaqt casaplotserver apps/casaplotserver/casaplotserver.cc ) build 12-Sep-2018 15:30:24 casa_add_executable( casaqt casaprogresstimer apps/casaprogresstimer/casaprogresstimer.cc ) build 12-Sep-2018 15:30:24 -casa_add_executable( casaqt qcasabrowser apps/qcasabrowser/qcasabrowser.cc ) build 12-Sep-2018 15:30:24 +casa_add_executable( casaqt casabrowser apps/casabrowser/casabrowser.cc ) build 12-Sep-2018 15:30:24 casa_add_executable( casaqt qwtplottertest apps/qwtplottertest/qwtplottertest.cc ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -install( PROGRAMS apps/qcasabrowser/casabrowser DESTINATION bin ) build 12-Sep-2018 15:30:24 casa_add_demo( casaqt QtProgressMeter/test/dProgressMeter.cc ) build 12-Sep-2018 15:30:24 diff --git a/code/casaqt/QwtPlotter/QPCanvasHelpers.cc b/code/casaqt/QwtPlotter/QPCanvasHelpers.cc build 12-Sep-2018 15:30:24 index 9765518..3a0be84 100644 build 12-Sep-2018 15:30:24 --- a/code/casaqt/QwtPlotter/QPCanvasHelpers.cc build 12-Sep-2018 15:30:24 +++ b/code/casaqt/QwtPlotter/QPCanvasHelpers.cc build 12-Sep-2018 15:30:24 @@ -164,23 +164,32 @@ QwtText QPScaleDraw::label(double value) const { build 12-Sep-2018 15:30:24 m_referenceSet ? m_relativeDateFormat : m_dateFormat, value, build 12-Sep-2018 15:30:24 m_scale, m_referenceSet, timePrecision).c_str()); build 12-Sep-2018 15:30:24 } else { build 12-Sep-2018 15:30:24 - stringstream ss; build 12-Sep-2018 15:30:24 - ss.precision(getTickPrecision()); build 12-Sep-2018 15:30:24 - ss << fixed << value; build 12-Sep-2018 15:30:24 - return QString(ss.str().c_str()); build 12-Sep-2018 15:30:24 + int tprecision = getTickPrecision(); build 12-Sep-2018 15:30:24 + if (tprecision >=0) { build 12-Sep-2018 15:30:24 + stringstream ss; build 12-Sep-2018 15:30:24 + ss.precision(tprecision); build 12-Sep-2018 15:30:24 + ss << fixed << value; build 12-Sep-2018 15:30:24 + return QString(ss.str().c_str()); build 12-Sep-2018 15:30:24 + } else { // with shared axis, ticks are not set build 12-Sep-2018 15:30:24 + return QwtScaleDraw::label(value); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 int QPScaleDraw::getTickPrecision() const { build 12-Sep-2018 15:30:24 // find tick step to get precision and make labels uniform build 12-Sep-2018 15:30:24 QList ticks = scaleDiv().ticks(QwtScaleDiv::MajorTick); build 12-Sep-2018 15:30:24 - double step = abs(ticks[1] - ticks[0]); build 12-Sep-2018 15:30:24 - int tickPrecision = floor(log10(step)); build 12-Sep-2018 15:30:24 - if (tickPrecision > 0) // int build 12-Sep-2018 15:30:24 - tickPrecision = 0; build 12-Sep-2018 15:30:24 - else build 12-Sep-2018 15:30:24 - tickPrecision = abs(tickPrecision); build 12-Sep-2018 15:30:24 - return tickPrecision; build 12-Sep-2018 15:30:24 + if (ticks.size() == 0) { build 12-Sep-2018 15:30:24 + return -1; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + double step = abs(ticks[1] - ticks[0]); build 12-Sep-2018 15:30:24 + int tickPrecision = floor(log10(step)); build 12-Sep-2018 15:30:24 + if (tickPrecision > 0) // int build 12-Sep-2018 15:30:24 + tickPrecision = 0; build 12-Sep-2018 15:30:24 + else build 12-Sep-2018 15:30:24 + tickPrecision = abs(tickPrecision); build 12-Sep-2018 15:30:24 + return tickPrecision; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 ////////////////////////// build 12-Sep-2018 15:30:24 diff --git a/code/casaqt/QwtPlotter/QPScatterPlot.cc b/code/casaqt/QwtPlotter/QPScatterPlot.cc build 12-Sep-2018 15:30:24 index 0f80ea1..18b7ad2 100644 build 12-Sep-2018 15:30:24 --- a/code/casaqt/QwtPlotter/QPScatterPlot.cc build 12-Sep-2018 15:30:24 +++ b/code/casaqt/QwtPlotter/QPScatterPlot.cc build 12-Sep-2018 15:30:24 @@ -537,7 +537,9 @@ void QPScatterPlot::draw_(QPainter* p, const QwtScaleMap& xMap, build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 for(unsigned int i = drawIndex; i < n; i++) { build 12-Sep-2018 15:30:24 m_maskedData->xyAndMaskAt(i, tempx, tempy, mask); build 12-Sep-2018 15:30:24 - if (!casacore::isNaN(tempx) && !casacore::isNaN(tempy)) { build 12-Sep-2018 15:30:24 + // don't plot nan and inf ! build 12-Sep-2018 15:30:24 + if (!casacore::isNaN(tempx) && !casacore::isNaN(tempy) && build 12-Sep-2018 15:30:24 + !casacore::isInf(tempx) && !casacore::isInf(tempy)) { build 12-Sep-2018 15:30:24 if(drawSymbol && !mask) { build 12-Sep-2018 15:30:24 for (unsigned int pt=0; pt build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +static void preprocess_args( int argc, const char *argv[], int &numargs, char **&args ); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +int main(int argc, const char* argv[] ) { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + char **args; build 12-Sep-2018 15:30:24 + int numargs; build 12-Sep-2018 15:30:24 + preprocess_args( argc, argv, numargs, args ); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + xercesc::XMLPlatformUtils::Initialize(); build 12-Sep-2018 15:30:24 + QApplication app( numargs, args ); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + Q_INIT_RESOURCE(QtBrowser); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + casa::TBMain* main = new casa::TBMain(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + for(int i = 1; i < numargs; i++) build 12-Sep-2018 15:30:24 + main->openTable(args[i]); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + int r = app.exec(); build 12-Sep-2018 15:30:24 + delete main; build 12-Sep-2018 15:30:24 + xercesc::XMLPlatformUtils::Terminate(); build 12-Sep-2018 15:30:24 + return r; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +static void preprocess_args( int argc, const char *argv[], int &numargs, char **&args ) { build 12-Sep-2018 15:30:24 + args = (char**) malloc( sizeof(char*) * argc ); build 12-Sep-2018 15:30:24 + numargs = 0; build 12-Sep-2018 15:30:24 + for ( int x = 0; x < argc; ++x ) { build 12-Sep-2018 15:30:24 + if ( ! strcmp( argv[x], "--casapy" ) ) { build 12-Sep-2018 15:30:24 + signal(SIGINT,SIG_IGN); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + args[numargs++] = strdup(argv[x]); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 diff --git a/code/casaqt/apps/qcasabrowser/casabrowser b/code/casaqt/apps/qcasabrowser/casabrowser build 12-Sep-2018 15:30:24 deleted file mode 100755 build 12-Sep-2018 15:30:24 index 3b9ef29..0000000 build 12-Sep-2018 15:30:24 --- a/code/casaqt/apps/qcasabrowser/casabrowser build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,16 +0,0 @@ build 12-Sep-2018 15:30:24 -#!/bin/bash build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -aipspath=($CASAPATH) build 12-Sep-2018 15:30:24 -CASAROOT=${aipspath[0]}/${aipspath[1]} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -if test -x $CASAROOT/apps/qcasabrowser.app/Contents/MacOS/qcasabrowser; then build 12-Sep-2018 15:30:24 - echo "Adjust this as it will cause problems with the distro" build 12-Sep-2018 15:30:24 - exec $CASAROOT/apps/qcasabrowser.app/Contents/MacOS/qcasabrowser $@ build 12-Sep-2018 15:30:24 -fi build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -if test -x $CASAROOT/bin/qcasabrowser; then build 12-Sep-2018 15:30:24 - exec $CASAROOT/bin/qcasabrowser $@ build 12-Sep-2018 15:30:24 -fi build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -echo "Cannot find a usable qcasabrowser..." build 12-Sep-2018 15:30:24 -exit 1 build 12-Sep-2018 15:30:24 diff --git a/code/casaqt/apps/qcasabrowser/qcasabrowser.cc b/code/casaqt/apps/qcasabrowser/qcasabrowser.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index 7c8cbda..0000000 build 12-Sep-2018 15:30:24 --- a/code/casaqt/apps/qcasabrowser/qcasabrowser.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,66 +0,0 @@ build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -static void preprocess_args( int argc, const char *argv[], int &numargs, char **&args ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -int main(int argc, const char* argv[] ) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - char **args; build 12-Sep-2018 15:30:24 - int numargs; build 12-Sep-2018 15:30:24 - preprocess_args( argc, argv, numargs, args ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - xercesc::XMLPlatformUtils::Initialize(); build 12-Sep-2018 15:30:24 - QApplication app( numargs, args ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - Q_INIT_RESOURCE(QtBrowser); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - casa::TBMain* main = new casa::TBMain(); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - for(int i = 1; i < numargs; i++) build 12-Sep-2018 15:30:24 - main->openTable(args[i]); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - int r = app.exec(); build 12-Sep-2018 15:30:24 - delete main; build 12-Sep-2018 15:30:24 - xercesc::XMLPlatformUtils::Terminate(); build 12-Sep-2018 15:30:24 - return r; build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -static void preprocess_args( int argc, const char *argv[], int &numargs, char **&args ) { build 12-Sep-2018 15:30:24 - args = (char**) malloc( sizeof(char*) * argc ); build 12-Sep-2018 15:30:24 - numargs = 0; build 12-Sep-2018 15:30:24 - for ( int x = 0; x < argc; ++x ) { build 12-Sep-2018 15:30:24 - if ( ! strcmp( argv[x], "--casapy" ) ) { build 12-Sep-2018 15:30:24 - signal(SIGINT,SIG_IGN); build 12-Sep-2018 15:30:24 - } else { build 12-Sep-2018 15:30:24 - args[numargs++] = strdup(argv[x]); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/* casabrowser script build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#!/bin/sh build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -aipspath=($CASAPATH) build 12-Sep-2018 15:30:24 -CASAROOT=${aipspath[0]} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -case $(uname) in build 12-Sep-2018 15:30:24 - Darwin) build 12-Sep-2018 15:30:24 - echo "Adjust this as it will cause problems for Boyd with the distro" build 12-Sep-2018 15:30:24 - $CASAROOT/darwin/apps/qcasabrowser.app/Contents/MacOS/qcasabrowser $@ build 12-Sep-2018 15:30:24 - ;; build 12-Sep-2018 15:30:24 - Linux) build 12-Sep-2018 15:30:24 - qcasabrowser $@ build 12-Sep-2018 15:30:24 - ;; build 12-Sep-2018 15:30:24 -esac build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -*/ build 12-Sep-2018 15:30:24 diff --git a/code/components/ComponentModels/FluxCalcLogFreqPolynomial.cc b/code/components/ComponentModels/FluxCalcLogFreqPolynomial.cc build 12-Sep-2018 15:30:24 index 0c161eb..50b06ba 100644 build 12-Sep-2018 15:30:24 --- a/code/components/ComponentModels/FluxCalcLogFreqPolynomial.cc build 12-Sep-2018 15:30:24 +++ b/code/components/ComponentModels/FluxCalcLogFreqPolynomial.cc build 12-Sep-2018 15:30:24 @@ -32,6 +32,8 @@ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 using namespace casacore; build 12-Sep-2018 15:30:24 namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -40,13 +42,28 @@ Bool FluxCalcLogFreqPolynomial::operator()(Flux& value, build 12-Sep-2018 15:30:24 const MFrequency& mfreq, build 12-Sep-2018 15:30:24 const Bool updatecoeffs) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 + LogIO os(LogOrigin("FluxCalcLogFreqPolynomial", "()", WHERE)); build 12-Sep-2018 15:30:24 Double dt = log10(mfreq.get(freqUnit_p).getValue()); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - if (updatecoeffs) { build 12-Sep-2018 15:30:24 + if (updatecoeffs || coeffs_p(0).nelements()==0) { build 12-Sep-2018 15:30:24 coeffs_p(0).resize(); build 12-Sep-2018 15:30:24 coeffs_p(1).resize(); build 12-Sep-2018 15:30:24 coeffs_p=getCurrentCoeffs(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + validfrange_p=getValidFreqRange(); build 12-Sep-2018 15:30:24 + Double ghzinfreq = mfreq.get("GHz").getValue(); build 12-Sep-2018 15:30:24 + Double minfreq = validfrange_p(0).get("GHz").getValue(); build 12-Sep-2018 15:30:24 + Double maxfreq = validfrange_p(1).get("GHz").getValue(); build 12-Sep-2018 15:30:24 + if (!(minfreq==0.0 && maxfreq ==0.0)) { build 12-Sep-2018 15:30:24 + //cerr<<" range:"<= 0; --order) build 12-Sep-2018 15:30:24 fluxCoeff = fluxCoeff * dt + coeffs_p(0)[order]; build 12-Sep-2018 15:30:24 diff --git a/code/components/ComponentModels/FluxCalcLogFreqPolynomial.h b/code/components/ComponentModels/FluxCalcLogFreqPolynomial.h build 12-Sep-2018 15:30:24 index 2621177..9acddfc 100644 build 12-Sep-2018 15:30:24 --- a/code/components/ComponentModels/FluxCalcLogFreqPolynomial.h build 12-Sep-2018 15:30:24 +++ b/code/components/ComponentModels/FluxCalcLogFreqPolynomial.h build 12-Sep-2018 15:30:24 @@ -129,6 +129,8 @@ private: build 12-Sep-2018 15:30:24 // same number of coefficients as the first element, or even any build 12-Sep-2018 15:30:24 // coefficients. Both Vectors start with the 0th order term. build 12-Sep-2018 15:30:24 casacore::RigidVector, 2> coeffs_p; build 12-Sep-2018 15:30:24 + //casacore::RigidVector validfrange_p; build 12-Sep-2018 15:30:24 + casacore::Vector validfrange_p; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // The frequency unit (e.g. "MHz" or "GHz") assumed by coeffs_p. build 12-Sep-2018 15:30:24 casacore::String freqUnit_p; build 12-Sep-2018 15:30:24 diff --git a/code/components/ComponentModels/FluxCalcVQS.cc b/code/components/ComponentModels/FluxCalcVQS.cc build 12-Sep-2018 15:30:24 index 21b6e53..2717e01 100644 build 12-Sep-2018 15:30:24 --- a/code/components/ComponentModels/FluxCalcVQS.cc build 12-Sep-2018 15:30:24 +++ b/code/components/ComponentModels/FluxCalcVQS.cc build 12-Sep-2018 15:30:24 @@ -33,6 +33,9 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Handy for passing anonymous arrays to functions. build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -47,6 +50,7 @@ using namespace casacore; build 12-Sep-2018 15:30:24 namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 FluxCalcVQS::FluxCalcVQS() : build 12-Sep-2018 15:30:24 srcEnum_p(FluxStdSrcs::UNKNOWN_SOURCE), build 12-Sep-2018 15:30:24 + validfreqrange_p(2), build 12-Sep-2018 15:30:24 istimevar_p(false) build 12-Sep-2018 15:30:24 { } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -70,7 +74,7 @@ Bool FluxCalcVQS::operator()(Vector >& values, build 12-Sep-2018 15:30:24 Bool success = true; build 12-Sep-2018 15:30:24 for(uInt f = 0; f < nfreqs; ++f) build 12-Sep-2018 15:30:24 success &= (*this)(values[f], errors[f], mfreqs[f], false); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 return success; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -158,6 +162,7 @@ void FluxCalcVQS::readQSCoeffsTable(const Path& fileName) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 AlwaysAssert(Table::isReadable(fullName), AipsError); build 12-Sep-2018 15:30:24 Table_p = Table(fullName, Table::Old); build 12-Sep-2018 15:30:24 + ///TableProxy tab2(Table_p); build 12-Sep-2018 15:30:24 //String srcName(names_p[srcEnum_p](0)); build 12-Sep-2018 15:30:24 String srcName(EnumToSrcName(srcEnum_p)); build 12-Sep-2018 15:30:24 String srcCoeffColName=srcName+"_coeffs"; build 12-Sep-2018 15:30:24 @@ -170,6 +175,20 @@ void FluxCalcVQS::readQSCoeffsTable(const Path& fileName) build 12-Sep-2018 15:30:24 const ROScalarColumn epochCol(Table_p, "Epoch"); build 12-Sep-2018 15:30:24 const ROArrayColumn CoeffCol(Table_p, srcCoeffColName); build 12-Sep-2018 15:30:24 const ROArrayColumn CoeffErrorCol(Table_p, srcCoeffErrorColName); build 12-Sep-2018 15:30:24 + // check if col contains a valid freq range info in a keyword build 12-Sep-2018 15:30:24 + if (CoeffCol.keywordSet().isDefined("ValidFreqRange")) { build 12-Sep-2018 15:30:24 + Vector validfreqRange; build 12-Sep-2018 15:30:24 + String freqRangeUnit; build 12-Sep-2018 15:30:24 + CoeffCol.keywordSet().asRecord("ValidFreqRange").get("freqRange",validfreqRange); build 12-Sep-2018 15:30:24 + CoeffCol.keywordSet().asRecord("ValidFreqRange").get("freqRangeUnit",freqRangeUnit); build 12-Sep-2018 15:30:24 + Vector mvalidfreqs; build 12-Sep-2018 15:30:24 + validfreqrange_p(0) = MFrequency(Quantity(validfreqRange(0),freqRangeUnit), MFrequency::TOPO); build 12-Sep-2018 15:30:24 + validfreqrange_p(1) = MFrequency(Quantity(validfreqRange(1),freqRangeUnit), MFrequency::TOPO); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + validfreqrange_p(0) = MFrequency(Quantity(0.0,"GHz"), MFrequency::TOPO); build 12-Sep-2018 15:30:24 + validfreqrange_p(1) = MFrequency(Quantity(0.0,"GHz"), MFrequency::TOPO); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 Vector tempEpochs; build 12-Sep-2018 15:30:24 epochCol.getColumn(tempEpochs,true); build 12-Sep-2018 15:30:24 CoeffCol.getColumn(coeffsmat_p,true); build 12-Sep-2018 15:30:24 @@ -180,6 +199,7 @@ void FluxCalcVQS::readQSCoeffsTable(const Path& fileName) build 12-Sep-2018 15:30:24 << "nepoch="< templist; build 12-Sep-2018 15:30:24 + templist = {"J0133-3629"}; build 12-Sep-2018 15:30:24 + names_p[FSS::J0133] = Vector (templist); build 12-Sep-2018 15:30:24 + directions_p[FSS::J0133] = MDirection(MVDirection(0.40998511349868466,-0.636928821694464), build 12-Sep-2018 15:30:24 + MDirection::J2000); build 12-Sep-2018 15:30:24 + templist = {"FORNAX_A", "FORNAX A", "FOR-A", "FOR A", "ForA", "J0322-3712"}; build 12-Sep-2018 15:30:24 + names_p[FSS::FORNAXA] = Vector (templist); build 12-Sep-2018 15:30:24 + directions_p[FSS::FORNAXA] = MDirection(MVDirection(0.8844302540951193,-0.649405598740554), build 12-Sep-2018 15:30:24 + MDirection::J2000); build 12-Sep-2018 15:30:24 + templist = {"J0444-2809"}; build 12-Sep-2018 15:30:24 + names_p[FSS::J0444] = Vector (templist); build 12-Sep-2018 15:30:24 + directions_p[FSS::J0444] = MDirection(MVDirection(1.2419253902826484,-0.49157683196101404), build 12-Sep-2018 15:30:24 + MDirection::J2000); build 12-Sep-2018 15:30:24 + templist = {"PICTOR_A","PICTOR A", "PIC-A", "PIC A", "PicA", "J0519-4546"}; build 12-Sep-2018 15:30:24 + names_p[FSS::PICTORA] = Vector (templist); build 12-Sep-2018 15:30:24 + directions_p[FSS::PICTORA] = MDirection(MVDirection(1.3955160370653494,-0.7989916117952379), build 12-Sep-2018 15:30:24 + MDirection::J2000); build 12-Sep-2018 15:30:24 + templist= {"TAURUS_A", "TAURUS A", "TAU-A", "TAU A", "TauA", "J0534+2200", "3C144", "3C 144", "3C_144", "CRAB"}; build 12-Sep-2018 15:30:24 + names_p[FSS::TAURUSA] = Vector (templist); build 12-Sep-2018 15:30:24 + directions_p[FSS::TAURUSA] = MDirection(MVDirection(1.4596748494230258,0.3842250233666105), build 12-Sep-2018 15:30:24 + MDirection::J2000); build 12-Sep-2018 15:30:24 + templist = {"HYDRA_A", "HYDRA A", "HYA-A", "HYA A", "HyaA", "J0918-1205", "3C218", "3C 218", "3C_218"}; build 12-Sep-2018 15:30:24 + names_p[FSS::HYDRAA] = Vector (templist); build 12-Sep-2018 15:30:24 + directions_p[FSS::HYDRAA] = MDirection(MVDirection(2.4351465533014114,-0.21110704143990625), build 12-Sep-2018 15:30:24 + MDirection::J2000); build 12-Sep-2018 15:30:24 + templist = {"VIRGO_A", "VIRGO A", "VIR-A", "VIR A", "VirA", "J1230+1223", "3C274", "3C 274", "3C_274", "M87"}; build 12-Sep-2018 15:30:24 + names_p[FSS::VIRGOA] = Vector (templist); build 12-Sep-2018 15:30:24 + directions_p[FSS::VIRGOA] = MDirection(MVDirection(-3.0070987886171765,0.2162659001873615), build 12-Sep-2018 15:30:24 + MDirection::J2000); build 12-Sep-2018 15:30:24 + templist = {"HERCULES_A", "HERCULES A", "HER-A", "HER A", "HerA", "J1651+0459", "3C348", "3C 348", "3C_348"}; build 12-Sep-2018 15:30:24 + names_p[FSS::HERCULESA] = Vector (templist); build 12-Sep-2018 15:30:24 + directions_p[FSS::HERCULESA] = MDirection(MVDirection(-1.871273156204919,0.08713711430959646), build 12-Sep-2018 15:30:24 + MDirection::J2000); build 12-Sep-2018 15:30:24 + templist = {"3C353", "3C 353", "3C_353", "J1720-0059"}; build 12-Sep-2018 15:30:24 + names_p[FSS::THREEC353] = Vector (templist); build 12-Sep-2018 15:30:24 + directions_p[FSS::THREEC353] = MDirection(MVDirection(-1.7432823443920011,-0.017099960309150668), build 12-Sep-2018 15:30:24 + MDirection::J2000); build 12-Sep-2018 15:30:24 + templist = {"CYGNUS_A", "CYGNUS A", "CYG-A", "CYG A", "CygA", "J1959+4044", "3C405", "3C 405", "3C_405"}; build 12-Sep-2018 15:30:24 + names_p[FSS::CYGNUSA] = Vector (templist); build 12-Sep-2018 15:30:24 + directions_p[FSS::CYGNUSA] = MDirection(MVDirection(-1.0494987241821205,0.7109409485219165), build 12-Sep-2018 15:30:24 + MDirection::J2000); build 12-Sep-2018 15:30:24 + templist = {"3C444", "3C 444", "3C_444", "J2214-1701"}; build 12-Sep-2018 15:30:24 + names_p[FSS::THREEC444] = Vector (templist); build 12-Sep-2018 15:30:24 + directions_p[FSS::THREEC444] = MDirection(MVDirection(-0.46063951349110815,-0.2971727999325764), build 12-Sep-2018 15:30:24 + MDirection::J2000); build 12-Sep-2018 15:30:24 + templist = {"CASSIOPEIA_A", "CASSIOPEIA A", "CAS-A", "CAS A", "CasA", "J2323+5848", "3C461", "3C 461", "3C_461"}; build 12-Sep-2018 15:30:24 + names_p[FSS::CASSIOPEIAA] = Vector (templist); build 12-Sep-2018 15:30:24 + directions_p[FSS::CASSIOPEIAA] = MDirection(MVDirection(-0.15969762655748126,1.0265153995604648), build 12-Sep-2018 15:30:24 + MDirection::J2000); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 directions_p[FSS::UNKNOWN_SOURCE] = MDirection(); // Default. build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/components/ComponentModels/FluxStdSrcs.h b/code/components/ComponentModels/FluxStdSrcs.h build 12-Sep-2018 15:30:24 index fb459e3..31fa807 100644 build 12-Sep-2018 15:30:24 --- a/code/components/ComponentModels/FluxStdSrcs.h build 12-Sep-2018 15:30:24 +++ b/code/components/ComponentModels/FluxStdSrcs.h build 12-Sep-2018 15:30:24 @@ -83,6 +83,19 @@ public: build 12-Sep-2018 15:30:24 THREEC196, build 12-Sep-2018 15:30:24 THREEC123, build 12-Sep-2018 15:30:24 THREEC380, build 12-Sep-2018 15:30:24 + // new sources from Perley-Butler 2017 build 12-Sep-2018 15:30:24 + J0133, build 12-Sep-2018 15:30:24 + FORNAXA, build 12-Sep-2018 15:30:24 + J0444, build 12-Sep-2018 15:30:24 + PICTORA, build 12-Sep-2018 15:30:24 + TAURUSA, build 12-Sep-2018 15:30:24 + HYDRAA, build 12-Sep-2018 15:30:24 + VIRGOA, build 12-Sep-2018 15:30:24 + HERCULESA, build 12-Sep-2018 15:30:24 + THREEC353, build 12-Sep-2018 15:30:24 + CYGNUSA, build 12-Sep-2018 15:30:24 + THREEC444, build 12-Sep-2018 15:30:24 + CASSIOPEIAA, build 12-Sep-2018 15:30:24 // The number of standards in this enumerator. build 12-Sep-2018 15:30:24 NUMBER_SOURCES, build 12-Sep-2018 15:30:24 UNKNOWN_SOURCE = NUMBER_SOURCES build 12-Sep-2018 15:30:24 diff --git a/code/components/ComponentModels/FluxStdsQS2.cc b/code/components/ComponentModels/FluxStdsQS2.cc build 12-Sep-2018 15:30:24 index 7e63c5e..dd0a3d4 100644 build 12-Sep-2018 15:30:24 --- a/code/components/ComponentModels/FluxStdsQS2.cc build 12-Sep-2018 15:30:24 +++ b/code/components/ComponentModels/FluxStdsQS2.cc build 12-Sep-2018 15:30:24 @@ -338,5 +338,64 @@ Bool FluxStdScaifeHeald2012::setSourceCoeffs() build 12-Sep-2018 15:30:24 return found; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +Bool FluxStdPerleyButler2017::setSourceCoeffs() build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + Bool found = true; build 12-Sep-2018 15:30:24 + Bool timevar = false; build 12-Sep-2018 15:30:24 + setFreqUnit("GHz"); build 12-Sep-2018 15:30:24 + FSS::Source srcEnum = FCVQS::getSrcEnum(); build 12-Sep-2018 15:30:24 + String stddatapath; build 12-Sep-2018 15:30:24 + String stdTabName("PerleyButler2017Coeffs"); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if(!Aipsrc::findDir(stddatapath,"./"+stdTabName)) { build 12-Sep-2018 15:30:24 + if(!Aipsrc::findDir(stddatapath, Aipsrc::aipsRoot()+"/data/nrao/VLA/standards/"+stdTabName)) { build 12-Sep-2018 15:30:24 + ostringstream oss; build 12-Sep-2018 15:30:24 + oss << "The coefficient data for Perley-Butler 2017, " << stdTabName build 12-Sep-2018 15:30:24 + << " is not found in ./ or in ~/data/nrao/VLA/standards/"; build 12-Sep-2018 15:30:24 + throw(AipsError(String(oss))); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + //cerr<<"use stddatapath="< build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// //
  • FluxStandard module build 12-Sep-2018 15:30:24 +// //
  • FluxCalcLogFreqPolynomial module build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // From "flux density", "standard", "Perley", "Butler", and "2017". build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // This specializes FluxCalcLogFreqPolynomial with the PerleyButler2017 coefficients and build 12-Sep-2018 15:30:24 +// // list of recognized sources. The coeffients are stored in a table along with epoch information. build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// // Support flux density calibration. build 12-Sep-2018 15:30:24 +// // build 12-Sep-2018 15:30:24 +// build 12-Sep-2018 15:30:24 +class FluxStdPerleyButler2017 : public virtual FluxCalcVQS, build 12-Sep-2018 15:30:24 + private FluxCalcLogFreqPolynomial build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 +private: build 12-Sep-2018 15:30:24 + virtual casacore::Bool setSourceCoeffs(); build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } //# NAMESPACE NSTDS -END build 12-Sep-2018 15:30:24 } //# NAMESPACE CASA - END build 12-Sep-2018 15:30:24 diff --git a/code/components/ComponentModels/test/FluxStandard2_GTest.cc b/code/components/ComponentModels/test/FluxStandard2_GTest.cc build 12-Sep-2018 15:30:24 index bf91427..011862e 100644 build 12-Sep-2018 15:30:24 --- a/code/components/ComponentModels/test/FluxStandard2_GTest.cc build 12-Sep-2018 15:30:24 +++ b/code/components/ComponentModels/test/FluxStandard2_GTest.cc build 12-Sep-2018 15:30:24 @@ -86,6 +86,19 @@ void AltSrcNameTest::SetUp() build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void AltSrcNameTest::TearDown() { }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +AltSrcNamePB2017Test::AltSrcNamePB2017Test() {}; build 12-Sep-2018 15:30:24 +AltSrcNamePB2017Test::~AltSrcNamePB2017Test() {}; build 12-Sep-2018 15:30:24 +void AltSrcNamePB2017Test::SetUp() build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + coeffsTbName = "PerleyButler2017Coeffs"; build 12-Sep-2018 15:30:24 + flxStdName = std::tr1::get<0>(GetParam()); build 12-Sep-2018 15:30:24 + srcName = std::tr1::get<1>(GetParam()); build 12-Sep-2018 15:30:24 + freq = std::tr1::get<2>(GetParam()); build 12-Sep-2018 15:30:24 + expFlxStdEnum = std::tr1::get<3>(GetParam()); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +void AltSrcNamePB2017Test::TearDown() { }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 SetInterpMethodTest::SetInterpMethodTest() {}; build 12-Sep-2018 15:30:24 SetInterpMethodTest::~SetInterpMethodTest() {}; build 12-Sep-2018 15:30:24 void SetInterpMethodTest::SetUp() build 12-Sep-2018 15:30:24 @@ -110,6 +123,18 @@ void FluxValueTest::SetUp() build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 void FluxValueTest::TearDown() {}; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +PB2017FluxValueTest::PB2017FluxValueTest() {}; build 12-Sep-2018 15:30:24 +PB2017FluxValueTest::~PB2017FluxValueTest() {}; build 12-Sep-2018 15:30:24 +void PB2017FluxValueTest::SetUp() build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + NewFluxStandardTest::SetUp(); build 12-Sep-2018 15:30:24 + flxStdName = std::tr1::get<0>(GetParam()); build 12-Sep-2018 15:30:24 + srcName = std::tr1::get<1>(GetParam()); build 12-Sep-2018 15:30:24 + freq = std::tr1::get<2>(GetParam()); build 12-Sep-2018 15:30:24 + expFlxStdEnum = std::tr1::get<3>(GetParam()); build 12-Sep-2018 15:30:24 + expFlxVal = std::tr1::get<4>(GetParam()); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 +void PB2017FluxValueTest::TearDown() {}; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 //Define parameter sets to be tested build 12-Sep-2018 15:30:24 // short param set just for the match check build 12-Sep-2018 15:30:24 @@ -117,7 +142,8 @@ void FluxValueTest::TearDown() {}; build 12-Sep-2018 15:30:24 std::tr1::tuple flxStdParams[] = build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 make_tuple("Perley-Butler 2013", FluxStandard::PERLEY_BUTLER_2013), build 12-Sep-2018 15:30:24 - make_tuple("Scaife-Heald 2012", FluxStandard::SCAIFE_HEALD_2012) build 12-Sep-2018 15:30:24 + make_tuple("Scaife-Heald 2012", FluxStandard::SCAIFE_HEALD_2012), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017", FluxStandard::PERLEY_BUTLER_2017) build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // for testing alternative source names build 12-Sep-2018 15:30:24 @@ -195,6 +221,140 @@ std::tr1::tuple flxStdParamsAltSrc build 12-Sep-2018 15:30:24 make_tuple("Scaife-Heald 2012","J1829+4845", 0.2, FluxStandard::SCAIFE_HEALD_2012) build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +//For Perley-Butler 2017 new sources build 12-Sep-2018 15:30:24 +std::tr1::tuple flxStdParamsAltSrcNamesPB2017[] = build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + // build 12-Sep-2018 15:30:24 + //{"J0133-3629"}; build 12-Sep-2018 15:30:24 + //{"FORNAX_A", "FORNAX A", "FOR-A", "FOR A", "J0322-3712"}; build 12-Sep-2018 15:30:24 + //{"J0444-2809"}; build 12-Sep-2018 15:30:24 + //{"PICTOR_A", "PICTOR A", "PIC-A", "PIC A", "J0519-4546"}; build 12-Sep-2018 15:30:24 + //{"TAURUS_A", "TAURUS A", "TAU-A", "TAU A", "J0534+2200", "3C144", "3C 144", "3C_144", "CRAB"}; build 12-Sep-2018 15:30:24 + //{"HYDRA_A", "HYDRA A", "HYA-A", "HYA A", "J0918-1205", "3C218", "3C 218", "3C_218"}; build 12-Sep-2018 15:30:24 + //{"VIRGO_A", "VIRGO A", "VIR-A", "VIR A", "J1230+1223", "3C274", "3C 274", "3C_274", "M87"}; build 12-Sep-2018 15:30:24 + //{"HERCULES_A", "HERCULES A", "HER-A", "HER A", "J1651+0459", "3C348", "3C 348", "3C_348"}; build 12-Sep-2018 15:30:24 + //{"3C353", "3C 353", "3C_353", "J1720-0059"}; build 12-Sep-2018 15:30:24 + //{"CYGNUS_A", "CYGNUS A", "CYG-A", "CYG A", "J1959+4044", "3C405", "3C 405", "3C_405"}; build 12-Sep-2018 15:30:24 + //{"3C444", "3C 444", "3C_444", "J2214-1701"}; build 12-Sep-2018 15:30:24 + //{"CASSIOPEIA_A", "CASSIOPEIA A", "CAS-A", "CAS A", "J2323+5848", "3C461", "3C 461", "3C_461"}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //J0133-3629 build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J0133-3629", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + //FORNAX A build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Fornax_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","FORNAX_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Fornax A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","FORNAX A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","For-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","FOR-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","For A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","FOR A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J0322-3712", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + //J0444-2809 build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J0444-2809", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + //PICTOR A build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Pictor_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","PICTOR_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Pictor A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","PICTOR A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Pic-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","PIC-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Pic A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","PIC A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J0519-4546", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + //TAURUS A build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Taurus_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","TAURUS_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Taurus A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","TAURUS A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Tau-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","TAU-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Tau A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","TAU A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J0534+2200", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C144", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C 144", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C_144", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","CRAB", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + //HYDRA A build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Hydra_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","HYDRA_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Hydra A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","HYDRA A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Hya-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","HYA-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Hya A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","HYA A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J0918-1205", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C218", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C 218", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C_218", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + //VIRGO A build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Virgo_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","VIRGO_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Virgo A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","VIRGO A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Vir-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","VIR-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Vir A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","VIR A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J1230+1223", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C274", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C 274", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C_274", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","M87", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + //HERCULES A build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Hercules_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","HERCULES_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Hercules A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","HERCULES A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Her-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","HER-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Her A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","HER A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J1651+0459", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C348", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C 348", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C_348", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + //3C353 build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C353", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C 353", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C_353", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J1720-0059", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + //CYGNUS A build 12-Sep-2018 15:30:24 + //make_tuple("Perley-Butler 2017","Cygnus_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","CYGNUS_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Cygnus A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","CYGNUS A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Cyg-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","CYG-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Cyg A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","CYG A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J1959+4044", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C405", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C 405", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C_405", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + //3C444 build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C444", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C 444", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C_444", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J2214-1701", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + //CASSIOPEIA A build 12-Sep-2018 15:30:24 + /*** build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Cassiopeia_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","CASSIOPEIA_A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Cassiopeia A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","CASSIOPEIA A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Cas-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","CAS-A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Cas A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","CAS A", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J2323+5848", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C461", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C 461", 2.0, FluxStandard::PERLEY_BUTLER_2017), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C_461", 2.0, FluxStandard::PERLEY_BUTLER_2017) build 12-Sep-2018 15:30:24 +***/ build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 // for setInterpMethod test build 12-Sep-2018 15:30:24 std::tr1::tuple flxStdParamsVarSrc[] = build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 @@ -244,6 +404,39 @@ std::tr1::tuple flxStdParam build 12-Sep-2018 15:30:24 make_tuple("Scaife-Heald 2012","3C380", 0.3, FluxStandard::SCAIFE_HEALD_2012, 45.454985119727866) build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +//for Flux Value PB2017 test build 12-Sep-2018 15:30:24 +// flux at 2017 epoch build 12-Sep-2018 15:30:24 +std::tr1::tuple flxStdParamsFullPB2017[] = build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J0133-3629", 2.0, FluxStandard::PERLEY_BUTLER_2017,6.67330337245), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C48", 2.0, FluxStandard::PERLEY_BUTLER_2017, 12.0766376419), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C48", 20.0, FluxStandard::PERLEY_BUTLER_2017, 1.34376748572), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Fornax_A", 0.2, FluxStandard::PERLEY_BUTLER_2017, 477.792755885), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Fornax_A", 0.5, FluxStandard::PERLEY_BUTLER_2017, 260.831709946), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C123", 2.0, FluxStandard::PERLEY_BUTLER_2017, 35.8415070329), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C123", 20.0, FluxStandard::PERLEY_BUTLER_2017, 3.73204541165), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","J0444-2809", 2.0, FluxStandard::PERLEY_BUTLER_2017, 4.91227416939), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C138", 2.0, FluxStandard::PERLEY_BUTLER_2017, 6.99355160643), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C138", 20.0, FluxStandard::PERLEY_BUTLER_2017, 1.37874384626), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Pictor_A", 2.0, FluxStandard::PERLEY_BUTLER_2017, 50.8667294544), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Taurus_A", 2.0, FluxStandard::PERLEY_BUTLER_2017, 758.684772777), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C147", 2.0, FluxStandard::PERLEY_BUTLER_2017, 16.7997184717), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C147", 20.0, FluxStandard::PERLEY_BUTLER_2017, 2.09874986844), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C196", 2.0, FluxStandard::PERLEY_BUTLER_2017, 10.3786270159), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C196", 20.0, FluxStandard::PERLEY_BUTLER_2017, 0.853708631823), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Hydra_A", 2.0, FluxStandard::PERLEY_BUTLER_2017, 31.2967163783), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Virgo_A", 2.0, FluxStandard::PERLEY_BUTLER_2017, 157.72738616), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C286", 2.0, FluxStandard::PERLEY_BUTLER_2017, 12.5056530041), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C286", 20.0, FluxStandard::PERLEY_BUTLER_2017, 2.72898772521), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C295", 2.0, FluxStandard::PERLEY_BUTLER_2017, 16.3591315603), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C295", 20.0, FluxStandard::PERLEY_BUTLER_2017, 1.09928230977), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Hercules_A", 2.0, FluxStandard::PERLEY_BUTLER_2017, 32.562420997), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C353", 2.0, FluxStandard::PERLEY_BUTLER_2017, 43.9344075193), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C380", 2.0, FluxStandard::PERLEY_BUTLER_2017, 10.0762542624), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Cygnus_A", 2.0, FluxStandard::PERLEY_BUTLER_2017, 1068.37333938), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","3C444", 2.0, FluxStandard::PERLEY_BUTLER_2017, 6.2361409066), build 12-Sep-2018 15:30:24 + make_tuple("Perley-Butler 2017","Cassiopeia_A", 2.0, FluxStandard::PERLEY_BUTLER_2017, 1339.73252473) build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 INSTANTIATE_TEST_CASE_P(checkStandardMatch, MatchStandardTest,::testing::ValuesIn(flxStdParams)); build 12-Sep-2018 15:30:24 TEST_P(MatchStandardTest, checkStandardMatch) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 @@ -267,6 +460,22 @@ TEST_P(AltSrcNameTest, checkAltSrcNames) build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +INSTANTIATE_TEST_CASE_P(checkAltSrcNamesPB2017,AltSrcNamePB2017Test,::testing::ValuesIn(flxStdParamsAltSrcNamesPB2017)); build 12-Sep-2018 15:30:24 +TEST_P(AltSrcNamePB2017Test, checkAltSrcNamesPB2017) build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + if (modelExists(coeffsTbName)) { build 12-Sep-2018 15:30:24 + fluxStd.reset(new FluxStandard(expFlxStdEnum)); build 12-Sep-2018 15:30:24 + mfreq = MFrequency(Quantity(freq,"GHz")); build 12-Sep-2018 15:30:24 + mtime = MEpoch(Quantity(57754.0,"d")); //2017-01-01 build 12-Sep-2018 15:30:24 + fluxStd->setInterpMethod("spline"); build 12-Sep-2018 15:30:24 + foundStd = fluxStd->compute(srcName, srcDir, mfreq, mtime, returnFlux, returnFluxErr); build 12-Sep-2018 15:30:24 + EXPECT_TRUE(foundStd); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + cout <<" The model parameter table, "<setInterpMethod(interpMethod); build 12-Sep-2018 15:30:24 foundStd = fluxStd->compute(srcName, srcDir, mfreq, mtime, returnFlux, returnFluxErr); build 12-Sep-2018 15:30:24 returnFlux.value(fluxUsed); build 12-Sep-2018 15:30:24 @@ -290,7 +499,6 @@ TEST_P(SetInterpMethodTest, checkInterpolation) build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 INSTANTIATE_TEST_CASE_P(ckeckFluxValues,FluxValueTest,::testing::ValuesIn(flxStdParamsFull)); build 12-Sep-2018 15:30:24 TEST_P(FluxValueTest, checkFluxValues) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 @@ -318,6 +526,32 @@ TEST_P(FluxValueTest, checkFluxValues) build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +INSTANTIATE_TEST_CASE_P(ckeckFluxValues,PB2017FluxValueTest,::testing::ValuesIn(flxStdParamsFullPB2017)); build 12-Sep-2018 15:30:24 +TEST_P(PB2017FluxValueTest, checkFluxValues) build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + // calc values were checked against calculation against a python script to be consistent at the tolerance level of build 12-Sep-2018 15:30:24 + Double tol = 0.0001; build 12-Sep-2018 15:30:24 + mtime = MEpoch(Quantity(57754.0,"d")); //2017-01-01 build 12-Sep-2018 15:30:24 + fluxStd.reset(new FluxStandard(expFlxStdEnum)); build 12-Sep-2018 15:30:24 + if (expFlxStdEnum == FluxStandard::PERLEY_BUTLER_2017) { build 12-Sep-2018 15:30:24 + coeffsTbName = "PerleyButler2017Coeffs"; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (modelExists(coeffsTbName)) { build 12-Sep-2018 15:30:24 + mfreq = MFrequency(Quantity(freq,"GHz")); build 12-Sep-2018 15:30:24 + fluxStd->setInterpMethod("nearest"); build 12-Sep-2018 15:30:24 + foundStd = fluxStd->compute(srcName, srcDir, mfreq, mtime, returnFlux, returnFluxErr); build 12-Sep-2018 15:30:24 + returnFlux.value(fluxUsed); build 12-Sep-2018 15:30:24 + EXPECT_TRUE(foundStd); build 12-Sep-2018 15:30:24 + //EXPECT_DOUBLE_EQ(expFlxVal,fluxUsed[0]); build 12-Sep-2018 15:30:24 + EXPECT_NEAR(expFlxVal,fluxUsed[0],tol); build 12-Sep-2018 15:30:24 + //cerr<> build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +public: build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + AltSrcNamePB2017Test(); build 12-Sep-2018 15:30:24 + virtual ~AltSrcNamePB2017Test(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +protected: build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void SetUp(); build 12-Sep-2018 15:30:24 + virtual void TearDown(); build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 class SetInterpMethodTest: public NewFluxStandardTest, build 12-Sep-2018 15:30:24 public ::testing::WithParamInterface> build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 @@ -132,6 +147,22 @@ protected: build 12-Sep-2018 15:30:24 //casacore::Double expFlxVal; build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +class PB2017FluxValueTest: public NewFluxStandardTest, build 12-Sep-2018 15:30:24 + public ::testing::WithParamInterface> build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +public: build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + PB2017FluxValueTest(); build 12-Sep-2018 15:30:24 + virtual ~PB2017FluxValueTest(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +protected: build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void SetUp(); build 12-Sep-2018 15:30:24 + virtual void TearDown(); build 12-Sep-2018 15:30:24 + //casacore::Double expFlxVal; build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 }// end namespace test build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #endif /* COMPONENTS_COMPONENTMODELS_TEST_FLUXSTANDARD_GTEST_H */ build 12-Sep-2018 15:30:24 diff --git a/code/crash/apps/reporter/CrashReportPoster.cc b/code/crash/apps/reporter/CrashReportPoster.cc build 12-Sep-2018 15:30:24 index 3f32938..6b9acf4 100644 build 12-Sep-2018 15:30:24 --- a/code/crash/apps/reporter/CrashReportPoster.cc build 12-Sep-2018 15:30:24 +++ b/code/crash/apps/reporter/CrashReportPoster.cc build 12-Sep-2018 15:30:24 @@ -177,7 +177,7 @@ CrashReportPoster::captureAdditionalInformation () build 12-Sep-2018 15:30:24 captureOne ("cat /proc/meminfo", "meminfo.txt"); build 12-Sep-2018 15:30:24 captureOne ("mount", "mountinfo.txt"); build 12-Sep-2018 15:30:24 captureOne ("lsb_release -a", "lsbinfo.txt"); build 12-Sep-2018 15:30:24 - captureOne ("uname -a", "unameinfo.txt"); build 12-Sep-2018 15:30:24 + captureOne ("uname -srvmp", "unameinfo.txt"); build 12-Sep-2018 15:30:24 if (logFile_p.size() > 0){ build 12-Sep-2018 15:30:24 captureOne ("cat " + logFile_p, "casa.log"); build 12-Sep-2018 15:30:24 } else { build 12-Sep-2018 15:30:24 @@ -193,7 +193,7 @@ CrashReportPoster::captureAdditionalInformation () build 12-Sep-2018 15:30:24 captureOne ("vm_stat", "meminfo.txt"); build 12-Sep-2018 15:30:24 captureOne ("mount", "mountinfo.txt"); build 12-Sep-2018 15:30:24 //captureOne ("lsb_release -a", "lsbinfo.txt"); build 12-Sep-2018 15:30:24 - captureOne ("uname -a", "unameinfo.txt"); build 12-Sep-2018 15:30:24 + captureOne ("uname -srvmp", "unameinfo.txt"); build 12-Sep-2018 15:30:24 if (logFile_p.size() > 0){ build 12-Sep-2018 15:30:24 captureOne ("cat " + logFile_p, "casa.log"); build 12-Sep-2018 15:30:24 } else { build 12-Sep-2018 15:30:24 diff --git a/code/display/QtViewer/QtDisplayData.cc b/code/display/QtViewer/QtDisplayData.cc build 12-Sep-2018 15:30:24 index 79ef3c9..9f1a29e 100644 build 12-Sep-2018 15:30:24 --- a/code/display/QtViewer/QtDisplayData.cc build 12-Sep-2018 15:30:24 +++ b/code/display/QtViewer/QtDisplayData.cc build 12-Sep-2018 15:30:24 @@ -394,7 +394,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 std::string outpath = viewer::options.temporaryPath(Path(path_).baseName()); build 12-Sep-2018 15:30:24 panel_->status( "generating temporary image: " + outpath ); build 12-Sep-2018 15:30:24 panel_->logIO( ) << "generating temporary image \'" << outpath << "'" << LogIO::POST; build 12-Sep-2018 15:30:24 - ImageRegridder regridder(im_, String(outpath), regrid_to->imageInterface( ) ); build 12-Sep-2018 15:30:24 + ImageRegridder regridder(im_, String(outpath), regrid_to->imageInterface( ) ); build 12-Sep-2018 15:30:24 regridder.setMethod(method); build 12-Sep-2018 15:30:24 regridder.setSpecAsVelocity(true); build 12-Sep-2018 15:30:24 im_ = regridder.regrid(); build 12-Sep-2018 15:30:24 diff --git a/code/flagging/Flagging/FlagDataHandler.cc b/code/flagging/Flagging/FlagDataHandler.cc build 12-Sep-2018 15:30:24 index 4922d52..e0f364f 100755 build 12-Sep-2018 15:30:24 --- a/code/flagging/Flagging/FlagDataHandler.cc build 12-Sep-2018 15:30:24 +++ b/code/flagging/Flagging/FlagDataHandler.cc build 12-Sep-2018 15:30:24 @@ -1642,33 +1642,32 @@ FlagDataHandler::setTimeAverageIter(bool activated) build 12-Sep-2018 15:30:24 enableTimeAvg_p = activated; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Setup the time averaging options build 12-Sep-2018 15:30:24 - if (dataColumnType_p.compare("DATA") == 0) build 12-Sep-2018 15:30:24 + if (dataColumnType_p == "DATA") build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 timeAvgOptions_p |= vi::AveragingOptions::AverageObserved; build 12-Sep-2018 15:30:24 timeAvgOptions_p |= vi::AveragingOptions::ObservedFlagWeightAvgFromSIGMA; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - else if (dataColumnType_p.compare("CORRECTED") == 0) build 12-Sep-2018 15:30:24 + else if (dataColumnType_p == "CORRECTED") build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 timeAvgOptions_p |= vi::AveragingOptions::AverageCorrected; build 12-Sep-2018 15:30:24 timeAvgOptions_p |= vi::AveragingOptions::CorrectedFlagWeightAvgFromWEIGHT; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - else if (dataColumnType_p.compare("MODEL") == 0) build 12-Sep-2018 15:30:24 + else if (dataColumnType_p == "MODEL") build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 timeAvgOptions_p |= vi::AveragingOptions::AverageModel; build 12-Sep-2018 15:30:24 timeAvgOptions_p |= vi::AveragingOptions::ModelPlainAvg; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - else if (dataColumnType_p.compare("FLOAT_DATA") == 0) build 12-Sep-2018 15:30:24 + else if (dataColumnType_p == "FLOAT_DATA") build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 timeAvgOptions_p |= vi::AveragingOptions::AverageFloat; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 -/* else if (dataColumnType_p.compare("RESIDUAL") == 0) build 12-Sep-2018 15:30:24 + else if (dataColumnType_p == "RESIDUAL") build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 timeAvgOptions_p |= vi::AveragingOptions::AverageCorrected; build 12-Sep-2018 15:30:24 + timeAvgOptions_p |= vi::AveragingOptions::CorrectedFlagWeightAvgFromWEIGHT; build 12-Sep-2018 15:30:24 timeAvgOptions_p |= vi::AveragingOptions::AverageModel; build 12-Sep-2018 15:30:24 - timeAvgOptions_p |= vi::AveragingOptions::ModelPlainAvg; build 12-Sep-2018 15:30:24 - timeAvgOptions_p |= vi::AveragingOptions::CorrectedFlagWeightAvgFromWEIGHT build 12-Sep-2018 15:30:24 - }*/ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + timeAvgOptions_p |= vi::AveragingOptions::ModelFlagWeightAvgFromWEIGHT; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ---------------------------------------------------------------------------- build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/Annotations/AnnEllipse.cc b/code/imageanalysis/Annotations/AnnEllipse.cc build 12-Sep-2018 15:30:24 index 957443b..7781ed5 100644 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/Annotations/AnnEllipse.cc build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/Annotations/AnnEllipse.cc build 12-Sep-2018 15:30:24 @@ -150,8 +150,11 @@ void AnnEllipse::_init( build 12-Sep-2018 15:30:24 ) { build 12-Sep-2018 15:30:24 Quantity angle; build 12-Sep-2018 15:30:24 csys.directionCoordinate().convert(angle, _getDirectionRefFrame()); build 12-Sep-2018 15:30:24 - _convertedPositionAngle -= angle; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 + // add the clockwise angle rather than subtract because the pixel build 12-Sep-2018 15:30:24 + // axes are aligned with the "from" (current) world coordinate system rather build 12-Sep-2018 15:30:24 + // than the "to" world coordinate system build 12-Sep-2018 15:30:24 + _convertedPositionAngle += angle; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 if (_convertedSemiMajorAxis < _convertedSemiMinorAxis) { build 12-Sep-2018 15:30:24 std::swap(_convertedSemiMajorAxis, _convertedSemiMinorAxis); build 12-Sep-2018 15:30:24 _convertedPositionAngle = Quantity( build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/Annotations/AnnotationBase.cc b/code/imageanalysis/Annotations/AnnotationBase.cc build 12-Sep-2018 15:30:24 index bdb0715..819bba5 100644 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/Annotations/AnnotationBase.cc build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/Annotations/AnnotationBase.cc build 12-Sep-2018 15:30:24 @@ -1030,7 +1030,6 @@ void AnnotationBase::_checkAndConvertDirections( build 12-Sep-2018 15:30:24 const String& origin, const AnnotationBase::Direction& quantities build 12-Sep-2018 15:30:24 ) { build 12-Sep-2018 15:30:24 _checkMixed(origin, quantities); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 MDirection::Types csysDirectionRefFrame = _csys.directionCoordinate().directionType(false); build 12-Sep-2018 15:30:24 Bool needsConverting = _directionRefFrame != csysDirectionRefFrame; build 12-Sep-2018 15:30:24 _convertedDirections.resize(quantities.size()); build 12-Sep-2018 15:30:24 @@ -1042,7 +1041,6 @@ void AnnotationBase::_checkAndConvertDirections( build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 // check this now because if converting from world to pixel fails when build 12-Sep-2018 15:30:24 // regions are being formed, it will wreak havoc build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 _testConvertToPixel(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1092,12 +1090,11 @@ std::list AnnotationBase::colorChoices() { build 12-Sep-2018 15:30:24 void AnnotationBase::_testConvertToPixel() const { build 12-Sep-2018 15:30:24 Vector pixel(2); build 12-Sep-2018 15:30:24 Vector world(2); build 12-Sep-2018 15:30:24 - Vector units = _csys.worldAxisUnits(); build 12-Sep-2018 15:30:24 - for ( build 12-Sep-2018 15:30:24 - Vector::const_iterator iter = _convertedDirections.begin(); build 12-Sep-2018 15:30:24 - iter != _convertedDirections.end(); iter++ build 12-Sep-2018 15:30:24 - ) { build 12-Sep-2018 15:30:24 - world = iter->getAngle().getValue("rad"); build 12-Sep-2018 15:30:24 + const auto units = _csys.worldAxisUnits(); build 12-Sep-2018 15:30:24 + const auto end = _convertedDirections.end(); build 12-Sep-2018 15:30:24 + for (auto iter = _convertedDirections.begin(); iter != end; ++iter) { build 12-Sep-2018 15:30:24 + world[0] = iter->getAngle().getValue(units[0])[0]; build 12-Sep-2018 15:30:24 + world[1] = iter->getAngle().getValue(units[1])[1]; build 12-Sep-2018 15:30:24 if (! _csys.directionCoordinate().toPixel(pixel, world)) { build 12-Sep-2018 15:30:24 ostringstream oss; build 12-Sep-2018 15:30:24 oss << "Could not convert world coordinate " << world << "to pixel"; build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/CMakeLists.txt b/code/imageanalysis/CMakeLists.txt build 12-Sep-2018 15:30:24 index 0629c43..a0469d9 100644 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/CMakeLists.txt build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/CMakeLists.txt build 12-Sep-2018 15:30:24 @@ -39,7 +39,6 @@ Images/ComponentListImage.cc build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 ImageAnalysis/AntennaResponses.cc build 12-Sep-2018 15:30:24 ImageAnalysis/CasaImageBeamSet.cc build 12-Sep-2018 15:30:24 -ImageAnalysis/ComplexImageRegridder.cc build 12-Sep-2018 15:30:24 ImageAnalysis/ComponentImager.cc build 12-Sep-2018 15:30:24 ImageAnalysis/ImageCollapserData.cc build 12-Sep-2018 15:30:24 ImageAnalysis/ImageCollapser2.cc build 12-Sep-2018 15:30:24 @@ -58,7 +57,6 @@ ImageAnalysis/ImagePolProxy.cc build 12-Sep-2018 15:30:24 ImageAnalysis/ImagePolTask.cc build 12-Sep-2018 15:30:24 ImageAnalysis/ImagePrimaryBeamCorrector.cc build 12-Sep-2018 15:30:24 ImageAnalysis/ImageProfileFitter.cc build 12-Sep-2018 15:30:24 -ImageAnalysis/ImageRegridder.cc build 12-Sep-2018 15:30:24 ImageAnalysis/ImageRotator.cc build 12-Sep-2018 15:30:24 ImageAnalysis/ImageStatsCalculator.cc build 12-Sep-2018 15:30:24 ImageAnalysis/ImageStatsConfigurator.cc build 12-Sep-2018 15:30:24 @@ -133,6 +131,7 @@ install (FILES build 12-Sep-2018 15:30:24 ImageAnalysis/BeamManipulator.tcc build 12-Sep-2018 15:30:24 ImageAnalysis/CasaImageBeamSet.h build 12-Sep-2018 15:30:24 ImageAnalysis/ComplexImageRegridder.h build 12-Sep-2018 15:30:24 + ImageAnalysis/ComplexImageRegridder.tcc build 12-Sep-2018 15:30:24 ImageAnalysis/ComponentImager.h build 12-Sep-2018 15:30:24 ImageAnalysis/ComponentListDeconvolver.h build 12-Sep-2018 15:30:24 ImageAnalysis/ComponentListDeconvolver.tcc build 12-Sep-2018 15:30:24 @@ -210,6 +209,7 @@ install (FILES build 12-Sep-2018 15:30:24 ImageAnalysis/ImageRebinner.h build 12-Sep-2018 15:30:24 ImageAnalysis/ImageRebinner.tcc build 12-Sep-2018 15:30:24 ImageAnalysis/ImageRegridder.h build 12-Sep-2018 15:30:24 + ImageAnalysis/ImageRegridder.tcc build 12-Sep-2018 15:30:24 ImageAnalysis/ImageRegridderBase.h build 12-Sep-2018 15:30:24 ImageAnalysis/ImageRegridderBase.tcc build 12-Sep-2018 15:30:24 ImageAnalysis/ImageRotator.h build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/ComplexImageRegridder.cc b/code/imageanalysis/ImageAnalysis/ComplexImageRegridder.cc build 12-Sep-2018 15:30:24 deleted file mode 100755 build 12-Sep-2018 15:30:24 index 4e36879..0000000 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/ImageAnalysis/ComplexImageRegridder.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,85 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 1998,1999,2000,2001,2003 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This program is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU General Public License as published by the Free build 12-Sep-2018 15:30:24 -//# Software Foundation; either version 2 of the License, or (at your option) build 12-Sep-2018 15:30:24 -//# any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This program is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for build 12-Sep-2018 15:30:24 -//# more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU General Public License along build 12-Sep-2018 15:30:24 -//# with this program; if not, write to the Free Software Foundation, Inc., build 12-Sep-2018 15:30:24 -//# 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id: $ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -using namespace casacore; build 12-Sep-2018 15:30:24 -namespace casa { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -const String ComplexImageRegridder::_class = "ComplexImageRegridder"; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -ComplexImageRegridder::ComplexImageRegridder( build 12-Sep-2018 15:30:24 - const SPCIIC image, build 12-Sep-2018 15:30:24 - const Record *const regionRec, build 12-Sep-2018 15:30:24 - const String& maskInp, const String& outname, Bool overwrite, build 12-Sep-2018 15:30:24 - const CoordinateSystem& csysTo, const IPosition& axes, build 12-Sep-2018 15:30:24 - const IPosition& shape build 12-Sep-2018 15:30:24 -) : ImageRegridderBase( build 12-Sep-2018 15:30:24 - image, regionRec, build 12-Sep-2018 15:30:24 - maskInp, outname, overwrite, build 12-Sep-2018 15:30:24 - csysTo, axes, shape build 12-Sep-2018 15:30:24 - ) {} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -template ComplexImageRegridder::ComplexImageRegridder( build 12-Sep-2018 15:30:24 - const SPCIIC image, const String& outname, build 12-Sep-2018 15:30:24 - const SPCIIT templateIm, const IPosition& axes, build 12-Sep-2018 15:30:24 - const Record *const regionRec, const String& maskInp, build 12-Sep-2018 15:30:24 - Bool overwrite, const IPosition& shape build 12-Sep-2018 15:30:24 -) : ImageRegridderBase( build 12-Sep-2018 15:30:24 - image, regionRec, maskInp, outname, overwrite, build 12-Sep-2018 15:30:24 - templateIm->coordinates(), axes, shape build 12-Sep-2018 15:30:24 -) {} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -ComplexImageRegridder::~ComplexImageRegridder() {} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -SPIIC ComplexImageRegridder::regrid() const { build 12-Sep-2018 15:30:24 - SPCIIC myimage = this->_getImage(); build 12-Sep-2018 15:30:24 - SPIIF realPart = ImageFactory::floatFromComplex( build 12-Sep-2018 15:30:24 - myimage, ImageFactory::REAL build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - ImageRegridder rgReal(realPart, _getRegion(), _getMask(), "", build 12-Sep-2018 15:30:24 - false, _getTemplateCoords(), _getAxes(), _getShape() build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - rgReal.setConfiguration(*this); build 12-Sep-2018 15:30:24 - SPIIF outReal = rgReal.regrid(); build 12-Sep-2018 15:30:24 - SPIIF imagPart = ImageFactory::floatFromComplex( build 12-Sep-2018 15:30:24 - myimage, ImageFactory::IMAG build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - ImageRegridder rgImag(imagPart, _getRegion(), _getMask(), "", build 12-Sep-2018 15:30:24 - false, _getTemplateCoords(), _getAxes(), _getShape() build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - rgImag.setConfiguration(*this); build 12-Sep-2018 15:30:24 - SPIIF outImag = rgImag.regrid(); build 12-Sep-2018 15:30:24 - SPIIC outImage = ImageFactory::complexFromFloat( build 12-Sep-2018 15:30:24 - outReal, outImag->get() build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - return this->_prepareOutputImage(*outImage); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/ComplexImageRegridder.h b/code/imageanalysis/ImageAnalysis/ComplexImageRegridder.h build 12-Sep-2018 15:30:24 index 2bfc2a3..b055f10 100755 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/ImageAnalysis/ComplexImageRegridder.h build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/ImageAnalysis/ComplexImageRegridder.h build 12-Sep-2018 15:30:24 @@ -33,9 +33,10 @@ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace casa { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -class ComplexImageRegridder : public ImageRegridderBase { build 12-Sep-2018 15:30:24 +template class ComplexImageRegridder : public ImageRegridderBase { build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 - // Top level interface which regrids an image with complex-valued pixels to a specified coordinate system build 12-Sep-2018 15:30:24 + // Top level interface which regrids an image with complex-valued pixels to build 12-Sep-2018 15:30:24 + // a specified coordinate system build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 @@ -49,30 +50,32 @@ class ComplexImageRegridder : public ImageRegridderBase { build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 - // High level interface for regridding an image. Note that in the case of a complex-valued build 12-Sep-2018 15:30:24 - // image, the image is first divided into its composite real and imaginary parts, and these build 12-Sep-2018 15:30:24 - // parts are regridded independently. The resulting regridded images are combined to form build 12-Sep-2018 15:30:24 - // the final regridded complex-valued image. build 12-Sep-2018 15:30:24 + // High level interface for regridding an image. Note that in the case of a build 12-Sep-2018 15:30:24 + // complex-valued image, the image is first divided into its composite real build 12-Sep-2018 15:30:24 + // and imaginary parts, and these parts are regridded independently. The build 12-Sep-2018 15:30:24 + // resulting regridded images are combined to form the final regridded build 12-Sep-2018 15:30:24 + // complex-valued image. build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 public: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + ComplexImageRegridder() = delete; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // if outname is empty, no image will be written build 12-Sep-2018 15:30:24 - // if overwrite is true, if image already exists it will be removed build 12-Sep-2018 15:30:24 - // if overwrite is false, if image already exists exception will be thrown build 12-Sep-2018 15:30:24 + // if overwrite is true, if image already exists it will be build 12-Sep-2018 15:30:24 + // removed if overwrite is false, if image already exists build 12-Sep-2018 15:30:24 + // exception will be thrown build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 ComplexImageRegridder( build 12-Sep-2018 15:30:24 - const SPCIIC image, build 12-Sep-2018 15:30:24 - const casacore::Record *const regionRec, build 12-Sep-2018 15:30:24 - const casacore::String& maskInp, const casacore::String& outname, casacore::Bool overwrite, build 12-Sep-2018 15:30:24 - const casacore::CoordinateSystem& csysTo, const casacore::IPosition& axes, build 12-Sep-2018 15:30:24 - const casacore::IPosition& shape build 12-Sep-2018 15:30:24 + SPCIIT image, const casacore::Record *const regionRec, build 12-Sep-2018 15:30:24 + const casacore::String& maskInp, const casacore::String& outname, build 12-Sep-2018 15:30:24 + casacore::Bool overwrite, const casacore::CoordinateSystem& csysTo, build 12-Sep-2018 15:30:24 + const casacore::IPosition& axes, const casacore::IPosition& shape build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - template ComplexImageRegridder( build 12-Sep-2018 15:30:24 - const SPCIIC image, const casacore::String& outname, build 12-Sep-2018 15:30:24 - const SPCIIT templateIm, const casacore::IPosition& axes=casacore::IPosition(), build 12-Sep-2018 15:30:24 + template ComplexImageRegridder( build 12-Sep-2018 15:30:24 + SPCIIT image, const casacore::String& outname, SPCIIU templateIm, build 12-Sep-2018 15:30:24 + const casacore::IPosition& axes=casacore::IPosition(), build 12-Sep-2018 15:30:24 const casacore::Record *const regionRec=0, build 12-Sep-2018 15:30:24 const casacore::String& maskInp="", casacore::Bool overwrite=false, build 12-Sep-2018 15:30:24 const casacore::IPosition& shape=casacore::IPosition() build 12-Sep-2018 15:30:24 @@ -83,7 +86,7 @@ public: build 12-Sep-2018 15:30:24 ~ComplexImageRegridder(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // perform the regrid. build 12-Sep-2018 15:30:24 - SPIIC regrid() const; build 12-Sep-2018 15:30:24 + SPIIT regrid() const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 protected: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -93,10 +96,10 @@ private: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 static const casacore::String _class; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // disallow default constructor build 12-Sep-2018 15:30:24 - ComplexImageRegridder(); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef CASACORE_NO_AUTO_TEMPLATES build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 #endif build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/ComplexImageRegridder.tcc b/code/imageanalysis/ImageAnalysis/ComplexImageRegridder.tcc build 12-Sep-2018 15:30:24 new file mode 100755 build 12-Sep-2018 15:30:24 index 0000000..2082e4f build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/ImageAnalysis/ComplexImageRegridder.tcc build 12-Sep-2018 15:30:24 @@ -0,0 +1,91 @@ build 12-Sep-2018 15:30:24 +//# Copyright (C) 1998,1999,2000,2001,2003 build 12-Sep-2018 15:30:24 +//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This program is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 +//# under the terms of the GNU General Public License as published by the Free build 12-Sep-2018 15:30:24 +//# Software Foundation; either version 2 of the License, or (at your option) build 12-Sep-2018 15:30:24 +//# any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This program is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 +//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 +//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for build 12-Sep-2018 15:30:24 +//# more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU General Public License along build 12-Sep-2018 15:30:24 +//# with this program; if not, write to the Free Software Foundation, Inc., build 12-Sep-2018 15:30:24 +//# 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 +//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 +//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 +//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 +//# 520 Edgemont Road build 12-Sep-2018 15:30:24 +//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# $Id: $ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +namespace casa { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template build 12-Sep-2018 15:30:24 +const String ComplexImageRegridder::_class = "ComplexImageRegridder"; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template ComplexImageRegridder::ComplexImageRegridder( build 12-Sep-2018 15:30:24 + SPCIIT image, const casacore::Record *const regionRec, build 12-Sep-2018 15:30:24 + const casacore::String& maskInp, const casacore::String& outname, build 12-Sep-2018 15:30:24 + casacore::Bool overwrite, const casacore::CoordinateSystem& csysTo, build 12-Sep-2018 15:30:24 + const casacore::IPosition& axes, const casacore::IPosition& shape build 12-Sep-2018 15:30:24 +) : ImageRegridderBase( build 12-Sep-2018 15:30:24 + image, regionRec, build 12-Sep-2018 15:30:24 + maskInp, outname, overwrite, build 12-Sep-2018 15:30:24 + csysTo, axes, shape build 12-Sep-2018 15:30:24 + ) {} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template template build 12-Sep-2018 15:30:24 +ComplexImageRegridder::ComplexImageRegridder( build 12-Sep-2018 15:30:24 + SPCIIT image, const casacore::String& outname, SPCIIU templateIm, build 12-Sep-2018 15:30:24 + const casacore::IPosition& axes, const casacore::Record *const regionRec, build 12-Sep-2018 15:30:24 + const casacore::String& maskInp, casacore::Bool overwrite, build 12-Sep-2018 15:30:24 + const casacore::IPosition& shape build 12-Sep-2018 15:30:24 +) : ImageRegridderBase( build 12-Sep-2018 15:30:24 + image, regionRec, maskInp, outname, overwrite, build 12-Sep-2018 15:30:24 + templateIm->coordinates(), axes, shape build 12-Sep-2018 15:30:24 +) {} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template ComplexImageRegridder::~ComplexImageRegridder() {} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template SPIIT ComplexImageRegridder::regrid() const { build 12-Sep-2018 15:30:24 + auto myimage = this->_getImage(); build 12-Sep-2018 15:30:24 + auto realPart = ImageFactory::floatFromComplex(myimage, ImageFactory::REAL); build 12-Sep-2018 15:30:24 + ImageRegridder::BaseType> rgReal( build 12-Sep-2018 15:30:24 + realPart, this->_getRegion(), this->_getMask(), "", build 12-Sep-2018 15:30:24 + false, this->_getTemplateCoords(), this->_getAxes(), this->_getShape() build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + rgReal.setConfiguration(*this); build 12-Sep-2018 15:30:24 + SHARED_PTR< build 12-Sep-2018 15:30:24 + const casacore::ImageInterface< build 12-Sep-2018 15:30:24 + typename casacore::NumericTraits::BaseType build 12-Sep-2018 15:30:24 + > build 12-Sep-2018 15:30:24 + > outReal = rgReal.regrid(); build 12-Sep-2018 15:30:24 + auto imagPart = ImageFactory::floatFromComplex( build 12-Sep-2018 15:30:24 + myimage, ImageFactory::IMAG build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + ImageRegridder::BaseType> rgImag( build 12-Sep-2018 15:30:24 + imagPart, this->_getRegion(), this->_getMask(), "", build 12-Sep-2018 15:30:24 + false, this->_getTemplateCoords(), this->_getAxes(), this->_getShape() build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + rgImag.setConfiguration(*this); build 12-Sep-2018 15:30:24 + SHARED_PTR< build 12-Sep-2018 15:30:24 + const casacore::ImageInterface< build 12-Sep-2018 15:30:24 + typename casacore::NumericTraits::BaseType build 12-Sep-2018 15:30:24 + > build 12-Sep-2018 15:30:24 + > outImag = rgImag.regrid(); build 12-Sep-2018 15:30:24 + auto outImage = ImageFactory::makeComplexImage(outReal, outImag); build 12-Sep-2018 15:30:24 + return this->_prepareOutputImage(*outImage); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/ComponentImager.cc b/code/imageanalysis/ImageAnalysis/ComponentImager.cc build 12-Sep-2018 15:30:24 index 426f6a2..e7da4fd 100644 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/ImageAnalysis/ComponentImager.cc build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/ImageAnalysis/ComponentImager.cc build 12-Sep-2018 15:30:24 @@ -78,8 +78,7 @@ using namespace casacore; build 12-Sep-2018 15:30:24 namespace casa { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 ComponentImager::ComponentImager( build 12-Sep-2018 15:30:24 - const SPIIF image, const Record *const ®ion, build 12-Sep-2018 15:30:24 - const String& mask build 12-Sep-2018 15:30:24 + const SPIIF image, const Record *const ®ion, const String& mask build 12-Sep-2018 15:30:24 ) : ImageTask(image, region, mask, "", false), build 12-Sep-2018 15:30:24 _image(image) { build 12-Sep-2018 15:30:24 _construct(); build 12-Sep-2018 15:30:24 @@ -94,11 +93,8 @@ void ComponentImager::modify(Bool verbose) { build 12-Sep-2018 15:30:24 for (int i = 0; i < nelem; ++i) { build 12-Sep-2018 15:30:24 mod[i] = _list.component(i); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 const auto n = mod.size(); build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - n == 0, "There are no components in the model componentlist" build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 + ThrowIf(n == 0, "There are no components in the model componentlist"); build 12-Sep-2018 15:30:24 auto subImage = SubImageFactory::createSubImageRW( build 12-Sep-2018 15:30:24 *_image, *this->_getRegion(), this->_getMask(), build 12-Sep-2018 15:30:24 (verbose ? this->_getLog().get() : nullptr), build 12-Sep-2018 15:30:24 @@ -113,9 +109,9 @@ void ComponentImager::modify(Bool verbose) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 cl.add(sky); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - // project(*subImage, cl); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - ComponentListImage cli(cl, subImage->coordinates(), subImage->shape(), False); build 12-Sep-2018 15:30:24 + ComponentListImage cli( build 12-Sep-2018 15:30:24 + cl, subImage->coordinates(), subImage->shape(), False build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 Lattice* x = &cli; build 12-Sep-2018 15:30:24 LatticeExpr expr; build 12-Sep-2018 15:30:24 const auto& imageUnitName = subImage->units().getName(); build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/ImageFactory.h b/code/imageanalysis/ImageAnalysis/ImageFactory.h build 12-Sep-2018 15:30:24 index 218654e..3ef732d 100755 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/ImageAnalysis/ImageFactory.h build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/ImageAnalysis/ImageFactory.h build 12-Sep-2018 15:30:24 @@ -135,7 +135,7 @@ public: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // only the pointer of the correct data type will be valid, the other build 12-Sep-2018 15:30:24 // will be null. build 12-Sep-2018 15:30:24 - static std::pair fromImage( build 12-Sep-2018 15:30:24 + static ITUPLE fromImage( build 12-Sep-2018 15:30:24 const casacore::String& outfile, const casacore::String& infile, build 12-Sep-2018 15:30:24 const casacore::Record& region, const casacore::String& mask, build 12-Sep-2018 15:30:24 casacore::Bool dropdeg=false, build 12-Sep-2018 15:30:24 @@ -155,17 +155,21 @@ public: build 12-Sep-2018 15:30:24 const casacore::Bool linear, const casacore::Bool overwrite build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Create a float-valued image from a complex-valued image. All metadata is copied build 12-Sep-2018 15:30:24 - // and pixel values are initialized according to func. build 12-Sep-2018 15:30:24 - static SHARED_PTR > floatFromComplex( build 12-Sep-2018 15:30:24 - SPCIIC complexImage, ComplexToFloatFunction func build 12-Sep-2018 15:30:24 + // Create a float-valued image from a complex-valued image. All metadata is build 12-Sep-2018 15:30:24 + // copied and pixel values are initialized according to func. build 12-Sep-2018 15:30:24 + template build 12-Sep-2018 15:30:24 + static SHARED_PTR> floatFromComplex( build 12-Sep-2018 15:30:24 + SHARED_PTR< build 12-Sep-2018 15:30:24 + const casacore::ImageInterface> build 12-Sep-2018 15:30:24 + > complexImage, ComplexToFloatFunction func build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Create a complex-valued image from a float-valued image (real part) build 12-Sep-2018 15:30:24 - // and float-valued array (imaginary part). All metadata is copied from the build 12-Sep-2018 15:30:24 - // real image and pixel values are initialized to realPart + i*complexPart build 12-Sep-2018 15:30:24 - static SHARED_PTR > complexFromFloat( build 12-Sep-2018 15:30:24 - SPCIIF realPart, const casacore::Array& imagPart build 12-Sep-2018 15:30:24 + // Create a complex-valued image from two real valued images. All metadata build 12-Sep-2018 15:30:24 + // is copied from the real image and pixel values are initialized to build 12-Sep-2018 15:30:24 + // realPart + i*complexPart build 12-Sep-2018 15:30:24 + template build 12-Sep-2018 15:30:24 + static SHARED_PTR>> makeComplexImage( build 12-Sep-2018 15:30:24 + SPCIIT realPart, SPCIIT imagPart build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Create a complex-valued image from a float-valued image (real part) build 12-Sep-2018 15:30:24 @@ -258,6 +262,15 @@ private: build 12-Sep-2018 15:30:24 std::unique_ptr& latt build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + static casacore::String _imageCreationMessage( build 12-Sep-2018 15:30:24 + const casacore::String& outfile, const ITUPLE& imagePtrs build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + static casacore::String _imageCreationMessage( build 12-Sep-2018 15:30:24 + const casacore::String& outfile, const casacore::IPosition& shape, build 12-Sep-2018 15:30:24 + casacore::DataType dataType build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // if successful, image will point to the newly named image build 12-Sep-2018 15:30:24 // upone return build 12-Sep-2018 15:30:24 template static ITUPLE _rename( build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/ImageFactory.tcc b/code/imageanalysis/ImageAnalysis/ImageFactory.tcc build 12-Sep-2018 15:30:24 index af55ae3..363e78e 100755 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/ImageAnalysis/ImageFactory.tcc build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/ImageAnalysis/ImageFactory.tcc build 12-Sep-2018 15:30:24 @@ -88,6 +88,33 @@ template void ImageFactory::remove(SPIIT& image, casacore::Bool verbos build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +template build 12-Sep-2018 15:30:24 +SHARED_PTR>> ImageFactory::makeComplexImage( build 12-Sep-2018 15:30:24 + SPCIIT realPart, SPCIIT imagPart build 12-Sep-2018 15:30:24 +) { build 12-Sep-2018 15:30:24 + auto shape = realPart->shape(); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + shape != imagPart->shape(), build 12-Sep-2018 15:30:24 + "Real and imaginary parts have different shapes" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + SHARED_PTR>> newImage( build 12-Sep-2018 15:30:24 + new TempImage>(shape, realPart->coordinates()) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + LatticeExpr> expr( build 12-Sep-2018 15:30:24 + casacore::formComplex(*realPart, *imagPart) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + if (ImageMask::isAllMaskTrue(expr)) { build 12-Sep-2018 15:30:24 + newImage->copyData(expr); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + newImage->attachMask(casacore::ArrayLattice(shape)); build 12-Sep-2018 15:30:24 + LogIO os; build 12-Sep-2018 15:30:24 + casacore::LatticeUtilities::copyDataAndMask(os, *newImage, expr, False); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + ImageUtilities::copyMiscellaneous(*newImage, *realPart); build 12-Sep-2018 15:30:24 + return newImage; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 template SPIIT ImageFactory::createImage( build 12-Sep-2018 15:30:24 const casacore::String& outfile, build 12-Sep-2018 15:30:24 const casacore::CoordinateSystem& cSys, const casacore::IPosition& shape, build 12-Sep-2018 15:30:24 @@ -95,13 +122,12 @@ template SPIIT ImageFactory::createImage( build 12-Sep-2018 15:30:24 const vector > *const &msgs build 12-Sep-2018 15:30:24 ) { build 12-Sep-2018 15:30:24 _checkOutfile(outfile, overwrite); build 12-Sep-2018 15:30:24 - casacore::Bool blank = outfile.empty(); build 12-Sep-2018 15:30:24 ThrowIf( build 12-Sep-2018 15:30:24 shape.nelements() != cSys.nPixelAxes(), build 12-Sep-2018 15:30:24 "Supplied CoordinateSystem and image shape are inconsistent" build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 SPIIT image; build 12-Sep-2018 15:30:24 - if (blank) { build 12-Sep-2018 15:30:24 + if (outfile.empty()) { build 12-Sep-2018 15:30:24 image.reset(new casacore::TempImage(shape, cSys)); build 12-Sep-2018 15:30:24 ThrowIf(! image, "Failed to create TempImage"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -112,27 +138,60 @@ template SPIIT ImageFactory::createImage( build 12-Sep-2018 15:30:24 "Failed to create PagedImage" build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - ostringstream os; build 12-Sep-2018 15:30:24 T *x = 0; build 12-Sep-2018 15:30:24 - os << "Created " build 12-Sep-2018 15:30:24 - << (blank ? "Temp" : "Paged") << " image " build 12-Sep-2018 15:30:24 - << (blank ? "" : "'" + outfile + "'") build 12-Sep-2018 15:30:24 - << " of shape " << shape << " with " build 12-Sep-2018 15:30:24 - << whatType(x) << " valued pixels."; build 12-Sep-2018 15:30:24 + auto creationMsg = _imageCreationMessage(outfile, shape, whatType(x)); build 12-Sep-2018 15:30:24 ImageHistory hist(image); build 12-Sep-2018 15:30:24 if (msgs) { build 12-Sep-2018 15:30:24 hist.addHistory(*msgs); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - casacore::LogOrigin lor("ImageFactory", __func__); build 12-Sep-2018 15:30:24 - hist.addHistory(lor, os.str()); build 12-Sep-2018 15:30:24 + LogOrigin lor("ImageFactory", __func__); build 12-Sep-2018 15:30:24 + hist.addHistory(lor, creationMsg); build 12-Sep-2018 15:30:24 image->set(0.0); build 12-Sep-2018 15:30:24 if (log) { build 12-Sep-2018 15:30:24 - casacore::LogIO mylog; build 12-Sep-2018 15:30:24 - mylog << casacore::LogIO::NORMAL << os.str() << casacore::LogIO::POST; build 12-Sep-2018 15:30:24 + LogIO mylog; build 12-Sep-2018 15:30:24 + mylog << LogOrigin("ImageFactory", __func__) build 12-Sep-2018 15:30:24 + << LogIO::NORMAL << creationMsg << LogIO::POST; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 return image; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +template build 12-Sep-2018 15:30:24 +SHARED_PTR> ImageFactory::floatFromComplex( build 12-Sep-2018 15:30:24 + SHARED_PTR>> complexImage, build 12-Sep-2018 15:30:24 + ComplexToFloatFunction function build 12-Sep-2018 15:30:24 +) { build 12-Sep-2018 15:30:24 + SHARED_PTR> newImage( build 12-Sep-2018 15:30:24 + new TempImage( build 12-Sep-2018 15:30:24 + TiledShape(complexImage->shape()), build 12-Sep-2018 15:30:24 + complexImage->coordinates() build 12-Sep-2018 15:30:24 + ) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + // FIXME use lattice copies build 12-Sep-2018 15:30:24 + auto mymask = complexImage->getMask(); build 12-Sep-2018 15:30:24 + if (complexImage->hasPixelMask()) { build 12-Sep-2018 15:30:24 + mymask = mymask && complexImage->pixelMask().get(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (! allTrue(mymask)) { build 12-Sep-2018 15:30:24 + newImage->attachMask(ArrayLattice(mymask)); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + ImageUtilities::copyMiscellaneous(*newImage, *complexImage); build 12-Sep-2018 15:30:24 + switch (function) { build 12-Sep-2018 15:30:24 + case REAL: build 12-Sep-2018 15:30:24 + // FIXME use lattice copies build 12-Sep-2018 15:30:24 + newImage->put(real(complexImage->get())); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case IMAG: build 12-Sep-2018 15:30:24 + // FIXME use lattice copies build 12-Sep-2018 15:30:24 + newImage->put(imag(complexImage->get())); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + default: build 12-Sep-2018 15:30:24 + ThrowCc("Logic Error: Unhandled function"); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return newImage; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 template SPIIT ImageFactory::_fromShape( build 12-Sep-2018 15:30:24 const casacore::String& outfile, const casacore::Vector& shapeV, build 12-Sep-2018 15:30:24 const casacore::Record& coordinates, casacore::Bool linear, build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/ImageFactory2.cc b/code/imageanalysis/ImageAnalysis/ImageFactory2.cc build 12-Sep-2018 15:30:24 index 41b6594..dc0a57a 100755 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/ImageAnalysis/ImageFactory2.cc build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/ImageAnalysis/ImageFactory2.cc build 12-Sep-2018 15:30:24 @@ -175,7 +175,7 @@ SPIIF ImageFactory::fromASCII( build 12-Sep-2018 15:30:24 return imageFromArray(outfile, pixels, csys, linear, overwrite); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -pair ImageFactory::fromImage( build 12-Sep-2018 15:30:24 +ITUPLE ImageFactory::fromImage( build 12-Sep-2018 15:30:24 const String& outfile, const String& infile, build 12-Sep-2018 15:30:24 const Record& region, const String& mask, Bool dropdeg, build 12-Sep-2018 15:30:24 Bool overwrite build 12-Sep-2018 15:30:24 @@ -185,29 +185,40 @@ pair ImageFactory::fromImage( build 12-Sep-2018 15:30:24 auto imageC = std::get<1>(imagePtrs); build 12-Sep-2018 15:30:24 auto imageD = std::get<2>(imagePtrs); build 12-Sep-2018 15:30:24 auto imageDC = std::get<3>(imagePtrs); build 12-Sep-2018 15:30:24 - LogIO mylog; build 12-Sep-2018 15:30:24 - mylog << LogOrigin("ImageFactory", __func__); build 12-Sep-2018 15:30:24 if (imageF) { build 12-Sep-2018 15:30:24 imageF = SubImageFactory::createImage( build 12-Sep-2018 15:30:24 *imageF, outfile, region, build 12-Sep-2018 15:30:24 mask, dropdeg, overwrite, false, false build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 ThrowIf(! imageF, "Failed to create image"); build 12-Sep-2018 15:30:24 - mylog << LogIO::NORMAL << "Created image '" << outfile build 12-Sep-2018 15:30:24 - << "' of shape " << imageF->shape() << LogIO::POST; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - imageC= SubImageFactory::createImage( build 12-Sep-2018 15:30:24 + else if (imageC) { build 12-Sep-2018 15:30:24 + imageC = SubImageFactory::createImage( build 12-Sep-2018 15:30:24 *imageC, outfile, region, build 12-Sep-2018 15:30:24 mask, dropdeg, overwrite, false, false build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 ThrowIf(! imageC, "Failed to create image"); build 12-Sep-2018 15:30:24 - mylog << LogIO::NORMAL << "Created image '" << outfile build 12-Sep-2018 15:30:24 - << "' of shape " << imageC->shape() << LogIO::POST; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - return make_pair(imageF, imageC); build 12-Sep-2018 15:30:24 + else if (imageD) { build 12-Sep-2018 15:30:24 + imageD = SubImageFactory::createImage( build 12-Sep-2018 15:30:24 + *imageD, outfile, region, build 12-Sep-2018 15:30:24 + mask, dropdeg, overwrite, false, false build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + ThrowIf(! imageD, "Failed to create image"); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + imageDC = SubImageFactory::createImage( build 12-Sep-2018 15:30:24 + *imageDC, outfile, region, build 12-Sep-2018 15:30:24 + mask, dropdeg, overwrite, false, false build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + ThrowIf(! imageDC, "Failed to create image"); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + LogIO mylog; build 12-Sep-2018 15:30:24 + mylog << LogOrigin("ImageFactory", __func__); build 12-Sep-2018 15:30:24 + ITUPLE ret(imageF, imageC, imageD, imageDC); build 12-Sep-2018 15:30:24 + mylog << LogIO::NORMAL << _imageCreationMessage(outfile, ret) build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + return ret; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 pair ImageFactory::fromRecord( build 12-Sep-2018 15:30:24 @@ -275,29 +286,6 @@ CoordinateSystem* ImageFactory::_makeCoordinateSystem( build 12-Sep-2018 15:30:24 return csys.release(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -SHARED_PTR > ImageFactory::complexFromFloat( build 12-Sep-2018 15:30:24 - SPCIIF realPart, const Array& imagPart build 12-Sep-2018 15:30:24 -) { build 12-Sep-2018 15:30:24 - SHARED_PTR > newImage( build 12-Sep-2018 15:30:24 - new TempImage( build 12-Sep-2018 15:30:24 - TiledShape(realPart->shape()), build 12-Sep-2018 15:30:24 - realPart->coordinates() build 12-Sep-2018 15:30:24 - ) build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - { build 12-Sep-2018 15:30:24 - Array mymask = realPart->getMask(); build 12-Sep-2018 15:30:24 - if (realPart->hasPixelMask()) { build 12-Sep-2018 15:30:24 - mymask = mymask && realPart->pixelMask().get(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if (! allTrue(mymask)) { build 12-Sep-2018 15:30:24 - newImage->attachMask(ArrayLattice(mymask)); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ImageUtilities::copyMiscellaneous(*newImage, *realPart); build 12-Sep-2018 15:30:24 - newImage->put(casacore::makeComplex(realPart->get(), imagPart)); build 12-Sep-2018 15:30:24 - return newImage; build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 SPIIC ImageFactory::makeComplex( build 12-Sep-2018 15:30:24 SPCIIF realPart, SPCIIF imagPart, const String& outfile, build 12-Sep-2018 15:30:24 const Record& region, Bool overwrite build 12-Sep-2018 15:30:24 @@ -323,8 +311,13 @@ SPIIC ImageFactory::makeComplex( build 12-Sep-2018 15:30:24 auto subImagImage = SubImageFactory::createSubImageRO( build 12-Sep-2018 15:30:24 *imagPart, region, mask, nullptr build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 - auto complexImage = complexFromFloat( build 12-Sep-2018 15:30:24 - subRealImage, subImagImage->get(false) build 12-Sep-2018 15:30:24 + auto complexImage = makeComplexImage( build 12-Sep-2018 15:30:24 + DYNAMIC_POINTER_CAST>( build 12-Sep-2018 15:30:24 + subRealImage build 12-Sep-2018 15:30:24 + ), build 12-Sep-2018 15:30:24 + DYNAMIC_POINTER_CAST>( build 12-Sep-2018 15:30:24 + subImagImage build 12-Sep-2018 15:30:24 + ) build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 return SubImageFactory::createImage( build 12-Sep-2018 15:30:24 *complexImage, outfile, Record(), "", AxesSpecifier(), build 12-Sep-2018 15:30:24 @@ -332,38 +325,6 @@ SPIIC ImageFactory::makeComplex( build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -SHARED_PTR > ImageFactory::floatFromComplex( build 12-Sep-2018 15:30:24 - SPCIIC complexImage, ComplexToFloatFunction function build 12-Sep-2018 15:30:24 -) { build 12-Sep-2018 15:30:24 - SHARED_PTR > newImage( build 12-Sep-2018 15:30:24 - new TempImage( build 12-Sep-2018 15:30:24 - TiledShape(complexImage->shape()), build 12-Sep-2018 15:30:24 - complexImage->coordinates() build 12-Sep-2018 15:30:24 - ) build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - { build 12-Sep-2018 15:30:24 - Array mymask = complexImage->getMask(); build 12-Sep-2018 15:30:24 - if (complexImage->hasPixelMask()) { build 12-Sep-2018 15:30:24 - mymask = mymask && complexImage->pixelMask().get(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if (! allTrue(mymask)) { build 12-Sep-2018 15:30:24 - newImage->attachMask(ArrayLattice(mymask)); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ImageUtilities::copyMiscellaneous(*newImage, *complexImage); build 12-Sep-2018 15:30:24 - switch (function) { build 12-Sep-2018 15:30:24 - case REAL: build 12-Sep-2018 15:30:24 - newImage->put(real(complexImage->get())); build 12-Sep-2018 15:30:24 - break; build 12-Sep-2018 15:30:24 - case IMAG: build 12-Sep-2018 15:30:24 - newImage->put(imag(complexImage->get())); build 12-Sep-2018 15:30:24 - break; build 12-Sep-2018 15:30:24 - default: build 12-Sep-2018 15:30:24 - ThrowCc("Logic Error: Unhandled function"); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - return newImage; build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 ITUPLE ImageFactory::fromFile(const String& infile, Bool cache) { build 12-Sep-2018 15:30:24 _checkInfile(infile); build 12-Sep-2018 15:30:24 ComponentListImage::registerOpenFunction(); build 12-Sep-2018 15:30:24 @@ -386,24 +347,32 @@ ITUPLE ImageFactory::_fromLatticeBase( build 12-Sep-2018 15:30:24 DataType dataType = latt->dataType(); build 12-Sep-2018 15:30:24 tuple ret(nullptr, nullptr, nullptr, nullptr); build 12-Sep-2018 15:30:24 if (dataType == TpFloat) { build 12-Sep-2018 15:30:24 - std::get<0>(ret) = SPIIF( build 12-Sep-2018 15:30:24 + auto f = SPIIF( build 12-Sep-2018 15:30:24 dynamic_cast *>(latt.release()) build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 + ThrowIf(! f, "Could not cast LatticeBase to ImageInterface"); build 12-Sep-2018 15:30:24 + std::get<0>(ret) = f; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else if (dataType == TpComplex) { build 12-Sep-2018 15:30:24 - std::get<1>(ret) = SPIIC( build 12-Sep-2018 15:30:24 + auto c = SPIIC( build 12-Sep-2018 15:30:24 dynamic_cast *>(latt.release()) build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 + ThrowIf(! c, "Could not cast LatticeBase to ImageInterface"); build 12-Sep-2018 15:30:24 + std::get<1>(ret) = c; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else if (dataType == TpDouble) { build 12-Sep-2018 15:30:24 - std::get<2>(ret) = SPIID( build 12-Sep-2018 15:30:24 + auto d = SPIID( build 12-Sep-2018 15:30:24 dynamic_cast *>(latt.release()) build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 + ThrowIf(! d, "Could not cast LatticeBase to ImageInterface"); build 12-Sep-2018 15:30:24 + std::get<2>(ret) = d; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else if (dataType == TpDComplex) { build 12-Sep-2018 15:30:24 - std::get<3>(ret) = SPIIDC( build 12-Sep-2018 15:30:24 + auto dc = SPIIDC( build 12-Sep-2018 15:30:24 dynamic_cast *>(latt.release()) build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 + ThrowIf(! dc, "Could not cast LatticeBase to ImageInterface"); build 12-Sep-2018 15:30:24 + std::get<3>(ret) = dc; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 ostringstream os; build 12-Sep-2018 15:30:24 @@ -643,5 +612,48 @@ void ImageFactory::_checkOutfile(const String& outfile, Bool overwrite) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +String ImageFactory::_imageCreationMessage( build 12-Sep-2018 15:30:24 + const String& outfile, const IPosition& shape, build 12-Sep-2018 15:30:24 + DataType dataType build 12-Sep-2018 15:30:24 +) { build 12-Sep-2018 15:30:24 + auto blank = outfile.empty(); build 12-Sep-2018 15:30:24 + ostringstream os; build 12-Sep-2018 15:30:24 + os << "Created " build 12-Sep-2018 15:30:24 + << (blank ? "Temp" : "Paged") << " image " build 12-Sep-2018 15:30:24 + << (blank ? "" : "'" + outfile + "'") build 12-Sep-2018 15:30:24 + << " of shape " << shape << " with " build 12-Sep-2018 15:30:24 + << dataType << " valued pixels."; build 12-Sep-2018 15:30:24 + return os.str(); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +String ImageFactory::_imageCreationMessage( build 12-Sep-2018 15:30:24 + const String& outfile, const ITUPLE& imagePtrs build 12-Sep-2018 15:30:24 +) { build 12-Sep-2018 15:30:24 + if (auto x = std::get<0>(imagePtrs)) { build 12-Sep-2018 15:30:24 + return _imageCreationMessage( build 12-Sep-2018 15:30:24 + outfile, x->shape(), TpFloat build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (auto x = std::get<1>(imagePtrs)) { build 12-Sep-2018 15:30:24 + return _imageCreationMessage( build 12-Sep-2018 15:30:24 + outfile, x->shape(), TpComplex build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (auto x = std::get<2>(imagePtrs)) { build 12-Sep-2018 15:30:24 + return _imageCreationMessage( build 12-Sep-2018 15:30:24 + outfile, x->shape(), TpDouble build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (auto x = std::get<3>(imagePtrs)) { build 12-Sep-2018 15:30:24 + return _imageCreationMessage( build 12-Sep-2018 15:30:24 + outfile, x->shape(), TpDComplex build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + ThrowCc("Logic Error"); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/ImageRegridder.cc b/code/imageanalysis/ImageAnalysis/ImageRegridder.cc build 12-Sep-2018 15:30:24 deleted file mode 100755 build 12-Sep-2018 15:30:24 index 3dd16be..0000000 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/ImageAnalysis/ImageRegridder.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,715 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 1998,1999,2000,2001,2003 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This program is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU General Public License as published by the Free build 12-Sep-2018 15:30:24 -//# Software Foundation; either version 2 of the License, or (at your option) build 12-Sep-2018 15:30:24 -//# any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This program is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for build 12-Sep-2018 15:30:24 -//# more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU General Public License along build 12-Sep-2018 15:30:24 -//# with this program; if not, write to the Free Software Foundation, Inc., build 12-Sep-2018 15:30:24 -//# 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id: $ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -using namespace casacore; build 12-Sep-2018 15:30:24 -namespace casa { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -const String ImageRegridder::_class = "ImageRegridder"; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -ImageRegridder::ImageRegridder( build 12-Sep-2018 15:30:24 - const SPCIIF image, build 12-Sep-2018 15:30:24 - const Record *const regionRec, build 12-Sep-2018 15:30:24 - const String& maskInp, const String& outname, Bool overwrite, build 12-Sep-2018 15:30:24 - const CoordinateSystem& csysTo, const IPosition& axes, build 12-Sep-2018 15:30:24 - const IPosition& shape build 12-Sep-2018 15:30:24 -) : ImageRegridderBase( build 12-Sep-2018 15:30:24 - image, regionRec, maskInp, outname, build 12-Sep-2018 15:30:24 - overwrite, csysTo, axes, shape build 12-Sep-2018 15:30:24 - ), _debug(0) {} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -ImageRegridder::ImageRegridder( build 12-Sep-2018 15:30:24 - const SPCIIF image, const String& outname, build 12-Sep-2018 15:30:24 - const SPCIIF templateIm, const IPosition& axes, build 12-Sep-2018 15:30:24 - const Record *const regionRec, const String& maskInp, build 12-Sep-2018 15:30:24 - Bool overwrite, const IPosition& shape build 12-Sep-2018 15:30:24 -) : ImageRegridderBase( build 12-Sep-2018 15:30:24 - image, regionRec, maskInp, outname, overwrite, build 12-Sep-2018 15:30:24 - templateIm->coordinates(), axes, shape build 12-Sep-2018 15:30:24 - ), build 12-Sep-2018 15:30:24 - _debug(0) {} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -ImageRegridder::~ImageRegridder() {} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -SPIIF ImageRegridder::regrid() const { build 12-Sep-2018 15:30:24 - _subimage = SubImageFactory::createImage( build 12-Sep-2018 15:30:24 - *this->_getImage(), "", *this->_getRegion(), this->_getMask(), build 12-Sep-2018 15:30:24 - this->_getDropDegen(), false, false, this->_getStretch() build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - auto regridByVel = false; build 12-Sep-2018 15:30:24 - const auto axes = _getAxes(); build 12-Sep-2018 15:30:24 - auto hasMultipleBeams = _getImage()->imageInfo().hasMultipleBeams(); build 12-Sep-2018 15:30:24 - if ( build 12-Sep-2018 15:30:24 - (_getSpecAsVelocity() || hasMultipleBeams) build 12-Sep-2018 15:30:24 - && _getImage()->coordinates().hasSpectralAxis() build 12-Sep-2018 15:30:24 - && _getTemplateCoords().hasSpectralAxis() build 12-Sep-2018 15:30:24 - ) { build 12-Sep-2018 15:30:24 - auto inputSpecAxis = _getImage()->coordinates().spectralAxisNumber(false); build 12-Sep-2018 15:30:24 - auto isInputSpecDegen = _subimage->shape()[inputSpecAxis] == 1; build 12-Sep-2018 15:30:24 - if (axes.empty()) { build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - hasMultipleBeams, build 12-Sep-2018 15:30:24 - "An image with multiple beams cannot be regridded along the spectral axis. " build 12-Sep-2018 15:30:24 - "You may wish to convolve all channels to a common resolution and retry" build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - if (! isInputSpecDegen && _getSpecAsVelocity()) { build 12-Sep-2018 15:30:24 - regridByVel = true; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - auto specAxis = this->_getImage()->coordinates().spectralAxisNumber(); build 12-Sep-2018 15:30:24 - for (uInt i=0; i_prepareOutputImage(*workIm); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -SPIIF ImageRegridder::_regrid() const { build 12-Sep-2018 15:30:24 - if (! _subimage) { build 12-Sep-2018 15:30:24 - // for when this method is called directly by regridByVelocity build 12-Sep-2018 15:30:24 - _subimage = SubImageFactory::createImage( build 12-Sep-2018 15:30:24 - *this->_getImage(), "", *this->_getRegion(), this->_getMask(), build 12-Sep-2018 15:30:24 - this->_getDropDegen(), false, false, this->_getStretch() build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - *this->_getLog() << LogOrigin(_class, __func__); build 12-Sep-2018 15:30:24 - ThrowIf(ImageMask::isAllMaskFalse(*_subimage), "All selected pixels are masked"); build 12-Sep-2018 15:30:24 - const CoordinateSystem csysFrom = _subimage->coordinates(); build 12-Sep-2018 15:30:24 - CoordinateSystem csysTo = _getTemplateCoords(); build 12-Sep-2018 15:30:24 - csysTo.setObsInfo(csysFrom.obsInfo()); build 12-Sep-2018 15:30:24 - std::set coordsToRegrid; build 12-Sep-2018 15:30:24 - CoordinateSystem csys = ImageRegrid::makeCoordinateSystem( build 12-Sep-2018 15:30:24 - *this->_getLog(), coordsToRegrid, csysTo, csysFrom, _getAxes(), build 12-Sep-2018 15:30:24 - _subimage->shape(), false build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - csys.nPixelAxes() != _getShape().size(), build 12-Sep-2018 15:30:24 - "The number of pixel axes in the output shape and Coordinate System must be the same. " build 12-Sep-2018 15:30:24 - "Shape has size " + String::toString(_getShape().size()) + ". Output coordinate system " build 12-Sep-2018 15:30:24 - "has " + String::toString(csys.nPixelAxes()) + " axes" build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - _checkOutputShape(*_subimage, coordsToRegrid); build 12-Sep-2018 15:30:24 - SPIIF workIm(new TempImage(_getKludgedShape(), csys)); build 12-Sep-2018 15:30:24 - ImageUtilities::copyMiscellaneous(*workIm, *_subimage); build 12-Sep-2018 15:30:24 - String maskName(""); build 12-Sep-2018 15:30:24 - ImageMaskAttacher::makeMask(*workIm, maskName, true, true, *this->_getLog(), true); build 12-Sep-2018 15:30:24 - ThrowIf ( build 12-Sep-2018 15:30:24 - ! _doImagesOverlap(_subimage, workIm), build 12-Sep-2018 15:30:24 - "There is no overlap between the (region chosen in) the input image" build 12-Sep-2018 15:30:24 - " and the output image with respect to the axes being regridded." build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - if ( build 12-Sep-2018 15:30:24 - coordsToRegrid.find(Coordinate::SPECTRAL) != coordsToRegrid.end() build 12-Sep-2018 15:30:24 - && fabs(csys.spectralCoordinate().increment()[0]) build 12-Sep-2018 15:30:24 - > fabs(csysFrom.spectralCoordinate().increment()[0]) build 12-Sep-2018 15:30:24 - ) { build 12-Sep-2018 15:30:24 - *_getLog() << LogOrigin(getClass(), __func__) << LogIO::WARN build 12-Sep-2018 15:30:24 - << "Warning: template/imagename relative channel size is " build 12-Sep-2018 15:30:24 - << fabs( build 12-Sep-2018 15:30:24 - csys.spectralCoordinate().increment()[0] build 12-Sep-2018 15:30:24 - /csysFrom.spectralCoordinate().increment()[0] build 12-Sep-2018 15:30:24 - ) << LogIO::POST; build 12-Sep-2018 15:30:24 - *_getLog() << LogOrigin(getClass(), __func__) build 12-Sep-2018 15:30:24 - << LogIO::WARN << "imregrid/ia.regrid() interpolates over spectral " build 12-Sep-2018 15:30:24 - << "channels and does not average channels together. Noise in your " build 12-Sep-2018 15:30:24 - << "resulting image will be the noise in the original individual " build 12-Sep-2018 15:30:24 - << "channels, not the averaged channel noise. To average output " build 12-Sep-2018 15:30:24 - << "channels together, use specsmooth (or ia.boxcar() or ia.hanning) " build 12-Sep-2018 15:30:24 - << "to smooth the spectral axis of your input cube to close to " build 12-Sep-2018 15:30:24 - << "desired resolution and use imregrid/ia.regrid() to regrid it to " build 12-Sep-2018 15:30:24 - << "the desired spectral coordinate grid." << LogIO::POST; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ImageRegrid ir; build 12-Sep-2018 15:30:24 - ir.showDebugInfo(_debug); build 12-Sep-2018 15:30:24 - ir.disableReferenceConversions(! _getDoRefChange()); build 12-Sep-2018 15:30:24 - ir.regrid( build 12-Sep-2018 15:30:24 - *workIm, _getMethod(), _getAxes(), *_subimage, build 12-Sep-2018 15:30:24 - _getReplicate(), _getDecimate(), true, build 12-Sep-2018 15:30:24 - _getForceRegrid() build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - if (! _getOutputStokes().empty()) { build 12-Sep-2018 15:30:24 - workIm = _decimateStokes(workIm); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - workIm->hasPixelMask() && ImageMask::isAllMaskFalse(*workIm), build 12-Sep-2018 15:30:24 - "All output pixels are masked" build 12-Sep-2018 15:30:24 - + String( build 12-Sep-2018 15:30:24 - _getDecimate() > 1 && _regriddingDirectionAxes() build 12-Sep-2018 15:30:24 - ? ". You might want to try decreasing the value of decimate if you are regridding direction axes" build 12-Sep-2018 15:30:24 - : "" build 12-Sep-2018 15:30:24 - ) build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - if (_getNReplicatedChans() > 1) { build 12-Sep-2018 15:30:24 - // spectral channel needs to be replicated _nReplicatedChans times, build 12-Sep-2018 15:30:24 - // and spectral coordinate of the template needs to be copied to the build 12-Sep-2018 15:30:24 - // output. build 12-Sep-2018 15:30:24 - IPosition finalShape = _getKludgedShape(); build 12-Sep-2018 15:30:24 - Int specAxisNumber = workIm->coordinates().spectralAxisNumber(false); build 12-Sep-2018 15:30:24 - finalShape[specAxisNumber] = _getNReplicatedChans(); build 12-Sep-2018 15:30:24 - SPIIF replicatedIm(new TempImage(finalShape, csys)); build 12-Sep-2018 15:30:24 - // FIXME this will exhaust memory for large images build 12-Sep-2018 15:30:24 - auto fillerPixels = workIm->get(); build 12-Sep-2018 15:30:24 - const auto fillerMask = workIm->pixelMask().get(); build 12-Sep-2018 15:30:24 - auto finalPixels = replicatedIm->get(); build 12-Sep-2018 15:30:24 - Array finalMask(replicatedIm->shape()); build 12-Sep-2018 15:30:24 - IPosition begin(finalPixels.ndim(), 0); build 12-Sep-2018 15:30:24 - IPosition end = finalPixels.shape(); build 12-Sep-2018 15:30:24 - auto n = _getNReplicatedChans(); build 12-Sep-2018 15:30:24 - for (uInt i=0; iput(finalPixels); build 12-Sep-2018 15:30:24 - DYNAMIC_POINTER_CAST >(replicatedIm)->attachMask( build 12-Sep-2018 15:30:24 - ArrayLattice(finalMask) build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - SpectralCoordinate spTo = _getTemplateCoords().spectralCoordinate(); build 12-Sep-2018 15:30:24 - CoordinateSystem csysFinal = replicatedIm->coordinates(); build 12-Sep-2018 15:30:24 - csysFinal.replaceCoordinate(spTo, csysFinal.spectralCoordinateNumber()); build 12-Sep-2018 15:30:24 - replicatedIm->setCoordinateInfo(csysFinal); build 12-Sep-2018 15:30:24 - workIm = replicatedIm; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - return workIm; build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -SPIIF ImageRegridder::_decimateStokes(SPIIF workIm) const { build 12-Sep-2018 15:30:24 - ImageMetaData md(workIm); build 12-Sep-2018 15:30:24 - if (_getOutputStokes().size() >= md.nStokes()) { build 12-Sep-2018 15:30:24 - return workIm; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - CasacRegionManager rm(workIm->coordinates()); build 12-Sep-2018 15:30:24 - String diagnostics; build 12-Sep-2018 15:30:24 - uInt nSelectedChannels = 0; build 12-Sep-2018 15:30:24 - if (_getOutputStokes().size() == 1) { build 12-Sep-2018 15:30:24 - String stokes = _getOutputStokes()[0]; build 12-Sep-2018 15:30:24 - Record region = rm.fromBCS( build 12-Sep-2018 15:30:24 - diagnostics, nSelectedChannels, stokes, build 12-Sep-2018 15:30:24 - "", CasacRegionManager::USE_FIRST_STOKES, build 12-Sep-2018 15:30:24 - "", workIm->shape() build 12-Sep-2018 15:30:24 - ).toRecord(""); build 12-Sep-2018 15:30:24 - return SubImageFactory::createImage( build 12-Sep-2018 15:30:24 - *workIm, "", region, "", false, false, false, false build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - // Only include the wanted stokes build 12-Sep-2018 15:30:24 - SHARED_PTR > concat( build 12-Sep-2018 15:30:24 - new ImageConcat( build 12-Sep-2018 15:30:24 - workIm->coordinates().polarizationAxisNumber(false) build 12-Sep-2018 15:30:24 - ) build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - for( String stokes: _getOutputStokes() ) { build 12-Sep-2018 15:30:24 - Record region = rm.fromBCS( build 12-Sep-2018 15:30:24 - diagnostics, nSelectedChannels, stokes, build 12-Sep-2018 15:30:24 - "", CasacRegionManager::USE_FIRST_STOKES, build 12-Sep-2018 15:30:24 - "", workIm->shape() build 12-Sep-2018 15:30:24 - ).toRecord(""); build 12-Sep-2018 15:30:24 - concat->setImage( build 12-Sep-2018 15:30:24 - *SubImageFactory::createImage( build 12-Sep-2018 15:30:24 - *workIm, "", region, "", false, false, false, false build 12-Sep-2018 15:30:24 - ), true build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - return concat; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -void ImageRegridder::_checkOutputShape( build 12-Sep-2018 15:30:24 - const SubImage& subImage, build 12-Sep-2018 15:30:24 - const std::set& coordsToRegrid build 12-Sep-2018 15:30:24 -) const { build 12-Sep-2018 15:30:24 - const auto& csysFrom = subImage.coordinates(); build 12-Sep-2018 15:30:24 - std::set coordsNotToRegrid; build 12-Sep-2018 15:30:24 - auto nCoordinates = csysFrom.nCoordinates(); build 12-Sep-2018 15:30:24 - auto inputShape = subImage.shape(); build 12-Sep-2018 15:30:24 - auto axes = _getAxes(); build 12-Sep-2018 15:30:24 - auto outputAxisOrder = axes; build 12-Sep-2018 15:30:24 - for (uInt i=axes.size(); i<_getKludgedShape().size(); i++) { build 12-Sep-2018 15:30:24 - outputAxisOrder.append(IPosition(1, i)); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - std::set::const_iterator coordsToRegridEnd = coordsToRegrid.end(); build 12-Sep-2018 15:30:24 - for (uInt i=0; i coordAxes = csysFrom.worldAxes(i); build 12-Sep-2018 15:30:24 - for( uInt oldAxis: coordAxes ) { build 12-Sep-2018 15:30:24 - uInt count = 0; build 12-Sep-2018 15:30:24 - for( uInt newAxis: outputAxisOrder ) { build 12-Sep-2018 15:30:24 - if ( build 12-Sep-2018 15:30:24 - newAxis == oldAxis build 12-Sep-2018 15:30:24 - && inputShape[oldAxis] != _getKludgedShape()[count] build 12-Sep-2018 15:30:24 - ) { build 12-Sep-2018 15:30:24 - *this->_getLog() << "Input axis " << oldAxis << " (coordinate type " build 12-Sep-2018 15:30:24 - << Coordinate::typeToString(coordType) << "), which " build 12-Sep-2018 15:30:24 - << "will not be regridded and corresponds to output axis " build 12-Sep-2018 15:30:24 - << newAxis << ", has length " << inputShape[oldAxis] << " where as " build 12-Sep-2018 15:30:24 - << " the specified length of the corresponding output axis is " build 12-Sep-2018 15:30:24 - << _getKludgedShape()[count] << ". If a coordinate is not regridded, " build 12-Sep-2018 15:30:24 - << "its input and output axes must have the same length. " << LogIO::EXCEPTION; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - count++; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -SPIIF ImageRegridder::_regridByVelocity() const { build 12-Sep-2018 15:30:24 - const CoordinateSystem csysTo = _getTemplateCoords(); build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - csysTo.spectralCoordinate().frequencySystem(true) build 12-Sep-2018 15:30:24 - != this->_getImage()->coordinates().spectralCoordinate().frequencySystem(true), build 12-Sep-2018 15:30:24 - "Image to be regridded has different frequency system from template coordinate system." build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - csysTo.spectralCoordinate().restFrequency() == 0, build 12-Sep-2018 15:30:24 - "Template spectral coordinate rest frequency is 0, " build 12-Sep-2018 15:30:24 - "so cannot regrid by velocity." build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - this->_getImage()->coordinates().spectralCoordinate().restFrequency() == 0, build 12-Sep-2018 15:30:24 - "Input image spectral coordinate rest frequency is 0, " build 12-Sep-2018 15:30:24 - "so cannot regrid by velocity." build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - std::unique_ptr csys( build 12-Sep-2018 15:30:24 - dynamic_cast(csysTo.clone()) build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - SpectralCoordinate templateSpecCoord = csys->spectralCoordinate(); build 12-Sep-2018 15:30:24 - std::unique_ptr coordClone( build 12-Sep-2018 15:30:24 - dynamic_cast(_subimage->coordinates().clone()) build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - SpectralCoordinate newSpecCoord = coordClone->spectralCoordinate(); build 12-Sep-2018 15:30:24 - Double newVelRefVal = 0; build 12-Sep-2018 15:30:24 - Double newVelInc = 0; build 12-Sep-2018 15:30:24 - std::pair toVelLimits; build 12-Sep-2018 15:30:24 - auto inSpecAxis = coordClone->spectralAxisNumber(false); build 12-Sep-2018 15:30:24 - for (uInt i=0; i<2; i++) { build 12-Sep-2018 15:30:24 - // i == 0 => csysTo, i == 1 => csysFrom build 12-Sep-2018 15:30:24 - CoordinateSystem *cs = i == 0 ? csys.get() : coordClone.get(); build 12-Sep-2018 15:30:24 - // create and replace the coordinate system's spectral coordinate with build 12-Sep-2018 15:30:24 - // a linear coordinate which describes the velocity axis. In this way build 12-Sep-2018 15:30:24 - // we can regrid by velocity. build 12-Sep-2018 15:30:24 - Int specCoordNum = cs->spectralCoordinateNumber(); build 12-Sep-2018 15:30:24 - SpectralCoordinate specCoord = cs->spectralCoordinate(); build 12-Sep-2018 15:30:24 - if ( build 12-Sep-2018 15:30:24 - specCoord.frequencySystem(false) != specCoord.frequencySystem(true) build 12-Sep-2018 15:30:24 - ) { build 12-Sep-2018 15:30:24 - // the underlying conversion system is different from the overlying one, so this build 12-Sep-2018 15:30:24 - // is pretty confusing. We want the underlying one also be the overlying one before build 12-Sep-2018 15:30:24 - // we regrid. build 12-Sep-2018 15:30:24 - Vector newRefVal; build 12-Sep-2018 15:30:24 - auto newRefPix = specCoord.referencePixel()[0]; build 12-Sep-2018 15:30:24 - specCoord.toWorld(newRefVal, Vector(1, newRefPix)); build 12-Sep-2018 15:30:24 - Vector newVal; build 12-Sep-2018 15:30:24 - specCoord.toWorld(newVal, Vector(1, newRefPix+1)); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - specCoord = SpectralCoordinate( build 12-Sep-2018 15:30:24 - specCoord.frequencySystem(true), newRefVal[0], build 12-Sep-2018 15:30:24 - newVal[0] - newRefVal[0], newRefPix, specCoord.restFrequency() build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - if (cs == coordClone.get()) { build 12-Sep-2018 15:30:24 - newSpecCoord = specCoord; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - Double freqRefVal = specCoord.referenceValue()[0]; build 12-Sep-2018 15:30:24 - Double velRefVal; build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - ! specCoord.frequencyToVelocity(velRefVal, freqRefVal), build 12-Sep-2018 15:30:24 - "Unable to determine reference velocity" build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - Double vel0; build 12-Sep-2018 15:30:24 - Double vel1 = 0; build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - ! specCoord.pixelToVelocity(vel0, 0.0) build 12-Sep-2018 15:30:24 - || ! specCoord.pixelToVelocity(vel1, 1.0), build 12-Sep-2018 15:30:24 - "Unable to determine velocity increment" build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - if (i == 0) { build 12-Sep-2018 15:30:24 - toVelLimits.first = vel0; build 12-Sep-2018 15:30:24 - specCoord.pixelToVelocity( build 12-Sep-2018 15:30:24 - toVelLimits.second, _getShape()[inSpecAxis] - 1 build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - if (toVelLimits.first > toVelLimits.second) { build 12-Sep-2018 15:30:24 - std::swap(toVelLimits.first, toVelLimits.second); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if (i == 1) { build 12-Sep-2018 15:30:24 - std::pair fromVelLimits; build 12-Sep-2018 15:30:24 - specCoord.pixelToVelocity( build 12-Sep-2018 15:30:24 - fromVelLimits.first, 0 build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - specCoord.pixelToVelocity( build 12-Sep-2018 15:30:24 - fromVelLimits.second, _subimage->shape()[inSpecAxis] - 1 build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - if (fromVelLimits.first > fromVelLimits.second) { build 12-Sep-2018 15:30:24 - std::swap(fromVelLimits.first, fromVelLimits.second); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - fromVelLimits.first > toVelLimits.second build 12-Sep-2018 15:30:24 - || fromVelLimits.second < toVelLimits.first, build 12-Sep-2018 15:30:24 - "Request to regrid by velocity, but input and output velocity coordinates do not overlap" build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - Matrix pc(1, 1, 0); build 12-Sep-2018 15:30:24 - pc.diagonal() = 1.0; build 12-Sep-2018 15:30:24 - LinearCoordinate lin( build 12-Sep-2018 15:30:24 - Vector(1, "velocity"), build 12-Sep-2018 15:30:24 - specCoord.worldAxisUnits(), build 12-Sep-2018 15:30:24 - Vector(1, velRefVal), build 12-Sep-2018 15:30:24 - Vector(1, vel1 - vel0), build 12-Sep-2018 15:30:24 - pc, specCoord.referencePixel() build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - // don't bother checking the return value of the replaceCoordinate call build 12-Sep-2018 15:30:24 - // as it will always be false because the replaced and replacement coordinate build 12-Sep-2018 15:30:24 - // types differ, but the coordinate will be replaced anyway. build 12-Sep-2018 15:30:24 - // Yes I find it nonintuitive and am scratching my head regarding the usefulness build 12-Sep-2018 15:30:24 - // of the return value as well. Just check that replacement coordinate is equal to build 12-Sep-2018 15:30:24 - // the coordinate we expect. build 12-Sep-2018 15:30:24 - cs->replaceCoordinate(lin, specCoordNum); build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - ! lin.near(cs->linearCoordinate(specCoordNum)), build 12-Sep-2018 15:30:24 - "Replacement linear coordinate does not match " build 12-Sep-2018 15:30:24 - "original linear coordinate because " build 12-Sep-2018 15:30:24 - + lin.errorMessage() build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - if (cs == csys.get()) { build 12-Sep-2018 15:30:24 - newVelRefVal = velRefVal; build 12-Sep-2018 15:30:24 - newVelInc = vel1 - vel0; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - _subimage->setCoordinateInfo(*cs); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - // do not pass the region or the mask, the maskedClone has already had the region and build 12-Sep-2018 15:30:24 - // mask applied build 12-Sep-2018 15:30:24 - ImageRegridder regridder( build 12-Sep-2018 15:30:24 - _subimage, 0, "", this->_getOutname(), build 12-Sep-2018 15:30:24 - this->_getOverwrite(), *csys, _getAxes(), _getShape() build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - regridder.setConfiguration(*this); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - SPIIF outImage = regridder._regrid(); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // replace the temporary linear coordinate with the saved spectral coordinate build 12-Sep-2018 15:30:24 - std::unique_ptr newCoords( build 12-Sep-2018 15:30:24 - dynamic_cast(outImage->coordinates().clone()) build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // make frequencies correct build 12-Sep-2018 15:30:24 - Double newRefFreq; build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - ! newSpecCoord.velocityToFrequency( build 12-Sep-2018 15:30:24 - newRefFreq, newVelRefVal build 12-Sep-2018 15:30:24 - ), build 12-Sep-2018 15:30:24 - "Unable to determine new reference frequency" build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - // get the new frequency increment build 12-Sep-2018 15:30:24 - Double newFreq; build 12-Sep-2018 15:30:24 - ThrowIf ( build 12-Sep-2018 15:30:24 - ! newSpecCoord.velocityToFrequency( build 12-Sep-2018 15:30:24 - newFreq, newVelRefVal + newVelInc build 12-Sep-2018 15:30:24 - ), build 12-Sep-2018 15:30:24 - "Unable to determine new frequency increment" build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - ThrowIf ( build 12-Sep-2018 15:30:24 - ! newSpecCoord.setReferenceValue(Vector(1, newRefFreq)), build 12-Sep-2018 15:30:24 - "Unable to set new reference frequency" build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - ThrowIf ( build 12-Sep-2018 15:30:24 - ! newSpecCoord.setIncrement((Vector(1, newFreq - newRefFreq))), build 12-Sep-2018 15:30:24 - "Unable to set new frequency increment" build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - ! newSpecCoord.setReferencePixel( build 12-Sep-2018 15:30:24 - templateSpecCoord.referencePixel() build 12-Sep-2018 15:30:24 - ), "Unable to set new reference pixel" build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - ThrowIf( build 12-Sep-2018 15:30:24 - ! newCoords->replaceCoordinate( build 12-Sep-2018 15:30:24 - newSpecCoord, build 12-Sep-2018 15:30:24 - _subimage->coordinates().linearCoordinateNumber()) build 12-Sep-2018 15:30:24 - && ! newSpecCoord.near(newCoords->spectralCoordinate()), build 12-Sep-2018 15:30:24 - "Unable to replace coordinate for velocity regridding" build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - outImage->setCoordinateInfo(*newCoords); build 12-Sep-2018 15:30:24 - return outImage; build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -Bool ImageRegridder::_doImagesOverlap( build 12-Sep-2018 15:30:24 - SPCIIF image0, SPCIIF image1 build 12-Sep-2018 15:30:24 -) const { build 12-Sep-2018 15:30:24 - const CoordinateSystem csys0 = image0->coordinates(); build 12-Sep-2018 15:30:24 - const CoordinateSystem csys1 = image1->coordinates(); build 12-Sep-2018 15:30:24 - IPosition shape0 = image0->shape(); build 12-Sep-2018 15:30:24 - IPosition shape1 = image1->shape(); build 12-Sep-2018 15:30:24 - ImageMetaData md0(image0); build 12-Sep-2018 15:30:24 - ImageMetaData md1(image1); build 12-Sep-2018 15:30:24 - Bool overlap = false; build 12-Sep-2018 15:30:24 - if ( build 12-Sep-2018 15:30:24 - csys0.hasDirectionCoordinate() build 12-Sep-2018 15:30:24 - && csys1.hasDirectionCoordinate() build 12-Sep-2018 15:30:24 - ) { build 12-Sep-2018 15:30:24 - const DirectionCoordinate dc0 = csys0.directionCoordinate(); build 12-Sep-2018 15:30:24 - DirectionCoordinate dc1 = csys1.directionCoordinate(); build 12-Sep-2018 15:30:24 - Vector dirShape0 = md0.directionShape(); build 12-Sep-2018 15:30:24 - Vector dirShape1 = md1.directionShape(); build 12-Sep-2018 15:30:24 - Vector inc0 = dc0.increment(); build 12-Sep-2018 15:30:24 - Vector inc1 = dc1.increment(); build 12-Sep-2018 15:30:24 - Vector units0 = dc0.worldAxisUnits(); build 12-Sep-2018 15:30:24 - Vector units1 = dc1.worldAxisUnits(); build 12-Sep-2018 15:30:24 - Bool reallyBig = false; build 12-Sep-2018 15:30:24 - Quantity extent; build 12-Sep-2018 15:30:24 - Quantity oneDeg(1, "deg"); build 12-Sep-2018 15:30:24 - for (uInt i=0; i<2; ++i) { build 12-Sep-2018 15:30:24 - extent = Quantity(dirShape0[i]*abs(inc0[i]), units0[i]); build 12-Sep-2018 15:30:24 - if (extent > oneDeg) { build 12-Sep-2018 15:30:24 - reallyBig = true; build 12-Sep-2018 15:30:24 - break; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - extent = Quantity(dirShape1[i]*abs(inc1[i]), units1[i]); build 12-Sep-2018 15:30:24 - if (extent > oneDeg) { build 12-Sep-2018 15:30:24 - reallyBig = true; build 12-Sep-2018 15:30:24 - break; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if (reallyBig) { build 12-Sep-2018 15:30:24 - *this->_getLog() << LogOrigin("ImageRegridder", __func__) build 12-Sep-2018 15:30:24 - << LogIO::WARN << "At least one of the images " build 12-Sep-2018 15:30:24 - << "exceeds one degree on at one side, not checking " build 12-Sep-2018 15:30:24 - << "for direction plane overlap." << LogIO::POST; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - Bool sameFrame = dc0.directionType(true) == dc1.directionType(true); build 12-Sep-2018 15:30:24 - if (!sameFrame) { build 12-Sep-2018 15:30:24 - dc1.setReferenceConversion(dc0.directionType(true)); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - Vector > corners0 = _getDirectionCorners( build 12-Sep-2018 15:30:24 - dc0, dirShape0 build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - Vector > corners1 = _getDirectionCorners( build 12-Sep-2018 15:30:24 - dc1, dirShape1 build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - overlap = _doRectanglesIntersect(corners0, corners1); build 12-Sep-2018 15:30:24 - if (! overlap) { build 12-Sep-2018 15:30:24 - return false; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if ( build 12-Sep-2018 15:30:24 - csys0.hasSpectralAxis() build 12-Sep-2018 15:30:24 - && csys1.hasSpectralAxis() build 12-Sep-2018 15:30:24 - ) { build 12-Sep-2018 15:30:24 - const SpectralCoordinate sp0 = csys0.spectralCoordinate(); build 12-Sep-2018 15:30:24 - const SpectralCoordinate sp1 = csys1.spectralCoordinate(); build 12-Sep-2018 15:30:24 - uInt nChan0 = md0.nChannels(); build 12-Sep-2018 15:30:24 - uInt nChan1 = md1.nChannels(); build 12-Sep-2018 15:30:24 - Double world; build 12-Sep-2018 15:30:24 - sp0.toWorld(world, 0); build 12-Sep-2018 15:30:24 - Double end00 = world; build 12-Sep-2018 15:30:24 - sp0.toWorld(world, nChan0 - 1); build 12-Sep-2018 15:30:24 - Double end01 = world; build 12-Sep-2018 15:30:24 - sp1.toWorld(world, 0); build 12-Sep-2018 15:30:24 - Double end10 = world; build 12-Sep-2018 15:30:24 - sp1.toWorld(world, nChan1 - 1); build 12-Sep-2018 15:30:24 - Double end11 = world; build 12-Sep-2018 15:30:24 - if ( build 12-Sep-2018 15:30:24 - max(end00, end01) < min(end10, end11) build 12-Sep-2018 15:30:24 - || max(end10, end11) < min(end00, end01) build 12-Sep-2018 15:30:24 - ) { build 12-Sep-2018 15:30:24 - return false; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - return true; build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -Vector > ImageRegridder::_getDirectionCorners( build 12-Sep-2018 15:30:24 - const DirectionCoordinate& dc, build 12-Sep-2018 15:30:24 - const IPosition& directionShape build 12-Sep-2018 15:30:24 -) { build 12-Sep-2018 15:30:24 - Vector world; build 12-Sep-2018 15:30:24 - Vector pixel(2, 0); build 12-Sep-2018 15:30:24 - Vector units = dc.worldAxisUnits(); build 12-Sep-2018 15:30:24 - dc.toWorld(world, pixel); build 12-Sep-2018 15:30:24 - Vector > corners(4); build 12-Sep-2018 15:30:24 - for (uInt i=0; i<4; ++i) { build 12-Sep-2018 15:30:24 - switch(i) { build 12-Sep-2018 15:30:24 - case 0: build 12-Sep-2018 15:30:24 - // blcx, blcy build 12-Sep-2018 15:30:24 - pixel.set(0); build 12-Sep-2018 15:30:24 - break; build 12-Sep-2018 15:30:24 - case 1: build 12-Sep-2018 15:30:24 - // trcx, blcy build 12-Sep-2018 15:30:24 - pixel[0] = directionShape[0]; build 12-Sep-2018 15:30:24 - pixel[1] = 0; build 12-Sep-2018 15:30:24 - break; build 12-Sep-2018 15:30:24 - case 2: build 12-Sep-2018 15:30:24 - // trcx, trcy build 12-Sep-2018 15:30:24 - pixel[0] = directionShape[0]; build 12-Sep-2018 15:30:24 - pixel[1] = directionShape[1]; build 12-Sep-2018 15:30:24 - break; build 12-Sep-2018 15:30:24 - case 3: build 12-Sep-2018 15:30:24 - // blcx, trcy build 12-Sep-2018 15:30:24 - pixel[0] = 0; build 12-Sep-2018 15:30:24 - pixel[1] = directionShape[1]; build 12-Sep-2018 15:30:24 - break; build 12-Sep-2018 15:30:24 - default: build 12-Sep-2018 15:30:24 - ThrowCc("Logic Error: This code should never be reached"); build 12-Sep-2018 15:30:24 - break; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - dc.toWorld(world, pixel); build 12-Sep-2018 15:30:24 - Double x = Quantity(world[0], units[0]).getValue("rad"); build 12-Sep-2018 15:30:24 - if (fabs(x) >= C::_2pi) { build 12-Sep-2018 15:30:24 - // resolve 2pi ambiguities for x (longitude) coordinate build 12-Sep-2018 15:30:24 - x = fmod(x, C::_2pi); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if (x < 0) { build 12-Sep-2018 15:30:24 - // ensure longitude is > 0 build 12-Sep-2018 15:30:24 - x += C::_2pi; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - corners[i].first = x; build 12-Sep-2018 15:30:24 - corners[i].second = Quantity(world[1], units[1]).getValue("rad"); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - auto diff0 = abs(corners[1].first - corners[0].first); build 12-Sep-2018 15:30:24 - auto diff1 = abs(corners[1].first - C::_2pi - corners[0].first); build 12-Sep-2018 15:30:24 - if (diff0 > diff1) { build 12-Sep-2018 15:30:24 - // image straddles longitude 0 and we have to rationalize the build 12-Sep-2018 15:30:24 - // longitude trc coordinate build 12-Sep-2018 15:30:24 - corners[1].first -= C::_2pi; build 12-Sep-2018 15:30:24 - corners[2].first -= C::_2pi; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - return corners; build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -Bool ImageRegridder::_doRectanglesIntersect( build 12-Sep-2018 15:30:24 - const Vector >& corners0, build 12-Sep-2018 15:30:24 - const Vector >& corners1 build 12-Sep-2018 15:30:24 -) { build 12-Sep-2018 15:30:24 - Double minx0 = corners0[0].first; build 12-Sep-2018 15:30:24 - Double maxx0 = minx0; build 12-Sep-2018 15:30:24 - Double miny0 = corners0[0].second; build 12-Sep-2018 15:30:24 - Double maxy0 = miny0; build 12-Sep-2018 15:30:24 - Double minx1 = corners1[0].first; build 12-Sep-2018 15:30:24 - Double maxx1 = minx1; build 12-Sep-2018 15:30:24 - Double miny1 = corners1[0].second; build 12-Sep-2018 15:30:24 - Double maxy1 = miny1; build 12-Sep-2018 15:30:24 - for (uInt i=1; i<4; i++) { build 12-Sep-2018 15:30:24 - minx0 = min(minx0, corners0[i].first); build 12-Sep-2018 15:30:24 - maxx0 = max(maxx0, corners0[i].first); build 12-Sep-2018 15:30:24 - miny0 = min(miny0, corners0[i].second); build 12-Sep-2018 15:30:24 - maxy0 = max(maxy0, corners0[i].second); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - minx1 = min(minx1, corners1[i].first); build 12-Sep-2018 15:30:24 - maxx1 = max(maxx1, corners1[i].first); build 12-Sep-2018 15:30:24 - miny1 = min(miny1, corners1[i].second); build 12-Sep-2018 15:30:24 - maxy1 = max(maxy1, corners1[i].second); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if ( build 12-Sep-2018 15:30:24 - minx0 > maxx1 || maxx0 < minx1 build 12-Sep-2018 15:30:24 - || miny0 > maxy1 || maxy0 < miny1 build 12-Sep-2018 15:30:24 - ) { build 12-Sep-2018 15:30:24 - // bounds check shows images do not intersect build 12-Sep-2018 15:30:24 - return false; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else if ( build 12-Sep-2018 15:30:24 - (minx0 >= minx1 && maxx0 <= maxx1 && miny0 >= miny1 && maxy0 <= maxy1) build 12-Sep-2018 15:30:24 - || (minx0 < minx1 && maxx0 > maxx1 && miny0 < miny1 && maxy0 > maxy1) build 12-Sep-2018 15:30:24 - ) { build 12-Sep-2018 15:30:24 - // one image lies completely inside the other build 12-Sep-2018 15:30:24 - return true; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - // determine intersection build 12-Sep-2018 15:30:24 - // FIXME There are more efficient algorithms. See eg build 12-Sep-2018 15:30:24 - // the Shamos-Hoey Algorithm build 12-Sep-2018 15:30:24 - // http://geomalgorithms.com/a09-_intersect-3.html#Pseudo-Code%3a%20S-H build 12-Sep-2018 15:30:24 - for (uInt i=0; i<4; i++) { build 12-Sep-2018 15:30:24 - Vector start0(2, corners0[i].first); build 12-Sep-2018 15:30:24 - start0[1] = corners0[i].second; build 12-Sep-2018 15:30:24 - Vector end0( build 12-Sep-2018 15:30:24 - 2, build 12-Sep-2018 15:30:24 - i == 3 ? corners0[0].first build 12-Sep-2018 15:30:24 - : corners0[i+1].first build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - end0[1] = i == 3 ? corners0[0].second : corners0[i+1].second; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - for (uInt j=0; j<4; j++) { build 12-Sep-2018 15:30:24 - Vector start1(2, corners1[j].first); build 12-Sep-2018 15:30:24 - start1[1] = corners1[j].second; build 12-Sep-2018 15:30:24 - Vector end1( build 12-Sep-2018 15:30:24 - 2, build 12-Sep-2018 15:30:24 - j == 3 ? corners1[0].first build 12-Sep-2018 15:30:24 - : corners1[j+1].first build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 - end1[1] = j == 3 ? corners1[0].second : corners1[j+1].second; build 12-Sep-2018 15:30:24 - if ( build 12-Sep-2018 15:30:24 - Geometry::doLineSegmentsIntersect( build 12-Sep-2018 15:30:24 - start0[0], start0[1], end0[0], end0[1], build 12-Sep-2018 15:30:24 - start1[0], start1[1], end1[0], end1[1] build 12-Sep-2018 15:30:24 - ) build 12-Sep-2018 15:30:24 - ) { build 12-Sep-2018 15:30:24 - return true; build 12-Sep-2018 15:30:24 - break; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - return false; build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/ImageRegridder.h b/code/imageanalysis/ImageAnalysis/ImageRegridder.h build 12-Sep-2018 15:30:24 index 81707d0..e562486 100755 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/ImageAnalysis/ImageRegridder.h build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/ImageAnalysis/ImageRegridder.h build 12-Sep-2018 15:30:24 @@ -28,7 +28,6 @@ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace casacore{ build 12-Sep-2018 15:30:24 @@ -40,9 +39,10 @@ template class TempImage; build 12-Sep-2018 15:30:24 namespace casa { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -class ImageRegridder : public ImageRegridderBase { build 12-Sep-2018 15:30:24 +template class ImageRegridder : public ImageRegridderBase { build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 - // Top level interface which regrids an image to a specified coordinate system build 12-Sep-2018 15:30:24 + // Top level interface which regrids an image to a specified coordinate build 12-Sep-2018 15:30:24 + // system build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 @@ -56,10 +56,11 @@ class ImageRegridder : public ImageRegridderBase { build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 - // High level interface for regridding an image. Note that in the case of a complex-valued build 12-Sep-2018 15:30:24 - // image, the image is first divided into its composite real and imaginary parts, and these build 12-Sep-2018 15:30:24 - // parts are regridded independently. The resulting regridded images are combined to form build 12-Sep-2018 15:30:24 - // the final regridded complex-valued image. build 12-Sep-2018 15:30:24 + // High level interface for regridding an image. Note that in the case of a build 12-Sep-2018 15:30:24 + // complex-valued image, the image is first divided into its composite real build 12-Sep-2018 15:30:24 + // and imaginary parts, and these parts are regridded independently. The build 12-Sep-2018 15:30:24 + // resulting regridded images are combined to form the final regridded build 12-Sep-2018 15:30:24 + // complex-valued image. build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 public: build 12-Sep-2018 15:30:24 @@ -67,22 +68,24 @@ public: build 12-Sep-2018 15:30:24 ImageRegridder() = delete; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // if outname is empty, no image will be written build 12-Sep-2018 15:30:24 - // if overwrite is true, if image already exists it will be removed build 12-Sep-2018 15:30:24 - // if overwrite is false, if image already exists exception will be thrown build 12-Sep-2018 15:30:24 + // if overwrite is true, if image already exists it will be build 12-Sep-2018 15:30:24 + // removed if overwrite is false, if image already exists build 12-Sep-2018 15:30:24 + // exception will be thrown build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 ImageRegridder( build 12-Sep-2018 15:30:24 - const SPCIIF image, build 12-Sep-2018 15:30:24 - const casacore::Record *const regionRec, build 12-Sep-2018 15:30:24 - const casacore::String& maskInp, const casacore::String& outname, casacore::Bool overwrite, build 12-Sep-2018 15:30:24 - const casacore::CoordinateSystem& csysTo, const casacore::IPosition& axes, build 12-Sep-2018 15:30:24 - const casacore::IPosition& shape build 12-Sep-2018 15:30:24 + const SPCIIT image, const casacore::Record *const regionRec, build 12-Sep-2018 15:30:24 + const casacore::String& maskInp, const casacore::String& outname, build 12-Sep-2018 15:30:24 + casacore::Bool overwrite, const casacore::CoordinateSystem& csysTo, build 12-Sep-2018 15:30:24 + const casacore::IPosition& axes, const casacore::IPosition& shape build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // FIXME Add support to allow image and templateIm to be of different data types build 12-Sep-2018 15:30:24 + // FIXME Add support to allow image and templateIm to be of different data build 12-Sep-2018 15:30:24 + // types build 12-Sep-2018 15:30:24 ImageRegridder( build 12-Sep-2018 15:30:24 - const SPCIIF image, const casacore::String& outname, build 12-Sep-2018 15:30:24 - const SPCIIF templateIm, const casacore::IPosition& axes=casacore::IPosition(), build 12-Sep-2018 15:30:24 + const SPCIIT image, const casacore::String& outname, build 12-Sep-2018 15:30:24 + const SPCIIT templateIm, build 12-Sep-2018 15:30:24 + const casacore::IPosition& axes=casacore::IPosition(), build 12-Sep-2018 15:30:24 const casacore::Record *const regionRec=0, build 12-Sep-2018 15:30:24 const casacore::String& maskInp="", casacore::Bool overwrite=false, build 12-Sep-2018 15:30:24 const casacore::IPosition& shape=casacore::IPosition() build 12-Sep-2018 15:30:24 @@ -93,44 +96,50 @@ public: build 12-Sep-2018 15:30:24 ~ImageRegridder(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // perform the regrid. build 12-Sep-2018 15:30:24 - SPIIF regrid() const; build 12-Sep-2018 15:30:24 + SPIIT regrid() const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 inline casacore::String getClass() const { return _class; } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void setDebug(casacore::Int debug) { _debug = debug; } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 private: build 12-Sep-2018 15:30:24 - mutable SPIIF _subimage; build 12-Sep-2018 15:30:24 + mutable SPIIT _subimage; build 12-Sep-2018 15:30:24 casacore::Int _debug; build 12-Sep-2018 15:30:24 static const casacore::String _class; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SPIIF _regrid() const; build 12-Sep-2018 15:30:24 + SPIIT _regrid() const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SPIIF _regridByVelocity() const; build 12-Sep-2018 15:30:24 + SPIIT _regridByVelocity() const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - casacore::Bool _doImagesOverlap( build 12-Sep-2018 15:30:24 - SPCIIF image0, build 12-Sep-2018 15:30:24 - SPCIIF image1 build 12-Sep-2018 15:30:24 - ) const; build 12-Sep-2018 15:30:24 + casacore::Bool _doImagesOverlap(SPCIIT image0, SPCIIT image1) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - static casacore::Vector > _getDirectionCorners( build 12-Sep-2018 15:30:24 + static casacore::Vector > build 12-Sep-2018 15:30:24 + _getDirectionCorners( build 12-Sep-2018 15:30:24 const casacore::DirectionCoordinate& dc, build 12-Sep-2018 15:30:24 const casacore::IPosition& directionShape build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void _checkOutputShape( build 12-Sep-2018 15:30:24 - const casacore::SubImage& subImage, build 12-Sep-2018 15:30:24 + const casacore::SubImage& subImage, build 12-Sep-2018 15:30:24 const std::set& coordsToRegrid build 12-Sep-2018 15:30:24 ) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SPIIF _decimateStokes(SPIIF workIm) const; build 12-Sep-2018 15:30:24 + SPIIT _decimateStokes(SPIIT workIm) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 static casacore::Bool _doRectanglesIntersect( build 12-Sep-2018 15:30:24 - const casacore::Vector >& corners0, build 12-Sep-2018 15:30:24 - const casacore::Vector >& corners1 build 12-Sep-2018 15:30:24 + const casacore::Vector< build 12-Sep-2018 15:30:24 + std::pair build 12-Sep-2018 15:30:24 + >& corners0, build 12-Sep-2018 15:30:24 + const casacore::Vector< build 12-Sep-2018 15:30:24 + std::pair build 12-Sep-2018 15:30:24 + >& corners1 build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#ifndef CASACORE_NO_AUTO_TEMPLATES build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 #endif build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/ImageRegridder.tcc b/code/imageanalysis/ImageAnalysis/ImageRegridder.tcc build 12-Sep-2018 15:30:24 new file mode 100755 build 12-Sep-2018 15:30:24 index 0000000..829b149 build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/ImageAnalysis/ImageRegridder.tcc build 12-Sep-2018 15:30:24 @@ -0,0 +1,731 @@ build 12-Sep-2018 15:30:24 +//# Copyright (C) 1998,1999,2000,2001,2003 build 12-Sep-2018 15:30:24 +//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This program is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 +//# under the terms of the GNU General Public License as published by the Free build 12-Sep-2018 15:30:24 +//# Software Foundation; either version 2 of the License, or (at your option) build 12-Sep-2018 15:30:24 +//# any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This program is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 +//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 +//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for build 12-Sep-2018 15:30:24 +//# more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU General Public License along build 12-Sep-2018 15:30:24 +//# with this program; if not, write to the Free Software Foundation, Inc., build 12-Sep-2018 15:30:24 +//# 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 +//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 +//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 +//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 +//# 520 Edgemont Road build 12-Sep-2018 15:30:24 +//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# $Id: $ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +namespace casa { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template const String ImageRegridder::_class = "ImageRegridder"; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template ImageRegridder::ImageRegridder( build 12-Sep-2018 15:30:24 + const SPCIIT image, const casacore::Record *const regionRec, build 12-Sep-2018 15:30:24 + const casacore::String& maskInp, const casacore::String& outname, build 12-Sep-2018 15:30:24 + casacore::Bool overwrite, const casacore::CoordinateSystem& csysTo, build 12-Sep-2018 15:30:24 + const casacore::IPosition& axes, const casacore::IPosition& shape build 12-Sep-2018 15:30:24 +) : ImageRegridderBase( build 12-Sep-2018 15:30:24 + image, regionRec, maskInp, outname, build 12-Sep-2018 15:30:24 + overwrite, csysTo, axes, shape build 12-Sep-2018 15:30:24 + ), _debug(0) {} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template ImageRegridder::ImageRegridder( build 12-Sep-2018 15:30:24 + const SPCIIT image, const casacore::String& outname, build 12-Sep-2018 15:30:24 + const SPCIIT templateIm, const casacore::IPosition& axes, build 12-Sep-2018 15:30:24 + const casacore::Record *const regionRec, const casacore::String& maskInp, build 12-Sep-2018 15:30:24 + casacore::Bool overwrite, const casacore::IPosition& shape build 12-Sep-2018 15:30:24 +) : ImageRegridderBase( build 12-Sep-2018 15:30:24 + image, regionRec, maskInp, outname, overwrite, build 12-Sep-2018 15:30:24 + templateIm->coordinates(), axes, shape build 12-Sep-2018 15:30:24 + ), build 12-Sep-2018 15:30:24 + _debug(0) {} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template ImageRegridder::~ImageRegridder() {} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template SPIIT ImageRegridder::regrid() const { build 12-Sep-2018 15:30:24 + _subimage = SubImageFactory::createImage( build 12-Sep-2018 15:30:24 + *this->_getImage(), "", *this->_getRegion(), this->_getMask(), build 12-Sep-2018 15:30:24 + this->_getDropDegen(), false, false, this->_getStretch() build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + auto regridByVel = false; build 12-Sep-2018 15:30:24 + const auto axes = this->_getAxes(); build 12-Sep-2018 15:30:24 + auto hasMultipleBeams = this->_getImage()->imageInfo().hasMultipleBeams(); build 12-Sep-2018 15:30:24 + const auto& csys = this->_getImage()->coordinates(); build 12-Sep-2018 15:30:24 + if ( build 12-Sep-2018 15:30:24 + (this->_getSpecAsVelocity() || hasMultipleBeams) build 12-Sep-2018 15:30:24 + && csys.hasSpectralAxis() build 12-Sep-2018 15:30:24 + && this->_getTemplateCoords().hasSpectralAxis() build 12-Sep-2018 15:30:24 + ) { build 12-Sep-2018 15:30:24 + auto inputSpecAxis = csys.spectralAxisNumber(false); build 12-Sep-2018 15:30:24 + auto isInputSpecDegen = _subimage->shape()[inputSpecAxis] == 1; build 12-Sep-2018 15:30:24 + if (axes.empty()) { build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + hasMultipleBeams, build 12-Sep-2018 15:30:24 + "An image with multiple beams cannot be regridded along the " build 12-Sep-2018 15:30:24 + "spectral axis. You may wish to convolve all channels to a " build 12-Sep-2018 15:30:24 + "common resolution and retry" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + if (! isInputSpecDegen && this->_getSpecAsVelocity()) { build 12-Sep-2018 15:30:24 + regridByVel = true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + auto specAxis = csys.spectralAxisNumber(); build 12-Sep-2018 15:30:24 + for (uInt i=0; i_getSpecAsVelocity()) { build 12-Sep-2018 15:30:24 + regridByVel = true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + auto workIm = regridByVel ? this->_regridByVelocity() : this->_regrid(); build 12-Sep-2018 15:30:24 + return this->_prepareOutputImage(*workIm); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template SPIIT ImageRegridder::_regrid() const { build 12-Sep-2018 15:30:24 + if (! _subimage) { build 12-Sep-2018 15:30:24 + // for when this method is called directly by regridByVelocity build 12-Sep-2018 15:30:24 + _subimage = SubImageFactory::createImage( build 12-Sep-2018 15:30:24 + *this->_getImage(), "", *this->_getRegion(), this->_getMask(), build 12-Sep-2018 15:30:24 + this->_getDropDegen(), false, false, this->_getStretch() build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + *this->_getLog() << LogOrigin(_class, __func__); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + ImageMask::isAllMaskFalse(*_subimage), build 12-Sep-2018 15:30:24 + "All selected pixels are masked" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + const auto csysFrom = _subimage->coordinates(); build 12-Sep-2018 15:30:24 + CoordinateSystem csysTo = this->_getTemplateCoords(); build 12-Sep-2018 15:30:24 + csysTo.setObsInfo(csysFrom.obsInfo()); build 12-Sep-2018 15:30:24 + std::set coordsToRegrid; build 12-Sep-2018 15:30:24 + auto csys = ImageRegrid::makeCoordinateSystem( build 12-Sep-2018 15:30:24 + *this->_getLog(), coordsToRegrid, csysTo, csysFrom, this->_getAxes(), build 12-Sep-2018 15:30:24 + _subimage->shape(), false build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + csys.nPixelAxes() != this->_getShape().size(), build 12-Sep-2018 15:30:24 + "The number of pixel axes in the output shape and Coordinate System " build 12-Sep-2018 15:30:24 + "must be the same. Shape has size " build 12-Sep-2018 15:30:24 + + casacore::String::toString(this->_getShape().size()) + ". Output " build 12-Sep-2018 15:30:24 + "coordinate system has " build 12-Sep-2018 15:30:24 + + casacore::String::toString(csys.nPixelAxes()) + " axes" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + this->_checkOutputShape(*_subimage, coordsToRegrid); build 12-Sep-2018 15:30:24 + SPIIT workIm(new TempImage(this->_getKludgedShape(), csys)); build 12-Sep-2018 15:30:24 + ImageUtilities::copyMiscellaneous(*workIm, *_subimage); build 12-Sep-2018 15:30:24 + String maskName(""); build 12-Sep-2018 15:30:24 + ImageMaskAttacher::makeMask( build 12-Sep-2018 15:30:24 + *workIm, maskName, true, true, *this->_getLog(), true build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + ThrowIf ( build 12-Sep-2018 15:30:24 + ! this->_doImagesOverlap(_subimage, workIm), build 12-Sep-2018 15:30:24 + "There is no overlap between the (region chosen in) the input image" build 12-Sep-2018 15:30:24 + " and the output image with respect to the axes being regridded." build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + if ( build 12-Sep-2018 15:30:24 + coordsToRegrid.find(Coordinate::SPECTRAL) != coordsToRegrid.end() build 12-Sep-2018 15:30:24 + && fabs(csys.spectralCoordinate().increment()[0]) build 12-Sep-2018 15:30:24 + > fabs(csysFrom.spectralCoordinate().increment()[0]) build 12-Sep-2018 15:30:24 + ) { build 12-Sep-2018 15:30:24 + *this->_getLog() << LogOrigin(getClass(), __func__) << LogIO::WARN build 12-Sep-2018 15:30:24 + << "Warning: template/imagename relative channel size is " build 12-Sep-2018 15:30:24 + << fabs( build 12-Sep-2018 15:30:24 + csys.spectralCoordinate().increment()[0] build 12-Sep-2018 15:30:24 + /csysFrom.spectralCoordinate().increment()[0] build 12-Sep-2018 15:30:24 + ) << LogIO::POST; build 12-Sep-2018 15:30:24 + *this->_getLog() << LogOrigin(getClass(), __func__) build 12-Sep-2018 15:30:24 + << LogIO::WARN << "imregrid/ia.regrid() interpolates over spectral " build 12-Sep-2018 15:30:24 + << "channels and does not average channels together. Noise in your " build 12-Sep-2018 15:30:24 + << "resulting image will be the noise in the original individual " build 12-Sep-2018 15:30:24 + << "channels, not the averaged channel noise. To average output " build 12-Sep-2018 15:30:24 + << "channels together, use specsmooth (or ia.boxcar() or " build 12-Sep-2018 15:30:24 + << "ia.hanning() to smooth the spectral axis of your input cube to " build 12-Sep-2018 15:30:24 + << "close to desired resolution and use imregrid/ia.regrid() to " build 12-Sep-2018 15:30:24 + << "regrid it to the desired spectral coordinate grid." build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + ImageRegrid ir; build 12-Sep-2018 15:30:24 + ir.showDebugInfo(_debug); build 12-Sep-2018 15:30:24 + ir.disableReferenceConversions(! this->_getDoRefChange()); build 12-Sep-2018 15:30:24 + ir.regrid( build 12-Sep-2018 15:30:24 + *workIm, this->_getMethod(), this->_getAxes(), *_subimage, build 12-Sep-2018 15:30:24 + this->_getReplicate(), this->_getDecimate(), true, build 12-Sep-2018 15:30:24 + this->_getForceRegrid() build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + if (! this->_getOutputStokes().empty()) { build 12-Sep-2018 15:30:24 + workIm = this->_decimateStokes(workIm); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + workIm->hasPixelMask() && ImageMask::isAllMaskFalse(*workIm), build 12-Sep-2018 15:30:24 + "All output pixels are masked" build 12-Sep-2018 15:30:24 + + casacore::String( build 12-Sep-2018 15:30:24 + this->_getDecimate() > 1 && this->_regriddingDirectionAxes() build 12-Sep-2018 15:30:24 + ? ". You might want to try decreasing the value of decimate if you " build 12-Sep-2018 15:30:24 + "are regridding direction axes" build 12-Sep-2018 15:30:24 + : "" build 12-Sep-2018 15:30:24 + ) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + if (this->_getNReplicatedChans() > 1) { build 12-Sep-2018 15:30:24 + // spectral channel needs to be replicated _nReplicatedChans times, build 12-Sep-2018 15:30:24 + // and spectral coordinate of the template needs to be copied to the build 12-Sep-2018 15:30:24 + // output. build 12-Sep-2018 15:30:24 + IPosition finalShape = this->_getKludgedShape(); build 12-Sep-2018 15:30:24 + Int specAxisNumber = workIm->coordinates().spectralAxisNumber(false); build 12-Sep-2018 15:30:24 + auto fillerPixels = workIm->get(); build 12-Sep-2018 15:30:24 + const auto fillerMask = workIm->pixelMask().get(); build 12-Sep-2018 15:30:24 + finalShape[specAxisNumber] = this->_getNReplicatedChans(); build 12-Sep-2018 15:30:24 + SPIIT replicatedIm(new casacore::TempImage(finalShape, csys)); build 12-Sep-2018 15:30:24 + DYNAMIC_POINTER_CAST>(replicatedIm)->attachMask( build 12-Sep-2018 15:30:24 + casacore::ArrayLattice(finalShape) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + auto& pixelMask = replicatedIm->pixelMask(); build 12-Sep-2018 15:30:24 + auto n = this->_getNReplicatedChans(); build 12-Sep-2018 15:30:24 + IPosition where(finalShape.size(), 0); build 12-Sep-2018 15:30:24 + for (uInt i=0; iputSlice(fillerPixels, where); build 12-Sep-2018 15:30:24 + pixelMask.putSlice(fillerMask, where); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + auto spTo = this->_getTemplateCoords().spectralCoordinate(); build 12-Sep-2018 15:30:24 + auto csysFinal = replicatedIm->coordinates(); build 12-Sep-2018 15:30:24 + csysFinal.replaceCoordinate(spTo, csysFinal.spectralCoordinateNumber()); build 12-Sep-2018 15:30:24 + replicatedIm->setCoordinateInfo(csysFinal); build 12-Sep-2018 15:30:24 + workIm = replicatedIm; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return workIm; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template SPIIT ImageRegridder::_decimateStokes(SPIIT workIm) const { build 12-Sep-2018 15:30:24 + ImageMetaData md(workIm); build 12-Sep-2018 15:30:24 + if (this->_getOutputStokes().size() >= md.nStokes()) { build 12-Sep-2018 15:30:24 + return workIm; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + CasacRegionManager rm(workIm->coordinates()); build 12-Sep-2018 15:30:24 + casacore::String diagnostics; build 12-Sep-2018 15:30:24 + casacore::uInt nSelectedChannels = 0; build 12-Sep-2018 15:30:24 + if (this->_getOutputStokes().size() == 1) { build 12-Sep-2018 15:30:24 + auto stokes = this->_getOutputStokes()[0]; build 12-Sep-2018 15:30:24 + auto region = rm.fromBCS( build 12-Sep-2018 15:30:24 + diagnostics, nSelectedChannels, stokes, build 12-Sep-2018 15:30:24 + "", CasacRegionManager::USE_FIRST_STOKES, build 12-Sep-2018 15:30:24 + "", workIm->shape() build 12-Sep-2018 15:30:24 + ).toRecord(""); build 12-Sep-2018 15:30:24 + return SubImageFactory::createImage( build 12-Sep-2018 15:30:24 + *workIm, "", region, "", false, false, false, false build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + // Only include the wanted stokes build 12-Sep-2018 15:30:24 + SHARED_PTR > concat( build 12-Sep-2018 15:30:24 + new casacore::ImageConcat( build 12-Sep-2018 15:30:24 + workIm->coordinates().polarizationAxisNumber(false) build 12-Sep-2018 15:30:24 + ) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + for(casacore::String stokes: this->_getOutputStokes()) { build 12-Sep-2018 15:30:24 + auto region = rm.fromBCS( build 12-Sep-2018 15:30:24 + diagnostics, nSelectedChannels, stokes, build 12-Sep-2018 15:30:24 + "", CasacRegionManager::USE_FIRST_STOKES, build 12-Sep-2018 15:30:24 + "", workIm->shape() build 12-Sep-2018 15:30:24 + ).toRecord(""); build 12-Sep-2018 15:30:24 + concat->setImage( build 12-Sep-2018 15:30:24 + *SubImageFactory::createImage( build 12-Sep-2018 15:30:24 + *workIm, "", region, "", false, false, false, false build 12-Sep-2018 15:30:24 + ), true build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return concat; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template void ImageRegridder::_checkOutputShape( build 12-Sep-2018 15:30:24 + const casacore::SubImage& subImage, build 12-Sep-2018 15:30:24 + const std::set& coordsToRegrid build 12-Sep-2018 15:30:24 +) const { build 12-Sep-2018 15:30:24 + const auto& csysFrom = subImage.coordinates(); build 12-Sep-2018 15:30:24 + std::set coordsNotToRegrid; build 12-Sep-2018 15:30:24 + auto nCoordinates = csysFrom.nCoordinates(); build 12-Sep-2018 15:30:24 + auto inputShape = subImage.shape(); build 12-Sep-2018 15:30:24 + auto axes = this->_getAxes(); build 12-Sep-2018 15:30:24 + auto outputAxisOrder = axes; build 12-Sep-2018 15:30:24 + for (uInt i=axes.size(); i_getKludgedShape().size(); ++i) { build 12-Sep-2018 15:30:24 + outputAxisOrder.append(casacore::IPosition(1, i)); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + const auto coordsToRegridEnd = coordsToRegrid.end(); build 12-Sep-2018 15:30:24 + for (uInt i=0; i_getKludgedShape()[count], build 12-Sep-2018 15:30:24 + "Input axis " + casacore::String::toString(oldAxis) build 12-Sep-2018 15:30:24 + + " (coordinate type " build 12-Sep-2018 15:30:24 + + casacore::Coordinate::typeToString(coordType) build 12-Sep-2018 15:30:24 + + "), which will not be regridded and corresponds to" build 12-Sep-2018 15:30:24 + + "output axis casacore::String::toString(newAxis), " build 12-Sep-2018 15:30:24 + + "has length " build 12-Sep-2018 15:30:24 + + casacore::String::toString(inputShape[oldAxis]) build 12-Sep-2018 15:30:24 + + " where as the specified length of the corresponding " build 12-Sep-2018 15:30:24 + + "output axis is " build 12-Sep-2018 15:30:24 + + casacore::String::toString( build 12-Sep-2018 15:30:24 + this->_getKludgedShape()[count] build 12-Sep-2018 15:30:24 + ) + ". If a coordinate is not regridded, its input and " build 12-Sep-2018 15:30:24 + + "output axes must have the same length." build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + ++count; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template SPIIT ImageRegridder::_regridByVelocity() const { build 12-Sep-2018 15:30:24 + const auto csysTo = this->_getTemplateCoords(); build 12-Sep-2018 15:30:24 + const auto specCoordTo = csysTo.spectralCoordinate(); build 12-Sep-2018 15:30:24 + const auto specCoordFrom = this->_getImage()->coordinates() build 12-Sep-2018 15:30:24 + .spectralCoordinate(); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + specCoordTo.frequencySystem(true) build 12-Sep-2018 15:30:24 + != specCoordFrom.frequencySystem(true), build 12-Sep-2018 15:30:24 + "Image to be regridded has different frequency system from template " build 12-Sep-2018 15:30:24 + "coordinate system." build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + specCoordTo.restFrequency() == 0, build 12-Sep-2018 15:30:24 + "Template spectral coordinate rest frequency is 0, " build 12-Sep-2018 15:30:24 + "so cannot regrid by velocity." build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + specCoordFrom.restFrequency() == 0, build 12-Sep-2018 15:30:24 + "Input image spectral coordinate rest frequency is 0, so cannot regrid " build 12-Sep-2018 15:30:24 + "by velocity." build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + std::unique_ptr csys( build 12-Sep-2018 15:30:24 + dynamic_cast(csysTo.clone()) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + auto templateSpecCoord = csys->spectralCoordinate(); build 12-Sep-2018 15:30:24 + std::unique_ptr coordClone( build 12-Sep-2018 15:30:24 + dynamic_cast( build 12-Sep-2018 15:30:24 + _subimage->coordinates().clone() build 12-Sep-2018 15:30:24 + ) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + auto newSpecCoord = coordClone->spectralCoordinate(); build 12-Sep-2018 15:30:24 + casacore::Double newVelRefVal = 0; build 12-Sep-2018 15:30:24 + casacore::Double newVelInc = 0; build 12-Sep-2018 15:30:24 + std::pair toVelLimits; build 12-Sep-2018 15:30:24 + auto inSpecAxis = coordClone->spectralAxisNumber(false); build 12-Sep-2018 15:30:24 + for (uInt i=0; i<2; ++i) { build 12-Sep-2018 15:30:24 + // i == 0 => csysTo, i == 1 => csysFrom build 12-Sep-2018 15:30:24 + auto *cs = i == 0 ? csys.get() : coordClone.get(); build 12-Sep-2018 15:30:24 + // create and replace the coordinate system's spectral coordinate with build 12-Sep-2018 15:30:24 + // a linear coordinate which describes the velocity axis. In this way build 12-Sep-2018 15:30:24 + // we can regrid by velocity. build 12-Sep-2018 15:30:24 + Int specCoordNum = cs->spectralCoordinateNumber(); build 12-Sep-2018 15:30:24 + auto specCoord = cs->spectralCoordinate(); build 12-Sep-2018 15:30:24 + if ( build 12-Sep-2018 15:30:24 + specCoord.frequencySystem(false) != specCoord.frequencySystem(true) build 12-Sep-2018 15:30:24 + ) { build 12-Sep-2018 15:30:24 + // the underlying conversion system is different from the overlying build 12-Sep-2018 15:30:24 + // one, so this is pretty confusing. We want the underlying one also build 12-Sep-2018 15:30:24 + // be the overlying one before we regrid. build 12-Sep-2018 15:30:24 + casacore::Vector newRefVal; build 12-Sep-2018 15:30:24 + auto newRefPix = specCoord.referencePixel()[0]; build 12-Sep-2018 15:30:24 + specCoord.toWorld( build 12-Sep-2018 15:30:24 + newRefVal, build 12-Sep-2018 15:30:24 + casacore::Vector(1, newRefPix) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + casacore::Vector newVal; build 12-Sep-2018 15:30:24 + specCoord.toWorld( build 12-Sep-2018 15:30:24 + newVal, casacore::Vector(1, newRefPix+1) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + specCoord = SpectralCoordinate( build 12-Sep-2018 15:30:24 + specCoord.frequencySystem(true), newRefVal[0], build 12-Sep-2018 15:30:24 + (newVal[0] - newRefVal[0]), newRefPix, specCoord.restFrequency() build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + if (cs == coordClone.get()) { build 12-Sep-2018 15:30:24 + newSpecCoord = specCoord; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + casacore::Double freqRefVal = specCoord.referenceValue()[0]; build 12-Sep-2018 15:30:24 + casacore::Double velRefVal; build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + ! specCoord.frequencyToVelocity(velRefVal, freqRefVal), build 12-Sep-2018 15:30:24 + "Unable to determine reference velocity" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + casacore::Double vel0; build 12-Sep-2018 15:30:24 + casacore::Double vel1 = 0; build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + ! specCoord.pixelToVelocity(vel0, 0.0) build 12-Sep-2018 15:30:24 + || ! specCoord.pixelToVelocity(vel1, 1.0), build 12-Sep-2018 15:30:24 + "Unable to determine velocity increment" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + if (i == 0) { build 12-Sep-2018 15:30:24 + toVelLimits.first = vel0; build 12-Sep-2018 15:30:24 + specCoord.pixelToVelocity( build 12-Sep-2018 15:30:24 + toVelLimits.second, this->_getShape()[inSpecAxis] - 1 build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + if (toVelLimits.first > toVelLimits.second) { build 12-Sep-2018 15:30:24 + std::swap(toVelLimits.first, toVelLimits.second); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (i == 1) { build 12-Sep-2018 15:30:24 + std::pair fromVelLimits; build 12-Sep-2018 15:30:24 + specCoord.pixelToVelocity(fromVelLimits.first, 0); build 12-Sep-2018 15:30:24 + specCoord.pixelToVelocity( build 12-Sep-2018 15:30:24 + fromVelLimits.second, _subimage->shape()[inSpecAxis] - 1 build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + if (fromVelLimits.first > fromVelLimits.second) { build 12-Sep-2018 15:30:24 + std::swap(fromVelLimits.first, fromVelLimits.second); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + fromVelLimits.first > toVelLimits.second build 12-Sep-2018 15:30:24 + || fromVelLimits.second < toVelLimits.first, build 12-Sep-2018 15:30:24 + "Request to regrid by velocity, but input and output velocity " build 12-Sep-2018 15:30:24 + "coordinates do not overlap" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + casacore::Matrix pc(1, 1, 0); build 12-Sep-2018 15:30:24 + pc.diagonal() = 1.0; build 12-Sep-2018 15:30:24 + casacore::LinearCoordinate lin( build 12-Sep-2018 15:30:24 + casacore::Vector(1, "velocity"), build 12-Sep-2018 15:30:24 + specCoord.worldAxisUnits(), build 12-Sep-2018 15:30:24 + casacore::Vector(1, velRefVal), build 12-Sep-2018 15:30:24 + casacore::Vector(1, vel1 - vel0), build 12-Sep-2018 15:30:24 + pc, specCoord.referencePixel() build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + // don't bother checking the return value of the replaceCoordinate call build 12-Sep-2018 15:30:24 + // as it will always be false because the replaced and replacement build 12-Sep-2018 15:30:24 + // coordinate types differ, but the coordinate will be replaced anyway. build 12-Sep-2018 15:30:24 + // Yes I find it nonintuitive and am scratching my head regarding the build 12-Sep-2018 15:30:24 + // usefulness of the return value as well. Just check that replacement build 12-Sep-2018 15:30:24 + // coordinate is equal to the coordinate we expect. build 12-Sep-2018 15:30:24 + cs->replaceCoordinate(lin, specCoordNum); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + ! lin.near(cs->linearCoordinate(specCoordNum)), build 12-Sep-2018 15:30:24 + "Replacement linear coordinate does not match " build 12-Sep-2018 15:30:24 + "original linear coordinate because " build 12-Sep-2018 15:30:24 + + lin.errorMessage() build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + if (cs == csys.get()) { build 12-Sep-2018 15:30:24 + newVelRefVal = velRefVal; build 12-Sep-2018 15:30:24 + newVelInc = vel1 - vel0; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + _subimage->setCoordinateInfo(*cs); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + // do not pass the region or the mask, the maskedClone has already had the build 12-Sep-2018 15:30:24 + // region and mask applied build 12-Sep-2018 15:30:24 + ImageRegridder regridder( build 12-Sep-2018 15:30:24 + _subimage, 0, "", this->_getOutname(), this->_getOverwrite(), *csys, build 12-Sep-2018 15:30:24 + this->_getAxes(), this->_getShape() build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + regridder.setConfiguration(*this); build 12-Sep-2018 15:30:24 + auto outImage = regridder._regrid(); build 12-Sep-2018 15:30:24 + // replace the temporary linear coordinate with the saved spectral build 12-Sep-2018 15:30:24 + // coordinate build 12-Sep-2018 15:30:24 + std::unique_ptr newCoords( build 12-Sep-2018 15:30:24 + dynamic_cast( build 12-Sep-2018 15:30:24 + outImage->coordinates().clone() build 12-Sep-2018 15:30:24 + ) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + // make frequencies correct build 12-Sep-2018 15:30:24 + casacore::Double newRefFreq; build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + ! newSpecCoord.velocityToFrequency( build 12-Sep-2018 15:30:24 + newRefFreq, newVelRefVal build 12-Sep-2018 15:30:24 + ), build 12-Sep-2018 15:30:24 + "Unable to determine new reference frequency" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + // get the new frequency increment build 12-Sep-2018 15:30:24 + casacore::Double newFreq; build 12-Sep-2018 15:30:24 + ThrowIf ( build 12-Sep-2018 15:30:24 + ! newSpecCoord.velocityToFrequency(newFreq, newVelRefVal + newVelInc), build 12-Sep-2018 15:30:24 + "Unable to determine new frequency increment" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + ThrowIf ( build 12-Sep-2018 15:30:24 + ! newSpecCoord.setReferenceValue(Vector(1, newRefFreq)), build 12-Sep-2018 15:30:24 + "Unable to set new reference frequency" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + ThrowIf ( build 12-Sep-2018 15:30:24 + ! newSpecCoord.setIncrement((Vector(1, newFreq - newRefFreq))), build 12-Sep-2018 15:30:24 + "Unable to set new frequency increment" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + ! newSpecCoord.setReferencePixel( build 12-Sep-2018 15:30:24 + templateSpecCoord.referencePixel() build 12-Sep-2018 15:30:24 + ), "Unable to set new reference pixel" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + ! newCoords->replaceCoordinate( build 12-Sep-2018 15:30:24 + newSpecCoord, build 12-Sep-2018 15:30:24 + _subimage->coordinates().linearCoordinateNumber()) build 12-Sep-2018 15:30:24 + && ! newSpecCoord.near(newCoords->spectralCoordinate()), build 12-Sep-2018 15:30:24 + "Unable to replace coordinate for velocity regridding" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + outImage->setCoordinateInfo(*newCoords); build 12-Sep-2018 15:30:24 + return outImage; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template Bool ImageRegridder::_doImagesOverlap( build 12-Sep-2018 15:30:24 + SPCIIT image0, SPCIIT image1 build 12-Sep-2018 15:30:24 +) const { build 12-Sep-2018 15:30:24 + const auto csys0 = image0->coordinates(); build 12-Sep-2018 15:30:24 + const auto csys1 = image1->coordinates(); build 12-Sep-2018 15:30:24 + auto shape0 = image0->shape(); build 12-Sep-2018 15:30:24 + auto shape1 = image1->shape(); build 12-Sep-2018 15:30:24 + ImageMetaData md0(image0); build 12-Sep-2018 15:30:24 + ImageMetaData md1(image1); build 12-Sep-2018 15:30:24 + Bool overlap = false; build 12-Sep-2018 15:30:24 + if ( build 12-Sep-2018 15:30:24 + csys0.hasDirectionCoordinate() build 12-Sep-2018 15:30:24 + && csys1.hasDirectionCoordinate() build 12-Sep-2018 15:30:24 + ) { build 12-Sep-2018 15:30:24 + const auto dc0 = csys0.directionCoordinate(); build 12-Sep-2018 15:30:24 + auto dc1 = csys1.directionCoordinate(); build 12-Sep-2018 15:30:24 + auto dirShape0 = md0.directionShape(); build 12-Sep-2018 15:30:24 + auto dirShape1 = md1.directionShape(); build 12-Sep-2018 15:30:24 + auto inc0 = dc0.increment(); build 12-Sep-2018 15:30:24 + auto inc1 = dc1.increment(); build 12-Sep-2018 15:30:24 + auto units0 = dc0.worldAxisUnits(); build 12-Sep-2018 15:30:24 + auto units1 = dc1.worldAxisUnits(); build 12-Sep-2018 15:30:24 + auto reallyBig = false; build 12-Sep-2018 15:30:24 + casacore::Quantity extent; build 12-Sep-2018 15:30:24 + casacore::Quantity oneDeg(1, "deg"); build 12-Sep-2018 15:30:24 + for (uInt i=0; i<2; ++i) { build 12-Sep-2018 15:30:24 + extent = casacore::Quantity(dirShape0[i]*abs(inc0[i]), units0[i]); build 12-Sep-2018 15:30:24 + if (extent > oneDeg) { build 12-Sep-2018 15:30:24 + reallyBig = true; build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + extent = casacore::Quantity(dirShape1[i]*abs(inc1[i]), units1[i]); build 12-Sep-2018 15:30:24 + if (extent > oneDeg) { build 12-Sep-2018 15:30:24 + reallyBig = true; build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (reallyBig) { build 12-Sep-2018 15:30:24 + *this->_getLog() << LogOrigin("ImageRegridder", __func__) build 12-Sep-2018 15:30:24 + << LogIO::WARN << "At least one of the images " build 12-Sep-2018 15:30:24 + << "exceeds one degree on at one side, not checking " build 12-Sep-2018 15:30:24 + << "for direction plane overlap." << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + auto sameFrame = dc0.directionType(true) == dc1.directionType(true); build 12-Sep-2018 15:30:24 + if (!sameFrame) { build 12-Sep-2018 15:30:24 + dc1.setReferenceConversion(dc0.directionType(true)); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + auto corners0 = _getDirectionCorners(dc0, dirShape0); build 12-Sep-2018 15:30:24 + auto corners1 = _getDirectionCorners(dc1, dirShape1); build 12-Sep-2018 15:30:24 + overlap = _doRectanglesIntersect(corners0, corners1); build 12-Sep-2018 15:30:24 + if (! overlap) { build 12-Sep-2018 15:30:24 + return false; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if ( build 12-Sep-2018 15:30:24 + csys0.hasSpectralAxis() build 12-Sep-2018 15:30:24 + && csys1.hasSpectralAxis() build 12-Sep-2018 15:30:24 + ) { build 12-Sep-2018 15:30:24 + const auto sp0 = csys0.spectralCoordinate(); build 12-Sep-2018 15:30:24 + const auto sp1 = csys1.spectralCoordinate(); build 12-Sep-2018 15:30:24 + auto nChan0 = md0.nChannels(); build 12-Sep-2018 15:30:24 + auto nChan1 = md1.nChannels(); build 12-Sep-2018 15:30:24 + casacore::Double world; build 12-Sep-2018 15:30:24 + sp0.toWorld(world, 0); build 12-Sep-2018 15:30:24 + auto end00 = world; build 12-Sep-2018 15:30:24 + sp0.toWorld(world, nChan0 - 1); build 12-Sep-2018 15:30:24 + auto end01 = world; build 12-Sep-2018 15:30:24 + sp1.toWorld(world, 0); build 12-Sep-2018 15:30:24 + auto end10 = world; build 12-Sep-2018 15:30:24 + sp1.toWorld(world, nChan1 - 1); build 12-Sep-2018 15:30:24 + auto end11 = world; build 12-Sep-2018 15:30:24 + if ( build 12-Sep-2018 15:30:24 + max(end00, end01) < min(end10, end11) build 12-Sep-2018 15:30:24 + || max(end10, end11) < min(end00, end01) build 12-Sep-2018 15:30:24 + ) { build 12-Sep-2018 15:30:24 + return false; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return true; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template build 12-Sep-2018 15:30:24 +casacore::Vector> build 12-Sep-2018 15:30:24 +ImageRegridder::_getDirectionCorners( build 12-Sep-2018 15:30:24 + const casacore::DirectionCoordinate& dc, build 12-Sep-2018 15:30:24 + const casacore::IPosition& directionShape build 12-Sep-2018 15:30:24 +) { build 12-Sep-2018 15:30:24 + casacore::Vector world; build 12-Sep-2018 15:30:24 + casacore::Vector pixel(2, 0); build 12-Sep-2018 15:30:24 + auto units = dc.worldAxisUnits(); build 12-Sep-2018 15:30:24 + dc.toWorld(world, pixel); build 12-Sep-2018 15:30:24 + casacore::Vector > corners(4); build 12-Sep-2018 15:30:24 + for (uInt i=0; i<4; ++i) { build 12-Sep-2018 15:30:24 + switch(i) { build 12-Sep-2018 15:30:24 + case 0: build 12-Sep-2018 15:30:24 + // blcx, blcy build 12-Sep-2018 15:30:24 + pixel.set(0); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case 1: build 12-Sep-2018 15:30:24 + // trcx, blcy build 12-Sep-2018 15:30:24 + pixel[0] = directionShape[0]; build 12-Sep-2018 15:30:24 + pixel[1] = 0; build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case 2: build 12-Sep-2018 15:30:24 + // trcx, trcy build 12-Sep-2018 15:30:24 + pixel[0] = directionShape[0]; build 12-Sep-2018 15:30:24 + pixel[1] = directionShape[1]; build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case 3: build 12-Sep-2018 15:30:24 + // blcx, trcy build 12-Sep-2018 15:30:24 + pixel[0] = 0; build 12-Sep-2018 15:30:24 + pixel[1] = directionShape[1]; build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + default: build 12-Sep-2018 15:30:24 + ThrowCc("Logic Error: This code should never be reached"); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + dc.toWorld(world, pixel); build 12-Sep-2018 15:30:24 + auto x = casacore::Quantity(world[0], units[0]).getValue("rad"); build 12-Sep-2018 15:30:24 + if (fabs(x) >= casacore::C::_2pi) { build 12-Sep-2018 15:30:24 + // resolve 2pi ambiguities for x (longitude) coordinate build 12-Sep-2018 15:30:24 + x = fmod(x, C::_2pi); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (x < 0) { build 12-Sep-2018 15:30:24 + // ensure longitude is > 0 build 12-Sep-2018 15:30:24 + x += casacore::C::_2pi; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + corners[i].first = x; build 12-Sep-2018 15:30:24 + corners[i].second = casacore::Quantity( build 12-Sep-2018 15:30:24 + world[1], units[1] build 12-Sep-2018 15:30:24 + ).getValue("rad"); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + auto diff0 = abs(corners[1].first - corners[0].first); build 12-Sep-2018 15:30:24 + auto diff1 = abs(corners[1].first - C::_2pi - corners[0].first); build 12-Sep-2018 15:30:24 + if (diff0 > diff1) { build 12-Sep-2018 15:30:24 + // image straddles longitude 0 and we have to rationalize the build 12-Sep-2018 15:30:24 + // longitude trc coordinate build 12-Sep-2018 15:30:24 + corners[1].first -= casacore::C::_2pi; build 12-Sep-2018 15:30:24 + corners[2].first -= casacore::C::_2pi; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return corners; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template casacore::Bool ImageRegridder::_doRectanglesIntersect( build 12-Sep-2018 15:30:24 + const casacore::Vector< build 12-Sep-2018 15:30:24 + std::pair build 12-Sep-2018 15:30:24 + >& corners0, build 12-Sep-2018 15:30:24 + const casacore::Vector< build 12-Sep-2018 15:30:24 + std::pair build 12-Sep-2018 15:30:24 + >& corners1 build 12-Sep-2018 15:30:24 +) { build 12-Sep-2018 15:30:24 + auto minx0 = corners0[0].first; build 12-Sep-2018 15:30:24 + auto maxx0 = minx0; build 12-Sep-2018 15:30:24 + auto miny0 = corners0[0].second; build 12-Sep-2018 15:30:24 + auto maxy0 = miny0; build 12-Sep-2018 15:30:24 + auto minx1 = corners1[0].first; build 12-Sep-2018 15:30:24 + auto maxx1 = minx1; build 12-Sep-2018 15:30:24 + auto miny1 = corners1[0].second; build 12-Sep-2018 15:30:24 + auto maxy1 = miny1; build 12-Sep-2018 15:30:24 + for (casacore::uInt i=1; i<4; ++i) { build 12-Sep-2018 15:30:24 + minx0 = min(minx0, corners0[i].first); build 12-Sep-2018 15:30:24 + maxx0 = max(maxx0, corners0[i].first); build 12-Sep-2018 15:30:24 + miny0 = min(miny0, corners0[i].second); build 12-Sep-2018 15:30:24 + maxy0 = max(maxy0, corners0[i].second); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + minx1 = min(minx1, corners1[i].first); build 12-Sep-2018 15:30:24 + maxx1 = max(maxx1, corners1[i].first); build 12-Sep-2018 15:30:24 + miny1 = min(miny1, corners1[i].second); build 12-Sep-2018 15:30:24 + maxy1 = max(maxy1, corners1[i].second); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if ( build 12-Sep-2018 15:30:24 + minx0 > maxx1 || maxx0 < minx1 build 12-Sep-2018 15:30:24 + || miny0 > maxy1 || maxy0 < miny1 build 12-Sep-2018 15:30:24 + ) { build 12-Sep-2018 15:30:24 + // bounds check shows images do not intersect build 12-Sep-2018 15:30:24 + return false; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if ( build 12-Sep-2018 15:30:24 + (minx0 >= minx1 && maxx0 <= maxx1 && miny0 >= miny1 && maxy0 <= maxy1) build 12-Sep-2018 15:30:24 + || (minx0 < minx1 && maxx0 > maxx1 && miny0 < miny1 && maxy0 > maxy1) build 12-Sep-2018 15:30:24 + ) { build 12-Sep-2018 15:30:24 + // one image lies completely inside the other build 12-Sep-2018 15:30:24 + return true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + // determine intersection build 12-Sep-2018 15:30:24 + // FIXME There are more efficient algorithms. See eg build 12-Sep-2018 15:30:24 + // the Shamos-Hoey Algorithm build 12-Sep-2018 15:30:24 + // http://geomalgorithms.com/a09-_intersect-3.html#Pseudo-Code%3a%20S-H build 12-Sep-2018 15:30:24 + for (casacore::uInt i=0; i<4; ++i) { build 12-Sep-2018 15:30:24 + casacore::Vector start0(2, corners0[i].first); build 12-Sep-2018 15:30:24 + start0[1] = corners0[i].second; build 12-Sep-2018 15:30:24 + casacore::Vector end0( build 12-Sep-2018 15:30:24 + 2, build 12-Sep-2018 15:30:24 + i == 3 ? corners0[0].first build 12-Sep-2018 15:30:24 + : corners0[i+1].first build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + end0[1] = i == 3 ? corners0[0].second : corners0[i+1].second; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + for (uInt j=0; j<4; ++j) { build 12-Sep-2018 15:30:24 + casacore::Vector start1(2, corners1[j].first); build 12-Sep-2018 15:30:24 + start1[1] = corners1[j].second; build 12-Sep-2018 15:30:24 + casacore::Vector end1( build 12-Sep-2018 15:30:24 + 2, build 12-Sep-2018 15:30:24 + j == 3 ? corners1[0].first build 12-Sep-2018 15:30:24 + : corners1[j+1].first build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + end1[1] = j == 3 ? corners1[0].second : corners1[j+1].second; build 12-Sep-2018 15:30:24 + if ( build 12-Sep-2018 15:30:24 + casacore::Geometry::doLineSegmentsIntersect( build 12-Sep-2018 15:30:24 + start0[0], start0[1], end0[0], end0[1], build 12-Sep-2018 15:30:24 + start1[0], start1[1], end1[0], end1[1] build 12-Sep-2018 15:30:24 + ) build 12-Sep-2018 15:30:24 + ) { build 12-Sep-2018 15:30:24 + return true; build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return false; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/ImageRotator.cc b/code/imageanalysis/ImageAnalysis/ImageRotator.cc build 12-Sep-2018 15:30:24 index e4c085f..19efe04 100644 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/ImageAnalysis/ImageRotator.cc build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/ImageAnalysis/ImageRotator.cc build 12-Sep-2018 15:30:24 @@ -95,7 +95,7 @@ SPIIF ImageRotator::rotate() { build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 IPosition axes2(pixelAxes); build 12-Sep-2018 15:30:24 - ImageRegridder regridder( build 12-Sep-2018 15:30:24 + ImageRegridder regridder( build 12-Sep-2018 15:30:24 subImage, nullptr, "", this->_getOutname(), build 12-Sep-2018 15:30:24 this->_getOverwrite(), cSysTo, axes2, _shape build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/PixelValueManipulator.h b/code/imageanalysis/ImageAnalysis/PixelValueManipulator.h build 12-Sep-2018 15:30:24 index fc230c2..eadc56b 100644 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/ImageAnalysis/PixelValueManipulator.h build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/ImageAnalysis/PixelValueManipulator.h build 12-Sep-2018 15:30:24 @@ -6,7 +6,6 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 namespace casa { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 template class PixelValueManipulator : public ImageTask { build 12-Sep-2018 15:30:24 @@ -44,25 +43,29 @@ public: build 12-Sep-2018 15:30:24 PixelValueManipulator() = delete; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // regionRec = 0 => no region selected, full image used build 12-Sep-2018 15:30:24 - // mask = "" => No additional mask specification, although image default mask will be used build 12-Sep-2018 15:30:24 - // if one exists. build 12-Sep-2018 15:30:24 + // mask = "" => No additional mask specification, although image default build 12-Sep-2018 15:30:24 + // mask will be used if one exists. build 12-Sep-2018 15:30:24 PixelValueManipulator( build 12-Sep-2018 15:30:24 const SPCIIT image, const casacore::Record *const regionRec, build 12-Sep-2018 15:30:24 - const casacore::String& mask, casacore::Bool verboseDuringConstruction=true build 12-Sep-2018 15:30:24 + const casacore::String& mask, build 12-Sep-2018 15:30:24 + casacore::Bool verboseDuringConstruction=casacore::True build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 ~PixelValueManipulator() {} build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 static void addNoise( build 12-Sep-2018 15:30:24 - SPIIT image, const casacore::String& type, const casacore::Record& region, const casacore::Vector& pars, build 12-Sep-2018 15:30:24 - casacore::Bool zero, const std::pair *const &seeds build 12-Sep-2018 15:30:24 + SPIIT image, const casacore::String& type, build 12-Sep-2018 15:30:24 + const casacore::Record& region, build 12-Sep-2018 15:30:24 + const casacore::Vector& pars, build 12-Sep-2018 15:30:24 + casacore::Bool zero, build 12-Sep-2018 15:30:24 + const std::pair *const &seeds build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // dirFrame and freqFrame are the codes for the build 12-Sep-2018 15:30:24 - // frames for which it is desired that the returned measures should be specified. build 12-Sep-2018 15:30:24 - // In both cases, one can specify "native" for the native coordinate frame, build 12-Sep-2018 15:30:24 - // "cl" for the conversion layer frame, or any valid frame string from casacore::MDirection::showType() build 12-Sep-2018 15:30:24 - // or casacore::MFrequency::showType(). build 12-Sep-2018 15:30:24 + // frames for which it is desired that the returned measures should be build 12-Sep-2018 15:30:24 + // specified. In both cases, one can specify "native" for the native build 12-Sep-2018 15:30:24 + // coordinate frame, "cl" for the conversion layer frame, or any valid frame build 12-Sep-2018 15:30:24 + // string from casacore::MDirection::showType() or MFrequency::showType(). build 12-Sep-2018 15:30:24 static casacore::Record* coordMeasures( build 12-Sep-2018 15:30:24 casacore::Quantum& intensity, casacore::Record& direction, build 12-Sep-2018 15:30:24 casacore::Record& frequency, casacore::Record& velocity, build 12-Sep-2018 15:30:24 @@ -106,53 +109,71 @@ public: build 12-Sep-2018 15:30:24 casacore::Bool usemask, casacore::Bool replicateArray build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // get the aggregated values along the specified pixel axis using the region and mask at construction build 12-Sep-2018 15:30:24 - // and any other mask the image may have. Supported values of function are (case-insensitive, build 12-Sep-2018 15:30:24 - // minimum match) those supported by ImageCollapser, ie "flux", "max", "mean", "median", "min", "rms", build 12-Sep-2018 15:30:24 - // "sqrtsum", "sqrtsum_npix", sqrtsum_npix_beam", "stddev", "sum", "variance", and "zero". Aggregation build 12-Sep-2018 15:30:24 - // of values occurs along all axes orthogonal to the one specified. One may specify the unit in which build 12-Sep-2018 15:30:24 - // coordinate values are calculated using the unit parameter. If unit starts with "pix", then build 12-Sep-2018 15:30:24 - // pixel coordinates are calculated, world coordinates otherwise. If pixel coordinates, the values are build 12-Sep-2018 15:30:24 - // relative to the zeroth pixel on the corresponding axis of the input image. If specified and it build 12-Sep-2018 15:30:24 - // doesn't start with "pix", the unit must be conformant with build 12-Sep-2018 15:30:24 - // the unit of axis in the coordinate system of the image, or it must be a unit that this axis build 12-Sep-2018 15:30:24 - // can be readily converted to (eg km/s if the axis is a frequency axis with base unit of Hz). build 12-Sep-2018 15:30:24 - // If the selected axis is the spectral axis and if the unit is chosen to be something other build 12-Sep-2018 15:30:24 - // than the native spectral coordinate unit (such as velocity or wavelength for a native frequency unit), build 12-Sep-2018 15:30:24 - // specType indicates the system to use when converting the frequency. Values of RELATVISTIC, build 12-Sep-2018 15:30:24 - // RADIO_VELOCITY, and OPTICAL_VELOCITY are only permitted if unit represents a velocity unit. build 12-Sep-2018 15:30:24 - // Values of WAVELENGTH and AIR_WAVELENGTH are only permitted if unit represents a length unit. build 12-Sep-2018 15:30:24 - // For a velocity unit, DEFAULT is equivalent to RELATIVISTIC. For a length unit, DEFAULT is equivalent to build 12-Sep-2018 15:30:24 - // WAVELENGTH. build 12-Sep-2018 15:30:24 - // If the selected axis is the spectral axis and unit is a velocity unit, build 12-Sep-2018 15:30:24 - // restFreq represents the rest frequency with respect to which the velocity scale should be build 12-Sep-2018 15:30:24 - // calculated. If null, the rest frequency associated with the spectral coordinate is used. build 12-Sep-2018 15:30:24 - // If the selected axis is the spectral axis, and unit is a frequency unit, build 12-Sep-2018 15:30:24 - // frame represents the frame of reference with respect to which the frequency scale should be build 12-Sep-2018 15:30:24 - // calculated. If empty, the reference frame associated with the spectral coordinate is used. build 12-Sep-2018 15:30:24 - // The return casacore::Record has the following keys: "values" is a casacore::Vector containing the aggregate pixel values, build 12-Sep-2018 15:30:24 - // "mask" is the associated mask values (casacore::Vector), "coords" is a casacore::Vector of coordinate values, build 12-Sep-2018 15:30:24 - // and "xUnit" is a casacore::String containing the coordinate unit, and "yUnit" is a string containing the build 12-Sep-2018 15:30:24 - // ordinate unit. build 12-Sep-2018 15:30:24 + // get the aggregated values along the specified pixel axis using the region build 12-Sep-2018 15:30:24 + // and mask at construction and any other mask the image may have. Supported build 12-Sep-2018 15:30:24 + // values of function are (case-insensitive, minimum match) those build 12-Sep-2018 15:30:24 + // supported by ImageCollapser, ie "flux", "max", "mean", "median", "min", build 12-Sep-2018 15:30:24 + // "rms", "sqrtsum", "sqrtsum_npix", sqrtsum_npix_beam", "stddev", "sum", build 12-Sep-2018 15:30:24 + // "variance", and "zero". Aggregation of values occurs along all axes build 12-Sep-2018 15:30:24 + // orthogonal to the one specified. One may specify the unit in which build 12-Sep-2018 15:30:24 + // coordinate values are calculated using the unit parameter. If build 12-Sep-2018 15:30:24 + // unit starts with "pix", then pixel coordinates are calculated, world build 12-Sep-2018 15:30:24 + // coordinates otherwise. If pixel coordinates, the values are relative to build 12-Sep-2018 15:30:24 + // the zeroth pixel on the corresponding axis of the input image. If build 12-Sep-2018 15:30:24 + // specified and it doesn't start with "pix", the unit must be conformant build 12-Sep-2018 15:30:24 + // with the unit of axis in the coordinate system of the image, build 12-Sep-2018 15:30:24 + // or it must be a unit that this axis can be readily converted to (eg km/s build 12-Sep-2018 15:30:24 + // if the axis is a frequency axis with base unit of Hz). If the selected build 12-Sep-2018 15:30:24 + // axis is the spectral axis and if the unit is chosen to be something other build 12-Sep-2018 15:30:24 + // than the native spectral coordinate unit (such as velocity or wavelength build 12-Sep-2018 15:30:24 + // for a native frequency unit), specType indicates the system to build 12-Sep-2018 15:30:24 + // use when converting the frequency. Values of RELATVISTIC, RADIO_VELOCITY, build 12-Sep-2018 15:30:24 + // and OPTICAL_VELOCITY are only permitted if unit represents a build 12-Sep-2018 15:30:24 + // velocity unit. Values of WAVELENGTH and AIR_WAVELENGTH are only permitted build 12-Sep-2018 15:30:24 + // if unit represents a length unit. For a velocity unit, DEFAULT build 12-Sep-2018 15:30:24 + // is equivalent to RELATIVISTIC. For a length unit, DEFAULT is equivalent build 12-Sep-2018 15:30:24 + // to WAVELENGTH. build 12-Sep-2018 15:30:24 + // If the selected axis is the spectral axis and unit is a build 12-Sep-2018 15:30:24 + // velocity unit, restFreq represents the rest frequency with build 12-Sep-2018 15:30:24 + // respect to which the velocity scale should be calculated. If null, the build 12-Sep-2018 15:30:24 + // rest frequency associated with the spectral coordinate is used. If the build 12-Sep-2018 15:30:24 + // selected axis is the spectral axis, and unit is a frequency build 12-Sep-2018 15:30:24 + // unit, frame represents the frame of reference with respect to build 12-Sep-2018 15:30:24 + // which the frequency scale should be calculated. If empty, the reference build 12-Sep-2018 15:30:24 + // frame associated with the spectral coordinate is used. The return Record build 12-Sep-2018 15:30:24 + // has the following keys: "values" is a casacore::Vector containing the build 12-Sep-2018 15:30:24 + // aggregate pixel values, "mask" is the associated mask values build 12-Sep-2018 15:30:24 + // (Vector), "coords" is a casacore::Vector of build 12-Sep-2018 15:30:24 + // coordinate values, and "xUnit" is a casacore::String containing the build 12-Sep-2018 15:30:24 + // coordinate unit, and "yUnit" is a string containing the ordinate unit. build 12-Sep-2018 15:30:24 casacore::Record getProfile( build 12-Sep-2018 15:30:24 - casacore::uInt axis, const casacore::String& function, const casacore::String& unit, build 12-Sep-2018 15:30:24 - PixelValueManipulatorData::SpectralType specType=PixelValueManipulatorData::DEFAULT, build 12-Sep-2018 15:30:24 - const casacore::Quantity *const restFreq=nullptr, const casacore::String& frame="" build 12-Sep-2018 15:30:24 + casacore::uInt axis, const casacore::String& function, build 12-Sep-2018 15:30:24 + const casacore::String& unit, build 12-Sep-2018 15:30:24 + PixelValueManipulatorData::SpectralType specType build 12-Sep-2018 15:30:24 + =PixelValueManipulatorData::DEFAULT, build 12-Sep-2018 15:30:24 + const casacore::Quantity *const restFreq=nullptr, build 12-Sep-2018 15:30:24 + const casacore::String& frame="" build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 casacore::Record getProfile( build 12-Sep-2018 15:30:24 - casacore::uInt axis, ImageCollapserData::AggregateType function, const casacore::String& unit, build 12-Sep-2018 15:30:24 - PixelValueManipulatorData::SpectralType specType=PixelValueManipulatorData::DEFAULT, build 12-Sep-2018 15:30:24 - const casacore::Quantity *const restFreq=nullptr, const casacore::String& frame="" build 12-Sep-2018 15:30:24 + casacore::uInt axis, ImageCollapserData::AggregateType function, build 12-Sep-2018 15:30:24 + const casacore::String& unit, build 12-Sep-2018 15:30:24 + PixelValueManipulatorData::SpectralType specType build 12-Sep-2018 15:30:24 + =PixelValueManipulatorData::DEFAULT, build 12-Sep-2018 15:30:24 + const casacore::Quantity *const restFreq=nullptr, build 12-Sep-2018 15:30:24 + const casacore::String& frame="" build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 casacore::String getClass() const { return _className; } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // region refers to the region in the image to be inserted, not the build 12-Sep-2018 15:30:24 - // region that was chosen at object construction build 12-Sep-2018 15:30:24 + // region refers to the region in the image to be inserted, not the region build 12-Sep-2018 15:30:24 + // that was chosen at object construction build 12-Sep-2018 15:30:24 static void insert( build 12-Sep-2018 15:30:24 - casacore::ImageInterface& target, const casacore::ImageInterface& image, const casacore::Record& region, build 12-Sep-2018 15:30:24 - const casacore::Vector& locatePixel, casacore::Bool verbose build 12-Sep-2018 15:30:24 + casacore::ImageInterface& target, build 12-Sep-2018 15:30:24 + const casacore::ImageInterface& image, build 12-Sep-2018 15:30:24 + const casacore::Record& region, build 12-Sep-2018 15:30:24 + const casacore::Vector& locatePixel, build 12-Sep-2018 15:30:24 + casacore::Bool verbose build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Make a block of regions from a Record build 12-Sep-2018 15:30:24 @@ -163,17 +184,20 @@ public: build 12-Sep-2018 15:30:24 const casacore::Record& Regions build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - casacore::Record pixelValue(const casacore::Vector& pixel) const; build 12-Sep-2018 15:30:24 + casacore::Record pixelValue( build 12-Sep-2018 15:30:24 + const casacore::Vector& pixel build 12-Sep-2018 15:30:24 + ) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void pixelValue( build 12-Sep-2018 15:30:24 - casacore::Bool& offImage, casacore::Quantum& value, casacore::Bool& mask, build 12-Sep-2018 15:30:24 - casacore::Vector& pos build 12-Sep-2018 15:30:24 + casacore::Bool& offImage, casacore::Quantum& value, build 12-Sep-2018 15:30:24 + casacore::Bool& mask, casacore::Vector& pos build 12-Sep-2018 15:30:24 ) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // set specified pixels or mask equal to provided scalar value build 12-Sep-2018 15:30:24 static casacore::Bool set( build 12-Sep-2018 15:30:24 - SPIIF image, const casacore::String& pixels, const casacore::Int pixelmask, build 12-Sep-2018 15:30:24 - casacore::Record& region, const casacore::Bool list = false build 12-Sep-2018 15:30:24 + SPIIF image, const casacore::String& pixels, build 12-Sep-2018 15:30:24 + const casacore::Int pixelmask, casacore::Record& region, build 12-Sep-2018 15:30:24 + const casacore::Bool list = false build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // set region name for logging purposes. Only used if the logfile is set. build 12-Sep-2018 15:30:24 @@ -206,19 +230,24 @@ private: build 12-Sep-2018 15:30:24 casacore::uInt axis, const casacore::String& function, Operator op build 12-Sep-2018 15:30:24 ) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SPIIT _doSingle(casacore::uInt axis, const casacore::String& function) const; build 12-Sep-2018 15:30:24 + SPIIT _doSingle( build 12-Sep-2018 15:30:24 + casacore::uInt axis, const casacore::String& function build 12-Sep-2018 15:30:24 + ) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 casacore::Record _doWorld( build 12-Sep-2018 15:30:24 SPIIT collapsed, const casacore::String& unit, build 12-Sep-2018 15:30:24 PixelValueManipulatorData::SpectralType specType, build 12-Sep-2018 15:30:24 - const casacore::Quantity *const restFreq, const casacore::String& frame, build 12-Sep-2018 15:30:24 + const casacore::Quantity *const restFreq, const casacore::String& frame, build 12-Sep-2018 15:30:24 casacore::uInt axis build 12-Sep-2018 15:30:24 ) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void _doNoncomformantUnit( build 12-Sep-2018 15:30:24 - casacore::Vector& coords, const casacore::CoordinateSystem& csys, build 12-Sep-2018 15:30:24 - const casacore::String& unit, PixelValueManipulatorData::SpectralType specType, build 12-Sep-2018 15:30:24 - const casacore::Quantity *const restFreq, const casacore::String& axisUnit build 12-Sep-2018 15:30:24 + casacore::Vector& coords, build 12-Sep-2018 15:30:24 + const casacore::CoordinateSystem& csys, build 12-Sep-2018 15:30:24 + const casacore::String& unit, build 12-Sep-2018 15:30:24 + PixelValueManipulatorData::SpectralType specType, build 12-Sep-2018 15:30:24 + const casacore::Quantity *const restFreq, build 12-Sep-2018 15:30:24 + const casacore::String& axisUnit build 12-Sep-2018 15:30:24 ) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 casacore::Vector _npts(casacore::uInt axis) const; build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/PixelValueManipulator.tcc b/code/imageanalysis/ImageAnalysis/PixelValueManipulator.tcc build 12-Sep-2018 15:30:24 index b267156..b9c2766 100644 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/ImageAnalysis/PixelValueManipulator.tcc build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/ImageAnalysis/PixelValueManipulator.tcc build 12-Sep-2018 15:30:24 @@ -165,8 +165,10 @@ template casacore::Record PixelValueManipulator::get() const { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 template Record PixelValueManipulator::getProfile( build 12-Sep-2018 15:30:24 uInt axis, ImageCollapserData::AggregateType function, build 12-Sep-2018 15:30:24 - const String& unit, PixelValueManipulatorData::SpectralType specType, build 12-Sep-2018 15:30:24 - const Quantity *const restFreq, const String& frame build 12-Sep-2018 15:30:24 + const casacore::String& unit, build 12-Sep-2018 15:30:24 + PixelValueManipulatorData::SpectralType specType, build 12-Sep-2018 15:30:24 + const casacore::Quantity *const restFreq, build 12-Sep-2018 15:30:24 + const casacore::String& frame build 12-Sep-2018 15:30:24 ) { build 12-Sep-2018 15:30:24 return getProfile( build 12-Sep-2018 15:30:24 axis, ImageCollapserData::minMatchMap()->at((uInt)function), build 12-Sep-2018 15:30:24 @@ -175,9 +177,10 @@ template Record PixelValueManipulator::getProfile( build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 template Record PixelValueManipulator::getProfile( build 12-Sep-2018 15:30:24 - uInt axis, const String& function, build 12-Sep-2018 15:30:24 - const String& unit, PixelValueManipulatorData::SpectralType specType, build 12-Sep-2018 15:30:24 - const Quantity *const restFreq, const String& frame build 12-Sep-2018 15:30:24 + casacore::uInt axis, const casacore::String& function, build 12-Sep-2018 15:30:24 + const casacore::String& unit, build 12-Sep-2018 15:30:24 + PixelValueManipulatorData::SpectralType specType, build 12-Sep-2018 15:30:24 + const casacore::Quantity *const restFreq, const casacore::String& frame build 12-Sep-2018 15:30:24 ) { build 12-Sep-2018 15:30:24 SPIIT collapsed; build 12-Sep-2018 15:30:24 Operator op = NONE; build 12-Sep-2018 15:30:24 @@ -243,7 +246,7 @@ template Record PixelValueManipulator::getProfile( build 12-Sep-2018 15:30:24 axisName = "Velocity"; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 auto imageName = this->_getImage()->name(); build 12-Sep-2018 15:30:24 - ostringstream oss; build 12-Sep-2018 15:30:24 + std::ostringstream oss; build 12-Sep-2018 15:30:24 oss << "#title: " << axisName build 12-Sep-2018 15:30:24 << " profile - " << imageName << endl; build 12-Sep-2018 15:30:24 if (! _regionName.empty()) { build 12-Sep-2018 15:30:24 @@ -252,11 +255,11 @@ template Record PixelValueManipulator::getProfile( build 12-Sep-2018 15:30:24 oss << "#xUnit " << xunit.getUnit() << endl; build 12-Sep-2018 15:30:24 oss << "#yUnit " << ret.asString("yUnit") << endl; build 12-Sep-2018 15:30:24 oss << "# " << imageName << endl << endl; build 12-Sep-2018 15:30:24 - Vector data; build 12-Sep-2018 15:30:24 + casacore::Vector data; build 12-Sep-2018 15:30:24 ret.get("values", data); build 12-Sep-2018 15:30:24 - Vector mask; build 12-Sep-2018 15:30:24 + casacore::Vector mask; build 12-Sep-2018 15:30:24 ret.get("mask", mask); build 12-Sep-2018 15:30:24 - Vector xvals = ret.asArrayDouble("coords"); build 12-Sep-2018 15:30:24 + casacore::Vector xvals = ret.asArrayDouble("coords"); build 12-Sep-2018 15:30:24 auto citer = xvals.begin(); build 12-Sep-2018 15:30:24 auto miter = mask.begin(); build 12-Sep-2018 15:30:24 for (const auto& d : data) { build 12-Sep-2018 15:30:24 @@ -273,17 +276,17 @@ template Record PixelValueManipulator::getProfile( build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 template SPIIT PixelValueManipulator::_doComposite( build 12-Sep-2018 15:30:24 - uInt axis, const String& function, Operator op build 12-Sep-2018 15:30:24 + casacore::uInt axis, const casacore::String& function, Operator op build 12-Sep-2018 15:30:24 ) const { build 12-Sep-2018 15:30:24 - String x = op == ADDITION ? "+" build 12-Sep-2018 15:30:24 + auto x = op == ADDITION ? "+" build 12-Sep-2018 15:30:24 : op == SUBTRACTION ? "-" build 12-Sep-2018 15:30:24 : op == MULTIPLICATION ? "*" build 12-Sep-2018 15:30:24 : "/"; build 12-Sep-2018 15:30:24 // have to make a copy, because after not const :( build 12-Sep-2018 15:30:24 auto f = function; build 12-Sep-2018 15:30:24 - String func0 = f.before(x); build 12-Sep-2018 15:30:24 + casacore::String func0 = f.before(x); build 12-Sep-2018 15:30:24 func0.trim(); build 12-Sep-2018 15:30:24 - String func1 = f.after(x); build 12-Sep-2018 15:30:24 + casacore::String func1 = f.after(x); build 12-Sep-2018 15:30:24 func1.trim(); build 12-Sep-2018 15:30:24 auto im0 = _doSingle(axis, func0); build 12-Sep-2018 15:30:24 auto im1 = func0 == func1 ? im0 : _doSingle(axis, func1); build 12-Sep-2018 15:30:24 @@ -295,28 +298,30 @@ template SPIIT PixelValueManipulator::_doComposite( build 12-Sep-2018 15:30:24 ret->copyData(data); build 12-Sep-2018 15:30:24 auto unit0 = im0->units(); build 12-Sep-2018 15:30:24 auto unit1 = im1->units(); build 12-Sep-2018 15:30:24 - Unit outUnit; build 12-Sep-2018 15:30:24 + casacore::Unit outUnit; build 12-Sep-2018 15:30:24 if (op == ADDITION || op == SUBTRACTION) { build 12-Sep-2018 15:30:24 if (unit1 == unit0) { build 12-Sep-2018 15:30:24 outUnit = unit0; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 - *this->_getLog() << LogIO::WARN << "Units incompatible for this operation, setting output image " build 12-Sep-2018 15:30:24 - << " brightness unit to empty" << LogIO::POST; build 12-Sep-2018 15:30:24 + *this->_getLog() << LogIO::WARN build 12-Sep-2018 15:30:24 + << "Units incompatible for this operation, setting output " build 12-Sep-2018 15:30:24 + << "image brightness unit to empty" << LogIO::POST; build 12-Sep-2018 15:30:24 outUnit = Unit(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 - Quantity q0(1, unit0); build 12-Sep-2018 15:30:24 - Quantity q1(1, unit1); build 12-Sep-2018 15:30:24 - outUnit = op == MULTIPLICATION ? (q0*q1).getFullUnit() : (q0/q1).getFullUnit(); build 12-Sep-2018 15:30:24 + casacore::Quantity q0(1, unit0); build 12-Sep-2018 15:30:24 + casacore::Quantity q1(1, unit1); build 12-Sep-2018 15:30:24 + outUnit = op == MULTIPLICATION build 12-Sep-2018 15:30:24 + ? (q0*q1).getFullUnit() : (q0/q1).getFullUnit(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 ret->setUnits(outUnit); build 12-Sep-2018 15:30:24 return ret; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 template SPIIT PixelValueManipulator::_doSingle( build 12-Sep-2018 15:30:24 - uInt axis, const String& function build 12-Sep-2018 15:30:24 + casacore::uInt axis, const casacore::String& function build 12-Sep-2018 15:30:24 ) const { build 12-Sep-2018 15:30:24 ImageCollapser collapser( build 12-Sep-2018 15:30:24 function, this->_getImage(), this->_getRegion(), build 12-Sep-2018 15:30:24 @@ -326,7 +331,10 @@ template SPIIT PixelValueManipulator::_doSingle( build 12-Sep-2018 15:30:24 return collapser.collapse(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -template casacore::Vector PixelValueManipulator::_npts(casacore::uInt axis) const { build 12-Sep-2018 15:30:24 +template build 12-Sep-2018 15:30:24 +casacore::Vector PixelValueManipulator::_npts( build 12-Sep-2018 15:30:24 + casacore::uInt axis build 12-Sep-2018 15:30:24 +) const { build 12-Sep-2018 15:30:24 auto subim = SubImageFactory::createSubImageRO( build 12-Sep-2018 15:30:24 *this->_getImage(), *this->_getRegion(), this->_getMask(), build 12-Sep-2018 15:30:24 this->_getLog().get(), AxesSpecifier(), this->_getStretch() build 12-Sep-2018 15:30:24 @@ -351,58 +359,54 @@ template casacore::Vector PixelValueManipulator::_np build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 template casacore::Record* PixelValueManipulator::getSlice( build 12-Sep-2018 15:30:24 - SPCIIT image, const casacore::Vector& x, const casacore::Vector& y, build 12-Sep-2018 15:30:24 - const casacore::Vector& axes, const casacore::Vector& coord, casacore::Int npts, build 12-Sep-2018 15:30:24 + SPCIIT image, const casacore::Vector& x, build 12-Sep-2018 15:30:24 + const casacore::Vector& y, build 12-Sep-2018 15:30:24 + const casacore::Vector& axes, build 12-Sep-2018 15:30:24 + const casacore::Vector& coord, Int npts, build 12-Sep-2018 15:30:24 const casacore::String& method build 12-Sep-2018 15:30:24 ) { build 12-Sep-2018 15:30:24 - casacore::Vector xPos; build 12-Sep-2018 15:30:24 - casacore::Vector yPos; build 12-Sep-2018 15:30:24 - casacore::Vector distance; build 12-Sep-2018 15:30:24 + casacore::Vector xPos, yPos, distance; build 12-Sep-2018 15:30:24 casacore::Vector pixels; build 12-Sep-2018 15:30:24 casacore::Vector pixelMask; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Construct PixelCurve. FIll in defaults for x, y vectors build 12-Sep-2018 15:30:24 casacore::PixelCurve1D curve(x, y, npts); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Set coordinates build 12-Sep-2018 15:30:24 casacore::IPosition iCoord(coord); build 12-Sep-2018 15:30:24 casacore::IPosition iAxes(axes); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Get the Slice build 12-Sep-2018 15:30:24 auto method2 = casacore::LatticeSlice1D::stringToMethod(method); build 12-Sep-2018 15:30:24 casacore::LatticeSlice1D slicer(*image, method2); build 12-Sep-2018 15:30:24 slicer.getSlice(pixels, pixelMask, curve, iAxes(0), iAxes(1), iCoord); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Get slice locations build 12-Sep-2018 15:30:24 casacore::uInt axis0, axis1; build 12-Sep-2018 15:30:24 slicer.getPosition(axis0, axis1, xPos, yPos, distance); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 casacore::RecordDesc outRecDesc; build 12-Sep-2018 15:30:24 - outRecDesc.addField("pixel", TpArrayFloat); build 12-Sep-2018 15:30:24 + outRecDesc.addField("pixel", asArray(image->dataType())); build 12-Sep-2018 15:30:24 outRecDesc.addField("mask", TpArrayBool); build 12-Sep-2018 15:30:24 outRecDesc.addField("xpos", TpArrayFloat); build 12-Sep-2018 15:30:24 outRecDesc.addField("ypos", TpArrayFloat); build 12-Sep-2018 15:30:24 outRecDesc.addField("distance", TpArrayFloat); build 12-Sep-2018 15:30:24 outRecDesc.addField("axes", TpArrayInt); build 12-Sep-2018 15:30:24 - casacore::Record *outRec = new casacore::Record(outRecDesc); build 12-Sep-2018 15:30:24 + auto *outRec = new casacore::Record(outRecDesc); build 12-Sep-2018 15:30:24 outRec->define("pixel", pixels); build 12-Sep-2018 15:30:24 outRec->define("mask", pixelMask); build 12-Sep-2018 15:30:24 outRec->define("xpos", xPos); build 12-Sep-2018 15:30:24 outRec->define("ypos", yPos); build 12-Sep-2018 15:30:24 outRec->define("distance", distance); build 12-Sep-2018 15:30:24 - outRec->define("axes", casacore::Vector(vector {axis0, axis1})); build 12-Sep-2018 15:30:24 + outRec->define("axes", Vector(vector {axis0, axis1})); build 12-Sep-2018 15:30:24 return outRec; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 template void PixelValueManipulator::insert( build 12-Sep-2018 15:30:24 - casacore::ImageInterface& target, const casacore::ImageInterface& infile, const casacore::Record& region, build 12-Sep-2018 15:30:24 + casacore::ImageInterface& target, build 12-Sep-2018 15:30:24 + const casacore::ImageInterface& infile, const casacore::Record& region, build 12-Sep-2018 15:30:24 const casacore::Vector& locatePixel, casacore::Bool verbose build 12-Sep-2018 15:30:24 ) { build 12-Sep-2018 15:30:24 auto doRef = locatePixel.empty(); build 12-Sep-2018 15:30:24 casacore::Int dbg = 0; build 12-Sep-2018 15:30:24 auto inSub = SubImageFactory::createSubImageRO( build 12-Sep-2018 15:30:24 infile, region, "", build 12-Sep-2018 15:30:24 - verbose ? std::unique_ptr(new casacore::LogIO()).get() : nullptr build 12-Sep-2018 15:30:24 + verbose build 12-Sep-2018 15:30:24 + ? std::unique_ptr(new casacore::LogIO()).get() build 12-Sep-2018 15:30:24 + : nullptr build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Generate output pixel location build 12-Sep-2018 15:30:24 @@ -411,7 +415,6 @@ template void PixelValueManipulator::insert( build 12-Sep-2018 15:30:24 const auto nDim = target.ndim(); build 12-Sep-2018 15:30:24 casacore::Vector outPix(doRef ? 0 : nDim); build 12-Sep-2018 15:30:24 const auto nDim2 = locatePixel.size(); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 if (! doRef) { build 12-Sep-2018 15:30:24 for (casacore::uInt i = 0; i < nDim; ++i) { build 12-Sep-2018 15:30:24 outPix[i] = i < nDim2 ? locatePixel[i] build 12-Sep-2018 15:30:24 @@ -431,7 +434,8 @@ template casacore::Record PixelValueManipulator::_doWorld( build 12-Sep-2018 15:30:24 ) const { build 12-Sep-2018 15:30:24 // drop degenerate axes build 12-Sep-2018 15:30:24 SPIIT tmp = SubImageFactory::createImage( build 12-Sep-2018 15:30:24 - *collapsed, "", casacore::Record(), "", casacore::AxesSpecifier(casacore::IPosition(1, axis)), build 12-Sep-2018 15:30:24 + *collapsed, "", casacore::Record(), "", build 12-Sep-2018 15:30:24 + casacore::AxesSpecifier(casacore::IPosition(1, axis)), build 12-Sep-2018 15:30:24 false, false, false build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 const casacore::CoordinateSystem csys = tmp->coordinates(); build 12-Sep-2018 15:30:24 @@ -477,7 +481,9 @@ template casacore::Record PixelValueManipulator::_doWorld( build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 if (! unit.empty() && unit != axisUnit) { build 12-Sep-2018 15:30:24 if (t.isConform(axisUnit)) { build 12-Sep-2018 15:30:24 - casacore::Quantum > q(coords, axisUnit); build 12-Sep-2018 15:30:24 + casacore::Quantum> q( build 12-Sep-2018 15:30:24 + coords, axisUnit build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 coords = q.getValue(unit); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 @@ -493,8 +499,9 @@ template casacore::Record PixelValueManipulator::_doWorld( build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 template void PixelValueManipulator::_doNoncomformantUnit( build 12-Sep-2018 15:30:24 - casacore::Vector& coords, const casacore::CoordinateSystem& csys, build 12-Sep-2018 15:30:24 - const casacore::String& unit, PixelValueManipulatorData::SpectralType specType, build 12-Sep-2018 15:30:24 + casacore::Vector& coords, build 12-Sep-2018 15:30:24 + const casacore::CoordinateSystem& csys, const casacore::String& unit, build 12-Sep-2018 15:30:24 + PixelValueManipulatorData::SpectralType specType, build 12-Sep-2018 15:30:24 const casacore::Quantity *const restFreq, const casacore::String& axisUnit build 12-Sep-2018 15:30:24 ) const { build 12-Sep-2018 15:30:24 ThrowIf( build 12-Sep-2018 15:30:24 @@ -583,11 +590,13 @@ template void PixelValueManipulator::_checkUnit( build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 template void PixelValueManipulator::put( build 12-Sep-2018 15:30:24 - SPIIT image, const casacore::Array& pixelsArray, const casacore::Vector& blc, build 12-Sep-2018 15:30:24 - const casacore::Vector& inc, casacore::Bool list, casacore::Bool locking, casacore::Bool replicate build 12-Sep-2018 15:30:24 + SPIIT image, const casacore::Array& pixelsArray, build 12-Sep-2018 15:30:24 + const casacore::Vector& blc, build 12-Sep-2018 15:30:24 + const casacore::Vector& inc, build 12-Sep-2018 15:30:24 + casacore::Bool list, casacore::Bool locking, casacore::Bool replicate build 12-Sep-2018 15:30:24 ) { build 12-Sep-2018 15:30:24 casacore::IPosition imageShape = image->shape(); build 12-Sep-2018 15:30:24 - casacore::uInt ndim = imageShape.nelements(); build 12-Sep-2018 15:30:24 + casacore::uInt ndim = imageShape.size(); build 12-Sep-2018 15:30:24 ThrowIf( build 12-Sep-2018 15:30:24 pixelsArray.ndim() > ndim, build 12-Sep-2018 15:30:24 "Pixel array cannot have more dimensions than the image!" build 12-Sep-2018 15:30:24 @@ -623,7 +632,6 @@ template void PixelValueManipulator::put( build 12-Sep-2018 15:30:24 << casacore::LogIO::NORMAL << "Selected bounding box " << sl.start() build 12-Sep-2018 15:30:24 << " to " << sl.end() << casacore::LogIO::POST; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Put the pixels build 12-Sep-2018 15:30:24 if (pixelsArray.ndim() == ndim) { build 12-Sep-2018 15:30:24 // _setCache(pixelsArray.shape()); build 12-Sep-2018 15:30:24 @@ -657,14 +665,13 @@ template void PixelValueManipulator::put( build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -template casacore::Bool PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:24 +template Bool PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:24 SPIIT image, const casacore::Array& pixels, build 12-Sep-2018 15:30:24 - const casacore::Array& mask, casacore::Record& region, casacore::Bool list, build 12-Sep-2018 15:30:24 - casacore::Bool usemask, casacore::Bool replicateArray build 12-Sep-2018 15:30:24 + const casacore::Array& mask, casacore::Record& region, build 12-Sep-2018 15:30:24 + casacore::Bool list, casacore::Bool usemask, casacore::Bool replicateArray build 12-Sep-2018 15:30:24 ) { build 12-Sep-2018 15:30:24 // used to verify array dimension build 12-Sep-2018 15:30:24 auto imageNDim = image->ndim(); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Checks on pixels dimensions build 12-Sep-2018 15:30:24 auto pixelShape = pixels.shape(); build 12-Sep-2018 15:30:24 auto pixelNDim = pixels.ndim(); build 12-Sep-2018 15:30:24 @@ -678,10 +685,9 @@ template casacore::Bool PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:24 "The shape of the pixels array is invalid" build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Checks on pixelmask dimensions build 12-Sep-2018 15:30:24 - casacore::Vector maskShape = mask.shape().asVector(); build 12-Sep-2018 15:30:24 - casacore::uInt maskNDim = mask.ndim(); build 12-Sep-2018 15:30:24 + auto maskShape = mask.shape().asVector(); build 12-Sep-2018 15:30:24 + auto maskNDim = mask.ndim(); build 12-Sep-2018 15:30:24 ThrowIf( build 12-Sep-2018 15:30:24 maskNDim > imageNDim, build 12-Sep-2018 15:30:24 "Mask array has more axes than the image" build 12-Sep-2018 15:30:24 @@ -692,14 +698,12 @@ template casacore::Bool PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:24 "The shape of the pixelmask array is invalid" build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Warning, an empty casacore::Array comes through the Glish tasking system build 12-Sep-2018 15:30:24 // as shape = [0], ndim = 1, nelements = 0 build 12-Sep-2018 15:30:24 casacore::IPosition dataShape; build 12-Sep-2018 15:30:24 casacore::uInt dataDim = 0; build 12-Sep-2018 15:30:24 auto pixelElements = pixels.size(); build 12-Sep-2018 15:30:24 auto maskElements = mask.size(); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 if (pixelElements != 0 && maskElements != 0) { build 12-Sep-2018 15:30:24 ThrowIf( build 12-Sep-2018 15:30:24 ! pixels.shape().isEqual(mask.shape()), build 12-Sep-2018 15:30:24 @@ -759,18 +763,18 @@ template casacore::Bool PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // If our image doesn't have a mask, try and make it one. build 12-Sep-2018 15:30:24 if (maskElements > 0) { build 12-Sep-2018 15:30:24 if (! image->hasPixelMask()) { build 12-Sep-2018 15:30:24 casacore::String maskName(""); build 12-Sep-2018 15:30:24 - ImageMaskAttacher::makeMask(*image, maskName, true, true, mylog, list); build 12-Sep-2018 15:30:24 + ImageMaskAttacher::makeMask( build 12-Sep-2018 15:30:24 + *image, maskName, true, true, mylog, list build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 if (! image->isMasked()) { build 12-Sep-2018 15:30:24 usemask = false; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Put the mask first build 12-Sep-2018 15:30:24 if (maskElements > 0 && image->hasPixelMask()) { build 12-Sep-2018 15:30:24 casacore::Lattice& maskOut = image->pixelMask(); build 12-Sep-2018 15:30:24 @@ -790,7 +794,9 @@ template casacore::Bool PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:24 mylog << casacore::LogIO::NORMAL build 12-Sep-2018 15:30:24 << "Padding mask array with degenerate axes" build 12-Sep-2018 15:30:24 << casacore::LogIO::POST; build 12-Sep-2018 15:30:24 - casacore::Array maskref(mask.addDegenerate(imageNDim - mask.ndim())); build 12-Sep-2018 15:30:24 + casacore::Array maskref( build 12-Sep-2018 15:30:24 + mask.addDegenerate(imageNDim - mask.ndim()) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 if (replicateArray) { build 12-Sep-2018 15:30:24 casacore::LatticeUtilities::replicate( build 12-Sep-2018 15:30:24 maskOut, latRegion.slicer(), build 12-Sep-2018 15:30:24 @@ -803,17 +809,18 @@ template casacore::Bool PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 - ThrowCc("The mask is not writable. Probably an ImageExpr or SubImage"); build 12-Sep-2018 15:30:24 + ThrowCc( build 12-Sep-2018 15:30:24 + "The mask is not writable. Probably an ImageExpr or SubImage" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Get the mask and data from disk if we need it build 12-Sep-2018 15:30:24 casacore::Array oldMask; build 12-Sep-2018 15:30:24 - casacore::Array oldData; build 12-Sep-2018 15:30:24 + casacore::Array oldData; build 12-Sep-2018 15:30:24 casacore::Bool deleteOldMask, deleteOldData, deleteNewData; build 12-Sep-2018 15:30:24 - const casacore::Bool* pOldMask = 0; build 12-Sep-2018 15:30:24 - const casacore::Float* pOldData = 0; build 12-Sep-2018 15:30:24 - const casacore::Float* pNewData = 0; build 12-Sep-2018 15:30:24 + const casacore::Bool* pOldMask = nullptr; build 12-Sep-2018 15:30:24 + const T* pOldData = nullptr; build 12-Sep-2018 15:30:24 + const T* pNewData = nullptr; build 12-Sep-2018 15:30:24 if (pixelElements > 0 && usemask) { build 12-Sep-2018 15:30:24 if (pixelNDim != imageNDim) { build 12-Sep-2018 15:30:24 pixelShape.append(casacore::IPosition(imageNDim - pixelNDim, 1)); build 12-Sep-2018 15:30:24 @@ -828,14 +835,13 @@ template casacore::Bool PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:24 pOldMask = oldMask.getStorage(deleteOldMask); // From disk build 12-Sep-2018 15:30:24 pNewData = pixels.getStorage(deleteNewData); // From user build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Put the pixels build 12-Sep-2018 15:30:24 if (dataDim == imageNDim) { build 12-Sep-2018 15:30:24 if (pixelElements > 0) { build 12-Sep-2018 15:30:24 if (usemask) { build 12-Sep-2018 15:30:24 - casacore::Bool deleteNewData2; build 12-Sep-2018 15:30:24 - casacore::Array pixels2(pixelShape); build 12-Sep-2018 15:30:24 - casacore::Float* pNewData2 = pixels2.getStorage(deleteNewData2); build 12-Sep-2018 15:30:24 + Bool deleteNewData2; build 12-Sep-2018 15:30:24 + Array pixels2(pixelShape); build 12-Sep-2018 15:30:24 + T* pNewData2 = pixels2.getStorage(deleteNewData2); build 12-Sep-2018 15:30:24 for (casacore::uInt i = 0; i < pixels2.nelements(); i++) { build 12-Sep-2018 15:30:24 pNewData2[i] = pNewData[i]; // Value user gives build 12-Sep-2018 15:30:24 if (!pOldMask[i]) { build 12-Sep-2018 15:30:24 @@ -844,7 +850,7 @@ template casacore::Bool PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 pixels2.putStorage(pNewData2, deleteNewData2); build 12-Sep-2018 15:30:24 if (replicateArray) { build 12-Sep-2018 15:30:24 - casacore::LatticeUtilities::replicate( build 12-Sep-2018 15:30:24 + LatticeUtilities::replicate( build 12-Sep-2018 15:30:24 *image, latRegion.slicer(), pixels2 build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -872,10 +878,10 @@ template casacore::Bool PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:24 << casacore::LogIO::POST; build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 if (usemask) { build 12-Sep-2018 15:30:24 - casacore::Bool deleteNewData2; build 12-Sep-2018 15:30:24 - casacore::Array pixels2(pixelShape); build 12-Sep-2018 15:30:24 - casacore::Float* pNewData2 = pixels2.getStorage(deleteNewData2); build 12-Sep-2018 15:30:24 - for (casacore::uInt i = 0; i < pixels2.nelements(); i++) { build 12-Sep-2018 15:30:24 + Bool deleteNewData2; build 12-Sep-2018 15:30:24 + Array pixels2(pixelShape); build 12-Sep-2018 15:30:24 + T* pNewData2 = pixels2.getStorage(deleteNewData2); build 12-Sep-2018 15:30:24 + for (uInt i = 0; i < pixels2.nelements(); i++) { build 12-Sep-2018 15:30:24 pNewData2[i] = pNewData[i]; // Value user gives build 12-Sep-2018 15:30:24 if (!pOldMask[i]) { build 12-Sep-2018 15:30:24 pNewData2[i] = pOldData[i]; // Value on disk build 12-Sep-2018 15:30:24 @@ -892,7 +898,7 @@ template casacore::Bool PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 - casacore::Array pixelsref( build 12-Sep-2018 15:30:24 + Array pixelsref( build 12-Sep-2018 15:30:24 pixels.addDegenerate(imageNDim - pixels.ndim()) build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 if (replicateArray) { build 12-Sep-2018 15:30:24 @@ -906,7 +912,6 @@ template casacore::Bool PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 if (pOldMask != 0) { build 12-Sep-2018 15:30:24 oldMask.freeStorage(pOldMask, deleteOldMask); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -920,30 +925,27 @@ template casacore::Bool PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 template casacore::Bool PixelValueManipulator::set( build 12-Sep-2018 15:30:24 - SPIIF image, const casacore::String& lespixels, const casacore::Int pixelmask, build 12-Sep-2018 15:30:24 - casacore::Record& p_Region, const casacore::Bool list build 12-Sep-2018 15:30:24 + SPIIF image, const casacore::String& lespixels, build 12-Sep-2018 15:30:24 + const casacore::Int pixelmask, casacore::Record& p_Region, build 12-Sep-2018 15:30:24 + const casacore::Bool list build 12-Sep-2018 15:30:24 ) { build 12-Sep-2018 15:30:24 casacore::LogIO mylog; build 12-Sep-2018 15:30:24 mylog << casacore::LogOrigin(_className, __func__); build 12-Sep-2018 15:30:24 auto setPixels = ! lespixels.empty(); build 12-Sep-2018 15:30:24 auto pixels = setPixels ? lespixels : "0.0"; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 auto setMask = pixelmask != -1; build 12-Sep-2018 15:30:24 auto mask = setMask ? pixelmask > 0 : true; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 if (!setPixels && !setMask) { build 12-Sep-2018 15:30:24 - mylog << casacore::LogIO::WARN << "Nothing to do" << casacore::LogIO::POST; build 12-Sep-2018 15:30:24 + mylog << casacore::LogIO::WARN << "Nothing to do" build 12-Sep-2018 15:30:24 + << casacore::LogIO::POST; build 12-Sep-2018 15:30:24 return false; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 casacore::Record tempRegions; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Try and make a mask if we need one. build 12-Sep-2018 15:30:24 if (setMask && ! image->isMasked()) { build 12-Sep-2018 15:30:24 casacore::String maskName(""); build 12-Sep-2018 15:30:24 ImageMaskAttacher::makeMask(*image, maskName, true, true, mylog, list); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Make region and subimage build 12-Sep-2018 15:30:24 std::unique_ptr tmpRegion(new casacore::Record(p_Region)); build 12-Sep-2018 15:30:24 std::unique_ptr pRegion( build 12-Sep-2018 15:30:24 @@ -953,7 +955,6 @@ template casacore::Bool PixelValueManipulator::set( build 12-Sep-2018 15:30:24 ) build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 casacore::SubImage subImage(*image, *pRegion, true); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Set the pixels build 12-Sep-2018 15:30:24 if (setPixels) { build 12-Sep-2018 15:30:24 // Get casacore::LatticeExprNode (tree) from parser build 12-Sep-2018 15:30:24 @@ -966,7 +967,7 @@ template casacore::Bool PixelValueManipulator::set( build 12-Sep-2018 15:30:24 casacore::String exprName; build 12-Sep-2018 15:30:24 casacore::PtrBlock tempRegs; build 12-Sep-2018 15:30:24 makeRegionBlock(tempRegs, tempRegions); build 12-Sep-2018 15:30:24 - casacore::LatticeExprNode node = casacore::ImageExprParse::command(pixels, temps, tempRegs); build 12-Sep-2018 15:30:24 + auto node = casacore::ImageExprParse::command(pixels, temps, tempRegs); build 12-Sep-2018 15:30:24 // Delete the ImageRegions build 12-Sep-2018 15:30:24 makeRegionBlock(tempRegs, casacore::Record()); build 12-Sep-2018 15:30:24 // We must have a scalar expression build 12-Sep-2018 15:30:24 @@ -977,17 +978,19 @@ template casacore::Bool PixelValueManipulator::set( build 12-Sep-2018 15:30:24 node.isInvalidScalar(), build 12-Sep-2018 15:30:24 "The scalar pixels expression is invalid" build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 - casacore::LatticeExprNode node2 = toFloat(node); build 12-Sep-2018 15:30:24 + auto node2 = toFloat(node); build 12-Sep-2018 15:30:24 // if region==T (good) set value given by pixel expression, else build 12-Sep-2018 15:30:24 // leave the pixels as they are build 12-Sep-2018 15:30:24 - casacore::LatticeRegion region = subImage.region(); build 12-Sep-2018 15:30:24 - casacore::LatticeExprNode node3(iif(region, node2.getFloat(), subImage)); build 12-Sep-2018 15:30:24 + auto region = subImage.region(); build 12-Sep-2018 15:30:24 + casacore::LatticeExprNode node3( build 12-Sep-2018 15:30:24 + iif(region, node2.getFloat(), subImage) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 subImage.copyData(casacore::LatticeExpr (node3)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 // Set the mask build 12-Sep-2018 15:30:24 if (setMask) { build 12-Sep-2018 15:30:24 - casacore::Lattice& pixelMask = subImage.pixelMask(); build 12-Sep-2018 15:30:24 - casacore::LatticeRegion region = subImage.region(); build 12-Sep-2018 15:30:24 + auto& pixelMask = subImage.pixelMask(); build 12-Sep-2018 15:30:24 + auto region = subImage.region(); build 12-Sep-2018 15:30:24 // if region==T (good) set value given by "mask", else build 12-Sep-2018 15:30:24 // leave the pixelMask as it is build 12-Sep-2018 15:30:24 casacore::LatticeExprNode node4(iif(region, mask, pixelMask)); build 12-Sep-2018 15:30:24 @@ -1010,7 +1013,9 @@ template void PixelValueManipulator::makeRegionBlock( build 12-Sep-2018 15:30:24 regions.resize(nreg); build 12-Sep-2018 15:30:24 regions.set(static_cast (0)); build 12-Sep-2018 15:30:24 for (casacore::uInt i=0; i casacore::Record PixelValueManipulator::pixelValue( build 12-Sep-2018 15:30:24 if (offImage) { build 12-Sep-2018 15:30:24 return casacore::Record(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 casacore::RecordDesc outRecDesc; build 12-Sep-2018 15:30:24 outRecDesc.addField("mask", TpBool); build 12-Sep-2018 15:30:24 outRecDesc.addField("value", TpRecord); build 12-Sep-2018 15:30:24 @@ -1041,7 +1045,6 @@ template casacore::Record PixelValueManipulator::pixelValue( build 12-Sep-2018 15:30:24 "Unable to convert QuantumHolder to Record " + error build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 outRec.defineRecord("value", qr); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 outRec.define("pixel", pos); build 12-Sep-2018 15:30:24 return outRec; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -1050,7 +1053,7 @@ template void PixelValueManipulator::pixelValue ( build 12-Sep-2018 15:30:24 casacore::Bool& offImage, casacore::Quantum& value, casacore::Bool& mask, build 12-Sep-2018 15:30:24 casacore::Vector& pos build 12-Sep-2018 15:30:24 ) const { build 12-Sep-2018 15:30:24 - const auto myim = this->_getImage(); build 12-Sep-2018 15:30:24 + const auto myim = this->_getImage(); build 12-Sep-2018 15:30:24 const auto imShape = myim->shape(); build 12-Sep-2018 15:30:24 const auto refPix = myim->coordinates().referencePixel(); build 12-Sep-2018 15:30:24 const auto nDim = myim->ndim(); build 12-Sep-2018 15:30:24 @@ -1094,7 +1097,4 @@ template void PixelValueManipulator::pixelValue ( build 12-Sep-2018 15:30:24 mask = maskPixel(shape - 1); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/ImageAnalysis/test/tImageCollapser.cc b/code/imageanalysis/ImageAnalysis/test/tImageCollapser.cc build 12-Sep-2018 15:30:24 index 84baf05..88390e1 100644 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/ImageAnalysis/test/tImageCollapser.cc build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/ImageAnalysis/test/tImageCollapser.cc build 12-Sep-2018 15:30:24 @@ -205,10 +205,8 @@ int main() { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 writeTestString("average full temporary image collapse along axis 0"); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 auto ret = ImageFactory::fromImage("", goodImage->name(), Record(), ""); build 12-Sep-2018 15:30:24 - auto tIm = ret.first; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + auto tIm = std::get<0>(ret); build 12-Sep-2018 15:30:24 ImageCollapser collapser( build 12-Sep-2018 15:30:24 "mean", tIm, nullptr, "", IPosition(1, 0), build 12-Sep-2018 15:30:24 false, outname(), false build 12-Sep-2018 15:30:24 diff --git a/code/imageanalysis/Images/ComponentListImage.cc b/code/imageanalysis/Images/ComponentListImage.cc build 12-Sep-2018 15:30:24 index 7f481a2..da42e50 100644 build 12-Sep-2018 15:30:24 --- a/code/imageanalysis/Images/ComponentListImage.cc build 12-Sep-2018 15:30:24 +++ b/code/imageanalysis/Images/ComponentListImage.cc build 12-Sep-2018 15:30:24 @@ -306,12 +306,17 @@ bool ComponentListImage::ok() const { build 12-Sep-2018 15:30:24 return n > 1 && n < 5 && x > 1 && x < 5; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -LatticeBase* ComponentListImage::openCLImage(const String& name, const MaskSpecifier&) { build 12-Sep-2018 15:30:24 +LatticeBase* ComponentListImage::openCLImage( build 12-Sep-2018 15:30:24 + const String& name, const MaskSpecifier& build 12-Sep-2018 15:30:24 +) { build 12-Sep-2018 15:30:24 return new ComponentListImage(name); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 const Lattice& ComponentListImage::pixelMask() const { build 12-Sep-2018 15:30:24 - ThrowIf(! _mask, "ComponentListImage::" + String(__func__) + " - no mask attached"); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + ! _mask, "ComponentListImage::" + String(__func__) build 12-Sep-2018 15:30:24 + + " - no mask attached" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 return *_mask; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -341,7 +346,8 @@ void ComponentListImage::resize(const TiledShape& newShape) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void ComponentListImage::set(const casacore::Float&) { build 12-Sep-2018 15:30:24 ThrowCc( build 12-Sep-2018 15:30:24 - "There is no general way to run " + String(__func__) + " on a ComponentList" build 12-Sep-2018 15:30:24 + "There is no general way to run " + String(__func__) build 12-Sep-2018 15:30:24 + + " on a ComponentList" build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -357,7 +363,8 @@ void ComponentListImage::setCache(casacore::Bool doCache) { build 12-Sep-2018 15:30:24 Bool ComponentListImage::setCoordinateInfo (const CoordinateSystem& csys) { build 12-Sep-2018 15:30:24 auto x = csys.nPixelAxes(); build 12-Sep-2018 15:30:24 ThrowIf( build 12-Sep-2018 15:30:24 - x != _shape.size(), "Coordinate system must have the same dimensionality as the shape" build 12-Sep-2018 15:30:24 + x != _shape.size(), build 12-Sep-2018 15:30:24 + "Coordinate system must have the same dimensionality as the shape" build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 ThrowIf( build 12-Sep-2018 15:30:24 ! csys.hasDirectionCoordinate(), build 12-Sep-2018 15:30:24 @@ -383,8 +390,14 @@ Bool ComponentListImage::setCoordinateInfo (const CoordinateSystem& csys) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 // implementation copied from PagedImage and tweaked. build 12-Sep-2018 15:30:24 auto& table = _cl._getTable(); build 12-Sep-2018 15:30:24 - ThrowIf(! table.isNull() && ! table.isWritable(), "Image is not writable, cannot save coordinate system"); build 12-Sep-2018 15:30:24 - ThrowIf(! ImageInterface::setCoordinateInfo(csys), "Could not set coordinate system"); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + ! table.isNull() && ! table.isWritable(), build 12-Sep-2018 15:30:24 + "Image is not writable, cannot save coordinate system" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + ! ImageInterface::setCoordinateInfo(csys), build 12-Sep-2018 15:30:24 + "Could not set coordinate system" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 if (! table.isNull()) { build 12-Sep-2018 15:30:24 // we've tested for writability above, so if here it's writable build 12-Sep-2018 15:30:24 _reopenRW(); build 12-Sep-2018 15:30:24 @@ -491,7 +504,8 @@ void ComponentListImage::useMask(MaskSpecifier spec) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void ComponentListImage::handleMath(const Lattice&, int) { build 12-Sep-2018 15:30:24 ThrowCc( build 12-Sep-2018 15:30:24 - "There is no general way to run " + String(__func__) + " on a ComponentList" build 12-Sep-2018 15:30:24 + "There is no general way to run " + String(__func__) build 12-Sep-2018 15:30:24 + + " on a ComponentList" build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -503,7 +517,9 @@ void ComponentListImage::_applyMask(const String& maskName) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 // Reconstruct the ImageRegion object. build 12-Sep-2018 15:30:24 // Turn the region into lattice coordinates. build 12-Sep-2018 15:30:24 - std::unique_ptr regPtr(getImageRegionPtr(maskName, RegionHandler::Masks)); build 12-Sep-2018 15:30:24 + std::unique_ptr regPtr( build 12-Sep-2018 15:30:24 + getImageRegionPtr(maskName, RegionHandler::Masks) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 std::shared_ptr latReg( build 12-Sep-2018 15:30:24 new LatticeRegion(regPtr->toLatticeRegion(coordinates(), shape())) build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 @@ -555,7 +571,9 @@ void ComponentListImage::_cacheCoordinateInfo(const CoordinateSystem& csys) { build 12-Sep-2018 15:30:24 MEpoch epochConv; build 12-Sep-2018 15:30:24 MPosition posConv; build 12-Sep-2018 15:30:24 MDirection dirConv; build 12-Sep-2018 15:30:24 - specCoord.getReferenceConversion(specConv, epochConv, posConv, dirConv); build 12-Sep-2018 15:30:24 + specCoord.getReferenceConversion( build 12-Sep-2018 15:30:24 + specConv, epochConv, posConv, dirConv build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 MeasFrame measFrame(epochConv, posConv, dirConv); build 12-Sep-2018 15:30:24 _freqRef = MeasRef(specConv, measFrame); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -583,7 +601,10 @@ void ComponentListImage::_cacheCoordinateInfo(const CoordinateSystem& csys) { build 12-Sep-2018 15:30:24 _pixelToIQUV[s] = 3; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 - ThrowCc("Unsupported stokes value " + mystokes + " at pixel " + String::toString(s)); build 12-Sep-2018 15:30:24 + ThrowCc( build 12-Sep-2018 15:30:24 + "Unsupported stokes value " + mystokes + " at pixel " build 12-Sep-2018 15:30:24 + + String::toString(s) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -616,10 +637,7 @@ void ComponentListImage::_computePointSourcePixelValues() { build 12-Sep-2018 15:30:24 std::vector foundPtSourceIdx; build 12-Sep-2018 15:30:24 uInt nInside = 0; build 12-Sep-2018 15:30:24 uInt nOutside = 0; build 12-Sep-2018 15:30:24 - _findPointSoures( build 12-Sep-2018 15:30:24 - foundPtSourceIdx, nInside, build 12-Sep-2018 15:30:24 - nOutside, pointSourceIdx build 12-Sep-2018 15:30:24 - ); build 12-Sep-2018 15:30:24 + _findPointSoures(foundPtSourceIdx, nInside, nOutside, pointSourceIdx); build 12-Sep-2018 15:30:24 LogIO log(LogOrigin(IMAGE_TYPE, __func__)); build 12-Sep-2018 15:30:24 auto npts = pointSourceIdx.size(); build 12-Sep-2018 15:30:24 if (nInside > 0) { build 12-Sep-2018 15:30:24 @@ -628,9 +646,9 @@ void ComponentListImage::_computePointSourcePixelValues() { build 12-Sep-2018 15:30:24 << "pixel coordinates." << LogIO::POST; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 if (nOutside > 0) { build 12-Sep-2018 15:30:24 - log << LogIO::NORMAL << "Found " << nOutside << " of " << npts << " point " build 12-Sep-2018 15:30:24 - << "sources to be located outside the image, so will ignore those." build 12-Sep-2018 15:30:24 - << LogIO::POST; build 12-Sep-2018 15:30:24 + log << LogIO::NORMAL << "Found " << nOutside << " of " << npts build 12-Sep-2018 15:30:24 + << " point sources to be located outside the image, so will ignore " build 12-Sep-2018 15:30:24 + << "those." << LogIO::POST; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 if (! foundPtSourceIdx.empty()) { build 12-Sep-2018 15:30:24 _modifiedCL.remove(Vector(foundPtSourceIdx)); build 12-Sep-2018 15:30:24 @@ -676,11 +694,11 @@ void ComponentListImage::_fillBuffer( build 12-Sep-2018 15:30:24 IPosition posInArray(ndim); build 12-Sep-2018 15:30:24 posInArray[_latAxis] = blat; build 12-Sep-2018 15:30:24 std::pair dirPos; build 12-Sep-2018 15:30:24 - dirPos.first = ilat; build 12-Sep-2018 15:30:24 uInt ilong = startLong + blong; build 12-Sep-2018 15:30:24 + dirPos.first = ilong; build 12-Sep-2018 15:30:24 uInt d = blat * nLong + blong; build 12-Sep-2018 15:30:24 posInArray[_longAxis] = blong; build 12-Sep-2018 15:30:24 - dirPos.second = ilong; build 12-Sep-2018 15:30:24 + dirPos.second = ilat; build 12-Sep-2018 15:30:24 uInt ifreq = startFreq + bfreq; build 12-Sep-2018 15:30:24 if (_hasFreq) { build 12-Sep-2018 15:30:24 posInArray[_freqAxis] = bfreq; build 12-Sep-2018 15:30:24 @@ -810,7 +828,8 @@ void ComponentListImage::_findPointSoures( build 12-Sep-2018 15:30:24 dirPos.second = pixelPosition[_latAxis]; build 12-Sep-2018 15:30:24 auto myiter = _ptSourcePixelVals->find(dirPos); build 12-Sep-2018 15:30:24 if (myiter == _ptSourcePixelVals->end()) { build 12-Sep-2018 15:30:24 - (*_ptSourcePixelVals)[dirPos] = Matrix(nFreqs, nStokes, 0); build 12-Sep-2018 15:30:24 + (*_ptSourcePixelVals)[dirPos] build 12-Sep-2018 15:30:24 + = Matrix(nFreqs, nStokes, 0); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 for (uInt f = 0; f < nFreqs; ++f) { build 12-Sep-2018 15:30:24 for (uInt s = 0; s < nStokes; ++s) { build 12-Sep-2018 15:30:24 @@ -1002,7 +1021,10 @@ void ComponentListImage::_reopenRW() { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void ComponentListImage::_resize(const TiledShape& newShape) { build 12-Sep-2018 15:30:24 auto shape = newShape.shape(); build 12-Sep-2018 15:30:24 - ThrowIf(shape.size() < 2 || shape.size() > 4, "ComponentListImages must have 2, 3, or 4 dimensions"); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + shape.size() < 2 || shape.size() > 4, build 12-Sep-2018 15:30:24 + "ComponentListImages must have 2, 3, or 4 dimensions" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 ThrowIf(anyLE(shape.asVector(), 0), "All shape elements must be positive"); build 12-Sep-2018 15:30:24 if (! _shape.conform(shape)) { build 12-Sep-2018 15:30:24 _shape.resize(shape.size(), False); build 12-Sep-2018 15:30:24 @@ -1036,7 +1058,9 @@ void ComponentListImage::_restoreAll(const TableRecord& rec) { build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 _resize(IPosition(rec.asArrayInt("shape"))); build 12-Sep-2018 15:30:24 // Restore the coordinates. build 12-Sep-2018 15:30:24 - std::unique_ptr restoredCoords(CoordinateSystem::restore(rec, "coords")); build 12-Sep-2018 15:30:24 + std::unique_ptr restoredCoords( build 12-Sep-2018 15:30:24 + CoordinateSystem::restore(rec, "coords") build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 ThrowIf(! restoredCoords, "Error restoring coordinate system"); build 12-Sep-2018 15:30:24 setCoordinateInfo(*restoredCoords); build 12-Sep-2018 15:30:24 // Restore the image info. build 12-Sep-2018 15:30:24 diff --git a/code/mstransform/CMakeLists.txt b/code/mstransform/CMakeLists.txt build 12-Sep-2018 15:30:24 index 0097187..1ce22b0 100644 build 12-Sep-2018 15:30:24 --- a/code/mstransform/CMakeLists.txt build 12-Sep-2018 15:30:24 +++ b/code/mstransform/CMakeLists.txt build 12-Sep-2018 15:30:24 @@ -28,6 +28,7 @@ casa_add_library( mstransform build 12-Sep-2018 15:30:24 MSTransform/MSTransformIteratorFactory.cc build 12-Sep-2018 15:30:24 MSTransform/MSUVBin.cc build 12-Sep-2018 15:30:24 MSTransform/StatWt.cc build 12-Sep-2018 15:30:24 + MSTransform/StatWtColConfig.cc build 12-Sep-2018 15:30:24 TVI/UtilsTVI.cc build 12-Sep-2018 15:30:24 TVI/DenoisingLib.cc build 12-Sep-2018 15:30:24 TVI/FreqAxisTVI.cc build 12-Sep-2018 15:30:24 @@ -53,6 +54,7 @@ install (FILES build 12-Sep-2018 15:30:24 MSTransform/MSTransformIteratorFactory.h build 12-Sep-2018 15:30:24 MSTransform/MSUVBin.h build 12-Sep-2018 15:30:24 MSTransform/StatWt.h build 12-Sep-2018 15:30:24 + MSTransform/StatWtColConfig.h build 12-Sep-2018 15:30:24 DESTINATION include/casacode/mstransform/MSTransform build 12-Sep-2018 15:30:24 ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/mstransform/MSTransform/MSTransformManager.cc b/code/mstransform/MSTransform/MSTransformManager.cc build 12-Sep-2018 15:30:24 index 35a67ba..811a67b 100755 build 12-Sep-2018 15:30:24 --- a/code/mstransform/MSTransform/MSTransformManager.cc build 12-Sep-2018 15:30:24 +++ b/code/mstransform/MSTransform/MSTransformManager.cc build 12-Sep-2018 15:30:24 @@ -24,6 +24,7 @@ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using namespace casacore; build 12-Sep-2018 15:30:24 namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 @@ -1651,16 +1652,8 @@ void MSTransformManager::setup() build 12-Sep-2018 15:30:24 // Set Regridding kernel build 12-Sep-2018 15:30:24 if (fftShiftEnabled_p) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - if (combinespws_p) build 12-Sep-2018 15:30:24 - { build 12-Sep-2018 15:30:24 - regridCoreComplex_p = &MSTransformManager::interpol1Dfftshift; build 12-Sep-2018 15:30:24 - regridCoreFloat_p = &MSTransformManager::interpol1Dfftshift; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else build 12-Sep-2018 15:30:24 - { build 12-Sep-2018 15:30:24 - regridCoreComplex_p = &MSTransformManager::fftshift; build 12-Sep-2018 15:30:24 - regridCoreFloat_p = &MSTransformManager::fftshift; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 + regridCoreComplex_p = &MSTransformManager::interpol1Dfftshift; build 12-Sep-2018 15:30:24 + regridCoreFloat_p = &MSTransformManager::interpol1Dfftshift; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 @@ -5840,6 +5833,23 @@ void MSTransformManager::initFrequencyTransGrid(vi::VisBuffer2 *vb) build 12-Sep-2018 15:30:24 bandwidth += chanWidth; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 fftShift_p = - absoluteShift / bandwidth; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ostringstream current; build 12-Sep-2018 15:30:24 + current << setprecision(numeric_limits::max_digits10) build 12-Sep-2018 15:30:24 + << newCentralFrequencyBeforeRegriddingAtCurrentTime; build 12-Sep-2018 15:30:24 + ostringstream reference; build 12-Sep-2018 15:30:24 + reference << setprecision(numeric_limits::max_digits10) build 12-Sep-2018 15:30:24 + << newCentralFrequencyBeforeRegriddingAtReferenceTime; build 12-Sep-2018 15:30:24 + logger_p << LogIO::NORMAL << LogOrigin("MSTransformManager",__FUNCTION__) build 12-Sep-2018 15:30:24 + << "Using fftshift interpolation. The absolute shift is the " build 12-Sep-2018 15:30:24 + << "new central frequency at current (input SPW) time - new " build 12-Sep-2018 15:30:24 + << "central frequency " build 12-Sep-2018 15:30:24 + << "at reference (output SPW) time\nAbsolute shift: " build 12-Sep-2018 15:30:24 + << current build 12-Sep-2018 15:30:24 + << " - " << reference build 12-Sep-2018 15:30:24 + << " = " << absoluteShift << ", bandwidth " << bandwidth build 12-Sep-2018 15:30:24 + << ", relative shift: " << fftShift_p << LogIO::POST; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 @@ -7123,7 +7133,7 @@ template void MSTransformManager::copyCubeOfData( vi::VisBuffer2 *vb, build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 -// build 12-Sep-2018 15:30:24 +// combine - for combinespws=True build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 template void MSTransformManager::combineCubeOfData( vi::VisBuffer2 *vb, build 12-Sep-2018 15:30:24 RefRows &rowRef, build 12-Sep-2018 15:30:24 @@ -7513,6 +7523,11 @@ template void MSTransformManager::transformAndWriteCubeOfData( Int inp build 12-Sep-2018 15:30:24 ArrayColumn &outputDataCol, build 12-Sep-2018 15:30:24 ArrayColumn *outputFlagCol) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 + logger_p << LogIO::DEBUG1 << LogOrigin("MSTransformManager",__FUNCTION__) build 12-Sep-2018 15:30:24 + << "Shape of input data cube: " << inputDataCube.shape() build 12-Sep-2018 15:30:24 + << ", output plane shape: " << outputPlaneShape build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // Write flag column too? build 12-Sep-2018 15:30:24 if (outputFlagCol != NULL) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 @@ -7621,8 +7636,6 @@ void MSTransformManager::setWeightsPlaneByReference( uInt inputRow, build 12-Sep-2018 15:30:24 Matrix &inputWeightsPlane) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 inputWeightsPlane = inputWeightsCube.xyPlane(inputRow); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -7669,8 +7682,6 @@ template void MSTransformManager::transformAndWritePlaneOfData( Int in build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Write output planes build 12-Sep-2018 15:30:24 writeOutputPlanes(row,outputDataPlane,outputFlagsPlane,outputDataCol,*outputFlagCol); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -7683,7 +7694,6 @@ void MSTransformManager::writeOutputPlanes( uInt row, build 12-Sep-2018 15:30:24 ArrayColumn &outputFlagCol) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 (*this.*writeOutputPlanesComplex_p)(row,outputDataPlane,outputFlagsPlane,outputDataCol,outputFlagCol); build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -7696,7 +7706,6 @@ void MSTransformManager::writeOutputPlanes( uInt row, build 12-Sep-2018 15:30:24 ArrayColumn &outputFlagCol) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 (*this.*writeOutputPlanesFloat_p)(row,outputDataPlane,outputFlagsPlane,outputDataCol,outputFlagCol); build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -7919,8 +7928,6 @@ template void MSTransformManager::writeOutputPlanesInBlock( uInt row, build 12-Sep-2018 15:30:24 outputDataCol.setShape(row,outputPlaneShape); build 12-Sep-2018 15:30:24 outputDataCol.put(row, outputDataPlane); build 12-Sep-2018 15:30:24 (*this.*writeOutputFlagsPlane_p)(outputFlagsPlane,outputFlagCol, outputPlaneShape, row); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -7934,7 +7941,6 @@ void MSTransformManager::writeOutputFlagsPlane( Matrix &outputPlane, build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 outputCol.setShape(outputRow,outputPlaneShape); build 12-Sep-2018 15:30:24 outputCol.put(outputRow, outputPlane); build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -7968,8 +7974,6 @@ template void MSTransformManager::writeOutputPlanesInSlices( uInt row, build 12-Sep-2018 15:30:24 writeOutputPlaneReshapedSlices(outputDataPlane,outputDataCol,sliceX,sliceY,outputPlaneShape_tail,outRow); build 12-Sep-2018 15:30:24 (*this.*writeOutputFlagsPlaneReshapedSlices_p)( outputFlagsPlane,outputFlagCol, build 12-Sep-2018 15:30:24 sliceX,sliceY,outputPlaneShape_tail,outRow); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -7983,7 +7987,6 @@ void MSTransformManager::writeOutputFlagsPlaneSlices( Matrix &outputPlane, build 12-Sep-2018 15:30:24 uInt &outputRow) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 writeOutputPlaneSlices(outputPlane,outputCol,sliceX,sliceY,outputPlaneShape,outputRow); build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -7997,7 +8000,6 @@ void MSTransformManager::writeOutputFlagsPlaneReshapedSlices( Matrix &outp build 12-Sep-2018 15:30:24 uInt &outputRow) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 writeOutputPlaneReshapedSlices(outputPlane,outputCol,sliceX,sliceY,outputPlaneShape,outputRow); build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -8013,7 +8015,6 @@ template void MSTransformManager::writeOutputPlaneSlices( Matrix &o build 12-Sep-2018 15:30:24 Matrix outputPlane_i = outputPlane(sliceX,sliceY); build 12-Sep-2018 15:30:24 outputCol.setShape(outputRow,outputPlaneShape); build 12-Sep-2018 15:30:24 outputCol.put(outputRow, outputPlane_i); build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -8030,7 +8031,6 @@ template void MSTransformManager::writeOutputPlaneReshapedSlices( Matr build 12-Sep-2018 15:30:24 outputPlane_i.resize(outputPlaneShape,true); build 12-Sep-2018 15:30:24 outputCol.setShape(outputRow,outputPlaneShape); build 12-Sep-2018 15:30:24 outputCol.put(outputRow, outputPlane_i); build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -8041,7 +8041,6 @@ void MSTransformManager::setWeightStripeByReference( uInt corrIndex, build 12-Sep-2018 15:30:24 Vector &inputWeightsStripe) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 inputWeightsStripe.reference(inputWeightsPlane.row(corrIndex)); build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -8054,9 +8053,21 @@ void MSTransformManager::transformStripeOfData(Int inputSpw, build 12-Sep-2018 15:30:24 Vector &outputDataStripe, build 12-Sep-2018 15:30:24 Vector &outputFlagsStripe) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - (*this.*transformStripeOfDataComplex_p)( inputSpw,inputDataStripe,inputFlagsStripe, build 12-Sep-2018 15:30:24 - inputWeightsStripe,outputDataStripe,outputFlagsStripe); build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 + auto shapeBefore = outputDataStripe.shape(); build 12-Sep-2018 15:30:24 + (*this.*transformStripeOfDataComplex_p)(inputSpw, inputDataStripe, inputFlagsStripe, build 12-Sep-2018 15:30:24 + inputWeightsStripe, outputDataStripe, build 12-Sep-2018 15:30:24 + outputFlagsStripe); build 12-Sep-2018 15:30:24 + auto shapeAfter = outputDataStripe.shape(); build 12-Sep-2018 15:30:24 + if (shapeAfter != shapeBefore) { build 12-Sep-2018 15:30:24 + ostringstream msg; build 12-Sep-2018 15:30:24 + msg << "Shape of output complex data stripe changed after applying " build 12-Sep-2018 15:30:24 + << "transformation. Output shape expected before transformation: " build 12-Sep-2018 15:30:24 + << shapeBefore build 12-Sep-2018 15:30:24 + << ". Output shape produced by transformation: " << shapeAfter; build 12-Sep-2018 15:30:24 + logger_p << LogIO::DEBUG1 << LogOrigin("MSTransformManager",__FUNCTION__) build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + throw AipsError(msg.str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -8071,7 +8082,6 @@ void MSTransformManager::transformStripeOfData(Int inputSpw, build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 (*this.*transformStripeOfDataFloat_p)( inputSpw,inputDataStripe,inputFlagsStripe,inputWeightsStripe, build 12-Sep-2018 15:30:24 outputDataStripe,outputFlagsStripe); build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -8710,7 +8720,6 @@ template void MSTransformManager::regrid(Int inputSpw, build 12-Sep-2018 15:30:24 outputDataStripe, build 12-Sep-2018 15:30:24 outputFlagsStripe); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -8730,7 +8739,6 @@ void MSTransformManager::regridCore(Int inputSpw, build 12-Sep-2018 15:30:24 inputWeightsStripe, build 12-Sep-2018 15:30:24 outputDataStripe, build 12-Sep-2018 15:30:24 outputFlagsStripe); build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -8749,7 +8757,6 @@ void MSTransformManager::regridCore(Int inputSpw, build 12-Sep-2018 15:30:24 inputWeightsStripe, build 12-Sep-2018 15:30:24 outputDataStripe, build 12-Sep-2018 15:30:24 outputFlagsStripe); build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -8770,7 +8777,6 @@ void MSTransformManager::fftshift(Int , build 12-Sep-2018 15:30:24 (const Double)fftShift_p, build 12-Sep-2018 15:30:24 false, // A good data point has its flag set to false build 12-Sep-2018 15:30:24 false); build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -8790,7 +8796,6 @@ void MSTransformManager::fftshift(Int , build 12-Sep-2018 15:30:24 (const uInt)0, // In vectors axis 0 is the only dimension build 12-Sep-2018 15:30:24 (const Double)fftShift_p, build 12-Sep-2018 15:30:24 false); // A good data point has its flag set to false build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 @@ -8887,9 +8892,9 @@ template void MSTransformManager::interpolateByChannelMap(Int spw, build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -// ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 -// build 12-Sep-2018 15:30:24 -// ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 +// ------------------------------------------------------------------------ build 12-Sep-2018 15:30:24 +// casacore::fftshift does not interpolate, it needs interpolation+fftshift build 12-Sep-2018 15:30:24 +// ------------------------------------------------------------------------ build 12-Sep-2018 15:30:24 template void MSTransformManager::interpol1Dfftshift(Int inputSpw, build 12-Sep-2018 15:30:24 const Vector &inputDataStripe, build 12-Sep-2018 15:30:24 const Vector &inputFlagsStripe, build 12-Sep-2018 15:30:24 @@ -8897,16 +8902,14 @@ template void MSTransformManager::interpol1Dfftshift(Int inputSpw, build 12-Sep-2018 15:30:24 Vector &outputDataStripe, build 12-Sep-2018 15:30:24 Vector &outputFlagsStripe) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - Vector regriddedDataStripe(inputDataStripe.shape(),T()); build 12-Sep-2018 15:30:24 - Vector regriddedFlagsStripe(inputFlagsStripe.shape(),false); build 12-Sep-2018 15:30:24 + Vector regriddedDataStripe(outputDataStripe.shape(),T()); build 12-Sep-2018 15:30:24 + Vector regriddedFlagsStripe(outputFlagsStripe.shape(),false); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // This linear interpolation provides an uniform grid (pre-condition to apply fftshift) build 12-Sep-2018 15:30:24 - interpol1D(inputSpw,inputDataStripe,inputFlagsStripe,inputWeightsStripe,regriddedDataStripe,regriddedFlagsStripe); build 12-Sep-2018 15:30:24 + // This linear interpolation provides a uniform grid (pre-condition to apply fftshift) build 12-Sep-2018 15:30:24 + interpol1D(inputSpw,inputDataStripe,inputFlagsStripe,inputWeightsStripe,regriddedDataStripe,regriddedFlagsStripe); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // fftshift takes care of time build 12-Sep-2018 15:30:24 - fftshift(inputSpw,regriddedDataStripe,regriddedFlagsStripe,inputWeightsStripe,outputDataStripe,outputFlagsStripe); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 + // fftshift takes care of time build 12-Sep-2018 15:30:24 + fftshift(inputSpw,regriddedDataStripe,regriddedFlagsStripe,inputWeightsStripe,outputDataStripe,outputFlagsStripe); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // ----------------------------------------------------------------------- build 12-Sep-2018 15:30:24 diff --git a/code/mstransform/MSTransform/StatWt.cc b/code/mstransform/MSTransform/StatWt.cc build 12-Sep-2018 15:30:24 index 819e585..8d999e5 100644 build 12-Sep-2018 15:30:24 --- a/code/mstransform/MSTransform/StatWt.cc build 12-Sep-2018 15:30:24 +++ b/code/mstransform/MSTransform/StatWt.cc build 12-Sep-2018 15:30:24 @@ -18,6 +18,8 @@ build 12-Sep-2018 15:30:24 //# Foundation, Inc., 59 Temple Place, Suite 330, Boston, build 12-Sep-2018 15:30:24 //# MA 02111-1307 USA build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -26,19 +28,26 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using namespace casacore; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace casa { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -StatWt::StatWt(MeasurementSet* ms) : _ms(ms), _saf() { build 12-Sep-2018 15:30:24 +StatWt::StatWt( build 12-Sep-2018 15:30:24 + MeasurementSet* ms, build 12-Sep-2018 15:30:24 + const StatWtColConfig* const statwtColConfig build 12-Sep-2018 15:30:24 +) : _ms(ms), build 12-Sep-2018 15:30:24 + _saf(), _statwtColConfig(statwtColConfig) { build 12-Sep-2018 15:30:24 ThrowIf(! _ms, "Input MS pointer cannot be NULL"); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + ! _statwtColConfig, build 12-Sep-2018 15:30:24 + "Input column configuration pointer cannot be NULL" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 StatWt::~StatWt() {} build 12-Sep-2018 15:30:24 @@ -76,63 +85,80 @@ void StatWt::setTVIConfig(const Record& config) { build 12-Sep-2018 15:30:24 _tviConfig = config; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -Record StatWt::writeWeights() const { build 12-Sep-2018 15:30:24 - auto hasWtSp = _ms->isColumn(MSMainEnums::WEIGHT_SPECTRUM); build 12-Sep-2018 15:30:24 - auto mustWriteWtSp = ! _preview build 12-Sep-2018 15:30:24 - && _tviConfig.isDefined(vi::StatWtTVI::CHANBIN); build 12-Sep-2018 15:30:24 - if (mustWriteWtSp) { build 12-Sep-2018 15:30:24 - auto type = _tviConfig.type(_tviConfig.fieldNumber(vi::StatWtTVI::CHANBIN)); build 12-Sep-2018 15:30:24 - if (type == TpArrayBool) { build 12-Sep-2018 15:30:24 - // default variant type build 12-Sep-2018 15:30:24 - mustWriteWtSp = False; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else if (type == TpString) { build 12-Sep-2018 15:30:24 - auto val = _tviConfig.asString(vi::StatWtTVI::CHANBIN); build 12-Sep-2018 15:30:24 - val.downcase(); build 12-Sep-2018 15:30:24 - if (val == "spw") { build 12-Sep-2018 15:30:24 - mustWriteWtSp = False; build 12-Sep-2018 15:30:24 +Record StatWt::writeWeights() { build 12-Sep-2018 15:30:24 + auto mustWriteWt = False; build 12-Sep-2018 15:30:24 + auto mustWriteWtSp = False; build 12-Sep-2018 15:30:24 + auto mustWriteSig = False; build 12-Sep-2018 15:30:24 + auto mustWriteSigSp = False; build 12-Sep-2018 15:30:24 + _statwtColConfig->getColWriteFlags( build 12-Sep-2018 15:30:24 + mustWriteWt, mustWriteWtSp, mustWriteSig, mustWriteSigSp build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + shared_ptr vi; build 12-Sep-2018 15:30:24 + std::shared_ptr factory; build 12-Sep-2018 15:30:24 + _constructVi(vi, factory); build 12-Sep-2018 15:30:24 + vi::VisBuffer2 *vb = vi->getVisBuffer(); build 12-Sep-2018 15:30:24 + ProgressMeter pm(0, _ms->nrow(), "StatWt Progress"); build 12-Sep-2018 15:30:24 + uInt64 count = 0; build 12-Sep-2018 15:30:24 + for (vi->originChunks(); vi->moreChunks(); vi->nextChunk()) { build 12-Sep-2018 15:30:24 + for (vi->origin(); vi->more(); vi->next()) { build 12-Sep-2018 15:30:24 + auto nrow = vb->nRows(); build 12-Sep-2018 15:30:24 + if (_preview) { build 12-Sep-2018 15:30:24 + // just need to run the flags to accumulate build 12-Sep-2018 15:30:24 + // flagging info build 12-Sep-2018 15:30:24 + vb->flagCube(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - auto mustInitWtSp = False; build 12-Sep-2018 15:30:24 - if (! hasWtSp && mustWriteWtSp) { build 12-Sep-2018 15:30:24 - // we must create WEIGHT_SPECTRUM build 12-Sep-2018 15:30:24 - hasWtSp = True; build 12-Sep-2018 15:30:24 - mustInitWtSp = True; build 12-Sep-2018 15:30:24 - // from Calibrater.cc build 12-Sep-2018 15:30:24 - // Nominal default tile shape build 12-Sep-2018 15:30:24 - IPosition dts(3, 4, 32, 1024); build 12-Sep-2018 15:30:24 - // Discern DATA's default tile shape and use it build 12-Sep-2018 15:30:24 - const auto dminfo = _ms->dataManagerInfo(); build 12-Sep-2018 15:30:24 - for (uInt i=0; iweightSpectrum(); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + x.empty(), build 12-Sep-2018 15:30:24 + "WEIGHT_SPECTRUM is only partially initialized. " build 12-Sep-2018 15:30:24 + "StatWt2 cannot deal with such an MS" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + vb->setWeightSpectrum(x); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (mustWriteSigSp) { build 12-Sep-2018 15:30:24 + auto& x = vb->sigmaSpectrum(); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + x.empty(), build 12-Sep-2018 15:30:24 + "SIGMA_SPECTRUM is only partially initialized. " build 12-Sep-2018 15:30:24 + "StatWt2 cannot deal with such an MS" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + vb->setSigmaSpectrum(x); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (mustWriteWt) { build 12-Sep-2018 15:30:24 + vb->setWeight(vb->weight()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (mustWriteSig) { build 12-Sep-2018 15:30:24 + vb->setSigma(vb->sigma()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + vb->setFlagCube(vb->flagCube()); build 12-Sep-2018 15:30:24 + vb->setFlagRow(vb->flagRow()); build 12-Sep-2018 15:30:24 + vb->writeChangesBack(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + count += nrow; build 12-Sep-2018 15:30:24 + pm.update(count); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - // Add the column build 12-Sep-2018 15:30:24 - String colWtSp = MS::columnName(MS::WEIGHT_SPECTRUM); build 12-Sep-2018 15:30:24 - TableDesc tdWtSp; build 12-Sep-2018 15:30:24 - tdWtSp.addColumn(ArrayColumnDesc(colWtSp, "weight spectrum", 2)); build 12-Sep-2018 15:30:24 - TiledShapeStMan wtSpStMan("TiledWgtSpectrum", dts); build 12-Sep-2018 15:30:24 - _ms->addColumn(tdWtSp, wtSpStMan); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - else if (! _preview) { build 12-Sep-2018 15:30:24 - // check to see if extant WEIGHT_SPECTRUM needs to be initialized build 12-Sep-2018 15:30:24 - ArrayColumn col(*_ms, MS::columnName(MS::WEIGHT_SPECTRUM)); build 12-Sep-2018 15:30:24 - try { build 12-Sep-2018 15:30:24 - col.get(0); build 12-Sep-2018 15:30:24 - // its initialized, so even if we are using the full spw for build 12-Sep-2018 15:30:24 - // binning, we still need to update WEIGHT_SPECTRUM build 12-Sep-2018 15:30:24 - mustWriteWtSp = True; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - catch (const AipsError& x) { build 12-Sep-2018 15:30:24 - // its not initialized, so we aren't going to write to it unless build 12-Sep-2018 15:30:24 - // chanbin has been specified to be less than the spw width build 12-Sep-2018 15:30:24 - mustInitWtSp = mustWriteWtSp; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 + if (_preview) { build 12-Sep-2018 15:30:24 + LogIO log(LogOrigin("StatWt", __func__)); build 12-Sep-2018 15:30:24 + log << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "RAN IN PREVIEW MODE. NO WEIGHTS NOR FLAGS WERE CHANGED." build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + factory->getTVI()->summarizeFlagging(); build 12-Sep-2018 15:30:24 + Double mean, variance; build 12-Sep-2018 15:30:24 + factory->getTVI()->summarizeStats(mean, variance); build 12-Sep-2018 15:30:24 + Record ret; build 12-Sep-2018 15:30:24 + ret.define("mean", mean); build 12-Sep-2018 15:30:24 + ret.define("variance", variance); build 12-Sep-2018 15:30:24 + return ret; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +void StatWt::_constructVi( build 12-Sep-2018 15:30:24 + std::shared_ptr& vi, build 12-Sep-2018 15:30:24 + std::shared_ptr& factory build 12-Sep-2018 15:30:24 +) const { build 12-Sep-2018 15:30:24 // default sort columns are from MSIter and are ARRAY_ID, FIELD_ID, DATA_DESC_ID, and TIME build 12-Sep-2018 15:30:24 // I'm adding scan and state because, according to the statwt requirements, by default, scan build 12-Sep-2018 15:30:24 // and state changes should mark boundaries in the weights computation build 12-Sep-2018 15:30:24 @@ -159,57 +185,11 @@ Record StatWt::writeWeights() const { build 12-Sep-2018 15:30:24 vi::IteratingParameters ipar(_timeBinWidth, sc); build 12-Sep-2018 15:30:24 vi::VisIterImpl2LayerFactory data(_ms, ipar, True); build 12-Sep-2018 15:30:24 unique_ptr config(dynamic_cast(_tviConfig.clone())); build 12-Sep-2018 15:30:24 - vi::StatWtTVILayerFactory statWtLayerFactory(*config); build 12-Sep-2018 15:30:24 + factory.reset(new vi::StatWtTVILayerFactory(*config)); build 12-Sep-2018 15:30:24 Vector facts(2); build 12-Sep-2018 15:30:24 facts[0] = &data; build 12-Sep-2018 15:30:24 - facts[1] = &statWtLayerFactory; build 12-Sep-2018 15:30:24 - vi::VisibilityIterator2 vi(facts); build 12-Sep-2018 15:30:24 - vi::VisBuffer2 *vb = vi.getVisBuffer(); build 12-Sep-2018 15:30:24 - Vector vr(1); build 12-Sep-2018 15:30:24 - ProgressMeter pm(0, _ms->nrow(), "StatWt Progress"); build 12-Sep-2018 15:30:24 - uInt64 count = 0; build 12-Sep-2018 15:30:24 - for (vi.originChunks(); vi.moreChunks(); vi.nextChunk()) { build 12-Sep-2018 15:30:24 - for (vi.origin(); vi.more(); vi.next()) { build 12-Sep-2018 15:30:24 - auto nrow = vb->nRows(); build 12-Sep-2018 15:30:24 - if (_preview) { build 12-Sep-2018 15:30:24 - // just need to run the flags to accumulate build 12-Sep-2018 15:30:24 - // flagging info build 12-Sep-2018 15:30:24 - vb->flagCube(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - if (mustInitWtSp) { build 12-Sep-2018 15:30:24 - auto nchan = vb->nChannels(); build 12-Sep-2018 15:30:24 - auto ncor = vb->nCorrelations(); build 12-Sep-2018 15:30:24 - Cube newwtsp(ncor, nchan, nrow, 0); build 12-Sep-2018 15:30:24 - vb->initWeightSpectrum(newwtsp); build 12-Sep-2018 15:30:24 - vb->writeChangesBack(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if (mustWriteWtSp) { build 12-Sep-2018 15:30:24 - vb->setWeightSpectrum(vb->weightSpectrum()); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - vb->setWeight(vb->weight()); build 12-Sep-2018 15:30:24 - vb->setFlagCube(vb->flagCube()); build 12-Sep-2018 15:30:24 - vb->setFlagRow(vb->flagRow()); build 12-Sep-2018 15:30:24 - vb->writeChangesBack(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - count += nrow; build 12-Sep-2018 15:30:24 - pm.update(count); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if (_preview) { build 12-Sep-2018 15:30:24 - LogIO log(LogOrigin("StatWt", __func__)); build 12-Sep-2018 15:30:24 - log << LogIO::NORMAL build 12-Sep-2018 15:30:24 - << "RAN IN PREVIEW MODE. NO WEIGHTS NOR FLAGS WERE CHANGED." build 12-Sep-2018 15:30:24 - << LogIO::POST; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - statWtLayerFactory.getTVI()->summarizeFlagging(); build 12-Sep-2018 15:30:24 - Double mean, variance; build 12-Sep-2018 15:30:24 - statWtLayerFactory.getTVI()->summarizeStats(mean, variance); build 12-Sep-2018 15:30:24 - Record ret; build 12-Sep-2018 15:30:24 - ret.define("mean", mean); build 12-Sep-2018 15:30:24 - ret.define("variance", variance); build 12-Sep-2018 15:30:24 - return ret; build 12-Sep-2018 15:30:24 + facts[1] = factory.get(); build 12-Sep-2018 15:30:24 + vi.reset(new vi::VisibilityIterator2(facts)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/mstransform/MSTransform/StatWt.h b/code/mstransform/MSTransform/StatWt.h build 12-Sep-2018 15:30:24 index 5da2266..70d8046 100644 build 12-Sep-2018 15:30:24 --- a/code/mstransform/MSTransform/StatWt.h build 12-Sep-2018 15:30:24 +++ b/code/mstransform/MSTransform/StatWt.h build 12-Sep-2018 15:30:24 @@ -24,14 +24,26 @@ build 12-Sep-2018 15:30:24 #define STATWT_H_ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +namespace casacore { build 12-Sep-2018 15:30:24 + class LogIO; build 12-Sep-2018 15:30:24 + class MeasurementSet; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 namespace casa { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +class StatWtColConfig; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +namespace vi { build 12-Sep-2018 15:30:24 + class StatWtTVILayerFactory; build 12-Sep-2018 15:30:24 + class VisibilityIterator2; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // This class implements reweighting of visibilities based on the statwt build 12-Sep-2018 15:30:24 // algorithm. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -39,7 +51,10 @@ class StatWt { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 public: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - StatWt(casacore::MeasurementSet* ms); build 12-Sep-2018 15:30:24 + StatWt( build 12-Sep-2018 15:30:24 + casacore::MeasurementSet* ms, build 12-Sep-2018 15:30:24 + const StatWtColConfig* const statwtColConfig build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 ~StatWt(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -66,7 +81,7 @@ public: build 12-Sep-2018 15:30:24 // set the StatWtTVI config record build 12-Sep-2018 15:30:24 void setTVIConfig(const casacore::Record& config); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - casacore::Record writeWeights() const; build 12-Sep-2018 15:30:24 + casacore::Record writeWeights(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 private: build 12-Sep-2018 15:30:24 casacore::MeasurementSet* _ms; build 12-Sep-2018 15:30:24 @@ -85,6 +100,13 @@ private: build 12-Sep-2018 15:30:24 std::unique_ptr> _wtrange = nullptr; build 12-Sep-2018 15:30:24 casacore::Record _tviConfig; build 12-Sep-2018 15:30:24 casacore::Bool _preview = false; build 12-Sep-2018 15:30:24 + const StatWtColConfig* _statwtColConfig = nullptr; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Construct the iterator build 12-Sep-2018 15:30:24 + void _constructVi( build 12-Sep-2018 15:30:24 + std::shared_ptr& vi, build 12-Sep-2018 15:30:24 + std::shared_ptr& factory build 12-Sep-2018 15:30:24 + ) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/mstransform/MSTransform/StatWtColConfig.cc b/code/mstransform/MSTransform/StatWtColConfig.cc build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..543006a build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/mstransform/MSTransform/StatWtColConfig.cc build 12-Sep-2018 15:30:24 @@ -0,0 +1,254 @@ build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# CASA - Common Astronomy Software Applications (http://casa.nrao.edu/) build 12-Sep-2018 15:30:24 +//# Copyright (C) Associated Universities, Inc. Washington DC, USA 2011, All rights reserved. build 12-Sep-2018 15:30:24 +//# Copyright (C) European Southern Observatory, 2011, All rights reserved. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is free software; you can redistribute it and/or build 12-Sep-2018 15:30:24 +//# modify it under the terms of the GNU Lesser General Public build 12-Sep-2018 15:30:24 +//# License as published by the Free software Foundation; either build 12-Sep-2018 15:30:24 +//# version 2.1 of the License, or (at your option) any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is distributed in the hope that it will be useful, build 12-Sep-2018 15:30:24 +//# but WITHOUT ANY WARRANTY, without even the implied warranty of build 12-Sep-2018 15:30:24 +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU build 12-Sep-2018 15:30:24 +//# Lesser General Public License for more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU Lesser General Public build 12-Sep-2018 15:30:24 +//# License along with this library; if not, write to the Free Software build 12-Sep-2018 15:30:24 +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, build 12-Sep-2018 15:30:24 +//# MA 02111-1307 USA build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +using namespace casacore; build 12-Sep-2018 15:30:24 +using namespace casac; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +namespace casa { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +StatWtColConfig::StatWtColConfig( build 12-Sep-2018 15:30:24 + casacore::MeasurementSet* ms, Bool preview, build 12-Sep-2018 15:30:24 + const String& dataColumn, const variant& chanbin build 12-Sep-2018 15:30:24 +) : _ms(ms), _preview(preview), _dataColumn(dataColumn) { build 12-Sep-2018 15:30:24 + ThrowIf(_dataColumn.empty(), "data column cannot be empty"); build 12-Sep-2018 15:30:24 + _dataColumn.downcase(); build 12-Sep-2018 15:30:24 + ThrowIf ( build 12-Sep-2018 15:30:24 + ! ( build 12-Sep-2018 15:30:24 + _dataColumn.startsWith("c") build 12-Sep-2018 15:30:24 + || _dataColumn.startsWith("d") build 12-Sep-2018 15:30:24 + || _dataColumn.startsWith("residual") build 12-Sep-2018 15:30:24 + || _dataColumn.startsWith("residual_") build 12-Sep-2018 15:30:24 + ), build 12-Sep-2018 15:30:24 + "Unsupported value for data column: " + dataColumn build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + _possiblyWriteSigma = _dataColumn.startsWith("d") build 12-Sep-2018 15:30:24 + || _dataColumn.startsWith("residual_"); build 12-Sep-2018 15:30:24 + auto chanBinType = chanbin.type(); build 12-Sep-2018 15:30:24 + ThrowIf( build 12-Sep-2018 15:30:24 + (chanBinType == variant::BOOLVEC && ! chanbin.toBoolVec().empty()) build 12-Sep-2018 15:30:24 + && chanBinType != variant::STRING && chanBinType != variant::INT, build 12-Sep-2018 15:30:24 + "Unsupported data type for chanbin" build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + _doChanBin = ( build 12-Sep-2018 15:30:24 + chanBinType == variant::STRING && chanbin.toString() != "spw" build 12-Sep-2018 15:30:24 + ) || chanBinType == variant::INT; build 12-Sep-2018 15:30:24 + _determineFlags(); build 12-Sep-2018 15:30:24 + _initSpecColsIfNecessary(); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +StatWtColConfig::~StatWtColConfig() {} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +void StatWtColConfig::getColWriteFlags( build 12-Sep-2018 15:30:24 + casacore::Bool& mustWriteWt, casacore::Bool& mustWriteWtSp, build 12-Sep-2018 15:30:24 + casacore::Bool& mustWriteSig, casacore::Bool& mustWriteSigSp build 12-Sep-2018 15:30:24 +) const { build 12-Sep-2018 15:30:24 + mustWriteWt = _mustWriteWt; build 12-Sep-2018 15:30:24 + mustWriteWtSp = _mustWriteWtSp; build 12-Sep-2018 15:30:24 + mustWriteSig = _mustWriteSig; build 12-Sep-2018 15:30:24 + mustWriteSigSp = _mustWriteSigSp; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +void StatWtColConfig::_determineFlags() { build 12-Sep-2018 15:30:24 + _mustWriteSig = _possiblyWriteSigma && ! _preview; build 12-Sep-2018 15:30:24 + Bool hasSigSp = False; build 12-Sep-2018 15:30:24 + Bool sigSpIsInitialized = False; build 12-Sep-2018 15:30:24 + _hasSpectrumIsSpectrumInitialized( build 12-Sep-2018 15:30:24 + hasSigSp, sigSpIsInitialized, MS::SIGMA_SPECTRUM build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + _mustWriteSigSp = _mustWriteSig && (sigSpIsInitialized || _doChanBin); build 12-Sep-2018 15:30:24 + _mustWriteWt = ! _preview build 12-Sep-2018 15:30:24 + && ( build 12-Sep-2018 15:30:24 + ! _mustWriteSig build 12-Sep-2018 15:30:24 + || ( build 12-Sep-2018 15:30:24 + _mustWriteSig build 12-Sep-2018 15:30:24 + && ! _ms->isColumn(MSMainEnums::CORRECTED_DATA) build 12-Sep-2018 15:30:24 + ) build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + Bool hasWtSp = False; build 12-Sep-2018 15:30:24 + Bool wtSpIsInitialized = False; build 12-Sep-2018 15:30:24 + _hasSpectrumIsSpectrumInitialized( build 12-Sep-2018 15:30:24 + hasWtSp, wtSpIsInitialized, MS::WEIGHT_SPECTRUM build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + _mustWriteWtSp = _mustWriteWt && (wtSpIsInitialized || _doChanBin); build 12-Sep-2018 15:30:24 + static const auto colNameWtSp = MS::columnName(MS::WEIGHT_SPECTRUM); build 12-Sep-2018 15:30:24 + static const auto descWtSp = "weight spectrum"; build 12-Sep-2018 15:30:24 + _dealWithSpectrumColumn( build 12-Sep-2018 15:30:24 + hasWtSp, _mustWriteWtSp, _mustInitWtSp, _mustWriteWt, build 12-Sep-2018 15:30:24 + colNameWtSp, descWtSp, wtSpIsInitialized build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + static const auto colNameSigSp = MS::columnName(MS::SIGMA_SPECTRUM); build 12-Sep-2018 15:30:24 + static const auto descSigSp = "sigma spectrum"; build 12-Sep-2018 15:30:24 + _dealWithSpectrumColumn( build 12-Sep-2018 15:30:24 + hasSigSp, _mustWriteSigSp, _mustInitSigSp, _mustWriteSig, build 12-Sep-2018 15:30:24 + colNameSigSp, descSigSp, sigSpIsInitialized build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + LogIO log(LogOrigin("StatWtColConfig", __func__)); build 12-Sep-2018 15:30:24 + if (_mustWriteWt) { build 12-Sep-2018 15:30:24 + if (_mustWriteSig) { build 12-Sep-2018 15:30:24 + log << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "CORRECTED_DATA is not present. Updating the " build 12-Sep-2018 15:30:24 + << "SIGMA/SIGMA_SPECTRUM and WEIGHT/WEIGHT_SPECTRUM values " build 12-Sep-2018 15:30:24 + << "based on calculations using the DATA column." build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + log << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Updating the WEIGHT/WEIGHT_SPECTRUM values. SIGMA/SIGMA_SPECTRUM " build 12-Sep-2018 15:30:24 + << "values will not be recalculated as they are related to the values " build 12-Sep-2018 15:30:24 + << "in the DATA column." << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (_mustWriteSig) { build 12-Sep-2018 15:30:24 + log << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Updating the SIGMA/SIGMA_SPECTRUM values. WEIGHT/WEIGHT_SPECTRUM will " build 12-Sep-2018 15:30:24 + << "not be recalculated as they are related to the values in the " build 12-Sep-2018 15:30:24 + << "CORRECTED_DATA column." << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +void StatWtColConfig::_initSpecColsIfNecessary() { build 12-Sep-2018 15:30:24 + if (! _mustInitWtSp && ! _mustInitSigSp) { build 12-Sep-2018 15:30:24 + return; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + LogIO log(LogOrigin("StatWtColConfig", __func__)); build 12-Sep-2018 15:30:24 + if (_mustInitWtSp) { build 12-Sep-2018 15:30:24 + log << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Fully initializing WEIGHT_SPECTRUM column" build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (_mustInitWtSp) { build 12-Sep-2018 15:30:24 + log << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Fully initializing SIGMA_SPECTRUM column" build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + std::vector scs; build 12-Sep-2018 15:30:24 + scs.push_back(MS::ARRAY_ID); build 12-Sep-2018 15:30:24 + scs.push_back(MS::DATA_DESC_ID); build 12-Sep-2018 15:30:24 + scs.push_back(MS::TIME); build 12-Sep-2018 15:30:24 + Block sort(scs.size()); build 12-Sep-2018 15:30:24 + uInt i = 0; build 12-Sep-2018 15:30:24 + for (const auto& col: scs) { build 12-Sep-2018 15:30:24 + sort[i] = col; build 12-Sep-2018 15:30:24 + ++i; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + vi::SortColumns sc(sort, False); build 12-Sep-2018 15:30:24 + vi::IteratingParameters ipar; build 12-Sep-2018 15:30:24 + vi::VisIterImpl2LayerFactory mydata(_ms, ipar, True); build 12-Sep-2018 15:30:24 + Vector facts(1); build 12-Sep-2018 15:30:24 + facts[0] = &mydata; build 12-Sep-2018 15:30:24 + vi::VisibilityIterator2 vi(facts); build 12-Sep-2018 15:30:24 + vi::VisBuffer2 *vb = vi.getVisBuffer(); build 12-Sep-2018 15:30:24 + for (vi.originChunks(); vi.moreChunks(); vi.nextChunk()) { build 12-Sep-2018 15:30:24 + for (vi.origin(); vi.more(); vi.next()) { build 12-Sep-2018 15:30:24 + auto nrow = vb->nRows(); build 12-Sep-2018 15:30:24 + auto nchan = vb->nChannels(); build 12-Sep-2018 15:30:24 + auto ncor = vb->nCorrelations(); build 12-Sep-2018 15:30:24 + Cube newsp(ncor, nchan, nrow, 0); build 12-Sep-2018 15:30:24 + if (_mustInitWtSp) { build 12-Sep-2018 15:30:24 + vb->initWeightSpectrum(newsp); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (_mustInitSigSp) { build 12-Sep-2018 15:30:24 + vb->initSigmaSpectrum(newsp); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + vb->writeChangesBack(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +void StatWtColConfig::_hasSpectrumIsSpectrumInitialized( build 12-Sep-2018 15:30:24 + bool& hasSpectrum, bool& spectrumIsInitialzed, build 12-Sep-2018 15:30:24 + MS::PredefinedColumns col build 12-Sep-2018 15:30:24 +) const { build 12-Sep-2018 15:30:24 + hasSpectrum = _ms->isColumn(col); build 12-Sep-2018 15:30:24 + if (! hasSpectrum) { build 12-Sep-2018 15:30:24 + // no column, so it is obviously not initialized build 12-Sep-2018 15:30:24 + spectrumIsInitialzed = False; build 12-Sep-2018 15:30:24 + return; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + ArrayColumn column(*_ms, MS::columnName(col)); build 12-Sep-2018 15:30:24 + try { build 12-Sep-2018 15:30:24 + column.get(0); build 12-Sep-2018 15:30:24 + // we were able to get a row, so its initialized. build 12-Sep-2018 15:30:24 + spectrumIsInitialzed = True; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + catch (const AipsError& x) { build 12-Sep-2018 15:30:24 + // attempt to get first row failed, its not initialized. build 12-Sep-2018 15:30:24 + spectrumIsInitialzed = False; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +void StatWtColConfig::_dealWithSpectrumColumn( build 12-Sep-2018 15:30:24 + Bool& hasSpec, Bool& mustWriteSpec, Bool& mustInitSpec, build 12-Sep-2018 15:30:24 + Bool mustWriteNonSpec, const String& colName, build 12-Sep-2018 15:30:24 + const String& descName, Bool specIsInitialized build 12-Sep-2018 15:30:24 +) { build 12-Sep-2018 15:30:24 + // this conditional structure supports the build 12-Sep-2018 15:30:24 + // case of ! hasSpec && ! mustWriteSpec, in which case, build 12-Sep-2018 15:30:24 + // nothing need be done build 12-Sep-2018 15:30:24 + if (! hasSpec) { build 12-Sep-2018 15:30:24 + if (mustWriteSpec) { build 12-Sep-2018 15:30:24 + // we must create spectrum column build 12-Sep-2018 15:30:24 + hasSpec = True; build 12-Sep-2018 15:30:24 + mustInitSpec = True; build 12-Sep-2018 15:30:24 + // from Calibrater.cc build 12-Sep-2018 15:30:24 + // Nominal default tile shape build 12-Sep-2018 15:30:24 + IPosition dts(3, 4, 32, 1024); build 12-Sep-2018 15:30:24 + // Discern DATA's default tile shape and use it build 12-Sep-2018 15:30:24 + const auto dminfo = _ms->dataManagerInfo(); build 12-Sep-2018 15:30:24 + for (uInt i=0; i(colWtSp, descName, 2)); build 12-Sep-2018 15:30:24 + TiledShapeStMan wtSpStMan("TiledWgtSpectrum", dts); build 12-Sep-2018 15:30:24 + _ms->addColumn(tdWtSp, wtSpStMan); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (mustWriteNonSpec) { build 12-Sep-2018 15:30:24 + if (specIsInitialized) { build 12-Sep-2018 15:30:24 + // it's initialized, so even if we are using the full build 12-Sep-2018 15:30:24 + // spw for binning, we still need to update *_SPECTRUM build 12-Sep-2018 15:30:24 + mustWriteSpec = True; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + // it's not initialized, so we aren't going to write to it unless build 12-Sep-2018 15:30:24 + // chanbin has been specified to be less than the spw width build 12-Sep-2018 15:30:24 + mustInitSpec = mustWriteSpec; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 diff --git a/code/mstransform/MSTransform/StatWtColConfig.h b/code/mstransform/MSTransform/StatWtColConfig.h build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..113cbbf build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/mstransform/MSTransform/StatWtColConfig.h build 12-Sep-2018 15:30:24 @@ -0,0 +1,104 @@ build 12-Sep-2018 15:30:24 +//# StatWt.h: Class which implements statistical reweighting build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# CASA - Common Astronomy Software Applications (http://casa.nrao.edu/) build 12-Sep-2018 15:30:24 +//# Copyright (C) Associated Universities, Inc. Washington DC, USA 2011, All rights reserved. build 12-Sep-2018 15:30:24 +//# Copyright (C) European Southern Observatory, 2011, All rights reserved. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is free software; you can redistribute it and/or build 12-Sep-2018 15:30:24 +//# modify it under the terms of the GNU Lesser General Public build 12-Sep-2018 15:30:24 +//# License as published by the Free software Foundation; either build 12-Sep-2018 15:30:24 +//# version 2.1 of the License, or (at your option) any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is distributed in the hope that it will be useful, build 12-Sep-2018 15:30:24 +//# but WITHOUT ANY WARRANTY, without even the implied warranty of build 12-Sep-2018 15:30:24 +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU build 12-Sep-2018 15:30:24 +//# Lesser General Public License for more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU Lesser General Public build 12-Sep-2018 15:30:24 +//# License along with this library; if not, write to the Free Software build 12-Sep-2018 15:30:24 +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, build 12-Sep-2018 15:30:24 +//# MA 02111-1307 USA build 12-Sep-2018 15:30:24 +//# $Id: $ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#ifndef STATWTCOLCONFIG_H_ build 12-Sep-2018 15:30:24 +#define STATWTCOLCONFIG_H_ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +namespace casacore { build 12-Sep-2018 15:30:24 + class LogIO; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +namespace casac { build 12-Sep-2018 15:30:24 + class variant; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +namespace casa { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +// This class is necessary to ensure partial initialization of SIGMA_SPECTRUM build 12-Sep-2018 15:30:24 +// and WEIGHT_SPECTRUM in the MS is not done. It should be constructed using build 12-Sep-2018 15:30:24 +// the entire MS (not an MS that has had a selection applied to it). This build 12-Sep-2018 15:30:24 +// class will do the complete initialization of SIGMA_SPECTRUM and build 12-Sep-2018 15:30:24 +// WEIGHT_SPECTRUM if necessary. build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +class StatWtColConfig { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +public: build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + StatWtColConfig() = delete; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // It is the caller's responsibility to ensure that the input build 12-Sep-2018 15:30:24 + // ms represents the entire MS, and is not an MS that has had build 12-Sep-2018 15:30:24 + // a selection applied to it. build 12-Sep-2018 15:30:24 + StatWtColConfig( build 12-Sep-2018 15:30:24 + casacore::MeasurementSet* ms, casacore::Bool preview, build 12-Sep-2018 15:30:24 + const casacore::String& dataColumn, const casac::variant& chanbin build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ~StatWtColConfig(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + void getColWriteFlags( build 12-Sep-2018 15:30:24 + casacore::Bool& mustWriteWt, casacore::Bool& mustWriteWtSp, build 12-Sep-2018 15:30:24 + casacore::Bool& mustWriteSig, casacore::Bool& mustWriteSigSp build 12-Sep-2018 15:30:24 + ) const; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + void initSpecColsIfNecessary(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +private: build 12-Sep-2018 15:30:24 + casacore::MeasurementSet* _ms; build 12-Sep-2018 15:30:24 + casacore::Bool _mustWriteWt = false; build 12-Sep-2018 15:30:24 + casacore::Bool _mustWriteWtSp = false; build 12-Sep-2018 15:30:24 + casacore::Bool _mustInitWtSp = false; build 12-Sep-2018 15:30:24 + casacore::Bool _mustWriteSig = false; build 12-Sep-2018 15:30:24 + casacore::Bool _mustWriteSigSp = false; build 12-Sep-2018 15:30:24 + casacore::Bool _mustInitSigSp = false; build 12-Sep-2018 15:30:24 + casacore::Bool _possiblyWriteSigma = false; build 12-Sep-2018 15:30:24 + casacore::Bool _preview = false; build 12-Sep-2018 15:30:24 + casacore::String _dataColumn = ""; build 12-Sep-2018 15:30:24 + casacore::Bool _doChanBin = false; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // determine if the MS has a WEIGHT/SIGMA_SPECTRUM column, if it must build 12-Sep-2018 15:30:24 + // be written, and/or if it must be initialized. build 12-Sep-2018 15:30:24 + void _dealWithSpectrumColumn( build 12-Sep-2018 15:30:24 + casacore::Bool& hasSpec, casacore::Bool& mustWriteSpec, build 12-Sep-2018 15:30:24 + casacore::Bool& mustInitSpec, casacore::Bool mustWriteNonSpec, build 12-Sep-2018 15:30:24 + const casacore::String& colName, const casacore::String& descName, build 12-Sep-2018 15:30:24 + casacore::Bool specIsInitialized build 12-Sep-2018 15:30:24 + ); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + void _determineFlags(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + void _hasSpectrumIsSpectrumInitialized( build 12-Sep-2018 15:30:24 + casacore::Bool& hasSpectrum, casacore::Bool& spectrumIsInitialzied, build 12-Sep-2018 15:30:24 + casacore::MS::PredefinedColumns col build 12-Sep-2018 15:30:24 + ) const; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + void _initSpecColsIfNecessary(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 diff --git a/code/mstransform/TVI/StatWtTVI.cc b/code/mstransform/TVI/StatWtTVI.cc build 12-Sep-2018 15:30:24 index 89c3dda..81a17ff 100644 build 12-Sep-2018 15:30:24 --- a/code/mstransform/TVI/StatWtTVI.cc build 12-Sep-2018 15:30:24 +++ b/code/mstransform/TVI/StatWtTVI.cc build 12-Sep-2018 15:30:24 @@ -21,6 +21,7 @@ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -64,6 +65,9 @@ StatWtTVI::StatWtTVI(ViImplementation2 * inputVii, const Record &configuration) build 12-Sep-2018 15:30:24 "StatWtTVI requires the MS to have a " build 12-Sep-2018 15:30:24 "DATA column. This MS does not" build 12-Sep-2018 15:30:24 ); build 12-Sep-2018 15:30:24 + _mustComputeSigma = (_column == DATA || _column == RESIDUAL_DATA); build 12-Sep-2018 15:30:24 + _updateWeight = ! _mustComputeSigma build 12-Sep-2018 15:30:24 + || (_mustComputeSigma && ! ms().isColumn(MSMainEnums::CORRECTED_DATA)); build 12-Sep-2018 15:30:24 _noModel = (_column == RESIDUAL || _column == RESIDUAL_DATA) build 12-Sep-2018 15:30:24 && ! origMS.isColumn(MSMainEnums::MODEL_DATA) build 12-Sep-2018 15:30:24 && ! origMS.source().isColumn(MSSourceEnums::SOURCE_MODEL); build 12-Sep-2018 15:30:24 @@ -163,7 +167,6 @@ Bool StatWtTVI::_parseConfiguration(const Record& config) { build 12-Sep-2018 15:30:24 sel.setSpwExpr(val); build 12-Sep-2018 15:30:24 auto chans = sel.getChanList(); build 12-Sep-2018 15:30:24 auto nrows = chans.nrow(); build 12-Sep-2018 15:30:24 - //const auto& myms = ms(); build 12-Sep-2018 15:30:24 MSMetaData md(&ms(), 50); build 12-Sep-2018 15:30:24 auto nchans = md.nChans(); build 12-Sep-2018 15:30:24 IPosition start(3, 0); build 12-Sep-2018 15:30:24 @@ -268,9 +271,9 @@ void StatWtTVI::_configureStatAlg(const Record& config) { build 12-Sep-2018 15:30:24 >(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 - StatisticsAlgorithmFactory< build 12-Sep-2018 15:30:24 - Double, Array::const_iterator, build 12-Sep-2018 15:30:24 - Array::const_iterator build 12-Sep-2018 15:30:24 + casacore::StatisticsAlgorithmFactory< build 12-Sep-2018 15:30:24 + casacore::Double,casacore::Array::const_iterator, build 12-Sep-2018 15:30:24 + casacore::Array::const_iterator build 12-Sep-2018 15:30:24 > saf; build 12-Sep-2018 15:30:24 if (alg.startsWith("ch")) { build 12-Sep-2018 15:30:24 Int maxiter = -1; build 12-Sep-2018 15:30:24 @@ -410,7 +413,7 @@ void StatWtTVI::_setChanBinMap(const casacore::Quantity& binWidth) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - // weight spectrum must be written build 12-Sep-2018 15:30:24 + // weight spectrum must be computed build 12-Sep-2018 15:30:24 _mustComputeWtSp.reset(new Bool(True)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -428,7 +431,7 @@ void StatWtTVI::_setChanBinMap(Int binWidth) { build 12-Sep-2018 15:30:24 _chanBins[i].push_back(bin); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - // weight spectrum must be written build 12-Sep-2018 15:30:24 + // weight spectrum must be computed build 12-Sep-2018 15:30:24 _mustComputeWtSp.reset(new Bool(True)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -474,7 +477,29 @@ Double StatWtTVI::getTimeBinWidthUsingInterval(const casacore::MeasurementSet *c build 12-Sep-2018 15:30:24 return n*stats.median; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -//void StatWtTVI::_initialize() {} build 12-Sep-2018 15:30:24 +void StatWtTVI::sigmaSpectrum(Cube& sigmaSp) const { build 12-Sep-2018 15:30:24 + if (_mustComputeSigma) { build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + Cube wtsp; build 12-Sep-2018 15:30:24 + // this computes _newWtsp, ignore wtsp build 12-Sep-2018 15:30:24 + weightSpectrum(wtsp); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + sigmaSp = Float(1.0)/sqrt(_newWtSp); build 12-Sep-2018 15:30:24 + if (anyEQ(_newWtSp, Float(0))) { build 12-Sep-2018 15:30:24 + Matrix::iterator iter = sigmaSp.begin(); build 12-Sep-2018 15:30:24 + Matrix::iterator end = sigmaSp.end(); build 12-Sep-2018 15:30:24 + Matrix::iterator witer = _newWtSp.begin(); build 12-Sep-2018 15:30:24 + for ( ; iter != end; ++iter, ++witer) { build 12-Sep-2018 15:30:24 + if (*witer == 0) { build 12-Sep-2018 15:30:24 + *iter = -1; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + TransformingVi2::sigmaSpectrum(sigmaSp); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void StatWtTVI::weightSpectrum(Cube& newWtsp) const { build 12-Sep-2018 15:30:24 ThrowIf(! _weightsComputed, "Weights have not been computed yet"); build 12-Sep-2018 15:30:24 @@ -484,11 +509,21 @@ void StatWtTVI::weightSpectrum(Cube& newWtsp) const { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 if (! _newWtSp.empty()) { build 12-Sep-2018 15:30:24 // already calculated build 12-Sep-2018 15:30:24 - newWtsp = _newWtSp.copy(); build 12-Sep-2018 15:30:24 + if (_updateWeight) { build 12-Sep-2018 15:30:24 + newWtsp = _newWtSp.copy(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + TransformingVi2::weightSpectrum(newWtsp); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 _computeWeightSpectrumAndFlags(); build 12-Sep-2018 15:30:24 - newWtsp = _newWtSp.copy(); build 12-Sep-2018 15:30:24 + if (_updateWeight) { build 12-Sep-2018 15:30:24 + newWtsp = _newWtSp.copy(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + TransformingVi2::weightSpectrum(newWtsp); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void StatWtTVI::_computeWeightSpectrumAndFlags() const { build 12-Sep-2018 15:30:24 @@ -605,32 +640,20 @@ void StatWtTVI::_updateWtSpFlags( build 12-Sep-2018 15:30:24 Cube& wtsp, Cube& flags, build 12-Sep-2018 15:30:24 Bool& checkFlags, const Slicer& slice, Float wt build 12-Sep-2018 15:30:24 ) const { build 12-Sep-2018 15:30:24 + // writable array reference build 12-Sep-2018 15:30:24 auto flagSlice = flags(slice); build 12-Sep-2018 15:30:24 if (*_mustComputeWtSp) { build 12-Sep-2018 15:30:24 + // writable array reference build 12-Sep-2018 15:30:24 auto wtSlice = wtsp(slice); build 12-Sep-2018 15:30:24 wtSlice = wt; build 12-Sep-2018 15:30:24 - // do this before we potentially flag data build 12-Sep-2018 15:30:24 + // update global stats before we potentially flag data build 12-Sep-2018 15:30:24 auto mask = ! flagSlice; build 12-Sep-2018 15:30:24 _wtStats->addData(wtSlice.begin(), mask.begin(), wtSlice.size()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - auto flagShape = flags.shape(); build 12-Sep-2018 15:30:24 - auto ncorr = flagShape[0]; build 12-Sep-2018 15:30:24 - auto nrow = flagShape[2]; build 12-Sep-2018 15:30:24 - Matrix maskmat(ncorr, nrow); build 12-Sep-2018 15:30:24 - IPosition start(3, 0); build 12-Sep-2018 15:30:24 - IPosition end(3, ncorr, flagShape[1], nrow); build 12-Sep-2018 15:30:24 - Slicer sl(start, end, Slicer::endIsLength); build 12-Sep-2018 15:30:24 - for (uInt corr=0; corr wtmat; build 12-Sep-2018 15:30:24 - weight(wtmat); build 12-Sep-2018 15:30:24 - _wtStats->addData(wtmat.begin(), maskmat.begin(), wtmat.size()); build 12-Sep-2018 15:30:24 + else if (! allTrue(flagSlice)) { build 12-Sep-2018 15:30:24 + // we don't need to compute WEIGHT_SPECTRUM, and the slice isn't build 12-Sep-2018 15:30:24 + // entirely flagged, so we need to update the WEIGHT column stats build 12-Sep-2018 15:30:24 + _wtStats->addData(Array(IPosition(1, 1), wt).begin(), 1); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 if ( build 12-Sep-2018 15:30:24 wt == 0 build 12-Sep-2018 15:30:24 @@ -655,10 +678,38 @@ std::pair, Cube> StatWtTVI::_getLowerLayerWtSpFlags( build 12-Sep-2018 15:30:24 return mypair; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +void StatWtTVI::sigma(Matrix& sigmaMat) const { build 12-Sep-2018 15:30:24 + if (_mustComputeSigma) { build 12-Sep-2018 15:30:24 + if (_newWt.empty()) { build 12-Sep-2018 15:30:24 + Matrix wtmat; build 12-Sep-2018 15:30:24 + weight(wtmat); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + sigmaMat = Float(1.0)/sqrt(_newWt); build 12-Sep-2018 15:30:24 + if (anyEQ(_newWt, Float(0))) { build 12-Sep-2018 15:30:24 + Matrix::iterator iter = sigmaMat.begin(); build 12-Sep-2018 15:30:24 + Matrix::iterator end = sigmaMat.end(); build 12-Sep-2018 15:30:24 + Matrix::iterator witer = _newWt.begin(); build 12-Sep-2018 15:30:24 + for ( ; iter != end; ++iter, ++witer) { build 12-Sep-2018 15:30:24 + if (*witer == 0) { build 12-Sep-2018 15:30:24 + *iter = -1; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + TransformingVi2::sigma(sigmaMat); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 void StatWtTVI::weight(Matrix & wtmat) const { build 12-Sep-2018 15:30:24 ThrowIf(! _weightsComputed, "Weights have not been computed yet"); build 12-Sep-2018 15:30:24 if (! _newWt.empty()) { build 12-Sep-2018 15:30:24 - wtmat = _newWt.copy(); build 12-Sep-2018 15:30:24 + if (_updateWeight) { build 12-Sep-2018 15:30:24 + wtmat = _newWt.copy(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + TransformingVi2::weight(wtmat); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 auto nrows = nRows(); build 12-Sep-2018 15:30:24 @@ -666,13 +717,15 @@ void StatWtTVI::weight(Matrix & wtmat) const { build 12-Sep-2018 15:30:24 if (*_mustComputeWtSp) { build 12-Sep-2018 15:30:24 // always use classical algorithm to get median for weights build 12-Sep-2018 15:30:24 ClassicalStatistics::const_iterator, Array::const_iterator> cs; build 12-Sep-2018 15:30:24 - Cube newWtsp; build 12-Sep-2018 15:30:24 + Cube wtsp; build 12-Sep-2018 15:30:24 Cube flagCube; build 12-Sep-2018 15:30:24 - weightSpectrum(newWtsp); build 12-Sep-2018 15:30:24 + // this computes _newWtsP which is what we will use, so build 12-Sep-2018 15:30:24 + // just ignore wtsp build 12-Sep-2018 15:30:24 + weightSpectrum(wtsp); build 12-Sep-2018 15:30:24 flag(flagCube); build 12-Sep-2018 15:30:24 IPosition blc(3, 0); build 12-Sep-2018 15:30:24 - IPosition trc = newWtsp.shape() - 1; build 12-Sep-2018 15:30:24 - const auto ncorr = newWtsp.shape()[0]; build 12-Sep-2018 15:30:24 + IPosition trc = _newWtSp.shape() - 1; build 12-Sep-2018 15:30:24 + const auto ncorr = _newWtSp.shape()[0]; build 12-Sep-2018 15:30:24 for (Int i=0; i & wtmat) const { build 12-Sep-2018 15:30:24 wtmat.column(i) = 0; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 - auto weights = newWtsp(blc, trc); build 12-Sep-2018 15:30:24 + auto weights = _newWtSp(blc, trc); build 12-Sep-2018 15:30:24 auto mask = ! flags; build 12-Sep-2018 15:30:24 cs.setData(weights.begin(), mask.begin(), weights.size()); build 12-Sep-2018 15:30:24 wtmat.column(i) = cs.getMedian(); build 12-Sep-2018 15:30:24 @@ -692,7 +745,7 @@ void StatWtTVI::weight(Matrix & wtmat) const { build 12-Sep-2018 15:30:24 for (uInt corr=0; corr & wtmat) const { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 _newWt = wtmat.copy(); build 12-Sep-2018 15:30:24 + if (! _updateWeight) { build 12-Sep-2018 15:30:24 + wtmat = Matrix(wtmat.shape()); build 12-Sep-2018 15:30:24 + TransformingVi2::weight(wtmat); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void StatWtTVI::_weightSingleChanBinBlockTimeProcessing( build 12-Sep-2018 15:30:24 @@ -1215,6 +1272,12 @@ void StatWtTVI::initWeightSpectrum (const casacore::Cube& wtspe build 12-Sep-2018 15:30:24 getVii()->initWeightSpectrum(wtspec); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +void StatWtTVI::initSigmaSpectrum (const casacore::Cube& sigspec) { build 12-Sep-2018 15:30:24 + // Pass to next layer down build 12-Sep-2018 15:30:24 + getVii()->initSigmaSpectrum(sigspec); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 void StatWtTVI::writeBackChanges(VisBuffer2 *vb) { build 12-Sep-2018 15:30:24 // Pass to next layer down build 12-Sep-2018 15:30:24 getVii()->writeBackChanges(vb); build 12-Sep-2018 15:30:24 diff --git a/code/mstransform/TVI/StatWtTVI.h b/code/mstransform/TVI/StatWtTVI.h build 12-Sep-2018 15:30:24 index 9a84cd0..e2e61bb 100644 build 12-Sep-2018 15:30:24 --- a/code/mstransform/TVI/StatWtTVI.h build 12-Sep-2018 15:30:24 +++ b/code/mstransform/TVI/StatWtTVI.h build 12-Sep-2018 15:30:24 @@ -77,16 +77,26 @@ public: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 virtual ~StatWtTVI(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + virtual casacore::String ViiType() const { build 12-Sep-2018 15:30:24 + return casacore::String("StatWt( ") + getVii()->ViiType() + " )"; build 12-Sep-2018 15:30:24 + }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 void initWeightSpectrum (const casacore::Cube& wtspec); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + void initSigmaSpectrum (const casacore::Cube& sigspec); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 void next(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void origin(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 virtual void weightSpectrum(casacore::Cube& wtsp) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + virtual void sigmaSpectrum(casacore::Cube& sigmaSp) const; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 virtual void weight(casacore::Matrix & wtmat) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + virtual void sigma(casacore::Matrix & sigmaMat) const; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 virtual void flag(casacore::Cube& flagCube) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 virtual void flagRow (casacore::Vector & flagRow) const; build 12-Sep-2018 15:30:24 @@ -202,6 +212,8 @@ private: build 12-Sep-2018 15:30:24 mutable std::map _rowIDInMSTorowIndexInChunk; build 12-Sep-2018 15:30:24 casacore::Double _slidingTimeWindowWidth = -1; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + casacore::Bool _mustComputeSigma = casacore::False; build 12-Sep-2018 15:30:24 + casacore::Bool _updateWeight = casacore::True; build 12-Sep-2018 15:30:24 casacore::Bool _noModel = casacore::False; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 SHARED_PTR< build 12-Sep-2018 15:30:24 diff --git a/code/msvis/MSVis/MSIter2.cc b/code/msvis/MSVis/MSIter2.cc build 12-Sep-2018 15:30:24 index 6626719..12bf2b0 100644 build 12-Sep-2018 15:30:24 --- a/code/msvis/MSVis/MSIter2.cc build 12-Sep-2018 15:30:24 +++ b/code/msvis/MSVis/MSIter2.cc build 12-Sep-2018 15:30:24 @@ -378,7 +378,7 @@ void MSIter2::construct2(const Block& sortColumns, build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -MSIter2::MSIter2(const MSIter2& other) build 12-Sep-2018 15:30:24 +MSIter2::MSIter2(const MSIter2& other): MSIter(other) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 operator=(other); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/msvis/MSVis/TransformingVi2.h b/code/msvis/MSVis/TransformingVi2.h build 12-Sep-2018 15:30:24 index fe2f51e..44b758d 100644 build 12-Sep-2018 15:30:24 --- a/code/msvis/MSVis/TransformingVi2.h build 12-Sep-2018 15:30:24 +++ b/code/msvis/MSVis/TransformingVi2.h build 12-Sep-2018 15:30:24 @@ -548,7 +548,7 @@ public: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Write/modify the weightSpectrum build 12-Sep-2018 15:30:24 virtual void writeWeightSpectrum (const casacore::Cube & wtsp); build 12-Sep-2018 15:30:24 - virtual void writeSigmaSpectrum (const casacore::Cube & wtsp); build 12-Sep-2018 15:30:24 + virtual void writeSigmaSpectrum (const casacore::Cube & sigsp); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Write/modify the Sigma build 12-Sep-2018 15:30:24 virtual void writeSigma (const casacore::Matrix & sig); build 12-Sep-2018 15:30:24 diff --git a/code/msvis/MSVis/VisBuffer.cc b/code/msvis/MSVis/VisBuffer.cc build 12-Sep-2018 15:30:24 index c5119d0..671e27e 100644 build 12-Sep-2018 15:30:24 --- a/code/msvis/MSVis/VisBuffer.cc build 12-Sep-2018 15:30:24 +++ b/code/msvis/MSVis/VisBuffer.cc build 12-Sep-2018 15:30:24 @@ -57,8 +57,6 @@ using namespace casacore; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -MSIter msi; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 VisBuffer::VisBuffer() build 12-Sep-2018 15:30:24 : corrSorted_p(false), build 12-Sep-2018 15:30:24 lastPointTableRow_p(0), build 12-Sep-2018 15:30:24 diff --git a/code/msvis/MSVis/VisibilityIteratorImpl2.cc b/code/msvis/MSVis/VisibilityIteratorImpl2.cc build 12-Sep-2018 15:30:24 index 94c5522..02ee886 100644 build 12-Sep-2018 15:30:24 --- a/code/msvis/MSVis/VisibilityIteratorImpl2.cc build 12-Sep-2018 15:30:24 +++ b/code/msvis/MSVis/VisibilityIteratorImpl2.cc build 12-Sep-2018 15:30:24 @@ -3904,6 +3904,8 @@ VisibilityIteratorImpl2::initializeBackWriters() build 12-Sep-2018 15:30:24 makeBackWriter(& VisibilityIteratorImpl2::writeWeight, & VisBuffer2::weight); build 12-Sep-2018 15:30:24 backWriters_p[VisBufferComponent2::WeightSpectrum] = build 12-Sep-2018 15:30:24 makeBackWriter(& VisibilityIteratorImpl2::writeWeightSpectrum, & VisBuffer2::weightSpectrum); build 12-Sep-2018 15:30:24 + backWriters_p[VisBufferComponent2::SigmaSpectrum] = build 12-Sep-2018 15:30:24 + makeBackWriter(& VisibilityIteratorImpl2::writeSigmaSpectrum, & VisBuffer2::sigmaSpectrum); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Now do the visibilities. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/plotms/CMakeLists.txt b/code/plotms/CMakeLists.txt build 12-Sep-2018 15:30:24 index 5076505..967a482 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/CMakeLists.txt build 12-Sep-2018 15:30:24 +++ b/code/plotms/CMakeLists.txt build 12-Sep-2018 15:30:24 @@ -289,31 +289,21 @@ INSTALL (FILES build 12-Sep-2018 15:30:24 casa_add_executable( plotms casaplotms apps/casaplotms/casaplotms.cc ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #TESTING build 12-Sep-2018 15:30:24 -# These tests cannot be run on build server -- no display build 12-Sep-2018 15:30:24 -# plotms tested in python with test_plotms.py build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dAveragingChannel.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dAveragingTime.cc ) build 12-Sep-2018 15:30:24 +# The app tests cannot be run on build server -- no display, build 12-Sep-2018 15:30:24 +# so plotms tested in python with test_plotms.py (with xvfb). build 12-Sep-2018 15:30:24 +# Kept one demo dExportPlot to demonstrate running app from C++ build 12-Sep-2018 15:30:24 +# and one test program for just loading cache, build 12-Sep-2018 15:30:24 +# useful for debugging GTs. build 12-Sep-2018 15:30:24 casa_add_demo( plotms test/dExportPlot.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dDataSelection.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dSymbol.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dLegend.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dOverPlot.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dOverPlot2Files.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dOverLeftRightPlot.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dOverIterationPlot.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dExportRange.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dExportRangeRightTop.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dExportRangeRightBottom.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dExportRangeLeftTop.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dExportRangeLeftBottom.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dExportRangeInternal.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dExportRangePipeline.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dTimeColorization.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dMultiplePlotTypes.cc) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dTimeColorizationAveraging.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dTimeIteration.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dTimeAveragingIteration.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dGridPlacement.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dGridPlacementMultiplePlots.cc ) build 12-Sep-2018 15:30:24 -casa_add_demo( plotms test/dGridPlacementMultipleRuns.cc ) build 12-Sep-2018 15:30:24 +casa_add_demo( plotms test/dCacheData.cc ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +casa_add_google_test( MODULES plotms SOURCES test/PlotMSCacheMetadata_GT.cc ) build 12-Sep-2018 15:30:24 +casa_add_google_test( MODULES plotms SOURCES test/PlotMSCacheVis_GT.cc ) build 12-Sep-2018 15:30:24 +casa_add_google_test( MODULES plotms SOURCES test/PlotMSCacheGeom_GT.cc ) build 12-Sep-2018 15:30:24 +casa_add_google_test( MODULES plotms SOURCES test/PlotMSCacheInvalid_GT.cc ) build 12-Sep-2018 15:30:24 +casa_add_google_test( MODULES plotms SOURCES test/PlotMSCacheLtdVis_GT.cc ) build 12-Sep-2018 15:30:24 +casa_add_google_test( MODULES plotms SOURCES test/PlotMSCacheOverlays_GT.cc ) build 12-Sep-2018 15:30:24 +casa_add_google_test( MODULES plotms SOURCES test/PlotMSCacheCallib_GT.cc ) build 12-Sep-2018 15:30:24 +casa_add_google_test( MODULES plotms SOURCES test/PlotMSCacheSelection_GT.cc ) build 12-Sep-2018 15:30:24 +casa_add_google_test( MODULES plotms SOURCES test/PlotMSCacheTransform_GT.cc ) build 12-Sep-2018 15:30:24 +casa_add_google_test( MODULES plotms SOURCES test/PlotMSCacheAveraging_GT.cc ) build 12-Sep-2018 15:30:24 diff --git a/code/plotms/Data/CalCache.cc b/code/plotms/Data/CalCache.cc build 12-Sep-2018 15:30:24 index 8b01e89..ad78db1 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/Data/CalCache.cc build 12-Sep-2018 15:30:24 +++ b/code/plotms/Data/CalCache.cc build 12-Sep-2018 15:30:24 @@ -51,8 +51,8 @@ namespace casa { build 12-Sep-2018 15:30:24 CalCache::CalCache(PlotMSApp* parent): build 12-Sep-2018 15:30:24 PlotMSCacheBase(parent), build 12-Sep-2018 15:30:24 divZero_(False), build 12-Sep-2018 15:30:24 - ci_p(NULL), build 12-Sep-2018 15:30:24 - wci_p(NULL), build 12-Sep-2018 15:30:24 + ci_p(nullptr), build 12-Sep-2018 15:30:24 + wci_p(nullptr), build 12-Sep-2018 15:30:24 basis_("unknown"), build 12-Sep-2018 15:30:24 parsAreComplex_(False), build 12-Sep-2018 15:30:24 msname_("") build 12-Sep-2018 15:30:24 @@ -101,7 +101,8 @@ void CalCache::loadIt(vector& loadAxes, build 12-Sep-2018 15:30:24 setFilename(filename_); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Trap unsupported modes: cal types, averaging, transforms, poln ratio build 12-Sep-2018 15:30:24 - if (calType_[0]=='A' || calType_[0]=='M' || calType_[0]=='X') { build 12-Sep-2018 15:30:24 + if (calType_[0]=='A' || calType_[0]=='M' || build 12-Sep-2018 15:30:24 + (calType_[0]=='X' && calType_.contains("Mueller"))) { build 12-Sep-2018 15:30:24 throw AipsError("Cal table type " + calType_ + " is unsupported in plotms. Please continue to use plotcal."); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -147,10 +148,11 @@ void CalCache::loadIt(vector& loadAxes, build 12-Sep-2018 15:30:24 void CalCache::loadNewCalTable(vector& loadAxes, build 12-Sep-2018 15:30:24 vector& loadData, ThreadCommunication* thread) { build 12-Sep-2018 15:30:24 // Get various names, properties from cal table build 12-Sep-2018 15:30:24 - NewCalTable ct(NewCalTable::createCT(filename_, Table::Old, Table::Plain)); build 12-Sep-2018 15:30:24 - basis_ = ct.polBasis(); build 12-Sep-2018 15:30:24 - parsAreComplex_ = ct.isComplex(); build 12-Sep-2018 15:30:24 - ROCTColumns ctCol(ct); build 12-Sep-2018 15:30:24 + TableLock lock(TableLock::AutoNoReadLocking); build 12-Sep-2018 15:30:24 + NewCalTable* ct = new NewCalTable(filename_, lock, Table::Old, Table::Plain); build 12-Sep-2018 15:30:24 + basis_ = ct->polBasis(); build 12-Sep-2018 15:30:24 + parsAreComplex_ = ct->isComplex(); build 12-Sep-2018 15:30:24 + ROCTColumns ctCol(*ct); build 12-Sep-2018 15:30:24 antnames_ = ctCol.antenna().name().getColumn(); build 12-Sep-2018 15:30:24 stanames_ = ctCol.antenna().station().getColumn(); build 12-Sep-2018 15:30:24 antstanames_ = antnames_ + String("@") + stanames_; build 12-Sep-2018 15:30:24 @@ -158,18 +160,33 @@ void CalCache::loadNewCalTable(vector& loadAxes, build 12-Sep-2018 15:30:24 positions_ = ctCol.antenna().position().getColumn(); build 12-Sep-2018 15:30:24 nAnt_ = ctCol.antenna().nrow(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - setUpCalIter(filename_,selection_, True,True,True); build 12-Sep-2018 15:30:24 + // Apply selection to get selected cal table build 12-Sep-2018 15:30:24 + NewCalTable* selct = new NewCalTable(); build 12-Sep-2018 15:30:24 + Vector > chansel; build 12-Sep-2018 15:30:24 + Vector > corrsel; build 12-Sep-2018 15:30:24 + selection_.apply(*ct, *selct, chansel, corrsel); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + Bool readonly(True); // no write access for loading cache build 12-Sep-2018 15:30:24 + setUpCalIter(*selct, readonly); build 12-Sep-2018 15:30:24 countChunks(*ci_p, loadAxes, loadData, thread); build 12-Sep-2018 15:30:24 loadCalChunks(*ci_p, loadAxes, thread); build 12-Sep-2018 15:30:24 - if (ci_p) build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // delete NCT and iter to release table locks build 12-Sep-2018 15:30:24 + if (ct != nullptr) { build 12-Sep-2018 15:30:24 + delete ct; build 12-Sep-2018 15:30:24 + ct = nullptr; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (selct != nullptr) { build 12-Sep-2018 15:30:24 + delete selct; build 12-Sep-2018 15:30:24 + selct = nullptr; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (ci_p != nullptr) { build 12-Sep-2018 15:30:24 delete ci_p; build 12-Sep-2018 15:30:24 - ci_p = NULL; build 12-Sep-2018 15:30:24 + ci_p = nullptr; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -void CalCache::setUpCalIter(const String& ctname, build 12-Sep-2018 15:30:24 - PlotMSSelection& selection, Bool readonly, build 12-Sep-2018 15:30:24 - Bool /*chanselect*/, Bool /*corrselect*/) { build 12-Sep-2018 15:30:24 - // for NewCalTable build 12-Sep-2018 15:30:24 +void CalCache::setUpCalIter(NewCalTable& selct, Bool readonly) { build 12-Sep-2018 15:30:24 Int nsortcol(4); build 12-Sep-2018 15:30:24 Block columns(nsortcol); build 12-Sep-2018 15:30:24 columns[0]="SCAN_NUMBER"; build 12-Sep-2018 15:30:24 @@ -177,37 +194,15 @@ void CalCache::setUpCalIter(const String& ctname, build 12-Sep-2018 15:30:24 columns[2]="SPECTRAL_WINDOW_ID"; build 12-Sep-2018 15:30:24 columns[3]="TIME"; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Now open the MS, select on it, make the VisIter build 12-Sep-2018 15:30:24 - TableLock lock(TableLock::AutoNoReadLocking); build 12-Sep-2018 15:30:24 - Table::TableOption tabopt(Table::Update); build 12-Sep-2018 15:30:24 - if (readonly) tabopt = Table::Old; build 12-Sep-2018 15:30:24 - NewCalTable ct(ctname, lock, tabopt, Table::Plain); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Apply selection build 12-Sep-2018 15:30:24 - NewCalTable selct; build 12-Sep-2018 15:30:24 - Vector > chansel; build 12-Sep-2018 15:30:24 - Vector > corrsel; build 12-Sep-2018 15:30:24 - selection.apply(ct, selct, chansel, corrsel); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // setup the volume meter build 12-Sep-2018 15:30:24 - // vm_.reset(); build 12-Sep-2018 15:30:24 - // vm_= PMSCacheVolMeter(ms,averaging_,chansel,corrsel); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 if (readonly) { build 12-Sep-2018 15:30:24 // Readonly version, for caching build 12-Sep-2018 15:30:24 - ci_p = new ROCTIter(selct,columns); build 12-Sep-2018 15:30:24 - wci_p =NULL; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 + ci_p = new ROCTIter(selct, columns); build 12-Sep-2018 15:30:24 + wci_p = nullptr; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 // Writable, e.g. for flagging build 12-Sep-2018 15:30:24 - wci_p = new CTIter(selct,columns); build 12-Sep-2018 15:30:24 + wci_p = new CTIter(selct, columns); build 12-Sep-2018 15:30:24 ci_p = wci_p; // const access build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Apply chan/corr selection build 12-Sep-2018 15:30:24 - //if (chanselect) rci_p->selectChannel(chansel); build 12-Sep-2018 15:30:24 - //if (corrselect) rci_p->selectCorrelation(corrsel); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void CalCache::countChunks(ROCTIter& ci, build 12-Sep-2018 15:30:24 @@ -215,8 +210,7 @@ void CalCache::countChunks(ROCTIter& ci, build 12-Sep-2018 15:30:24 vector& loadData, build 12-Sep-2018 15:30:24 ThreadCommunication* thread) { build 12-Sep-2018 15:30:24 // for NewCalTable build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - if (thread!=NULL) { build 12-Sep-2018 15:30:24 + if (thread!=nullptr) { build 12-Sep-2018 15:30:24 thread->setStatus("Establishing cache size. Please wait..."); build 12-Sep-2018 15:30:24 thread->setAllowedOperations(false,false,false); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -228,43 +222,18 @@ void CalCache::countChunks(ROCTIter& ci, build 12-Sep-2018 15:30:24 ++chunk; build 12-Sep-2018 15:30:24 ci.next0(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 setCache(chunk, loadAxes, loadData); build 12-Sep-2018 15:30:24 - // cout << " Found " << nChunk_ << " chunks." << endl; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - /* build 12-Sep-2018 15:30:24 -void MSCache::trapExcessVolume(map pendingLoadAxes) { build 12-Sep-2018 15:30:24 - try { build 12-Sep-2018 15:30:24 - String s; build 12-Sep-2018 15:30:24 - s=vm_.evalVolume(pendingLoadAxes,netAxesMask(currentX_,currentY_)); build 12-Sep-2018 15:30:24 - logLoad(s); build 12-Sep-2018 15:30:24 - } catch(AipsError& log) { build 12-Sep-2018 15:30:24 - // catch detected volume excess, clear the existing cache, and rethrow build 12-Sep-2018 15:30:24 - logLoad(log.getMesg()); build 12-Sep-2018 15:30:24 - clear(); build 12-Sep-2018 15:30:24 - stringstream ss; build 12-Sep-2018 15:30:24 - ss << "Please try selecting less data," << endl build 12-Sep-2018 15:30:24 - << "averaging, checking 'Reload' (to clear unneeded cache items)," << endl build 12-Sep-2018 15:30:24 - << "or letting other memory-intensive processes finish."; build 12-Sep-2018 15:30:24 - throw(AipsError(ss.str())); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 void CalCache::loadCalChunks(ROCTIter& ci, build 12-Sep-2018 15:30:24 const vector loadAxes, build 12-Sep-2018 15:30:24 ThreadCommunication* thread) { build 12-Sep-2018 15:30:24 // for NewCalTable build 12-Sep-2018 15:30:24 // permit cancel in progress meter: build 12-Sep-2018 15:30:24 - if(thread != NULL) build 12-Sep-2018 15:30:24 + if(thread != nullptr) build 12-Sep-2018 15:30:24 thread->setAllowedOperations(false,false,true); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 logLoad("Loading chunks......"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Initialize the freq/vel calculator (in case we use it) build 12-Sep-2018 15:30:24 - // vbu_=VisBufferUtil(vb); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 Int chunk(0), lastscan(0), thisscan(0), lastspw(-1), thisspw(0); build 12-Sep-2018 15:30:24 chshapes_.resize(4,nChunk_); build 12-Sep-2018 15:30:24 goodChunk_.resize(nChunk_); build 12-Sep-2018 15:30:24 @@ -273,17 +242,14 @@ void CalCache::loadCalChunks(ROCTIter& ci, build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Reset iterator build 12-Sep-2018 15:30:24 ci.reset(); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 while (!ci.pastEnd()) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // If a thread is given, check if the user canceled. build 12-Sep-2018 15:30:24 - if(thread != NULL && thread->wasCanceled()) { build 12-Sep-2018 15:30:24 + if(thread != nullptr && thread->wasCanceled()) { build 12-Sep-2018 15:30:24 dataLoaded_ = false; build 12-Sep-2018 15:30:24 return; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // If a thread is given, update it. build 12-Sep-2018 15:30:24 - if(thread != NULL && (nChunk_ <= (int)THREAD_SEGMENT || build 12-Sep-2018 15:30:24 + if(thread != nullptr && (nChunk_ <= (int)THREAD_SEGMENT || build 12-Sep-2018 15:30:24 chunk % THREAD_SEGMENT == 0)) { build 12-Sep-2018 15:30:24 thread->setStatus("Loading chunk " + String::toString(chunk) + build 12-Sep-2018 15:30:24 " / " + String::toString(nChunk_) + "."); build 12-Sep-2018 15:30:24 @@ -341,7 +307,7 @@ void CalCache::loadCalChunks(ROCTIter& ci, build 12-Sep-2018 15:30:24 ci.next(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // If a thread is given, update it. build 12-Sep-2018 15:30:24 - if(thread != NULL && (nChunk_ <= (int)THREAD_SEGMENT || build 12-Sep-2018 15:30:24 + if(thread != nullptr && (nChunk_ <= (int)THREAD_SEGMENT || build 12-Sep-2018 15:30:24 chunk % THREAD_SEGMENT == 0)) { build 12-Sep-2018 15:30:24 progress = ((double)chunk+1) / nChunk_; build 12-Sep-2018 15:30:24 thread->setProgress((unsigned int)((progress * 100) + 0.5)); build 12-Sep-2018 15:30:24 @@ -700,11 +666,14 @@ void CalCache::flagToDisk(const PlotMSFlagging& flagging, build 12-Sep-2018 15:30:24 stringstream ss; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Make the VisIterator writable, with selection revised as appropriate build 12-Sep-2018 15:30:24 - Bool selectchan(netAxesMask_[dataIndex](1) && !flagging.channel()); build 12-Sep-2018 15:30:24 - Bool selectcorr(netAxesMask_[dataIndex](0) && !flagging.corrAll()); build 12-Sep-2018 15:30:24 + NewCalTable* ct = new NewCalTable(filename_, Table::Update, Table::Plain); build 12-Sep-2018 15:30:24 + NewCalTable* selct = new NewCalTable(); build 12-Sep-2018 15:30:24 + Vector > chansel; build 12-Sep-2018 15:30:24 + Vector > corrsel; build 12-Sep-2018 15:30:24 + selection_.apply(*ct, *selct, chansel, corrsel); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Set up a write-able CTIter (ci_p also points to it) build 12-Sep-2018 15:30:24 - setUpCalIter(filename_,selection_,False,selectchan,selectcorr); build 12-Sep-2018 15:30:24 + Bool readonly(False); // write access for flagging build 12-Sep-2018 15:30:24 + setUpCalIter(*selct, readonly); build 12-Sep-2018 15:30:24 ci_p->reset(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Int iflag(0); build 12-Sep-2018 15:30:24 @@ -846,11 +815,21 @@ void CalCache::flagToDisk(const PlotMSFlagging& flagging, build 12-Sep-2018 15:30:24 } // flaggable chunk build 12-Sep-2018 15:30:24 } // ichk build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Delete the VisIter so lock is released build 12-Sep-2018 15:30:24 - if (wci_p) build 12-Sep-2018 15:30:24 + // Delete the NCTs and VisIter so lock is released build 12-Sep-2018 15:30:24 + if (ct != nullptr) { build 12-Sep-2018 15:30:24 + delete ct; build 12-Sep-2018 15:30:24 + ct = nullptr; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (selct != nullptr) { build 12-Sep-2018 15:30:24 + delete selct; build 12-Sep-2018 15:30:24 + selct = nullptr; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (wci_p != nullptr) { build 12-Sep-2018 15:30:24 delete wci_p; build 12-Sep-2018 15:30:24 - wci_p=NULL; build 12-Sep-2018 15:30:24 - ci_p=NULL; build 12-Sep-2018 15:30:24 + wci_p = nullptr; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + ci_p = nullptr; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 logFlag(ss.str()); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -861,7 +840,7 @@ void CalCache::flagToDisk(const PlotMSFlagging& flagging, build 12-Sep-2018 15:30:24 void CalCache::countChunks(Int nchunks, vector& loadAxes, build 12-Sep-2018 15:30:24 vector& loadData, ThreadCommunication* thread) { build 12-Sep-2018 15:30:24 // for CalTable build 12-Sep-2018 15:30:24 - if (thread!=NULL) { build 12-Sep-2018 15:30:24 + if (thread!=nullptr) { build 12-Sep-2018 15:30:24 thread->setStatus("Establishing cache size. Please wait..."); build 12-Sep-2018 15:30:24 thread->setAllowedOperations(false,false,false); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -890,7 +869,7 @@ void CalCache::getNamesFromMS() { build 12-Sep-2018 15:30:24 void CalCache::setUpLoad(ThreadCommunication* thread, Slice& parSlice) { build 12-Sep-2018 15:30:24 // common setup for CalTables build 12-Sep-2018 15:30:24 // permit cancel in progress meter: build 12-Sep-2018 15:30:24 - if(thread != NULL) build 12-Sep-2018 15:30:24 + if(thread != nullptr) build 12-Sep-2018 15:30:24 thread->setAllowedOperations(false,false,true); build 12-Sep-2018 15:30:24 logLoad("Loading chunks......"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1104,7 +1083,7 @@ void CalCache::loadCalChunks(ROBJonesPolyMCol& mcol, ROCalDescColumns& dcol, build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // If a thread is given, update it. build 12-Sep-2018 15:30:24 - if(thread != NULL) { build 12-Sep-2018 15:30:24 + if(thread != nullptr) { build 12-Sep-2018 15:30:24 double progress = ((double)row) / nrow; build 12-Sep-2018 15:30:24 thread->setProgress((unsigned int)((progress * 100) + 0.5)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -1498,7 +1477,7 @@ void CalCache::loadCalChunks(ROGJonesSplineMCol& mcol, ROCalDescColumns& dcol, build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // If a thread is given, update it. build 12-Sep-2018 15:30:24 - if(thread != NULL) { build 12-Sep-2018 15:30:24 + if(thread != nullptr) { build 12-Sep-2018 15:30:24 double progress = ((double)sample) / nsample; build 12-Sep-2018 15:30:24 thread->setProgress((unsigned int)((progress * 100) + 0.5)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/plotms/Data/CalCache.h b/code/plotms/Data/CalCache.h build 12-Sep-2018 15:30:24 index 0b53e2b..1e86161 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/Data/CalCache.h build 12-Sep-2018 15:30:24 +++ b/code/plotms/Data/CalCache.h build 12-Sep-2018 15:30:24 @@ -84,7 +84,7 @@ protected: build 12-Sep-2018 15:30:24 // CAL-specific loadIt method build 12-Sep-2018 15:30:24 virtual void loadIt(vector& loadAxes, build 12-Sep-2018 15:30:24 vector& loadData, build 12-Sep-2018 15:30:24 - ThreadCommunication* thread = NULL); build 12-Sep-2018 15:30:24 + ThreadCommunication* thread = nullptr); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 private: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -93,10 +93,8 @@ private: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // NewCalTable: build 12-Sep-2018 15:30:24 void loadNewCalTable(vector& loadAxes, build 12-Sep-2018 15:30:24 - vector& loadData, ThreadCommunication* thread = NULL); build 12-Sep-2018 15:30:24 - void setUpCalIter(const casacore::String& calname, PlotMSSelection& selection, build 12-Sep-2018 15:30:24 - casacore::Bool readonly=true, casacore::Bool chanselect=true, build 12-Sep-2018 15:30:24 - casacore::Bool corrselect=true); build 12-Sep-2018 15:30:24 + vector& loadData, ThreadCommunication* thread = nullptr); build 12-Sep-2018 15:30:24 + void setUpCalIter(NewCalTable& selct, casacore::Bool readonly=True); build 12-Sep-2018 15:30:24 void countChunks(ROCTIter& ci, build 12-Sep-2018 15:30:24 vector& loadAxes, build 12-Sep-2018 15:30:24 vector& loadData, build 12-Sep-2018 15:30:24 @@ -121,7 +119,7 @@ private: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // BPOLY CalTable: build 12-Sep-2018 15:30:24 void loadBPoly(vector& loadAxes, build 12-Sep-2018 15:30:24 - vector& loadData, ThreadCommunication* thread = NULL); build 12-Sep-2018 15:30:24 + vector& loadData, ThreadCommunication* thread = nullptr); build 12-Sep-2018 15:30:24 void loadCalChunks(ROBJonesPolyMCol& mcol, ROCalDescColumns& dcol, build 12-Sep-2018 15:30:24 casacore::Int nrow, const vector loadAxes, build 12-Sep-2018 15:30:24 casacore::Vector >& chansel, build 12-Sep-2018 15:30:24 @@ -140,7 +138,7 @@ private: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // GSPLINE CalTable: build 12-Sep-2018 15:30:24 void loadGSpline(vector& loadAxes, build 12-Sep-2018 15:30:24 - vector& loadData, ThreadCommunication* thread = NULL); build 12-Sep-2018 15:30:24 + vector& loadData, ThreadCommunication* thread = nullptr); build 12-Sep-2018 15:30:24 void loadCalChunks(ROGJonesSplineMCol& mcol, ROCalDescColumns& dcol, build 12-Sep-2018 15:30:24 casacore::Int nsample, const vector loadAxes, build 12-Sep-2018 15:30:24 casacore::Vector& selectedAnts, ThreadCommunication* thread); build 12-Sep-2018 15:30:24 @@ -166,8 +164,7 @@ private: build 12-Sep-2018 15:30:24 // Volume meter for volume calculation build 12-Sep-2018 15:30:24 // PMSCacheVolMeter vm_; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // NewCalTable build 12-Sep-2018 15:30:24 - // cal table iterator pointers build 12-Sep-2018 15:30:24 + // NewCalTable iterator pointers build 12-Sep-2018 15:30:24 ROCTIter* ci_p; build 12-Sep-2018 15:30:24 CTIter* wci_p; build 12-Sep-2018 15:30:24 // The polarization basis build 12-Sep-2018 15:30:24 diff --git a/code/plotms/Data/MSCache.cc b/code/plotms/Data/MSCache.cc build 12-Sep-2018 15:30:24 index be3c60a..f51571c 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/Data/MSCache.cc build 12-Sep-2018 15:30:24 +++ b/code/plotms/Data/MSCache.cc build 12-Sep-2018 15:30:24 @@ -127,7 +127,7 @@ void MSCache::loadIt(vector& loadAxes, build 12-Sep-2018 15:30:24 logWarn(PMS::LOG_ORIGIN_LOAD_CACHE, "Scalar averaging ignored: no other averaging is enabled."); build 12-Sep-2018 15:30:24 averaging_.setScalarAve(useScalarAve); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if ( averaging_.baseline() || averaging_.antenna() || useScalarAve) { build 12-Sep-2018 15:30:24 + if ( averaging_.baseline() || averaging_.antenna() || averaging_.spw() || useScalarAve) { build 12-Sep-2018 15:30:24 // Averaging with PlotMSVBAverager build 12-Sep-2018 15:30:24 // Create visibility iterator vi_p build 12-Sep-2018 15:30:24 setUpVisIter(selection_, calibration_, dataColumn_, build 12-Sep-2018 15:30:24 @@ -285,12 +285,12 @@ String MSCache::getDataColumn(vector& loadAxes, build 12-Sep-2018 15:30:24 PMS::DataColumn MSCache::checkReqDataColumn(PMS::DataColumn reqDataCol) { build 12-Sep-2018 15:30:24 // Check if requested data, scratch, or float cols exist build 12-Sep-2018 15:30:24 PMS::DataColumn datacol = reqDataCol; build 12-Sep-2018 15:30:24 - Bool datacolOk(false), corcolOk(false), floatcolOk(false); build 12-Sep-2018 15:30:24 Table thisTable(filename_); build 12-Sep-2018 15:30:24 const ColumnDescSet cds = thisTable.tableDesc().columnDescSet(); build 12-Sep-2018 15:30:24 - datacolOk = cds.isDefined("DATA"); build 12-Sep-2018 15:30:24 - corcolOk = cds.isDefined("CORRECTED_DATA"); build 12-Sep-2018 15:30:24 - floatcolOk = cds.isDefined("FLOAT_DATA"); build 12-Sep-2018 15:30:24 + Bool datacolOk(cds.isDefined("DATA")), build 12-Sep-2018 15:30:24 + corrcolOk(cds.isDefined("CORRECTED_DATA") || calibration_.useCallib()), build 12-Sep-2018 15:30:24 + modelcolOk(cds.isDefined("MODEL_DATA")), build 12-Sep-2018 15:30:24 + floatcolOk(cds.isDefined("FLOAT_DATA")); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 switch (reqDataCol) { build 12-Sep-2018 15:30:24 case PMS::DATA: { build 12-Sep-2018 15:30:24 @@ -301,33 +301,80 @@ PMS::DataColumn MSCache::checkReqDataColumn(PMS::DataColumn reqDataCol) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - case PMS::CORRECTED: build 12-Sep-2018 15:30:24 - case PMS::CORRECTED_DIVIDE_MODEL: build 12-Sep-2018 15:30:24 - case PMS::CORRMODEL: { build 12-Sep-2018 15:30:24 + case PMS::CORRECTED: { build 12-Sep-2018 15:30:24 // requested corrected data but no (real or OTF) corrected column build 12-Sep-2018 15:30:24 - if (!corcolOk && !calibration_.useCallib()) { build 12-Sep-2018 15:30:24 + if (!corrcolOk) { build 12-Sep-2018 15:30:24 if (datacolOk) { build 12-Sep-2018 15:30:24 // CAS-5214 - use DATA if no CORRECTED_DATA with warning build 12-Sep-2018 15:30:24 datacol = PMS::DATA; build 12-Sep-2018 15:30:24 - logWarn( "load_cache", "CORRECTED_DATA column not present and calibration library not set or enabled; will use DATA instead."); build 12-Sep-2018 15:30:24 + logWarn( "load_cache", "CORRECTED_DATA column not present and calibration library not set/enabled; will use DATA instead of CORRECTED or residuals."); build 12-Sep-2018 15:30:24 } else if (floatcolOk) { build 12-Sep-2018 15:30:24 // CAS-7761 - for singledish, use FLOAT if no CORRECTED or DATA build 12-Sep-2018 15:30:24 datacol = PMS::FLOAT_DATA; build 12-Sep-2018 15:30:24 - logWarn( "load_cache", "CORRECTED_DATA column not present and calibration library not set or enabled; will use FLOAT_DATA instead."); build 12-Sep-2018 15:30:24 + logWarn( "load_cache", "CORRECTED_DATA column not present and callibration library not set/enabled; will use FLOAT_DATA instead of CORRECTED or residuals."); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - break; build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + case PMS::MODEL: { build 12-Sep-2018 15:30:24 + if (floatcolOk && !modelcolOk) { build 12-Sep-2018 15:30:24 + // model not auto-generated for singledish build 12-Sep-2018 15:30:24 + throw(AipsError("MODEL_DATA not present; use FLOAT_DATA.")); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::CORRECTED_DIVIDE_MODEL: build 12-Sep-2018 15:30:24 + case PMS::CORRMODEL: { build 12-Sep-2018 15:30:24 + // requested corrected residuals but no (real or OTF) corrected column build 12-Sep-2018 15:30:24 + if (!corrcolOk) { build 12-Sep-2018 15:30:24 + if (datacolOk) { build 12-Sep-2018 15:30:24 + if (reqDataCol==PMS::CORRECTED_DIVIDE_MODEL) { build 12-Sep-2018 15:30:24 + datacol = PMS::DATA_DIVIDE_MODEL; build 12-Sep-2018 15:30:24 + logWarn( "load_cache", "CORRECTED_DATA column not present and calibration library not set/enabled"); build 12-Sep-2018 15:30:24 + logWarn("load_cache", "Using data/model instead of corrected/model."); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + datacol = PMS::DATAMODEL; build 12-Sep-2018 15:30:24 + logWarn( "load_cache", "CORRECTED_DATA column not present and calibration library not set/enabled"); build 12-Sep-2018 15:30:24 + logWarn("load_cache", "Using data-model instead of corrected-model."); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + throw(AipsError("CORRECTED_DATA not present for residuals; use FLOAT_DATA.")); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (floatcolOk && !modelcolOk) { build 12-Sep-2018 15:30:24 + // residuals requested for singledish; model not auto-generated build 12-Sep-2018 15:30:24 + throw(AipsError("MODEL_DATA not present for residuals; use CORRECTED_DATA or FLOAT_DATA.")); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::DATAMODEL: build 12-Sep-2018 15:30:24 + case PMS::DATA_DIVIDE_MODEL: { build 12-Sep-2018 15:30:24 + if (floatcolOk) { build 12-Sep-2018 15:30:24 + if (!modelcolOk) { build 12-Sep-2018 15:30:24 + // model not auto-generated for singledish build 12-Sep-2018 15:30:24 + throw(AipsError("MODEL_DATA not present; use FLOAT_DATA.")); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // If model columns added to singledish (future), build 12-Sep-2018 15:30:24 + // create FLOATMODEL and FLOAT_DIVIDE_MODEL columns to use instead build 12-Sep-2018 15:30:24 + // But for now... build 12-Sep-2018 15:30:24 + throw(AipsError("DATA not present, cannot plot these residuals.")); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 case PMS::FLOAT_DATA: { build 12-Sep-2018 15:30:24 // requested float data but no FLOAT column build 12-Sep-2018 15:30:24 - if (!floatcolOk) { build 12-Sep-2018 15:30:24 - throw(AipsError("FLOAT_DATA not present, please use DATA")); build 12-Sep-2018 15:30:24 + if (!floatcolOk && datacolOk) { build 12-Sep-2018 15:30:24 + throw(AipsError("FLOAT_DATA not present; use DATA")); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 default: build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 - } // switch build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 return datacol; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -365,7 +412,7 @@ String MSCache::checkLoadedAxesDatacol() { build 12-Sep-2018 15:30:24 String MSCache::normalizeColumnName(String plotmscol) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 // Convert datacolumn as needed for MSTransformManager build 12-Sep-2018 15:30:24 - String colname = plotmscol; build 12-Sep-2018 15:30:24 + String colname = plotmscol; build 12-Sep-2018 15:30:24 if ((plotmscol == "corrected-model") || build 12-Sep-2018 15:30:24 (plotmscol == "data-model") || build 12-Sep-2018 15:30:24 (plotmscol == "data/model") || build 12-Sep-2018 15:30:24 @@ -373,7 +420,7 @@ String MSCache::normalizeColumnName(String plotmscol) build 12-Sep-2018 15:30:24 colname = "ALL"; build 12-Sep-2018 15:30:24 } else if (plotmscol == "float") { build 12-Sep-2018 15:30:24 colname = "FLOAT_DATA"; build 12-Sep-2018 15:30:24 - } else { // "data", "corrected", "model" build 12-Sep-2018 15:30:24 + } else { // "data", "corrected", "model" build 12-Sep-2018 15:30:24 colname.upcase(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 return colname; build 12-Sep-2018 15:30:24 @@ -445,8 +492,8 @@ void MSCache::setUpVisIter(PlotMSSelection& selection, build 12-Sep-2018 15:30:24 configuration.define("timeaverage", true); build 12-Sep-2018 15:30:24 String timespanStr = "state"; build 12-Sep-2018 15:30:24 if (averaging_.field()) build 12-Sep-2018 15:30:24 - timespanStr += ",scan,field"; build 12-Sep-2018 15:30:24 - else if (averaging_.scan()) build 12-Sep-2018 15:30:24 + timespanStr += ",field"; build 12-Sep-2018 15:30:24 + if (averaging_.scan()) build 12-Sep-2018 15:30:24 timespanStr += ",scan"; build 12-Sep-2018 15:30:24 configuration.define("timespan", timespanStr); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -471,7 +518,9 @@ void MSCache::setUpVisIter(PlotMSSelection& selection, build 12-Sep-2018 15:30:24 configuration.define("spwaverage", true); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - LogFilter oldFilter(plotms_->getParameters().logPriority()); build 12-Sep-2018 15:30:24 + LogFilter oldFilter(LogMessage::NORMAL); build 12-Sep-2018 15:30:24 + if (plotms_ != nullptr) build 12-Sep-2018 15:30:24 + LogFilter oldFilter(plotms_->getParameters().logPriority()); build 12-Sep-2018 15:30:24 MSTransformIteratorFactory* factory = NULL; build 12-Sep-2018 15:30:24 try { build 12-Sep-2018 15:30:24 // Filter out MSTransformManager setup messages build 12-Sep-2018 15:30:24 @@ -567,7 +616,7 @@ void MSCache::updateEstimateProgress(ThreadCommunication* thread) { build 12-Sep-2018 15:30:24 bool MSCache::countChunks(vi::VisibilityIterator2& vi, build 12-Sep-2018 15:30:24 Vector& nIterPerAve, build 12-Sep-2018 15:30:24 vector& loadAxes, build 12-Sep-2018 15:30:24 - vector& loadData, build 12-Sep-2018 15:30:24 + vector& loadData, build 12-Sep-2018 15:30:24 ThreadCommunication* thread) { build 12-Sep-2018 15:30:24 // Let plotms count the chunks for memory estimation build 12-Sep-2018 15:30:24 // when baseline/antenna/spw/scalar averaging build 12-Sep-2018 15:30:24 @@ -718,16 +767,16 @@ void MSCache::trapExcessVolume(map pendingLoadAxes) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 s = vm_->evalVolume(pendingLoadAxes, mask); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - logLoad(s); build 12-Sep-2018 15:30:24 + logLoad(s); build 12-Sep-2018 15:30:24 } catch(AipsError& log) { build 12-Sep-2018 15:30:24 // catch detected volume excess, clear the existing cache, and rethrow build 12-Sep-2018 15:30:24 logLoad(log.getMesg()); build 12-Sep-2018 15:30:24 deleteVm(); build 12-Sep-2018 15:30:24 stringstream ss; build 12-Sep-2018 15:30:24 - ss << "Estimated cache exceeds limits." << endl build 12-Sep-2018 15:30:24 - << "Please try using data selection, averaging," << endl build 12-Sep-2018 15:30:24 - << "checking 'Reload' (to clear unneeded cache items)," << endl build 12-Sep-2018 15:30:24 - << "or letting other memory-intensive processes finish."; build 12-Sep-2018 15:30:24 + ss << "Estimated cache exceeds limits." << endl build 12-Sep-2018 15:30:24 + << "Please try using data selection, averaging," << endl build 12-Sep-2018 15:30:24 + << "checking 'Reload' (to clear unneeded cache items)," build 12-Sep-2018 15:30:24 + << "or letting other memory-intensive processes finish."; build 12-Sep-2018 15:30:24 throw(AipsError(ss.str())); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -740,7 +789,7 @@ void MSCache::updateProgress(ThreadCommunication* thread, Int chunk) { build 12-Sep-2018 15:30:24 " / " + String::toString(nChunk_) + "."); build 12-Sep-2018 15:30:24 progress = ((double)chunk+1) / nChunk_; build 12-Sep-2018 15:30:24 thread->setProgress((unsigned int)((progress * 100) + 0.5)); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void MSCache::loadChunks(vi::VisibilityIterator2& vi, build 12-Sep-2018 15:30:24 @@ -1519,22 +1568,22 @@ void MSCache::loadAxis(vi::VisBuffer2* vb, Int vbnum, PMS::Axis axis, build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 case PMS::CORRMODEL: { build 12-Sep-2018 15:30:24 *realCorrModel_[vbnum] = build 12-Sep-2018 15:30:24 - real(vb->visCubeCorrected()) - real(vb->visCubeModel()); build 12-Sep-2018 15:30:24 + real(vb->visCubeCorrected()- vb->visCubeModel()); build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 case PMS::DATAMODEL: { build 12-Sep-2018 15:30:24 *realDataModel_[vbnum] = build 12-Sep-2018 15:30:24 - real(vb->visCube()) - real(vb->visCubeModel()); build 12-Sep-2018 15:30:24 + real(vb->visCube() - vb->visCubeModel()); build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 case PMS::DATA_DIVIDE_MODEL: { build 12-Sep-2018 15:30:24 *realDataDivModel_[vbnum] = build 12-Sep-2018 15:30:24 - real(vb->visCube()) / real(vb->visCubeModel()); build 12-Sep-2018 15:30:24 + real(vb->visCube() / vb->visCubeModel()); build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 case PMS::CORRECTED_DIVIDE_MODEL: { build 12-Sep-2018 15:30:24 *realCorrDivModel_[vbnum] = build 12-Sep-2018 15:30:24 - real(vb->visCubeCorrected()) / real(vb->visCubeModel()); build 12-Sep-2018 15:30:24 + real(vb->visCubeCorrected() / vb->visCubeModel()); build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 case PMS::FLOAT_DATA: { build 12-Sep-2018 15:30:24 @@ -1560,22 +1609,22 @@ void MSCache::loadAxis(vi::VisBuffer2* vb, Int vbnum, PMS::Axis axis, build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 case PMS::CORRMODEL: { build 12-Sep-2018 15:30:24 *imagCorrModel_[vbnum] = build 12-Sep-2018 15:30:24 - imag(vb->visCubeCorrected()) - imag(vb->visCubeModel()); build 12-Sep-2018 15:30:24 + imag(vb->visCubeCorrected() - vb->visCubeModel()); build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 case PMS::DATAMODEL: { build 12-Sep-2018 15:30:24 *imagDataModel_[vbnum] = build 12-Sep-2018 15:30:24 - imag(vb->visCube()) - imag(vb->visCubeModel()); build 12-Sep-2018 15:30:24 + imag(vb->visCube() - vb->visCubeModel()); build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 case PMS::DATA_DIVIDE_MODEL: { build 12-Sep-2018 15:30:24 *imagDataDivModel_[vbnum] = build 12-Sep-2018 15:30:24 - imag(vb->visCube()) / imag(vb->visCubeModel()); build 12-Sep-2018 15:30:24 + imag(vb->visCube() / vb->visCubeModel()); build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 case PMS::CORRECTED_DIVIDE_MODEL: { build 12-Sep-2018 15:30:24 *imagCorrDivModel_[vbnum] = build 12-Sep-2018 15:30:24 - imag(vb->visCubeCorrected()) / imag(vb->visCubeModel()); build 12-Sep-2018 15:30:24 + imag(vb->visCubeCorrected() / vb->visCubeModel()); build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 case PMS::FLOAT_DATA: // should have caught this already build 12-Sep-2018 15:30:24 @@ -1634,7 +1683,7 @@ void MSCache::loadAxis(vi::VisBuffer2* vb, Int vbnum, PMS::Axis axis, build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 case PMS::CORRMODEL: { build 12-Sep-2018 15:30:24 *wtxampCorrModel_[vbnum] = build 12-Sep-2018 15:30:24 - amplitude(vb->visCubeCorrected() - vb->visCube()); build 12-Sep-2018 15:30:24 + amplitude(vb->visCubeCorrected() - vb->visCubeModel()); build 12-Sep-2018 15:30:24 Cube wtA(*wtxampCorrModel_[vbnum]); build 12-Sep-2018 15:30:24 for(uInt c = 0; c < nchannels; ++c) { build 12-Sep-2018 15:30:24 wtA.xzPlane(c) = wtA.xzPlane(c) * vb->weight(); build 12-Sep-2018 15:30:24 diff --git a/code/plotms/Data/PlotMSCacheBase.cc b/code/plotms/Data/PlotMSCacheBase.cc build 12-Sep-2018 15:30:24 index d54cbfb..133039b 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/Data/PlotMSCacheBase.cc build 12-Sep-2018 15:30:24 +++ b/code/plotms/Data/PlotMSCacheBase.cc build 12-Sep-2018 15:30:24 @@ -99,15 +99,10 @@ PlotMSCacheBase::PlotMSCacheBase(PlotMSApp* parent): build 12-Sep-2018 15:30:24 scan_(), build 12-Sep-2018 15:30:24 dataLoaded_(false), build 12-Sep-2018 15:30:24 userCanceled_(false), build 12-Sep-2018 15:30:24 - xminG_(0), build 12-Sep-2018 15:30:24 - yminG_(0), build 12-Sep-2018 15:30:24 - xmaxG_(0), build 12-Sep-2018 15:30:24 - ymaxG_(0), build 12-Sep-2018 15:30:24 calType_(""), build 12-Sep-2018 15:30:24 polnRatio_(false), build 12-Sep-2018 15:30:24 plotmsAtm_(NULL) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Make the empty indexer0 object so we have and empty PlotData object build 12-Sep-2018 15:30:24 int dataCount = 1; build 12-Sep-2018 15:30:24 currentX_.resize(dataCount, PMS::DEFAULT_XAXIS); build 12-Sep-2018 15:30:24 @@ -123,6 +118,22 @@ PlotMSCacheBase::PlotMSCacheBase(PlotMSApp* parent): build 12-Sep-2018 15:30:24 indexer_[i].set( NULL ); build 12-Sep-2018 15:30:24 plmask_[i].set( NULL ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + xminG_.resize(dataCount); build 12-Sep-2018 15:30:24 + xminG_.set(0); build 12-Sep-2018 15:30:24 + xmaxG_.resize(dataCount); build 12-Sep-2018 15:30:24 + xmaxG_.set(0); build 12-Sep-2018 15:30:24 + yminG_.resize(dataCount); build 12-Sep-2018 15:30:24 + yminG_.set(0); build 12-Sep-2018 15:30:24 + ymaxG_.resize(dataCount); build 12-Sep-2018 15:30:24 + ymaxG_.set(0); build 12-Sep-2018 15:30:24 + xflminG_.resize(dataCount); build 12-Sep-2018 15:30:24 + xflminG_.set(0); build 12-Sep-2018 15:30:24 + xflmaxG_.resize(dataCount); build 12-Sep-2018 15:30:24 + xflmaxG_.set(0); build 12-Sep-2018 15:30:24 + yflminG_.resize(dataCount); build 12-Sep-2018 15:30:24 + yflminG_.set(0); build 12-Sep-2018 15:30:24 + yflmaxG_.resize(dataCount); build 12-Sep-2018 15:30:24 + yflmaxG_.set(0); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Set up loaded axes to be initially empty, and set up data columns for build 12-Sep-2018 15:30:24 // data-based axes. build 12-Sep-2018 15:30:24 @@ -854,11 +865,25 @@ void PlotMSCacheBase::resizeIndexer( int size ){ build 12-Sep-2018 15:30:24 deleteIndexer(); build 12-Sep-2018 15:30:24 indexer_.resize( size ); build 12-Sep-2018 15:30:24 //plmask_.resize( size ); build 12-Sep-2018 15:30:24 + xminG_.resize(size); build 12-Sep-2018 15:30:24 + xmaxG_.resize(size); build 12-Sep-2018 15:30:24 + yminG_.resize(size); build 12-Sep-2018 15:30:24 + ymaxG_.resize(size); build 12-Sep-2018 15:30:24 + xflminG_.resize(size); build 12-Sep-2018 15:30:24 + xflmaxG_.resize(size); build 12-Sep-2018 15:30:24 + yflminG_.resize(size); build 12-Sep-2018 15:30:24 + yflmaxG_.resize(size); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void PlotMSCacheBase::clearRanges(){ build 12-Sep-2018 15:30:24 - xminG_=yminG_=xflminG_=yflminG_=DBL_MAX; build 12-Sep-2018 15:30:24 - xmaxG_=ymaxG_=xflmaxG_=yflmaxG_=-DBL_MAX; build 12-Sep-2018 15:30:24 + xminG_.set(DBL_MAX); build 12-Sep-2018 15:30:24 + yminG_.set(DBL_MAX); build 12-Sep-2018 15:30:24 + xflminG_.set(DBL_MAX); build 12-Sep-2018 15:30:24 + yflminG_.set(DBL_MAX); build 12-Sep-2018 15:30:24 + xmaxG_.set(-DBL_MAX); build 12-Sep-2018 15:30:24 + ymaxG_.set(-DBL_MAX); build 12-Sep-2018 15:30:24 + xflmaxG_.set(-DBL_MAX); build 12-Sep-2018 15:30:24 + yflmaxG_.set(-DBL_MAX); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 String PlotMSCacheBase::getTimeBounds( int iterValue ){ build 12-Sep-2018 15:30:24 @@ -911,30 +936,30 @@ pair PlotMSCacheBase::getTimeBounds() const { build 12-Sep-2018 15:30:24 int dataCount = getDataCount(); build 12-Sep-2018 15:30:24 for ( int i = 0; i < dataCount; i++ ){ build 12-Sep-2018 15:30:24 if (PMS::axis(currentY_[i]) == "Time") { build 12-Sep-2018 15:30:24 - timeBounds.first = yminG_; build 12-Sep-2018 15:30:24 - timeBounds.second = ymaxG_; build 12-Sep-2018 15:30:24 + timeBounds.first = yminG_[i]; build 12-Sep-2018 15:30:24 + timeBounds.second = ymaxG_[i]; build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else if (PMS::axis(currentX_[i]) == "Time") { build 12-Sep-2018 15:30:24 - timeBounds.first = xminG_; build 12-Sep-2018 15:30:24 - timeBounds.second = xmaxG_; build 12-Sep-2018 15:30:24 + timeBounds.first = xminG_[i]; build 12-Sep-2018 15:30:24 + timeBounds.second = xmaxG_[i]; build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 return timeBounds; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -pair PlotMSCacheBase::getYAxisBounds() const { build 12-Sep-2018 15:30:24 +pair PlotMSCacheBase::getYAxisBounds(int index) const { build 12-Sep-2018 15:30:24 pair axisBounds; build 12-Sep-2018 15:30:24 - axisBounds.first = yminG_; build 12-Sep-2018 15:30:24 - axisBounds.second = ymaxG_; build 12-Sep-2018 15:30:24 + axisBounds.first = yminG_[index]; build 12-Sep-2018 15:30:24 + axisBounds.second = ymaxG_[index]; build 12-Sep-2018 15:30:24 return axisBounds; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -pair PlotMSCacheBase::getXAxisBounds() const { build 12-Sep-2018 15:30:24 +pair PlotMSCacheBase::getXAxisBounds(int index) const { build 12-Sep-2018 15:30:24 pair axisBounds; build 12-Sep-2018 15:30:24 - axisBounds.first = xminG_; build 12-Sep-2018 15:30:24 - axisBounds.second = xmaxG_; build 12-Sep-2018 15:30:24 + axisBounds.first = xminG_[index]; build 12-Sep-2018 15:30:24 + axisBounds.second = xmaxG_[index]; build 12-Sep-2018 15:30:24 return axisBounds; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1174,16 +1199,16 @@ void PlotMSCacheBase::setUpIndexer(PMS::Axis iteraxis, Bool globalXRange, build 12-Sep-2018 15:30:24 Double ixflmin,iyflmin,ixflmax,iyflmax; build 12-Sep-2018 15:30:24 for (Int iter=0;iterunmaskedMinsMaxesRaw(ixmin,ixmax,iymin,iymax); build 12-Sep-2018 15:30:24 - xminG_=min(xminG_,ixmin); build 12-Sep-2018 15:30:24 - xmaxG_=max(xmaxG_,ixmax); build 12-Sep-2018 15:30:24 - yminG_=min(yminG_,iymin); build 12-Sep-2018 15:30:24 - ymaxG_=max(ymaxG_,iymax); build 12-Sep-2018 15:30:24 + xminG_[dataIndex] = min(xminG_[dataIndex], ixmin); build 12-Sep-2018 15:30:24 + xmaxG_[dataIndex] = max(xmaxG_[dataIndex], ixmax); build 12-Sep-2018 15:30:24 + yminG_[dataIndex] = min(yminG_[dataIndex], iymin); build 12-Sep-2018 15:30:24 + ymaxG_[dataIndex] = max(ymaxG_[dataIndex], iymax); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 indexer_[dataIndex][iter]->maskedMinsMaxesRaw(ixflmin,ixflmax,iyflmin,iyflmax); build 12-Sep-2018 15:30:24 - xflminG_=min(xflminG_,ixflmin); build 12-Sep-2018 15:30:24 - xflmaxG_=max(xflmaxG_,ixflmax); build 12-Sep-2018 15:30:24 - yflminG_=min(yflminG_,iyflmin); build 12-Sep-2018 15:30:24 - yflmaxG_=max(yflmaxG_,iyflmax); build 12-Sep-2018 15:30:24 + xflminG_[dataIndex] = min(xflminG_[dataIndex], ixflmin); build 12-Sep-2018 15:30:24 + xflmaxG_[dataIndex] = max(xflmaxG_[dataIndex], ixflmax); build 12-Sep-2018 15:30:24 + yflminG_[dataIndex] = min(yflminG_[dataIndex], iyflmin); build 12-Sep-2018 15:30:24 + yflmaxG_[dataIndex] = max(yflmaxG_[dataIndex], iyflmax); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // set usage of globals build 12-Sep-2018 15:30:24 indexer_[dataIndex][iter]->setGlobalMinMax(globalXRange,globalYRange); build 12-Sep-2018 15:30:24 @@ -1199,7 +1224,7 @@ void PlotMSCacheBase::setUpIndexer(PMS::Axis iteraxis, Bool globalXRange, build 12-Sep-2018 15:30:24 if (PMS::axisIsData(currentX_[dataIndex])) build 12-Sep-2018 15:30:24 ss << ":" << PMS::dataColumn(currentXData_[dataIndex]); build 12-Sep-2018 15:30:24 ss << ": " << ixmin << " to " << ixmax << " (unflagged); "; build 12-Sep-2018 15:30:24 - if (xflminG_ == DBL_MAX) build 12-Sep-2018 15:30:24 + if (xflminG_[dataIndex] == DBL_MAX) build 12-Sep-2018 15:30:24 ss << "(no flagged data)" << endl; build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 ss << "; " << ixflmin << " to " << ixflmax << " (flagged)." << endl; build 12-Sep-2018 15:30:24 @@ -1207,7 +1232,7 @@ void PlotMSCacheBase::setUpIndexer(PMS::Axis iteraxis, Bool globalXRange, build 12-Sep-2018 15:30:24 if (PMS::axisIsData(currentY_[dataIndex])) build 12-Sep-2018 15:30:24 ss << ":" << PMS::dataColumn(currentYData_[dataIndex]); build 12-Sep-2018 15:30:24 ss << ": " << iymin << " to " << iymax << " (unflagged); "; build 12-Sep-2018 15:30:24 - if (yflminG_ == DBL_MAX) build 12-Sep-2018 15:30:24 + if (yflminG_ [dataIndex]== DBL_MAX) build 12-Sep-2018 15:30:24 ss << "(no flagged data)"; build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 ss << iyflmin << " to " << iyflmax << "(flagged)."; build 12-Sep-2018 15:30:24 @@ -1806,7 +1831,9 @@ void PlotMSCacheBase::deletePlotMask() { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void PlotMSCacheBase::log(const String& method, const String& message, build 12-Sep-2018 15:30:24 int eventType) { build 12-Sep-2018 15:30:24 - plotms_->getLogger()->postMessage(PMS::LOG_ORIGIN,method,message,eventType); build 12-Sep-2018 15:30:24 + if (plotms_ != nullptr) { build 12-Sep-2018 15:30:24 + plotms_->getLogger()->postMessage(PMS::LOG_ORIGIN,method,message,eventType); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 int PlotMSCacheBase::findColorIndex( int chunk, bool initialize ){ build 12-Sep-2018 15:30:24 @@ -1843,4 +1870,17 @@ void PlotMSCacheBase::printAtmStats(casacore::Int scan) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +bool PlotMSCacheBase::hasOverlay() { build 12-Sep-2018 15:30:24 + // check loaded axes for overlays build 12-Sep-2018 15:30:24 + bool overlay(false); build 12-Sep-2018 15:30:24 + std::vector axes(loadedAxes()); build 12-Sep-2018 15:30:24 + for (int i=0; i& flag(casacore::Int chunk) { return *flag_[chunk]; }; build 12-Sep-2018 15:30:24 - inline casacore::Vector& flagrow(casacore::Int chunk) { return *flagrow_[chunk]; }; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Axis-specific generic gets build 12-Sep-2018 15:30:24 + /*** Axis-specific generic gets, per chunk and relative index (from indexer) ***/ build 12-Sep-2018 15:30:24 inline casacore::Double getScan(casacore::Int chnk,casacore::Int irel) { return scan_(chnk); (void)irel; }; build 12-Sep-2018 15:30:24 inline casacore::Double getField(casacore::Int chnk,casacore::Int irel) { return field_(chnk); (void)irel; }; build 12-Sep-2018 15:30:24 inline casacore::Double getTime(casacore::Int chnk,casacore::Int irel) { return time_(chnk); (void)irel; }; build 12-Sep-2018 15:30:24 @@ -284,6 +283,107 @@ public: build 12-Sep-2018 15:30:24 inline casacore::Double getAtm(casacore::Int chnk,casacore::Int irel) { return *(atm_[chnk]->data()+irel); }; build 12-Sep-2018 15:30:24 inline casacore::Double getTsky(casacore::Int chnk,casacore::Int irel) { return *(tsky_[chnk]->data()+irel); }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + /* -----------------------------------------------------------------------*/ build 12-Sep-2018 15:30:24 + /*** Axis-specific generic gets, per chunk (for unit tests) ***/ build 12-Sep-2018 15:30:24 + // metadata axes build 12-Sep-2018 15:30:24 + inline casacore::Int scan(casacore::Int chnk) { return scan_(chnk);}; build 12-Sep-2018 15:30:24 + inline casacore::Int field(casacore::Int chnk) { return field_(chnk); }; build 12-Sep-2018 15:30:24 + inline casacore::Double time(casacore::Int chnk) { return time_(chnk); }; build 12-Sep-2018 15:30:24 + inline casacore::Double timeIntr(casacore::Int chnk) { return timeIntr_(chnk); }; build 12-Sep-2018 15:30:24 + inline casacore::Int spw(casacore::Int chnk) { return spw_(chnk); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& chan(casacore::Int chnk) { return *(chan_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& freq(casacore::Int chnk) { return *(freq_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& vel(casacore::Int chnk) { return *(vel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& corr(casacore::Int chnk) { return *(corr_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& ant1(casacore::Int chnk) { return *(antenna1_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& ant2(casacore::Int chnk) { return *(antenna2_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& bsln(casacore::Int chnk) { return *(baseline_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& row(casacore::Int chnk) { return *(row_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& obsid(casacore::Int chnk) { return *(obsid_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& intent(casacore::Int chnk) { return *(intent_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& feed1(casacore::Int chnk) { return *(feed1_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& feed2(casacore::Int chnk) { return *(feed2_[chnk]); }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // visibility and flag axes build 12-Sep-2018 15:30:24 + inline casacore::Array& ampData(casacore::Int chnk) { return *(amp_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& ampCorr(casacore::Int chnk) { return *(ampCorr_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& ampModel(casacore::Int chnk) { return *(ampModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& ampCorrModel(casacore::Int chnk) { return *(ampCorrModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& ampDataModel(casacore::Int chnk) { return *(ampDataModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& ampDataDivModel(casacore::Int chnk) { return *(ampDataDivModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& ampCorrDivModel(casacore::Int chnk) { return *(ampCorrDivModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& ampFloat(casacore::Int chnk) { return *(ampFloat_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& phaData(casacore::Int chnk) { return *(pha_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& phaCorr(casacore::Int chnk) { return *(phaCorr_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& phaModel(casacore::Int chnk) { return *(phaModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& phaCorrModel(casacore::Int chnk) { return *(phaCorrModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& phaDataModel(casacore::Int chnk) { return *(phaDataModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& phaDataDivModel(casacore::Int chnk) { return *(phaDataDivModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& phaCorrDivModel(casacore::Int chnk) { return *(phaCorrDivModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& realData(casacore::Int chnk) { return *(real_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& realCorr(casacore::Int chnk) { return *(realCorr_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& realModel(casacore::Int chnk) { return *(realModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& realCorrModel(casacore::Int chnk) { return *(realCorrModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& realDataModel(casacore::Int chnk) { return *(realDataModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& realDataDivModel(casacore::Int chnk) { return *(realDataDivModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& realCorrDivModel(casacore::Int chnk) { return *(realCorrDivModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& imagData(casacore::Int chnk) { return *(imag_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& imagCorr(casacore::Int chnk) { return *(imagCorr_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& imagModel(casacore::Int chnk) { return *(imagModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& imagCorrModel(casacore::Int chnk) { return *(imagCorrModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& imagDataModel(casacore::Int chnk) { return *(imagDataModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& imagDataDivModel(casacore::Int chnk) { return *(imagDataDivModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& imagCorrDivModel(casacore::Int chnk) { return *(imagCorrDivModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& wtxampData(casacore::Int chnk) { return *(wtxamp_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& wtxampCorr(casacore::Int chnk) { return *(wtxampCorr_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& wtxampModel(casacore::Int chnk) { return *(wtxampModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& wtxampCorrModel(casacore::Int chnk) { return *(wtxampCorrModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& wtxampDataModel(casacore::Int chnk) { return *(wtxampDataModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& wtxampDataDivModel(casacore::Int chnk) { return *(wtxampDataDivModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& wtxampCorrDivModel(casacore::Int chnk) { return *(wtxampCorrDivModel_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& wtxampFloat(casacore::Int chnk) { return *(wtxampFloat_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& flag(casacore::Int chunk) { return *flag_[chunk]; }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& flagrow(casacore::Int chunk) { return *flagrow_[chunk]; }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // weight axes build 12-Sep-2018 15:30:24 + inline casacore::Array& wt(casacore::Int chnk) { return *(wt_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& wtsp(casacore::Int chnk) { return *(wtsp_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& sigma(casacore::Int chnk) { return *(sigma_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& sigmasp(casacore::Int chnk) { return *(sigmasp_[chnk]); }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // observational geometry axes build 12-Sep-2018 15:30:24 + inline casacore::Vector& uVDist(casacore::Int chnk) { return *(uvdist_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Matrix& uVDistL(casacore::Int chnk) { return *(uvdistL_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& u(casacore::Int chnk) { return *(u_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& v(casacore::Int chnk) { return *(v_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& w(casacore::Int chnk) { return *(w_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Matrix& uWave(casacore::Int chnk) { return *(uwave_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Matrix& vWave(casacore::Int chnk) { return *(vwave_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Matrix& wWave(casacore::Int chnk) { return *(wwave_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Double az0(casacore::Int chnk) { return az0_[chnk]; }; build 12-Sep-2018 15:30:24 + inline casacore::Double el0(casacore::Int chnk) { return el0_[chnk]; }; build 12-Sep-2018 15:30:24 + inline casacore::Double ha0(casacore::Int chnk) { return ha0_[chnk]; }; build 12-Sep-2018 15:30:24 + inline casacore::Double pa0(casacore::Int chnk) { return pa0_[chnk]; }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& ant(casacore::Int chnk) { return *(antenna_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& az(casacore::Int chnk) { return *(az_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& el(casacore::Int chnk) { return *(el_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& parAng(casacore::Int chnk) { return *(parang_[chnk]); }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // ephemeris axes build 12-Sep-2018 15:30:24 + inline casacore::Double radvel(casacore::Int chnk) { return radialVelocity_[chnk]; }; build 12-Sep-2018 15:30:24 + inline casacore::Double rho(casacore::Int chnk) { return rho_[chnk]; }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // calibration axes build 12-Sep-2018 15:30:24 + inline casacore::Array& par(casacore::Int chnk) { return *(par_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& snr(casacore::Int chnk) { return *(snr_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Array& antpos(casacore::Int chnk) { return *(antpos_[chnk]); }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // curve overlay axes build 12-Sep-2018 15:30:24 + inline casacore::Vector& atm(casacore::Int chnk) { return *(atm_[chnk]); }; build 12-Sep-2018 15:30:24 + inline casacore::Vector& tsky(casacore::Int chnk) { return *(tsky_[chnk]); }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /* -----------------------------------------------------------------------*/ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // Returns a list of channel numbers that were averaged together in that chunk build 12-Sep-2018 15:30:24 inline casacore::Vector getChansPerBin(casacore::Int chnk,casacore::Int irel) { return (*chansPerBin_[chnk])[irel]; }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -303,8 +403,8 @@ public: build 12-Sep-2018 15:30:24 // Return the time as doubles build 12-Sep-2018 15:30:24 pair getTimeBounds() const; build 12-Sep-2018 15:30:24 // Return the axes ranges build 12-Sep-2018 15:30:24 - pair getXAxisBounds() const; build 12-Sep-2018 15:30:24 - pair getYAxisBounds() const; build 12-Sep-2018 15:30:24 + pair getXAxisBounds(int index) const; build 12-Sep-2018 15:30:24 + pair getYAxisBounds(int index) const; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 inline PMS::DataColumn getXDataColumn() { return currentXData_[0]; }; build 12-Sep-2018 15:30:24 inline PMS::DataColumn getYDataColumn(int index) { return currentYData_[index]; }; build 12-Sep-2018 15:30:24 @@ -490,8 +590,9 @@ protected: build 12-Sep-2018 15:30:24 //map> loadedAxesData_; build 12-Sep-2018 15:30:24 map pendingLoadAxes_; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Global ranges build 12-Sep-2018 15:30:24 - casacore::Double xminG_,yminG_,xflminG_,yflminG_,xmaxG_,ymaxG_,xflmaxG_,yflmaxG_; build 12-Sep-2018 15:30:24 + // Global ranges (unflagged and flagged, per indexer) build 12-Sep-2018 15:30:24 + casacore::Vector xminG_, xmaxG_, yminG_, ymaxG_, build 12-Sep-2018 15:30:24 + xflminG_, xflmaxG_, yflminG_, yflmaxG_; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // A copy of the casacore::Data parameters build 12-Sep-2018 15:30:24 casacore::String filename_; build 12-Sep-2018 15:30:24 diff --git a/code/plotms/Data/PlotMSIndexer.cc b/code/plotms/Data/PlotMSIndexer.cc build 12-Sep-2018 15:30:24 index 0859e8b..d3ce085 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/Data/PlotMSIndexer.cc build 12-Sep-2018 15:30:24 +++ b/code/plotms/Data/PlotMSIndexer.cc build 12-Sep-2018 15:30:24 @@ -78,7 +78,7 @@ PlotMSIndexer::PlotMSIndexer(): build 12-Sep-2018 15:30:24 itsColorizeAxis_(PMS::DEFAULT_COLOR_AXIS), build 12-Sep-2018 15:30:24 self(const_cast(this)) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - dataIndex = 0; build 12-Sep-2018 15:30:24 + dataIndex_ = 0; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 PlotMSIndexer::PlotMSIndexer(PlotMSCacheBase* parent, PMS::Axis xAxis, build 12-Sep-2018 15:30:24 @@ -125,7 +125,7 @@ PlotMSIndexer::PlotMSIndexer(PlotMSCacheBase* parent, PMS::Axis xAxis, build 12-Sep-2018 15:30:24 itsColorizeAxis_(PMS::DEFAULT_COLOR_AXIS), build 12-Sep-2018 15:30:24 self(const_cast(this)) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - dataIndex = index; build 12-Sep-2018 15:30:24 + dataIndex_ = index; build 12-Sep-2018 15:30:24 setUpIndexing(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -174,7 +174,7 @@ PlotMSIndexer::PlotMSIndexer(PlotMSCacheBase* parent, build 12-Sep-2018 15:30:24 itsColorizeAxis_(PMS::DEFAULT_COLOR_AXIS), build 12-Sep-2018 15:30:24 self(const_cast(this)) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - dataIndex = index; build 12-Sep-2018 15:30:24 + dataIndex_ = index; build 12-Sep-2018 15:30:24 setUpIndexing(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -215,31 +215,35 @@ bool PlotMSIndexer::minsMaxes(double& xMin, double& xMax, build 12-Sep-2018 15:30:24 // X: build 12-Sep-2018 15:30:24 if (globalXMinMax_ || (sizeMasked()==0 && sizeUnmasked()==0)) { build 12-Sep-2018 15:30:24 // calculate global build 12-Sep-2018 15:30:24 - xMin=min(plotmscache_->xminG_,plotmscache_->xflminG_); build 12-Sep-2018 15:30:24 - xMax=max(plotmscache_->xmaxG_,plotmscache_->xflmaxG_); build 12-Sep-2018 15:30:24 + xMin = min(plotmscache_->xminG_[dataIndex_], plotmscache_->xflminG_[dataIndex_]); build 12-Sep-2018 15:30:24 + xMax = max(plotmscache_->xmaxG_[dataIndex_], plotmscache_->xflmaxG_[dataIndex_]); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 - xMin=min(xmin_,xflmin_); build 12-Sep-2018 15:30:24 - xMax=max(xmax_,xflmax_); build 12-Sep-2018 15:30:24 + xMin = min(xmin_, xflmin_); build 12-Sep-2018 15:30:24 + xMax = max(xmax_, xflmax_); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Y: build 12-Sep-2018 15:30:24 if (globalYMinMax_ || (sizeMasked()==0 && sizeUnmasked()==0)) { build 12-Sep-2018 15:30:24 // calculate global build 12-Sep-2018 15:30:24 - yMin=min(plotmscache_->yminG_,plotmscache_->yflminG_); build 12-Sep-2018 15:30:24 - yMax=max(plotmscache_->ymaxG_,plotmscache_->yflmaxG_); build 12-Sep-2018 15:30:24 + yMin = min(plotmscache_->yminG_[dataIndex_], plotmscache_->yflminG_[dataIndex_]); build 12-Sep-2018 15:30:24 + yMax = max(plotmscache_->ymaxG_[dataIndex_], plotmscache_->yflmaxG_[dataIndex_]); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 - yMin=min(ymin_,yflmin_); build 12-Sep-2018 15:30:24 - yMax=max(ymax_,yflmax_); build 12-Sep-2018 15:30:24 + yMin = min(ymin_, yflmin_); build 12-Sep-2018 15:30:24 + yMax = max(ymax_, yflmax_); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + if (plotmscache_->hasOverlay()) build 12-Sep-2018 15:30:24 + adjustYRange(yMin, yMax); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 return true; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 bool PlotMSIndexer::maskedAt( unsigned int index) const { build 12-Sep-2018 15:30:24 setChunk(index); build 12-Sep-2018 15:30:24 - return !(*(plotmscache_->plmask_[dataIndex][currChunk_]->data()+irel_)); build 12-Sep-2018 15:30:24 + return !(*(plotmscache_->plmask_[dataIndex_][currChunk_]->data()+irel_)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 void PlotMSIndexer::xyAndMaskAt(unsigned int index, build 12-Sep-2018 15:30:24 double& x, double& y, build 12-Sep-2018 15:30:24 bool& mask) const { build 12-Sep-2018 15:30:24 @@ -248,7 +252,7 @@ void PlotMSIndexer::xyAndMaskAt(unsigned int index, build 12-Sep-2018 15:30:24 (self->*XIndexer_)(currChunk_,irel_)); build 12-Sep-2018 15:30:24 y=(plotmscache_->*getYFromCache_)(currChunk_, build 12-Sep-2018 15:30:24 (self->*YIndexer_)(currChunk_,irel_)); build 12-Sep-2018 15:30:24 - mask=!(*(plotmscache_->plmask_[dataIndex][currChunk_]->data()+irel_)); build 12-Sep-2018 15:30:24 + mask=!(*(plotmscache_->plmask_[dataIndex_][currChunk_]->data()+irel_)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 bool PlotMSIndexer::maskedMinsMaxes(double& xMin, double& xMax, build 12-Sep-2018 15:30:24 @@ -260,25 +264,28 @@ bool PlotMSIndexer::maskedMinsMaxes(double& xMin, double& xMax, build 12-Sep-2018 15:30:24 // X: build 12-Sep-2018 15:30:24 if (globalXMinMax_ || sizeMasked()==0) { build 12-Sep-2018 15:30:24 // Use globals from the cache build 12-Sep-2018 15:30:24 - xMin=plotmscache_->xflminG_; build 12-Sep-2018 15:30:24 - xMax=plotmscache_->xflmaxG_; build 12-Sep-2018 15:30:24 + xMin = plotmscache_->xflminG_[dataIndex_]; build 12-Sep-2018 15:30:24 + xMax = plotmscache_->xflmaxG_[dataIndex_]; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 // get local ones build 12-Sep-2018 15:30:24 - xMin=xflmin_; build 12-Sep-2018 15:30:24 - xMax=xflmax_; build 12-Sep-2018 15:30:24 + xMin = xflmin_; build 12-Sep-2018 15:30:24 + xMax = xflmax_; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 // Y: build 12-Sep-2018 15:30:24 if (globalYMinMax_ || sizeMasked()==0) { build 12-Sep-2018 15:30:24 // Use globals from the cache build 12-Sep-2018 15:30:24 - yMin=plotmscache_->yflminG_; build 12-Sep-2018 15:30:24 - yMax=plotmscache_->yflmaxG_; build 12-Sep-2018 15:30:24 + yMin = plotmscache_->yflminG_[dataIndex_]; build 12-Sep-2018 15:30:24 + yMax = plotmscache_->yflmaxG_[dataIndex_]; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 // use local ones build 12-Sep-2018 15:30:24 - yMin=yflmin_; build 12-Sep-2018 15:30:24 - yMax=yflmax_; build 12-Sep-2018 15:30:24 + yMin = yflmin_; build 12-Sep-2018 15:30:24 + yMax = yflmax_; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + if (plotmscache_->hasOverlay()) build 12-Sep-2018 15:30:24 + adjustYRange(yMin, yMax); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 return true; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -305,29 +312,44 @@ bool PlotMSIndexer::unmaskedMinsMaxes(double& xMin, double& xMax, build 12-Sep-2018 15:30:24 // X: build 12-Sep-2018 15:30:24 if (globalXMinMax_ || sizeUnmasked()==0 ) { build 12-Sep-2018 15:30:24 // Use globals from the cache build 12-Sep-2018 15:30:24 - xMin=plotmscache_->xminG_; build 12-Sep-2018 15:30:24 - xMax=plotmscache_->xmaxG_; build 12-Sep-2018 15:30:24 + xMin = plotmscache_->xminG_[dataIndex_]; build 12-Sep-2018 15:30:24 + xMax = plotmscache_->xmaxG_[dataIndex_]; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 // get local ones build 12-Sep-2018 15:30:24 - xMin=xmin_; build 12-Sep-2018 15:30:24 - xMax=xmax_; build 12-Sep-2018 15:30:24 + xMin = xmin_; build 12-Sep-2018 15:30:24 + xMax = xmax_; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Y: build 12-Sep-2018 15:30:24 if (globalYMinMax_ || sizeUnmasked()==0 ) { build 12-Sep-2018 15:30:24 // Use globals from the cache build 12-Sep-2018 15:30:24 - yMin=plotmscache_->yminG_; build 12-Sep-2018 15:30:24 - yMax=plotmscache_->ymaxG_; build 12-Sep-2018 15:30:24 + yMin = plotmscache_->yminG_[dataIndex_]; build 12-Sep-2018 15:30:24 + yMax = plotmscache_->ymaxG_[dataIndex_]; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 // get local ones build 12-Sep-2018 15:30:24 - yMin=ymin_; build 12-Sep-2018 15:30:24 - yMax=ymax_; build 12-Sep-2018 15:30:24 + yMin = ymin_; build 12-Sep-2018 15:30:24 + yMax = ymax_; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + if (plotmscache_->hasOverlay()) build 12-Sep-2018 15:30:24 + adjustYRange(yMin, yMax); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 return true; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +void PlotMSIndexer::adjustYRange(double& yMin, double& yMax) { build 12-Sep-2018 15:30:24 + double range = yMax-yMin; build 12-Sep-2018 15:30:24 + if (!PMS::axisIsOverlay(currentY_)) { build 12-Sep-2018 15:30:24 + // add margin to top of non-overlay axis build 12-Sep-2018 15:30:24 + yMax += range * 0.25; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // add margin to bottom of overlay axis build 12-Sep-2018 15:30:24 + if (range < 5.0) range = 5.0; build 12-Sep-2018 15:30:24 + yMin -= range*2.0; build 12-Sep-2018 15:30:24 + if (yMin < 0.0) yMin = 0.0; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 bool PlotMSIndexer::unmaskedMinsMaxesRaw(double& xMin, double& xMax, build 12-Sep-2018 15:30:24 double& yMin, double& yMax) { build 12-Sep-2018 15:30:24 @@ -411,7 +433,7 @@ void PlotMSIndexer::setUpIndexing() { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Forbid antenna-based/baseline-based combination plots, for now build 12-Sep-2018 15:30:24 // (e.g., data vs. _antenna-based_ elevation) build 12-Sep-2018 15:30:24 - if (plotmscache_->netAxesMask_[dataIndex](2)&&plotmscache_->netAxesMask_[dataIndex](3)) build 12-Sep-2018 15:30:24 + if (plotmscache_->netAxesMask_[dataIndex_](2)&&plotmscache_->netAxesMask_[dataIndex_](3)) build 12-Sep-2018 15:30:24 throw(AipsError("Cannot yet support antenna-based and baseline-based data in same plot.")); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Refer to the chunk shape matrix in the cache build 12-Sep-2018 15:30:24 @@ -433,12 +455,12 @@ void PlotMSIndexer::setUpIndexing() { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 nperchan_.resize(nChunk()); build 12-Sep-2018 15:30:24 nperchan_.set(1); build 12-Sep-2018 15:30:24 - if (plotmscache_->netAxesMask_[dataIndex](0)) nperchan_ *= chsh.row(0); build 12-Sep-2018 15:30:24 + if (plotmscache_->netAxesMask_[dataIndex_](0)) nperchan_ *= chsh.row(0); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 nperbsln_.resize(nChunk()); build 12-Sep-2018 15:30:24 nperbsln_.set(1); build 12-Sep-2018 15:30:24 - if (plotmscache_->netAxesMask_[dataIndex](0)) nperbsln_ *= chsh.row(0); build 12-Sep-2018 15:30:24 - if (plotmscache_->netAxesMask_[dataIndex](1)) nperbsln_ *= chsh.row(1); build 12-Sep-2018 15:30:24 + if (plotmscache_->netAxesMask_[dataIndex_](0)) nperbsln_ *= chsh.row(0); build 12-Sep-2018 15:30:24 + if (plotmscache_->netAxesMask_[dataIndex_](1)) nperbsln_ *= chsh.row(1); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 nperant_.reference(nperbsln_); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -544,7 +566,7 @@ void PlotMSIndexer::setUpIndexing() { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Count per segment build 12-Sep-2018 15:30:24 Int iseg(-1); build 12-Sep-2018 15:30:24 - Vector& nAM(plotmscache_->netAxesMask_[dataIndex]); build 12-Sep-2018 15:30:24 + Vector& nAM(plotmscache_->netAxesMask_[dataIndex_]); build 12-Sep-2018 15:30:24 double timeInterval(1); build 12-Sep-2018 15:30:24 bool averagingTime = plotmscache_->averaging_.time(); build 12-Sep-2018 15:30:24 if ( averagingTime ){ build 12-Sep-2018 15:30:24 @@ -1439,12 +1461,12 @@ void PlotMSIndexer::reportMeta(Double x, Double y, Bool masked,stringstream& ss) build 12-Sep-2018 15:30:24 else ss << "BL="; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Antenna Names build 12-Sep-2018 15:30:24 - if (!plotmscache_->netAxesMask_[dataIndex](2) || ant1<0) build 12-Sep-2018 15:30:24 + if (!plotmscache_->netAxesMask_[dataIndex_](2) || ant1<0) build 12-Sep-2018 15:30:24 ss << "*"; build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 ss << plotmscache_->antstanames_(ant1); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if (!plotmscache_->netAxesMask_[dataIndex](2) || ant2<0) build 12-Sep-2018 15:30:24 + if (!plotmscache_->netAxesMask_[dataIndex_](2) || ant2<0) build 12-Sep-2018 15:30:24 ss << " & * "; build 12-Sep-2018 15:30:24 else if (ant1==ant2) build 12-Sep-2018 15:30:24 ss << " && " << plotmscache_->antstanames_(ant2); build 12-Sep-2018 15:30:24 @@ -1454,11 +1476,11 @@ void PlotMSIndexer::reportMeta(Double x, Double y, Bool masked,stringstream& ss) build 12-Sep-2018 15:30:24 // Antenna indices build 12-Sep-2018 15:30:24 if (showindices) { build 12-Sep-2018 15:30:24 ss << " ["; build 12-Sep-2018 15:30:24 - if (!plotmscache_->netAxesMask_[dataIndex](2) || ant1<0) build 12-Sep-2018 15:30:24 + if (!plotmscache_->netAxesMask_[dataIndex_](2) || ant1<0) build 12-Sep-2018 15:30:24 ss << "*"; build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 ss << ant1; build 12-Sep-2018 15:30:24 - if (!plotmscache_->netAxesMask_[dataIndex](2) || ant2<0) build 12-Sep-2018 15:30:24 + if (!plotmscache_->netAxesMask_[dataIndex_](2) || ant2<0) build 12-Sep-2018 15:30:24 ss << "&*"; build 12-Sep-2018 15:30:24 else if (ant1==ant2) build 12-Sep-2018 15:30:24 ss << "&&" << ant2; build 12-Sep-2018 15:30:24 @@ -1482,7 +1504,7 @@ void PlotMSIndexer::reportMeta(Double x, Double y, Bool masked,stringstream& ss) build 12-Sep-2018 15:30:24 if (caltype =="GSPLINE") { // no chan build 12-Sep-2018 15:30:24 ss << "*"; build 12-Sep-2018 15:30:24 } else { build 12-Sep-2018 15:30:24 - if (plotmscache_->netAxesMask_[dataIndex](1)) { build 12-Sep-2018 15:30:24 + if (plotmscache_->netAxesMask_[dataIndex_](1)) { build 12-Sep-2018 15:30:24 if (isMS && pmsAvg.channel() && pmsAvg.channelValue()>1) { build 12-Sep-2018 15:30:24 Vector chansPerBin = plotmscache_->getChansPerBin(currChunk_, ichan); build 12-Sep-2018 15:30:24 ss << "<" << chansPerBin[0] << "~" << chansPerBin[chansPerBin.size()-1] << ">"; build 12-Sep-2018 15:30:24 @@ -1498,7 +1520,7 @@ void PlotMSIndexer::reportMeta(Double x, Double y, Bool masked,stringstream& ss) build 12-Sep-2018 15:30:24 if (caltype =="GSPLINE") { // no freq build 12-Sep-2018 15:30:24 ss << "Freq=* "; build 12-Sep-2018 15:30:24 } else { build 12-Sep-2018 15:30:24 - if (plotmscache_->netAxesMask_[dataIndex](1)) { build 12-Sep-2018 15:30:24 + if (plotmscache_->netAxesMask_[dataIndex_](1)) { build 12-Sep-2018 15:30:24 if (isMS && pmsAvg.channel() && pmsAvg.channelValue()>1) { build 12-Sep-2018 15:30:24 ss << "Avg Freq="; build 12-Sep-2018 15:30:24 } else { build 12-Sep-2018 15:30:24 @@ -1516,7 +1538,7 @@ void PlotMSIndexer::reportMeta(Double x, Double y, Bool masked,stringstream& ss) build 12-Sep-2018 15:30:24 ss << "Coordinate="; build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 ss << "Poln="; build 12-Sep-2018 15:30:24 - if (plotmscache_->netAxesMask_[dataIndex](0)) build 12-Sep-2018 15:30:24 + if (plotmscache_->netAxesMask_[dataIndex_](0)) build 12-Sep-2018 15:30:24 ss << plotmscache_->polname(Int(plotmscache_->getCorr(currChunk_,getIndex1000(currChunk_,irel_)))); build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 ss << "*"; build 12-Sep-2018 15:30:24 @@ -1583,7 +1605,7 @@ PlotLogMessage* PlotMSIndexer::flagRange(const PlotMSFlagging& flagging, build 12-Sep-2018 15:30:24 if (nFound > 0) { build 12-Sep-2018 15:30:24 // Refresh the plot mask to reflect newly flagged data build 12-Sep-2018 15:30:24 // TBD: only do chunks that need it! build 12-Sep-2018 15:30:24 - plotmscache_->setPlotMask(dataIndex); build 12-Sep-2018 15:30:24 + plotmscache_->setPlotMask(dataIndex_); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // cout << "Finished in-memory flagging." << endl; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1597,7 +1619,7 @@ PlotLogMessage* PlotMSIndexer::flagRange(const PlotMSFlagging& flagging, build 12-Sep-2018 15:30:24 // cout << "flagindex = " << flagindex << endl; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Set the flags in the MS build 12-Sep-2018 15:30:24 - plotmscache_->flagToDisk(flagging, flagchunk, flagindex, flag, this, dataIndex); build 12-Sep-2018 15:30:24 + plotmscache_->flagToDisk(flagging, flagchunk, flagindex, flag, this, dataIndex_); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Recompute ranges build 12-Sep-2018 15:30:24 @@ -1709,7 +1731,7 @@ void PlotMSIndexer::flagInCache(const PlotMSFlagging& flagging,Bool flag) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Set flag range on correlation axis: build 12-Sep-2018 15:30:24 Int icorr(0); build 12-Sep-2018 15:30:24 - if (plotmscache_->netAxesMask_[dataIndex](0) && !flagging.corrAll()) { build 12-Sep-2018 15:30:24 + if (plotmscache_->netAxesMask_[dataIndex_](0) && !flagging.corrAll()) { build 12-Sep-2018 15:30:24 // specific correlation build 12-Sep-2018 15:30:24 icorr=getIndex1000(currChunk_,irel_); // (irel_%icorrmax_(currChunk_)); build 12-Sep-2018 15:30:24 corr=Slice(icorr,1,1); build 12-Sep-2018 15:30:24 @@ -1720,7 +1742,7 @@ void PlotMSIndexer::flagInCache(const PlotMSFlagging& flagging,Bool flag) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Set Flag range on channel axis: build 12-Sep-2018 15:30:24 Int ichan(-1); build 12-Sep-2018 15:30:24 - if (plotmscache_->netAxesMask_[dataIndex](1) && !flagging.channel()) { build 12-Sep-2018 15:30:24 + if (plotmscache_->netAxesMask_[dataIndex_](1) && !flagging.channel()) { build 12-Sep-2018 15:30:24 // specific channel build 12-Sep-2018 15:30:24 ichan=getIndex0100(currChunk_,irel_); // (irel_%icorrmax_(currChunk_)); //Int(getChan()); build 12-Sep-2018 15:30:24 /* ....old way require convert from chan value to channel index... build 12-Sep-2018 15:30:24 @@ -1746,7 +1768,7 @@ void PlotMSIndexer::flagInCache(const PlotMSFlagging& flagging,Bool flag) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Set Flag range on baseline axis: build 12-Sep-2018 15:30:24 Int ibsln(-1); build 12-Sep-2018 15:30:24 - if (plotmscache_->netAxesMask_[dataIndex](2)) { build 12-Sep-2018 15:30:24 + if (plotmscache_->netAxesMask_[dataIndex_](2)) { build 12-Sep-2018 15:30:24 // specific correlation build 12-Sep-2018 15:30:24 ibsln=getIndex0010(currChunk_,irel_); //(irel_/nperbsln_(currChunk_))%ibslnmax_(currChunk_); build 12-Sep-2018 15:30:24 bsln=Slice(ibsln,1,1); build 12-Sep-2018 15:30:24 diff --git a/code/plotms/Data/PlotMSIndexer.h b/code/plotms/Data/PlotMSIndexer.h build 12-Sep-2018 15:30:24 index ac3f6f4..62abb03 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/Data/PlotMSIndexer.h build 12-Sep-2018 15:30:24 +++ b/code/plotms/Data/PlotMSIndexer.h build 12-Sep-2018 15:30:24 @@ -200,6 +200,9 @@ private: build 12-Sep-2018 15:30:24 // may want to cache ALL ranges for all loaded values to avoid recomputation. build 12-Sep-2018 15:30:24 void computeRanges(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + // Adjust the Y range for overlays to make room at top of plot build 12-Sep-2018 15:30:24 + void adjustYRange(double& yMin, double& yMax); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // Compute baseline's length in meters between ant1 and ant2 build 12-Sep-2018 15:30:24 casacore::Double computeBaselineLength(casacore::Int ant1, casacore::Int ant2); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -279,8 +282,7 @@ private: build 12-Sep-2018 15:30:24 // Cope with const-ness in the get methods build 12-Sep-2018 15:30:24 PlotMSIndexer* self; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - int dataIndex; build 12-Sep-2018 15:30:24 + int dataIndex_; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/plotms/GuiTabs/PlotMSIterateTab.cc b/code/plotms/GuiTabs/PlotMSIterateTab.cc build 12-Sep-2018 15:30:24 index a0e5a79..cb698f7 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/GuiTabs/PlotMSIterateTab.cc build 12-Sep-2018 15:30:24 +++ b/code/plotms/GuiTabs/PlotMSIterateTab.cc build 12-Sep-2018 15:30:24 @@ -450,11 +450,12 @@ void PlotMSIterateTab::getValue(PlotMSPlotParameters& params) const { build 12-Sep-2018 15:30:24 d->setGlobalScaleX( globalXCheck->isChecked()); build 12-Sep-2018 15:30:24 d->setGlobalScaleY( globalYCheck->isChecked()); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - d->setCommonAxisX( sharedXCheck->isChecked()); build 12-Sep-2018 15:30:24 - d->setCommonAxisY( sharedYCheck->isChecked()); build 12-Sep-2018 15:30:24 + // only set if grid build 12-Sep-2018 15:30:24 + d->setCommonAxisX( gridRowSpin->maximum()>1 && sharedXCheck->isChecked()); build 12-Sep-2018 15:30:24 + d->setCommonAxisY( gridColSpin->maximum()>1 && sharedYCheck->isChecked()); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - //Note, we are subtracting 1 because UI values start with 1, but internal build 12-Sep-2018 15:30:24 - //values are 0 based. build 12-Sep-2018 15:30:24 + //Note, we are subtracting 1 because UI values start with 1, build 12-Sep-2018 15:30:24 + //but internal values are 0 based. build 12-Sep-2018 15:30:24 int rowSpinIndex = gridRowSpin->value() - 1; build 12-Sep-2018 15:30:24 int colSpinIndex = gridColSpin->value() - 1; build 12-Sep-2018 15:30:24 d->setGridRow( rowSpinIndex ); build 12-Sep-2018 15:30:24 @@ -480,6 +481,7 @@ void PlotMSIterateTab::setValue(const PlotMSPlotParameters& params) { build 12-Sep-2018 15:30:24 sharedYCheck->setChecked( d->isCommonAxisY() ); build 12-Sep-2018 15:30:24 globalXCheck->setChecked( d->isGlobalScaleX() ); build 12-Sep-2018 15:30:24 globalYCheck->setChecked( d->isGlobalScaleY() ); build 12-Sep-2018 15:30:24 + globalChanged(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 int rowIndex = d->getGridRow(); build 12-Sep-2018 15:30:24 int colIndex = d->getGridCol(); build 12-Sep-2018 15:30:24 diff --git a/code/plotms/GuiTabs/PlotMSOptionsTab.cc b/code/plotms/GuiTabs/PlotMSOptionsTab.cc build 12-Sep-2018 15:30:24 index 277f873..f906707 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/GuiTabs/PlotMSOptionsTab.cc build 12-Sep-2018 15:30:24 +++ b/code/plotms/GuiTabs/PlotMSOptionsTab.cc build 12-Sep-2018 15:30:24 @@ -203,6 +203,7 @@ void PlotMSOptionsTab::gridChanged(){ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 itsParameters_.setRowCount(rowCount); build 12-Sep-2018 15:30:24 itsParameters_.setColCount(colCount); build 12-Sep-2018 15:30:24 + itsPlotter_->gridSizeChanged(rowCount, colCount); build 12-Sep-2018 15:30:24 //Required so that if the user has unplotted changes, for example, selection build 12-Sep-2018 15:30:24 //the new grid will pick up the changes. build 12-Sep-2018 15:30:24 bool plotted = itsPlotter_->plot(); build 12-Sep-2018 15:30:24 diff --git a/code/plotms/PlotMS/PlotMSConstants.cc b/code/plotms/PlotMS/PlotMSConstants.cc build 12-Sep-2018 15:30:24 index 615f1fb..d2bdce1 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/PlotMS/PlotMSConstants.cc build 12-Sep-2018 15:30:24 +++ b/code/plotms/PlotMS/PlotMSConstants.cc build 12-Sep-2018 15:30:24 @@ -83,6 +83,13 @@ bool PMS::axisIsUV(Axis axis) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +bool PMS::axisIsOverlay(Axis axis) { build 12-Sep-2018 15:30:24 + switch(axis) { build 12-Sep-2018 15:30:24 + case ATM: case TSKY: return true; build 12-Sep-2018 15:30:24 + default: return false; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 PMS::AxisType PMS::axisType(Axis axis) { build 12-Sep-2018 15:30:24 switch(axis) { build 12-Sep-2018 15:30:24 case FLAG: build 12-Sep-2018 15:30:24 diff --git a/code/plotms/PlotMS/PlotMSConstants.h b/code/plotms/PlotMS/PlotMSConstants.h build 12-Sep-2018 15:30:24 index c9d8769..24ed288 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/PlotMS/PlotMSConstants.h build 12-Sep-2018 15:30:24 +++ b/code/plotms/PlotMS/PlotMSConstants.h build 12-Sep-2018 15:30:24 @@ -179,6 +179,8 @@ public: build 12-Sep-2018 15:30:24 static bool axisIsWeight(Axis axis); build 12-Sep-2018 15:30:24 // for loading conjugates and setting axis ranges build 12-Sep-2018 15:30:24 static bool axisIsUV(Axis axis); build 12-Sep-2018 15:30:24 + // for adjusting axis ranges build 12-Sep-2018 15:30:24 + static bool axisIsOverlay(Axis axis); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Enum for different axes types. Currently only used to display this build 12-Sep-2018 15:30:24 // information to the user in the GUI's cache tab. build 12-Sep-2018 15:30:24 diff --git a/code/plotms/PlotMS/PlotMSSelection.cc b/code/plotms/PlotMS/PlotMSSelection.cc build 12-Sep-2018 15:30:24 index f3c72d2..70518e5 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/PlotMS/PlotMSSelection.cc build 12-Sep-2018 15:30:24 +++ b/code/plotms/PlotMS/PlotMSSelection.cc build 12-Sep-2018 15:30:24 @@ -164,10 +164,10 @@ void PlotMSSelection::apply(NewCalTable& ct, NewCalTable& selCT, build 12-Sep-2018 15:30:24 if (feed().length()>0) build 12-Sep-2018 15:30:24 throw(AipsError("Selection by feed not supported for NewCalTable")); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Set the selected NewCalTable to be the same initially build 12-Sep-2018 15:30:24 - // as the input NewCalTable build 12-Sep-2018 15:30:24 - selCT = ct; build 12-Sep-2018 15:30:24 - if (!isEmpty()) { build 12-Sep-2018 15:30:24 + if (isEmpty()) { build 12-Sep-2018 15:30:24 + // Set the selected NewCalTable to be the same as the input NewCalTable build 12-Sep-2018 15:30:24 + selCT = ct; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 // set up CTSelection with expressions build 12-Sep-2018 15:30:24 CTSelection cts; build 12-Sep-2018 15:30:24 cts.setTimeExpr(timerange()); build 12-Sep-2018 15:30:24 @@ -182,7 +182,7 @@ void PlotMSSelection::apply(NewCalTable& ct, NewCalTable& selCT, build 12-Sep-2018 15:30:24 CTInterface cti(ct); build 12-Sep-2018 15:30:24 TableExprNode ten = cts.toTableExprNode(&cti); build 12-Sep-2018 15:30:24 try { build 12-Sep-2018 15:30:24 - getSelectedTable(selCT, ct, ten, ""); build 12-Sep-2018 15:30:24 + selCT = ct(ten); build 12-Sep-2018 15:30:24 } catch(AipsError x) { build 12-Sep-2018 15:30:24 throw(AipsError("Error selecting on caltable:\n" + x.getMesg())); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/plotms/Plots/PlotMSPlot.cc b/code/plotms/Plots/PlotMSPlot.cc build 12-Sep-2018 15:30:24 index 3efaa3c..b9cb91c 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/Plots/PlotMSPlot.cc build 12-Sep-2018 15:30:24 +++ b/code/plotms/Plots/PlotMSPlot.cc build 12-Sep-2018 15:30:24 @@ -1761,7 +1761,7 @@ void PlotMSPlot::setCanvasProperties (int row, int col, int numplots, uInt itera build 12-Sep-2018 15:30:24 if ( axesParams->xRangeSet() ){ build 12-Sep-2018 15:30:24 // Custom axes ranges set by user build 12-Sep-2018 15:30:24 canvas->setAxisRange(cx, axesParams->xRange()); build 12-Sep-2018 15:30:24 - } else if (xPtsToPlot) { build 12-Sep-2018 15:30:24 + } else if (xPtsToPlot && !iterParams->isGlobalScaleX()) { build 12-Sep-2018 15:30:24 setAxisRange(x, cx, xmin, xmax, canvas); build 12-Sep-2018 15:30:24 if (PMS::axisIsUV(x)) { build 12-Sep-2018 15:30:24 xIsUV = true; build 12-Sep-2018 15:30:24 @@ -1776,15 +1776,8 @@ void PlotMSPlot::setCanvasProperties (int row, int col, int numplots, uInt itera build 12-Sep-2018 15:30:24 if ( axesParams->yRangeSet(i) ){ build 12-Sep-2018 15:30:24 // Custom axes ranges set by user build 12-Sep-2018 15:30:24 canvas->setAxisRange(cy, axesParams->yRange(i)); build 12-Sep-2018 15:30:24 - } else if (yPtsToPlot) { build 12-Sep-2018 15:30:24 + } else if (yPtsToPlot && !iterParams->isGlobalScaleY()) { build 12-Sep-2018 15:30:24 PMS::Axis y = cacheParams->yAxis(i); build 12-Sep-2018 15:30:24 - // add margin if showAtm so overlay doesn't overlap plot build 12-Sep-2018 15:30:24 - if ((cacheParams->showAtm() && y!=PMS::ATM) || build 12-Sep-2018 15:30:24 - (cacheParams->showTsky() && y!=PMS::TSKY)) { build 12-Sep-2018 15:30:24 - ymax += (ymax-ymin)*0.5; build 12-Sep-2018 15:30:24 - pair ybounds = make_pair(ymin, ymax); build 12-Sep-2018 15:30:24 - canvas->setAxisRange(cy, ybounds); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 setAxisRange(y, cy, ymin, ymax, canvas); build 12-Sep-2018 15:30:24 if (PMS::axisIsUV(y) && xIsUV) { build 12-Sep-2018 15:30:24 // set x and y ranges equally build 12-Sep-2018 15:30:24 @@ -1796,13 +1789,7 @@ void PlotMSPlot::setCanvasProperties (int row, int col, int numplots, uInt itera build 12-Sep-2018 15:30:24 makeSquare = true; build 12-Sep-2018 15:30:24 if (xIsUVwave && (y==PMS::UWAVE || y==PMS::VWAVE)) build 12-Sep-2018 15:30:24 waveplot=true; build 12-Sep-2018 15:30:24 - } else if (y==PMS::ATM || y==PMS::TSKY) { build 12-Sep-2018 15:30:24 - itsCache_->indexer(1,iteration).minsMaxes(xmin, xmax, ymin, ymax); build 12-Sep-2018 15:30:24 - pair atmrange; build 12-Sep-2018 15:30:24 - if (y==PMS::ATM) atmrange = make_pair(0, min(ymax+1.0, 100.0)); build 12-Sep-2018 15:30:24 - else atmrange = make_pair(0, ymax+0.1); build 12-Sep-2018 15:30:24 - canvas->setAxisRange(cy, atmrange); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/PlotMSCacheAveraging_GT.cc b/code/plotms/test/PlotMSCacheAveraging_GT.cc build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..7746017 build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/plotms/test/PlotMSCacheAveraging_GT.cc build 12-Sep-2018 15:30:24 @@ -0,0 +1,651 @@ build 12-Sep-2018 15:30:24 +//# PlotMSCacheAveraging_GT.cc:: GoogleTest for plotms cache averaging modes build 12-Sep-2018 15:30:24 +//# Copyright (C) 2018 build 12-Sep-2018 15:30:24 +//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 +//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 +//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 +//# option) any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 +//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 +//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 +//# License for more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 +//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 +//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 +//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 +//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 +//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 +//# 520 Edgemont Road build 12-Sep-2018 15:30:24 +//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# $Id$ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +using namespace casa; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +class PlotMSCacheTest : public ::testing::Test { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +protected: build 12-Sep-2018 15:30:24 + virtual void SetUp() { build 12-Sep-2018 15:30:24 + // Using visstat2 regression dataset: build 12-Sep-2018 15:30:24 + // All datacolumns present: data, model, corrected build 12-Sep-2018 15:30:24 + dataPath = tUtil::getFullPath( "ngc5921_add_corect_model.ms", "visstat2" ); build 12-Sep-2018 15:30:24 + MeasurementSet ms(dataPath); build 12-Sep-2018 15:30:24 + Block sortCols(4); // Use default sort columns build 12-Sep-2018 15:30:24 + sortCols[0] = MS::columnName(MS::ARRAY_ID); build 12-Sep-2018 15:30:24 + sortCols[1] = MS::columnName(MS::FIELD_ID); build 12-Sep-2018 15:30:24 + sortCols[2] = MS::columnName(MS::DATA_DESC_ID); build 12-Sep-2018 15:30:24 + sortCols[3] = MS::columnName(MS::TIME); build 12-Sep-2018 15:30:24 + sortedMS = ms.sort(sortCols); build 12-Sep-2018 15:30:24 + // specific to this dataset: build 12-Sep-2018 15:30:24 + expNChunk = 60; build 12-Sep-2018 15:30:24 + expNCorr = 2; build 12-Sep-2018 15:30:24 + expNChan = 63; build 12-Sep-2018 15:30:24 + expNRow = 351; // rows in first chunk build 12-Sep-2018 15:30:24 + // Set up plotms cache object with no parent (PlotMSApp*) build 12-Sep-2018 15:30:24 + cache = new MSCache(nullptr); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void TearDown() { build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String dataPath; build 12-Sep-2018 15:30:24 + Int expNChunk, expNCorr, expNChan, expNRow; build 12-Sep-2018 15:30:24 + MeasurementSet sortedMS; build 12-Sep-2018 15:30:24 + // use defaults (none!) build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 + MSCache* cache; build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +int main(int argc, char** argv) { build 12-Sep-2018 15:30:24 + ::testing::InitGoogleTest(&argc, argv); build 12-Sep-2018 15:30:24 + return RUN_ALL_TESTS(); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testAvgchannel) { build 12-Sep-2018 15:30:24 + // Test visibilities with channel averaging build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + // average all channels; pipeline uses large number build 12-Sep-2018 15:30:24 + String avgchan("1e6"); build 12-Sep-2018 15:30:24 + itsAveraging.setChannel(true); build 12-Sep-2018 15:30:24 + itsAveraging.setChannelValue(String::toDouble(avgchan)); build 12-Sep-2018 15:30:24 + expNChan = 1; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // main table columns; ignoring flags since all unflagged data build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(sortedMS); build 12-Sep-2018 15:30:24 + Array corrData(msmc.correctedData().getColumn()); build 12-Sep-2018 15:30:24 + Array wtsp(msmc.weightSpectrum().getColumn()); build 12-Sep-2018 15:30:24 + // adjust cube shapes for first chunk build 12-Sep-2018 15:30:24 + IPosition visShape(corrData.shape()); build 12-Sep-2018 15:30:24 + visShape.setLast(IPosition(1,expNRow)); build 12-Sep-2018 15:30:24 + corrData.adjustLastAxis(visShape); build 12-Sep-2018 15:30:24 + wtsp.adjustLastAxis(visShape); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // average channel axis build 12-Sep-2018 15:30:24 + Cube avgCorrData(expNCorr, expNChan, expNRow); build 12-Sep-2018 15:30:24 + for (Int row=0; row dataSlice = corrData(Slicer(Slice(corr), Slice(), Slice(row))); build 12-Sep-2018 15:30:24 + Array wtspSlice = wtsp(Slicer(Slice(corr), Slice(), Slice(row))); build 12-Sep-2018 15:30:24 + dataSlice *= wtspSlice; build 12-Sep-2018 15:30:24 + avgCorrData(corr, 0, row) = sum(dataSlice) / sum(wtspSlice); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + // amplitude of averaged data build 12-Sep-2018 15:30:24 + Cube expAmpCorr(amplitude(avgCorrData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // load cache and check first chunk build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + std::vector loadAxes {PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::CORRECTED, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChan, cache->ampCorr(ichunk).shape()(1)); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allNear(expAmpCorr, cache->ampCorr(ichunk), .000001)); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testAvgTime) { build 12-Sep-2018 15:30:24 + // Test visibilities with time averaging build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + expNRow = 1; // all rows averaged into 1 row build 12-Sep-2018 15:30:24 + expNChunk = 7; // since chunks are averaged together build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // average all times in chunk build 12-Sep-2018 15:30:24 + String avgtime("1e6"); build 12-Sep-2018 15:30:24 + itsAveraging.setTime(true); build 12-Sep-2018 15:30:24 + itsAveraging.setTimeValue(String::toDouble(avgtime)); build 12-Sep-2018 15:30:24 + // First chunk is first scan (1) and first field (0) build 12-Sep-2018 15:30:24 + // Time averaging is by baseline; select one baseline for test build 12-Sep-2018 15:30:24 + String antennaExpr("2&3"), scanExpr("1"), fieldExpr("0"); build 12-Sep-2018 15:30:24 + itsSelection.setAntenna(antennaExpr); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Get selected MS: build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, "", "", antennaExpr, build 12-Sep-2018 15:30:24 + fieldExpr, "", "", "", "", scanExpr, "", "", "", ""); build 12-Sep-2018 15:30:24 + // main table columns; ignoring flags since all unflagged data build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array corrData(msmc.correctedData().getColumn()); build 12-Sep-2018 15:30:24 + Array wtsp(msmc.weightSpectrum().getColumn()); build 12-Sep-2018 15:30:24 + // adjust cube shapes for first chunk build 12-Sep-2018 15:30:24 + IPosition visShape(corrData.shape()); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // average time (row) axis build 12-Sep-2018 15:30:24 + Cube avgCorrData(expNCorr, expNChan, expNRow); build 12-Sep-2018 15:30:24 + for (Int corr=0; corr dataSlice = corrData(Slicer(Slice(corr), Slice(chan), Slice())); build 12-Sep-2018 15:30:24 + Array wtspSlice = wtsp(Slicer(Slice(corr), Slice(chan), Slice())); build 12-Sep-2018 15:30:24 + dataSlice *= wtspSlice; build 12-Sep-2018 15:30:24 + avgCorrData(corr, chan, 0) = sum(dataSlice) / sum(wtspSlice); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + // amplitude of averaged data build 12-Sep-2018 15:30:24 + Cube expAmpCorr(amplitude(avgCorrData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // load cache and check first chunk build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + std::vector loadAxes {PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::CORRECTED, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAmpCorr, cache->ampCorr(ichunk))); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testAvgScan) { build 12-Sep-2018 15:30:24 + // Test visibilities with time averaging over scan build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + expNRow = 1; // all rows averaged into 1 row build 12-Sep-2018 15:30:24 + expNChunk = 3; // since chunks are averaged together build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // average all times in chunk build 12-Sep-2018 15:30:24 + String avgtime("1e6"); build 12-Sep-2018 15:30:24 + itsAveraging.setTime(true); build 12-Sep-2018 15:30:24 + itsAveraging.setTimeValue(String::toDouble(avgtime)); build 12-Sep-2018 15:30:24 + itsAveraging.setScan(true); build 12-Sep-2018 15:30:24 + // First chunk is first field (0) only, averaging over scan build 12-Sep-2018 15:30:24 + // Time averaging is by baseline; select one baseline for test build 12-Sep-2018 15:30:24 + String antennaExpr("2&3"), fieldExpr("0"); build 12-Sep-2018 15:30:24 + itsSelection.setAntenna(antennaExpr); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Get selected MS: build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, "", "", antennaExpr, build 12-Sep-2018 15:30:24 + fieldExpr, "", "", "", "", "", "", "", "", ""); build 12-Sep-2018 15:30:24 + // main table columns; ignoring flags since all unflagged data build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array corrData(msmc.correctedData().getColumn()); build 12-Sep-2018 15:30:24 + Array wtsp(msmc.weightSpectrum().getColumn()); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // average time (row) axis build 12-Sep-2018 15:30:24 + Cube avgCorrData(expNCorr, expNChan, expNRow); build 12-Sep-2018 15:30:24 + for (Int corr=0; corr dataSlice = corrData(Slicer(Slice(corr), Slice(chan), Slice())); build 12-Sep-2018 15:30:24 + Array wtspSlice = wtsp(Slicer(Slice(corr), Slice(chan), Slice())); build 12-Sep-2018 15:30:24 + dataSlice *= wtspSlice; build 12-Sep-2018 15:30:24 + avgCorrData(corr, chan, 0) = sum(dataSlice) / sum(wtspSlice); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + // amplitude of averaged data build 12-Sep-2018 15:30:24 + Cube expAmpCorr(amplitude(avgCorrData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // load cache and check first chunk build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + std::vector loadAxes {PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::CORRECTED, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAmpCorr, cache->ampCorr(ichunk))); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testAvgField) { build 12-Sep-2018 15:30:24 + // Test visibilities with time averaging over field build 12-Sep-2018 15:30:24 + // NOTE: chunks are per scan, so averaging over field makes no difference build 12-Sep-2018 15:30:24 + // (compared to plain time-averaging) since fields do not change mid-scan build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + expNRow = 1; // all rows averaged into 1 row build 12-Sep-2018 15:30:24 + expNChunk = 7; // since chunks are averaged together build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // average all times in chunk build 12-Sep-2018 15:30:24 + String avgtime("1e6"); build 12-Sep-2018 15:30:24 + itsAveraging.setTime(true); build 12-Sep-2018 15:30:24 + itsAveraging.setTimeValue(String::toDouble(avgtime)); build 12-Sep-2018 15:30:24 + itsAveraging.setField(true); build 12-Sep-2018 15:30:24 + // First chunk is first scan (1) build 12-Sep-2018 15:30:24 + // Time averaging is by baseline; select one baseline for test build 12-Sep-2018 15:30:24 + String antennaExpr("2&3"), scanExpr("1"); build 12-Sep-2018 15:30:24 + itsSelection.setAntenna(antennaExpr); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Get selected MS: build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, "", "", antennaExpr, build 12-Sep-2018 15:30:24 + "", "", "", "", "", scanExpr, "", "", "", ""); build 12-Sep-2018 15:30:24 + // main table columns; ignoring flags since all unflagged data build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array corrData(msmc.correctedData().getColumn()); build 12-Sep-2018 15:30:24 + Array wtsp(msmc.weightSpectrum().getColumn()); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // average time (row) axis build 12-Sep-2018 15:30:24 + Cube avgCorrData(expNCorr, expNChan, expNRow); build 12-Sep-2018 15:30:24 + for (Int corr=0; corr dataSlice = corrData(Slicer(Slice(corr), Slice(chan), Slice())); build 12-Sep-2018 15:30:24 + Array wtspSlice = wtsp(Slicer(Slice(corr), Slice(chan), Slice())); build 12-Sep-2018 15:30:24 + dataSlice *= wtspSlice; build 12-Sep-2018 15:30:24 + avgCorrData(corr, chan, 0) = sum(dataSlice) / sum(wtspSlice); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + // amplitude of averaged data build 12-Sep-2018 15:30:24 + Cube expAmpCorr(amplitude(avgCorrData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // load cache and check first chunk build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + std::vector loadAxes {PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::CORRECTED, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAmpCorr, cache->ampCorr(ichunk))); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testAvgScanField) { build 12-Sep-2018 15:30:24 + // Test visibilities with time averaging over scan and field build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + expNRow = 1; // all rows averaged into 1 row build 12-Sep-2018 15:30:24 + expNChunk = 1; // since *all* chunks are averaged together build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // average all times in chunk build 12-Sep-2018 15:30:24 + String avgtime("1e6"); build 12-Sep-2018 15:30:24 + itsAveraging.setTime(true); build 12-Sep-2018 15:30:24 + itsAveraging.setTimeValue(String::toDouble(avgtime)); build 12-Sep-2018 15:30:24 + itsAveraging.setScan(true); build 12-Sep-2018 15:30:24 + itsAveraging.setField(true); build 12-Sep-2018 15:30:24 + // First chunk is first field (0) only, averaging over scan build 12-Sep-2018 15:30:24 + // Time averaging is by baseline; select one baseline for test build 12-Sep-2018 15:30:24 + String antennaExpr("2&3"); build 12-Sep-2018 15:30:24 + itsSelection.setAntenna(antennaExpr); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Get selected MS: build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, "", "", antennaExpr, build 12-Sep-2018 15:30:24 + "", "", "", "", "", "", "", "", "", ""); build 12-Sep-2018 15:30:24 + // main table columns; ignoring flags since all unflagged data build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array corrData(msmc.correctedData().getColumn()); build 12-Sep-2018 15:30:24 + Array wtsp(msmc.weightSpectrum().getColumn()); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // average time (row) axis build 12-Sep-2018 15:30:24 + Cube avgCorrData(expNCorr, expNChan, expNRow); build 12-Sep-2018 15:30:24 + for (Int corr=0; corr dataSlice = corrData(Slicer(Slice(corr), Slice(chan), Slice())); build 12-Sep-2018 15:30:24 + Array wtspSlice = wtsp(Slicer(Slice(corr), Slice(chan), Slice())); build 12-Sep-2018 15:30:24 + dataSlice *= wtspSlice; build 12-Sep-2018 15:30:24 + avgCorrData(corr, chan, 0) = sum(dataSlice) / sum(wtspSlice); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + // amplitude of averaged data build 12-Sep-2018 15:30:24 + Cube expAmpCorr(amplitude(avgCorrData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // load cache and check first chunk build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + std::vector loadAxes {PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::CORRECTED, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allNear(expAmpCorr, cache->ampCorr(ichunk), .000001)); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testAvgBaseline) { build 12-Sep-2018 15:30:24 + // Select two baselines and average them together build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + expNRow = 1; // all rows averaged into 1 row build 12-Sep-2018 15:30:24 + Int vbNRow(2); // each chunk has one row per baseline build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // selections build 12-Sep-2018 15:30:24 + itsAveraging.setBaseline(True); build 12-Sep-2018 15:30:24 + String antennaExpr("2&3; 2&4"); build 12-Sep-2018 15:30:24 + itsSelection.setAntenna(antennaExpr); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Get selected MS: build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, "", "", antennaExpr, build 12-Sep-2018 15:30:24 + "", "", "", "", "", "", "", "", "", ""); build 12-Sep-2018 15:30:24 + // main table columns; ignoring flags since all unflagged data build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array corrData(msmc.correctedData().getColumn()); build 12-Sep-2018 15:30:24 + // PlotMSVBAverager uses weight instead of weight spectrum build 12-Sep-2018 15:30:24 + Matrix wt(msmc.weight().getColumn()); build 12-Sep-2018 15:30:24 + // vb has two rows, one per baseline build 12-Sep-2018 15:30:24 + IPosition visShape(corrData.shape()); build 12-Sep-2018 15:30:24 + visShape.setLast(IPosition(1,vbNRow)); build 12-Sep-2018 15:30:24 + corrData.adjustLastAxis(visShape); build 12-Sep-2018 15:30:24 + IPosition wtShape(wt.shape()); build 12-Sep-2018 15:30:24 + wtShape.setLast(IPosition(1,vbNRow)); build 12-Sep-2018 15:30:24 + wt.adjustLastAxis(wtShape); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // make wtsp cube from wt: fill in same value for all chans build 12-Sep-2018 15:30:24 + Cube wtsp(visShape); build 12-Sep-2018 15:30:24 + Float weightVal; build 12-Sep-2018 15:30:24 + for (Int corr=0; corr avgCorrData(expNCorr, expNChan, expNRow); build 12-Sep-2018 15:30:24 + for (Int corr=0; corr dataSlice = corrData(Slicer(Slice(corr), Slice(chan), Slice())); build 12-Sep-2018 15:30:24 + Array wtspSlice = wtsp(Slicer(Slice(corr), Slice(chan), Slice())); build 12-Sep-2018 15:30:24 + dataSlice *= wtspSlice; build 12-Sep-2018 15:30:24 + avgCorrData(corr, chan, 0) = sum(dataSlice) / sum(wtspSlice); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + // amplitude of averaged data build 12-Sep-2018 15:30:24 + Cube expAmpCorr(amplitude(avgCorrData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // load cache and check first chunk build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + std::vector loadAxes {PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::CORRECTED, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAmpCorr, cache->ampCorr(ichunk))); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testAvgAntenna) { build 12-Sep-2018 15:30:24 + // Select one antenna and average data for antennas in chunk build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + expNRow = 26; // nAnt for chunk build 12-Sep-2018 15:30:24 + Int vbNRow(25); // each chunk has one row per baseline build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set selection and averaging build 12-Sep-2018 15:30:24 + String antennaExpr("0"); build 12-Sep-2018 15:30:24 + itsAveraging.setAntenna(True); build 12-Sep-2018 15:30:24 + itsSelection.setAntenna(antennaExpr); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Get selected MS: build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, "", "", antennaExpr, build 12-Sep-2018 15:30:24 + "", "", "", "", "", "", "", "", "", ""); build 12-Sep-2018 15:30:24 + // main table columns; ignoring flags since all unflagged data build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Cube corrData(msmc.correctedData().getColumn()); build 12-Sep-2018 15:30:24 + // PlotMSVBAverager uses weight instead of weight spectrum build 12-Sep-2018 15:30:24 + Matrix wt(msmc.weight().getColumn()); build 12-Sep-2018 15:30:24 + Vector ant1(msmc.antenna1().getColumn()), build 12-Sep-2018 15:30:24 + ant2(msmc.antenna2().getColumn()); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // resize for first chunk build 12-Sep-2018 15:30:24 + IPosition visShape(corrData.shape()); build 12-Sep-2018 15:30:24 + visShape.setLast(IPosition(1,vbNRow)); build 12-Sep-2018 15:30:24 + corrData.adjustLastAxis(visShape); build 12-Sep-2018 15:30:24 + IPosition wtShape(wt.shape()); build 12-Sep-2018 15:30:24 + wtShape.setLast(IPosition(1,vbNRow)); build 12-Sep-2018 15:30:24 + wt.adjustLastAxis(wtShape); build 12-Sep-2018 15:30:24 + ant1.resize(vbNRow, true); build 12-Sep-2018 15:30:24 + ant2.resize(vbNRow, true); build 12-Sep-2018 15:30:24 + // set of all antenna ids build 12-Sep-2018 15:30:24 + Vector allAntIds = concatenateArray(ant1, ant2); build 12-Sep-2018 15:30:24 + Int nAnts = GenSort::sort(allAntIds, Sort::Ascending, Sort::NoDuplicates); build 12-Sep-2018 15:30:24 + allAntIds.resize(nAnts, true); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // make wtsp cube from wt: fill in same value for all chans build 12-Sep-2018 15:30:24 + Cube wtsp(visShape); build 12-Sep-2018 15:30:24 + Float weightVal; build 12-Sep-2018 15:30:24 + for (Int corr=0; corr accumCorrData(outShape, 0.0); build 12-Sep-2018 15:30:24 + Cube wtPerAnt(outShape, 0.0); build 12-Sep-2018 15:30:24 + for (Int antIdx=0; antIdx rowWt = wtsp.xyPlane(row); build 12-Sep-2018 15:30:24 + Matrix antWtData = corrData.xyPlane(row) * rowWt; build 12-Sep-2018 15:30:24 + // no += for Matrix build 12-Sep-2018 15:30:24 + Matrix accumAntWtData = antWtData + accumCorrData.xyPlane(antIdx); build 12-Sep-2018 15:30:24 + accumCorrData.xyPlane(antIdx) = accumAntWtData; build 12-Sep-2018 15:30:24 + wtPerAnt.xyPlane(antIdx) = wtPerAnt.xyPlane(antIdx) + rowWt; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + // divide accum data by accum weight to get expected averaged corrected data build 12-Sep-2018 15:30:24 + Cube avgCorrData(expNCorr, expNChan, nAnts); build 12-Sep-2018 15:30:24 + for (Int corr=0; corr expAmpCorr(amplitude(avgCorrData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // load cache and check first chunk build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + std::vector loadAxes {PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::CORRECTED, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allNear(expAmpCorr, cache->ampCorr(ichunk), .000001)); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testAvgSpw) { build 12-Sep-2018 15:30:24 + // average each channel over spw (spw nchans must match) build 12-Sep-2018 15:30:24 + // Use dataset with more than one spw: build 12-Sep-2018 15:30:24 + dataPath = tUtil::getFullPath( "Four_ants_3C286.ms", "flagdata" ); build 12-Sep-2018 15:30:24 + MeasurementSet ms(dataPath); build 12-Sep-2018 15:30:24 + Block sortCols(4); // change order of sort cols to average spws build 12-Sep-2018 15:30:24 + sortCols[0] = MS::columnName(MS::ARRAY_ID); build 12-Sep-2018 15:30:24 + sortCols[1] = MS::columnName(MS::FIELD_ID); build 12-Sep-2018 15:30:24 + sortCols[2] = MS::columnName(MS::TIME); build 12-Sep-2018 15:30:24 + sortCols[3] = MS::columnName(MS::DATA_DESC_ID); build 12-Sep-2018 15:30:24 + sortedMS = ms.sort(sortCols); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Select 2 spws and 2 channels; will average chan0 values and chan1 values build 12-Sep-2018 15:30:24 + // separately over the 2 spws. build 12-Sep-2018 15:30:24 + // Also select first timestamp for rows in first chunk only. build 12-Sep-2018 15:30:24 + String spwExpr("1~2:0~1"), timeExpr("14:45:08.50"); build 12-Sep-2018 15:30:24 + // specific to this dataset: build 12-Sep-2018 15:30:24 + expNChunk=179; expNCorr=4; expNChan=2; expNRow=6; build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, "", timeExpr, "", "", build 12-Sep-2018 15:30:24 + spwExpr, "", "", "", "", "", "", "", ""); build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Cube visData(msmc.data().getColumn()); build 12-Sep-2018 15:30:24 + Cube flags(msmc.flag().getColumn()); build 12-Sep-2018 15:30:24 + Matrix wt(msmc.weight().getColumn()); build 12-Sep-2018 15:30:24 + IPosition visShape(visData.shape()); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // make wtsp cube: fill in same value for all chans build 12-Sep-2018 15:30:24 + Cube wtsp(visShape); build 12-Sep-2018 15:30:24 + Float weightVal; build 12-Sep-2018 15:30:24 + for (Int corr=0; corr avgVisData(expNCorr, expNChan, expNRow); build 12-Sep-2018 15:30:24 + Complex dataSpw1, dataSpw2; build 12-Sep-2018 15:30:24 + Float wtSpw1, wtSpw2; build 12-Sep-2018 15:30:24 + Bool flagSpw1, flagSpw2; build 12-Sep-2018 15:30:24 + for (Int corr=0; corr expAmpData(amplitude(avgVisData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set up selection and averaging for cache build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + itsSelection.setSpw(spwExpr); build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + itsAveraging.setSpw(true); build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // check values for first chunk build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::CHANNEL}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + Int nchunk(cache->nChunk()), nchan(cache->chunkShapes()(IPosition(2,1,ichunk))), build 12-Sep-2018 15:30:24 + nrow(cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + Cube cacheAmpData(cache->ampData(ichunk)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, nchunk); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChan, nchan); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, nrow); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allNear(expAmpData, cacheAmpData, .0000001)); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testAvgTimeScalar) { build 12-Sep-2018 15:30:24 + // Test visibilities with time averaging build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + expNRow = 1; // all rows averaged into 1 row build 12-Sep-2018 15:30:24 + expNChunk = 7; // since chunks are averaged together build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // average all times in chunk build 12-Sep-2018 15:30:24 + String avgtime("1e6"); build 12-Sep-2018 15:30:24 + itsAveraging.setTime(true); build 12-Sep-2018 15:30:24 + itsAveraging.setTimeValue(String::toDouble(avgtime)); build 12-Sep-2018 15:30:24 + itsAveraging.setScalarAve(true); build 12-Sep-2018 15:30:24 + // First chunk is first scan (1) and first field (0). build 12-Sep-2018 15:30:24 + // Time averaging is by baseline; select one baseline for test build 12-Sep-2018 15:30:24 + String antennaExpr("2&3"), scanExpr("1"), fieldExpr("0"); build 12-Sep-2018 15:30:24 + itsSelection.setAntenna(antennaExpr); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Get selected MS: build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, "", "", antennaExpr, build 12-Sep-2018 15:30:24 + fieldExpr, "", "", "", "", scanExpr, "", "", "", ""); build 12-Sep-2018 15:30:24 + // main table columns; ignoring flags since all unflagged data build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array corrData(msmc.correctedData().getColumn()); build 12-Sep-2018 15:30:24 + Array wtsp(msmc.weightSpectrum().getColumn()); build 12-Sep-2018 15:30:24 + // adjust cube shapes for first chunk build 12-Sep-2018 15:30:24 + IPosition visShape(corrData.shape()); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // average amplitudes over time (row) axis build 12-Sep-2018 15:30:24 + Cube expScalarAvgData(expNCorr, expNChan, expNRow); build 12-Sep-2018 15:30:24 + for (Int corr=0; corr dataSlice = amplitude(corrData(Slicer(Slice(corr), Slice(chan), Slice()))); build 12-Sep-2018 15:30:24 + Array wtspSlice = wtsp(Slicer(Slice(corr), Slice(chan), Slice())); build 12-Sep-2018 15:30:24 + dataSlice *= wtspSlice; build 12-Sep-2018 15:30:24 + expScalarAvgData(corr,chan,0) = sum(dataSlice) / sum(wtspSlice); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // load cache and check first chunk build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + std::vector loadAxes {PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::CORRECTED, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allNear(expScalarAvgData, cache->ampCorr(ichunk), .000001)); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/PlotMSCacheCallib_GT.cc b/code/plotms/test/PlotMSCacheCallib_GT.cc build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..d6c81b4 build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/plotms/test/PlotMSCacheCallib_GT.cc build 12-Sep-2018 15:30:24 @@ -0,0 +1,128 @@ build 12-Sep-2018 15:30:24 +//# PlotMSCacheCallib_GT.cc:: GoogleTest for plotms OTF calibration build 12-Sep-2018 15:30:24 +//# Copyright (C) 2018 build 12-Sep-2018 15:30:24 +//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 +//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 +//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 +//# option) any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 +//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 +//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 +//# License for more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 +//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 +//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 +//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 +//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 +//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 +//# 520 Edgemont Road build 12-Sep-2018 15:30:24 +//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# $Id$ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +using namespace casa; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/* test loading corrected data with OTF calibration */ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +class PlotMSCacheTest : public ::testing::Test { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +protected: build 12-Sep-2018 15:30:24 + virtual void SetUp() { build 12-Sep-2018 15:30:24 + // Using mstransform regression dataset with callib file build 12-Sep-2018 15:30:24 + String origPath = tUtil::getFullPath( "ngc5921_regression", "mstransform" ); build 12-Sep-2018 15:30:24 + Directory origDir(origPath); build 12-Sep-2018 15:30:24 + newPath = "ngc5921_regression"; build 12-Sep-2018 15:30:24 + // Copy test dir because callib paths are relative build 12-Sep-2018 15:30:24 + origDir.copy(newPath); build 12-Sep-2018 15:30:24 + dataPath = newPath + "/ngc5921.ms"; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Set up plotms cache object with no parent (PlotMSApp*) build 12-Sep-2018 15:30:24 + cache = new MSCache(nullptr); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + MeasurementSet ms(dataPath); build 12-Sep-2018 15:30:24 + Block sortCols(4); // Use default sort columns build 12-Sep-2018 15:30:24 + sortCols[0] = MS::columnName(MS::ARRAY_ID); build 12-Sep-2018 15:30:24 + sortCols[1] = MS::columnName(MS::FIELD_ID); build 12-Sep-2018 15:30:24 + sortCols[2] = MS::columnName(MS::DATA_DESC_ID); build 12-Sep-2018 15:30:24 + sortCols[3] = MS::columnName(MS::TIME); build 12-Sep-2018 15:30:24 + sortedMS = ms.sort(sortCols); build 12-Sep-2018 15:30:24 + // specific to this dataset: build 12-Sep-2018 15:30:24 + expNChunk = 60; build 12-Sep-2018 15:30:24 + expNRow = 351; // rows in first chunk build 12-Sep-2018 15:30:24 + expNChan = 63; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void TearDown() { build 12-Sep-2018 15:30:24 + if (cache != nullptr) delete cache; build 12-Sep-2018 15:30:24 + Directory newDir(newPath); build 12-Sep-2018 15:30:24 + newDir.removeRecursive(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String newPath, dataPath; build 12-Sep-2018 15:30:24 + Int expNChunk, expNRow, expNChan; // expected values build 12-Sep-2018 15:30:24 + MeasurementSet sortedMS; build 12-Sep-2018 15:30:24 + // use defaults (none!) build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 + MSCache* cache; build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +int main(int argc, char** argv) { build 12-Sep-2018 15:30:24 + ::testing::InitGoogleTest(&argc, argv); build 12-Sep-2018 15:30:24 + return RUN_ALL_TESTS(); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testCallib ) { build 12-Sep-2018 15:30:24 + // dataset only has DATA column, will request CORRECTED build 12-Sep-2018 15:30:24 + // with calibration enabled build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // main table columns : DATA build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(sortedMS); build 12-Sep-2018 15:30:24 + Array visdata(msmc.data().getColumn()); build 12-Sep-2018 15:30:24 + IPosition visshape = visdata.shape(); build 12-Sep-2018 15:30:24 + visshape.setLast(IPosition(1,expNRow)); build 12-Sep-2018 15:30:24 + visdata.adjustLastAxis(visshape); build 12-Sep-2018 15:30:24 + Array ampdata(amplitude(visdata)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::CORRECTED, PMS::DATA}; build 12-Sep-2018 15:30:24 + // no corrected data, uses DATA instead build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, itsTransformations, build 12-Sep-2018 15:30:24 + itsCalibration, nullptr ); build 12-Sep-2018 15:30:24 + EXPECT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + EXPECT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + EXPECT_TRUE(allEQ(ampdata, cache->ampData(ichunk))); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // no corrected data, use OTF calibration build 12-Sep-2018 15:30:24 + itsCalibration.setUseCallib(True); build 12-Sep-2018 15:30:24 + String callibPath(newPath + "/ngc5921_callib.txt"); build 12-Sep-2018 15:30:24 + itsCalibration.setCalLibrary(callibPath); build 12-Sep-2018 15:30:24 + //itsCalibration.setCalLibrary("ngc5921_callib.txt"); build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, itsTransformations, build 12-Sep-2018 15:30:24 + itsCalibration, nullptr ); build 12-Sep-2018 15:30:24 + EXPECT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + EXPECT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + // get Amp:corrected, make sure didn't load DATA again build 12-Sep-2018 15:30:24 + EXPECT_TRUE(allNE(ampdata, cache->ampCorr(ichunk))); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/PlotMSCacheGeom_GT.cc b/code/plotms/test/PlotMSCacheGeom_GT.cc build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..2696c11 build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/plotms/test/PlotMSCacheGeom_GT.cc build 12-Sep-2018 15:30:24 @@ -0,0 +1,235 @@ build 12-Sep-2018 15:30:24 +//# PlotMSCacheGeom_GT.cc:: GoogleTest for plotms cache observational geometry axes build 12-Sep-2018 15:30:24 +//# Copyright (C) 2018 build 12-Sep-2018 15:30:24 +//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 +//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 +//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 +//# option) any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 +//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 +//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 +//# License for more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 +//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 +//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 +//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 +//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 +//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 +//# 520 Edgemont Road build 12-Sep-2018 15:30:24 +//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# $Id$ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +using namespace casa; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +class PlotMSCacheTest : public ::testing::Test { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +protected: build 12-Sep-2018 15:30:24 + virtual void SetUp() { build 12-Sep-2018 15:30:24 + // Using visstat2 regression dataset: build 12-Sep-2018 15:30:24 + // All datacolumns present: data, model, corrected build 12-Sep-2018 15:30:24 + dataPath = tUtil::getFullPath( "ngc5921_add_corect_model.ms", "visstat2" ); build 12-Sep-2018 15:30:24 + MeasurementSet ms(dataPath); build 12-Sep-2018 15:30:24 + Block sortCols(4); // Use default sort columns build 12-Sep-2018 15:30:24 + sortCols[0] = MS::columnName(MS::ARRAY_ID); build 12-Sep-2018 15:30:24 + sortCols[1] = MS::columnName(MS::FIELD_ID); build 12-Sep-2018 15:30:24 + sortCols[2] = MS::columnName(MS::DATA_DESC_ID); build 12-Sep-2018 15:30:24 + sortCols[3] = MS::columnName(MS::TIME); build 12-Sep-2018 15:30:24 + sortedMS = ms.sort(sortCols); build 12-Sep-2018 15:30:24 + // specific to this dataset: build 12-Sep-2018 15:30:24 + expNChunk = 60; build 12-Sep-2018 15:30:24 + expNRow = 351; // rows in first chunk build 12-Sep-2018 15:30:24 + expNChan = 63; build 12-Sep-2018 15:30:24 + // Set up plotms cache object with no parent (PlotMSApp*) build 12-Sep-2018 15:30:24 + cache = new MSCache(nullptr); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void TearDown() { build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String dataPath; build 12-Sep-2018 15:30:24 + Int expNChunk, expNRow, expNChan; // expected values build 12-Sep-2018 15:30:24 + MeasurementSet sortedMS; build 12-Sep-2018 15:30:24 + // use defaults (none!) build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 + MSCache* cache; build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +int main(int argc, char** argv) { build 12-Sep-2018 15:30:24 + ::testing::InitGoogleTest(&argc, argv); build 12-Sep-2018 15:30:24 + return RUN_ALL_TESTS(); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testObsGeom) { build 12-Sep-2018 15:30:24 + // Test observational geometry axis options: build 12-Sep-2018 15:30:24 + // UVDIST,UVDIST_L,U,V,W,UWAVE,VWAVE,WWAVE,AZ0,EL0,HA0,PA0, build 12-Sep-2018 15:30:24 + // ANTENNA,AZIMUTH,ELEVATION,PARANG build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Load expected/needed values from MeasurementSet build 12-Sep-2018 15:30:24 + // main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(sortedMS); build 12-Sep-2018 15:30:24 + Matrix uvw(msmc.uvw().getColumn()); build 12-Sep-2018 15:30:24 + Int ddID(msmc.dataDescId().get(0)), build 12-Sep-2018 15:30:24 + fieldId(msmc.fieldId().get(0)); build 12-Sep-2018 15:30:24 + MEpoch epoch(msmc.timeMeas()(0)); build 12-Sep-2018 15:30:24 + // subtable columns build 12-Sep-2018 15:30:24 + ROMSColumns mscol(sortedMS); build 12-Sep-2018 15:30:24 + Int spw(mscol.dataDescription().spectralWindowId().get(ddID)); build 12-Sep-2018 15:30:24 + Vector chanfreqs(mscol.spectralWindow().chanFreq().get(spw)); build 12-Sep-2018 15:30:24 + uInt nAnt = mscol.antenna().nrow(); build 12-Sep-2018 15:30:24 + Vector phasedir(mscol.field().phaseDirMeasCol()(fieldId)); build 12-Sep-2018 15:30:24 + Cube recepAngle(mscol.feed().receptorAngle().getColumn()); build 12-Sep-2018 15:30:24 + Matrix angles = recepAngle.xyPlane(0); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + MSDerivedValues msd; // for azel build 12-Sep-2018 15:30:24 + msd.setAntennas(mscol.antenna()); build 12-Sep-2018 15:30:24 + msd.setFieldCenter(phasedir(0)); build 12-Sep-2018 15:30:24 + msd.setEpoch(epoch); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Resize for first chunk and do calculations build 12-Sep-2018 15:30:24 + // get u,v,w build 12-Sep-2018 15:30:24 + uvw.resize(IPosition(2,3,expNRow), True); build 12-Sep-2018 15:30:24 + Vector expU(uvw.row(0)), expV(uvw.row(1)), expW(uvw.row(2)), build 12-Sep-2018 15:30:24 + expUVDist; build 12-Sep-2018 15:30:24 + // calculate uvdist build 12-Sep-2018 15:30:24 + uInt vecsize = expU.size(); build 12-Sep-2018 15:30:24 + expUVDist.resize(vecsize); build 12-Sep-2018 15:30:24 + for (uInt i=0; i expUVDistL, expUWave, expVWave, expWWave; build 12-Sep-2018 15:30:24 + // c is the speed of light in km/s (casa/BasicSL/Constants.cc): build 12-Sep-2018 15:30:24 + Vector uvDistM(expUVDist/C::c); build 12-Sep-2018 15:30:24 + Vector uM(expU/C::c), vM(expV/C::c), wM(expW/C::c); build 12-Sep-2018 15:30:24 + expUVDistL.resize(expNChan, expNRow); build 12-Sep-2018 15:30:24 + expUWave.resize(expNChan, expNRow); build 12-Sep-2018 15:30:24 + expVWave.resize(expNChan, expNRow); build 12-Sep-2018 15:30:24 + expWWave.resize(expNChan, expNRow); build 12-Sep-2018 15:30:24 + for (Int row=0; row azel, expAz(nAnt), expEl(nAnt); build 12-Sep-2018 15:30:24 + Vector expParAng(nAnt); build 12-Sep-2018 15:30:24 + for (uInt ant=0; ant expAnt(nAnt); build 12-Sep-2018 15:30:24 + indgen(expAnt); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Request geometry axes: build 12-Sep-2018 15:30:24 + std::vector geomAxes {PMS::UVDIST, PMS::UVDIST_L, PMS::U, PMS::V, build 12-Sep-2018 15:30:24 + PMS::W, PMS::UWAVE, PMS::VWAVE, PMS::WWAVE, PMS::AZ0, PMS::EL0, PMS::HA0, build 12-Sep-2018 15:30:24 + PMS::PA0, PMS::ANTENNA, PMS::AZIMUTH, PMS::ELEVATION, PMS::PARANG}; build 12-Sep-2018 15:30:24 + // Datacolumn for non-vis axes always DATA build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // check values for first chunk build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + for (auto axis : geomAxes) { build 12-Sep-2018 15:30:24 + std::vector loadAxes{axis, PMS::TIME}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Check arrays with allEQ in ArrayLogical.h build 12-Sep-2018 15:30:24 + switch(axis) { build 12-Sep-2018 15:30:24 + case PMS::UVDIST: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expUVDist, cache->uVDist(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::UVDIST_L: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expUVDistL, cache->uVDistL(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::U: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expU, cache->u(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::V: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expV, cache->v(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::W: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expW, cache->w(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::UWAVE: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expUWave, cache->uWave(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::VWAVE: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVWave, cache->vWave(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::WWAVE: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expWWave, cache->wWave(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::AZ0: build 12-Sep-2018 15:30:24 + ASSERT_EQ(expAz0, cache->az0(ichunk)); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::EL0: build 12-Sep-2018 15:30:24 + ASSERT_EQ(expEl0, cache->el0(ichunk)); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::HA0: build 12-Sep-2018 15:30:24 + ASSERT_NEAR(expHA0, cache->ha0(ichunk), .00001); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::PA0: build 12-Sep-2018 15:30:24 + ASSERT_NEAR(expPA0, cache->pa0(ichunk), .00001); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::ANTENNA: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAnt, cache->ant(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::AZIMUTH: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAz, cache->az(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::ELEVATION: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expEl, cache->el(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::PARANG: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allNear(expParAng, cache->parAng(ichunk), .00001)); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + default: build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/PlotMSCacheInvalid_GT.cc b/code/plotms/test/PlotMSCacheInvalid_GT.cc build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..a236404 build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/plotms/test/PlotMSCacheInvalid_GT.cc build 12-Sep-2018 15:30:24 @@ -0,0 +1,91 @@ build 12-Sep-2018 15:30:24 +//# PlotMSCacheInvalid_GT.cc:: GoogleTest for invalid axes (for test MS) build 12-Sep-2018 15:30:24 +//# Copyright (C) 2018 build 12-Sep-2018 15:30:24 +//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 +//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 +//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 +//# option) any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 +//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 +//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 +//# License for more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 +//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 +//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 +//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 +//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 +//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 +//# 520 Edgemont Road build 12-Sep-2018 15:30:24 +//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# $Id$ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +using namespace casa; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +class PlotMSCacheTest : public ::testing::Test { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +protected: build 12-Sep-2018 15:30:24 + virtual void SetUp() { build 12-Sep-2018 15:30:24 + // Using visstat2 regression dataset: build 12-Sep-2018 15:30:24 + // All datacolumns present: data, model, corrected build 12-Sep-2018 15:30:24 + dataPath = tUtil::getFullPath( "ngc5921_add_corect_model.ms", "visstat2" ); build 12-Sep-2018 15:30:24 + // Set up plotms cache object with no parent (PlotMSApp*) build 12-Sep-2018 15:30:24 + cache = new MSCache(nullptr); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void TearDown() { build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String dataPath; build 12-Sep-2018 15:30:24 + // use defaults (none!) build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 + MSCache* cache; build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +int main(int argc, char** argv) { build 12-Sep-2018 15:30:24 + ::testing::InitGoogleTest(&argc, argv); build 12-Sep-2018 15:30:24 + return RUN_ALL_TESTS(); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testInvalidAxes) { build 12-Sep-2018 15:30:24 + // test cal table and ephem axes build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + std::vector invalidAxes {PMS::GAMP, PMS::GPHASE, build 12-Sep-2018 15:30:24 + PMS::GREAL, PMS::GIMAG, PMS::DELAY, PMS::SWP, PMS::TSYS, build 12-Sep-2018 15:30:24 + PMS::OPAC, PMS::SNR, PMS::TEC, PMS::ANTPOS, build 12-Sep-2018 15:30:24 + // Ephemeris build 12-Sep-2018 15:30:24 + PMS::RADIAL_VELOCITY, PMS::RHO}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + for (auto axis : invalidAxes) { build 12-Sep-2018 15:30:24 + std::vector loadAxes{axis, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_THROW(cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, itsTransformations, build 12-Sep-2018 15:30:24 + itsCalibration, nullptr ), AipsError); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/PlotMSCacheLtdVis_GT.cc b/code/plotms/test/PlotMSCacheLtdVis_GT.cc build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..e5fc583 build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/plotms/test/PlotMSCacheLtdVis_GT.cc build 12-Sep-2018 15:30:24 @@ -0,0 +1,209 @@ build 12-Sep-2018 15:30:24 +//# PlotMSCacheLtdVis_GT.cc:: GoogleTest for limited visibilities (only DATA in MS) build 12-Sep-2018 15:30:24 +//# Copyright (C) 2018 build 12-Sep-2018 15:30:24 +//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 +//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 +//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 +//# option) any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 +//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 +//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 +//# License for more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 +//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 +//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 +//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 +//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 +//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 +//# 520 Edgemont Road build 12-Sep-2018 15:30:24 +//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# $Id$ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +using namespace casa; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/* test dataset visibility axes with one column: DATA or FLOAT_DATA */ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +int main(int argc, char** argv) { build 12-Sep-2018 15:30:24 + ::testing::InitGoogleTest(&argc, argv); build 12-Sep-2018 15:30:24 + return RUN_ALL_TESTS(); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST( PlotMSCacheTest, testDataOnlyMS ) { build 12-Sep-2018 15:30:24 + // dataset only has DATA column build 12-Sep-2018 15:30:24 + String dataPath = tUtil::getFullPath( "pm_ngc5921.ms", "plotms" ); build 12-Sep-2018 15:30:24 + Int ichunk(0), expNChunk(60), expNRow(351); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + MeasurementSet ms(dataPath); build 12-Sep-2018 15:30:24 + Block sortCols(4); // Use default sort columns build 12-Sep-2018 15:30:24 + sortCols[0] = MS::columnName(MS::ARRAY_ID); build 12-Sep-2018 15:30:24 + sortCols[1] = MS::columnName(MS::FIELD_ID); build 12-Sep-2018 15:30:24 + sortCols[2] = MS::columnName(MS::DATA_DESC_ID); build 12-Sep-2018 15:30:24 + sortCols[3] = MS::columnName(MS::TIME); build 12-Sep-2018 15:30:24 + MeasurementSet sortedMS = ms.sort(sortCols); build 12-Sep-2018 15:30:24 + // main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(sortedMS); build 12-Sep-2018 15:30:24 + Array visdata(msmc.data().getColumn()); build 12-Sep-2018 15:30:24 + IPosition visshape = visdata.shape(); build 12-Sep-2018 15:30:24 + visshape.setLast(IPosition(1,expNRow)); build 12-Sep-2018 15:30:24 + visdata.adjustLastAxis(visshape); build 12-Sep-2018 15:30:24 + Array ampdata(amplitude(visdata)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + MSCache* cache = new MSCache(nullptr); build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Datacolumn options: build 12-Sep-2018 15:30:24 + std::vector visCols {PMS::DATA, PMS::CORRECTED, build 12-Sep-2018 15:30:24 + PMS::MODEL, PMS::CORRMODEL, PMS::DATAMODEL, build 12-Sep-2018 15:30:24 + PMS::DATA_DIVIDE_MODEL, PMS::CORRECTED_DIVIDE_MODEL}; build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + for (auto datacol : visCols) { build 12-Sep-2018 15:30:24 + std::vector loadData{datacol, PMS::DATA}; build 12-Sep-2018 15:30:24 + switch (datacol) { build 12-Sep-2018 15:30:24 + case PMS::DATA: build 12-Sep-2018 15:30:24 + case PMS::CORRECTED: build 12-Sep-2018 15:30:24 + case PMS::CORRMODEL: build 12-Sep-2018 15:30:24 + case PMS::CORRECTED_DIVIDE_MODEL: { build 12-Sep-2018 15:30:24 + // no corrected data, uses data instead build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, itsTransformations, build 12-Sep-2018 15:30:24 + itsCalibration, nullptr ); build 12-Sep-2018 15:30:24 + EXPECT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + Int nrow = cache->chunkShapes()(IPosition(2,2,ichunk)); build 12-Sep-2018 15:30:24 + EXPECT_EQ(expNRow, nrow); build 12-Sep-2018 15:30:24 + EXPECT_TRUE(allEQ(ampdata, cache->ampData(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::MODEL: build 12-Sep-2018 15:30:24 + case PMS::DATAMODEL: build 12-Sep-2018 15:30:24 + case PMS::DATA_DIVIDE_MODEL: { build 12-Sep-2018 15:30:24 + // generates model dynamically build 12-Sep-2018 15:30:24 + ASSERT_NO_THROW(cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, itsTransformations, build 12-Sep-2018 15:30:24 + itsCalibration, nullptr )); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + Int nrow = cache->chunkShapes()(IPosition(2,2,ichunk)); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, nrow); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::FLOAT_DATA: { build 12-Sep-2018 15:30:24 + // FLOAT_DATA throws exception for interferometry data build 12-Sep-2018 15:30:24 + ASSERT_THROW(cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, itsTransformations, build 12-Sep-2018 15:30:24 + itsCalibration, nullptr ), AipsError); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST( PlotMSCacheTest, testFloatOnlyMS) { build 12-Sep-2018 15:30:24 + // Test visibility axis options for singledish: build 12-Sep-2018 15:30:24 + // Axes: build 12-Sep-2018 15:30:24 + // amp = real => float data build 12-Sep-2018 15:30:24 + // phase = imag => invalid build 12-Sep-2018 15:30:24 + // Data columns: build 12-Sep-2018 15:30:24 + // DATA = CORRECTED = FLOAT => float data build 12-Sep-2018 15:30:24 + // MODEL = data/corrected residuals => invalid build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // use singledish dataset, only has FLOAT_DATA column build 12-Sep-2018 15:30:24 + String dataPath = tUtil::getFullPath( "sdimaging.ms", "sdimaging" ); build 12-Sep-2018 15:30:24 + MeasurementSet ms(dataPath); build 12-Sep-2018 15:30:24 + Block sortCols(4); // Use default sort columns build 12-Sep-2018 15:30:24 + sortCols[0] = MS::columnName(MS::ARRAY_ID); build 12-Sep-2018 15:30:24 + sortCols[1] = MS::columnName(MS::FIELD_ID); build 12-Sep-2018 15:30:24 + sortCols[2] = MS::columnName(MS::DATA_DESC_ID); build 12-Sep-2018 15:30:24 + sortCols[3] = MS::columnName(MS::TIME); build 12-Sep-2018 15:30:24 + MeasurementSet sortedMS = ms.sort(sortCols); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // main table columns: get first row (==first chunk) build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(sortedMS); build 12-Sep-2018 15:30:24 + Array floatData = msmc.floatData().get(0); // matrix build 12-Sep-2018 15:30:24 + Cube floatCube = floatData.addDegenerate(1); // cube build 12-Sep-2018 15:30:24 + Int expNChunk(3843), expNRow(1); // since only 1 "baseline" build 12-Sep-2018 15:30:24 + // Visibility axis options: build 12-Sep-2018 15:30:24 + std::vector visAxes {PMS::AMP, PMS::PHASE, build 12-Sep-2018 15:30:24 + PMS::REAL, PMS::IMAG}; build 12-Sep-2018 15:30:24 + // Datacolumn options: build 12-Sep-2018 15:30:24 + std::vector visCols {PMS::DATA, PMS::CORRECTED, build 12-Sep-2018 15:30:24 + PMS::MODEL, PMS::CORRMODEL, PMS::DATAMODEL, build 12-Sep-2018 15:30:24 + PMS::DATA_DIVIDE_MODEL, PMS::CORRECTED_DIVIDE_MODEL}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + MSCache* cache = new MSCache(nullptr); build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + for (auto axis : visAxes) { build 12-Sep-2018 15:30:24 + std::vector loadAxes{axis, PMS::TIME}; build 12-Sep-2018 15:30:24 + for (auto datacol : visCols) { build 12-Sep-2018 15:30:24 + std::vector loadData{datacol, PMS::DATA}; build 12-Sep-2018 15:30:24 + switch (axis) { build 12-Sep-2018 15:30:24 + case PMS::AMP: build 12-Sep-2018 15:30:24 + case PMS::REAL: { build 12-Sep-2018 15:30:24 + switch (datacol) { build 12-Sep-2018 15:30:24 + case PMS::DATA: build 12-Sep-2018 15:30:24 + case PMS::CORRECTED: build 12-Sep-2018 15:30:24 + case PMS::FLOAT_DATA: { build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + Int nrow = cache->chunkShapes()(IPosition(2,2,ichunk)); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, nrow); build 12-Sep-2018 15:30:24 + if (axis==PMS::AMP) build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(floatCube, cache->ampFloat(ichunk))); build 12-Sep-2018 15:30:24 + if (axis==PMS::REAL) build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(floatCube, cache->realData(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::MODEL: build 12-Sep-2018 15:30:24 + case PMS::DATAMODEL: build 12-Sep-2018 15:30:24 + case PMS::DATA_DIVIDE_MODEL: build 12-Sep-2018 15:30:24 + case PMS::CORRMODEL: build 12-Sep-2018 15:30:24 + case PMS::CORRECTED_DIVIDE_MODEL: { build 12-Sep-2018 15:30:24 + ASSERT_THROW(cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, itsTransformations, build 12-Sep-2018 15:30:24 + itsCalibration, nullptr ), AipsError); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::PHASE: build 12-Sep-2018 15:30:24 + case PMS::IMAG: { build 12-Sep-2018 15:30:24 + ASSERT_THROW(cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, itsTransformations, build 12-Sep-2018 15:30:24 + itsCalibration, nullptr ), AipsError); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + default: build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/PlotMSCacheMetadata_GT.cc b/code/plotms/test/PlotMSCacheMetadata_GT.cc build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..c18e3bd build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/plotms/test/PlotMSCacheMetadata_GT.cc build 12-Sep-2018 15:30:24 @@ -0,0 +1,200 @@ build 12-Sep-2018 15:30:24 +//# PlotMSCacheMetadata_GT.cc:: GoogleTest for plotms cache metadata axes build 12-Sep-2018 15:30:24 +//# Copyright (C) 2018 build 12-Sep-2018 15:30:24 +//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 +//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 +//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 +//# option) any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 +//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 +//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 +//# License for more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 +//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 +//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 +//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 +//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 +//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 +//# 520 Edgemont Road build 12-Sep-2018 15:30:24 +//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# $Id$ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +using namespace casa; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +class PlotMSCacheTest : public ::testing::Test { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +protected: build 12-Sep-2018 15:30:24 + virtual void SetUp() { build 12-Sep-2018 15:30:24 + // Using visstat2 regression dataset: build 12-Sep-2018 15:30:24 + // All datacolumns present: data, model, corrected build 12-Sep-2018 15:30:24 + dataPath = tUtil::getFullPath( "ngc5921_add_corect_model.ms", "visstat2" ); build 12-Sep-2018 15:30:24 + MeasurementSet ms(dataPath); build 12-Sep-2018 15:30:24 + Block sortCols(4); // Use default sort columns build 12-Sep-2018 15:30:24 + sortCols[0] = MS::columnName(MS::ARRAY_ID); build 12-Sep-2018 15:30:24 + sortCols[1] = MS::columnName(MS::FIELD_ID); build 12-Sep-2018 15:30:24 + sortCols[2] = MS::columnName(MS::DATA_DESC_ID); build 12-Sep-2018 15:30:24 + sortCols[3] = MS::columnName(MS::TIME); build 12-Sep-2018 15:30:24 + sortedMS = ms.sort(sortCols); build 12-Sep-2018 15:30:24 + // specific to this dataset: build 12-Sep-2018 15:30:24 + expNChunk = 60; build 12-Sep-2018 15:30:24 + expNRow = 351; // rows in first chunk build 12-Sep-2018 15:30:24 + expNChan = 63; build 12-Sep-2018 15:30:24 + // Set up plotms cache object with no parent (PlotMSApp*) build 12-Sep-2018 15:30:24 + cache = new MSCache(nullptr); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void TearDown() { build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String dataPath; build 12-Sep-2018 15:30:24 + Int expNChunk, expNRow, expNChan; // expected values build 12-Sep-2018 15:30:24 + MeasurementSet sortedMS; build 12-Sep-2018 15:30:24 + // use defaults (none!) build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 + MSCache* cache; build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +int main(int argc, char** argv) { build 12-Sep-2018 15:30:24 + ::testing::InitGoogleTest(&argc, argv); build 12-Sep-2018 15:30:24 + return RUN_ALL_TESTS(); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testMetadata) { build 12-Sep-2018 15:30:24 + // Test metadata axis options build 12-Sep-2018 15:30:24 + // SCAN,FIELD,TIME,TIME_INTERVAL,SPW,CHANNEL,FREQUENCY,VELOCITY,CORR, build 12-Sep-2018 15:30:24 + // ANTENNA1,ANTENNA2,BASELINE,ROW,OBSERVATION,INTENT,FEED1,FEED2 build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Load expected values from MeasurementSet main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(sortedMS); build 12-Sep-2018 15:30:24 + Int expScan(msmc.scanNumber().get(0)), build 12-Sep-2018 15:30:24 + expField(msmc.fieldId().get(0)); build 12-Sep-2018 15:30:24 + Double expTime(msmc.time().get(0)), build 12-Sep-2018 15:30:24 + expInterval(msmc.interval().get(0)); build 12-Sep-2018 15:30:24 + Vector expAnt1(msmc.antenna1().getColumn()), build 12-Sep-2018 15:30:24 + expAnt2(msmc.antenna2().getColumn()), build 12-Sep-2018 15:30:24 + expObsId(msmc.observationId().getColumn()), build 12-Sep-2018 15:30:24 + expIntent(msmc.stateId().getColumn()), build 12-Sep-2018 15:30:24 + expFeed1(msmc.feed1().getColumn()), build 12-Sep-2018 15:30:24 + expFeed2(msmc.feed2().getColumn()), build 12-Sep-2018 15:30:24 + expBaseline; build 12-Sep-2018 15:30:24 + Int ddID(msmc.dataDescId().get(0)); // for spw, pol build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // subtable columns build 12-Sep-2018 15:30:24 + ROMSColumns mscol(sortedMS); build 12-Sep-2018 15:30:24 + Int polID(mscol.dataDescription().polarizationId().get(ddID)); build 12-Sep-2018 15:30:24 + uInt nAnt(mscol.antenna().nrow()); build 12-Sep-2018 15:30:24 + Vector expChan, build 12-Sep-2018 15:30:24 + expCorr(mscol.polarization().corrType().get(polID)); build 12-Sep-2018 15:30:24 + Int expSpw(mscol.dataDescription().spectralWindowId().get(ddID)); build 12-Sep-2018 15:30:24 + Vector expFreq(mscol.spectralWindow().chanFreq().get(expSpw)), build 12-Sep-2018 15:30:24 + expVel; // converted from frequency build 12-Sep-2018 15:30:24 + Vector freqMeas(mscol.spectralWindow().chanFreqMeas()(expSpw)); build 12-Sep-2018 15:30:24 + uInt nchan = expFreq.size(); build 12-Sep-2018 15:30:24 + expVel.resize(nchan); build 12-Sep-2018 15:30:24 + expChan.resize(nchan); build 12-Sep-2018 15:30:24 + // get freq, chan, velocity build 12-Sep-2018 15:30:24 + Double restfreq = expFreq(nchan/2); // before freq conversion build 12-Sep-2018 15:30:24 + expFreq /= 1.0e9; // convert to GHz build 12-Sep-2018 15:30:24 + indgen(expChan); build 12-Sep-2018 15:30:24 + for (uInt chan=0; chan expRow; build 12-Sep-2018 15:30:24 + expRow.resize(expNRow); build 12-Sep-2018 15:30:24 + indgen(expRow); build 12-Sep-2018 15:30:24 + expAnt1.resize(expNRow, True); build 12-Sep-2018 15:30:24 + expAnt2.resize(expNRow, True); build 12-Sep-2018 15:30:24 + expObsId.resize(expNRow, True); build 12-Sep-2018 15:30:24 + expIntent.resize(expNRow, True); build 12-Sep-2018 15:30:24 + expFeed1.resize(expNRow, True); build 12-Sep-2018 15:30:24 + expFeed2.resize(expNRow, True); build 12-Sep-2018 15:30:24 + // get baseline numbers build 12-Sep-2018 15:30:24 + expBaseline.resize(expNRow); build 12-Sep-2018 15:30:24 + for (Int i=0; i metaAxes {PMS::TIME_INTERVAL, PMS::VELOCITY, build 12-Sep-2018 15:30:24 + PMS::ROW, PMS::FEED1, PMS::FEED2}; build 12-Sep-2018 15:30:24 + // Datacolumn for non-vis axes always DATA build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // check values for first chunk build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + for (auto axis : metaAxes) { build 12-Sep-2018 15:30:24 + std::vector loadAxes{axis, PMS::TIME}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + Int nrow = cache->chunkShapes()(IPosition(2,2,ichunk)); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, nrow); build 12-Sep-2018 15:30:24 + // Check scalars with ASSERT_EQ build 12-Sep-2018 15:30:24 + // Check arrays with allEQ in ArrayLogical.h build 12-Sep-2018 15:30:24 + switch(axis) { build 12-Sep-2018 15:30:24 + case PMS::TIME_INTERVAL: build 12-Sep-2018 15:30:24 + ASSERT_EQ(expInterval, cache->timeIntr(ichunk)); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::VELOCITY: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allNear(expVel, cache->vel(ichunk), .0000001)); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::ROW: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expRow, cache->row(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::FEED1: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expFeed1, cache->feed1(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::FEED2: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expFeed2, cache->feed2(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + default: build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + ASSERT_EQ(expScan, cache->scan(ichunk)); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expField, cache->field(ichunk)); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expTime, cache->time(ichunk)); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expSpw, cache->spw(ichunk)); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expChan, cache->chan(ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expFreq, cache->freq(ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expCorr, cache->corr(ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAnt1, cache->ant1(ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAnt2, cache->ant2(ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expBaseline, cache->bsln(ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expObsId, cache->obsid(ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expIntent, cache->intent(ichunk))); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/PlotMSCacheOverlays_GT.cc b/code/plotms/test/PlotMSCacheOverlays_GT.cc build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..962fde9 build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/plotms/test/PlotMSCacheOverlays_GT.cc build 12-Sep-2018 15:30:24 @@ -0,0 +1,119 @@ build 12-Sep-2018 15:30:24 +//# PlotMSCacheOverlays_GT.cc:: GoogleTest for plotms cache overlays build 12-Sep-2018 15:30:24 +//# Copyright (C) 2018 build 12-Sep-2018 15:30:24 +//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 +//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 +//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 +//# option) any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 +//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 +//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 +//# License for more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 +//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 +//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 +//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 +//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 +//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 +//# 520 Edgemont Road build 12-Sep-2018 15:30:24 +//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# $Id$ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +//#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +using namespace casa; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +class PlotMSCacheTest : public ::testing::Test { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +protected: build 12-Sep-2018 15:30:24 + virtual void SetUp() { build 12-Sep-2018 15:30:24 + // Using visstat2 regression dataset: build 12-Sep-2018 15:30:24 + // All datacolumns present: data, model, corrected build 12-Sep-2018 15:30:24 + dataPath = tUtil::getFullPath( "ngc5921_add_corect_model.ms", "visstat2" ); build 12-Sep-2018 15:30:24 + // specific to this dataset: build 12-Sep-2018 15:30:24 + expNChunk = 60; build 12-Sep-2018 15:30:24 + expNRow = 351; // rows in first chunk build 12-Sep-2018 15:30:24 + expNChan = 63; build 12-Sep-2018 15:30:24 + // Set up plotms cache object with no parent (PlotMSApp*) build 12-Sep-2018 15:30:24 + cache = new MSCache(nullptr); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void TearDown() { build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String dataPath; build 12-Sep-2018 15:30:24 + Int expNChunk, expNRow; build 12-Sep-2018 15:30:24 + uInt expNChan; // expected values build 12-Sep-2018 15:30:24 + MeasurementSet sortedMS; build 12-Sep-2018 15:30:24 + // use defaults (none!) build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 + MSCache* cache; build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +int main(int argc, char** argv) { build 12-Sep-2018 15:30:24 + ::testing::InitGoogleTest(&argc, argv); build 12-Sep-2018 15:30:24 + return RUN_ALL_TESTS(); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testOverlays) { build 12-Sep-2018 15:30:24 + // Test overlay axis options build 12-Sep-2018 15:30:24 + // ATM, TSKY build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + std::vector atmAxes {PMS::ATM, PMS::TSKY}; build 12-Sep-2018 15:30:24 + // Datacolumn for non-vis axes always DATA build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::DATA, PMS::DATA, PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // check values for first chunk build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + for (auto yaxis : atmAxes) { build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::FREQUENCY, yaxis, PMS::FREQUENCY}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + // Check arrays with ArrayLogical.h build 12-Sep-2018 15:30:24 + switch(yaxis) { build 12-Sep-2018 15:30:24 + case PMS::ATM: { // percent build 12-Sep-2018 15:30:24 + Vector atm(cache->atm(ichunk)); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChan, atm.size()); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allGT(atm, 99.0)); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allLT(atm, 100.0)); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::TSKY: { // Kelvin build 12-Sep-2018 15:30:24 + Vector tsky(cache->tsky(ichunk)); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChan, tsky.size()); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allGT(tsky, 0.0)); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allLT(tsky, 10.0)); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + default: build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/PlotMSCacheSelection_GT.cc b/code/plotms/test/PlotMSCacheSelection_GT.cc build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..4e26959 build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/plotms/test/PlotMSCacheSelection_GT.cc build 12-Sep-2018 15:30:24 @@ -0,0 +1,514 @@ build 12-Sep-2018 15:30:24 +//# PlotMSCacheSelection_GT.cc:: GoogleTest for plotms selection build 12-Sep-2018 15:30:24 +//# Copyright (C) 2018 build 12-Sep-2018 15:30:24 +//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 +//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 +//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 +//# option) any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 +//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 +//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 +//# License for more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 +//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 +//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 +//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 +//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 +//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 +//# 520 Edgemont Road build 12-Sep-2018 15:30:24 +//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# $Id$ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +using namespace casa; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +class PlotMSCacheTest : public ::testing::Test { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +protected: build 12-Sep-2018 15:30:24 + virtual void SetUp() { build 12-Sep-2018 15:30:24 + // Using visstat2 regression dataset: build 12-Sep-2018 15:30:24 + // All datacolumns present: data, model, corrected build 12-Sep-2018 15:30:24 + dataPath = tUtil::getFullPath( "ngc5921_add_corect_model.ms", "visstat2" ); build 12-Sep-2018 15:30:24 + MeasurementSet ms(dataPath); build 12-Sep-2018 15:30:24 + Block sortCols(4); // Use default sort columns build 12-Sep-2018 15:30:24 + sortCols[0] = MS::columnName(MS::ARRAY_ID); build 12-Sep-2018 15:30:24 + sortCols[1] = MS::columnName(MS::FIELD_ID); build 12-Sep-2018 15:30:24 + sortCols[2] = MS::columnName(MS::DATA_DESC_ID); build 12-Sep-2018 15:30:24 + sortCols[3] = MS::columnName(MS::TIME); build 12-Sep-2018 15:30:24 + sortedMS = ms.sort(sortCols); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Set up plotms cache object with no parent (PlotMSApp*) build 12-Sep-2018 15:30:24 + cache = new MSCache(nullptr); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void TearDown() { build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String dataPath; build 12-Sep-2018 15:30:24 + MeasurementSet sortedMS; build 12-Sep-2018 15:30:24 + // use defaults (none!) build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 + MSCache* cache; build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +int main(int argc, char** argv) { build 12-Sep-2018 15:30:24 + ::testing::InitGoogleTest(&argc, argv); build 12-Sep-2018 15:30:24 + return RUN_ALL_TESTS(); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testFieldSelection) { build 12-Sep-2018 15:30:24 + /* select field, check nchunk, amp and field */ build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + String fieldExpr("2"); build 12-Sep-2018 15:30:24 + Int expNRow(378), expNChunk(34), ichunk(0); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // get selected MS build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + Vector > chanSlices, corrSlices; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, chanSlices, corrSlices, ""/*outMSName*/, build 12-Sep-2018 15:30:24 + ""/*timeExpr*/, ""/*antennaExpr*/, fieldExpr, ""/*spwExpr*/, build 12-Sep-2018 15:30:24 + ""/*uvDistExpr*/, ""/*taQLExpr*/, ""/*polnExpr*/, ""/*scanExpr*/, build 12-Sep-2018 15:30:24 + ""/*arrayExpr*/, ""/*stateExpr*/, ""/*obsExpr*/, ""/*feedExpr*/); build 12-Sep-2018 15:30:24 + // main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array visData(msmc.data().getColumn()); build 12-Sep-2018 15:30:24 + Int expField(msmc.fieldId().get(0)); build 12-Sep-2018 15:30:24 + // resize for nrows build 12-Sep-2018 15:30:24 + IPosition visShape(visData.shape()); build 12-Sep-2018 15:30:24 + visShape.setLast(IPosition(1,expNRow)); build 12-Sep-2018 15:30:24 + visData.adjustLastAxis(visShape); build 12-Sep-2018 15:30:24 + Array expAmp(amplitude(visData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set PlotMSSelection and load cache build 12-Sep-2018 15:30:24 + itsSelection.setField(fieldExpr); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + // check amp for selected field in chunk 0 build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAmp, cache->ampData(ichunk))); build 12-Sep-2018 15:30:24 + // check selected field in every chunk build 12-Sep-2018 15:30:24 + for (Int chunk=0; chunkfield(chunk)); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testSpwSelection) { build 12-Sep-2018 15:30:24 + // select spw:chan and check chunks, shapes, amp, and spw/chan numbers build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // MS only has one spw, select channels build 12-Sep-2018 15:30:24 + String spwExpr("0:16~31"); build 12-Sep-2018 15:30:24 + Int expNChunk(60), expNChan(16), expNRow(351), expSpw(0), ichunk(0); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // get selected MS build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + Vector > chanSlices, corrSlices; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, chanSlices, corrSlices, ""/*outMSName*/, build 12-Sep-2018 15:30:24 + ""/*timeExpr*/, ""/*antennaExpr*/, ""/*fieldExpr*/, spwExpr, build 12-Sep-2018 15:30:24 + ""/*uvDistExpr*/, ""/*taQLExpr*/, ""/*polnExpr*/, ""/*scanExpr*/, build 12-Sep-2018 15:30:24 + ""/*arrayExpr*/, ""/*stateExpr*/, ""/*obsExpr*/, ""/*feedExpr*/); build 12-Sep-2018 15:30:24 + // main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array visData(msmc.data().getColumn()); build 12-Sep-2018 15:30:24 + // resize for nchans, nrows in first chunk build 12-Sep-2018 15:30:24 + Slicer visSlicer(Slice(), chanSlices(0)(0), Slice(0,expNRow)); build 12-Sep-2018 15:30:24 + Array selVis(visData(visSlicer)); build 12-Sep-2018 15:30:24 + Array expAmp(amplitude(selVis)); build 12-Sep-2018 15:30:24 + // make chan vector build 12-Sep-2018 15:30:24 + Vector expChans(expNChan); build 12-Sep-2018 15:30:24 + indgen(expChans); build 12-Sep-2018 15:30:24 + expChans += 16; // start at channel 16 build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set PlotMSSelection and load cache build 12-Sep-2018 15:30:24 + itsSelection.setSpw(spwExpr); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChan, cache->chunkShapes()(IPosition(2,1,ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + // check amp for selected channels in chunk 0 build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAmp, cache->ampData(ichunk))); build 12-Sep-2018 15:30:24 + // check selected spw, chans in every chunk build 12-Sep-2018 15:30:24 + for (Int chunk=0; chunkspw(chunk)); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expChans, cache->chan(chunk))); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testTimeSelection) { build 12-Sep-2018 15:30:24 + /* select time, check nchunk, amp, and first time */ build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + String timeExpr("10:22:00~10:47:00"); build 12-Sep-2018 15:30:24 + Int expNRow(378), expNChunk(23), ichunk(0); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // get selected MS build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + Vector > chanSlices, corrSlices; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, chanSlices, corrSlices, ""/*outMSName*/, build 12-Sep-2018 15:30:24 + timeExpr, ""/*antennaExpr*/, ""/*fieldExpr*/, ""/*spwExpr*/, build 12-Sep-2018 15:30:24 + ""/*uvDistExpr*/, ""/*taQLExpr*/, ""/*polnExpr*/, ""/*scanExpr*/, build 12-Sep-2018 15:30:24 + ""/*arrayExpr*/, ""/*stateExpr*/, ""/*obsExpr*/, ""/*feedExpr*/); build 12-Sep-2018 15:30:24 + // main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array visData(msmc.data().getColumn()); build 12-Sep-2018 15:30:24 + Double expTime(msmc.time().get(0)); build 12-Sep-2018 15:30:24 + // resize for nrows build 12-Sep-2018 15:30:24 + IPosition visShape(visData.shape()); build 12-Sep-2018 15:30:24 + visShape.setLast(IPosition(1,expNRow)); build 12-Sep-2018 15:30:24 + visData.adjustLastAxis(visShape); build 12-Sep-2018 15:30:24 + Array expAmp(amplitude(visData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set PlotMSSelection and load cache build 12-Sep-2018 15:30:24 + itsSelection.setTimerange(timeExpr); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + // check amp for selected field in chunk 0 build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAmp, cache->ampData(ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expTime, cache->time(ichunk)); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testUVSelection) { build 12-Sep-2018 15:30:24 + /* select uvdist, check nchunk, values > min */ build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + String uvDistExpr(">1km"); build 12-Sep-2018 15:30:24 + // number of chunks reduced from 60 build 12-Sep-2018 15:30:24 + Int expNChunk(16); build 12-Sep-2018 15:30:24 + Double minUVDist(1000.0); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set PlotMSSelection and load cache build 12-Sep-2018 15:30:24 + itsSelection.setUvrange(uvDistExpr); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::UVDIST, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + // check all uVDist > minUVDist build 12-Sep-2018 15:30:24 + for (Int chunk=0; chunkuVDist(chunk), minUVDist)); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testAntennaSelection) { build 12-Sep-2018 15:30:24 + /* select antenna baseline, check ant1 and ant2 */ build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + String antennaExpr("1&2"); build 12-Sep-2018 15:30:24 + Int expNRow(1), // one baseline per chunk build 12-Sep-2018 15:30:24 + expNChunk(60), ichunk(0); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // get selected MS build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + Vector > chanSlices, corrSlices; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, chanSlices, corrSlices, ""/*outMSName*/, build 12-Sep-2018 15:30:24 + ""/*timeExpr*/, antennaExpr, ""/*fieldExpr*/, ""/*spwExpr*/, build 12-Sep-2018 15:30:24 + ""/*uvDistExpr*/, ""/*taQLExpr*/, ""/*polnExpr*/, ""/*scanExpr*/, build 12-Sep-2018 15:30:24 + ""/*arrayExpr*/, ""/*stateExpr*/, ""/*obsExpr*/, ""/*feedExpr*/); build 12-Sep-2018 15:30:24 + // main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Vector expAnt1(msmc.antenna1().getColumn()), build 12-Sep-2018 15:30:24 + expAnt2(msmc.antenna2().getColumn()); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set PlotMSSelection and load cache build 12-Sep-2018 15:30:24 + itsSelection.setAntenna(antennaExpr); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::ANTENNA1, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + // check selected antenna in every chunk build 12-Sep-2018 15:30:24 + for (Int chunk=0; chunkant1(chunk), expAnt1(chunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(cache->ant2(chunk), expAnt2(chunk))); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testScanSelection) { build 12-Sep-2018 15:30:24 + /* select scan, check amp, scan numbers */ build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + String scanExpr("2"); build 12-Sep-2018 15:30:24 + Int expNRow(378), expNChunk(5), ichunk(0); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // get selected MS build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + Vector > chanSlices, corrSlices; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, chanSlices, corrSlices, ""/*outMSName*/, build 12-Sep-2018 15:30:24 + ""/*timeExpr*/, ""/*antennaExpr*/, ""/*fieldExpr*/, ""/*spwExpr*/, build 12-Sep-2018 15:30:24 + ""/*uvDistExpr*/, ""/*taQLExpr*/, ""/*polnExpr*/, scanExpr, build 12-Sep-2018 15:30:24 + ""/*arrayExpr*/, ""/*stateExpr*/, ""/*obsExpr*/, ""/*feedExpr*/); build 12-Sep-2018 15:30:24 + // main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Int expScan(msmc.scanNumber().get(0)); build 12-Sep-2018 15:30:24 + Array visData(msmc.data().getColumn()); build 12-Sep-2018 15:30:24 + // resize for nrows build 12-Sep-2018 15:30:24 + IPosition visShape(visData.shape()); build 12-Sep-2018 15:30:24 + visShape.setLast(IPosition(1,expNRow)); build 12-Sep-2018 15:30:24 + visData.adjustLastAxis(visShape); build 12-Sep-2018 15:30:24 + Array expAmp(amplitude(visData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set PlotMSSelection and load cache build 12-Sep-2018 15:30:24 + itsSelection.setScan(scanExpr); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + // check selected scan in chunks build 12-Sep-2018 15:30:24 + for (Int chunk=0; chunkscan(chunk), expScan); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testCorrSelection) { build 12-Sep-2018 15:30:24 + // select correlation and check shape of chunks, amp, corr build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String polnExpr("LL"); build 12-Sep-2018 15:30:24 + Int expNChunk(60), expNCorr(1), expCorr(8), expNRow(351), ichunk(0); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // get selected MS build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + Vector > chanSlices, corrSlices; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, chanSlices, corrSlices, ""/*outMSName*/, build 12-Sep-2018 15:30:24 + ""/*timeExpr*/, ""/*antennaExpr*/, ""/*fieldExpr*/, ""/*spwExpr*/, build 12-Sep-2018 15:30:24 + ""/*uvDistExpr*/, ""/*taQLExpr*/, polnExpr, ""/*scanExpr*/, build 12-Sep-2018 15:30:24 + ""/*arrayExpr*/, ""/*stateExpr*/, ""/*obsExpr*/, ""/*feedExpr*/); build 12-Sep-2018 15:30:24 + // main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array visData(msmc.data().getColumn()); build 12-Sep-2018 15:30:24 + // slice for corrSlices, nrows in first chunk build 12-Sep-2018 15:30:24 + Slicer visSlicer(corrSlices(0)(0), Slice(), Slice(0,expNRow)); build 12-Sep-2018 15:30:24 + Array selVis(visData(visSlicer)); build 12-Sep-2018 15:30:24 + Array expAmp(amplitude(selVis)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set PlotMSSelection and load cache build 12-Sep-2018 15:30:24 + itsSelection.setCorr(polnExpr); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNCorr, cache->chunkShapes()(IPosition(2,0,ichunk))); build 12-Sep-2018 15:30:24 + // check amp in chunk 0 build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAmp, cache->ampData(ichunk))); build 12-Sep-2018 15:30:24 + // check selected corr in every chunk build 12-Sep-2018 15:30:24 + for (Int chunk=0; chunkcorr(chunk))); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testArraySelection) { build 12-Sep-2018 15:30:24 + /* select arrayID, check nchunk, nrow, amp build 12-Sep-2018 15:30:24 + * (no cache getter for array id) */ build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + String arrayExpr("0"); // only one array ID in MS, not really a selection build 12-Sep-2018 15:30:24 + Int expNRow(351), expNChunk(60), ichunk(0); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // get selected MS build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + Vector > chanSlices, corrSlices; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, chanSlices, corrSlices, ""/*outMSName*/, build 12-Sep-2018 15:30:24 + ""/*timeExpr*/, ""/*antennaExpr*/, ""/*fieldExpr*/, ""/*spwExpr*/, build 12-Sep-2018 15:30:24 + ""/*uvDistExpr*/, ""/*taQLExpr*/, ""/*polnExpr*/, ""/*scanExpr*/, build 12-Sep-2018 15:30:24 + arrayExpr, ""/*stateExpr*/, ""/*obsExpr*/, ""/*feedExpr*/); build 12-Sep-2018 15:30:24 + // main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array visData(msmc.data().getColumn()); build 12-Sep-2018 15:30:24 + // resize for nrows build 12-Sep-2018 15:30:24 + IPosition visShape(visData.shape()); build 12-Sep-2018 15:30:24 + visShape.setLast(IPosition(1,expNRow)); build 12-Sep-2018 15:30:24 + visData.adjustLastAxis(visShape); build 12-Sep-2018 15:30:24 + Array expAmp(amplitude(visData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set PlotMSSelection and load cache build 12-Sep-2018 15:30:24 + itsSelection.setArray(arrayExpr); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAmp, cache->ampData(ichunk))); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testObservationSelection) { build 12-Sep-2018 15:30:24 + /* select observationID, check nchunk, nrow, amp, obsid */ build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String obsExpr("0"); // only one obs ID in MS, not really a selection build 12-Sep-2018 15:30:24 + Int expNRow(351), expNChunk(60), ichunk(0); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // get selected MS build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + Vector > chanSlices, corrSlices; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, chanSlices, corrSlices, ""/*outMSName*/, build 12-Sep-2018 15:30:24 + ""/*timeExpr*/, ""/*antennaExpr*/, ""/*fieldExpr*/, ""/*spwExpr*/, build 12-Sep-2018 15:30:24 + ""/*uvDistExpr*/, ""/*taQLExpr*/, ""/*polnExpr*/, ""/*scanExpr*/, build 12-Sep-2018 15:30:24 + ""/*arrayExpr*/, ""/*stateExpr*/, obsExpr, ""/*feedExpr*/); build 12-Sep-2018 15:30:24 + // main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array visData(msmc.data().getColumn()); build 12-Sep-2018 15:30:24 + Int expObs(msmc.observationId().get(0)); build 12-Sep-2018 15:30:24 + // resize for nrows build 12-Sep-2018 15:30:24 + IPosition visShape(visData.shape()); build 12-Sep-2018 15:30:24 + visShape.setLast(IPosition(1,expNRow)); build 12-Sep-2018 15:30:24 + visData.adjustLastAxis(visShape); build 12-Sep-2018 15:30:24 + Array expAmp(amplitude(visData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set PlotMSSelection and load cache build 12-Sep-2018 15:30:24 + itsSelection.setObservation(obsExpr); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAmp, cache->ampData(ichunk))); build 12-Sep-2018 15:30:24 + // check selected obs id in every chunk build 12-Sep-2018 15:30:24 + for (Int chunk=0; chunkobsid(chunk))); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testIntentSelection) { build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + // no STATE table, STATE_ID col is -1 build 12-Sep-2018 15:30:24 + // so this will throw an exception build 12-Sep-2018 15:30:24 + itsSelection.setIntent("CALIBRATE*"); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + ASSERT_THROW(cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ), AipsError); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testFeedSelection) { build 12-Sep-2018 15:30:24 + /* select feedID, check nchunk, nrow, amp, feed id */ build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // only one feed ID in MS, not really a selection build 12-Sep-2018 15:30:24 + // Use "auto-correlation" syntax to select feed1==feed2==0 build 12-Sep-2018 15:30:24 + String feedExpr("0&&&"); build 12-Sep-2018 15:30:24 + Int expNRow(351), expNChunk(60), ichunk(0); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // get selected MS build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + Vector > chanSlices, corrSlices; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, chanSlices, corrSlices, ""/*outMSName*/, build 12-Sep-2018 15:30:24 + ""/*timeExpr*/, ""/*antennaExpr*/, ""/*fieldExpr*/, ""/*spwExpr*/, build 12-Sep-2018 15:30:24 + ""/*uvDistExpr*/, ""/*taQLExpr*/, ""/*polnExpr*/, ""/*scanExpr*/, build 12-Sep-2018 15:30:24 + ""/*arrayExpr*/, ""/*stateExpr*/, ""/*obsExpr*/, feedExpr); build 12-Sep-2018 15:30:24 + // main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Int expFeed(msmc.feed1().get(0)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set PlotMSSelection and load cache build 12-Sep-2018 15:30:24 + itsSelection.setFeed(feedExpr); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::FEED1, PMS::FEED2}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNRow, cache->chunkShapes()(IPosition(2,2,ichunk))); build 12-Sep-2018 15:30:24 + // check selected feed id in every chunk build 12-Sep-2018 15:30:24 + for (Int chunk=0; chunkfeed1(chunk))); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expFeed, cache->feed2(chunk))); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testTaQLSelection) { build 12-Sep-2018 15:30:24 + /* select field using taQL, check nchunk, amp and field */ build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + String taQLExpr("FIELD_ID >= 1"); build 12-Sep-2018 15:30:24 + Int expNRow(378), expNChunk(48), ichunk(0); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // get selected MS build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + Vector > chanSlices, corrSlices; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, chanSlices, corrSlices, ""/*outMSName*/, build 12-Sep-2018 15:30:24 + ""/*timeExpr*/, ""/*antennaExpr*/, ""/*fieldExpr*/, ""/*spwExpr*/, build 12-Sep-2018 15:30:24 + ""/*uvDistExpr*/, taQLExpr, ""/*polnExpr*/, ""/*scanExpr*/, build 12-Sep-2018 15:30:24 + ""/*arrayExpr*/, ""/*stateExpr*/, ""/*obsExpr*/, ""/*feedExpr*/); build 12-Sep-2018 15:30:24 + // main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array visData(msmc.data().getColumn()); build 12-Sep-2018 15:30:24 + Int expField(msmc.fieldId().get(0)); build 12-Sep-2018 15:30:24 + // resize for nrows build 12-Sep-2018 15:30:24 + IPosition visShape(visData.shape()); build 12-Sep-2018 15:30:24 + visShape.setLast(IPosition(1,expNRow)); build 12-Sep-2018 15:30:24 + visData.adjustLastAxis(visShape); build 12-Sep-2018 15:30:24 + Array expAmp(amplitude(visData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set PlotMSSelection and load cache build 12-Sep-2018 15:30:24 + itsSelection.setMsselect(taQLExpr); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + // check amp for selected field in chunk 0 build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expAmp, cache->ampData(ichunk))); build 12-Sep-2018 15:30:24 + ASSERT_EQ(expField, cache->field(ichunk)); build 12-Sep-2018 15:30:24 + // check selected field in every chunk build 12-Sep-2018 15:30:24 + for (Int chunk=0; chunkfield(chunk), expField); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/PlotMSCacheTransform_GT.cc b/code/plotms/test/PlotMSCacheTransform_GT.cc build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..eecc310 build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/plotms/test/PlotMSCacheTransform_GT.cc build 12-Sep-2018 15:30:24 @@ -0,0 +1,284 @@ build 12-Sep-2018 15:30:24 +//# PlotMSCacheTransform_GT.cc:: GoogleTest for plotms transformations build 12-Sep-2018 15:30:24 +//# Copyright (C) 2018 build 12-Sep-2018 15:30:24 +//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 +//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 +//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 +//# option) any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 +//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 +//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 +//# License for more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 +//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 +//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 +//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 +//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 +//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 +//# 520 Edgemont Road build 12-Sep-2018 15:30:24 +//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# $Id$ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +using namespace casa; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +class PlotMSCacheTest : public ::testing::Test { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +protected: build 12-Sep-2018 15:30:24 + virtual void SetUp() { build 12-Sep-2018 15:30:24 + // Using visstat2 regression dataset: build 12-Sep-2018 15:30:24 + // All datacolumns present: data, model, corrected build 12-Sep-2018 15:30:24 + dataPath = tUtil::getFullPath( "ngc5921_add_corect_model.ms", "visstat2" ); build 12-Sep-2018 15:30:24 + MeasurementSet ms(dataPath); build 12-Sep-2018 15:30:24 + Block sortCols(4); // Use default sort columns build 12-Sep-2018 15:30:24 + sortCols[0] = MS::columnName(MS::ARRAY_ID); build 12-Sep-2018 15:30:24 + sortCols[1] = MS::columnName(MS::FIELD_ID); build 12-Sep-2018 15:30:24 + sortCols[2] = MS::columnName(MS::DATA_DESC_ID); build 12-Sep-2018 15:30:24 + sortCols[3] = MS::columnName(MS::TIME); build 12-Sep-2018 15:30:24 + sortedMS = ms.sort(sortCols); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String dataPath; build 12-Sep-2018 15:30:24 + MeasurementSet sortedMS; build 12-Sep-2018 15:30:24 + // use defaults (none!) build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +int main(int argc, char** argv) { build 12-Sep-2018 15:30:24 + ::testing::InitGoogleTest(&argc, argv); build 12-Sep-2018 15:30:24 + return RUN_ALL_TESTS(); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testFreqFrame) { build 12-Sep-2018 15:30:24 + // Test frequency conversion transformations build 12-Sep-2018 15:30:24 + // Load values from MeasurementSet main table build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(sortedMS); build 12-Sep-2018 15:30:24 + Int ddID(msmc.dataDescId().get(0)); // for spw / freq build 12-Sep-2018 15:30:24 + Int fieldID(msmc.fieldId().get(0)); // for phasedir build 12-Sep-2018 15:30:24 + Int obsID(msmc.observationId().get(0)); // for phasedir build 12-Sep-2018 15:30:24 + MEpoch epoch(msmc.timeMeas()(0)); build 12-Sep-2018 15:30:24 + // values from subtables for freq conversion build 12-Sep-2018 15:30:24 + ROMSColumns mscol(sortedMS); build 12-Sep-2018 15:30:24 + Int spw(mscol.dataDescription().spectralWindowId().get(ddID)); build 12-Sep-2018 15:30:24 + Vector inputFreq(mscol.spectralWindow().chanFreq()(spw)); build 12-Sep-2018 15:30:24 + Int refFrame(mscol.spectralWindow().measFreqRef()(spw)); build 12-Sep-2018 15:30:24 + Vector phaseDirCol(mscol.field().phaseDirMeasCol()(fieldID)); build 12-Sep-2018 15:30:24 + MDirection phaseDir(phaseDirCol(0)); build 12-Sep-2018 15:30:24 + // get observatory position build 12-Sep-2018 15:30:24 + String telName(mscol.observation().telescopeName().get(obsID)); build 12-Sep-2018 15:30:24 + MPosition obsPosition; build 12-Sep-2018 15:30:24 + if (!MeasTable::Observatory(obsPosition, telName)) build 12-Sep-2018 15:30:24 + obsPosition = mscol.antenna().positionMeas()(0); build 12-Sep-2018 15:30:24 + // make freq converter build 12-Sep-2018 15:30:24 + MeasFrame measFrame(epoch, obsPosition, phaseDir); build 12-Sep-2018 15:30:24 + MFrequency::Ref observedFrame(refFrame, measFrame); build 12-Sep-2018 15:30:24 + Unit unit(String("Hz")); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Datacolumn for non-vis axes always DATA build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::FREQUENCY, PMS::CHANNEL}; build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + std::vector frames{"LSRK", build 12-Sep-2018 15:30:24 + "LSRD", "BARY", "GEO", "TOPO", "GALACTO", "LGROUP", "CMB"}; build 12-Sep-2018 15:30:24 + Int ichunk(0); // check values for first chunk build 12-Sep-2018 15:30:24 + uInt nchan(inputFreq.size()); build 12-Sep-2018 15:30:24 + MFrequency::Convert freqNewFrame; build 12-Sep-2018 15:30:24 + Vector expFreq(nchan); build 12-Sep-2018 15:30:24 + for (auto frame : frames) { build 12-Sep-2018 15:30:24 + // transform MS freqs with converter (expected frequencies) build 12-Sep-2018 15:30:24 + MFrequency::Types newFrameType(MFrequency::typeFromString(frame)); build 12-Sep-2018 15:30:24 + freqNewFrame = MFrequency::Convert(unit, observedFrame, newFrameType); build 12-Sep-2018 15:30:24 + for (uInt chan=0; chanload(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // check expected vs cache freqs build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expFreq, cache->freq(ichunk))); build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testRestFreq) { build 12-Sep-2018 15:30:24 + // Test velocity rest frequency options build 12-Sep-2018 15:30:24 + // Load values from MeasurementSet main table build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(sortedMS); build 12-Sep-2018 15:30:24 + Int ddID(msmc.dataDescId().get(0)); // for spw / freq build 12-Sep-2018 15:30:24 + // values from subtables for freq conversion build 12-Sep-2018 15:30:24 + ROMSColumns mscol(sortedMS); build 12-Sep-2018 15:30:24 + Int spw(mscol.dataDescription().spectralWindowId().get(ddID)); build 12-Sep-2018 15:30:24 + Vector inputFreq(mscol.spectralWindow().chanFreq()(spw)); build 12-Sep-2018 15:30:24 + Vector inputFreqMeas(mscol.spectralWindow().chanFreqMeas()(spw)); build 12-Sep-2018 15:30:24 + // get velocity with various rest freqs (test only, not a science case) build 12-Sep-2018 15:30:24 + uInt nchan(inputFreq.size()); build 12-Sep-2018 15:30:24 + Double midrestfreq(inputFreq(nchan/2)), build 12-Sep-2018 15:30:24 + lowrestfreq(min(inputFreq)), highrestfreq(max(inputFreq)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Datacolumn for non-vis axes always DATA build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::VELOCITY, PMS::CHANNEL}; build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + std::vector testfreqs{lowrestfreq, midrestfreq, highrestfreq}; build 12-Sep-2018 15:30:24 + Int ichunk(0); // check values for first chunk build 12-Sep-2018 15:30:24 + Vector expVel(nchan); // converted from frequency build 12-Sep-2018 15:30:24 + for (auto restfreq : testfreqs) { build 12-Sep-2018 15:30:24 + // get expected velocities build 12-Sep-2018 15:30:24 + for (uInt chan=0; chanload(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // check expected vs cache freqs build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allNear(expVel, cache->vel(ichunk), .0000001)); build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testVelDef) { build 12-Sep-2018 15:30:24 + // Test velocity definition options build 12-Sep-2018 15:30:24 + // Load values from MeasurementSet main table build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(sortedMS); build 12-Sep-2018 15:30:24 + Int ddID(msmc.dataDescId().get(0)); // for spw / freq build 12-Sep-2018 15:30:24 + // values from subtables for freq conversion build 12-Sep-2018 15:30:24 + ROMSColumns mscol(sortedMS); build 12-Sep-2018 15:30:24 + Int spw(mscol.dataDescription().spectralWindowId().get(ddID)); build 12-Sep-2018 15:30:24 + Vector inputFreq(mscol.spectralWindow().chanFreq()(spw)); build 12-Sep-2018 15:30:24 + Vector inputFreqMeas(mscol.spectralWindow().chanFreqMeas()(spw)); build 12-Sep-2018 15:30:24 + // get velocity with various rest freqs (test only, not a science case) build 12-Sep-2018 15:30:24 + uInt nchan(inputFreq.size()); build 12-Sep-2018 15:30:24 + Double restfreq(inputFreq(nchan/2)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Datacolumn for non-vis axes always DATA build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::VELOCITY, PMS::CHANNEL}; build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + std::vector veldefs{"RADIO", "OPTICAL", "TRUE"}; build 12-Sep-2018 15:30:24 + Int ichunk(0); // check values for first chunk build 12-Sep-2018 15:30:24 + Vector expVel(nchan); // converted from frequency build 12-Sep-2018 15:30:24 + MDoppler::Types dopptype; // converted from string build 12-Sep-2018 15:30:24 + for (auto veldef : veldefs) { build 12-Sep-2018 15:30:24 + // get expected velocities build 12-Sep-2018 15:30:24 + MDoppler::getType(dopptype, veldef); build 12-Sep-2018 15:30:24 + for (uInt chan=0; chanload(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // check expected vs cache freqs build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allNear(expVel, cache->vel(ichunk), .0000001)); build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testPhaseShift) { build 12-Sep-2018 15:30:24 + // Test phase shift transformations build 12-Sep-2018 15:30:24 + String scanExpr("1"); // add selection to reduce test time build 12-Sep-2018 15:30:24 + itsSelection.setScan(scanExpr); build 12-Sep-2018 15:30:24 + // Get selected MS: build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, "", "", "", build 12-Sep-2018 15:30:24 + "", "", "", "", "", scanExpr, "", "", "", ""); build 12-Sep-2018 15:30:24 + // Load values from MeasurementSet main table build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Matrix uvw(msmc.uvw().getColumn()); build 12-Sep-2018 15:30:24 + Cube visData(msmc.data().getColumn()); build 12-Sep-2018 15:30:24 + Int ddID(msmc.dataDescId().get(0)); // for spw / freq build 12-Sep-2018 15:30:24 + // values from subtables for freq conversion build 12-Sep-2018 15:30:24 + ROMSColumns mscol(sortedMS); build 12-Sep-2018 15:30:24 + Int spw(mscol.dataDescription().spectralWindowId().get(ddID)); build 12-Sep-2018 15:30:24 + Vector inputFreq(mscol.spectralWindow().chanFreq()(spw)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // resize expected nrow in first chunk build 12-Sep-2018 15:30:24 + uInt expNRow(351); build 12-Sep-2018 15:30:24 + uvw.resize(IPosition(2,3,expNRow), True); build 12-Sep-2018 15:30:24 + Vector vecU(uvw.row(0)), vecV(uvw.row(1)); build 12-Sep-2018 15:30:24 + IPosition visShape(visData.shape()); build 12-Sep-2018 15:30:24 + visShape.setLast(IPosition(1,expNRow)); build 12-Sep-2018 15:30:24 + visData.adjustLastAxis(visShape); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + Double dx(0.5), dy(0.5); // phase shift values build 12-Sep-2018 15:30:24 + Double toRadians = C::pi / 180.0 / 3600.0; build 12-Sep-2018 15:30:24 + Double dxrad(dx*toRadians), dyrad(dy*toRadians); // radians build 12-Sep-2018 15:30:24 + vecU *= dxrad; build 12-Sep-2018 15:30:24 + vecV *= dyrad; build 12-Sep-2018 15:30:24 + Vector phases(vecU + vecV); build 12-Sep-2018 15:30:24 + phases *= (-2.0 * C::pi / C::c); // radians/Hz build 12-Sep-2018 15:30:24 + uInt ncorr(visData.shape()(0)); build 12-Sep-2018 15:30:24 + Double phaRad; build 12-Sep-2018 15:30:24 + Complex factor; build 12-Sep-2018 15:30:24 + for (uInt row=0; row expPhase(phase(visData) * 180.0 / C::pi); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Datacolumn for non-vis axes always DATA build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::PHASE, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + Int ichunk(0); // check values for first chunk build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // get cache value build 12-Sep-2018 15:30:24 + itsTransformations.setXpcOffset(dx); build 12-Sep-2018 15:30:24 + itsTransformations.setYpcOffset(dy); build 12-Sep-2018 15:30:24 + MSCache* cache = new MSCache(nullptr); build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // check expected vs cache phase build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expPhase, cache->phaData(ichunk))); build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/PlotMSCacheVis_GT.cc b/code/plotms/test/PlotMSCacheVis_GT.cc build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..d8e07d3 build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/plotms/test/PlotMSCacheVis_GT.cc build 12-Sep-2018 15:30:24 @@ -0,0 +1,394 @@ build 12-Sep-2018 15:30:24 +//# PlotMSCacheVis_GT.cc:: GoogleTest for plotms cache visibility axes build 12-Sep-2018 15:30:24 +//# Copyright (C) 2018 build 12-Sep-2018 15:30:24 +//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 +//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 +//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 +//# option) any later version. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 +//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 +//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 +//# License for more details. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 +//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 +//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 +//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 +//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 +//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 +//# 520 Edgemont Road build 12-Sep-2018 15:30:24 +//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# build 12-Sep-2018 15:30:24 +//# $Id$ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +using namespace casa; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +class PlotMSCacheTest : public ::testing::Test { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +protected: build 12-Sep-2018 15:30:24 + virtual void SetUp() { build 12-Sep-2018 15:30:24 + // Using visstat2 regression dataset: build 12-Sep-2018 15:30:24 + // All datacolumns present: data, model, corrected build 12-Sep-2018 15:30:24 + dataPath = tUtil::getFullPath( "ngc5921_add_corect_model.ms", "visstat2" ); build 12-Sep-2018 15:30:24 + MeasurementSet ms(dataPath); build 12-Sep-2018 15:30:24 + Block sortCols(4); // Use default sort columns build 12-Sep-2018 15:30:24 + sortCols[0] = MS::columnName(MS::ARRAY_ID); build 12-Sep-2018 15:30:24 + sortCols[1] = MS::columnName(MS::FIELD_ID); build 12-Sep-2018 15:30:24 + sortCols[2] = MS::columnName(MS::DATA_DESC_ID); build 12-Sep-2018 15:30:24 + sortCols[3] = MS::columnName(MS::TIME); build 12-Sep-2018 15:30:24 + sortedMS = ms.sort(sortCols); build 12-Sep-2018 15:30:24 + // specific to this dataset: build 12-Sep-2018 15:30:24 + expNChunk = 12; build 12-Sep-2018 15:30:24 + expNRow = 351; // rows in first chunk build 12-Sep-2018 15:30:24 + expNChan = 63; build 12-Sep-2018 15:30:24 + // Set up plotms cache object with no parent (PlotMSApp*) build 12-Sep-2018 15:30:24 + cache = new MSCache(nullptr); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void TearDown() { build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String dataPath; build 12-Sep-2018 15:30:24 + Int expNChunk, expNRow, expNChan; // expected values build 12-Sep-2018 15:30:24 + MeasurementSet sortedMS; build 12-Sep-2018 15:30:24 + // use defaults (none!) build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 + MSCache* cache; build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +int main(int argc, char** argv) { build 12-Sep-2018 15:30:24 + ::testing::InitGoogleTest(&argc, argv); build 12-Sep-2018 15:30:24 + return RUN_ALL_TESTS(); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +TEST_F( PlotMSCacheTest, testVisibilities) { build 12-Sep-2018 15:30:24 + // Test visibility and flag axis options: build 12-Sep-2018 15:30:24 + // AMP,PHASE,REAL,IMAG,WT,WTxAMP,WTSP, build 12-Sep-2018 15:30:24 + // SIGMA,SIGMASP,FLAG,FLAG_ROW build 12-Sep-2018 15:30:24 + // and datacolumn options: build 12-Sep-2018 15:30:24 + // DATA, CORRECTED, MODEL, CORRMODEL, DATAMODEL, build 12-Sep-2018 15:30:24 + // DATA_DIVIDE_MODEL, CORRECTED_DIVIDE_MODEL build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_NE(nullptr, cache); // make sure we have a cache build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String scanExpr("1"); // add selection to reduce test time build 12-Sep-2018 15:30:24 + itsSelection.setScan(scanExpr); build 12-Sep-2018 15:30:24 + // Get selected MS: build 12-Sep-2018 15:30:24 + MeasurementSet selMS; build 12-Sep-2018 15:30:24 + mssSetData2(sortedMS, selMS, ""/*outms*/, ""/*time*/, ""/*ant*/, build 12-Sep-2018 15:30:24 + ""/*field*/, ""/*spw*/, ""/*uvdist*/, ""/*taql*/, ""/*poln*/, build 12-Sep-2018 15:30:24 + scanExpr, ""/*array*/, ""/*state*/, ""/*obs*/, ""/*feed*/); build 12-Sep-2018 15:30:24 + // main table columns build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(selMS); build 12-Sep-2018 15:30:24 + Array visData(msmc.data().getColumn()), build 12-Sep-2018 15:30:24 + modelData(msmc.modelData().getColumn()), build 12-Sep-2018 15:30:24 + corrData(msmc.correctedData().getColumn()); build 12-Sep-2018 15:30:24 + Array expFlag(msmc.flag().getColumn()); build 12-Sep-2018 15:30:24 + Vector expFlagrow(msmc.flagRow().getColumn()); build 12-Sep-2018 15:30:24 + Array expWt(msmc.weight().getColumn()), build 12-Sep-2018 15:30:24 + expWtSp(msmc.weightSpectrum().getColumn()), build 12-Sep-2018 15:30:24 + expSigma(msmc.sigma().getColumn()), build 12-Sep-2018 15:30:24 + expSigmaSp; build 12-Sep-2018 15:30:24 + // adjust cube shapes for first chunk build 12-Sep-2018 15:30:24 + IPosition flagShape(expFlag.shape()); build 12-Sep-2018 15:30:24 + flagShape.setLast(IPosition(1,expNRow)); build 12-Sep-2018 15:30:24 + visData.adjustLastAxis(flagShape); build 12-Sep-2018 15:30:24 + modelData.adjustLastAxis(flagShape); build 12-Sep-2018 15:30:24 + corrData.adjustLastAxis(flagShape); build 12-Sep-2018 15:30:24 + expFlag.adjustLastAxis(flagShape); build 12-Sep-2018 15:30:24 + expWtSp.adjustLastAxis(flagShape); build 12-Sep-2018 15:30:24 + // adjust wt arrays build 12-Sep-2018 15:30:24 + IPosition wtShape(expWt.shape()); build 12-Sep-2018 15:30:24 + wtShape.setLast(IPosition(1,expNRow)); build 12-Sep-2018 15:30:24 + expWt.adjustLastAxis(wtShape); build 12-Sep-2018 15:30:24 + expSigma.adjustLastAxis(wtShape); build 12-Sep-2018 15:30:24 + // adjust vector build 12-Sep-2018 15:30:24 + expFlagrow.resize(expNRow, True); build 12-Sep-2018 15:30:24 + // make sigmasp (no column) by adding chan axis to sigma build 12-Sep-2018 15:30:24 + tUtil::makeSigmaSpFromSigma(expSigmaSp, expSigma, expNChan); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // make residual data cubes build 12-Sep-2018 15:30:24 + Array corrmodelData(corrData - modelData); build 12-Sep-2018 15:30:24 + Array corrDivmodelData(corrData / modelData); build 12-Sep-2018 15:30:24 + Array vismodelData(visData - modelData); build 12-Sep-2018 15:30:24 + Array visDivmodelData(visData / modelData); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Visibility axis options: build 12-Sep-2018 15:30:24 + std::vector visAxes {PMS::AMP, PMS::PHASE, build 12-Sep-2018 15:30:24 + PMS::REAL, PMS::IMAG, PMS::WTxAMP}; build 12-Sep-2018 15:30:24 + // Datacolumn options: build 12-Sep-2018 15:30:24 + std::vector visCols {PMS::DATA, PMS::CORRECTED, build 12-Sep-2018 15:30:24 + PMS::MODEL, PMS::CORRMODEL, PMS::DATAMODEL, build 12-Sep-2018 15:30:24 + PMS::DATA_DIVIDE_MODEL, PMS::CORRECTED_DIVIDE_MODEL}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // check values for first chunk: each vis axis with each datacolumn build 12-Sep-2018 15:30:24 + // Expected values: build 12-Sep-2018 15:30:24 + Array expVis; // datacube with axis operation applied build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + for (auto axis : visAxes) { build 12-Sep-2018 15:30:24 + std::vector loadAxes{axis, PMS::TIME}; build 12-Sep-2018 15:30:24 + for (auto datacol : visCols) { build 12-Sep-2018 15:30:24 + std::vector loadData{datacol, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ASSERT_EQ(expNChunk, cache->nChunk()); build 12-Sep-2018 15:30:24 + switch (axis) { build 12-Sep-2018 15:30:24 + case PMS::AMP: { build 12-Sep-2018 15:30:24 + switch (datacol) { build 12-Sep-2018 15:30:24 + case PMS::DATA: build 12-Sep-2018 15:30:24 + expVis = amplitude(visData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->ampData(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::CORRECTED: build 12-Sep-2018 15:30:24 + expVis = amplitude(corrData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->ampCorr(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::MODEL: build 12-Sep-2018 15:30:24 + expVis = amplitude(modelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->ampModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::CORRMODEL: build 12-Sep-2018 15:30:24 + expVis = amplitude(corrmodelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->ampCorrModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::DATAMODEL: build 12-Sep-2018 15:30:24 + expVis = amplitude(vismodelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->ampDataModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::DATA_DIVIDE_MODEL: build 12-Sep-2018 15:30:24 + expVis = amplitude(visDivmodelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(tUtil::allEQDiv(expVis, build 12-Sep-2018 15:30:24 + cache->ampDataDivModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::CORRECTED_DIVIDE_MODEL: build 12-Sep-2018 15:30:24 + expVis = amplitude(corrDivmodelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(tUtil::allEQDiv(expVis, build 12-Sep-2018 15:30:24 + cache->ampCorrDivModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::FLOAT_DATA: build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::PHASE: { // convert to degrees build 12-Sep-2018 15:30:24 + switch (datacol) { build 12-Sep-2018 15:30:24 + case PMS::DATA: build 12-Sep-2018 15:30:24 + expVis = phase(visData) * 180.0 / C::pi; build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->phaData(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::CORRECTED: build 12-Sep-2018 15:30:24 + expVis = phase(corrData) * 180.0 / C::pi; build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->phaCorr(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::MODEL: build 12-Sep-2018 15:30:24 + expVis = phase(modelData) * 180.0 / C::pi; build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->phaModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::CORRMODEL: build 12-Sep-2018 15:30:24 + expVis = phase(corrmodelData) * 180.0 / C::pi; build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->phaCorrModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::DATAMODEL: build 12-Sep-2018 15:30:24 + expVis = phase(vismodelData) * 180.0 / C::pi; build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->phaDataModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::DATA_DIVIDE_MODEL: build 12-Sep-2018 15:30:24 + expVis = phase(visDivmodelData) * 180.0 / C::pi; build 12-Sep-2018 15:30:24 + ASSERT_TRUE(tUtil::allEQDiv(expVis, build 12-Sep-2018 15:30:24 + cache->phaDataDivModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::CORRECTED_DIVIDE_MODEL: build 12-Sep-2018 15:30:24 + expVis = phase(corrDivmodelData) * 180.0 / C::pi; build 12-Sep-2018 15:30:24 + ASSERT_TRUE(tUtil::allEQDiv(expVis, build 12-Sep-2018 15:30:24 + cache->phaCorrDivModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::FLOAT_DATA: build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::REAL: { build 12-Sep-2018 15:30:24 + switch (datacol) { build 12-Sep-2018 15:30:24 + case PMS::DATA: build 12-Sep-2018 15:30:24 + expVis = real(visData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->realData(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::CORRECTED: build 12-Sep-2018 15:30:24 + expVis = real(corrData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->realCorr(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::MODEL: build 12-Sep-2018 15:30:24 + expVis = real(modelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->realModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::CORRMODEL: build 12-Sep-2018 15:30:24 + expVis = real(corrmodelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->realCorrModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::DATAMODEL: build 12-Sep-2018 15:30:24 + expVis = real(vismodelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->realDataModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::DATA_DIVIDE_MODEL: build 12-Sep-2018 15:30:24 + expVis = real(visDivmodelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(tUtil::allEQDiv(expVis, build 12-Sep-2018 15:30:24 + cache->realDataDivModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::CORRECTED_DIVIDE_MODEL: build 12-Sep-2018 15:30:24 + expVis = real(corrDivmodelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(tUtil::allEQDiv(expVis, build 12-Sep-2018 15:30:24 + cache->realCorrDivModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::FLOAT_DATA: build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::IMAG: { build 12-Sep-2018 15:30:24 + switch (datacol) { build 12-Sep-2018 15:30:24 + case PMS::DATA: build 12-Sep-2018 15:30:24 + expVis = imag(visData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->imagData(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::CORRECTED: build 12-Sep-2018 15:30:24 + expVis = imag(corrData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->imagCorr(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::MODEL: build 12-Sep-2018 15:30:24 + expVis = imag(modelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->imagModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::CORRMODEL: build 12-Sep-2018 15:30:24 + expVis = imag(corrmodelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->imagCorrModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::DATAMODEL: build 12-Sep-2018 15:30:24 + expVis = imag(vismodelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expVis, cache->imagDataModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::DATA_DIVIDE_MODEL: build 12-Sep-2018 15:30:24 + expVis = imag(visDivmodelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(tUtil::allEQDiv(expVis, build 12-Sep-2018 15:30:24 + cache->imagDataDivModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::CORRECTED_DIVIDE_MODEL: build 12-Sep-2018 15:30:24 + expVis = imag(corrDivmodelData); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(tUtil::allEQDiv(expVis, build 12-Sep-2018 15:30:24 + cache->imagCorrDivModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::FLOAT_DATA: build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::WTxAMP: { build 12-Sep-2018 15:30:24 + switch (datacol) { build 12-Sep-2018 15:30:24 + case PMS::DATA: { build 12-Sep-2018 15:30:24 + expVis = amplitude(visData); build 12-Sep-2018 15:30:24 + Array expWtAmp = tUtil::getWtAmp(expWt, expVis); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expWtAmp, cache->wtxampData(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::CORRECTED: { build 12-Sep-2018 15:30:24 + expVis = amplitude(corrData); build 12-Sep-2018 15:30:24 + Array expWtAmp = tUtil::getWtAmp(expWt, expVis); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expWtAmp, cache->wtxampCorr(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::MODEL: { build 12-Sep-2018 15:30:24 + expVis = amplitude(modelData); build 12-Sep-2018 15:30:24 + Array expWtAmp = tUtil::getWtAmp(expWt, expVis); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expWtAmp, cache->wtxampModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::CORRMODEL: { build 12-Sep-2018 15:30:24 + expVis = amplitude(corrmodelData); build 12-Sep-2018 15:30:24 + Array expWtAmp = tUtil::getWtAmp(expWt, expVis); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expWtAmp, cache->wtxampCorrModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::DATAMODEL: { build 12-Sep-2018 15:30:24 + expVis = amplitude(vismodelData); build 12-Sep-2018 15:30:24 + Array expWtAmp = tUtil::getWtAmp(expWt, expVis); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expWtAmp, cache->wtxampDataModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::DATA_DIVIDE_MODEL: { build 12-Sep-2018 15:30:24 + expVis = amplitude(visDivmodelData); build 12-Sep-2018 15:30:24 + Array expWtAmp = tUtil::getWtAmp(expWt, expVis); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(tUtil::allEQDiv(expWtAmp, cache->wtxampDataDivModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::CORRECTED_DIVIDE_MODEL: { build 12-Sep-2018 15:30:24 + expVis = amplitude(corrDivmodelData); build 12-Sep-2018 15:30:24 + Array expWtAmp = tUtil::getWtAmp(expWt, expVis); build 12-Sep-2018 15:30:24 + ASSERT_TRUE(tUtil::allEQDiv(expWtAmp, cache->wtxampCorrDivModel(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + case PMS::FLOAT_DATA: build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + default: build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expFlag, cache->flag(ichunk))); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // check wt, wtsp, sigma, sigmasp, flagrow build 12-Sep-2018 15:30:24 + std::vector wtAxes {PMS::WT, PMS::WTSP, build 12-Sep-2018 15:30:24 + PMS::SIGMA, PMS::SIGMASP, PMS::FLAG_ROW}; build 12-Sep-2018 15:30:24 + for (auto axis : wtAxes) { build 12-Sep-2018 15:30:24 + std::vector loadAxes{axis, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData {PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + switch(axis) { build 12-Sep-2018 15:30:24 + case PMS::WT: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expWt, cache->wt(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::WTSP: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expWtSp, cache->wtsp(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::SIGMA: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expSigma, cache->sigma(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::SIGMASP: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expSigmaSp, cache->sigmasp(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case PMS::FLAG_ROW: build 12-Sep-2018 15:30:24 + ASSERT_TRUE(allEQ(expFlagrow, cache->flagrow(ichunk))); build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + default: build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dAveraging.cc b/code/plotms/test/dAveraging.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index 04e4e8a..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dAveraging.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,136 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Path for data build 12-Sep-2018 15:30:24 - String dataPath = "/lustre/bkent/evlapipeline/helpdesk/13A-398.sb17165245.eb19445220.56369.115810324074.ms"; build 12-Sep-2018 15:30:24 - cout << "tAveraging:: using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Use corrected data build 12-Sep-2018 15:30:24 - PMS_PP_Cache* cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( cacheParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - cacheParams->setYAxis (PMS::AMP, PMS::CORRECTED ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Turn channel and time averaging on. build 12-Sep-2018 15:30:24 - PlotMSAveraging averaging = ppdata->averaging(); build 12-Sep-2018 15:30:24 - //averaging.setChannel( true); build 12-Sep-2018 15:30:24 - //averaging.setChannelValue( 65 ); build 12-Sep-2018 15:30:24 - averaging.setTime( true ); build 12-Sep-2018 15:30:24 - averaging.setTimeValue( 200 ); build 12-Sep-2018 15:30:24 - ppdata->setAveraging( averaging ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make some selections. build 12-Sep-2018 15:30:24 - PlotMSSelection sel = ppdata->selection(); build 12-Sep-2018 15:30:24 - sel.setScan( "31"); build 12-Sep-2018 15:30:24 - //Note: the :3 selects on channel 3 so we can decrease the data size and not build 12-Sep-2018 15:30:24 - //average channels which doesn't seem to be the problem. build 12-Sep-2018 15:30:24 - sel.setSpw( "10:3"); build 12-Sep-2018 15:30:24 - sel.setAntenna( "22&23"); build 12-Sep-2018 15:30:24 - sel.setCorr( "RR"); build 12-Sep-2018 15:30:24 - sel.setField( "2" ); build 12-Sep-2018 15:30:24 - ppdata->setSelection(sel); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Colorize by spw build 12-Sep-2018 15:30:24 - PMS_PP_Display* displayParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( displayParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - displayParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - displayParams->setColorize( true, PMS::SPW ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Add the plot build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Export build 12-Sep-2018 15:30:24 - String outFile( "/tmp/plotAveragingTest.jpg"); build 12-Sep-2018 15:30:24 - tUtil::clearFile( outFile ); build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tAveraging - result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile, 44000, 45000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tAveraging - result of first saved file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Now turn time averaging on build 12-Sep-2018 15:30:24 - /*averaging.setTime( true ); build 12-Sep-2018 15:30:24 - averaging.setTimeValue( 200 ); build 12-Sep-2018 15:30:24 - ppdata->setAveraging( averaging); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Export the plot again build 12-Sep-2018 15:30:24 - String outFile2( "/tmp/plotAveragingTest2.jpg"); build 12-Sep-2018 15:30:24 - tUtil::clearFile( outFile2 ); build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type2 = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format2(type2, outFile2 ); build 12-Sep-2018 15:30:24 - format2.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - bool ok2 = app.save(format2); build 12-Sep-2018 15:30:24 - cout << "tAveraging - result of save="< build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // CAS-2884 (plotms averages all channels with avgchannel = '1') build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Path for data build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tAveragingChannel:: using data from " << dataPath.c_str() << endl; build 12-Sep-2018 15:30:24 - String exportPath = tUtil::getExportPath(); build 12-Sep-2018 15:30:24 - cout << "Writing plotfiles to " << exportPath << endl; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Set up plotms object. build 12-Sep-2018 15:30:24 - PlotMSApp app(false, false ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Set up parameters for plot. build 12-Sep-2018 15:30:24 - PlotMSPlotParameters plotParams = PlotMSPlot::makeParameters(&app); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PMS_PP_MSData* ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Set up channel vs time plot build 12-Sep-2018 15:30:24 - PMS_PP_Cache* cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if(cacheParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PMS::Axis yAxis = PMS::CHANNEL; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis, PMS::DATA); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Add the plot build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Export format for all tests build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - // File size should be the same for first 3 cases build 12-Sep-2018 15:30:24 - int noAveragingSizeMin = 310000; build 12-Sep-2018 15:30:24 - int noAveragingSizeMax = 350000; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // start with no averaging build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotAveragingChannelTest1.jpg"; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tAveragingChannel test 1 - result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile, noAveragingSizeMin, noAveragingSizeMax, -1 ); build 12-Sep-2018 15:30:24 - cout << "tAveragingChannel test 1 - result of first saved file check="<< okOutput << endl; build 12-Sep-2018 15:30:24 - bool test1 = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Now turn channel averaging on to 1 (should be same as none) build 12-Sep-2018 15:30:24 - PlotMSAveraging averaging = ppdata->averaging(); build 12-Sep-2018 15:30:24 - averaging.setChannel( true); build 12-Sep-2018 15:30:24 - averaging.setChannelValue( 1 ); build 12-Sep-2018 15:30:24 - ppdata->setAveraging( averaging ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - app.clearPlots(); build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Export the plot again build 12-Sep-2018 15:30:24 - String outFile2 = exportPath + "plotAveragingChannelTest2.jpg"; build 12-Sep-2018 15:30:24 - PlotExportFormat format2(type, outFile2 ); build 12-Sep-2018 15:30:24 - format2.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - ok = app.save(format2); build 12-Sep-2018 15:30:24 - cout << "tAveragingChannel test 2 - result of save=" << ok <setAveraging( averaging ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - app.clearPlots(); build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Export the plot again build 12-Sep-2018 15:30:24 - String outFile3 = exportPath + "plotAveragingChannelTest3.jpg"; build 12-Sep-2018 15:30:24 - PlotExportFormat format3(type, outFile3 ); build 12-Sep-2018 15:30:24 - format3.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - ok = app.save(format3); build 12-Sep-2018 15:30:24 - cout << "tAveragingChannel test 3 - result of save=" << ok <(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Set up channel vs time plot build 12-Sep-2018 15:30:24 - PMS_PP_Cache* cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if(cacheParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PMS::Axis yAxis = PMS::CHANNEL; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis, PMS::DATA); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Add the plot build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Export format for all tests build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // start with no averaging build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotAveragingTimeTest1.jpg"; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tAveragingTime test 1 - result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile, 300000, 335000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tAveragingTime test 1 - result of first saved file check="<< okOutput << endl; build 12-Sep-2018 15:30:24 - bool test1 = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Now turn time averaging on to 600 build 12-Sep-2018 15:30:24 - PlotMSAveraging averaging = ppdata->averaging(); build 12-Sep-2018 15:30:24 - averaging.setTime( true); build 12-Sep-2018 15:30:24 - averaging.setTimeValue( 600.0 ); build 12-Sep-2018 15:30:24 - ppdata->setAveraging( averaging ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - app.clearPlots(); build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Export the plot again build 12-Sep-2018 15:30:24 - String outFile2 = exportPath + "plotAveragingTimeTest2.jpg"; build 12-Sep-2018 15:30:24 - PlotExportFormat format2(type, outFile2 ); build 12-Sep-2018 15:30:24 - format2.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - ok = app.save(format2); build 12-Sep-2018 15:30:24 - cout << "tAveragingTime test 2 - result of save=" << ok < sortCols(4); // Use default sort columns build 12-Sep-2018 15:30:24 + sortCols[0] = MS::columnName(MS::ARRAY_ID); build 12-Sep-2018 15:30:24 + sortCols[1] = MS::columnName(MS::FIELD_ID); build 12-Sep-2018 15:30:24 + sortCols[2] = MS::columnName(MS::DATA_DESC_ID); build 12-Sep-2018 15:30:24 + sortCols[3] = MS::columnName(MS::TIME); build 12-Sep-2018 15:30:24 + MeasurementSet sortedMS = ms.sort(sortCols); build 12-Sep-2018 15:30:24 + ROMSMainColumns msmc(sortedMS); build 12-Sep-2018 15:30:24 + Array visData(msmc.data().getColumn()); build 12-Sep-2018 15:30:24 + IPosition visShape(visData.shape()); build 12-Sep-2018 15:30:24 + visShape.setLast(IPosition(1,expNRow)); build 12-Sep-2018 15:30:24 + visData.adjustLastAxis(visShape); build 12-Sep-2018 15:30:24 + Array amp(amplitude(visData)); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + PlotMSSelection itsSelection; build 12-Sep-2018 15:30:24 + PlotMSAveraging itsAveraging; build 12-Sep-2018 15:30:24 + PlotMSTransformations itsTransformations; build 12-Sep-2018 15:30:24 + PlotMSCalibration itsCalibration; build 12-Sep-2018 15:30:24 + MSCache* cache = new MSCache(nullptr); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // check values for first chunk build 12-Sep-2018 15:30:24 + Int ichunk(0); build 12-Sep-2018 15:30:24 + std::vector loadAxes{PMS::AMP, PMS::TIME}; build 12-Sep-2018 15:30:24 + std::vector loadData{PMS::DATA, PMS::DATA}; build 12-Sep-2018 15:30:24 + cache->load(loadAxes, loadData, dataPath, build 12-Sep-2018 15:30:24 + itsSelection, itsAveraging, build 12-Sep-2018 15:30:24 + itsTransformations, itsCalibration, build 12-Sep-2018 15:30:24 + nullptr ); // ThreadCommunication* is nullptr build 12-Sep-2018 15:30:24 + cout << "chunk:" << cache->nChunk() << endl; build 12-Sep-2018 15:30:24 + cout << "nrow:" << cache->chunkShapes()(IPosition(2,2,ichunk)) << endl; build 12-Sep-2018 15:30:24 + cout << "exp=got:" << allEQ(amp, cache->ampData(ichunk)) << endl; build 12-Sep-2018 15:30:24 + bool cacheOk = (cache != nullptr); build 12-Sep-2018 15:30:24 + delete cache; build 12-Sep-2018 15:30:24 + return cacheOk; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dDataSelection.cc b/code/plotms/test/dDataSelection.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index fff55be..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dDataSelection.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,83 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Path for data build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms"); build 12-Sep-2018 15:30:24 - cout << "tDataSelection:: using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PlotMSSelection sel = ppdata->selection(); build 12-Sep-2018 15:30:24 - sel.setScan( "2,4"); build 12-Sep-2018 15:30:24 - ppdata->setSelection(sel); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotDataSelectionTest.jpg"; build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tDataSelection - result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile, 70000, 105000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tDataSelection - result of first saved file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dExportPlot.cc b/code/plotms/test/dExportPlot.cc build 12-Sep-2018 15:30:24 index 670ba55..d5a49f3 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dExportPlot.cc build 12-Sep-2018 15:30:24 +++ b/code/plotms/test/dExportPlot.cc build 12-Sep-2018 15:30:24 @@ -50,7 +50,9 @@ int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 PlotMSApp app(false, false); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Set up parameters for plot. build 12-Sep-2018 15:30:24 + // Set up default parameters for plot. build 12-Sep-2018 15:30:24 + // Can also set parameters for averaging, transformation, build 12-Sep-2018 15:30:24 + // iteration, display, etc. in PlotMSPlotParameterGroups build 12-Sep-2018 15:30:24 PlotMSPlotParameters plotParams = PlotMSPlot::makeParameters(&app); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 PMS_PP_MSData* ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dExportRange.cc b/code/plotms/test/dExportRange.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index b338997..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dExportRange.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,163 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -bool exportPlot(PlotMSApp& app, String outFile, PlotExportFormat::Type type, build 12-Sep-2018 15:30:24 - String strType, int minSize, int maxSize ){ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tExportRange:: "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We are going to iterate over scan, using a shared axis and global build 12-Sep-2018 15:30:24 - //scale with a 2 x 2 grid for the iteration. build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterationParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterationParams->setIterationAxis( PMS::SCAN ); build 12-Sep-2018 15:30:24 - iterationParams->setGlobalScaleX( true ); build 12-Sep-2018 15:30:24 - iterationParams->setGlobalScaleY( true ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - iterationParams->setCommonAxisX( true ); build 12-Sep-2018 15:30:24 - iterationParams->setCommonAxisY( true ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We want to print all (2) pages in the output. build 12-Sep-2018 15:30:24 - PlotMSExportParam& exportParams = app.getExportParameters(); build 12-Sep-2018 15:30:24 - exportParams.setExportRange( PMS::PAGE_ALL ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make the plot. build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool jpg_test = exportAsJPG( app, exportPath ); build 12-Sep-2018 15:30:24 - bool png_test = exportAsPNG( app, exportPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Too much data to export as text. build 12-Sep-2018 15:30:24 - //exportAsText( app ); build 12-Sep-2018 15:30:24 - bool pdf_test = exportAsPDF( app, exportPath ); build 12-Sep-2018 15:30:24 - bool ps_test = exportAsPS( app, exportPath ); build 12-Sep-2018 15:30:24 - bool test = jpg_test && png_test && pdf_test && ps_test; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dExportRangeInternal.cc b/code/plotms/test/dExportRangeInternal.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index bb87b8c..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dExportRangeInternal.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,116 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether an iteration plot, with two pages, can be exported build 12-Sep-2018 15:30:24 - * in a single pass. We use a 2x3 grid. Each plot manages its own axes internally. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeInternal using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We are going to iterate over scan, using a shared axis and global build 12-Sep-2018 15:30:24 - //scale for the iteration. build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterationParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterationParams->setIterationAxis( PMS::SCAN ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set a left y-axis and a top x-axis build 12-Sep-2018 15:30:24 - PMS_PP_Axes* axisParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (axisParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - axisParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - axisParams->setAxes(X_TOP, Y_RIGHT, 0 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We want to print all (2) pages in the output. build 12-Sep-2018 15:30:24 - PlotMSExportParam& exportParams = app.getExportParameters(); build 12-Sep-2018 15:30:24 - exportParams.setExportRange( PMS::PAGE_ALL ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make the plot. build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotMSExportRangeInternal"; build 12-Sep-2018 15:30:24 - String outFile1( outFile+"_Scan1,2,3,4,5,6.jpg"); build 12-Sep-2018 15:30:24 - String outFile2( outFile+"_Scan7_2.jpg"); build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile+".jpg" ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tExportRangeInternal:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile1, 240000, 280000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeInternal:: Result of first save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool okOutput2 = tUtil::checkFile( outFile2, 45000, 65000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeInternal: Result of second save file check=" << okOutput2 << endl; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile1); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile2); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool test = ok && okOutput && okOutput2; build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dExportRangeLeftBottom.cc b/code/plotms/test/dExportRangeLeftBottom.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index 84a957a..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dExportRangeLeftBottom.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,121 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether an iteration plot, with two pages, can be exported build 12-Sep-2018 15:30:24 - * in a single pass. We use a 2x3 grid and a common left,bottom axis build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeLeftBottom using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We are going to iterate over scan, using a shared axis and global build 12-Sep-2018 15:30:24 - //scale for the iteration. build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterationParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterationParams->setIterationAxis( PMS::SCAN ); build 12-Sep-2018 15:30:24 - iterationParams->setGlobalScaleX( true ); build 12-Sep-2018 15:30:24 - iterationParams->setGlobalScaleY( true ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - iterationParams->setCommonAxisX( true ); build 12-Sep-2018 15:30:24 - iterationParams->setCommonAxisY( true ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set a right y-axis and a top x-axis build 12-Sep-2018 15:30:24 - PMS_PP_Axes* axisParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (axisParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - axisParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - axisParams->setAxes(X_BOTTOM, Y_LEFT, 0 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We want to print all (2) pages in the output. build 12-Sep-2018 15:30:24 - PlotMSExportParam& exportParams = app.getExportParameters(); build 12-Sep-2018 15:30:24 - exportParams.setExportRange( PMS::PAGE_ALL ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make the plot. build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotMSExportRangeLeftBottom"; build 12-Sep-2018 15:30:24 - String outFile1( outFile+"_Scan1,2,3,4,5,6.jpg"); build 12-Sep-2018 15:30:24 - String outFile2( outFile + "_Scan7_2.jpg"); build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile+".jpg" ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tExportRangeLeftBottom:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile1, 120000, 170000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeLeftBottom:: Result of first save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool okOutput2 = tUtil::checkFile( outFile2, 50000, 70000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeLeftBottom: Result of second save file check=" << okOutput2 << endl; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile1); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile2); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool test = ok && okOutput && okOutput2; build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dExportRangeLeftTop.cc b/code/plotms/test/dExportRangeLeftTop.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index 3ff39f9..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dExportRangeLeftTop.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,121 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether an iteration plot, with two pages, can be exported build 12-Sep-2018 15:30:24 - * in a single pass. We use a 2x3 grid and a common left,top axis build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeLeftTop using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We are going to iterate over scan, using a shared axis and global build 12-Sep-2018 15:30:24 - //scale for the iteration. build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterationParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterationParams->setIterationAxis( PMS::SCAN ); build 12-Sep-2018 15:30:24 - iterationParams->setGlobalScaleX( true ); build 12-Sep-2018 15:30:24 - iterationParams->setGlobalScaleY( true ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - iterationParams->setCommonAxisX( true ); build 12-Sep-2018 15:30:24 - iterationParams->setCommonAxisY( true ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set a left y-axis and a top x-axis build 12-Sep-2018 15:30:24 - PMS_PP_Axes* axisParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (axisParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - axisParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - axisParams->setAxes(X_TOP, Y_LEFT, 0 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We want to print all (2) pages in the output. build 12-Sep-2018 15:30:24 - PlotMSExportParam& exportParams = app.getExportParameters(); build 12-Sep-2018 15:30:24 - exportParams.setExportRange( PMS::PAGE_ALL ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make the plot. build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotMSExportRangeLeftTop"; build 12-Sep-2018 15:30:24 - String outFile1( outFile + "_Scan1,2,3,4,5,6.jpg"); build 12-Sep-2018 15:30:24 - String outFile2( outFile + "_Scan7_2.jpg"); build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile + ".jpg" ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tExportRangeLeftTop:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile1, 110000, 160000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeLeftTop:: Result of first save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool okOutput2 = tUtil::checkFile( outFile2, 50000, 65000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeLeftTop: Result of second save file check=" << okOutput2 << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput && okOutput2; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile1); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile2); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dExportRangePipeline.cc b/code/plotms/test/dExportRangePipeline.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index 19cdada..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dExportRangePipeline.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,123 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether an iteration plot can be exported as one plot per page. build 12-Sep-2018 15:30:24 - * Supposedly this is the scenario the pipeline will be running. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tExportRangePipeline using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We are going to iterate over scan, using a shared axis and global build 12-Sep-2018 15:30:24 - //scale for the iteration. build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterationParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterationParams->setIterationAxis( PMS::SCAN ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set a left y-axis and a top x-axis build 12-Sep-2018 15:30:24 - PMS_PP_Axes* axisParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (axisParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - axisParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - axisParams->setAxes(X_BOTTOM, Y_LEFT, 0 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We want to print all pages in the output. build 12-Sep-2018 15:30:24 - PlotMSExportParam& exportParams = app.getExportParameters(); build 12-Sep-2018 15:30:24 - exportParams.setExportRange( PMS::PAGE_ALL ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make the plot. build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Note: There will be seven plots generated, but we will just build 12-Sep-2018 15:30:24 - //check the first. build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotMSExportRangePipeline"; build 12-Sep-2018 15:30:24 - String outFile1( outFile + "_Scan1.jpg"); build 12-Sep-2018 15:30:24 - String outFile2( outFile + "_Scan2_2.jpg"); build 12-Sep-2018 15:30:24 - String outFile3( outFile + "_Scan3_3.jpg"); build 12-Sep-2018 15:30:24 - String outFile4( outFile + "_Scan4_4.jpg"); build 12-Sep-2018 15:30:24 - String outFile5( outFile + "_Scan5_5.jpg"); build 12-Sep-2018 15:30:24 - String outFile6( outFile + "_Scan6_6.jpg"); build 12-Sep-2018 15:30:24 - String outFile7( outFile + "_Scan7_7.jpg"); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile + ".jpg" ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tExportRangePipeline:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile1, 120000, 140000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tExportRangePipeline:: Result of first save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile1); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile2); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile3); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile4); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile5); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile6); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile7); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dExportRangeRightBottom.cc b/code/plotms/test/dExportRangeRightBottom.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index e58ff12..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dExportRangeRightBottom.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,121 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether an iteration plot, with two pages, can be exported build 12-Sep-2018 15:30:24 - * in a single pass. We use a 2x3 grid and a common right,bottom axis build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeRightBottom using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We are going to iterate over scan, using a shared axis and global build 12-Sep-2018 15:30:24 - //scale for the iteration. build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterationParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterationParams->setIterationAxis( PMS::SCAN ); build 12-Sep-2018 15:30:24 - iterationParams->setGlobalScaleX( true ); build 12-Sep-2018 15:30:24 - iterationParams->setGlobalScaleY( true ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - iterationParams->setCommonAxisX( true ); build 12-Sep-2018 15:30:24 - iterationParams->setCommonAxisY( true ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set a right y-axis and a top x-axis build 12-Sep-2018 15:30:24 - PMS_PP_Axes* axisParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (axisParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - axisParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - axisParams->setAxes(X_BOTTOM, Y_RIGHT, 0 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We want to print all (2) pages in the output. build 12-Sep-2018 15:30:24 - PlotMSExportParam& exportParams = app.getExportParameters(); build 12-Sep-2018 15:30:24 - exportParams.setExportRange( PMS::PAGE_ALL ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make the plot. build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotMSExportRangeRightBottom"; build 12-Sep-2018 15:30:24 - String outFile1( outFile + "_Scan1,2,3,4,5,6.jpg"); build 12-Sep-2018 15:30:24 - String outFile2( outFile + "_Scan7_2.jpg"); build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile + ".jpg" ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tExportRangeRightBottom:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile1, 110000, 155000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeRightBottom:: Result of first save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool okOutput2 = tUtil::checkFile( outFile2, 45000, 60000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeRightBottom: Result of second save file check=" << okOutput2 << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput && okOutput2; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile1); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile2); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dExportRangeRightTop.cc b/code/plotms/test/dExportRangeRightTop.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index f5b8ae7..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dExportRangeRightTop.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,121 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether an iteration plot, with two pages, can be exported build 12-Sep-2018 15:30:24 - * in a single pass. We use a 2x3 grid and a common right,top axis build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tExportRangePNG using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We are going to iterate over scan, using a shared axis and global build 12-Sep-2018 15:30:24 - //scale for the iteration. build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterationParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterationParams->setIterationAxis( PMS::SCAN ); build 12-Sep-2018 15:30:24 - iterationParams->setGlobalScaleX( true ); build 12-Sep-2018 15:30:24 - iterationParams->setGlobalScaleY( true ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - iterationParams->setCommonAxisX( true ); build 12-Sep-2018 15:30:24 - iterationParams->setCommonAxisY( true ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set a right y-axis and a top x-axis build 12-Sep-2018 15:30:24 - PMS_PP_Axes* axisParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (axisParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - axisParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - axisParams->setAxes(X_TOP, Y_RIGHT, 0 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We want to print all (2) pages in the output. build 12-Sep-2018 15:30:24 - PlotMSExportParam& exportParams = app.getExportParameters(); build 12-Sep-2018 15:30:24 - exportParams.setExportRange( PMS::PAGE_ALL ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make the plot. build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotMSExportRangeRightTop"; build 12-Sep-2018 15:30:24 - String outFile1( outFile + "_Scan1,2,3,4,5,6.jpg"); build 12-Sep-2018 15:30:24 - String outFile2( outFile + "_Scan7_2.jpg"); build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile + ".jpg" ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tExportRangeRightTop:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile1, 100000, 150000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeRightTop:: Result of first save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool okOutput2 = tUtil::checkFile( outFile2, 45000, 60000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tExportRangeRightTop: Result of second save file check=" << okOutput2 << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput && okOutput2; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile1); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile2); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dGridPlacement.cc b/code/plotms/test/dGridPlacement.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index fef7b0d..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dGridPlacement.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,108 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether a plot can be placed in the second row, second column build 12-Sep-2018 15:30:24 - * of a 2x3 page layout. The uneven number of rows and columns are important build 12-Sep-2018 15:30:24 - * to make sure placement is not switched or confused. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - qDebug() << "tGridPlacement using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Put the plot in the 2nd row, 2nd col build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterParams->setGridRow( 1 ); build 12-Sep-2018 15:30:24 - iterParams->setGridCol( 1 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We want to print all pages in the output. build 12-Sep-2018 15:30:24 - PlotMSExportParam& exportParams = app.getExportParameters(); build 12-Sep-2018 15:30:24 - exportParams.setExportRange( PMS::PAGE_ALL ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotMSGridPlacementTest.jpg"; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - qDebug() << "tGridPlacement:: Result of save=" << ok; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile, 55000, 80000, -1 ); build 12-Sep-2018 15:30:24 - qDebug() << "tGridPlacement:: Result of save file check=" << okOutput; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dGridPlacementMultiplePlots.cc b/code/plotms/test/dGridPlacementMultiplePlots.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index a4d62d6..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dGridPlacementMultiplePlots.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,116 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether multiple plots can be displayed in a grid. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - qDebug() << "tGridPlacementMultiplePlots using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Put the plot in the correct location. build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - int rowIndex = i / 2; build 12-Sep-2018 15:30:24 - int colIndex = i % 2; build 12-Sep-2018 15:30:24 - iterParams->setGridRow( rowIndex ); build 12-Sep-2018 15:30:24 - iterParams->setGridCol( colIndex ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Add the plot. build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We want to print all pages in the output. build 12-Sep-2018 15:30:24 - PlotMSExportParam& exportParams = app.getExportParameters(); build 12-Sep-2018 15:30:24 - exportParams.setExportRange( PMS::PAGE_ALL ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotMSGridPlacementMultiplePlotsTest.jpg"; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - qDebug() << "tGridPlacementMultiplePlots:: Result of save=" << ok; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile, 250000, 300000, -1 ); build 12-Sep-2018 15:30:24 - qDebug() << "tGridPlacementMultiplePlots:: Result of save file check=" << okOutput; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dGridPlacementMultipleRuns.cc b/code/plotms/test/dGridPlacementMultipleRuns.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index d16b194..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dGridPlacementMultipleRuns.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,237 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether plots can be placed in a 2x3 page layout. Then it changes build 12-Sep-2018 15:30:24 - * the grid size to 1x1 and generates a plot. This tests whether build 12-Sep-2018 15:30:24 - * the grid size can be dynamically changed in scripting mode. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - qDebug() << "tGridPlacementMultipleRuns using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Put the plot in the first slot build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterParams->setGridRow( 0 ); build 12-Sep-2018 15:30:24 - iterParams->setGridCol( 0 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make the plot. build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make a second plot build 12-Sep-2018 15:30:24 - PlotMSPlotParameters plotParams2 = PlotMSPlot::makeParameters(&app); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PMS_PP_MSData* ppdata2 = plotParams2.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdata2 == NULL) { build 12-Sep-2018 15:30:24 - plotParams2.setGroup(); build 12-Sep-2018 15:30:24 - ppdata2 = plotParams2.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata2->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterParams2 = plotParams2.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterParams2 == NULL ){ build 12-Sep-2018 15:30:24 - plotParams2.setGroup(); build 12-Sep-2018 15:30:24 - iterParams2 = plotParams2.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterParams2->setGridRow( 0 ); build 12-Sep-2018 15:30:24 - iterParams2->setGridCol( 1 ); build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams2 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make a third plot build 12-Sep-2018 15:30:24 - PlotMSPlotParameters plotParams3 = PlotMSPlot::makeParameters(&app); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PMS_PP_MSData* ppdata3 = plotParams3.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdata3 == NULL) { build 12-Sep-2018 15:30:24 - plotParams3.setGroup(); build 12-Sep-2018 15:30:24 - ppdata3 = plotParams3.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata3->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterParams3 = plotParams3.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterParams3 == NULL ){ build 12-Sep-2018 15:30:24 - plotParams3.setGroup(); build 12-Sep-2018 15:30:24 - iterParams3 = plotParams3.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterParams3->setGridRow( 0 ); build 12-Sep-2018 15:30:24 - iterParams3->setGridCol( 2 ); build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams3 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make a fourth plot build 12-Sep-2018 15:30:24 - PlotMSPlotParameters plotParams4 = PlotMSPlot::makeParameters(&app); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PMS_PP_MSData* ppdata4 = plotParams4.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdata4 == NULL) { build 12-Sep-2018 15:30:24 - plotParams4.setGroup(); build 12-Sep-2018 15:30:24 - ppdata4 = plotParams4.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata4->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterParams4 = plotParams4.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterParams4 == NULL ){ build 12-Sep-2018 15:30:24 - plotParams4.setGroup(); build 12-Sep-2018 15:30:24 - iterParams4 = plotParams3.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterParams4->setGridRow( 1 ); build 12-Sep-2018 15:30:24 - iterParams4->setGridCol( 0 ); build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams4 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make a fifth plot build 12-Sep-2018 15:30:24 - PlotMSPlotParameters plotParams5 = PlotMSPlot::makeParameters(&app); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PMS_PP_MSData* ppdata5 = plotParams5.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdata5 == NULL) { build 12-Sep-2018 15:30:24 - plotParams5.setGroup(); build 12-Sep-2018 15:30:24 - ppdata5 = plotParams5.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata5->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterParams5 = plotParams5.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterParams5 == NULL ){ build 12-Sep-2018 15:30:24 - plotParams5.setGroup(); build 12-Sep-2018 15:30:24 - iterParams5 = plotParams5.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterParams5->setGridRow( 1 ); build 12-Sep-2018 15:30:24 - iterParams5->setGridCol( 0 ); build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams5 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make a sixth plot build 12-Sep-2018 15:30:24 - PlotMSPlotParameters plotParams6 = PlotMSPlot::makeParameters(&app); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PMS_PP_MSData* ppdata6 = plotParams6.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdata6 == NULL) { build 12-Sep-2018 15:30:24 - plotParams6.setGroup(); build 12-Sep-2018 15:30:24 - ppdata6 = plotParams6.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata6->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterParams6 = plotParams6.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterParams6 == NULL ){ build 12-Sep-2018 15:30:24 - plotParams6.setGroup(); build 12-Sep-2018 15:30:24 - iterParams6 = plotParams6.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterParams6->setGridRow( 1 ); build 12-Sep-2018 15:30:24 - iterParams6->setGridCol( 0 ); build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams6 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We want to print all pages in the output. build 12-Sep-2018 15:30:24 - PlotMSExportParam& exportParams = app.getExportParameters(); build 12-Sep-2018 15:30:24 - exportParams.setExportRange( PMS::PAGE_ALL ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotMSGridPlacementMultipleRuns1Test.jpg"; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type2 = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type2, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - qDebug() << "tGridPlacementMultipleRuns 1:: Result of save=" << ok; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile, 155000, 225000, -1 ); build 12-Sep-2018 15:30:24 - qDebug() << "tGridPlacementMultipleRuns 1:: Result of save file check=" << okOutput; build 12-Sep-2018 15:30:24 - bool test1 = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Now neck down the grid size build 12-Sep-2018 15:30:24 - params.setGridSize( 1, 1); build 12-Sep-2018 15:30:24 - app.setParameters( params ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make a third plot build 12-Sep-2018 15:30:24 - PlotMSPlotParameters plotParams7 = PlotMSPlot::makeParameters(&app); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PMS_PP_MSData* ppdata7 = plotParams7.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdata7 == NULL) { build 12-Sep-2018 15:30:24 - plotParams7.setGroup(); build 12-Sep-2018 15:30:24 - ppdata7 = plotParams7.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata7->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterParams7 = plotParams7.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterParams7 == NULL ){ build 12-Sep-2018 15:30:24 - plotParams7.setGroup(); build 12-Sep-2018 15:30:24 - iterParams7 = plotParams7.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterParams7->setGridRow( 0 ); build 12-Sep-2018 15:30:24 - iterParams7->setGridCol( 0 ); build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams7 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Export the second version. build 12-Sep-2018 15:30:24 - String outFile2 = exportPath + "plotMSGridPlacementMultipleRuns2Test.jpg"; build 12-Sep-2018 15:30:24 - PlotExportFormat format2(type2, outFile2 ); build 12-Sep-2018 15:30:24 - format2.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - ok = app.save(format2); build 12-Sep-2018 15:30:24 - qDebug() << "tGridPlacementMultipleRuns 2:: Result of save=" << ok; build 12-Sep-2018 15:30:24 - okOutput = tUtil::checkFile( outFile2, 235000, 255000, -1 ); build 12-Sep-2018 15:30:24 - qDebug() << "tGridPlacementMultipleRuns 2:: Result of save file check=" << okOutput; build 12-Sep-2018 15:30:24 - bool test2 = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile2); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool test = test1 && test2; build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dLegend.cc b/code/plotms/test/dLegend.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index 5229438..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dLegend.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,137 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether we can overplot field and scan for the test data with a legend build 12-Sep-2018 15:30:24 - * showing the two sets of data. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tLegend using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Cache and Axes build 12-Sep-2018 15:30:24 - PMS_PP_Cache* cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - PMS_PP_Axes* axesParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if(cacheParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if(axesParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - axesParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //The cache must have exactly as many x-axes as y-axes so we duplicate build 12-Sep-2018 15:30:24 - //the x-axis properties here. build 12-Sep-2018 15:30:24 - int yAxisCount = 2; build 12-Sep-2018 15:30:24 - PMS::Axis xAxis = PMS::TIME; build 12-Sep-2018 15:30:24 - for ( int i = 0; i < yAxisCount; i++ ){ build 12-Sep-2018 15:30:24 - cacheParams->setXAxis(xAxis, PMS::DATA, i); build 12-Sep-2018 15:30:24 - axesParams->setXAxis( X_BOTTOM, i); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PMS::Axis yAxis1 = PMS::SCAN; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis1, PMS::DATA, 0); build 12-Sep-2018 15:30:24 - axesParams->setYAxis( Y_LEFT, 0); build 12-Sep-2018 15:30:24 - PMS::Axis yAxis2 = PMS::FIELD; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis2, PMS::DATA, 1); build 12-Sep-2018 15:30:24 - axesParams->setYAxis(Y_LEFT, 1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Turn on the legend. build 12-Sep-2018 15:30:24 - PMS_PP_Canvas* canvasParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if(canvasParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - canvasParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - canvasParams->showLegend(true); build 12-Sep-2018 15:30:24 - qDebug() << "tLegend setShowLegend"; build 12-Sep-2018 15:30:24 - const PlotCanvas::LegendPosition position = PlotCanvas::INT_URIGHT; build 12-Sep-2018 15:30:24 - canvasParams->setLegendPosition( position ); build 12-Sep-2018 15:30:24 - qDebug() << "tLegend setLegendPosition"; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We need to set a distinctive color for each set of data build 12-Sep-2018 15:30:24 - //so we can distinguish it. build 12-Sep-2018 15:30:24 - PMS_PP_Display* ppdisp = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdisp == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdisp = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PlotSymbolPtr ps = app.createSymbol ("diamond", 5, "00FF00", "mesh2", false ); build 12-Sep-2018 15:30:24 - ppdisp->setUnflaggedSymbol(ps, 0); build 12-Sep-2018 15:30:24 - PlotSymbolPtr ps2 = app.createSymbol ("diamond", 5, "0000FF", "mesh2", false ); build 12-Sep-2018 15:30:24 - ppdisp->setUnflaggedSymbol(ps2, 1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotLegendTest.jpg"; build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tLegend:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile, 60000, 95000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tLegend:: Result of save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dMultiplePlotTypes.cc b/code/plotms/test/dMultiplePlotTypes.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index 52388e2..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dMultiplePlotTypes.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,200 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether multiple plot types can be supported on the same grid. build 12-Sep-2018 15:30:24 - * Make a 2x2 grid. Fill the (1,1) slot with an overplot, build 12-Sep-2018 15:30:24 - * the (1,2) slot with a normal plot, and then the build 12-Sep-2018 15:30:24 - * bottom row with an iteration plot that extends to the build 12-Sep-2018 15:30:24 - * next page. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tMultiplePlotTypes using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Cache and Axes build 12-Sep-2018 15:30:24 - PMS_PP_Cache* cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - PMS_PP_Axes* axesParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if(cacheParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if(axesParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - axesParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //The cache must have exactly as many x-axes as y-axes so we duplicate build 12-Sep-2018 15:30:24 - //the x-axis properties here. build 12-Sep-2018 15:30:24 - int yAxisCount = 2; build 12-Sep-2018 15:30:24 - PMS::Axis xAxis = PMS::TIME; build 12-Sep-2018 15:30:24 - for ( int i = 0; i < yAxisCount; i++ ){ build 12-Sep-2018 15:30:24 - cacheParams->setXAxis(xAxis, PMS::DATA, i); build 12-Sep-2018 15:30:24 - axesParams->setXAxis( X_BOTTOM, i); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PMS::Axis yAxis1 = PMS::SCAN; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis1, PMS::DATA, 0); build 12-Sep-2018 15:30:24 - axesParams->setYAxis( Y_LEFT, 0); build 12-Sep-2018 15:30:24 - PMS::Axis yAxis2 = PMS::FIELD; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis2, PMS::DATA, 1); build 12-Sep-2018 15:30:24 - axesParams->setYAxis(Y_LEFT, 1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We need to set a distinctive color for each set of data build 12-Sep-2018 15:30:24 - //so we can distinguish it. build 12-Sep-2018 15:30:24 - PMS_PP_Display* ppdisp = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdisp == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdisp = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PlotSymbolPtr ps = app.createSymbol ("diamond", 5, "00FF00", "mesh2", false ); build 12-Sep-2018 15:30:24 - ppdisp->setUnflaggedSymbol(ps, 0); build 12-Sep-2018 15:30:24 - PlotSymbolPtr ps2 = app.createSymbol ("diamond", 5, "0000FF", "mesh2", false ); build 12-Sep-2018 15:30:24 - ppdisp->setUnflaggedSymbol(ps2, 1); build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - /** build 12-Sep-2018 15:30:24 - * Normal Plot build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - PlotMSPlotParameters plotParams2 = PlotMSPlot::makeParameters(&app); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PMS_PP_MSData* ppdata2 = plotParams2.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdata2 == NULL) { build 12-Sep-2018 15:30:24 - plotParams2.setGroup(); build 12-Sep-2018 15:30:24 - ppdata2 = plotParams2.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata2->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterationParams2 = plotParams2.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterationParams2 == NULL ){ build 12-Sep-2018 15:30:24 - plotParams2.setGroup(); build 12-Sep-2018 15:30:24 - iterationParams2 = plotParams2.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterationParams2->setGridRow(0); build 12-Sep-2018 15:30:24 - iterationParams2->setGridCol(1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams2 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - /** build 12-Sep-2018 15:30:24 - * Iteration Plot build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - PlotMSPlotParameters plotParams3 = PlotMSPlot::makeParameters(&app); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PMS_PP_MSData* ppdata3 = plotParams3.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdata3 == NULL) { build 12-Sep-2018 15:30:24 - plotParams3.setGroup(); build 12-Sep-2018 15:30:24 - ppdata3 = plotParams3.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata3->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterationParams3 = plotParams3.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterationParams3 == NULL ){ build 12-Sep-2018 15:30:24 - plotParams3.setGroup(); build 12-Sep-2018 15:30:24 - iterationParams3 = plotParams3.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterationParams3->setGridRow(0); build 12-Sep-2018 15:30:24 - iterationParams3->setGridCol(1); build 12-Sep-2018 15:30:24 - iterationParams3->setIterationAxis( PMS::SCAN ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams3 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - /** build 12-Sep-2018 15:30:24 - * Export build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We want to print all (2) pages in the output. build 12-Sep-2018 15:30:24 - PlotMSExportParam& exportParams = app.getExportParameters(); build 12-Sep-2018 15:30:24 - exportParams.setExportRange( PMS::PAGE_ALL ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotMSMultiplePlotTypes"; build 12-Sep-2018 15:30:24 - String outFile1( outFile + "_Scan1,2.jpg"); build 12-Sep-2018 15:30:24 - //Because of the iteration plot at the end, we should have two more pages. build 12-Sep-2018 15:30:24 - String outFile2( outFile + "_Scan3,4,5,6_2.jpg"); build 12-Sep-2018 15:30:24 - String outFile3( outFile + "_Scan7_3.jpg"); build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile + ".jpg"); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tMultiplePlotTypes:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile1, 210000, 260000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tMultiplePlotTypes:: Result of first save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool okOutput2 = tUtil::checkFile( outFile2, 210000, 260000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tMultiplePlotTypes:: Result of second save file check=" << okOutput2 << endl; build 12-Sep-2018 15:30:24 - bool okOutput3 = tUtil::checkFile( outFile3, 54000, 68000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tMultiplePlotTypes:: Result of third save file check=" << okOutput3 << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput && okOutput2 && okOutput3; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile1); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile2); build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile3); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dOverIterationPlot.cc b/code/plotms/test/dOverIterationPlot.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index bac1712..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dOverIterationPlot.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,140 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether an overplot consisting of scan and field can be build 12-Sep-2018 15:30:24 - * iterated over antenna build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tOverIterationPlot using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make a 2x2 grid build 12-Sep-2018 15:30:24 - PlotMSParameters& overallParams = app.getParameters(); build 12-Sep-2018 15:30:24 - overallParams.setRowCount( 2 ); build 12-Sep-2018 15:30:24 - overallParams.setColCount( 2 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Cache and Axes build 12-Sep-2018 15:30:24 - PMS_PP_Cache* cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - PMS_PP_Axes* axesParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if(cacheParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if(axesParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - axesParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //The cache must have exactly as many x-axes as y-axes so we duplicate build 12-Sep-2018 15:30:24 - //the x-axis properties here. build 12-Sep-2018 15:30:24 - int yAxisCount = 2; build 12-Sep-2018 15:30:24 - PMS::Axis xAxis = PMS::TIME; build 12-Sep-2018 15:30:24 - for ( int i = 0; i < yAxisCount; i++ ){ build 12-Sep-2018 15:30:24 - cacheParams->setXAxis(xAxis, PMS::DATA, i); build 12-Sep-2018 15:30:24 - axesParams->setXAxis( X_BOTTOM, i); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PMS::Axis yAxis1 = PMS::SCAN; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis1, PMS::DATA, 0); build 12-Sep-2018 15:30:24 - axesParams->setYAxis( Y_LEFT, 0); build 12-Sep-2018 15:30:24 - PMS::Axis yAxis2 = PMS::FIELD; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis2, PMS::DATA, 1); build 12-Sep-2018 15:30:24 - axesParams->setYAxis(Y_LEFT, 1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We need to set a distinctive color for each set of data build 12-Sep-2018 15:30:24 - //so we can distinguish it. build 12-Sep-2018 15:30:24 - PMS_PP_Display* ppdisp = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdisp == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdisp = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PlotSymbolPtr ps = app.createSymbol ("diamond", 5, "00FF00", "mesh2", false ); build 12-Sep-2018 15:30:24 - ppdisp->setUnflaggedSymbol(ps, 0); build 12-Sep-2018 15:30:24 - PlotSymbolPtr ps2 = app.createSymbol ("diamond", 5, "0000FF", "mesh2", false ); build 12-Sep-2018 15:30:24 - ppdisp->setUnflaggedSymbol(ps2, 1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Now make it into an iteration plot over antenna. build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterationParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterationParams->setIterationAxis( PMS::ANTENNA ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotOverIterationTest"; build 12-Sep-2018 15:30:24 - String outFile1( outFile + "_Antenna1@VLA:N7,2@VLA:W1,3@VLA:W2,4@VLA:E1.jpg"); build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile + ".jpg" ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tOverIterationplot:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile1, 155000, 240000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tOverIterationplot:: Result of save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile1); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dOverLeftRightPlot.cc b/code/plotms/test/dOverLeftRightPlot.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index 2e9971a..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dOverLeftRightPlot.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,124 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether we can overplot field and scan for the test data with scan build 12-Sep-2018 15:30:24 - * using the left axis and field using the right axis. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tOverLeftRight using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Cache and Axes build 12-Sep-2018 15:30:24 - PMS_PP_Cache* cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - PMS_PP_Axes* axesParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if(cacheParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if(axesParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - axesParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //The cache must have exactly as many x-axes as y-axes so we duplicate build 12-Sep-2018 15:30:24 - //the x-axis properties here. build 12-Sep-2018 15:30:24 - int yAxisCount = 2; build 12-Sep-2018 15:30:24 - PMS::Axis xAxis = PMS::TIME; build 12-Sep-2018 15:30:24 - for ( int i = 0; i < yAxisCount; i++ ){ build 12-Sep-2018 15:30:24 - cacheParams->setXAxis(xAxis, PMS::DATA, i); build 12-Sep-2018 15:30:24 - axesParams->setXAxis( X_BOTTOM, i); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PMS::Axis yAxis1 = PMS::SCAN; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis1, PMS::DATA, 0); build 12-Sep-2018 15:30:24 - axesParams->setYAxis( Y_LEFT, 0); build 12-Sep-2018 15:30:24 - PMS::Axis yAxis2 = PMS::FIELD; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis2, PMS::DATA, 1); build 12-Sep-2018 15:30:24 - axesParams->setYAxis(Y_RIGHT, 1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We need to set a distinctive color for each set of data build 12-Sep-2018 15:30:24 - //so we can distinguish it. build 12-Sep-2018 15:30:24 - PMS_PP_Display* ppdisp = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdisp == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdisp = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PlotSymbolPtr ps = app.createSymbol ("diamond", 5, "00FF00", "mesh2", false ); build 12-Sep-2018 15:30:24 - ppdisp->setUnflaggedSymbol(ps, 0); build 12-Sep-2018 15:30:24 - PlotSymbolPtr ps2 = app.createSymbol ("diamond", 5, "0000FF", "mesh2", false ); build 12-Sep-2018 15:30:24 - ppdisp->setUnflaggedSymbol(ps2, 1); build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotMSOverLeftRightTest.jpg"; build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tOverLeftRight:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile, 60000, 95000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tOverLeftRight:: Result of save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dOverPlot.cc b/code/plotms/test/dOverPlot.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index c3b1b80..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dOverPlot.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,124 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether we can overplot field and scan for the test data with both build 12-Sep-2018 15:30:24 - * plots using a left axis. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tOverPlot using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Cache and Axes build 12-Sep-2018 15:30:24 - PMS_PP_Cache* cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - PMS_PP_Axes* axesParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if(cacheParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if(axesParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - axesParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //The cache must have exactly as many x-axes as y-axes so we duplicate build 12-Sep-2018 15:30:24 - //the x-axis properties here. build 12-Sep-2018 15:30:24 - int yAxisCount = 2; build 12-Sep-2018 15:30:24 - PMS::Axis xAxis = PMS::TIME; build 12-Sep-2018 15:30:24 - for ( int i = 0; i < yAxisCount; i++ ){ build 12-Sep-2018 15:30:24 - cacheParams->setXAxis(xAxis, PMS::DATA, i); build 12-Sep-2018 15:30:24 - axesParams->setXAxis( X_BOTTOM, i); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PMS::Axis yAxis1 = PMS::SCAN; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis1, PMS::DATA, 0); build 12-Sep-2018 15:30:24 - axesParams->setYAxis( Y_LEFT, 0); build 12-Sep-2018 15:30:24 - PMS::Axis yAxis2 = PMS::FIELD; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis2, PMS::DATA, 1); build 12-Sep-2018 15:30:24 - axesParams->setYAxis(Y_LEFT, 1); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We need to set a distinctive color for each set of data build 12-Sep-2018 15:30:24 - //so we can distinguish it. build 12-Sep-2018 15:30:24 - PMS_PP_Display* ppdisp = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdisp == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdisp = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PlotSymbolPtr ps = app.createSymbol ("diamond", 5, "00FF00", "mesh2", false ); build 12-Sep-2018 15:30:24 - ppdisp->setUnflaggedSymbol(ps, 0); build 12-Sep-2018 15:30:24 - PlotSymbolPtr ps2 = app.createSymbol ("diamond", 5, "0000FF", "mesh2", false ); build 12-Sep-2018 15:30:24 - ppdisp->setUnflaggedSymbol(ps2, 1); build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotMSOverplotTest.jpg"; build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tOverplot:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile, 55000, 85000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tOverplot:: Result of save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dOverPlot2Files.cc b/code/plotms/test/dOverPlot2Files.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index 6db1843..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dOverPlot2Files.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,141 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether we can overplot two different plots. One plot will be build 12-Sep-2018 15:30:24 - * scan x time and the other will be field x time. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath = tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - qDebug() << "tOverPlot2FilesTest using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Cache and Axes build 12-Sep-2018 15:30:24 - PMS_PP_Cache* cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - PMS_PP_Axes* axesParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if(cacheParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if(axesParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - axesParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set up the axes based on which plot it is. build 12-Sep-2018 15:30:24 - PMS::Axis xAxis = PMS::TIME; build 12-Sep-2018 15:30:24 - cacheParams->setXAxis(xAxis, PMS::DATA, 0); build 12-Sep-2018 15:30:24 - axesParams->setXAxis( X_BOTTOM, 0); build 12-Sep-2018 15:30:24 - if ( i == 0 ){ build 12-Sep-2018 15:30:24 - PMS::Axis yAxis1 = PMS::SCAN; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis1, PMS::DATA, 0); build 12-Sep-2018 15:30:24 - axesParams->setYAxis( Y_LEFT, 0); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - PMS::Axis yAxis2 = PMS::FIELD; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis2, PMS::DATA, 0); build 12-Sep-2018 15:30:24 - axesParams->setYAxis(Y_LEFT, 0); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //We need to set a distinctive color for each set of data build 12-Sep-2018 15:30:24 - //so we can distinguish it. build 12-Sep-2018 15:30:24 - PMS_PP_Display* ppdisp = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (ppdisp == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdisp = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if ( i == 0 ){ build 12-Sep-2018 15:30:24 - PlotSymbolPtr ps = app.createSymbol ("diamond", 5, "00FF00", "mesh2", false ); build 12-Sep-2018 15:30:24 - ppdisp->setUnflaggedSymbol(ps, 0); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - else { build 12-Sep-2018 15:30:24 - PlotSymbolPtr ps2 = app.createSymbol ("diamond", 5, "0000FF", "mesh2", false ); build 12-Sep-2018 15:30:24 - ppdisp->setUnflaggedSymbol(ps2, 0); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Change the data index based on the plot, but put them in the same build 12-Sep-2018 15:30:24 - //location of the grid. build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if (iterParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterParams->setGridRow(0); build 12-Sep-2018 15:30:24 - iterParams->setGridCol(0); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - qDebug()<<"Test adding plot "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - PlotSymbolPtr ps = app.createSymbol ("diamond", 10, "00FF00", "mesh2", false ); build 12-Sep-2018 15:30:24 - cout << "Created symbol type="<symbol()<(); build 12-Sep-2018 15:30:24 - if (ppdisp == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdisp = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdisp->setUnflaggedSymbol(ps); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - tUtil::updatePlot(&app); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Now save it and check the file size. build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotMSSymbolTest.jpg"; build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tSymbol:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile, 200000, 220000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tSymbol:: Result of save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dTimeAveragingIteration.cc b/code/plotms/test/dTimeAveragingIteration.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index 19554f4..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dTimeAveragingIteration.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,116 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether a elevation/amp plot can be iterated with respect to time. build 12-Sep-2018 15:30:24 - * Here we are averaging time. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath= tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tTimeAveragingIteration using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set time averaging of 100000 seconds. build 12-Sep-2018 15:30:24 - PlotMSAveraging averaging; build 12-Sep-2018 15:30:24 - averaging.setTime( true ); build 12-Sep-2018 15:30:24 - averaging.setTimeValue( 3600 ); build 12-Sep-2018 15:30:24 - ppdata->setAveraging( averaging ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make a 2x2 grid build 12-Sep-2018 15:30:24 - PlotMSParameters& overallParams = app.getParameters(); build 12-Sep-2018 15:30:24 - overallParams.setRowCount( 1 ); build 12-Sep-2018 15:30:24 - overallParams.setColCount( 2 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set-up a elevation x amp plot build 12-Sep-2018 15:30:24 - PMS_PP_Cache* cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if(cacheParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PMS::Axis xAxis = PMS::EL0; build 12-Sep-2018 15:30:24 - cacheParams->setXAxis(xAxis, PMS::DATA); build 12-Sep-2018 15:30:24 - PMS::Axis yAxis = PMS::AMP; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis, PMS::DATA); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set-up iteration with respect to time. build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterationParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterationParams->setIterationAxis( PMS::TIME ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Add the plot build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotTimeAveragingIterationTest"; build 12-Sep-2018 15:30:24 - String outFile1( outFile + "_Time09:21:44.9994 - 09:50:44.9995,09:50:44.9995 - 10:46:15.0001.jpg"); build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile + ".jpg" ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tTimeAveragingIteration:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile1, 70000, 140000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tTimeAveragingIteration:: Result of save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile1); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dTimeColorization.cc b/code/plotms/test/dTimeColorization.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index cdd05f8..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dTimeColorization.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,103 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether a elevation/amp plot can be colorized with respect to time. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath= tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tTimeColorization using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set-up a elevation x amp plot build 12-Sep-2018 15:30:24 - PMS_PP_Cache* cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if(cacheParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PMS::Axis xAxis = PMS::EL0; build 12-Sep-2018 15:30:24 - cacheParams->setXAxis(xAxis, PMS::DATA); build 12-Sep-2018 15:30:24 - PMS::Axis yAxis = PMS::AMP; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis, PMS::DATA); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set-up colorization with respect to time. build 12-Sep-2018 15:30:24 - PMS_PP_Display* displayParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( displayParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - displayParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - displayParams->setColorize( true, PMS::TIME ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Add the plot build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotTimeColorizationTest.jpg"; build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tTimeColorization:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile, 170000, 185000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tTimeColorization:: Result of save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dTimeColorizationAveraging.cc b/code/plotms/test/dTimeColorizationAveraging.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index ea97c6f..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dTimeColorizationAveraging.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,109 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether a elevation/amp plot can be colorized with respect to averaged time. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath= tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tTimeColorizationAveraging using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set time averaging of 3600 seconds. build 12-Sep-2018 15:30:24 - PlotMSAveraging averaging; build 12-Sep-2018 15:30:24 - averaging.setTime( true ); build 12-Sep-2018 15:30:24 - averaging.setTimeValue( 3600 ); build 12-Sep-2018 15:30:24 - ppdata->setAveraging( averaging ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set-up a elevation x amp plot build 12-Sep-2018 15:30:24 - PMS_PP_Cache* cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if(cacheParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PMS::Axis xAxis = PMS::EL0; build 12-Sep-2018 15:30:24 - cacheParams->setXAxis(xAxis, PMS::DATA); build 12-Sep-2018 15:30:24 - PMS::Axis yAxis = PMS::AMP; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis, PMS::DATA); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set-up colorization with respect to time. build 12-Sep-2018 15:30:24 - PMS_PP_Display* displayParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( displayParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - displayParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - displayParams->setColorize( true, PMS::TIME ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Add the plot build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotTimeColorAverageTest.jpg"; build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile ); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tTimeColorizationAveraging:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile, 50000, 75000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tTimeColorizationAveraging:: Result of save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/dTimeIteration.cc b/code/plotms/test/dTimeIteration.cc build 12-Sep-2018 15:30:24 deleted file mode 100644 build 12-Sep-2018 15:30:24 index 9da6c6e..0000000 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/dTimeIteration.cc build 12-Sep-2018 15:30:24 +++ /dev/null build 12-Sep-2018 15:30:24 @@ -1,110 +0,0 @@ build 12-Sep-2018 15:30:24 -//# Copyright (C) 2008 build 12-Sep-2018 15:30:24 -//# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:24 -//# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:24 -//# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:24 -//# option) any later version. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:24 -//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:24 -//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:24 -//# License for more details. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:24 -//# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:24 -//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# Correspondence concerning AIPS++ should be addressed as follows: build 12-Sep-2018 15:30:24 -//# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:24 -//# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:24 -//# National Radio Astronomy Observatory build 12-Sep-2018 15:30:24 -//# 520 Edgemont Road build 12-Sep-2018 15:30:24 -//# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# build 12-Sep-2018 15:30:24 -//# $Id$ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -/** build 12-Sep-2018 15:30:24 - * Tests whether a elevation/amp plot can be iterated with respect to time. build 12-Sep-2018 15:30:24 - * Here, we are not averaging so there should be a single point per time iteration. build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 -int main(int /*argc*/, char** /*argv[]*/) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String dataPath= tUtil::getFullPath( "pm_ngc5921.ms" ); build 12-Sep-2018 15:30:24 - cout << "tTimeIteration using data from "<(); build 12-Sep-2018 15:30:24 - if (ppdata == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - ppdata = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - ppdata->setFilename( dataPath ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Make a 2x2 grid build 12-Sep-2018 15:30:24 - PlotMSParameters& overallParams = app.getParameters(); build 12-Sep-2018 15:30:24 - overallParams.setRowCount( 2 ); build 12-Sep-2018 15:30:24 - overallParams.setColCount( 2 ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set-up a elevation x amp plot build 12-Sep-2018 15:30:24 - PMS_PP_Cache* cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if(cacheParams == NULL) { build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - cacheParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - PMS::Axis xAxis = PMS::EL0; build 12-Sep-2018 15:30:24 - cacheParams->setXAxis(xAxis, PMS::DATA); build 12-Sep-2018 15:30:24 - PMS::Axis yAxis = PMS::AMP; build 12-Sep-2018 15:30:24 - cacheParams->setYAxis(yAxis, PMS::DATA); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Set-up iteration with respect to time. build 12-Sep-2018 15:30:24 - PMS_PP_Iteration* iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - if ( iterationParams == NULL ){ build 12-Sep-2018 15:30:24 - plotParams.setGroup(); build 12-Sep-2018 15:30:24 - iterationParams = plotParams.typedGroup(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - iterationParams->setIterationAxis( PMS::TIME ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - //Add the plot build 12-Sep-2018 15:30:24 - app.addOverPlot( &plotParams ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String outFile = exportPath + "plotTimeIterationTest"; build 12-Sep-2018 15:30:24 - String outFile1( outFile + "_Time09:18:59.9998,09:19:30.0002,09:20:00.0006,09:20:30.0010.jpg"); build 12-Sep-2018 15:30:24 - PlotExportFormat::Type type = PlotExportFormat::JPG; build 12-Sep-2018 15:30:24 - PlotExportFormat format(type, outFile + ".jpg"); build 12-Sep-2018 15:30:24 - format.resolution = PlotExportFormat::SCREEN; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool ok = app.save(format); build 12-Sep-2018 15:30:24 - cout << "tTimeIteration:: Result of save=" << ok << endl; build 12-Sep-2018 15:30:24 - bool okOutput = tUtil::checkFile( outFile1, 110000, 190000, -1 ); build 12-Sep-2018 15:30:24 - cout << "tTimeIteration:: Result of save file check=" << okOutput << endl; build 12-Sep-2018 15:30:24 - bool test = ok && okOutput; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // clean up build 12-Sep-2018 15:30:24 - tUtil::clearFile(outFile1); build 12-Sep-2018 15:30:24 - tUtil::clearFile(exportPath); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - bool checkGui = tUtil::exitMain( false ); build 12-Sep-2018 15:30:24 - return !(test && checkGui); build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 diff --git a/code/plotms/test/tUtil.h b/code/plotms/test/tUtil.h build 12-Sep-2018 15:30:24 index a79dcee..0acbf3a 100644 build 12-Sep-2018 15:30:24 --- a/code/plotms/test/tUtil.h build 12-Sep-2018 15:30:24 +++ b/code/plotms/test/tUtil.h build 12-Sep-2018 15:30:24 @@ -22,7 +22,11 @@ build 12-Sep-2018 15:30:24 //# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:24 //# build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -36,7 +40,7 @@ build 12-Sep-2018 15:30:24 namespace casa { build 12-Sep-2018 15:30:24 class tUtil { build 12-Sep-2018 15:30:24 public: build 12-Sep-2018 15:30:24 - static casacore::String getFullPath( casacore::String fileName ){ build 12-Sep-2018 15:30:24 + static casacore::String getFullPath( casacore::String fileName, casacore::String directory="plotms" ){ build 12-Sep-2018 15:30:24 //casacore::Path for data build 12-Sep-2018 15:30:24 casacore::String aipsPath = casacore::EnvironmentVariable::get("CASAPATH"); build 12-Sep-2018 15:30:24 if (aipsPath.empty()) { build 12-Sep-2018 15:30:24 @@ -54,7 +58,9 @@ public: build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 dataPath = aipsPath; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - dataPath.append( "/data/regression/unittest/plotms/" ); build 12-Sep-2018 15:30:24 + dataPath.append( "/data/regression/unittest/"); build 12-Sep-2018 15:30:24 + dataPath.append( directory ); build 12-Sep-2018 15:30:24 + dataPath.append( "/" ); build 12-Sep-2018 15:30:24 qDebug() << "Datapath="< arr1, build 12-Sep-2018 15:30:24 + const casacore::Array arr2) { build 12-Sep-2018 15:30:24 + // compare elements of a divided array, in which some elements may be build 12-Sep-2018 15:30:24 + // nan or inf (after divide by 0) build 12-Sep-2018 15:30:24 + casacore::IPosition arr1shape(arr1.shape()), arr2shape(arr2.shape()); build 12-Sep-2018 15:30:24 + bool equal(arr1shape==arr2shape); build 12-Sep-2018 15:30:24 + if (equal) { // so far so good build 12-Sep-2018 15:30:24 + casacore::uInt ndata = arr1.nelements(); build 12-Sep-2018 15:30:24 + casacore::Vector vec1 = build 12-Sep-2018 15:30:24 + arr1.reform(casacore::IPosition(1, ndata)); build 12-Sep-2018 15:30:24 + casacore::Vector vec2 = build 12-Sep-2018 15:30:24 + arr2.reform(casacore::IPosition(1, ndata)); build 12-Sep-2018 15:30:24 + // element-by-element comparison build 12-Sep-2018 15:30:24 + for (casacore::uInt i=0; i getWtAmp( build 12-Sep-2018 15:30:24 + const casacore::Array& wt, build 12-Sep-2018 15:30:24 + const casacore::Array& amp) { build 12-Sep-2018 15:30:24 + // apply per-corr wt to each row build 12-Sep-2018 15:30:24 + casacore::Array wtamp(amp.shape()); build 12-Sep-2018 15:30:24 + casacore::uInt nrow(wtamp.shape()(2)), ncorr(2); build 12-Sep-2018 15:30:24 + for (casacore::uInt row=0; row& sigmasp, build 12-Sep-2018 15:30:24 + Array& sigma, Int nchan) { build 12-Sep-2018 15:30:24 + // add channel axis to [ncorr,nrow] sigma array build 12-Sep-2018 15:30:24 + casacore::IPosition sigmashape = sigma.shape(); build 12-Sep-2018 15:30:24 + casacore::uInt ncorr(sigmashape(0)), nrow(sigmashape(1)); build 12-Sep-2018 15:30:24 + sigmasp.resize(IPosition(3, ncorr, nchan, nrow)); build 12-Sep-2018 15:30:24 + for (uInt row=0; row direction0(2, 2, 0.0); build 12-Sep-2018 15:30:24 @@ -801,7 +825,9 @@ Bool NRO2MSReader::getData(size_t irow, DataRecord &record) { build 12-Sep-2018 15:30:24 throw AipsError("Internal Data ERROR: inconsistent ARRAY information in scan header"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - record.time = getIntMiddleTimeSec(scan_data); build 12-Sep-2018 15:30:24 + // 2018/05/30 TN build 12-Sep-2018 15:30:24 + // CAS-11223 build 12-Sep-2018 15:30:24 + record.time = jst2utcSec(getIntMiddleTimeSec(scan_data)); build 12-Sep-2018 15:30:24 record.interval = obs_header_.IPTIM0; build 12-Sep-2018 15:30:24 // std::cout << "TIME=" << record.time << " INTERVAL=" << record.interval build 12-Sep-2018 15:30:24 // << std::endl; build 12-Sep-2018 15:30:24 diff --git a/code/singledishfiller/Filler/NRO2MSReader.h b/code/singledishfiller/Filler/NRO2MSReader.h build 12-Sep-2018 15:30:24 index 7bda8c1..a2c8270 100644 build 12-Sep-2018 15:30:24 --- a/code/singledishfiller/Filler/NRO2MSReader.h build 12-Sep-2018 15:30:24 +++ b/code/singledishfiller/Filler/NRO2MSReader.h build 12-Sep-2018 15:30:24 @@ -11,6 +11,9 @@ build 12-Sep-2018 15:30:24 #define STRING2CHAR(s) const_cast((s).c_str()) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -21,11 +24,13 @@ using namespace std; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -constexpr double kDay2Sec = 86400.0; build 12-Sep-2018 15:30:24 -constexpr double kSec2Day = 1.0 / kDay2Sec; build 12-Sep-2018 15:30:24 +// forward declaration build 12-Sep-2018 15:30:24 +class NROOptionalTables; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 class NRO2MSReader: public ReaderInterface { build 12-Sep-2018 15:30:24 public: build 12-Sep-2018 15:30:24 + typedef NROOptionalTables OptionalTables; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 NRO2MSReader(std::string const &scantable_name); build 12-Sep-2018 15:30:24 virtual ~NRO2MSReader(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -93,32 +98,32 @@ public: build 12-Sep-2018 15:30:24 // for DataAccumulator build 12-Sep-2018 15:30:24 virtual casacore::Bool getData(size_t irow, sdfiller::DataRecord &record); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - virtual int getNROArraySize() { build 12-Sep-2018 15:30:24 + virtual int getNROArraySize() const { build 12-Sep-2018 15:30:24 // return obs_header_.ARYNM0; //obs_header_.NBEAM * obs_header_.NPOL * obs_header_.NSPWIN; build 12-Sep-2018 15:30:24 return NRO_ARYMAX; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - virtual int getNRONumBeam() { build 12-Sep-2018 15:30:24 + virtual int getNRONumBeam() const { build 12-Sep-2018 15:30:24 return obs_header_.NBEAM; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - virtual int getNRONumPol() { build 12-Sep-2018 15:30:24 + virtual int getNRONumPol() const { build 12-Sep-2018 15:30:24 return obs_header_.NPOL; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - virtual int getNRONumSpw() { build 12-Sep-2018 15:30:24 + virtual int getNRONumSpw() const { build 12-Sep-2018 15:30:24 return obs_header_.NSPWIN; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - virtual bool isNROArrayUsed(int array_id) { build 12-Sep-2018 15:30:24 + virtual bool isNROArrayUsed(int array_id) const { build 12-Sep-2018 15:30:24 return array_mapper_[array_id].isUsed(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - virtual int getNROArrayBeamId(int array_id) { build 12-Sep-2018 15:30:24 + virtual int getNROArrayBeamId(int array_id) const { build 12-Sep-2018 15:30:24 // assert(array_id >= 0 && array_id < getNROArraySize()); build 12-Sep-2018 15:30:24 return array_mapper_[array_id].getBeamId(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - virtual casacore::Stokes::StokesTypes getNROArrayPol(int array_id) { build 12-Sep-2018 15:30:24 + virtual casacore::Stokes::StokesTypes getNROArrayPol(int array_id) const { build 12-Sep-2018 15:30:24 // assert(array_id >= 0 && array_id < getNROArraySize()); build 12-Sep-2018 15:30:24 return array_mapper_[array_id].getPol(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - virtual int getNROArraySpwId(int array_id) { build 12-Sep-2018 15:30:24 + virtual int getNROArraySpwId(int array_id) const { build 12-Sep-2018 15:30:24 // assert(array_id >= 0 && array_id < getNROArraySize()); build 12-Sep-2018 15:30:24 return array_mapper_[array_id].getSpwId(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -281,6 +286,49 @@ private: build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +// OptionalTables class for NRO data build 12-Sep-2018 15:30:24 +class NROOptionalTables { build 12-Sep-2018 15:30:24 +public: build 12-Sep-2018 15:30:24 + static void Generate(casacore::Table &table, NRO2MSReader const &reader) { build 12-Sep-2018 15:30:24 + // generate NRO_ARRAY table build 12-Sep-2018 15:30:24 + Generate_NRO_ARRAY(table, reader); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +private: build 12-Sep-2018 15:30:24 + static void Generate_NRO_ARRAY(casacore::Table &table, NRO2MSReader const &reader) { build 12-Sep-2018 15:30:24 + casacore::String const nro_tablename = "NRO_ARRAY"; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + casacore::TableDesc td(nro_tablename, casacore::TableDesc::Scratch); build 12-Sep-2018 15:30:24 + td.addColumn(casacore::ScalarColumnDesc("ARRAY")); build 12-Sep-2018 15:30:24 + td.addColumn(casacore::ScalarColumnDesc("BEAM")); build 12-Sep-2018 15:30:24 + td.addColumn(casacore::ScalarColumnDesc("POLARIZATION")); build 12-Sep-2018 15:30:24 + td.addColumn(casacore::ScalarColumnDesc("SPECTRAL_WINDOW")); build 12-Sep-2018 15:30:24 + casacore::String tabname = table.tableName() + "/" + nro_tablename; build 12-Sep-2018 15:30:24 + casacore::SetupNewTable newtab(tabname, td, casacore::Table::Scratch); build 12-Sep-2018 15:30:24 + table.rwKeywordSet().defineTable(nro_tablename, build 12-Sep-2018 15:30:24 + casacore::Table(newtab, reader.getNROArraySize())); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + casacore::Table nro_table = table.rwKeywordSet().asTable(nro_tablename); build 12-Sep-2018 15:30:24 + casacore::ScalarColumn arr(nro_table, "ARRAY"); build 12-Sep-2018 15:30:24 + casacore::ScalarColumn bea(nro_table, "BEAM"); build 12-Sep-2018 15:30:24 + casacore::ScalarColumn pol(nro_table, "POLARIZATION"); build 12-Sep-2018 15:30:24 + casacore::ScalarColumn spw(nro_table, "SPECTRAL_WINDOW"); build 12-Sep-2018 15:30:24 + for (int iarr = 0; iarr < reader.getNROArraySize(); ++iarr) { build 12-Sep-2018 15:30:24 + arr.put(iarr, iarr); build 12-Sep-2018 15:30:24 + if (reader.isNROArrayUsed(iarr)) { build 12-Sep-2018 15:30:24 + bea.put(iarr, reader.getNROArrayBeamId(iarr)); build 12-Sep-2018 15:30:24 + pol.put(iarr, reader.getNROArrayPol(iarr)); build 12-Sep-2018 15:30:24 + spw.put(iarr, reader.getNROArraySpwId(iarr)); build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + // array is not used, fill with -1 build 12-Sep-2018 15:30:24 + bea.put(iarr, -1); build 12-Sep-2018 15:30:24 + pol.put(iarr, -1); build 12-Sep-2018 15:30:24 + spw.put(iarr, -1); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 } //# NAMESPACE CASA - END build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #endif /* SINGLEDISH_FILLER_NRO2MSREADER_H_ */ build 12-Sep-2018 15:30:24 diff --git a/code/singledishfiller/Filler/ReaderInterface.h b/code/singledishfiller/Filler/ReaderInterface.h build 12-Sep-2018 15:30:24 index d6815d1..1491910 100644 build 12-Sep-2018 15:30:24 --- a/code/singledishfiller/Filler/ReaderInterface.h build 12-Sep-2018 15:30:24 +++ b/code/singledishfiller/Filler/ReaderInterface.h build 12-Sep-2018 15:30:24 @@ -15,6 +15,10 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -26,6 +30,9 @@ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +// forward declaration build 12-Sep-2018 15:30:24 +template class NullOptionalTables; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // NonCopyable Mixin (CRTP) build 12-Sep-2018 15:30:24 template build 12-Sep-2018 15:30:24 class NonCopyable { build 12-Sep-2018 15:30:24 @@ -43,8 +50,10 @@ private: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 class ReaderInterface: private NonCopyable { build 12-Sep-2018 15:30:24 public: build 12-Sep-2018 15:30:24 - ReaderInterface(std::string const &name, bool const is_nro = false) : build 12-Sep-2018 15:30:24 - name_(name), is_nro_(is_nro) { build 12-Sep-2018 15:30:24 + typedef NullOptionalTables OptionalTables; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ReaderInterface(std::string const &name) : build 12-Sep-2018 15:30:24 + name_(name) { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 virtual ~ReaderInterface() { build 12-Sep-2018 15:30:24 @@ -54,10 +63,6 @@ public: build 12-Sep-2018 15:30:24 return name_; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - bool isNROData() { build 12-Sep-2018 15:30:24 - return is_nro_; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 virtual casacore::String getDataUnit() const { build 12-Sep-2018 15:30:24 return ""; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -147,7 +152,6 @@ protected: build 12-Sep-2018 15:30:24 virtual void finalizeSpecific() = 0; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 std::string const name_; build 12-Sep-2018 15:30:24 - bool const is_nro_; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 private: build 12-Sep-2018 15:30:24 // common initialization/finalization actions build 12-Sep-2018 15:30:24 @@ -157,6 +161,15 @@ private: build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +// empty OptionalTables class build 12-Sep-2018 15:30:24 +template build 12-Sep-2018 15:30:24 +class NullOptionalTables { build 12-Sep-2018 15:30:24 +public: build 12-Sep-2018 15:30:24 + static void Generate(casacore::Table &/*table*/, Reader const &/*reader*/) { build 12-Sep-2018 15:30:24 + //std::cout << "This is default. NullOptionalTables::Generate" << std::endl; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 } //# NAMESPACE CASA - END build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #endif /* SINGLEDISH_FILLER_READERINTERFACE_H_ */ build 12-Sep-2018 15:30:24 diff --git a/code/singledishfiller/Filler/SingleDishMSFiller.h b/code/singledishfiller/Filler/SingleDishMSFiller.h build 12-Sep-2018 15:30:24 index 737ab8d..1040a55 100644 build 12-Sep-2018 15:30:24 --- a/code/singledishfiller/Filler/SingleDishMSFiller.h build 12-Sep-2018 15:30:24 +++ b/code/singledishfiller/Filler/SingleDishMSFiller.h build 12-Sep-2018 15:30:24 @@ -120,9 +120,6 @@ private: build 12-Sep-2018 15:30:24 // fill HISTORY table build 12-Sep-2018 15:30:24 void fillHistory(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // add and fill NRO_ARRAY table (specific for NRO data) build 12-Sep-2018 15:30:24 - void fillNROArray(); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // update POLARIZATION table build 12-Sep-2018 15:30:24 // @param[in] corr_type polarization type list build 12-Sep-2018 15:30:24 // @param[in] num_pol number of polarization components build 12-Sep-2018 15:30:24 diff --git a/code/singledishfiller/Filler/SingleDishMSFiller.tcc b/code/singledishfiller/Filler/SingleDishMSFiller.tcc build 12-Sep-2018 15:30:24 index 1a0ff27..f38c420 100644 build 12-Sep-2018 15:30:24 --- a/code/singledishfiller/Filler/SingleDishMSFiller.tcc build 12-Sep-2018 15:30:24 +++ b/code/singledishfiller/Filler/SingleDishMSFiller.tcc build 12-Sep-2018 15:30:24 @@ -665,11 +665,9 @@ void SingleDishMSFiller::fillPreProcessTables() { build 12-Sep-2018 15:30:24 // fill SPECTRAL_WINDOW table build 12-Sep-2018 15:30:24 fillSpectralWindow(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Add and fill NRO_ARRAY table (only for NRO data) build 12-Sep-2018 15:30:24 - if (reader_->isNROData()) { build 12-Sep-2018 15:30:24 - fillNROArray(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + // Generate optional tables if necessary build 12-Sep-2018 15:30:24 + T::OptionalTables::Generate(*ms_, *reader_); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 POST_END; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -821,43 +819,6 @@ void SingleDishMSFiller::fillSpectralWindow() { build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 template build 12-Sep-2018 15:30:24 -void SingleDishMSFiller::fillNROArray() { build 12-Sep-2018 15:30:24 - POST_START; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String const nro_tablename = "NRO_ARRAY"; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - casacore::TableDesc td(nro_tablename, TableDesc::Scratch); build 12-Sep-2018 15:30:24 - td.addColumn(ScalarColumnDesc("ARRAY")); build 12-Sep-2018 15:30:24 - td.addColumn(ScalarColumnDesc("BEAM")); build 12-Sep-2018 15:30:24 - td.addColumn(ScalarColumnDesc("POLARIZATION")); build 12-Sep-2018 15:30:24 - td.addColumn(ScalarColumnDesc("SPECTRAL_WINDOW")); build 12-Sep-2018 15:30:24 - casacore::String tabname = ms_->tableName() + "/" + nro_tablename; build 12-Sep-2018 15:30:24 - casacore::SetupNewTable newtab(tabname, td, Table::Scratch); build 12-Sep-2018 15:30:24 - ms_->rwKeywordSet().defineTable(nro_tablename, Table(newtab, reader_->getNROArraySize())); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - casacore::Table nro_table = ms_->rwKeywordSet().asTable(nro_tablename); build 12-Sep-2018 15:30:24 - casacore::ScalarColumn arr(nro_table, "ARRAY"); build 12-Sep-2018 15:30:24 - casacore::ScalarColumn bea(nro_table, "BEAM"); build 12-Sep-2018 15:30:24 - casacore::ScalarColumn pol(nro_table, "POLARIZATION"); build 12-Sep-2018 15:30:24 - casacore:: ScalarColumn spw(nro_table, "SPECTRAL_WINDOW"); build 12-Sep-2018 15:30:24 - for (int iarr = 0; iarr < reader_->getNROArraySize(); ++iarr) { build 12-Sep-2018 15:30:24 - arr.put(iarr, iarr); build 12-Sep-2018 15:30:24 - if (reader_->isNROArrayUsed(iarr)) { build 12-Sep-2018 15:30:24 - bea.put(iarr, reader_->getNROArrayBeamId(iarr)); build 12-Sep-2018 15:30:24 - pol.put(iarr, reader_->getNROArrayPol(iarr)); build 12-Sep-2018 15:30:24 - spw.put(iarr, reader_->getNROArraySpwId(iarr)); build 12-Sep-2018 15:30:24 - } else { build 12-Sep-2018 15:30:24 - // array is not used, fill with -1 build 12-Sep-2018 15:30:24 - bea.put(iarr, -1); build 12-Sep-2018 15:30:24 - pol.put(iarr, -1); build 12-Sep-2018 15:30:24 - spw.put(iarr, -1); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - POST_END; build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -template build 12-Sep-2018 15:30:24 casacore::Int SingleDishMSFiller::updatePolarization(casacore::Vector const &corr_type, build 12-Sep-2018 15:30:24 casacore::Int const &num_pol) { build 12-Sep-2018 15:30:24 casacore::uInt num_corr = corr_type.size(); build 12-Sep-2018 15:30:24 diff --git a/code/stdcasa/CMakeLists.txt b/code/stdcasa/CMakeLists.txt build 12-Sep-2018 15:30:24 index 8756bac..17c6981 100644 build 12-Sep-2018 15:30:24 --- a/code/stdcasa/CMakeLists.txt build 12-Sep-2018 15:30:24 +++ b/code/stdcasa/CMakeLists.txt build 12-Sep-2018 15:30:24 @@ -52,6 +52,7 @@ install (FILES build 12-Sep-2018 15:30:24 variant.h build 12-Sep-2018 15:30:24 casac.h build 12-Sep-2018 15:30:24 version.h build 12-Sep-2018 15:30:24 + optionparser.h build 12-Sep-2018 15:30:24 DESTINATION include/casacode/stdcasa build 12-Sep-2018 15:30:24 ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/stdcasa/StdCasa/variant.cc b/code/stdcasa/StdCasa/variant.cc build 12-Sep-2018 15:30:24 index c529bb4..377a7b4 100644 build 12-Sep-2018 15:30:24 --- a/code/stdcasa/StdCasa/variant.cc build 12-Sep-2018 15:30:24 +++ b/code/stdcasa/StdCasa/variant.cc build 12-Sep-2018 15:30:24 @@ -1,3 +1,5 @@ build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -1556,8 +1558,8 @@ void variant::as( TYPE t, int size ) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #define GETIT(CONST,CONST2,RET_TYPE,NAME,TYPE,VAL,DEREF) \ build 12-Sep-2018 15:30:24 CONST RET_TYPE variant::NAME( ) CONST2 throw(error) { \ build 12-Sep-2018 15:30:24 - if ( typev != TYPE ) \ build 12-Sep-2018 15:30:24 - throw( create_message( #NAME " called for type") ); \ build 12-Sep-2018 15:30:24 + if ( typev != TYPE ) \ build 12-Sep-2018 15:30:24 + ThrowCc( create_message( #NAME " called for type") ); \ build 12-Sep-2018 15:30:24 return DEREF val.VAL; \ build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/stdcasa/optionparser.h b/code/stdcasa/optionparser.h build 12-Sep-2018 15:30:24 new file mode 100644 build 12-Sep-2018 15:30:24 index 0000000..186d12d build 12-Sep-2018 15:30:24 --- /dev/null build 12-Sep-2018 15:30:24 +++ b/code/stdcasa/optionparser.h build 12-Sep-2018 15:30:24 @@ -0,0 +1,2858 @@ build 12-Sep-2018 15:30:24 +/* build 12-Sep-2018 15:30:24 + * The Lean Mean C++ Option Parser build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Copyright (C) 2012-2017 Matthias S. Benkmann build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * The "Software" in the following 2 paragraphs refers to this file containing build 12-Sep-2018 15:30:24 + * the code to The Lean Mean C++ Option Parser. build 12-Sep-2018 15:30:24 + * The "Software" does NOT refer to any other files which you build 12-Sep-2018 15:30:24 + * may have received alongside this file (e.g. as part of a larger project that build 12-Sep-2018 15:30:24 + * incorporates The Lean Mean C++ Option Parser). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Permission is hereby granted, free of charge, to any person obtaining a copy build 12-Sep-2018 15:30:24 + * of this software, to deal in the Software without restriction, including build 12-Sep-2018 15:30:24 + * without limitation the rights to use, copy, modify, merge, publish, build 12-Sep-2018 15:30:24 + * distribute, sublicense, and/or sell copies of the Software, and to permit build 12-Sep-2018 15:30:24 + * persons to whom the Software is furnished to do so, subject to the following build 12-Sep-2018 15:30:24 + * conditions: build 12-Sep-2018 15:30:24 + * The above copyright notice and this permission notice shall be included in build 12-Sep-2018 15:30:24 + * all copies or substantial portions of the Software. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR build 12-Sep-2018 15:30:24 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, build 12-Sep-2018 15:30:24 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE build 12-Sep-2018 15:30:24 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER build 12-Sep-2018 15:30:24 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, build 12-Sep-2018 15:30:24 + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE build 12-Sep-2018 15:30:24 + * SOFTWARE. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/* build 12-Sep-2018 15:30:24 + * NOTE: It is recommended that you read the processed HTML doxygen documentation build 12-Sep-2018 15:30:24 + * rather than this source. If you don't know doxygen, it's like javadoc for C++. build 12-Sep-2018 15:30:24 + * If you don't want to install doxygen you can find a copy of the processed build 12-Sep-2018 15:30:24 + * documentation at build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * http://optionparser.sourceforge.net/ build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** build 12-Sep-2018 15:30:24 + * @file build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @brief This is the only file required to use The Lean Mean C++ Option Parser. build 12-Sep-2018 15:30:24 + * Just \#include it and you're set. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * The Lean Mean C++ Option Parser handles the program's command line arguments build 12-Sep-2018 15:30:24 + * (argc, argv). build 12-Sep-2018 15:30:24 + * It supports the short and long option formats of getopt(), getopt_long() build 12-Sep-2018 15:30:24 + * and getopt_long_only() but has a more convenient interface. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @par Feedback: build 12-Sep-2018 15:30:24 + * Send questions, bug reports, feature requests etc. to: optionparser-feedback(a)lists.sourceforge.net build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @par Highlights: build 12-Sep-2018 15:30:24 + *
      build 12-Sep-2018 15:30:24 + *
    • It is a header-only library. Just \#include "optionparser.h" and you're set. build 12-Sep-2018 15:30:24 + *
    • It is freestanding. There are no dependencies whatsoever, not even the build 12-Sep-2018 15:30:24 + * C or C++ standard library. build 12-Sep-2018 15:30:24 + *
    • It has a usage message formatter that supports column alignment and build 12-Sep-2018 15:30:24 + * line wrapping. This aids localization because it adapts to build 12-Sep-2018 15:30:24 + * translated strings that are shorter or longer (even if they contain build 12-Sep-2018 15:30:24 + * Asian wide characters). build 12-Sep-2018 15:30:24 + *
    • Unlike getopt() and derivatives it doesn't force you to loop through build 12-Sep-2018 15:30:24 + * options sequentially. Instead you can access options directly like this: build 12-Sep-2018 15:30:24 + *
        build 12-Sep-2018 15:30:24 + *
      • Test for presence of a switch in the argument vector: build 12-Sep-2018 15:30:24 + * @code if ( options[QUIET] ) ... @endcode build 12-Sep-2018 15:30:24 + *
      • Evaluate --enable-foo/--disable-foo pair where the last one used wins: build 12-Sep-2018 15:30:24 + * @code if ( options[FOO].last()->type() == DISABLE ) ... @endcode build 12-Sep-2018 15:30:24 + *
      • Cumulative option (-v verbose, -vv more verbose, -vvv even more verbose): build 12-Sep-2018 15:30:24 + * @code int verbosity = options[VERBOSE].count(); @endcode build 12-Sep-2018 15:30:24 + *
      • Iterate over all --file=<fname> arguments: build 12-Sep-2018 15:30:24 + * @code for (Option* opt = options[FILE]; opt; opt = opt->next()) build 12-Sep-2018 15:30:24 + * fname = opt->arg; ... @endcode build 12-Sep-2018 15:30:24 + *
      • If you really want to, you can still process all arguments in order: build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * for (int i = 0; i < p.optionsCount(); ++i) { build 12-Sep-2018 15:30:24 + * Option& opt = buffer[i]; build 12-Sep-2018 15:30:24 + * switch(opt.index()) { build 12-Sep-2018 15:30:24 + * case HELP: ... build 12-Sep-2018 15:30:24 + * case VERBOSE: ... build 12-Sep-2018 15:30:24 + * case FILE: fname = opt.arg; ... build 12-Sep-2018 15:30:24 + * case UNKNOWN: ... build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + *
      build 12-Sep-2018 15:30:24 + *
    @n build 12-Sep-2018 15:30:24 + * Despite these features the code size remains tiny. build 12-Sep-2018 15:30:24 + * It is smaller than uClibc's GNU getopt() and just a build 12-Sep-2018 15:30:24 + * couple 100 bytes larger than uClibc's SUSv3 getopt(). @n build 12-Sep-2018 15:30:24 + * (This does not include the usage formatter, of course. But you don't have to use that.) build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @par Download: build 12-Sep-2018 15:30:24 + * Tarball with examples and test programs: build 12-Sep-2018 15:30:24 + * optionparser-1.7.tar.gz @n build 12-Sep-2018 15:30:24 + * Just the header (this is all you really need): build 12-Sep-2018 15:30:24 + * optionparser.h build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @par Changelog: build 12-Sep-2018 15:30:24 + * Version 1.7: Work on const-correctness. @n build 12-Sep-2018 15:30:24 + * Version 1.6: Fix for MSC compiler. @n build 12-Sep-2018 15:30:24 + * Version 1.5: Fixed 2 warnings about potentially uninitialized variables. @n build 12-Sep-2018 15:30:24 + * Added const version of Option::next(). @n build 12-Sep-2018 15:30:24 + * Version 1.4: Fixed 2 printUsage() bugs that messed up output with small COLUMNS values. @n build 12-Sep-2018 15:30:24 + * Version 1.3: Compatible with Microsoft Visual C++. @n build 12-Sep-2018 15:30:24 + * Version 1.2: Added @ref option::Option::namelen "Option::namelen" and removed the extraction build 12-Sep-2018 15:30:24 + * of short option characters into a special buffer. @n build 12-Sep-2018 15:30:24 + * Changed @ref option::Arg::Optional "Arg::Optional" to accept arguments if they are attached build 12-Sep-2018 15:30:24 + * rather than separate. This is what GNU getopt() does and how POSIX recommends build 12-Sep-2018 15:30:24 + * utilities should interpret their arguments.@n build 12-Sep-2018 15:30:24 + * Version 1.1: Optional mode with argument reordering as done by GNU getopt(), so that build 12-Sep-2018 15:30:24 + * options and non-options can be mixed. See build 12-Sep-2018 15:30:24 + * @ref option::Parser::parse() "Parser::parse()". build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @par Example program: build 12-Sep-2018 15:30:24 + * (Note: @c option::* identifiers are links that take you to their documentation.) build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * #error EXAMPLE SHORTENED FOR READABILITY. BETTER EXAMPLES ARE IN THE .TAR.GZ! build 12-Sep-2018 15:30:24 + * #include build 12-Sep-2018 15:30:24 + * #include "optionparser.h" build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * enum optionIndex { UNKNOWN, HELP, PLUS }; build 12-Sep-2018 15:30:24 + * const option::Descriptor usage[] = build 12-Sep-2018 15:30:24 + * { build 12-Sep-2018 15:30:24 + * {UNKNOWN, 0,"" , "" ,option::Arg::None, "USAGE: example [options]\n\n" build 12-Sep-2018 15:30:24 + * "Options:" }, build 12-Sep-2018 15:30:24 + * {HELP, 0,"" , "help",option::Arg::None, " --help \tPrint usage and exit." }, build 12-Sep-2018 15:30:24 + * {PLUS, 0,"p", "plus",option::Arg::None, " --plus, -p \tIncrement count." }, build 12-Sep-2018 15:30:24 + * {UNKNOWN, 0,"" , "" ,option::Arg::None, "\nExamples:\n" build 12-Sep-2018 15:30:24 + * " example --unknown -- --this_is_no_option\n" build 12-Sep-2018 15:30:24 + * " example -unk --plus -ppp file1 file2\n" }, build 12-Sep-2018 15:30:24 + * {0,0,0,0,0,0} build 12-Sep-2018 15:30:24 + * }; build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * int main(int argc, char* argv[]) build 12-Sep-2018 15:30:24 + * { build 12-Sep-2018 15:30:24 + * argc-=(argc>0); argv+=(argc>0); // skip program name argv[0] if present build 12-Sep-2018 15:30:24 + * option::Stats stats(usage, argc, argv); build 12-Sep-2018 15:30:24 + * option::Option options[stats.options_max], buffer[stats.buffer_max]; build 12-Sep-2018 15:30:24 + * option::Parser parse(usage, argc, argv, options, buffer); build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * if (parse.error()) build 12-Sep-2018 15:30:24 + * return 1; build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * if (options[HELP] || argc == 0) { build 12-Sep-2018 15:30:24 + * option::printUsage(std::cout, usage); build 12-Sep-2018 15:30:24 + * return 0; build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * std::cout << "--plus count: " << build 12-Sep-2018 15:30:24 + * options[PLUS].count() << "\n"; build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * for (option::Option* opt = options[UNKNOWN]; opt; opt = opt->next()) build 12-Sep-2018 15:30:24 + * std::cout << "Unknown option: " << opt->name << "\n"; build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * for (int i = 0; i < parse.nonOptionsCount(); ++i) build 12-Sep-2018 15:30:24 + * std::cout << "Non-option #" << i << ": " << parse.nonOption(i) << "\n"; build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @par Option syntax: build 12-Sep-2018 15:30:24 + * @li The Lean Mean C++ Option Parser follows POSIX getopt() conventions and supports build 12-Sep-2018 15:30:24 + * GNU-style getopt_long() long options as well as Perl-style single-minus build 12-Sep-2018 15:30:24 + * long options (getopt_long_only()). build 12-Sep-2018 15:30:24 + * @li short options have the format @c -X where @c X is any character that fits in a char. build 12-Sep-2018 15:30:24 + * @li short options can be grouped, i.e. -X -Y is equivalent to @c -XY. build 12-Sep-2018 15:30:24 + * @li a short option may take an argument either separate (-X foo) or build 12-Sep-2018 15:30:24 + * attached (@c -Xfoo). You can make the parser accept the additional format @c -X=foo by build 12-Sep-2018 15:30:24 + * registering @c X as a long option (in addition to being a short option) and build 12-Sep-2018 15:30:24 + * enabling single-minus long options. build 12-Sep-2018 15:30:24 + * @li an argument-taking short option may be grouped if it is the last in the group, e.g. build 12-Sep-2018 15:30:24 + * @c -ABCXfoo or -ABCX foo (@c foo is the argument to the @c -X option). build 12-Sep-2018 15:30:24 + * @li a lone minus character @c '-' is not treated as an option. It is customarily used where build 12-Sep-2018 15:30:24 + * a file name is expected to refer to stdin or stdout. build 12-Sep-2018 15:30:24 + * @li long options have the format @c --option-name. build 12-Sep-2018 15:30:24 + * @li the option-name of a long option can be anything and include any characters. build 12-Sep-2018 15:30:24 + * Even @c = characters will work, but don't do that. build 12-Sep-2018 15:30:24 + * @li [optional] long options may be abbreviated as long as the abbreviation is unambiguous. build 12-Sep-2018 15:30:24 + * You can set a minimum length for abbreviations. build 12-Sep-2018 15:30:24 + * @li [optional] long options may begin with a single minus. The double minus form is always build 12-Sep-2018 15:30:24 + * accepted, too. build 12-Sep-2018 15:30:24 + * @li a long option may take an argument either separate ( --option arg ) or build 12-Sep-2018 15:30:24 + * attached ( --option=arg ). In the attached form the equals sign is mandatory. build 12-Sep-2018 15:30:24 + * @li an empty string can be passed as an attached long option argument: --option-name= . build 12-Sep-2018 15:30:24 + * Note the distinction between an empty string as argument and no argument at all. build 12-Sep-2018 15:30:24 + * @li an empty string is permitted as separate argument to both long and short options. build 12-Sep-2018 15:30:24 + * @li Arguments to both short and long options may start with a @c '-' character. E.g. build 12-Sep-2018 15:30:24 + * -X-X , -X -X or --long-X=-X . If @c -X build 12-Sep-2018 15:30:24 + * and @c --long-X take an argument, that argument will be @c "-X" in all 3 cases. build 12-Sep-2018 15:30:24 + * @li If using the built-in @ref option::Arg::Optional "Arg::Optional", optional arguments must build 12-Sep-2018 15:30:24 + * be attached. build 12-Sep-2018 15:30:24 + * @li the special option @c -- (i.e. without a name) terminates the list of build 12-Sep-2018 15:30:24 + * options. Everything that follows is a non-option argument, even if it starts with build 12-Sep-2018 15:30:24 + * a @c '-' character. The @c -- itself will not appear in the parse results. build 12-Sep-2018 15:30:24 + * @li the first argument that doesn't start with @c '-' or @c '--' and does not belong to build 12-Sep-2018 15:30:24 + * a preceding argument-taking option, will terminate the option list and is the build 12-Sep-2018 15:30:24 + * first non-option argument. All following command line arguments are treated as build 12-Sep-2018 15:30:24 + * non-option arguments, even if they start with @c '-' . @n build 12-Sep-2018 15:30:24 + * NOTE: This behaviour is mandated by POSIX, but GNU getopt() only honours this if it is build 12-Sep-2018 15:30:24 + * explicitly requested (e.g. by setting POSIXLY_CORRECT). @n build 12-Sep-2018 15:30:24 + * You can enable the GNU behaviour by passing @c true as first argument to build 12-Sep-2018 15:30:24 + * e.g. @ref option::Parser::parse() "Parser::parse()". build 12-Sep-2018 15:30:24 + * @li Arguments that look like options (i.e. @c '-' followed by at least 1 character) but build 12-Sep-2018 15:30:24 + * aren't, are NOT treated as non-option arguments. They are treated as unknown options and build 12-Sep-2018 15:30:24 + * are collected into a list of unknown options for error reporting. @n build 12-Sep-2018 15:30:24 + * This means that in order to pass a first non-option build 12-Sep-2018 15:30:24 + * argument beginning with the minus character it is required to use the build 12-Sep-2018 15:30:24 + * @c -- special option, e.g. build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * program -x -- --strange-filename build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * In this example, @c --strange-filename is a non-option argument. If the @c -- build 12-Sep-2018 15:30:24 + * were omitted, it would be treated as an unknown option. @n build 12-Sep-2018 15:30:24 + * See @ref option::Descriptor::longopt for information on how to collect unknown options. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#ifndef OPTIONPARSER_H_ build 12-Sep-2018 15:30:24 +#define OPTIONPARSER_H_ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#ifdef _MSC_VER build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 +#pragma intrinsic(_BitScanReverse) build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** @brief The namespace of The Lean Mean C++ Option Parser. */ build 12-Sep-2018 15:30:24 +namespace option build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#ifdef _MSC_VER build 12-Sep-2018 15:30:24 +struct MSC_Builtin_CLZ build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + static int builtin_clz(unsigned x) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + unsigned long index; build 12-Sep-2018 15:30:24 + _BitScanReverse(&index, x); build 12-Sep-2018 15:30:24 + return 32-index; // int is always 32bit on Windows, even for target x64 build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 +#define __builtin_clz(x) MSC_Builtin_CLZ::builtin_clz(x) build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +class Option; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** build 12-Sep-2018 15:30:24 + * @brief Possible results when checking if an argument is valid for a certain option. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * In the case that no argument is provided for an option that takes an build 12-Sep-2018 15:30:24 + * optional argument, return codes @c ARG_OK and @c ARG_IGNORE are equivalent. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 +enum ArgStatus build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + //! The option does not take an argument. build 12-Sep-2018 15:30:24 + ARG_NONE, build 12-Sep-2018 15:30:24 + //! The argument is acceptable for the option. build 12-Sep-2018 15:30:24 + ARG_OK, build 12-Sep-2018 15:30:24 + //! The argument is not acceptable but that's non-fatal because the option's argument is optional. build 12-Sep-2018 15:30:24 + ARG_IGNORE, build 12-Sep-2018 15:30:24 + //! The argument is not acceptable and that's fatal. build 12-Sep-2018 15:30:24 + ARG_ILLEGAL build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** build 12-Sep-2018 15:30:24 + * @brief Signature of functions that check if an argument is valid for a certain type of option. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Every Option has such a function assigned in its Descriptor. build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * Descriptor usage[] = { {UNKNOWN, 0, "", "", Arg::None, ""}, ... }; build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * A CheckArg function has the following signature: build 12-Sep-2018 15:30:24 + * @code ArgStatus CheckArg(const Option& option, bool msg); @endcode build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * It is used to check if a potential argument would be acceptable for the option. build 12-Sep-2018 15:30:24 + * It will even be called if there is no argument. In that case @c option.arg will be @c NULL. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * If @c msg is @c true and the function determines that an argument is not acceptable and build 12-Sep-2018 15:30:24 + * that this is a fatal error, it should output a message to the user before build 12-Sep-2018 15:30:24 + * returning @ref ARG_ILLEGAL. If @c msg is @c false the function should remain silent (or you build 12-Sep-2018 15:30:24 + * will get duplicate messages). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * See @ref ArgStatus for the meaning of the return values. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * While you can provide your own functions, build 12-Sep-2018 15:30:24 + * often the following pre-defined checks (which never return @ref ARG_ILLEGAL) will suffice: build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @li @c Arg::None @copybrief Arg::None build 12-Sep-2018 15:30:24 + * @li @c Arg::Optional @copybrief Arg::Optional build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 +typedef ArgStatus (*CheckArg)(const Option& option, bool msg); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** build 12-Sep-2018 15:30:24 + * @brief Describes an option, its help text (usage) and how it should be parsed. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * The main input when constructing an option::Parser is an array of Descriptors. build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + * @par Example: build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * enum OptionIndex {CREATE, ...}; build 12-Sep-2018 15:30:24 + * enum OptionType {DISABLE, ENABLE, OTHER}; build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * const option::Descriptor usage[] = { build 12-Sep-2018 15:30:24 + * { CREATE, // index build 12-Sep-2018 15:30:24 + * OTHER, // type build 12-Sep-2018 15:30:24 + * "c", // shortopt build 12-Sep-2018 15:30:24 + * "create", // longopt build 12-Sep-2018 15:30:24 + * Arg::None, // check_arg build 12-Sep-2018 15:30:24 + * "--create Tells the program to create something." // help build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * , ... build 12-Sep-2018 15:30:24 + * }; build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 +struct Descriptor build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Index of this option's linked list in the array filled in by the parser. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Command line options whose Descriptors have the same index will end up in the same build 12-Sep-2018 15:30:24 + * linked list in the order in which they appear on the command line. If you have build 12-Sep-2018 15:30:24 + * multiple long option aliases that refer to the same option, give their descriptors build 12-Sep-2018 15:30:24 + * the same @c index. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * If you have options that mean exactly opposite things build 12-Sep-2018 15:30:24 + * (e.g. @c --enable-foo and @c --disable-foo ), you should also give them the same build 12-Sep-2018 15:30:24 + * @c index, but distinguish them through different values for @ref type. build 12-Sep-2018 15:30:24 + * That way they end up in the same list and you can just take the last element of the build 12-Sep-2018 15:30:24 + * list and use its type. This way you get the usual behaviour where switches later build 12-Sep-2018 15:30:24 + * on the command line override earlier ones without having to code it manually. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @par Tip: build 12-Sep-2018 15:30:24 + * Use an enum rather than plain ints for better readability, as shown in the example build 12-Sep-2018 15:30:24 + * at Descriptor. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const unsigned index; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Used to distinguish between options with the same @ref index. build 12-Sep-2018 15:30:24 + * See @ref index for details. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * It is recommended that you use an enum rather than a plain int to make your build 12-Sep-2018 15:30:24 + * code more readable. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const int type; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Each char in this string will be accepted as a short option character. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * The string must not include the minus character @c '-' or you'll get undefined build 12-Sep-2018 15:30:24 + * behaviour. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * If this Descriptor should not have short option characters, use the empty build 12-Sep-2018 15:30:24 + * string "". NULL is not permitted here! build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * See @ref longopt for more information. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const char* const shortopt; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief The long option name (without the leading @c -- ). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * If this Descriptor should not have a long option name, use the empty build 12-Sep-2018 15:30:24 + * string "". NULL is not permitted here! build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * While @ref shortopt allows multiple short option characters, each build 12-Sep-2018 15:30:24 + * Descriptor can have only a single long option name. If you have multiple build 12-Sep-2018 15:30:24 + * long option names referring to the same option use separate Descriptors build 12-Sep-2018 15:30:24 + * that have the same @ref index and @ref type. You may repeat build 12-Sep-2018 15:30:24 + * short option characters in such an alias Descriptor but there's no need to. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @par Dummy Descriptors: build 12-Sep-2018 15:30:24 + * You can use dummy Descriptors with an build 12-Sep-2018 15:30:24 + * empty string for both @ref shortopt and @ref longopt to add text to build 12-Sep-2018 15:30:24 + * the usage that is not related to a specific option. See @ref help. build 12-Sep-2018 15:30:24 + * The first dummy Descriptor will be used for unknown options (see below). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @par Unknown Option Descriptor: build 12-Sep-2018 15:30:24 + * The first dummy Descriptor in the list of Descriptors, build 12-Sep-2018 15:30:24 + * whose @ref shortopt and @ref longopt are both the empty string, will be used build 12-Sep-2018 15:30:24 + * as the Descriptor for unknown options. An unknown option is a string in build 12-Sep-2018 15:30:24 + * the argument vector that is not a lone minus @c '-' but starts with a minus build 12-Sep-2018 15:30:24 + * character and does not match any Descriptor's @ref shortopt or @ref longopt. @n build 12-Sep-2018 15:30:24 + * Note that the dummy descriptor's @ref check_arg function @e will be called and build 12-Sep-2018 15:30:24 + * its return value will be evaluated as usual. I.e. if it returns @ref ARG_ILLEGAL build 12-Sep-2018 15:30:24 + * the parsing will be aborted with Parser::error()==true. @n build 12-Sep-2018 15:30:24 + * if @c check_arg does not return @ref ARG_ILLEGAL the descriptor's build 12-Sep-2018 15:30:24 + * @ref index @e will be used to pick the linked list into which build 12-Sep-2018 15:30:24 + * to put the unknown option. @n build 12-Sep-2018 15:30:24 + * If there is no dummy descriptor, unknown options will be dropped silently. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const char* const longopt; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief For each option that matches @ref shortopt or @ref longopt this function build 12-Sep-2018 15:30:24 + * will be called to check a potential argument to the option. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * This function will be called even if there is no potential argument. In that case build 12-Sep-2018 15:30:24 + * it will be passed @c NULL as @c arg parameter. Do not confuse this with the empty build 12-Sep-2018 15:30:24 + * string. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * See @ref CheckArg for more information. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const CheckArg check_arg; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief The usage text associated with the options in this Descriptor. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * You can use option::printUsage() to format your usage message based on build 12-Sep-2018 15:30:24 + * the @c help texts. You can use dummy Descriptors where build 12-Sep-2018 15:30:24 + * @ref shortopt and @ref longopt are both the empty string to add text to build 12-Sep-2018 15:30:24 + * the usage that is not related to a specific option. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * See option::printUsage() for special formatting characters you can use in build 12-Sep-2018 15:30:24 + * @c help to get a column layout. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @attention build 12-Sep-2018 15:30:24 + * Must be UTF-8-encoded. If your compiler supports C++11 you can use the "u8" build 12-Sep-2018 15:30:24 + * prefix to make sure string literals are properly encoded. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const char* help; build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** build 12-Sep-2018 15:30:24 + * @brief A parsed option from the command line together with its argument if it has one. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * The Parser chains all parsed options with the same Descriptor::index together build 12-Sep-2018 15:30:24 + * to form a linked list. This allows you to easily implement all of the common ways build 12-Sep-2018 15:30:24 + * of handling repeated options and enable/disable pairs. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @li Test for presence of a switch in the argument vector: build 12-Sep-2018 15:30:24 + * @code if ( options[QUIET] ) ... @endcode build 12-Sep-2018 15:30:24 + * @li Evaluate --enable-foo/--disable-foo pair where the last one used wins: build 12-Sep-2018 15:30:24 + * @code if ( options[FOO].last()->type() == DISABLE ) ... @endcode build 12-Sep-2018 15:30:24 + * @li Cumulative option (-v verbose, -vv more verbose, -vvv even more verbose): build 12-Sep-2018 15:30:24 + * @code int verbosity = options[VERBOSE].count(); @endcode build 12-Sep-2018 15:30:24 + * @li Iterate over all --file=<fname> arguments: build 12-Sep-2018 15:30:24 + * @code for (Option* opt = options[FILE]; opt; opt = opt->next()) build 12-Sep-2018 15:30:24 + * fname = opt->arg; ... @endcode build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 +class Option build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + Option* next_; build 12-Sep-2018 15:30:24 + Option* prev_; build 12-Sep-2018 15:30:24 +public: build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Pointer to this Option's Descriptor. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Remember that the first dummy descriptor (see @ref Descriptor::longopt) is used build 12-Sep-2018 15:30:24 + * for unknown options. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @attention build 12-Sep-2018 15:30:24 + * @c desc==NULL signals that this Option is unused. This is the default state of build 12-Sep-2018 15:30:24 + * elements in the result array. You don't need to test @c desc explicitly. You build 12-Sep-2018 15:30:24 + * can simply write something like this: build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * if (options[CREATE]) build 12-Sep-2018 15:30:24 + * { build 12-Sep-2018 15:30:24 + * ... build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * This works because of operator const Option*() . build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const Descriptor* desc; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief The name of the option as used on the command line. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * The main purpose of this string is to be presented to the user in messages. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * In the case of a long option, this is the actual @c argv pointer, i.e. the first build 12-Sep-2018 15:30:24 + * character is a '-'. In the case of a short option this points to the option build 12-Sep-2018 15:30:24 + * character within the @c argv string. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Note that in the case of a short option group or an attached option argument, this build 12-Sep-2018 15:30:24 + * string will contain additional characters following the actual name. Use @ref namelen build 12-Sep-2018 15:30:24 + * to filter out the actual option name only. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const char* name; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Pointer to this Option's argument (if any). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * NULL if this option has no argument. Do not confuse this with the empty string which build 12-Sep-2018 15:30:24 + * is a valid argument. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const char* arg; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief The length of the option @ref name. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Because @ref name points into the actual @c argv string, the option name may be build 12-Sep-2018 15:30:24 + * followed by more characters (e.g. other short options in the same short option group). build 12-Sep-2018 15:30:24 + * This value is the number of bytes (not characters!) that are part of the actual name. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * For a short option, this length is always 1. For a long option this length is always build 12-Sep-2018 15:30:24 + * at least 2 if single minus long options are permitted and at least 3 if they are disabled. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @note build 12-Sep-2018 15:30:24 + * In the pathological case of a minus within a short option group (e.g. @c -xf-z), this build 12-Sep-2018 15:30:24 + * length is incorrect, because this case will be misinterpreted as a long option and the build 12-Sep-2018 15:30:24 + * name will therefore extend to the string's 0-terminator or a following '=" character build 12-Sep-2018 15:30:24 + * if there is one. This is irrelevant for most uses of @ref name and @c namelen. If you build 12-Sep-2018 15:30:24 + * really need to distinguish the case of a long and a short option, compare @ref name to build 12-Sep-2018 15:30:24 + * the @c argv pointers. A long option's @c name is always identical to one of them, build 12-Sep-2018 15:30:24 + * whereas a short option's is never. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + int namelen; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns Descriptor::type of this Option's Descriptor, or 0 if this Option build 12-Sep-2018 15:30:24 + * is invalid (unused). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Because this method (and last(), too) can be used even on unused Options with desc==0, you can (provided build 12-Sep-2018 15:30:24 + * you arrange your types properly) switch on type() without testing validity first. build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * enum OptionType { UNUSED=0, DISABLED=0, ENABLED=1 }; build 12-Sep-2018 15:30:24 + * enum OptionIndex { FOO }; build 12-Sep-2018 15:30:24 + * const Descriptor usage[] = { build 12-Sep-2018 15:30:24 + * { FOO, ENABLED, "", "enable-foo", Arg::None, 0 }, build 12-Sep-2018 15:30:24 + * { FOO, DISABLED, "", "disable-foo", Arg::None, 0 }, build 12-Sep-2018 15:30:24 + * { 0, 0, 0, 0, 0, 0 } }; build 12-Sep-2018 15:30:24 + * ... build 12-Sep-2018 15:30:24 + * switch(options[FOO].last()->type()) // no validity check required! build 12-Sep-2018 15:30:24 + * { build 12-Sep-2018 15:30:24 + * case ENABLED: ... build 12-Sep-2018 15:30:24 + * case DISABLED: ... // UNUSED==DISABLED ! build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + int type() const build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return desc == 0 ? 0 : desc->type; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns Descriptor::index of this Option's Descriptor, or -1 if this Option build 12-Sep-2018 15:30:24 + * is invalid (unused). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + int index() const build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return desc == 0 ? -1 : (int)desc->index; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns the number of times this Option (or others with the same Descriptor::index) build 12-Sep-2018 15:30:24 + * occurs in the argument vector. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * This corresponds to the number of elements in the linked list this Option is part of. build 12-Sep-2018 15:30:24 + * It doesn't matter on which element you call count(). The return value is always the same. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Use this to implement cumulative options, such as -v, -vv, -vvv for build 12-Sep-2018 15:30:24 + * different verbosity levels. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Returns 0 when called for an unused/invalid option. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + int count() const build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + int c = (desc == 0 ? 0 : 1); build 12-Sep-2018 15:30:24 + const Option* p = first(); build 12-Sep-2018 15:30:24 + while (!p->isLast()) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + ++c; build 12-Sep-2018 15:30:24 + p = p->next_; build 12-Sep-2018 15:30:24 + }; build 12-Sep-2018 15:30:24 + return c; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns true iff this is the first element of the linked list. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * The first element in the linked list is the first option on the command line build 12-Sep-2018 15:30:24 + * that has the respective Descriptor::index value. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Returns true for an unused/invalid option. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + bool isFirst() const build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return isTagged(prev_); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns true iff this is the last element of the linked list. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * The last element in the linked list is the last option on the command line build 12-Sep-2018 15:30:24 + * that has the respective Descriptor::index value. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Returns true for an unused/invalid option. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + bool isLast() const build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return isTagged(next_); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns a pointer to the first element of the linked list. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Use this when you want the first occurrence of an option on the command line to build 12-Sep-2018 15:30:24 + * take precedence. Note that this is not the way most programs handle options. build 12-Sep-2018 15:30:24 + * You should probably be using last() instead. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @note build 12-Sep-2018 15:30:24 + * This method may be called on an unused/invalid option and will return a pointer to the build 12-Sep-2018 15:30:24 + * option itself. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Option* first() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + Option* p = this; build 12-Sep-2018 15:30:24 + while (!p->isFirst()) build 12-Sep-2018 15:30:24 + p = p->prev_; build 12-Sep-2018 15:30:24 + return p; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * const version of Option::first(). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const Option* first() const build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return const_cast(this)->first(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns a pointer to the last element of the linked list. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Use this when you want the last occurrence of an option on the command line to build 12-Sep-2018 15:30:24 + * take precedence. This is the most common way of handling conflicting options. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @note build 12-Sep-2018 15:30:24 + * This method may be called on an unused/invalid option and will return a pointer to the build 12-Sep-2018 15:30:24 + * option itself. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @par Tip: build 12-Sep-2018 15:30:24 + * If you have options with opposite meanings (e.g. @c --enable-foo and @c --disable-foo), you build 12-Sep-2018 15:30:24 + * can assign them the same Descriptor::index to get them into the same list. Distinguish them by build 12-Sep-2018 15:30:24 + * Descriptor::type and all you have to do is check last()->type() to get build 12-Sep-2018 15:30:24 + * the state listed last on the command line. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Option* last() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return first()->prevwrap(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * const version of Option::last(). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const Option* last() const build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return first()->prevwrap(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns a pointer to the previous element of the linked list or NULL if build 12-Sep-2018 15:30:24 + * called on first(). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * If called on first() this method returns NULL. Otherwise it will return the build 12-Sep-2018 15:30:24 + * option with the same Descriptor::index that precedes this option on the command build 12-Sep-2018 15:30:24 + * line. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Option* prev() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return isFirst() ? 0 : prev_; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns a pointer to the previous element of the linked list with wrap-around from build 12-Sep-2018 15:30:24 + * first() to last(). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * If called on first() this method returns last(). Otherwise it will return the build 12-Sep-2018 15:30:24 + * option with the same Descriptor::index that precedes this option on the command build 12-Sep-2018 15:30:24 + * line. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Option* prevwrap() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return untag(prev_); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * const version of Option::prevwrap(). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const Option* prevwrap() const build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return untag(prev_); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns a pointer to the next element of the linked list or NULL if called build 12-Sep-2018 15:30:24 + * on last(). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * If called on last() this method returns NULL. Otherwise it will return the build 12-Sep-2018 15:30:24 + * option with the same Descriptor::index that follows this option on the command build 12-Sep-2018 15:30:24 + * line. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Option* next() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return isLast() ? 0 : next_; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * const version of Option::next(). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const Option* next() const build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return isLast() ? 0 : next_; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns a pointer to the next element of the linked list with wrap-around from build 12-Sep-2018 15:30:24 + * last() to first(). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * If called on last() this method returns first(). Otherwise it will return the build 12-Sep-2018 15:30:24 + * option with the same Descriptor::index that follows this option on the command build 12-Sep-2018 15:30:24 + * line. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Option* nextwrap() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return untag(next_); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Makes @c new_last the new last() by chaining it into the list after last(). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * It doesn't matter which element you call append() on. The new element will always build 12-Sep-2018 15:30:24 + * be appended to last(). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @attention build 12-Sep-2018 15:30:24 + * @c new_last must not yet be part of a list, or that list will become corrupted, because build 12-Sep-2018 15:30:24 + * this method does not unchain @c new_last from an existing list. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + void append(Option* new_last) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + Option* p = last(); build 12-Sep-2018 15:30:24 + Option* f = first(); build 12-Sep-2018 15:30:24 + p->next_ = new_last; build 12-Sep-2018 15:30:24 + new_last->prev_ = p; build 12-Sep-2018 15:30:24 + new_last->next_ = tag(f); build 12-Sep-2018 15:30:24 + f->prev_ = tag(new_last); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Casts from Option to const Option* but only if this Option is valid. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * If this Option is valid (i.e. @c desc!=NULL), returns this. build 12-Sep-2018 15:30:24 + * Otherwise returns NULL. This allows testing an Option directly build 12-Sep-2018 15:30:24 + * in an if-clause to see if it is used: build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * if (options[CREATE]) build 12-Sep-2018 15:30:24 + * { build 12-Sep-2018 15:30:24 + * ... build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * It also allows you to write loops like this: build 12-Sep-2018 15:30:24 + * @code for (Option* opt = options[FILE]; opt; opt = opt->next()) build 12-Sep-2018 15:30:24 + * fname = opt->arg; ... @endcode build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + operator const Option*() const build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return desc ? this : 0; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Casts from Option to Option* but only if this Option is valid. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * If this Option is valid (i.e. @c desc!=NULL), returns this. build 12-Sep-2018 15:30:24 + * Otherwise returns NULL. This allows testing an Option directly build 12-Sep-2018 15:30:24 + * in an if-clause to see if it is used: build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * if (options[CREATE]) build 12-Sep-2018 15:30:24 + * { build 12-Sep-2018 15:30:24 + * ... build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * It also allows you to write loops like this: build 12-Sep-2018 15:30:24 + * @code for (Option* opt = options[FILE]; opt; opt = opt->next()) build 12-Sep-2018 15:30:24 + * fname = opt->arg; ... @endcode build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + operator Option*() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return desc ? this : 0; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Creates a new Option that is a one-element linked list and has NULL build 12-Sep-2018 15:30:24 + * @ref desc, @ref name, @ref arg and @ref namelen. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Option() : build 12-Sep-2018 15:30:24 + desc(0), name(0), arg(0), namelen(0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + prev_ = tag(this); build 12-Sep-2018 15:30:24 + next_ = tag(this); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Creates a new Option that is a one-element linked list and has the given build 12-Sep-2018 15:30:24 + * values for @ref desc, @ref name and @ref arg. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * If @c name_ points at a character other than '-' it will be assumed to refer to a build 12-Sep-2018 15:30:24 + * short option and @ref namelen will be set to 1. Otherwise the length will extend to build 12-Sep-2018 15:30:24 + * the first '=' character or the string's 0-terminator. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Option(const Descriptor* desc_, const char* name_, const char* arg_) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + init(desc_, name_, arg_); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Makes @c *this a copy of @c orig except for the linked list pointers. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * After this operation @c *this will be a one-element linked list. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + void operator=(const Option& orig) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + init(orig.desc, orig.name, orig.arg); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Makes @c *this a copy of @c orig except for the linked list pointers. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * After this operation @c *this will be a one-element linked list. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Option(const Option& orig) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + init(orig.desc, orig.name, orig.arg); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +private: build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Sets the fields of this Option to the given values (extracting @c name if necessary). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * If @c name_ points at a character other than '-' it will be assumed to refer to a build 12-Sep-2018 15:30:24 + * short option and @ref namelen will be set to 1. Otherwise the length will extend to build 12-Sep-2018 15:30:24 + * the first '=' character or the string's 0-terminator. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + void init(const Descriptor* desc_, const char* name_, const char* arg_) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + desc = desc_; build 12-Sep-2018 15:30:24 + name = name_; build 12-Sep-2018 15:30:24 + arg = arg_; build 12-Sep-2018 15:30:24 + prev_ = tag(this); build 12-Sep-2018 15:30:24 + next_ = tag(this); build 12-Sep-2018 15:30:24 + namelen = 0; build 12-Sep-2018 15:30:24 + if (name == 0) build 12-Sep-2018 15:30:24 + return; build 12-Sep-2018 15:30:24 + namelen = 1; build 12-Sep-2018 15:30:24 + if (name[0] != '-') build 12-Sep-2018 15:30:24 + return; build 12-Sep-2018 15:30:24 + while (name[namelen] != 0 && name[namelen] != '=') build 12-Sep-2018 15:30:24 + ++namelen; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + static Option* tag(Option* ptr) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return (Option*) ((unsigned long long) ptr | 1); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + static Option* untag(Option* ptr) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return (Option*) ((unsigned long long) ptr & ~1ull); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + static bool isTagged(Option* ptr) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return ((unsigned long long) ptr & 1); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** build 12-Sep-2018 15:30:24 + * @brief Functions for checking the validity of option arguments. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @copydetails CheckArg build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * The following example code build 12-Sep-2018 15:30:24 + * can serve as starting place for writing your own more complex CheckArg functions: build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * struct Arg: public option::Arg build 12-Sep-2018 15:30:24 + * { build 12-Sep-2018 15:30:24 + * static void printError(const char* msg1, const option::Option& opt, const char* msg2) build 12-Sep-2018 15:30:24 + * { build 12-Sep-2018 15:30:24 + * fprintf(stderr, "ERROR: %s", msg1); build 12-Sep-2018 15:30:24 + * fwrite(opt.name, opt.namelen, 1, stderr); build 12-Sep-2018 15:30:24 + * fprintf(stderr, "%s", msg2); build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * static option::ArgStatus Unknown(const option::Option& option, bool msg) build 12-Sep-2018 15:30:24 + * { build 12-Sep-2018 15:30:24 + * if (msg) printError("Unknown option '", option, "'\n"); build 12-Sep-2018 15:30:24 + * return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * static option::ArgStatus Required(const option::Option& option, bool msg) build 12-Sep-2018 15:30:24 + * { build 12-Sep-2018 15:30:24 + * if (option.arg != 0) build 12-Sep-2018 15:30:24 + * return option::ARG_OK; build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * if (msg) printError("Option '", option, "' requires an argument\n"); build 12-Sep-2018 15:30:24 + * return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * static option::ArgStatus NonEmpty(const option::Option& option, bool msg) build 12-Sep-2018 15:30:24 + * { build 12-Sep-2018 15:30:24 + * if (option.arg != 0 && option.arg[0] != 0) build 12-Sep-2018 15:30:24 + * return option::ARG_OK; build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * if (msg) printError("Option '", option, "' requires a non-empty argument\n"); build 12-Sep-2018 15:30:24 + * return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * static option::ArgStatus Numeric(const option::Option& option, bool msg) build 12-Sep-2018 15:30:24 + * { build 12-Sep-2018 15:30:24 + * char* endptr = 0; build 12-Sep-2018 15:30:24 + * if (option.arg != 0 && strtol(option.arg, &endptr, 10)){}; build 12-Sep-2018 15:30:24 + * if (endptr != option.arg && *endptr == 0) build 12-Sep-2018 15:30:24 + * return option::ARG_OK; build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * if (msg) printError("Option '", option, "' requires a numeric argument\n"); build 12-Sep-2018 15:30:24 + * return option::ARG_ILLEGAL; build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * }; build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 +struct Arg build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + //! @brief For options that don't take an argument: Returns ARG_NONE. build 12-Sep-2018 15:30:24 + static ArgStatus None(const Option&, bool) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return ARG_NONE; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief Returns ARG_OK if the argument is attached and ARG_IGNORE otherwise. build 12-Sep-2018 15:30:24 + static ArgStatus Optional(const Option& option, bool) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (option.arg && option.name[option.namelen] != 0) build 12-Sep-2018 15:30:24 + return ARG_OK; build 12-Sep-2018 15:30:24 + else build 12-Sep-2018 15:30:24 + return ARG_IGNORE; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** build 12-Sep-2018 15:30:24 + * @brief Determines the minimum lengths of the buffer and options arrays used for Parser. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Because Parser doesn't use dynamic memory its output arrays have to be pre-allocated. build 12-Sep-2018 15:30:24 + * If you don't want to use fixed size arrays (which may turn out too small, causing build 12-Sep-2018 15:30:24 + * command line arguments to be dropped), you can use Stats to determine the correct sizes. build 12-Sep-2018 15:30:24 + * Stats work cumulative. You can first pass in your default options and then the real build 12-Sep-2018 15:30:24 + * options and afterwards the counts will reflect the union. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 +struct Stats build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Number of elements needed for a @c buffer[] array to be used for build 12-Sep-2018 15:30:24 + * @ref Parser::parse() "parsing" the same argument vectors that were fed build 12-Sep-2018 15:30:24 + * into this Stats object. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @note build 12-Sep-2018 15:30:24 + * This number is always 1 greater than the actual number needed, to give build 12-Sep-2018 15:30:24 + * you a sentinel element. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + unsigned buffer_max; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Number of elements needed for an @c options[] array to be used for build 12-Sep-2018 15:30:24 + * @ref Parser::parse() "parsing" the same argument vectors that were fed build 12-Sep-2018 15:30:24 + * into this Stats object. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @note build 12-Sep-2018 15:30:24 + * @li This number is always 1 greater than the actual number needed, to give build 12-Sep-2018 15:30:24 + * you a sentinel element. build 12-Sep-2018 15:30:24 + * @li This number depends only on the @c usage, not the argument vectors, because build 12-Sep-2018 15:30:24 + * the @c options array needs exactly one slot for each possible Descriptor::index. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + unsigned options_max; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Creates a Stats object with counts set to 1 (for the sentinel element). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Stats() : build 12-Sep-2018 15:30:24 + buffer_max(1), options_max(1) // 1 more than necessary as sentinel build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Creates a new Stats object and immediately updates it for the build 12-Sep-2018 15:30:24 + * given @c usage and argument vector. You may pass 0 for @c argc and/or @c argv, build 12-Sep-2018 15:30:24 + * if you just want to update @ref options_max. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @note build 12-Sep-2018 15:30:24 + * The calls to Stats methods must match the later calls to Parser methods. build 12-Sep-2018 15:30:24 + * See Parser::parse() for the meaning of the arguments. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Stats(bool gnu, const Descriptor usage[], int argc, const char** argv, int min_abbr_len = 0, // build 12-Sep-2018 15:30:24 + bool single_minus_longopt = false) : build 12-Sep-2018 15:30:24 + buffer_max(1), options_max(1) // 1 more than necessary as sentinel build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + add(gnu, usage, argc, argv, min_abbr_len, single_minus_longopt); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief Stats(...) with non-const argv. build 12-Sep-2018 15:30:24 + Stats(bool gnu, const Descriptor usage[], int argc, char** argv, int min_abbr_len = 0, // build 12-Sep-2018 15:30:24 + bool single_minus_longopt = false) : build 12-Sep-2018 15:30:24 + buffer_max(1), options_max(1) // 1 more than necessary as sentinel build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + add(gnu, usage, argc, (const char**) argv, min_abbr_len, single_minus_longopt); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief POSIX Stats(...) (gnu==false). build 12-Sep-2018 15:30:24 + Stats(const Descriptor usage[], int argc, const char** argv, int min_abbr_len = 0, // build 12-Sep-2018 15:30:24 + bool single_minus_longopt = false) : build 12-Sep-2018 15:30:24 + buffer_max(1), options_max(1) // 1 more than necessary as sentinel build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + add(false, usage, argc, argv, min_abbr_len, single_minus_longopt); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief POSIX Stats(...) (gnu==false) with non-const argv. build 12-Sep-2018 15:30:24 + Stats(const Descriptor usage[], int argc, char** argv, int min_abbr_len = 0, // build 12-Sep-2018 15:30:24 + bool single_minus_longopt = false) : build 12-Sep-2018 15:30:24 + buffer_max(1), options_max(1) // 1 more than necessary as sentinel build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + add(false, usage, argc, (const char**) argv, min_abbr_len, single_minus_longopt); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Updates this Stats object for the build 12-Sep-2018 15:30:24 + * given @c usage and argument vector. You may pass 0 for @c argc and/or @c argv, build 12-Sep-2018 15:30:24 + * if you just want to update @ref options_max. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @note build 12-Sep-2018 15:30:24 + * The calls to Stats methods must match the later calls to Parser methods. build 12-Sep-2018 15:30:24 + * See Parser::parse() for the meaning of the arguments. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + void add(bool gnu, const Descriptor usage[], int argc, const char** argv, int min_abbr_len = 0, // build 12-Sep-2018 15:30:24 + bool single_minus_longopt = false); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief add() with non-const argv. build 12-Sep-2018 15:30:24 + void add(bool gnu, const Descriptor usage[], int argc, char** argv, int min_abbr_len = 0, // build 12-Sep-2018 15:30:24 + bool single_minus_longopt = false) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + add(gnu, usage, argc, (const char**) argv, min_abbr_len, single_minus_longopt); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief POSIX add() (gnu==false). build 12-Sep-2018 15:30:24 + void add(const Descriptor usage[], int argc, const char** argv, int min_abbr_len = 0, // build 12-Sep-2018 15:30:24 + bool single_minus_longopt = false) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + add(false, usage, argc, argv, min_abbr_len, single_minus_longopt); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief POSIX add() (gnu==false) with non-const argv. build 12-Sep-2018 15:30:24 + void add(const Descriptor usage[], int argc, char** argv, int min_abbr_len = 0, // build 12-Sep-2018 15:30:24 + bool single_minus_longopt = false) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + add(false, usage, argc, (const char**) argv, min_abbr_len, single_minus_longopt); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +private: build 12-Sep-2018 15:30:24 + class CountOptionsAction; build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** build 12-Sep-2018 15:30:24 + * @brief Checks argument vectors for validity and parses them into data build 12-Sep-2018 15:30:24 + * structures that are easier to work with. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @par Example: build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * int main(int argc, char* argv[]) build 12-Sep-2018 15:30:24 + * { build 12-Sep-2018 15:30:24 + * argc-=(argc>0); argv+=(argc>0); // skip program name argv[0] if present build 12-Sep-2018 15:30:24 + * option::Stats stats(usage, argc, argv); build 12-Sep-2018 15:30:24 + * option::Option options[stats.options_max], buffer[stats.buffer_max]; build 12-Sep-2018 15:30:24 + * option::Parser parse(usage, argc, argv, options, buffer); build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * if (parse.error()) build 12-Sep-2018 15:30:24 + * return 1; build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * if (options[HELP]) build 12-Sep-2018 15:30:24 + * ... build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 +class Parser build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + int op_count; //!< @internal @brief see optionsCount() build 12-Sep-2018 15:30:24 + int nonop_count; //!< @internal @brief see nonOptionsCount() build 12-Sep-2018 15:30:24 + const char** nonop_args; //!< @internal @brief see nonOptions() build 12-Sep-2018 15:30:24 + bool err; //!< @internal @brief see error() build 12-Sep-2018 15:30:24 +public: build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Creates a new Parser. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Parser() : build 12-Sep-2018 15:30:24 + op_count(0), nonop_count(0), nonop_args(0), err(false) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Creates a new Parser and immediately parses the given argument vector. build 12-Sep-2018 15:30:24 + * @copydetails parse() build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Parser(bool gnu, const Descriptor usage[], int argc, const char** argv, Option options[], Option buffer[], build 12-Sep-2018 15:30:24 + int min_abbr_len = 0, bool single_minus_longopt = false, int bufmax = -1) : build 12-Sep-2018 15:30:24 + op_count(0), nonop_count(0), nonop_args(0), err(false) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + parse(gnu, usage, argc, argv, options, buffer, min_abbr_len, single_minus_longopt, bufmax); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief Parser(...) with non-const argv. build 12-Sep-2018 15:30:24 + Parser(bool gnu, const Descriptor usage[], int argc, char** argv, Option options[], Option buffer[], build 12-Sep-2018 15:30:24 + int min_abbr_len = 0, bool single_minus_longopt = false, int bufmax = -1) : build 12-Sep-2018 15:30:24 + op_count(0), nonop_count(0), nonop_args(0), err(false) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + parse(gnu, usage, argc, (const char**) argv, options, buffer, min_abbr_len, single_minus_longopt, bufmax); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief POSIX Parser(...) (gnu==false). build 12-Sep-2018 15:30:24 + Parser(const Descriptor usage[], int argc, const char** argv, Option options[], Option buffer[], int min_abbr_len = 0, build 12-Sep-2018 15:30:24 + bool single_minus_longopt = false, int bufmax = -1) : build 12-Sep-2018 15:30:24 + op_count(0), nonop_count(0), nonop_args(0), err(false) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + parse(false, usage, argc, argv, options, buffer, min_abbr_len, single_minus_longopt, bufmax); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief POSIX Parser(...) (gnu==false) with non-const argv. build 12-Sep-2018 15:30:24 + Parser(const Descriptor usage[], int argc, char** argv, Option options[], Option buffer[], int min_abbr_len = 0, build 12-Sep-2018 15:30:24 + bool single_minus_longopt = false, int bufmax = -1) : build 12-Sep-2018 15:30:24 + op_count(0), nonop_count(0), nonop_args(0), err(false) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + parse(false, usage, argc, (const char**) argv, options, buffer, min_abbr_len, single_minus_longopt, bufmax); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Parses the given argument vector. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @param gnu if true, parse() will not stop at the first non-option argument. Instead it will build 12-Sep-2018 15:30:24 + * reorder arguments so that all non-options are at the end. This is the default behaviour build 12-Sep-2018 15:30:24 + * of GNU getopt() but is not conforming to POSIX. @n build 12-Sep-2018 15:30:24 + * Note, that once the argument vector has been reordered, the @c gnu flag will have build 12-Sep-2018 15:30:24 + * no further effect on this argument vector. So it is enough to pass @c gnu==true when build 12-Sep-2018 15:30:24 + * creating Stats. build 12-Sep-2018 15:30:24 + * @param usage Array of Descriptor objects that describe the options to support. The last entry build 12-Sep-2018 15:30:24 + * of this array must have 0 in all fields. build 12-Sep-2018 15:30:24 + * @param argc The number of elements from @c argv that are to be parsed. If you pass -1, the number build 12-Sep-2018 15:30:24 + * will be determined automatically. In that case the @c argv list must end with a NULL build 12-Sep-2018 15:30:24 + * pointer. build 12-Sep-2018 15:30:24 + * @param argv The arguments to be parsed. If you pass -1 as @c argc the last pointer in the @c argv build 12-Sep-2018 15:30:24 + * list must be NULL to mark the end. build 12-Sep-2018 15:30:24 + * @param options Each entry is the first element of a linked list of Options. Each new option build 12-Sep-2018 15:30:24 + * that is parsed will be appended to the list specified by that Option's build 12-Sep-2018 15:30:24 + * Descriptor::index. If an entry is not yet used (i.e. the Option is invalid), build 12-Sep-2018 15:30:24 + * it will be replaced rather than appended to. @n build 12-Sep-2018 15:30:24 + * The minimum length of this array is the greatest Descriptor::index value that build 12-Sep-2018 15:30:24 + * occurs in @c usage @e PLUS ONE. build 12-Sep-2018 15:30:24 + * @param buffer Each argument that is successfully parsed (including unknown arguments, if they build 12-Sep-2018 15:30:24 + * have a Descriptor whose CheckArg does not return @ref ARG_ILLEGAL) will be stored in this build 12-Sep-2018 15:30:24 + * array. parse() scans the array for the first invalid entry and begins writing at that build 12-Sep-2018 15:30:24 + * index. You can pass @c bufmax to limit the number of options stored. build 12-Sep-2018 15:30:24 + * @param min_abbr_len Passing a value min_abbr_len > 0 enables abbreviated long build 12-Sep-2018 15:30:24 + * options. The parser will match a prefix of a long option as if it was build 12-Sep-2018 15:30:24 + * the full long option (e.g. @c --foob=10 will be interpreted as if it was build 12-Sep-2018 15:30:24 + * @c --foobar=10 ), as long as the prefix has at least @c min_abbr_len characters build 12-Sep-2018 15:30:24 + * (not counting the @c -- ) and is unambiguous. build 12-Sep-2018 15:30:24 + * @n Be careful if combining @c min_abbr_len=1 with @c single_minus_longopt=true build 12-Sep-2018 15:30:24 + * because the ambiguity check does not consider short options and abbreviated build 12-Sep-2018 15:30:24 + * single minus long options will take precedence over short options. build 12-Sep-2018 15:30:24 + * @param single_minus_longopt Passing @c true for this option allows long options to begin with build 12-Sep-2018 15:30:24 + * a single minus. The double minus form will still be recognized. Note that build 12-Sep-2018 15:30:24 + * single minus long options take precedence over short options and short option build 12-Sep-2018 15:30:24 + * groups. E.g. @c -file would be interpreted as @c --file and not as build 12-Sep-2018 15:30:24 + * -f -i -l -e (assuming a long option named @c "file" exists). build 12-Sep-2018 15:30:24 + * @param bufmax The greatest index in the @c buffer[] array that parse() will write to is build 12-Sep-2018 15:30:24 + * @c bufmax-1. If there are more options, they will be processed (in particular build 12-Sep-2018 15:30:24 + * their CheckArg will be called) but not stored. @n build 12-Sep-2018 15:30:24 + * If you used Stats::buffer_max to dimension this array, you can pass build 12-Sep-2018 15:30:24 + * -1 (or not pass @c bufmax at all) which tells parse() that the buffer is build 12-Sep-2018 15:30:24 + * "large enough". build 12-Sep-2018 15:30:24 + * @attention build 12-Sep-2018 15:30:24 + * Remember that @c options and @c buffer store Option @e objects, not pointers. Therefore it build 12-Sep-2018 15:30:24 + * is not possible for the same object to be in both arrays. For those options that are found in build 12-Sep-2018 15:30:24 + * both @c buffer[] and @c options[] the respective objects are independent copies. And only the build 12-Sep-2018 15:30:24 + * objects in @c options[] are properly linked via Option::next() and Option::prev(). build 12-Sep-2018 15:30:24 + * You can iterate over @c buffer[] to build 12-Sep-2018 15:30:24 + * process all options in the order they appear in the argument vector, but if you want access to build 12-Sep-2018 15:30:24 + * the other Options with the same Descriptor::index, then you @e must access the linked list via build 12-Sep-2018 15:30:24 + * @c options[]. You can get the linked list in options from a buffer object via something like build 12-Sep-2018 15:30:24 + * @c options[buffer[i].index()]. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + void parse(bool gnu, const Descriptor usage[], int argc, const char** argv, Option options[], Option buffer[], build 12-Sep-2018 15:30:24 + int min_abbr_len = 0, bool single_minus_longopt = false, int bufmax = -1); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief parse() with non-const argv. build 12-Sep-2018 15:30:24 + void parse(bool gnu, const Descriptor usage[], int argc, char** argv, Option options[], Option buffer[], build 12-Sep-2018 15:30:24 + int min_abbr_len = 0, bool single_minus_longopt = false, int bufmax = -1) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + parse(gnu, usage, argc, (const char**) argv, options, buffer, min_abbr_len, single_minus_longopt, bufmax); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief POSIX parse() (gnu==false). build 12-Sep-2018 15:30:24 + void parse(const Descriptor usage[], int argc, const char** argv, Option options[], Option buffer[], build 12-Sep-2018 15:30:24 + int min_abbr_len = 0, bool single_minus_longopt = false, int bufmax = -1) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + parse(false, usage, argc, argv, options, buffer, min_abbr_len, single_minus_longopt, bufmax); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief POSIX parse() (gnu==false) with non-const argv. build 12-Sep-2018 15:30:24 + void parse(const Descriptor usage[], int argc, char** argv, Option options[], Option buffer[], int min_abbr_len = 0, build 12-Sep-2018 15:30:24 + bool single_minus_longopt = false, int bufmax = -1) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + parse(false, usage, argc, (const char**) argv, options, buffer, min_abbr_len, single_minus_longopt, bufmax); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns the number of valid Option objects in @c buffer[]. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @note build 12-Sep-2018 15:30:24 + * @li The returned value always reflects the number of Options in the buffer[] array used for build 12-Sep-2018 15:30:24 + * the most recent call to parse(). build 12-Sep-2018 15:30:24 + * @li The count (and the buffer[]) includes unknown options if they are collected build 12-Sep-2018 15:30:24 + * (see Descriptor::longopt). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + int optionsCount() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return op_count; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns the number of non-option arguments that remained at the end of the build 12-Sep-2018 15:30:24 + * most recent parse() that actually encountered non-option arguments. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @note build 12-Sep-2018 15:30:24 + * A parse() that does not encounter non-option arguments will leave this value build 12-Sep-2018 15:30:24 + * as well as nonOptions() undisturbed. This means you can feed the Parser a build 12-Sep-2018 15:30:24 + * default argument vector that contains non-option arguments (e.g. a default filename). build 12-Sep-2018 15:30:24 + * Then you feed it the actual arguments from the user. If the user has supplied at build 12-Sep-2018 15:30:24 + * least one non-option argument, all of the non-option arguments from the default build 12-Sep-2018 15:30:24 + * disappear and are replaced by the user's non-option arguments. However, if the build 12-Sep-2018 15:30:24 + * user does not supply any non-option arguments the defaults will still be in build 12-Sep-2018 15:30:24 + * effect. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + int nonOptionsCount() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return nonop_count; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns a pointer to an array of non-option arguments (only valid build 12-Sep-2018 15:30:24 + * if nonOptionsCount() >0 ). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @note build 12-Sep-2018 15:30:24 + * @li parse() does not copy arguments, so this pointer points into the actual argument build 12-Sep-2018 15:30:24 + * vector as passed to parse(). build 12-Sep-2018 15:30:24 + * @li As explained at nonOptionsCount() this pointer is only changed by parse() calls build 12-Sep-2018 15:30:24 + * that actually encounter non-option arguments. A parse() call that encounters only build 12-Sep-2018 15:30:24 + * options, will not change nonOptions(). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const char** nonOptions() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return nonop_args; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns nonOptions()[i] (@e without checking if i is in range!). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const char* nonOption(int i) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return nonOptions()[i]; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns @c true if an unrecoverable error occurred while parsing options. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * An illegal argument to an option (i.e. CheckArg returns @ref ARG_ILLEGAL) is an build 12-Sep-2018 15:30:24 + * unrecoverable error that aborts the parse. Unknown options are only an error if build 12-Sep-2018 15:30:24 + * their CheckArg function returns @ref ARG_ILLEGAL. Otherwise they are collected. build 12-Sep-2018 15:30:24 + * In that case if you want to exit the program if either an illegal argument build 12-Sep-2018 15:30:24 + * or an unknown option has been passed, use code like this build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * if (parser.error() || options[UNKNOWN]) build 12-Sep-2018 15:30:24 + * exit(1); build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + bool error() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return err; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +private: build 12-Sep-2018 15:30:24 + friend struct Stats; build 12-Sep-2018 15:30:24 + class StoreOptionAction; build 12-Sep-2018 15:30:24 + struct Action; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief This is the core function that does all the parsing. build 12-Sep-2018 15:30:24 + * @retval false iff an unrecoverable error occurred. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + static bool workhorse(bool gnu, const Descriptor usage[], int numargs, const char** args, Action& action, build 12-Sep-2018 15:30:24 + bool single_minus_longopt, bool print_errors, int min_abbr_len); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Returns true iff @c st1 is a prefix of @c st2 and build 12-Sep-2018 15:30:24 + * in case @c st2 is longer than @c st1, then build 12-Sep-2018 15:30:24 + * the first additional character is '='. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @par Examples: build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * streq("foo", "foo=bar") == true build 12-Sep-2018 15:30:24 + * streq("foo", "foobar") == false build 12-Sep-2018 15:30:24 + * streq("foo", "foo") == true build 12-Sep-2018 15:30:24 + * streq("foo=bar", "foo") == false build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + static bool streq(const char* st1, const char* st2) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + while (*st1 != 0) build 12-Sep-2018 15:30:24 + if (*st1++ != *st2++) build 12-Sep-2018 15:30:24 + return false; build 12-Sep-2018 15:30:24 + return (*st2 == 0 || *st2 == '='); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Like streq() but handles abbreviations. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Returns true iff @c st1 and @c st2 have a common build 12-Sep-2018 15:30:24 + * prefix with the following properties: build 12-Sep-2018 15:30:24 + * @li (if min > 0) its length is at least @c min characters or the same length as @c st1 (whichever is smaller). build 12-Sep-2018 15:30:24 + * @li (if min <= 0) its length is the same as that of @c st1 build 12-Sep-2018 15:30:24 + * @li within @c st2 the character following the common prefix is either '=' or end-of-string. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Examples: build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * streqabbr("foo", "foo=bar",) == true build 12-Sep-2018 15:30:24 + * streqabbr("foo", "fo=bar" , 2) == true build 12-Sep-2018 15:30:24 + * streqabbr("foo", "fo" , 2) == true build 12-Sep-2018 15:30:24 + * streqabbr("foo", "fo" , 0) == false build 12-Sep-2018 15:30:24 + * streqabbr("foo", "f=bar" , 2) == false build 12-Sep-2018 15:30:24 + * streqabbr("foo", "f" , 2) == false build 12-Sep-2018 15:30:24 + * streqabbr("fo" , "foo=bar",) == false build 12-Sep-2018 15:30:24 + * streqabbr("foo", "foobar" ,) == false build 12-Sep-2018 15:30:24 + * streqabbr("foo", "fobar" ,) == false build 12-Sep-2018 15:30:24 + * streqabbr("foo", "foo" ,) == true build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + static bool streqabbr(const char* st1, const char* st2, long long min) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + const char* st1start = st1; build 12-Sep-2018 15:30:24 + while (*st1 != 0 && (*st1 == *st2)) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + ++st1; build 12-Sep-2018 15:30:24 + ++st2; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + return (*st1 == 0 || (min > 0 && (st1 - st1start) >= min)) && (*st2 == 0 || *st2 == '='); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Returns true iff character @c ch is contained in the string @c st. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Returns @c true for @c ch==0 . build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + static bool instr(char ch, const char* st) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + while (*st != 0 && *st != ch) build 12-Sep-2018 15:30:24 + ++st; build 12-Sep-2018 15:30:24 + return *st == ch; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Rotates args[-count],...,args[-1],args[0] to become build 12-Sep-2018 15:30:24 + * args[0],args[-count],...,args[-1]. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + static void shift(const char** args, int count) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + for (int i = 0; i > -count; --i) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + const char* temp = args[i]; build 12-Sep-2018 15:30:24 + args[i] = args[i - 1]; build 12-Sep-2018 15:30:24 + args[i - 1] = temp; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Interface for actions Parser::workhorse() should perform for each Option it build 12-Sep-2018 15:30:24 + * parses. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 +struct Parser::Action build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Called by Parser::workhorse() for each Option that has been successfully build 12-Sep-2018 15:30:24 + * parsed (including unknown build 12-Sep-2018 15:30:24 + * options if they have a Descriptor whose Descriptor::check_arg does not return build 12-Sep-2018 15:30:24 + * @ref ARG_ILLEGAL. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Returns @c false iff a fatal error has occured and the parse should be aborted. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + virtual bool perform(Option&) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Called by Parser::workhorse() after finishing the parse. build 12-Sep-2018 15:30:24 + * @param numargs the number of non-option arguments remaining build 12-Sep-2018 15:30:24 + * @param args pointer to the first remaining non-option argument (if numargs > 0). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @return build 12-Sep-2018 15:30:24 + * @c false iff a fatal error has occurred. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + virtual bool finished(int numargs, const char** args) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + (void) numargs; build 12-Sep-2018 15:30:24 + (void) args; build 12-Sep-2018 15:30:24 + return true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief An Action to pass to Parser::workhorse() that will increment a counter for build 12-Sep-2018 15:30:24 + * each parsed Option. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 +class Stats::CountOptionsAction: public Parser::Action build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + unsigned* buffer_max; build 12-Sep-2018 15:30:24 +public: build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * Creates a new CountOptionsAction that will increase @c *buffer_max_ for each build 12-Sep-2018 15:30:24 + * parsed Option. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + CountOptionsAction(unsigned* buffer_max_) : build 12-Sep-2018 15:30:24 + buffer_max(buffer_max_) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + bool perform(Option&) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (*buffer_max == 0x7fffffff) build 12-Sep-2018 15:30:24 + return false; // overflow protection: don't accept number of options that doesn't fit signed int build 12-Sep-2018 15:30:24 + ++*buffer_max; build 12-Sep-2018 15:30:24 + return true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief An Action to pass to Parser::workhorse() that will store each parsed Option in build 12-Sep-2018 15:30:24 + * appropriate arrays (see Parser::parse()). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 +class Parser::StoreOptionAction: public Parser::Action build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + Parser& parser; build 12-Sep-2018 15:30:24 + Option* options; build 12-Sep-2018 15:30:24 + Option* buffer; build 12-Sep-2018 15:30:24 + int bufmax; //! Number of slots in @c buffer. @c -1 means "large enough". build 12-Sep-2018 15:30:24 +public: build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Creates a new StoreOption action. build 12-Sep-2018 15:30:24 + * @param parser_ the parser whose op_count should be updated. build 12-Sep-2018 15:30:24 + * @param options_ each Option @c o is chained into the linked list @c options_[o.desc->index] build 12-Sep-2018 15:30:24 + * @param buffer_ each Option is appended to this array as long as there's a free slot. build 12-Sep-2018 15:30:24 + * @param bufmax_ number of slots in @c buffer_. @c -1 means "large enough". build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + StoreOptionAction(Parser& parser_, Option options_[], Option buffer_[], int bufmax_) : build 12-Sep-2018 15:30:24 + parser(parser_), options(options_), buffer(buffer_), bufmax(bufmax_) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + // find first empty slot in buffer (if any) build 12-Sep-2018 15:30:24 + int bufidx = 0; build 12-Sep-2018 15:30:24 + while ((bufmax < 0 || bufidx < bufmax) && buffer[bufidx]) build 12-Sep-2018 15:30:24 + ++bufidx; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // set parser's optionCount build 12-Sep-2018 15:30:24 + parser.op_count = bufidx; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + bool perform(Option& option) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (bufmax < 0 || parser.op_count < bufmax) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (parser.op_count == 0x7fffffff) build 12-Sep-2018 15:30:24 + return false; // overflow protection: don't accept number of options that doesn't fit signed int build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + buffer[parser.op_count] = option; build 12-Sep-2018 15:30:24 + int idx = buffer[parser.op_count].desc->index; build 12-Sep-2018 15:30:24 + if (options[idx]) build 12-Sep-2018 15:30:24 + options[idx].append(buffer[parser.op_count]); build 12-Sep-2018 15:30:24 + else build 12-Sep-2018 15:30:24 + options[idx] = buffer[parser.op_count]; build 12-Sep-2018 15:30:24 + ++parser.op_count; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return true; // NOTE: an option that is discarded because of a full buffer is not fatal build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + bool finished(int numargs, const char** args) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + // only overwrite non-option argument list if there's at least 1 build 12-Sep-2018 15:30:24 + // new non-option argument. Otherwise we keep the old list. This build 12-Sep-2018 15:30:24 + // makes it easy to use default non-option arguments. build 12-Sep-2018 15:30:24 + if (numargs > 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + parser.nonop_count = numargs; build 12-Sep-2018 15:30:24 + parser.nonop_args = args; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + return true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 +}; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +inline void Parser::parse(bool gnu, const Descriptor usage[], int argc, const char** argv, Option options[], build 12-Sep-2018 15:30:24 + Option buffer[], int min_abbr_len, bool single_minus_longopt, int bufmax) build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + StoreOptionAction action(*this, options, buffer, bufmax); build 12-Sep-2018 15:30:24 + err = !workhorse(gnu, usage, argc, argv, action, single_minus_longopt, true, min_abbr_len); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +inline void Stats::add(bool gnu, const Descriptor usage[], int argc, const char** argv, int min_abbr_len, build 12-Sep-2018 15:30:24 + bool single_minus_longopt) build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + // determine size of options array. This is the greatest index used in the usage + 1 build 12-Sep-2018 15:30:24 + int i = 0; build 12-Sep-2018 15:30:24 + while (usage[i].shortopt != 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (usage[i].index + 1 >= options_max) build 12-Sep-2018 15:30:24 + options_max = (usage[i].index + 1) + 1; // 1 more than necessary as sentinel build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ++i; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + CountOptionsAction action(&buffer_max); build 12-Sep-2018 15:30:24 + Parser::workhorse(gnu, usage, argc, argv, action, single_minus_longopt, false, min_abbr_len); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +inline bool Parser::workhorse(bool gnu, const Descriptor usage[], int numargs, const char** args, Action& action, build 12-Sep-2018 15:30:24 + bool single_minus_longopt, bool print_errors, int min_abbr_len) build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + // protect against NULL pointer build 12-Sep-2018 15:30:24 + if (args == 0) build 12-Sep-2018 15:30:24 + numargs = 0; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + int nonops = 0; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + while (numargs != 0 && *args != 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + const char* param = *args; // param can be --long-option, -srto or non-option argument build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // in POSIX mode the first non-option argument terminates the option list build 12-Sep-2018 15:30:24 + // a lone minus character is a non-option argument build 12-Sep-2018 15:30:24 + if (param[0] != '-' || param[1] == 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (gnu) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + ++nonops; build 12-Sep-2018 15:30:24 + ++args; build 12-Sep-2018 15:30:24 + if (numargs > 0) build 12-Sep-2018 15:30:24 + --numargs; build 12-Sep-2018 15:30:24 + continue; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // -- terminates the option list. The -- itself is skipped. build 12-Sep-2018 15:30:24 + if (param[1] == '-' && param[2] == 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + shift(args, nonops); build 12-Sep-2018 15:30:24 + ++args; build 12-Sep-2018 15:30:24 + if (numargs > 0) build 12-Sep-2018 15:30:24 + --numargs; build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + bool handle_short_options; build 12-Sep-2018 15:30:24 + const char* longopt_name; build 12-Sep-2018 15:30:24 + if (param[1] == '-') // if --long-option build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + handle_short_options = false; build 12-Sep-2018 15:30:24 + longopt_name = param + 2; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + handle_short_options = true; build 12-Sep-2018 15:30:24 + longopt_name = param + 1; //for testing a potential -long-option build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + bool try_single_minus_longopt = single_minus_longopt; build 12-Sep-2018 15:30:24 + bool have_more_args = (numargs > 1 || numargs < 0); // is referencing argv[1] valid? build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + do // loop over short options in group, for long options the body is executed only once build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + int idx = 0; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + const char* optarg = 0; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /******************** long option **********************/ build 12-Sep-2018 15:30:24 + if (handle_short_options == false || try_single_minus_longopt) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + idx = 0; build 12-Sep-2018 15:30:24 + while (usage[idx].longopt != 0 && !streq(usage[idx].longopt, longopt_name)) build 12-Sep-2018 15:30:24 + ++idx; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (usage[idx].longopt == 0 && min_abbr_len > 0) // if we should try to match abbreviated long options build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + int i1 = 0; build 12-Sep-2018 15:30:24 + while (usage[i1].longopt != 0 && !streqabbr(usage[i1].longopt, longopt_name, min_abbr_len)) build 12-Sep-2018 15:30:24 + ++i1; build 12-Sep-2018 15:30:24 + if (usage[i1].longopt != 0) build 12-Sep-2018 15:30:24 + { // now test if the match is unambiguous by checking for another match build 12-Sep-2018 15:30:24 + int i2 = i1 + 1; build 12-Sep-2018 15:30:24 + while (usage[i2].longopt != 0 && !streqabbr(usage[i2].longopt, longopt_name, min_abbr_len)) build 12-Sep-2018 15:30:24 + ++i2; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (usage[i2].longopt == 0) // if there was no second match it's unambiguous, so accept i1 as idx build 12-Sep-2018 15:30:24 + idx = i1; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // if we found something, disable handle_short_options (only relevant if single_minus_longopt) build 12-Sep-2018 15:30:24 + if (usage[idx].longopt != 0) build 12-Sep-2018 15:30:24 + handle_short_options = false; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + try_single_minus_longopt = false; // prevent looking for longopt in the middle of shortopt group build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + optarg = longopt_name; build 12-Sep-2018 15:30:24 + while (*optarg != 0 && *optarg != '=') build 12-Sep-2018 15:30:24 + ++optarg; build 12-Sep-2018 15:30:24 + if (*optarg == '=') // attached argument build 12-Sep-2018 15:30:24 + ++optarg; build 12-Sep-2018 15:30:24 + else build 12-Sep-2018 15:30:24 + // possibly detached argument build 12-Sep-2018 15:30:24 + optarg = (have_more_args ? args[1] : 0); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /************************ short option ***********************************/ build 12-Sep-2018 15:30:24 + if (handle_short_options) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (*++param == 0) // point at the 1st/next option character build 12-Sep-2018 15:30:24 + break; // end of short option group build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + idx = 0; build 12-Sep-2018 15:30:24 + while (usage[idx].shortopt != 0 && !instr(*param, usage[idx].shortopt)) build 12-Sep-2018 15:30:24 + ++idx; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (param[1] == 0) // if the potential argument is separate build 12-Sep-2018 15:30:24 + optarg = (have_more_args ? args[1] : 0); build 12-Sep-2018 15:30:24 + else build 12-Sep-2018 15:30:24 + // if the potential argument is attached build 12-Sep-2018 15:30:24 + optarg = param + 1; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + const Descriptor* descriptor = &usage[idx]; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (descriptor->shortopt == 0) /************** unknown option ********************/ build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + // look for dummy entry (shortopt == "" and longopt == "") to use as Descriptor for unknown options build 12-Sep-2018 15:30:24 + idx = 0; build 12-Sep-2018 15:30:24 + while (usage[idx].shortopt != 0 && (usage[idx].shortopt[0] != 0 || usage[idx].longopt[0] != 0)) build 12-Sep-2018 15:30:24 + ++idx; build 12-Sep-2018 15:30:24 + descriptor = (usage[idx].shortopt == 0 ? 0 : &usage[idx]); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (descriptor != 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + Option option(descriptor, param, optarg); build 12-Sep-2018 15:30:24 + switch (descriptor->check_arg(option, print_errors)) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + case ARG_ILLEGAL: build 12-Sep-2018 15:30:24 + return false; // fatal build 12-Sep-2018 15:30:24 + case ARG_OK: build 12-Sep-2018 15:30:24 + // skip one element of the argument vector, if it's a separated argument build 12-Sep-2018 15:30:24 + if (optarg != 0 && have_more_args && optarg == args[1]) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + shift(args, nonops); build 12-Sep-2018 15:30:24 + if (numargs > 0) build 12-Sep-2018 15:30:24 + --numargs; build 12-Sep-2018 15:30:24 + ++args; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // No further short options are possible after an argument build 12-Sep-2018 15:30:24 + handle_short_options = false; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case ARG_IGNORE: build 12-Sep-2018 15:30:24 + case ARG_NONE: build 12-Sep-2018 15:30:24 + option.arg = 0; build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (!action.perform(option)) build 12-Sep-2018 15:30:24 + return false; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + } while (handle_short_options); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + shift(args, nonops); build 12-Sep-2018 15:30:24 + ++args; build 12-Sep-2018 15:30:24 + if (numargs > 0) build 12-Sep-2018 15:30:24 + --numargs; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + } // while build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (numargs > 0 && *args == 0) // It's a bug in the caller if numargs is greater than the actual number build 12-Sep-2018 15:30:24 + numargs = 0; // of arguments, but as a service to the user we fix this if we spot it. build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (numargs < 0) // if we don't know the number of remaining non-option arguments build 12-Sep-2018 15:30:24 + { // we need to count them build 12-Sep-2018 15:30:24 + numargs = 0; build 12-Sep-2018 15:30:24 + while (args[numargs] != 0) build 12-Sep-2018 15:30:24 + ++numargs; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + return action.finished(numargs + nonops, args - nonops); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief The implementation of option::printUsage(). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 +struct PrintUsageImplementation build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Interface for Functors that write (part of) a string somewhere. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + struct IStringWriter build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Writes the given number of chars beginning at the given pointer somewhere. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + virtual void operator()(const char*, int) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Encapsulates a function with signature func(string, size) where build 12-Sep-2018 15:30:24 + * string can be initialized with a const char* and size with an int. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + template build 12-Sep-2018 15:30:24 + struct FunctionWriter: public IStringWriter build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + Function* write; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void operator()(const char* str, int size) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + (*write)(str, size); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + FunctionWriter(Function* w) : build 12-Sep-2018 15:30:24 + write(w) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Encapsulates a reference to an object with a write(string, size) build 12-Sep-2018 15:30:24 + * method like that of @c std::ostream. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + template build 12-Sep-2018 15:30:24 + struct OStreamWriter: public IStringWriter build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + OStream& ostream; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void operator()(const char* str, int size) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + ostream.write(str, size); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + OStreamWriter(OStream& o) : build 12-Sep-2018 15:30:24 + ostream(o) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Like OStreamWriter but encapsulates a @c const reference, which is build 12-Sep-2018 15:30:24 + * typically a temporary object of a user class. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + template build 12-Sep-2018 15:30:24 + struct TemporaryWriter: public IStringWriter build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + const Temporary& userstream; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void operator()(const char* str, int size) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + userstream.write(str, size); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + TemporaryWriter(const Temporary& u) : build 12-Sep-2018 15:30:24 + userstream(u) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Encapsulates a function with the signature func(fd, string, size) (the build 12-Sep-2018 15:30:24 + * signature of the @c write() system call) build 12-Sep-2018 15:30:24 + * where fd can be initialized from an int, string from a const char* and size from an int. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + template build 12-Sep-2018 15:30:24 + struct SyscallWriter: public IStringWriter build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + Syscall* write; build 12-Sep-2018 15:30:24 + int fd; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void operator()(const char* str, int size) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + (*write)(fd, str, size); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + SyscallWriter(Syscall* w, int f) : build 12-Sep-2018 15:30:24 + write(w), fd(f) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Encapsulates a function with the same signature as @c std::fwrite(). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + template build 12-Sep-2018 15:30:24 + struct StreamWriter: public IStringWriter build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + Function* fwrite; build 12-Sep-2018 15:30:24 + Stream* stream; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + virtual void operator()(const char* str, int size) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + (*fwrite)(str, size, 1, stream); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + StreamWriter(Function* w, Stream* s) : build 12-Sep-2018 15:30:24 + fwrite(w), stream(s) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Sets i1 = max(i1, i2) build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + static void upmax(int& i1, int i2) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + i1 = (i1 >= i2 ? i1 : i2); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Moves the "cursor" to column @c want_x assuming it is currently at column @c x build 12-Sep-2018 15:30:24 + * and sets @c x=want_x . build 12-Sep-2018 15:30:24 + * If x > want_x , a line break is output before indenting. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @param write Spaces and possibly a line break are written via this functor to get build 12-Sep-2018 15:30:24 + * the desired indentation @c want_x . build 12-Sep-2018 15:30:24 + * @param[in,out] x the current indentation. Set to @c want_x by this method. build 12-Sep-2018 15:30:24 + * @param want_x the desired indentation. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + static void indent(IStringWriter& write, int& x, int want_x) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + int indent = want_x - x; build 12-Sep-2018 15:30:24 + if (indent < 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + write("\n", 1); build 12-Sep-2018 15:30:24 + indent = want_x; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (indent > 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + char space = ' '; build 12-Sep-2018 15:30:24 + for (int i = 0; i < indent; ++i) build 12-Sep-2018 15:30:24 + write(&space, 1); build 12-Sep-2018 15:30:24 + x = want_x; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns true if ch is the unicode code point of a wide character. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @note build 12-Sep-2018 15:30:24 + * The following character ranges are treated as wide build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * 1100..115F build 12-Sep-2018 15:30:24 + * 2329..232A (just 2 characters!) build 12-Sep-2018 15:30:24 + * 2E80..A4C6 except for 303F build 12-Sep-2018 15:30:24 + * A960..A97C build 12-Sep-2018 15:30:24 + * AC00..D7FB build 12-Sep-2018 15:30:24 + * F900..FAFF build 12-Sep-2018 15:30:24 + * FE10..FE6B build 12-Sep-2018 15:30:24 + * FF01..FF60 build 12-Sep-2018 15:30:24 + * FFE0..FFE6 build 12-Sep-2018 15:30:24 + * 1B000...... build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + static bool isWideChar(unsigned ch) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (ch == 0x303F) build 12-Sep-2018 15:30:24 + return false; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + return ((0x1100 <= ch && ch <= 0x115F) || (0x2329 <= ch && ch <= 0x232A) || (0x2E80 <= ch && ch <= 0xA4C6) build 12-Sep-2018 15:30:24 + || (0xA960 <= ch && ch <= 0xA97C) || (0xAC00 <= ch && ch <= 0xD7FB) || (0xF900 <= ch && ch <= 0xFAFF) build 12-Sep-2018 15:30:24 + || (0xFE10 <= ch && ch <= 0xFE6B) || (0xFF01 <= ch && ch <= 0xFF60) || (0xFFE0 <= ch && ch <= 0xFFE6) build 12-Sep-2018 15:30:24 + || (0x1B000 <= ch)); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Splits a @c Descriptor[] array into tables, rows, lines and columns and build 12-Sep-2018 15:30:24 + * iterates over these components. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * The top-level organizational unit is the @e table. build 12-Sep-2018 15:30:24 + * A table begins at a Descriptor with @c help!=NULL and extends up to build 12-Sep-2018 15:30:24 + * a Descriptor with @c help==NULL. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * A table consists of @e rows. Due to line-wrapping and explicit breaks build 12-Sep-2018 15:30:24 + * a row may take multiple lines on screen. Rows within the table are separated build 12-Sep-2018 15:30:24 + * by \\n. They never cross Descriptor boundaries. This means a row ends either build 12-Sep-2018 15:30:24 + * at \\n or the 0 at the end of the help string. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * A row consists of columns/cells. Columns/cells within a row are separated by \\t. build 12-Sep-2018 15:30:24 + * Line breaks within a cell are marked by \\v. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Rows in the same table need not have the same number of columns/cells. The build 12-Sep-2018 15:30:24 + * extreme case are interjections, which are rows that contain neither \\t nor \\v. build 12-Sep-2018 15:30:24 + * These are NOT treated specially by LinePartIterator, but they are treated build 12-Sep-2018 15:30:24 + * specially by printUsage(). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * LinePartIterator iterates through the usage at 3 levels: table, row and part. build 12-Sep-2018 15:30:24 + * Tables and rows are as described above. A @e part is a line within a cell. build 12-Sep-2018 15:30:24 + * LinePartIterator iterates through 1st parts of all cells, then through the 2nd build 12-Sep-2018 15:30:24 + * parts of all cells (if any),... @n build 12-Sep-2018 15:30:24 + * Example: The row "1 \v 3 \t 2 \v 4" has 2 cells/columns and 4 parts. build 12-Sep-2018 15:30:24 + * The parts will be returned in the order 1, 2, 3, 4. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * It is possible that some cells have fewer parts than others. In this case build 12-Sep-2018 15:30:24 + * LinePartIterator will "fill up" these cells with 0-length parts. IOW, LinePartIterator build 12-Sep-2018 15:30:24 + * always returns the same number of parts for each column. Note that this is different build 12-Sep-2018 15:30:24 + * from the way rows and columns are handled. LinePartIterator does @e not guarantee that build 12-Sep-2018 15:30:24 + * the same number of columns will be returned for each row. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + class LinePartIterator build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + const Descriptor* tablestart; //!< The 1st descriptor of the current table. build 12-Sep-2018 15:30:24 + const Descriptor* rowdesc; //!< The Descriptor that contains the current row. build 12-Sep-2018 15:30:24 + const char* rowstart; //!< Ptr to 1st character of current row within rowdesc->help. build 12-Sep-2018 15:30:24 + const char* ptr; //!< Ptr to current part within the current row. build 12-Sep-2018 15:30:24 + int col; //!< Index of current column. build 12-Sep-2018 15:30:24 + int len; //!< Length of the current part (that ptr points at) in BYTES build 12-Sep-2018 15:30:24 + int screenlen; //!< Length of the current part in screen columns (taking narrow/wide chars into account). build 12-Sep-2018 15:30:24 + int max_line_in_block; //!< Greatest index of a line within the block. This is the number of \\v within the cell with the most \\vs. build 12-Sep-2018 15:30:24 + int line_in_block; //!< Line index within the current cell of the current part. build 12-Sep-2018 15:30:24 + int target_line_in_block; //!< Line index of the parts we should return to the user on this iteration. build 12-Sep-2018 15:30:24 + bool hit_target_line; //!< Flag whether we encountered a part with line index target_line_in_block in the current cell. build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Determines the byte and character lengths of the part at @ref ptr and build 12-Sep-2018 15:30:24 + * stores them in @ref len and @ref screenlen respectively. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + void update_length() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + screenlen = 0; build 12-Sep-2018 15:30:24 + for (len = 0; ptr[len] != 0 && ptr[len] != '\v' && ptr[len] != '\t' && ptr[len] != '\n'; ++len) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + ++screenlen; build 12-Sep-2018 15:30:24 + unsigned ch = (unsigned char) ptr[len]; build 12-Sep-2018 15:30:24 + if (ch > 0xC1) // everything <= 0xC1 (yes, even 0xC1 itself) is not a valid UTF-8 start byte build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + // int __builtin_clz (unsigned int x) build 12-Sep-2018 15:30:24 + // Returns the number of leading 0-bits in x, starting at the most significant bit build 12-Sep-2018 15:30:24 + unsigned mask = (unsigned) -1 >> __builtin_clz(ch ^ 0xff); build 12-Sep-2018 15:30:24 + ch = ch & mask; // mask out length bits, we don't verify their correctness build 12-Sep-2018 15:30:24 + while (((unsigned char) ptr[len + 1] ^ 0x80) <= 0x3F) // while next byte is continuation byte build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + ch = (ch << 6) ^ (unsigned char) ptr[len + 1] ^ 0x80; // add continuation to char code build 12-Sep-2018 15:30:24 + ++len; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + // ch is the decoded unicode code point build 12-Sep-2018 15:30:24 + if (ch >= 0x1100 && isWideChar(ch)) // the test for 0x1100 is here to avoid the function call in the Latin case build 12-Sep-2018 15:30:24 + ++screenlen; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + public: build 12-Sep-2018 15:30:24 + //! @brief Creates an iterator for @c usage. build 12-Sep-2018 15:30:24 + LinePartIterator(const Descriptor usage[]) : build 12-Sep-2018 15:30:24 + tablestart(usage), rowdesc(0), rowstart(0), ptr(0), col(-1), len(0), max_line_in_block(0), line_in_block(0), build 12-Sep-2018 15:30:24 + target_line_in_block(0), hit_target_line(true) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Moves iteration to the next table (if any). Has to be called once on a new build 12-Sep-2018 15:30:24 + * LinePartIterator to move to the 1st table. build 12-Sep-2018 15:30:24 + * @retval false if moving to next table failed because no further table exists. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + bool nextTable() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + // If this is NOT the first time nextTable() is called after the constructor, build 12-Sep-2018 15:30:24 + // then skip to the next table break (i.e. a Descriptor with help == 0) build 12-Sep-2018 15:30:24 + if (rowdesc != 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + while (tablestart->help != 0 && tablestart->shortopt != 0) build 12-Sep-2018 15:30:24 + ++tablestart; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Find the next table after the break (if any) build 12-Sep-2018 15:30:24 + while (tablestart->help == 0 && tablestart->shortopt != 0) build 12-Sep-2018 15:30:24 + ++tablestart; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + restartTable(); build 12-Sep-2018 15:30:24 + return rowstart != 0; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Reset iteration to the beginning of the current table. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + void restartTable() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + rowdesc = tablestart; build 12-Sep-2018 15:30:24 + rowstart = tablestart->help; build 12-Sep-2018 15:30:24 + ptr = 0; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Moves iteration to the next row (if any). Has to be called once after each call to build 12-Sep-2018 15:30:24 + * @ref nextTable() to move to the 1st row of the table. build 12-Sep-2018 15:30:24 + * @retval false if moving to next row failed because no further row exists. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + bool nextRow() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (ptr == 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + restartRow(); build 12-Sep-2018 15:30:24 + return rowstart != 0; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + while (*ptr != 0 && *ptr != '\n') build 12-Sep-2018 15:30:24 + ++ptr; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (*ptr == 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if ((rowdesc + 1)->help == 0) // table break build 12-Sep-2018 15:30:24 + return false; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ++rowdesc; build 12-Sep-2018 15:30:24 + rowstart = rowdesc->help; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else // if (*ptr == '\n') build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + rowstart = ptr + 1; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + restartRow(); build 12-Sep-2018 15:30:24 + return true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Reset iteration to the beginning of the current row. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + void restartRow() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + ptr = rowstart; build 12-Sep-2018 15:30:24 + col = -1; build 12-Sep-2018 15:30:24 + len = 0; build 12-Sep-2018 15:30:24 + screenlen = 0; build 12-Sep-2018 15:30:24 + max_line_in_block = 0; build 12-Sep-2018 15:30:24 + line_in_block = 0; build 12-Sep-2018 15:30:24 + target_line_in_block = 0; build 12-Sep-2018 15:30:24 + hit_target_line = true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Moves iteration to the next part (if any). Has to be called once after each call to build 12-Sep-2018 15:30:24 + * @ref nextRow() to move to the 1st part of the row. build 12-Sep-2018 15:30:24 + * @retval false if moving to next part failed because no further part exists. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * See @ref LinePartIterator for details about the iteration. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + bool next() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (ptr == 0) build 12-Sep-2018 15:30:24 + return false; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (col == -1) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + col = 0; build 12-Sep-2018 15:30:24 + update_length(); build 12-Sep-2018 15:30:24 + return true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ptr += len; build 12-Sep-2018 15:30:24 + while (true) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + switch (*ptr) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + case '\v': build 12-Sep-2018 15:30:24 + upmax(max_line_in_block, ++line_in_block); build 12-Sep-2018 15:30:24 + ++ptr; build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case '\t': build 12-Sep-2018 15:30:24 + if (!hit_target_line) // if previous column did not have the targetline build 12-Sep-2018 15:30:24 + { // then "insert" a 0-length part build 12-Sep-2018 15:30:24 + update_length(); build 12-Sep-2018 15:30:24 + hit_target_line = true; build 12-Sep-2018 15:30:24 + return true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + hit_target_line = false; build 12-Sep-2018 15:30:24 + line_in_block = 0; build 12-Sep-2018 15:30:24 + ++col; build 12-Sep-2018 15:30:24 + ++ptr; build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + case 0: build 12-Sep-2018 15:30:24 + case '\n': build 12-Sep-2018 15:30:24 + if (!hit_target_line) // if previous column did not have the targetline build 12-Sep-2018 15:30:24 + { // then "insert" a 0-length part build 12-Sep-2018 15:30:24 + update_length(); build 12-Sep-2018 15:30:24 + hit_target_line = true; build 12-Sep-2018 15:30:24 + return true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (++target_line_in_block > max_line_in_block) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + update_length(); build 12-Sep-2018 15:30:24 + return false; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + hit_target_line = false; build 12-Sep-2018 15:30:24 + line_in_block = 0; build 12-Sep-2018 15:30:24 + col = 0; build 12-Sep-2018 15:30:24 + ptr = rowstart; build 12-Sep-2018 15:30:24 + continue; build 12-Sep-2018 15:30:24 + default: build 12-Sep-2018 15:30:24 + ++ptr; build 12-Sep-2018 15:30:24 + continue; build 12-Sep-2018 15:30:24 + } // switch build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (line_in_block == target_line_in_block) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + update_length(); build 12-Sep-2018 15:30:24 + hit_target_line = true; build 12-Sep-2018 15:30:24 + return true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } // while build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns the index (counting from 0) of the column in which build 12-Sep-2018 15:30:24 + * the part pointed to by @ref data() is located. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + int column() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return col; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns the index (counting from 0) of the line within the current column build 12-Sep-2018 15:30:24 + * this part belongs to. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + int line() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return target_line_in_block; // NOT line_in_block !!! It would be wrong if !hit_target_line build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns the length of the part pointed to by @ref data() in raw chars (not UTF-8 characters). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + int length() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return len; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns the width in screen columns of the part pointed to by @ref data(). build 12-Sep-2018 15:30:24 + * Takes multi-byte UTF-8 sequences and wide characters into account. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + int screenLength() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return screenlen; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Returns the current part of the iteration. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const char* data() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return ptr; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief Takes input and line wraps it, writing out one line at a time so that build 12-Sep-2018 15:30:24 + * it can be interleaved with output from other columns. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * The LineWrapper is used to handle the last column of each table as well as interjections. build 12-Sep-2018 15:30:24 + * The LineWrapper is called once for each line of output. If the data given to it fits build 12-Sep-2018 15:30:24 + * into the designated width of the last column it is simply written out. If there build 12-Sep-2018 15:30:24 + * is too much data, an appropriate split point is located and only the data up to this build 12-Sep-2018 15:30:24 + * split point is written out. The rest of the data is queued for the next line. build 12-Sep-2018 15:30:24 + * That way the last column can be line wrapped and interleaved with data from build 12-Sep-2018 15:30:24 + * other columns. The following example makes this clearer: build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * Column 1,1 Column 2,1 This is a long text build 12-Sep-2018 15:30:24 + * Column 1,2 Column 2,2 that does not fit into build 12-Sep-2018 15:30:24 + * a single line. build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * The difficulty in producing this output is that the whole string build 12-Sep-2018 15:30:24 + * "This is a long text that does not fit into a single line" is the build 12-Sep-2018 15:30:24 + * 1st and only part of column 3. In order to produce the above build 12-Sep-2018 15:30:24 + * output the string must be output piecemeal, interleaved with build 12-Sep-2018 15:30:24 + * the data from the other columns. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + class LineWrapper build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + static const int bufmask = 15; //!< Must be a power of 2 minus 1. build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Ring buffer for length component of pair (data, length). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + int lenbuf[bufmask + 1]; build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Ring buffer for data component of pair (data, length). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + const char* datbuf[bufmask + 1]; build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief The indentation of the column to which the LineBuffer outputs. LineBuffer build 12-Sep-2018 15:30:24 + * assumes that the indentation has already been written when @ref process() build 12-Sep-2018 15:30:24 + * is called, so this value is only used when a buffer flush requires writing build 12-Sep-2018 15:30:24 + * additional lines of output. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + int x; build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief The width of the column to line wrap. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + int width; build 12-Sep-2018 15:30:24 + int head; //!< @brief index for next write build 12-Sep-2018 15:30:24 + int tail; //!< @brief index for next read - 1 (i.e. increment tail BEFORE read) build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Multiple methods of LineWrapper may decide to flush part of the buffer to build 12-Sep-2018 15:30:24 + * free up space. The contract of process() says that only 1 line is output. So build 12-Sep-2018 15:30:24 + * this variable is used to track whether something has output a line. It is build 12-Sep-2018 15:30:24 + * reset at the beginning of process() and checked at the end to decide if build 12-Sep-2018 15:30:24 + * output has already occurred or is still needed. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + bool wrote_something; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + bool buf_empty() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return ((tail + 1) & bufmask) == head; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + bool buf_full() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return tail == head; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + void buf_store(const char* data, int len) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + lenbuf[head] = len; build 12-Sep-2018 15:30:24 + datbuf[head] = data; build 12-Sep-2018 15:30:24 + head = (head + 1) & bufmask; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //! @brief Call BEFORE reading ...buf[tail]. build 12-Sep-2018 15:30:24 + void buf_next() build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + tail = (tail + 1) & bufmask; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Writes (data,len) into the ring buffer. If the buffer is full, a single line build 12-Sep-2018 15:30:24 + * is flushed out of the buffer into @c write. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + void output(IStringWriter& write, const char* data, int len) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (buf_full()) build 12-Sep-2018 15:30:24 + write_one_line(write); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + buf_store(data, len); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Writes a single line of output from the buffer to @c write. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + void write_one_line(IStringWriter& write) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (wrote_something) // if we already wrote something, we need to start a new line build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + write("\n", 1); build 12-Sep-2018 15:30:24 + int _ = 0; build 12-Sep-2018 15:30:24 + indent(write, _, x); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (!buf_empty()) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + buf_next(); build 12-Sep-2018 15:30:24 + write(datbuf[tail], lenbuf[tail]); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + wrote_something = true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + public: build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Writes out all remaining data from the LineWrapper using @c write. build 12-Sep-2018 15:30:24 + * Unlike @ref process() this method indents all lines including the first and build 12-Sep-2018 15:30:24 + * will output a \\n at the end (but only if something has been written). build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + void flush(IStringWriter& write) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (buf_empty()) build 12-Sep-2018 15:30:24 + return; build 12-Sep-2018 15:30:24 + int _ = 0; build 12-Sep-2018 15:30:24 + indent(write, _, x); build 12-Sep-2018 15:30:24 + wrote_something = false; build 12-Sep-2018 15:30:24 + while (!buf_empty()) build 12-Sep-2018 15:30:24 + write_one_line(write); build 12-Sep-2018 15:30:24 + write("\n", 1); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Process, wrap and output the next piece of data. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * process() will output at least one line of output. This is not necessarily build 12-Sep-2018 15:30:24 + * the @c data passed in. It may be data queued from a prior call to process(). build 12-Sep-2018 15:30:24 + * If the internal buffer is full, more than 1 line will be output. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * process() assumes that the a proper amount of indentation has already been build 12-Sep-2018 15:30:24 + * output. It won't write any further indentation before the 1st line. If build 12-Sep-2018 15:30:24 + * more than 1 line is written due to buffer constraints, the lines following build 12-Sep-2018 15:30:24 + * the first will be indented by this method, though. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * No \\n is written by this method after the last line that is written. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @param write where to write the data. build 12-Sep-2018 15:30:24 + * @param data the new chunk of data to write. build 12-Sep-2018 15:30:24 + * @param len the length of the chunk of data to write. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + void process(IStringWriter& write, const char* data, int len) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + wrote_something = false; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + while (len > 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (len <= width) // quick test that works because utf8width <= len (all wide chars have at least 2 bytes) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + output(write, data, len); build 12-Sep-2018 15:30:24 + len = 0; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else // if (len > width) it's possible (but not guaranteed) that utf8len > width build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + int utf8width = 0; build 12-Sep-2018 15:30:24 + int maxi = 0; build 12-Sep-2018 15:30:24 + while (maxi < len && utf8width < width) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + int charbytes = 1; build 12-Sep-2018 15:30:24 + unsigned ch = (unsigned char) data[maxi]; build 12-Sep-2018 15:30:24 + if (ch > 0xC1) // everything <= 0xC1 (yes, even 0xC1 itself) is not a valid UTF-8 start byte build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + // int __builtin_clz (unsigned int x) build 12-Sep-2018 15:30:24 + // Returns the number of leading 0-bits in x, starting at the most significant bit build 12-Sep-2018 15:30:24 + unsigned mask = (unsigned) -1 >> __builtin_clz(ch ^ 0xff); build 12-Sep-2018 15:30:24 + ch = ch & mask; // mask out length bits, we don't verify their correctness build 12-Sep-2018 15:30:24 + while ((maxi + charbytes < len) && // build 12-Sep-2018 15:30:24 + (((unsigned char) data[maxi + charbytes] ^ 0x80) <= 0x3F)) // while next byte is continuation byte build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + ch = (ch << 6) ^ (unsigned char) data[maxi + charbytes] ^ 0x80; // add continuation to char code build 12-Sep-2018 15:30:24 + ++charbytes; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + // ch is the decoded unicode code point build 12-Sep-2018 15:30:24 + if (ch >= 0x1100 && isWideChar(ch)) // the test for 0x1100 is here to avoid the function call in the Latin case build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (utf8width + 2 > width) build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + ++utf8width; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + ++utf8width; build 12-Sep-2018 15:30:24 + maxi += charbytes; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // data[maxi-1] is the last byte of the UTF-8 sequence of the last character that fits build 12-Sep-2018 15:30:24 + // onto the 1st line. If maxi == len, all characters fit on the line. build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (maxi == len) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + output(write, data, len); build 12-Sep-2018 15:30:24 + len = 0; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else // if (maxi < len) at least 1 character (data[maxi] that is) doesn't fit on the line build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + int i; build 12-Sep-2018 15:30:24 + for (i = maxi; i >= 0; --i) build 12-Sep-2018 15:30:24 + if (data[i] == ' ') build 12-Sep-2018 15:30:24 + break; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (i >= 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + output(write, data, i); build 12-Sep-2018 15:30:24 + data += i + 1; build 12-Sep-2018 15:30:24 + len -= i + 1; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else // did not find a space to split at => split before data[maxi] build 12-Sep-2018 15:30:24 + { // data[maxi] is always the beginning of a character, never a continuation byte build 12-Sep-2018 15:30:24 + output(write, data, maxi); build 12-Sep-2018 15:30:24 + data += maxi; build 12-Sep-2018 15:30:24 + len -= maxi; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (!wrote_something) // if we didn't already write something to make space in the buffer build 12-Sep-2018 15:30:24 + write_one_line(write); // write at most one line of actual output build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @brief Constructs a LineWrapper that wraps its output to fit into build 12-Sep-2018 15:30:24 + * screen columns @c x1 (incl.) to @c x2 (excl.). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @c x1 gives the indentation LineWrapper uses if it needs to indent. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + LineWrapper(int x1, int x2) : build 12-Sep-2018 15:30:24 + x(x1), width(x2 - x1), head(0), tail(bufmask) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (width < 2) // because of wide characters we need at least width 2 or the code breaks build 12-Sep-2018 15:30:24 + width = 2; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * @internal build 12-Sep-2018 15:30:24 + * @brief This is the implementation that is shared between all printUsage() templates. build 12-Sep-2018 15:30:24 + * Because all printUsage() templates share this implementation, there is no template bloat. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + static void printUsage(IStringWriter& write, const Descriptor usage[], int width = 80, // build 12-Sep-2018 15:30:24 + int last_column_min_percent = 50, int last_column_own_line_max_percent = 75) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (width < 1) // protect against nonsense values build 12-Sep-2018 15:30:24 + width = 80; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (width > 10000) // protect against overflow in the following computation build 12-Sep-2018 15:30:24 + width = 10000; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + int last_column_min_width = ((width * last_column_min_percent) + 50) / 100; build 12-Sep-2018 15:30:24 + int last_column_own_line_max_width = ((width * last_column_own_line_max_percent) + 50) / 100; build 12-Sep-2018 15:30:24 + if (last_column_own_line_max_width == 0) build 12-Sep-2018 15:30:24 + last_column_own_line_max_width = 1; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + LinePartIterator part(usage); build 12-Sep-2018 15:30:24 + while (part.nextTable()) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /***************** Determine column widths *******************************/ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + const int maxcolumns = 8; // 8 columns are enough for everyone build 12-Sep-2018 15:30:24 + int col_width[maxcolumns]; build 12-Sep-2018 15:30:24 + int lastcolumn; build 12-Sep-2018 15:30:24 + int leftwidth; build 12-Sep-2018 15:30:24 + int overlong_column_threshold = 10000; build 12-Sep-2018 15:30:24 + do build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + lastcolumn = 0; build 12-Sep-2018 15:30:24 + for (int i = 0; i < maxcolumns; ++i) build 12-Sep-2018 15:30:24 + col_width[i] = 0; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + part.restartTable(); build 12-Sep-2018 15:30:24 + while (part.nextRow()) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + while (part.next()) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (part.column() < maxcolumns) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + upmax(lastcolumn, part.column()); build 12-Sep-2018 15:30:24 + if (part.screenLength() < overlong_column_threshold) build 12-Sep-2018 15:30:24 + // We don't let rows that don't use table separators (\t or \v) influence build 12-Sep-2018 15:30:24 + // the width of column 0. This allows the user to interject section headers build 12-Sep-2018 15:30:24 + // or explanatory paragraphs that do not participate in the table layout. build 12-Sep-2018 15:30:24 + if (part.column() > 0 || part.line() > 0 || part.data()[part.length()] == '\t' build 12-Sep-2018 15:30:24 + || part.data()[part.length()] == '\v') build 12-Sep-2018 15:30:24 + upmax(col_width[part.column()], part.screenLength()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /* build 12-Sep-2018 15:30:24 + * If the last column doesn't fit on the same build 12-Sep-2018 15:30:24 + * line as the other columns, we can fix that by starting it on its own line. build 12-Sep-2018 15:30:24 + * However we can't do this for any of the columns 0..lastcolumn-1. build 12-Sep-2018 15:30:24 + * If their sum exceeds the maximum width we try to fix this by iteratively build 12-Sep-2018 15:30:24 + * ignoring the widest line parts in the width determination until build 12-Sep-2018 15:30:24 + * we arrive at a series of column widths that fit into one line. build 12-Sep-2018 15:30:24 + * The result is a layout where everything is nicely formatted build 12-Sep-2018 15:30:24 + * except for a few overlong fragments. build 12-Sep-2018 15:30:24 + * */ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + leftwidth = 0; build 12-Sep-2018 15:30:24 + overlong_column_threshold = 0; build 12-Sep-2018 15:30:24 + for (int i = 0; i < lastcolumn; ++i) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + leftwidth += col_width[i]; build 12-Sep-2018 15:30:24 + upmax(overlong_column_threshold, col_width[i]); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + } while (leftwidth > width); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /**************** Determine tab stops and last column handling **********************/ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + int tabstop[maxcolumns]; build 12-Sep-2018 15:30:24 + tabstop[0] = 0; build 12-Sep-2018 15:30:24 + for (int i = 1; i < maxcolumns; ++i) build 12-Sep-2018 15:30:24 + tabstop[i] = tabstop[i - 1] + col_width[i - 1]; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + int rightwidth = width - tabstop[lastcolumn]; build 12-Sep-2018 15:30:24 + bool print_last_column_on_own_line = false; build 12-Sep-2018 15:30:24 + if (rightwidth < last_column_min_width && // if we don't have the minimum requested width for the last column build 12-Sep-2018 15:30:24 + ( col_width[lastcolumn] == 0 || // and all last columns are > overlong_column_threshold build 12-Sep-2018 15:30:24 + rightwidth < col_width[lastcolumn] // or there is at least one last column that requires more than the space available build 12-Sep-2018 15:30:24 + ) build 12-Sep-2018 15:30:24 + ) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + print_last_column_on_own_line = true; build 12-Sep-2018 15:30:24 + rightwidth = last_column_own_line_max_width; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // If lastcolumn == 0 we must disable print_last_column_on_own_line because build 12-Sep-2018 15:30:24 + // otherwise 2 copies of the last (and only) column would be output. build 12-Sep-2018 15:30:24 + // Actually this is just defensive programming. It is currently not build 12-Sep-2018 15:30:24 + // possible that lastcolumn==0 and print_last_column_on_own_line==true build 12-Sep-2018 15:30:24 + // at the same time, because lastcolumn==0 => tabstop[lastcolumn] == 0 => build 12-Sep-2018 15:30:24 + // rightwidth==width => rightwidth>=last_column_min_width (unless someone passes build 12-Sep-2018 15:30:24 + // a bullshit value >100 for last_column_min_percent) => the above if condition build 12-Sep-2018 15:30:24 + // is false => print_last_column_on_own_line==false build 12-Sep-2018 15:30:24 + if (lastcolumn == 0) build 12-Sep-2018 15:30:24 + print_last_column_on_own_line = false; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + LineWrapper lastColumnLineWrapper(width - rightwidth, width); build 12-Sep-2018 15:30:24 + LineWrapper interjectionLineWrapper(0, width); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + part.restartTable(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /***************** Print out all rows of the table *************************************/ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + while (part.nextRow()) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + int x = -1; build 12-Sep-2018 15:30:24 + while (part.next()) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (part.column() > lastcolumn) build 12-Sep-2018 15:30:24 + continue; // drop excess columns (can happen if lastcolumn == maxcolumns-1) build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (part.column() == 0) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (x >= 0) build 12-Sep-2018 15:30:24 + write("\n", 1); build 12-Sep-2018 15:30:24 + x = 0; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + indent(write, x, tabstop[part.column()]); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if ((part.column() < lastcolumn) build 12-Sep-2018 15:30:24 + && (part.column() > 0 || part.line() > 0 || part.data()[part.length()] == '\t' build 12-Sep-2018 15:30:24 + || part.data()[part.length()] == '\v')) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + write(part.data(), part.length()); build 12-Sep-2018 15:30:24 + x += part.screenLength(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else // either part.column() == lastcolumn or we are in the special case of build 12-Sep-2018 15:30:24 + // an interjection that doesn't contain \v or \t build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + // NOTE: This code block is not necessarily executed for build 12-Sep-2018 15:30:24 + // each line, because some rows may have fewer columns. build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + LineWrapper& lineWrapper = (part.column() == 0) ? interjectionLineWrapper : lastColumnLineWrapper; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (!print_last_column_on_own_line || part.column() != lastcolumn) build 12-Sep-2018 15:30:24 + lineWrapper.process(write, part.data(), part.length()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } // while build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (print_last_column_on_own_line) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + part.restartRow(); build 12-Sep-2018 15:30:24 + while (part.next()) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (part.column() == lastcolumn) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + write("\n", 1); build 12-Sep-2018 15:30:24 + int _ = 0; build 12-Sep-2018 15:30:24 + indent(write, _, width - rightwidth); build 12-Sep-2018 15:30:24 + lastColumnLineWrapper.process(write, part.data(), part.length()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + write("\n", 1); build 12-Sep-2018 15:30:24 + lastColumnLineWrapper.flush(write); build 12-Sep-2018 15:30:24 + interjectionLineWrapper.flush(write); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 +; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +/** build 12-Sep-2018 15:30:24 + * @brief Outputs a nicely formatted usage string with support for multi-column formatting build 12-Sep-2018 15:30:24 + * and line-wrapping. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * printUsage() takes the @c help texts of a Descriptor[] array and formats them into build 12-Sep-2018 15:30:24 + * a usage message, wrapping lines to achieve the desired output width. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Table formatting: build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Aside from plain strings which are simply line-wrapped, the usage may contain tables. Tables build 12-Sep-2018 15:30:24 + * are used to align elements in the output. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * // Without a table. The explanatory texts are not aligned. build 12-Sep-2018 15:30:24 + * -c, --create |Creates something. build 12-Sep-2018 15:30:24 + * -k, --kill |Destroys something. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * // With table formatting. The explanatory texts are aligned. build 12-Sep-2018 15:30:24 + * -c, --create |Creates something. build 12-Sep-2018 15:30:24 + * -k, --kill |Destroys something. build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Table formatting removes the need to pad help texts manually with spaces to achieve build 12-Sep-2018 15:30:24 + * alignment. To create a table, simply insert \\t (tab) characters to separate the cells build 12-Sep-2018 15:30:24 + * within a row. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * const option::Descriptor usage[] = { build 12-Sep-2018 15:30:24 + * {..., "-c, --create \tCreates something." }, build 12-Sep-2018 15:30:24 + * {..., "-k, --kill \tDestroys something." }, ... build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Note that you must include the minimum amount of space desired between cells yourself. build 12-Sep-2018 15:30:24 + * Table formatting will insert further spaces as needed to achieve alignment. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * You can insert line breaks within cells by using \\v (vertical tab). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * const option::Descriptor usage[] = { build 12-Sep-2018 15:30:24 + * {..., "-c,\v--create \tCreates\vsomething." }, build 12-Sep-2018 15:30:24 + * {..., "-k,\v--kill \tDestroys\vsomething." }, ... build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * // results in build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * -c, Creates build 12-Sep-2018 15:30:24 + * --create something. build 12-Sep-2018 15:30:24 + * -k, Destroys build 12-Sep-2018 15:30:24 + * --kill something. build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * You can mix lines that do not use \\t or \\v with those that do. The plain build 12-Sep-2018 15:30:24 + * lines will not mess up the table layout. Alignment of the table columns will build 12-Sep-2018 15:30:24 + * be maintained even across these interjections. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * const option::Descriptor usage[] = { build 12-Sep-2018 15:30:24 + * {..., "-c, --create \tCreates something." }, build 12-Sep-2018 15:30:24 + * {..., "----------------------------------" }, build 12-Sep-2018 15:30:24 + * {..., "-k, --kill \tDestroys something." }, ... build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * // results in build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * -c, --create Creates something. build 12-Sep-2018 15:30:24 + * ---------------------------------- build 12-Sep-2018 15:30:24 + * -k, --kill Destroys something. build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * You can have multiple tables within the same usage whose columns are build 12-Sep-2018 15:30:24 + * aligned independently. Simply insert a dummy Descriptor with @c help==0. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * const option::Descriptor usage[] = { build 12-Sep-2018 15:30:24 + * {..., "Long options:" }, build 12-Sep-2018 15:30:24 + * {..., "--very-long-option \tDoes something long." }, build 12-Sep-2018 15:30:24 + * {..., "--ultra-super-mega-long-option \tTakes forever to complete." }, build 12-Sep-2018 15:30:24 + * {..., 0 }, // ---------- table break ----------- build 12-Sep-2018 15:30:24 + * {..., "Short options:" }, build 12-Sep-2018 15:30:24 + * {..., "-s \tShort." }, build 12-Sep-2018 15:30:24 + * {..., "-q \tQuick." }, ... build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * // results in build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Long options: build 12-Sep-2018 15:30:24 + * --very-long-option Does something long. build 12-Sep-2018 15:30:24 + * --ultra-super-mega-long-option Takes forever to complete. build 12-Sep-2018 15:30:24 + * Short options: build 12-Sep-2018 15:30:24 + * -s Short. build 12-Sep-2018 15:30:24 + * -q Quick. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * // Without the table break it would be build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Long options: build 12-Sep-2018 15:30:24 + * --very-long-option Does something long. build 12-Sep-2018 15:30:24 + * --ultra-super-mega-long-option Takes forever to complete. build 12-Sep-2018 15:30:24 + * Short options: build 12-Sep-2018 15:30:24 + * -s Short. build 12-Sep-2018 15:30:24 + * -q Quick. build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Output methods: build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * Because TheLeanMeanC++Option parser is freestanding, you have to provide the means for build 12-Sep-2018 15:30:24 + * output in the first argument(s) to printUsage(). Because printUsage() is implemented as build 12-Sep-2018 15:30:24 + * a set of template functions, you have great flexibility in your choice of output build 12-Sep-2018 15:30:24 + * method. The following example demonstrates typical uses. Anything that's similar enough build 12-Sep-2018 15:30:24 + * will work. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * #include // write() build 12-Sep-2018 15:30:24 + * #include // cout build 12-Sep-2018 15:30:24 + * #include // ostringstream build 12-Sep-2018 15:30:24 + * #include // fwrite() build 12-Sep-2018 15:30:24 + * using namespace std; build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * void my_write(const char* str, int size) { build 12-Sep-2018 15:30:24 + * fwrite(str, size, 1, stdout); build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * struct MyWriter { build 12-Sep-2018 15:30:24 + * void write(const char* buf, size_t size) const { build 12-Sep-2018 15:30:24 + * fwrite(str, size, 1, stdout); build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * }; build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * struct MyWriteFunctor { build 12-Sep-2018 15:30:24 + * void operator()(const char* buf, size_t size) { build 12-Sep-2018 15:30:24 + * fwrite(str, size, 1, stdout); build 12-Sep-2018 15:30:24 + * } build 12-Sep-2018 15:30:24 + * }; build 12-Sep-2018 15:30:24 + * ... build 12-Sep-2018 15:30:24 + * printUsage(my_write, usage); // custom write function build 12-Sep-2018 15:30:24 + * printUsage(MyWriter(), usage); // temporary of a custom class build 12-Sep-2018 15:30:24 + * MyWriter writer; build 12-Sep-2018 15:30:24 + * printUsage(writer, usage); // custom class object build 12-Sep-2018 15:30:24 + * MyWriteFunctor wfunctor; build 12-Sep-2018 15:30:24 + * printUsage(&wfunctor, usage); // custom functor build 12-Sep-2018 15:30:24 + * printUsage(write, 1, usage); // write() to file descriptor 1 build 12-Sep-2018 15:30:24 + * printUsage(cout, usage); // an ostream& build 12-Sep-2018 15:30:24 + * printUsage(fwrite, stdout, usage); // fwrite() to stdout build 12-Sep-2018 15:30:24 + * ostringstream sstr; build 12-Sep-2018 15:30:24 + * printUsage(sstr, usage); // an ostringstream& build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @par Notes: build 12-Sep-2018 15:30:24 + * @li the @c write() method of a class that is to be passed as a temporary build 12-Sep-2018 15:30:24 + * as @c MyWriter() is in the example, must be a @c const method, because build 12-Sep-2018 15:30:24 + * temporary objects are passed as const reference. This only applies to build 12-Sep-2018 15:30:24 + * temporary objects that are created and destroyed in the same statement. build 12-Sep-2018 15:30:24 + * If you create an object like @c writer in the example, this restriction build 12-Sep-2018 15:30:24 + * does not apply. build 12-Sep-2018 15:30:24 + * @li a functor like @c MyWriteFunctor in the example must be passed as a pointer. build 12-Sep-2018 15:30:24 + * This differs from the way functors are passed to e.g. the STL algorithms. build 12-Sep-2018 15:30:24 + * @li All printUsage() templates are tiny wrappers around a shared non-template implementation. build 12-Sep-2018 15:30:24 + * So there's no penalty for using different versions in the same program. build 12-Sep-2018 15:30:24 + * @li printUsage() always interprets Descriptor::help as UTF-8 and always produces UTF-8-encoded build 12-Sep-2018 15:30:24 + * output. If your system uses a different charset, you must do your own conversion. You build 12-Sep-2018 15:30:24 + * may also need to change the font of the console to see non-ASCII characters properly. build 12-Sep-2018 15:30:24 + * This is particularly true for Windows. build 12-Sep-2018 15:30:24 + * @li @b Security @b warning: Do not insert untrusted strings (such as user-supplied arguments) build 12-Sep-2018 15:30:24 + * into the usage. printUsage() has no protection against malicious UTF-8 sequences. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @param prn The output method to use. See the examples above. build 12-Sep-2018 15:30:24 + * @param usage the Descriptor[] array whose @c help texts will be formatted. build 12-Sep-2018 15:30:24 + * @param width the maximum number of characters per output line. Note that this number is build 12-Sep-2018 15:30:24 + * in actual characters, not bytes. printUsage() supports UTF-8 in @c help and will build 12-Sep-2018 15:30:24 + * count multi-byte UTF-8 sequences properly. Asian wide characters are counted build 12-Sep-2018 15:30:24 + * as 2 characters. build 12-Sep-2018 15:30:24 + * @param last_column_min_percent (0-100) The minimum percentage of @c width that should be available build 12-Sep-2018 15:30:24 + * for the last column (which typically contains the textual explanation of an option). build 12-Sep-2018 15:30:24 + * If less space is available, the last column will be printed on its own line, indented build 12-Sep-2018 15:30:24 + * according to @c last_column_own_line_max_percent. build 12-Sep-2018 15:30:24 + * @param last_column_own_line_max_percent (0-100) If the last column is printed on its own line due to build 12-Sep-2018 15:30:24 + * less than @c last_column_min_percent of the width being available, then only build 12-Sep-2018 15:30:24 + * @c last_column_own_line_max_percent of the extra line(s) will be used for the build 12-Sep-2018 15:30:24 + * last column's text. This ensures an indentation. See example below. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @code build 12-Sep-2018 15:30:24 + * // width=20, last_column_min_percent=50 (i.e. last col. min. width=10) build 12-Sep-2018 15:30:24 + * --3456789 1234567890 build 12-Sep-2018 15:30:24 + * 1234567890 build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * // width=20, last_column_min_percent=75 (i.e. last col. min. width=15) build 12-Sep-2018 15:30:24 + * // last_column_own_line_max_percent=75 build 12-Sep-2018 15:30:24 + * --3456789 build 12-Sep-2018 15:30:24 + * 123456789012345 build 12-Sep-2018 15:30:24 + * 67890 build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * // width=20, last_column_min_percent=75 (i.e. last col. min. width=15) build 12-Sep-2018 15:30:24 + * // last_column_own_line_max_percent=33 (i.e. max. 5) build 12-Sep-2018 15:30:24 + * --3456789 build 12-Sep-2018 15:30:24 + * 12345 build 12-Sep-2018 15:30:24 + * 67890 build 12-Sep-2018 15:30:24 + * 12345 build 12-Sep-2018 15:30:24 + * 67890 build 12-Sep-2018 15:30:24 + * @endcode build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 +template build 12-Sep-2018 15:30:24 +void printUsage(OStream& prn, const Descriptor usage[], int width = 80, int last_column_min_percent = 50, build 12-Sep-2018 15:30:24 + int last_column_own_line_max_percent = 75) build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + PrintUsageImplementation::OStreamWriter write(prn); build 12-Sep-2018 15:30:24 + PrintUsageImplementation::printUsage(write, usage, width, last_column_min_percent, last_column_own_line_max_percent); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template build 12-Sep-2018 15:30:24 +void printUsage(Function* prn, const Descriptor usage[], int width = 80, int last_column_min_percent = 50, build 12-Sep-2018 15:30:24 + int last_column_own_line_max_percent = 75) build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + PrintUsageImplementation::FunctionWriter write(prn); build 12-Sep-2018 15:30:24 + PrintUsageImplementation::printUsage(write, usage, width, last_column_min_percent, last_column_own_line_max_percent); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template build 12-Sep-2018 15:30:24 +void printUsage(const Temporary& prn, const Descriptor usage[], int width = 80, int last_column_min_percent = 50, build 12-Sep-2018 15:30:24 + int last_column_own_line_max_percent = 75) build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + PrintUsageImplementation::TemporaryWriter write(prn); build 12-Sep-2018 15:30:24 + PrintUsageImplementation::printUsage(write, usage, width, last_column_min_percent, last_column_own_line_max_percent); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template build 12-Sep-2018 15:30:24 +void printUsage(Syscall* prn, int fd, const Descriptor usage[], int width = 80, int last_column_min_percent = 50, build 12-Sep-2018 15:30:24 + int last_column_own_line_max_percent = 75) build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + PrintUsageImplementation::SyscallWriter write(prn, fd); build 12-Sep-2018 15:30:24 + PrintUsageImplementation::printUsage(write, usage, width, last_column_min_percent, last_column_own_line_max_percent); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +template build 12-Sep-2018 15:30:24 +void printUsage(Function* prn, Stream* stream, const Descriptor usage[], int width = 80, int last_column_min_percent = build 12-Sep-2018 15:30:24 + 50, build 12-Sep-2018 15:30:24 + int last_column_own_line_max_percent = 75) build 12-Sep-2018 15:30:24 +{ build 12-Sep-2018 15:30:24 + PrintUsageImplementation::StreamWriter write(prn, stream); build 12-Sep-2018 15:30:24 + PrintUsageImplementation::printUsage(write, usage, width, last_column_min_percent, last_column_own_line_max_percent); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 +// namespace option build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 +#endif /* OPTIONPARSER_H_ */ build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/CalTables/CalSet.tcc b/code/synthesis/CalTables/CalSet.tcc build 12-Sep-2018 15:30:24 index 5533e21..16c721b 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/CalTables/CalSet.tcc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/CalTables/CalSet.tcc build 12-Sep-2018 15:30:24 @@ -598,7 +598,7 @@ template void CalSet::store (const casacore::String& file, build 12-Sep-2018 15:30:24 casacore::Int maxNumChan(1); build 12-Sep-2018 15:30:24 for (casacore::Int iSpw=0; iSpw inmask(maskString); build 12-Sep-2018 15:30:24 IPosition inShape = inmask.shape(); build 12-Sep-2018 15:30:24 IPosition outShape = imstore->mask()->shape(); build 12-Sep-2018 15:30:24 Int specAxis = CoordinateUtil::findSpectralAxis(inmask.coordinates()); build 12-Sep-2018 15:30:24 + Int inNchan = (specAxis==-1? 1: inShape(specAxis) ); build 12-Sep-2018 15:30:24 Int outSpecAxis = CoordinateUtil::findSpectralAxis(imstore->mask()->coordinates()); build 12-Sep-2018 15:30:24 - if (inShape(specAxis) == 1 && outShape(outSpecAxis)>1) { build 12-Sep-2018 15:30:24 - os << "Expanding mask image: " << maskString << LogIO::POST; build 12-Sep-2018 15:30:24 + Vector inWhichPols, outWhichPols; build 12-Sep-2018 15:30:24 + Int stokesAxis = CoordinateUtil::findStokesAxis(inWhichPols, inmask.coordinates()); build 12-Sep-2018 15:30:24 + Int inNstokes = (stokesAxis==-1? 1: inShape(stokesAxis) ); build 12-Sep-2018 15:30:24 + Int outStokesAxis = CoordinateUtil::findStokesAxis(outWhichPols, imstore->mask()->coordinates()); build 12-Sep-2018 15:30:24 + //if (inShape(specAxis) == 1 && outShape(outSpecAxis)>1) { build 12-Sep-2018 15:30:24 + if (inNchan == 1 && outShape(outSpecAxis)>1) { build 12-Sep-2018 15:30:24 + os << "Extending mask image: " << maskString << LogIO::POST; build 12-Sep-2018 15:30:24 + expandMask(inmask, tempMaskImage); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + //else if(inShape(stokesAxis) == 1 && outShape(outStokesAxis) > 1 ) { build 12-Sep-2018 15:30:24 + else if(inNstokes == 1 && outShape(outStokesAxis) > 1 ) { build 12-Sep-2018 15:30:24 + os << "Extending mask image along Stokes axis: " << maskString << LogIO::POST; build 12-Sep-2018 15:30:24 expandMask(inmask, tempMaskImage); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 @@ -537,7 +550,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 SPCIIF templateim(new TempImage(outshape,outcsys, memoryToUse())); build 12-Sep-2018 15:30:24 Record* dummyrec = 0; build 12-Sep-2018 15:30:24 //ImageRegridder regridder(tempim, outfilename, templateim, axes, dummyrec, "", true, outshape); build 12-Sep-2018 15:30:24 - ImageRegridder regridder(tempim, "", templateim, axes, dummyrec, "", true, outshape); build 12-Sep-2018 15:30:24 + ImageRegridder regridder(tempim, "", templateim, axes, dummyrec, "", true, outshape); build 12-Sep-2018 15:30:24 regridder.setMethod(Interpolate2D::LINEAR); build 12-Sep-2018 15:30:24 SPIIF retim = regridder.regrid(); build 12-Sep-2018 15:30:24 //outImageMask.copyData( (LatticeExpr) iif(*retim > 0.1, 1.0, 0.0) ); build 12-Sep-2018 15:30:24 @@ -569,59 +582,270 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 LogIO os( LogOrigin("SDMaskHandler", "expandMask", WHERE) ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // expand mask with input range (in spectral axis and stokes?) ... to output range on outimage build 12-Sep-2018 15:30:24 - // current expand a continuum mask to a cube mask in channels only (to all channels) build 12-Sep-2018 15:30:24 + // currently expand a continuum mask to a cube mask in channels (to all channels) build 12-Sep-2018 15:30:24 + // or continuum Stokes I mask to multi-Stokes mask build 12-Sep-2018 15:30:24 + // or continuum with multi-Stokes mask to cube with multi-Stokes mask build 12-Sep-2018 15:30:24 IPosition inShape = inImageMask.shape(); build 12-Sep-2018 15:30:24 CoordinateSystem inCsys = inImageMask.coordinates(); build 12-Sep-2018 15:30:24 Vector dirAxes = CoordinateUtil::findDirectionAxes(inCsys); build 12-Sep-2018 15:30:24 Int inSpecAxis = CoordinateUtil::findSpectralAxis(inCsys); build 12-Sep-2018 15:30:24 - Int inNchan = inShape(inSpecAxis); build 12-Sep-2018 15:30:24 + Int inNchan; build 12-Sep-2018 15:30:24 + if (inSpecAxis==-1) { build 12-Sep-2018 15:30:24 + inNchan=1; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + inNchan = inShape(inSpecAxis); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 Vector inWhichPols; build 12-Sep-2018 15:30:24 Int inStokesAxis = CoordinateUtil::findStokesAxis(inWhichPols,inCsys); build 12-Sep-2018 15:30:24 + Int inNpol; build 12-Sep-2018 15:30:24 + if (inStokesAxis==-1) { build 12-Sep-2018 15:30:24 + inNpol=1; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + inNpol = inShape(inStokesAxis); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 - // Single channel(continuum) input mask to output cube mask case: build 12-Sep-2018 15:30:24 - // - It can be different shape in direction axes and will be regridded. build 12-Sep-2018 15:30:24 - if (inNchan==1) { build 12-Sep-2018 15:30:24 - IPosition outShape = outImageMask.shape(); build 12-Sep-2018 15:30:24 - CoordinateSystem outCsys = outImageMask.coordinates(); build 12-Sep-2018 15:30:24 - Vector outDirAxes = CoordinateUtil::findDirectionAxes(outCsys); build 12-Sep-2018 15:30:24 - Int outSpecAxis = CoordinateUtil::findSpectralAxis(outCsys); build 12-Sep-2018 15:30:24 - Int outNchan = outShape(outSpecAxis); build 12-Sep-2018 15:30:24 - Vector outWhichPols; build 12-Sep-2018 15:30:24 - Int outStokesAxis = CoordinateUtil::findStokesAxis(outWhichPols,outCsys); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - Int stokesInc = 1; build 12-Sep-2018 15:30:24 - if (inShape(inStokesAxis)==outShape(outStokesAxis)) { build 12-Sep-2018 15:30:24 + IPosition outShape = outImageMask.shape(); build 12-Sep-2018 15:30:24 + CoordinateSystem outCsys = outImageMask.coordinates(); build 12-Sep-2018 15:30:24 + Vector outDirAxes = CoordinateUtil::findDirectionAxes(outCsys); build 12-Sep-2018 15:30:24 + Int outSpecAxis = CoordinateUtil::findSpectralAxis(outCsys); build 12-Sep-2018 15:30:24 + Int outNchan = outShape(outSpecAxis); build 12-Sep-2018 15:30:24 + Vector outWhichPols; build 12-Sep-2018 15:30:24 + Int outStokesAxis = CoordinateUtil::findStokesAxis(outWhichPols,outCsys); build 12-Sep-2018 15:30:24 + Int outNpol = outShape(outStokesAxis); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + IPosition start(4,0,0,0,0); build 12-Sep-2018 15:30:24 + IPosition length(4,outShape(outDirAxes(0)), outShape(outDirAxes(1)),1,1); build 12-Sep-2018 15:30:24 + //Slicer sl(start, length); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + Int stokesInc = 1; build 12-Sep-2018 15:30:24 + // for fixing removed degenerate axis build 12-Sep-2018 15:30:24 + Bool addSpecAxis = (inSpecAxis == -1? True: False); build 12-Sep-2018 15:30:24 + // Do expansion for input mask with single channel (continuum) build 12-Sep-2018 15:30:24 + if (inNchan==1 ) { build 12-Sep-2018 15:30:24 + if (inNpol == 1 ) { build 12-Sep-2018 15:30:24 + stokesInc = 1; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (inShape(inStokesAxis)==outShape(outStokesAxis)) { build 12-Sep-2018 15:30:24 stokesInc = inShape(inStokesAxis); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - IPosition start(4,0,0,0,0); build 12-Sep-2018 15:30:24 - IPosition length(4,outShape(outDirAxes(0)), outShape(outDirAxes(1)),1,1); build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + throw(AipsError("Cannot extend the input mask of "+String::toString(inNpol)+ build 12-Sep-2018 15:30:24 + " Stokes planes to the output mask of "+String::toString(outNpol)+ build 12-Sep-2018 15:30:24 + " Stokes planes. Please modify the input mask to make it a Stokes I mask or a mask with the same number of Stokes planes as the output.") ); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 length(outStokesAxis) = stokesInc; build 12-Sep-2018 15:30:24 - Slicer sl(start, length); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + // I stokes cont -> cube: regrid ra.dec on the input single plane build 12-Sep-2018 15:30:24 + // I stokes cont -> cont multi-stokes: regrid ra.dec on the input build 12-Sep-2018 15:30:24 + // I stokes cont -> cube multi-stokes: regid ra.dec on input build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + Slicer sl(start, length); build 12-Sep-2018 15:30:24 // make a subImage for regridding output build 12-Sep-2018 15:30:24 SubImage chanMask(outImageMask, sl, true); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 ImageRegrid imregrid; build 12-Sep-2018 15:30:24 + TempImage tempInImageMask(chanMask.shape(), chanMask.coordinates(),memoryToUse()); build 12-Sep-2018 15:30:24 + PtrHolder > outmaskim_ptr; build 12-Sep-2018 15:30:24 + if ( chanMask.shape().nelements() > inImageMask.shape().nelements() ) { build 12-Sep-2018 15:30:24 + String stokesStr; build 12-Sep-2018 15:30:24 + if (inNpol==1) { build 12-Sep-2018 15:30:24 + stokesStr="I"; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + stokesStr=""; build 12-Sep-2018 15:30:24 + //for (uInt ipol=0; ipol < inWhichPols.nelements(); ipol++) { build 12-Sep-2018 15:30:24 + // stokesStr+=Stokes::name(inWhichPols(ipol)); build 12-Sep-2018 15:30:24 + //} build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + //os<<"Adding degenerate axes: addSpecAxis="< inMaskData; build 12-Sep-2018 15:30:24 IPosition end2(4,outShape(outDirAxes(0)), outShape(outDirAxes(1)), 1, 1); build 12-Sep-2018 15:30:24 + if ( inNpol==outNpol ) { build 12-Sep-2018 15:30:24 + end2(outStokesAxis) = inNpol; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 chanMask.doGetSlice(inMaskData, Slicer(start,end2)); build 12-Sep-2018 15:30:24 - for (Int ich = 1; ich < outNchan; ich++) { build 12-Sep-2018 15:30:24 - start(outSpecAxis) = ich; build 12-Sep-2018 15:30:24 - IPosition stride(4,1,1,1,1); build 12-Sep-2018 15:30:24 - stride(outSpecAxis) = stokesInc; build 12-Sep-2018 15:30:24 - outImageMask.putSlice(inMaskData,start,stride); build 12-Sep-2018 15:30:24 + IPosition stride(4,1,1,1,1); build 12-Sep-2018 15:30:24 + // build 12-Sep-2018 15:30:24 + // continuum output mask case build 12-Sep-2018 15:30:24 + if (outNchan==1) { build 12-Sep-2018 15:30:24 + //No copying over channels, just do copying over all Stokes if input mask is a single Stokes build 12-Sep-2018 15:30:24 + if (inNpol == 1 && outNpol > 1) { build 12-Sep-2018 15:30:24 + for (Int ipol = 0; ipol < outNpol; ipol++) { build 12-Sep-2018 15:30:24 + start(outStokesAxis) = ipol; build 12-Sep-2018 15:30:24 + os<<"Copying input mask to Stokes plane="< 1) { build 12-Sep-2018 15:30:24 + // extend to other Stokes build 12-Sep-2018 15:30:24 + for (Int ipol = 0; ipol < outNpol; ipol++) { build 12-Sep-2018 15:30:24 + os<<"Copying input mask to Stokes plane="< stokesMask(outImageMask, slStokes, true); build 12-Sep-2018 15:30:24 + ImageRegrid imregrid2; build 12-Sep-2018 15:30:24 + TempImage tempInStokesImageMask(stokesMask.shape(), stokesMask.coordinates(),memoryToUse()); build 12-Sep-2018 15:30:24 + PtrHolder > outstokesmaskim_ptr; build 12-Sep-2018 15:30:24 + Vector outWhichPols; build 12-Sep-2018 15:30:24 + if ( stokesMask.shape().nelements() > inImageMask.shape().nelements() ) { build 12-Sep-2018 15:30:24 + casacore::ImageUtilities::addDegenerateAxes(os, outstokesmaskim_ptr, inImageMask,"",False, addSpecAxis, "I", False, False, True); build 12-Sep-2018 15:30:24 + Vector outWorldOrder(4); build 12-Sep-2018 15:30:24 + Vector outPixelOrder(4); build 12-Sep-2018 15:30:24 + outWorldOrder(0)=0; build 12-Sep-2018 15:30:24 + outWorldOrder(1)=1; build 12-Sep-2018 15:30:24 + outWorldOrder(2)=3; build 12-Sep-2018 15:30:24 + outWorldOrder(3)=2; build 12-Sep-2018 15:30:24 + outPixelOrder(0)=0; build 12-Sep-2018 15:30:24 + outPixelOrder(1)=1; build 12-Sep-2018 15:30:24 + outPixelOrder(2)=3; build 12-Sep-2018 15:30:24 + outPixelOrder(3)=2; build 12-Sep-2018 15:30:24 + CoordinateSystem modcsys=tempInStokesImageMask.coordinates(); build 12-Sep-2018 15:30:24 + IPosition inMaskShape = inImageMask.shape(); build 12-Sep-2018 15:30:24 + Array inData = outstokesmaskim_ptr->get(); build 12-Sep-2018 15:30:24 + IPosition newAxisOrder(4,0,1,3,2); build 12-Sep-2018 15:30:24 + Array reorderedData = reorderArray(inData, newAxisOrder); build 12-Sep-2018 15:30:24 + IPosition newShape=reorderedData.shape(); build 12-Sep-2018 15:30:24 + //os<< "reoderedData shape="< modTempInStokesMask(TiledShape(newShape), modcsys); build 12-Sep-2018 15:30:24 + modTempInStokesMask.put(reorderedData); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (compareSpectralCoordinate(inImageMask,tempInStokesImageMask) ) { build 12-Sep-2018 15:30:24 + tempInStokesImageMask.copyData(modTempInStokesMask); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + if (compareSpectralCoordinate(inImageMask,tempInStokesImageMask) ) { build 12-Sep-2018 15:30:24 + tempInStokesImageMask.copyData(inImageMask); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + try { build 12-Sep-2018 15:30:24 + imregrid2.regrid(stokesMask, Interpolate2D::LINEAR, dirAxes, tempInStokesImageMask); build 12-Sep-2018 15:30:24 + } catch (AipsError& x) { build 12-Sep-2018 15:30:24 + os< inMaskData2; build 12-Sep-2018 15:30:24 + IPosition end3(4,outShape(outDirAxes(0)), outShape(outDirAxes(1)), 1, 1); build 12-Sep-2018 15:30:24 + end3(outStokesAxis) = inNpol; build 12-Sep-2018 15:30:24 + end3(outSpecAxis) = inNchan; build 12-Sep-2018 15:30:24 + stokesMask.doGetSlice(inMaskData2,slStokes); build 12-Sep-2018 15:30:24 + IPosition stride(4,1,1,1,1); build 12-Sep-2018 15:30:24 + IPosition inStart2(4,0,0,0,0); build 12-Sep-2018 15:30:24 + for (Int ipol = 0; ipol < outNpol; ipol++) { build 12-Sep-2018 15:30:24 + // need to slice mask from each stokes plane build 12-Sep-2018 15:30:24 + inMaskData2.resize(); build 12-Sep-2018 15:30:24 + inStart2(outStokesAxis) = 0; build 12-Sep-2018 15:30:24 + start(outStokesAxis) = ipol; build 12-Sep-2018 15:30:24 + end3(outStokesAxis) = 1; build 12-Sep-2018 15:30:24 + stride(outStokesAxis) = 1; build 12-Sep-2018 15:30:24 + stride(outSpecAxis) = 1; // assume here inNchan == outNchan build 12-Sep-2018 15:30:24 + stokesMask.doGetSlice(inMaskData2, Slicer(inStart2,end3)); build 12-Sep-2018 15:30:24 + outImageMask.putSlice(inMaskData2,start); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 throw(AipsError("Input mask,"+inImageMask.name()+" does not conform with the number of channels in output mask")); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + Bool SDMaskHandler::compareSpectralCoordinate(const ImageInterface& inImage, const ImageInterface& outImage) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + LogIO os( LogOrigin("SDMaskHandler", "checkSpectralCoord",WHERE) ); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + SpectralCoordinate outSpecCoord = outImage.coordinates().spectralCoordinate(); build 12-Sep-2018 15:30:24 + IPosition inshape = inImage.shape(); build 12-Sep-2018 15:30:24 + IPosition outshape = outImage.shape(); build 12-Sep-2018 15:30:24 + CoordinateSystem incys = inImage.coordinates(); build 12-Sep-2018 15:30:24 + CoordinateSystem outcsys = outImage.coordinates(); build 12-Sep-2018 15:30:24 + Int inSpecAxis = CoordinateUtil::findSpectralAxis(incys); build 12-Sep-2018 15:30:24 + Int outSpecAxis = CoordinateUtil::findSpectralAxis(outcsys); build 12-Sep-2018 15:30:24 + Bool nchanMatch(true); build 12-Sep-2018 15:30:24 + if (inSpecAxis != -1 and outSpecAxis != -1 ) build 12-Sep-2018 15:30:24 + nchanMatch = inshape(inSpecAxis) == outshape(outSpecAxis)? true: false; build 12-Sep-2018 15:30:24 + if (!nchanMatch) { build 12-Sep-2018 15:30:24 + if (!outSpecCoord.near(inImage.coordinates().spectralCoordinate())) { build 12-Sep-2018 15:30:24 + throw(AipsError("Cannot extend the input mask. Spectral coordiante and the number of channels of the input mask does not match with those of the output mask. Use a single channel mask or a mask that matches the spectral coordiante of the output. ")); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + throw(AipsError("Cannot extend the input mask. The number of the channels in Input mask,"+inImage.name()+"does not match with that of the output mask. Use a single channel mask or a mask that matches the spectral coordiante of the output. ")); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return false; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + if (!outSpecCoord.near(inImage.coordinates().spectralCoordinate())) { build 12-Sep-2018 15:30:24 + throw(AipsError("Cannot extend the input mask. Spectral coordiante of Input mask,"+inImage.name()+"does not match with that of the output mask. Use a single channel mask or a mask that matches the spectral coordiante of the output. ")); build 12-Sep-2018 15:30:24 + return false; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // was Imager::clone()... build 12-Sep-2018 15:30:24 //static Bool cloneImShape(const ImageInterface& inImage, ImageInterface& outImage) build 12-Sep-2018 15:30:24 Bool SDMaskHandler::cloneImShape(const ImageInterface& inImage, const String& outImageName) build 12-Sep-2018 15:30:24 @@ -1138,7 +1362,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 axes(2) = CoordinateUtil::findSpectralAxis(incsys); build 12-Sep-2018 15:30:24 Record* dummyrec = 0; build 12-Sep-2018 15:30:24 SPCIIF inmask_ptr(tempIm_ptr); build 12-Sep-2018 15:30:24 - ImageRegridder regridder(inmask_ptr, "", tempIm2_ptr, axes, dummyrec, "", True, shp); build 12-Sep-2018 15:30:24 + ImageRegridder regridder(inmask_ptr, "", tempIm2_ptr, axes, dummyrec, "", True, shp); build 12-Sep-2018 15:30:24 regridder.setMethod(Interpolate2D::LINEAR); build 12-Sep-2018 15:30:24 tempIm_ptr = regridder.regrid(); build 12-Sep-2018 15:30:24 //for debugging: save the mask at this stage build 12-Sep-2018 15:30:24 @@ -2744,13 +2968,19 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void SDMaskHandler::makePBMask(SHARED_PTR imstore, Float pblimit) build 12-Sep-2018 15:30:24 + void SDMaskHandler::makePBMask(SHARED_PTR imstore, Float pblimit, Bool combinemask) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 LogIO os( LogOrigin("SDMaskHandler","makePBMask",WHERE) ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if( imstore->hasPB() ) // Projection algorithms will have this. build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - LatticeExpr themask( iif( (*(imstore->pb())) > pblimit , 1.0, 0.0 ) ); build 12-Sep-2018 15:30:24 + LatticeExpr themask; build 12-Sep-2018 15:30:24 + if (combinemask && imstore->hasMask()) { build 12-Sep-2018 15:30:24 + themask = LatticeExpr ( iif( (*(imstore->pb())) > pblimit, *(imstore->mask()), 0.0 ) ); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else { build 12-Sep-2018 15:30:24 + themask = LatticeExpr ( iif( (*(imstore->pb())) > pblimit , 1.0, 0.0 ) ); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 imstore->mask()->copyData( themask ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else // Calculate it here... build 12-Sep-2018 15:30:24 @@ -3193,7 +3423,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 const Vector& maskthreshold, build 12-Sep-2018 15:30:24 const Vector& thresholdtype, build 12-Sep-2018 15:30:24 const Vector& chanflag, build 12-Sep-2018 15:30:24 - const Vector& zeroChanMask, build 12-Sep-2018 15:30:24 + const Vector& /* zeroChanMask */, build 12-Sep-2018 15:30:24 const Vector& nreg, build 12-Sep-2018 15:30:24 const Vector& npruned, build 12-Sep-2018 15:30:24 const Vector& ngrowreg, build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SDMaskHandler.h b/code/synthesis/ImagerObjects/SDMaskHandler.h build 12-Sep-2018 15:30:24 index 793cc64..fa7b4ee 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SDMaskHandler.h build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SDMaskHandler.h build 12-Sep-2018 15:30:24 @@ -271,7 +271,10 @@ public: build 12-Sep-2018 15:30:24 casacore::Float pixelBeamArea(const casacore::GaussianBeam& beam, const casacore::CoordinateSystem& csys); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Create a mask image applying PB level build 12-Sep-2018 15:30:24 - void makePBMask(SHARED_PTR imstore, casacore::Float pblimit=0.1); build 12-Sep-2018 15:30:24 + // @param[in, out] imstore SIImageStore build 12-Sep-2018 15:30:24 + // @param[in] pblimit Primary beam cut off level build 12-Sep-2018 15:30:24 + // @param[in] pblimit Primary beam cut off level build 12-Sep-2018 15:30:24 + void makePBMask(SHARED_PTR imstore, casacore::Float pblimit=0.1, casacore::Bool combinemask=false); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void autoMaskWithinPB(SHARED_PTR imstore, build 12-Sep-2018 15:30:24 casacore::TempImage& posmask, build 12-Sep-2018 15:30:24 @@ -362,6 +365,8 @@ public: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 + casacore::Bool compareSpectralCoordinate(const casacore::ImageInterface& inImage, build 12-Sep-2018 15:30:24 + const casacore::ImageInterface& outImage); build 12-Sep-2018 15:30:24 static casacore::Bool cloneImShape(const casacore::ImageInterface& inImage, const casacore::String& outImageName); build 12-Sep-2018 15:30:24 // max MB of memory to use in TempImage build 12-Sep-2018 15:30:24 static inline casacore::Double memoryToUse() {return 1.0;}; build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SIImageStore.cc b/code/synthesis/ImagerObjects/SIImageStore.cc build 12-Sep-2018 15:30:24 index 294872d..eff7430 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SIImageStore.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SIImageStore.cc build 12-Sep-2018 15:30:24 @@ -54,7 +54,7 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -139,10 +139,13 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SIImageStore::SIImageStore(String imagename, build 12-Sep-2018 15:30:24 - CoordinateSystem &imcoordsys, build 12-Sep-2018 15:30:24 - IPosition imshape, build 12-Sep-2018 15:30:24 - // const Int nfacets, build 12-Sep-2018 15:30:24 + // Used from SynthesisNormalizer::makeImageStore() build 12-Sep-2018 15:30:24 + SIImageStore::SIImageStore(const String &imagename, build 12-Sep-2018 15:30:24 + const CoordinateSystem &imcoordsys, build 12-Sep-2018 15:30:24 + const IPosition &imshape, build 12-Sep-2018 15:30:24 + const String &objectname, build 12-Sep-2018 15:30:24 + const Record &miscinfo, build 12-Sep-2018 15:30:24 + // const Int nfacets, build 12-Sep-2018 15:30:24 const Bool /*overwrite*/, build 12-Sep-2018 15:30:24 const Bool useweightimage) build 12-Sep-2018 15:30:24 // TODO : Add parameter to indicate weight image shape. build 12-Sep-2018 15:30:24 @@ -172,27 +175,21 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 itsPolId = 0; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 itsImageName = imagename; build 12-Sep-2018 15:30:24 - itsImageShape = imshape; build 12-Sep-2018 15:30:24 itsCoordSys = imcoordsys; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - itsMiscInfo=Record(); build 12-Sep-2018 15:30:24 + itsImageShape = imshape; build 12-Sep-2018 15:30:24 + itsObjectName = objectname; build 12-Sep-2018 15:30:24 + itsMiscInfo = miscinfo; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 init(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 validate(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SIImageStore::SIImageStore(String imagename,const Bool ignorefacets) build 12-Sep-2018 15:30:24 + // Used from SynthesisNormalizer::makeImageStore() build 12-Sep-2018 15:30:24 + SIImageStore::SIImageStore(const String &imagename, const Bool ignorefacets) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 LogIO os( LogOrigin("SIImageStore","Open existing Images",WHERE) ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - /* build 12-Sep-2018 15:30:24 - init(); build 12-Sep-2018 15:30:24 - String fname( imagename + ".info" ); build 12-Sep-2018 15:30:24 - recreate( fname ); build 12-Sep-2018 15:30:24 - */ build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 itsPsf.reset( ); build 12-Sep-2018 15:30:24 itsModel.reset( ); build 12-Sep-2018 15:30:24 itsResidual.reset( ); build 12-Sep-2018 15:30:24 @@ -227,11 +224,13 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 // imptr.reset( new PagedImage (itsImageName+String(".psf")) ); build 12-Sep-2018 15:30:24 buildImage( imptr, (itsImageName+String(".psf")) ); build 12-Sep-2018 15:30:24 + itsObjectName=imptr->imageInfo().objectName(); build 12-Sep-2018 15:30:24 itsMiscInfo=imptr->miscInfo(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else if ( doesImageExist(itsImageName+String(".residual")) ){ build 12-Sep-2018 15:30:24 //imptr.reset( new PagedImage (itsImageName+String(".residual")) ); build 12-Sep-2018 15:30:24 buildImage( imptr, (itsImageName+String(".residual")) ); build 12-Sep-2018 15:30:24 + itsObjectName=imptr->imageInfo().objectName(); build 12-Sep-2018 15:30:24 itsMiscInfo=imptr->miscInfo(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 @@ -262,7 +261,9 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 itsFacetId = 0; build 12-Sep-2018 15:30:24 itsUseWeight = getUseWeightImage( *imptr ); build 12-Sep-2018 15:30:24 itsPBScaleFactor=1.0; ///// No need to set properly here as it will be calc'd in () build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + /////redo this here as psf may have different coordinates build 12-Sep-2018 15:30:24 + itsCoordSys = imptr->coordinates(); build 12-Sep-2018 15:30:24 + itsMiscInfo=imptr->miscInfo(); build 12-Sep-2018 15:30:24 if( itsUseWeight && ! doesImageExist(itsImageName+String(".weight")) ) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 throw(AipsError("Internal error : Sumwt has a useweightimage=True but the weight image does not exist.")); build 12-Sep-2018 15:30:24 @@ -282,19 +283,24 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 validate(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SIImageStore::SIImageStore(SHARED_PTR > modelim, build 12-Sep-2018 15:30:24 - SHARED_PTR > residim, build 12-Sep-2018 15:30:24 - SHARED_PTR > psfim, build 12-Sep-2018 15:30:24 - SHARED_PTR > weightim, build 12-Sep-2018 15:30:24 - SHARED_PTR > restoredim, build 12-Sep-2018 15:30:24 - SHARED_PTR > maskim, build 12-Sep-2018 15:30:24 - SHARED_PTR > sumwtim, build 12-Sep-2018 15:30:24 - SHARED_PTR > gridwtim, build 12-Sep-2018 15:30:24 - SHARED_PTR > pbim, build 12-Sep-2018 15:30:24 - SHARED_PTR > restoredpbcorim, build 12-Sep-2018 15:30:24 - CoordinateSystem& csys, build 12-Sep-2018 15:30:24 - IPosition imshape, build 12-Sep-2018 15:30:24 - String imagename, build 12-Sep-2018 15:30:24 + // used from getSubImageStore(), for example when creating the facets list build 12-Sep-2018 15:30:24 + // this would be safer if it was refactored as a copy constructor of the generic stuff + build 12-Sep-2018 15:30:24 + // initialization of the facet related parameters build 12-Sep-2018 15:30:24 + SIImageStore::SIImageStore(const SHARED_PTR > &modelim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &residim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &psfim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &weightim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &restoredim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &maskim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &sumwtim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &gridwtim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &pbim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &restoredpbcorim, build 12-Sep-2018 15:30:24 + const CoordinateSystem &csys, build 12-Sep-2018 15:30:24 + const IPosition &imshape, build 12-Sep-2018 15:30:24 + const String &imagename, build 12-Sep-2018 15:30:24 + const String &objectname, build 12-Sep-2018 15:30:24 + const Record &miscinfo, build 12-Sep-2018 15:30:24 const Int facet, const Int nfacets, build 12-Sep-2018 15:30:24 const Int chan, const Int nchanchunks, build 12-Sep-2018 15:30:24 const Int pol, const Int npolchunks, build 12-Sep-2018 15:30:24 @@ -316,6 +322,9 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 itsPBScaleFactor=1.0;// No need to set properly here as it will be computed in makePSF. build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + itsObjectName = objectname; build 12-Sep-2018 15:30:24 + itsMiscInfo = miscinfo; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 itsNFacets = nfacets; build 12-Sep-2018 15:30:24 itsFacetId = facet; build 12-Sep-2018 15:30:24 itsNChanChunks = nchanchunks; build 12-Sep-2018 15:30:24 @@ -413,7 +422,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 const Int chan, const Int nchanchunks, build 12-Sep-2018 15:30:24 const Int pol, const Int npolchunks) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - return SHARED_PTR(new SIImageStore(itsModel, itsResidual, itsPsf, itsWeight, itsImage, itsMask, itsSumWt, itsGridWt, itsPB, itsImagePBcor, itsCoordSys,itsImageShape, itsImageName, facet, nfacets,chan,nchanchunks,pol,npolchunks,itsUseWeight)); build 12-Sep-2018 15:30:24 + return std::make_shared(itsModel, itsResidual, itsPsf, itsWeight, itsImage, itsMask, itsSumWt, itsGridWt, itsPB, itsImagePBcor, itsCoordSys, itsImageShape, itsImageName, itsObjectName, itsMiscInfo, facet, nfacets, chan, nchanchunks, pol, npolchunks, itsUseWeight); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// build 12-Sep-2018 15:30:24 @@ -421,11 +430,10 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 SHARED_PTR > SIImageStore::openImage(const String imagenamefull, build 12-Sep-2018 15:30:24 const Bool overwrite, build 12-Sep-2018 15:30:24 - const Bool dosumwt, const Int nfacetsperside) build 12-Sep-2018 15:30:24 + const Bool dosumwt, const Int nfacetsperside, const Bool checkCoordSys) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 SHARED_PTR > imPtr; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 IPosition useShape( itsParentImageShape ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if( dosumwt ) // change shape to sumwt image shape. build 12-Sep-2018 15:30:24 @@ -500,7 +508,8 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 oo1 << useShape; oo2 << imPtr->shape(); build 12-Sep-2018 15:30:24 throw( AipsError( "There is a shape mismatch between existing images ("+oo2.str()+") and current parameters ("+oo1.str()+"). If you are attempting to restart a run with a new image shape, please change imagename and supply the old model or mask as inputs (via the startmodel or mask parameters) so that they can be regridded to the new shape before continuing." ) ); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - if( itsParentCoordSys.nCoordinates()>0 && ! itsParentCoordSys.near( imPtr->coordinates() ) ) build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if( itsParentCoordSys.nCoordinates()>0 && checkCoordSys && ! itsParentCoordSys.near( imPtr->coordinates() ) ) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 /// Implement an exception to get CAS-9977 to work. build 12-Sep-2018 15:30:24 @@ -577,24 +586,16 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 return imPtr; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - void SIImageStore::buildImage(SHARED_PTR > &imptr,IPosition shape, CoordinateSystem csys, String name) build 12-Sep-2018 15:30:24 + void SIImageStore::buildImage(SHARED_PTR > &imptr, IPosition shape, build 12-Sep-2018 15:30:24 + CoordinateSystem csys, const String name) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // LogIO os( LogOrigin("SIImageStore","Open existing Images",WHERE) ); build 12-Sep-2018 15:30:24 - // os <<"Opening new image " << name << LogIO::POST; build 12-Sep-2018 15:30:24 + LogIO os( LogOrigin("SIImageStore", "Open non-existing image", WHERE) ); build 12-Sep-2018 15:30:24 + os <<"Opening image, name: " << name << LogIO::DEBUG1; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 itsOpened++; build 12-Sep-2018 15:30:24 imptr.reset( new PagedImage (shape, csys, name) ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - ImageInfo info = imptr->imageInfo(); build 12-Sep-2018 15:30:24 - String objectName(""); build 12-Sep-2018 15:30:24 - if( itsMiscInfo.isDefined("OBJECT") ){ itsMiscInfo.get("OBJECT", objectName); } build 12-Sep-2018 15:30:24 - if(objectName != String("")){ build 12-Sep-2018 15:30:24 - info.setObjectName(objectName); build 12-Sep-2018 15:30:24 - imptr->setImageInfo( info ); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - imptr->setMiscInfo( itsMiscInfo ); build 12-Sep-2018 15:30:24 + initMetaInfo(imptr, name); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 /* build 12-Sep-2018 15:30:24 Int MEMFACTOR = 18; build 12-Sep-2018 15:30:24 Double memoryMB=HostInfo::memoryTotal(True)/1024/(MEMFACTOR*itsOpened); build 12-Sep-2018 15:30:24 @@ -610,11 +611,10 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void SIImageStore::buildImage(SHARED_PTR > &imptr, String name) build 12-Sep-2018 15:30:24 + void SIImageStore::buildImage(SHARED_PTR > &imptr, const String name) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // LogIO os( LogOrigin("SIImageStore","Open existing Images",WHERE) ); build 12-Sep-2018 15:30:24 - // os <<"Opening existing image " << name << LogIO::POST; build 12-Sep-2018 15:30:24 + LogIO os(LogOrigin("SIImageStore", "Open existing Images", WHERE)); build 12-Sep-2018 15:30:24 + os <<"Opening image, name: " << name << LogIO::DEBUG1; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 itsOpened++; build 12-Sep-2018 15:30:24 //imptr.reset( new PagedImage( name ) ); build 12-Sep-2018 15:30:24 @@ -660,14 +660,42 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * Sets ImageInfo and MiscInfo on an image build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @param imptr image to initialize build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + void SIImageStore::initMetaInfo(SHARED_PTR > &imptr, build 12-Sep-2018 15:30:24 + const String name) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + // Check objectname, as one of the mandatory fields. What this is meant to check is - build 12-Sep-2018 15:30:24 + // has the metainfo been initialized? If not, grab info from associated PSF build 12-Sep-2018 15:30:24 + if (not itsObjectName.empty()) { build 12-Sep-2018 15:30:24 + ImageInfo info = imptr->imageInfo(); build 12-Sep-2018 15:30:24 + info.setObjectName(itsObjectName); build 12-Sep-2018 15:30:24 + imptr->setImageInfo(info); build 12-Sep-2018 15:30:24 + imptr->setMiscInfo(itsMiscInfo); build 12-Sep-2018 15:30:24 + } else if (std::string::npos == name.find(imageExts(PSF))) { build 12-Sep-2018 15:30:24 + auto srcImg = psf(0); build 12-Sep-2018 15:30:24 + if (nullptr != srcImg) { build 12-Sep-2018 15:30:24 + imptr->setImageInfo(srcImg->imageInfo()); build 12-Sep-2018 15:30:24 + imptr->setMiscInfo(srcImg->miscInfo()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// build 12-Sep-2018 15:30:24 - void SIImageStore::setImageInfo(const Record miscinfo) build 12-Sep-2018 15:30:24 + void SIImageStore::setMiscInfo(const Record miscinfo) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 itsMiscInfo = miscinfo; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + void SIImageStore::setObjectName(const String name) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + itsObjectName = name; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 SHARED_PTR > SIImageStore::makeSubImage(const Int facet, const Int nfacets, build 12-Sep-2018 15:30:24 @@ -971,7 +999,8 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - ptr = openImage(itsImageName+label , itsOverWrite, sw, 1 ); build 12-Sep-2018 15:30:24 + ///coordsys for psf can be different ...shape should be the same. build 12-Sep-2018 15:30:24 + ptr = openImage(itsImageName+label , itsOverWrite, sw, 1, !(label.contains(imageExts(PSF)))); build 12-Sep-2018 15:30:24 //cout << "Opening image : " << itsImageName+label << " of shape " << ptr->shape() << endl; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -3011,12 +3040,7 @@ void SIImageStore::regridToModelImage( ImageInterface &inputimage, Int te build 12-Sep-2018 15:30:24 inFile >> token; if (token=="itsUseWeight:") inFile >> itsUseWeight; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Bool coordSysLoaded=False; build 12-Sep-2018 15:30:24 - String itsName; build 12-Sep-2018 15:30:24 - try build 12-Sep-2018 15:30:24 - { build 12-Sep-2018 15:30:24 - itsName=itsImageName+imageExts(PSF);casa::openImage(itsName, itsPsf); build 12-Sep-2018 15:30:24 - if (coordSysLoaded==False) {itsCoordSys=itsPsf->coordinates(); itsMiscInfo=itsPsf->miscInfo();coordSysLoaded=True;} build 12-Sep-2018 15:30:24 - } catch (AipsIO& x) {logIO << "\"" << itsName << "\" not found." << LogIO::WARN;}; build 12-Sep-2018 15:30:24 + String itsName; build 12-Sep-2018 15:30:24 try build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 itsName=itsImageName+imageExts(MASK);casa::openImage(itsName, itsMask); build 12-Sep-2018 15:30:24 @@ -3049,6 +3073,11 @@ void SIImageStore::regridToModelImage( ImageInterface &inputimage, Int te build 12-Sep-2018 15:30:24 } catch (AipsIO& x) {logIO << "\"" << itsName << "\" not found." << LogIO::WARN;}; build 12-Sep-2018 15:30:24 try build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 + itsName=itsImageName+imageExts(PSF);casa::openImage(itsName, itsPsf); build 12-Sep-2018 15:30:24 + if (coordSysLoaded==False) {itsCoordSys=itsPsf->coordinates(); itsMiscInfo=itsPsf->miscInfo();coordSysLoaded=True;} build 12-Sep-2018 15:30:24 + } catch (AipsIO& x) {logIO << "\"" << itsName << "\" not found." << LogIO::WARN;}; build 12-Sep-2018 15:30:24 + try build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 casa::openImage(itsImageName+imageExts(FORWARDGRID), itsForwardGrid); build 12-Sep-2018 15:30:24 casa::openImage(itsImageName+imageExts(BACKWARDGRID), itsBackwardGrid); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SIImageStore.h b/code/synthesis/ImagerObjects/SIImageStore.h build 12-Sep-2018 15:30:24 index 487a2ea..7835a87 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SIImageStore.h build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SIImageStore.h build 12-Sep-2018 15:30:24 @@ -57,28 +57,33 @@ class SIImageStore build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 SIImageStore(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SIImageStore(casacore::String imagename,const casacore::Bool ignorefacets=casacore::False); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - SIImageStore(casacore::String imagename, build 12-Sep-2018 15:30:24 - casacore::CoordinateSystem &imcoordsys, build 12-Sep-2018 15:30:24 - casacore::IPosition imshape, build 12-Sep-2018 15:30:24 - // const casacore::Int nfacets=1, build 12-Sep-2018 15:30:24 + SIImageStore(const casacore::String &imagename, build 12-Sep-2018 15:30:24 + const casacore::Bool ignorefacets=casacore::False); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + SIImageStore(const casacore::String &imagename, build 12-Sep-2018 15:30:24 + const casacore::CoordinateSystem &imcoordsys, build 12-Sep-2018 15:30:24 + const casacore::IPosition &imshape, build 12-Sep-2018 15:30:24 + const casacore::String &objectname, build 12-Sep-2018 15:30:24 + const casacore::Record &miscinfo, build 12-Sep-2018 15:30:24 + // const casacore::Int nfacets=1, build 12-Sep-2018 15:30:24 const casacore::Bool overwrite=casacore::False, build 12-Sep-2018 15:30:24 const casacore::Bool useweightimage=casacore::False); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SIImageStore(SHARED_PTR > modelim, build 12-Sep-2018 15:30:24 - SHARED_PTR > residim, build 12-Sep-2018 15:30:24 - SHARED_PTR > psfim, build 12-Sep-2018 15:30:24 - SHARED_PTR > weightim, build 12-Sep-2018 15:30:24 - SHARED_PTR > restoredim, build 12-Sep-2018 15:30:24 - SHARED_PTR > maskim, build 12-Sep-2018 15:30:24 - SHARED_PTR > sumwtim, build 12-Sep-2018 15:30:24 - SHARED_PTR > gridwtim, build 12-Sep-2018 15:30:24 - SHARED_PTR > pbim, build 12-Sep-2018 15:30:24 - SHARED_PTR > restoredpbcorim, build 12-Sep-2018 15:30:24 - casacore::CoordinateSystem& csys, build 12-Sep-2018 15:30:24 - casacore::IPosition imshape, build 12-Sep-2018 15:30:24 - casacore::String imagename, build 12-Sep-2018 15:30:24 + SIImageStore(const SHARED_PTR > &modelim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &residim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &psfim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &weightim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &restoredim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &maskim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &sumwtim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &gridwtim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &pbim, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &restoredpbcorim, build 12-Sep-2018 15:30:24 + const casacore::CoordinateSystem &csys, build 12-Sep-2018 15:30:24 + const casacore::IPosition &imshape, build 12-Sep-2018 15:30:24 + const casacore::String &imagename, build 12-Sep-2018 15:30:24 + const casacore::String &objectname, build 12-Sep-2018 15:30:24 + const casacore::Record &miscinfo, build 12-Sep-2018 15:30:24 const casacore::Int facet=0, const casacore::Int nfacets=1, build 12-Sep-2018 15:30:24 const casacore::Int chan=0, const casacore::Int nchanchunks=1, build 12-Sep-2018 15:30:24 const casacore::Int pol=0, const casacore::Int npolchunks=1, build 12-Sep-2018 15:30:24 @@ -118,7 +123,9 @@ class SIImageStore build 12-Sep-2018 15:30:24 virtual casacore::Vector getModelImageName(); build 12-Sep-2018 15:30:24 virtual void setWeightDensity( SHARED_PTR imagetoset ); build 12-Sep-2018 15:30:24 virtual casacore::Bool doesImageExist(casacore::String imagename); build 12-Sep-2018 15:30:24 - void setImageInfo(const casacore::Record miscinfo); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + void setObjectName(const casacore::String); build 12-Sep-2018 15:30:24 + void setMiscInfo(const casacore::Record miscinfo); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 virtual void resetImages( casacore::Bool resetpsf, casacore::Bool resetresidual, casacore::Bool resetweight ); build 12-Sep-2018 15:30:24 virtual void addImages( SHARED_PTR imagestoadd, build 12-Sep-2018 15:30:24 @@ -237,10 +244,10 @@ protected: build 12-Sep-2018 15:30:24 SHARED_PTR > openImage(const casacore::String imagenamefull, build 12-Sep-2018 15:30:24 const casacore::Bool overwrite, build 12-Sep-2018 15:30:24 const casacore::Bool dosumwt=casacore::False, build 12-Sep-2018 15:30:24 - const casacore::Int nfacetsperside=1); build 12-Sep-2018 15:30:24 + const casacore::Int nfacetsperside=1, const casacore::Bool checkCoord=casacore::True); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - void buildImage(SHARED_PTR > &imptr, casacore::IPosition shape, casacore::CoordinateSystem csys, casacore::String name); build 12-Sep-2018 15:30:24 - void buildImage(SHARED_PTR > &imptr,casacore::String name); build 12-Sep-2018 15:30:24 + void buildImage(SHARED_PTR > &imptr, casacore::IPosition shape, casacore::CoordinateSystem csys, const casacore::String name); build 12-Sep-2018 15:30:24 + void buildImage(SHARED_PTR > &imptr,const casacore::String name); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 casacore::Double getPbMax(); build 12-Sep-2018 15:30:24 @@ -264,6 +271,7 @@ protected: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 casacore::Bool itsOverWrite; build 12-Sep-2018 15:30:24 casacore::Bool itsUseWeight; build 12-Sep-2018 15:30:24 + casacore::String itsObjectName; build 12-Sep-2018 15:30:24 casacore::Record itsMiscInfo; build 12-Sep-2018 15:30:24 SHARED_PTR > itsMask, itsParentMask, itsGridWt; // mutliterm shares this... build 12-Sep-2018 15:30:24 casacore::Double itsPBScaleFactor; build 12-Sep-2018 15:30:24 @@ -288,6 +296,9 @@ protected: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 private: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + virtual void initMetaInfo(SHARED_PTR > &imptr, build 12-Sep-2018 15:30:24 + const casacore::String name); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 SHARED_PTR > itsPsf, itsModel, itsResidual, itsWeight, itsImage, itsSumWt, itsImagePBcor, itsPB; build 12-Sep-2018 15:30:24 SHARED_PTR > itsForwardGrid, itsBackwardGrid; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SIImageStoreMultiTerm.cc b/code/synthesis/ImagerObjects/SIImageStoreMultiTerm.cc build 12-Sep-2018 15:30:24 index eced858..626c9aa 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SIImageStoreMultiTerm.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SIImageStoreMultiTerm.cc build 12-Sep-2018 15:30:24 @@ -70,49 +70,36 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 SIImageStoreMultiTerm::SIImageStoreMultiTerm():SIImageStore() build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 + itsNTerms=0; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 itsPsfs.resize(0); build 12-Sep-2018 15:30:24 itsModels.resize(0); build 12-Sep-2018 15:30:24 itsResiduals.resize(0); build 12-Sep-2018 15:30:24 itsWeights.resize(0); build 12-Sep-2018 15:30:24 itsImages.resize(0); build 12-Sep-2018 15:30:24 itsSumWts.resize(0); build 12-Sep-2018 15:30:24 - itsPBs.resize(0); build 12-Sep-2018 15:30:24 itsImagePBcors.resize(0); build 12-Sep-2018 15:30:24 - itsMask.reset( ); build 12-Sep-2018 15:30:24 - itsGridWt.reset( ); build 12-Sep-2018 15:30:24 + itsPBs.resize(0); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 itsForwardGrids.resize(0); build 12-Sep-2018 15:30:24 itsBackwardGrids.resize(0); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - itsNTerms=0; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - itsNFacets=1; build 12-Sep-2018 15:30:24 - itsFacetId=0; build 12-Sep-2018 15:30:24 - itsNChanChunks = 1; build 12-Sep-2018 15:30:24 - itsChanId = 0; build 12-Sep-2018 15:30:24 - itsNPolChunks = 1; build 12-Sep-2018 15:30:24 - itsPolId = 0; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 itsUseWeight=false; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - itsImageShape=IPosition(4,0,0,0,0); build 12-Sep-2018 15:30:24 - itsImageName=String(""); build 12-Sep-2018 15:30:24 - itsCoordSys=CoordinateSystem(); build 12-Sep-2018 15:30:24 - itsMiscInfo=Record(); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // itsValidity = false; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 init(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 validate(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - SIImageStoreMultiTerm::SIImageStoreMultiTerm(String imagename, build 12-Sep-2018 15:30:24 - CoordinateSystem &imcoordsys, build 12-Sep-2018 15:30:24 - IPosition imshape, build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Used from SynthesisNormalizer::makeImageStore() build 12-Sep-2018 15:30:24 + SIImageStoreMultiTerm::SIImageStoreMultiTerm(const String &imagename, build 12-Sep-2018 15:30:24 + const CoordinateSystem &imcoordsys, build 12-Sep-2018 15:30:24 + const IPosition &imshape, build 12-Sep-2018 15:30:24 + const String &objectname, build 12-Sep-2018 15:30:24 + const Record &miscinfo, build 12-Sep-2018 15:30:24 const Int /*nfacets*/, build 12-Sep-2018 15:30:24 - const Bool /*overwrite*/, build 12-Sep-2018 15:30:24 + const Bool /*overwrite*/, build 12-Sep-2018 15:30:24 uInt ntaylorterms, build 12-Sep-2018 15:30:24 Bool useweightimage) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 @@ -135,15 +122,8 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 itsForwardGrids.resize(itsNTerms); build 12-Sep-2018 15:30:24 itsBackwardGrids.resize(2 * itsNTerms - 1); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - //cout << "Input imshape : " << imshape << endl; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - itsImageName = imagename; build 12-Sep-2018 15:30:24 - itsImageShape = imshape; build 12-Sep-2018 15:30:24 - itsCoordSys = imcoordsys; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // itsNFacets = nfacets; // So that sumwt shape happens properly, via checkValidity build 12-Sep-2018 15:30:24 // itsFacetId = -1; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 itsNFacets=1; build 12-Sep-2018 15:30:24 itsFacetId=0; build 12-Sep-2018 15:30:24 itsNChanChunks = 1; build 12-Sep-2018 15:30:24 @@ -151,18 +131,23 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 itsNPolChunks = 1; build 12-Sep-2018 15:30:24 itsPolId = 0; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + itsImageName = imagename; build 12-Sep-2018 15:30:24 + itsCoordSys = imcoordsys; build 12-Sep-2018 15:30:24 + itsImageShape = imshape; build 12-Sep-2018 15:30:24 + itsObjectName = objectname; build 12-Sep-2018 15:30:24 + itsMiscInfo = miscinfo; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 itsUseWeight = useweightimage; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - itsMiscInfo=Record(); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 init(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 validate(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SIImageStoreMultiTerm::SIImageStoreMultiTerm(String imagename, uInt ntaylorterms,const Bool ignorefacets) build 12-Sep-2018 15:30:24 + // Used from SynthesisNormalizer::makeImageStore() build 12-Sep-2018 15:30:24 + SIImageStoreMultiTerm::SIImageStoreMultiTerm(const String &imagename, uInt ntaylorterms, build 12-Sep-2018 15:30:24 + const Bool ignorefacets) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 LogIO os( LogOrigin("SIImageStoreMultiTerm","Open existing Images",WHERE) ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -236,6 +221,9 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 itsNFacets = imptr->shape()[0]; build 12-Sep-2018 15:30:24 itsFacetId = 0; build 12-Sep-2018 15:30:24 itsUseWeight = getUseWeightImage( *imptr ); build 12-Sep-2018 15:30:24 + /////redo this here as psf may have different coordinates build 12-Sep-2018 15:30:24 + itsCoordSys = imptr->coordinates(); build 12-Sep-2018 15:30:24 + itsMiscInfo=imptr->miscInfo(); build 12-Sep-2018 15:30:24 if( itsUseWeight && ! doesImageExist(itsImageName+String(".weight.tt0")) ) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 throw(AipsError("Internal error : MultiTerm Sumwt has a useweightimage=true but the weight image does not exist.")); build 12-Sep-2018 15:30:24 @@ -304,28 +292,32 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 ////////////////////////////////////////////////////////////////////////////////////////////////////// build 12-Sep-2018 15:30:24 /////////////Constructor with pointers already created else where but taken over here build 12-Sep-2018 15:30:24 - SIImageStoreMultiTerm::SIImageStoreMultiTerm(Block > > modelims, build 12-Sep-2018 15:30:24 - Block > >residims, build 12-Sep-2018 15:30:24 - Block > >psfims, build 12-Sep-2018 15:30:24 - Block > >weightims, build 12-Sep-2018 15:30:24 - Block > >restoredims, build 12-Sep-2018 15:30:24 - Block > >sumwtims, build 12-Sep-2018 15:30:24 - Block > >pbims, build 12-Sep-2018 15:30:24 - Block > >restoredpbcorims, build 12-Sep-2018 15:30:24 - SHARED_PTR > newmask, build 12-Sep-2018 15:30:24 - SHARED_PTR > newalpha, build 12-Sep-2018 15:30:24 - SHARED_PTR > newbeta, build 12-Sep-2018 15:30:24 - SHARED_PTR > newalphaerror, build 12-Sep-2018 15:30:24 - SHARED_PTR > newalphapbcor, build 12-Sep-2018 15:30:24 - SHARED_PTR > newbetapbcor, build 12-Sep-2018 15:30:24 - CoordinateSystem& csys, build 12-Sep-2018 15:30:24 - IPosition imshape, build 12-Sep-2018 15:30:24 - String imagename, build 12-Sep-2018 15:30:24 + // used from getSubImageStore(), for example when creating the facets list build 12-Sep-2018 15:30:24 + // this would be safer if it was refactored as a copy constructor of the generic stuff + build 12-Sep-2018 15:30:24 + // initialization of the facet related parameters build 12-Sep-2018 15:30:24 + SIImageStoreMultiTerm::SIImageStoreMultiTerm(const Block > > &modelims, build 12-Sep-2018 15:30:24 + const Block > > &residims, build 12-Sep-2018 15:30:24 + const Block > > &psfims, build 12-Sep-2018 15:30:24 + const Block > > &weightims, build 12-Sep-2018 15:30:24 + const Block > > &restoredims, build 12-Sep-2018 15:30:24 + const Block > > &sumwtims, build 12-Sep-2018 15:30:24 + const Block > > &pbims, build 12-Sep-2018 15:30:24 + const Block > > &restoredpbcorims, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &newmask, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &newalpha, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &newbeta, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &newalphaerror, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &newalphapbcor, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &newbetapbcor, build 12-Sep-2018 15:30:24 + const CoordinateSystem& csys, build 12-Sep-2018 15:30:24 + const IPosition &imshape, build 12-Sep-2018 15:30:24 + const String &imagename, build 12-Sep-2018 15:30:24 + const String &objectname, build 12-Sep-2018 15:30:24 + const Record &miscinfo, build 12-Sep-2018 15:30:24 const Int facet, const Int nfacets, build 12-Sep-2018 15:30:24 const Int chan, const Int nchanchunks, build 12-Sep-2018 15:30:24 const Int pol, const Int npolchunks) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 itsPsfs=psfims; build 12-Sep-2018 15:30:24 itsModels=modelims; build 12-Sep-2018 15:30:24 itsResiduals=residims; build 12-Sep-2018 15:30:24 @@ -352,6 +344,9 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 itsForwardGrids.resize( itsNTerms ); build 12-Sep-2018 15:30:24 itsBackwardGrids.resize( 2 * itsNTerms - 1 ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + itsObjectName = objectname; build 12-Sep-2018 15:30:24 + itsMiscInfo = miscinfo; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 itsNFacets = nfacets; build 12-Sep-2018 15:30:24 itsFacetId = facet; build 12-Sep-2018 15:30:24 itsNChanChunks = nchanchunks; build 12-Sep-2018 15:30:24 @@ -383,7 +378,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 itsMask.reset( ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - validate(); build 12-Sep-2018 15:30:24 + validate(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -624,15 +619,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 accessImage( itsModels[term], itsParentModels[term], imageExts(MODEL)+".tt"+String::toString(term) ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Set up header info the first time. build 12-Sep-2018 15:30:24 - ImageInfo info = itsModels[term]->imageInfo(); build 12-Sep-2018 15:30:24 - String objectName(""); build 12-Sep-2018 15:30:24 - if( itsMiscInfo.isDefined("OBJECT") ){ itsMiscInfo.get("OBJECT", objectName); } build 12-Sep-2018 15:30:24 - info.setObjectName(objectName); build 12-Sep-2018 15:30:24 - itsModels[term]->setImageInfo( info ); build 12-Sep-2018 15:30:24 - itsModels[term]->setMiscInfo( itsMiscInfo ); build 12-Sep-2018 15:30:24 itsModels[term]->setUnits("Jy/pixel"); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 return itsModels[term]; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -761,7 +748,6 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 void SIImageStoreMultiTerm::addImages( SHARED_PTR imagestoadd, build 12-Sep-2018 15:30:24 Bool addpsf, Bool addresidual, Bool addweight, Bool adddensity) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 for(uInt tix=0;tix<2*itsNTerms-1;tix++) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1306,12 +1292,14 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 os< SIImageStoreMultiTerm::getSubImageStore(const Int facet, const Int nfacets, build 12-Sep-2018 15:30:24 const Int chan, const Int nchanchunks, build 12-Sep-2018 15:30:24 const Int pol, const Int npolchunks) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - return SHARED_PTR(new SIImageStoreMultiTerm(itsModels, itsResiduals, itsPsfs, itsWeights, itsImages, itsSumWts, itsPBs, itsImagePBcors, itsMask, itsAlpha, itsBeta, itsAlphaError,itsAlphaPBcor, itsBetaPBcor, itsCoordSys,itsParentImageShape, itsImageName, facet, nfacets,chan,nchanchunks,pol,npolchunks)); build 12-Sep-2018 15:30:24 + std::shared_ptr multiTermStore = build 12-Sep-2018 15:30:24 + std::make_shared(itsModels, itsResiduals, itsPsfs, itsWeights, itsImages, itsSumWts, itsPBs, itsImagePBcors, itsMask, itsAlpha, itsBeta, itsAlphaError,itsAlphaPBcor, itsBetaPBcor, itsCoordSys, itsParentImageShape, itsImageName, itsObjectName, itsMiscInfo, facet, nfacets, chan, nchanchunks, pol, npolchunks); build 12-Sep-2018 15:30:24 + return multiTermStore; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SIImageStoreMultiTerm.h b/code/synthesis/ImagerObjects/SIImageStoreMultiTerm.h build 12-Sep-2018 15:30:24 index 67ebbea..3b9a43f 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SIImageStoreMultiTerm.h build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SIImageStoreMultiTerm.h build 12-Sep-2018 15:30:24 @@ -53,10 +53,17 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 // Default constructor build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 SIImageStoreMultiTerm(); build 12-Sep-2018 15:30:24 - SIImageStoreMultiTerm(casacore::String imagename, casacore::uInt ntaylorterms=1, const casacore::Bool ignorefacets=false); build 12-Sep-2018 15:30:24 - SIImageStoreMultiTerm(casacore::String imagename, casacore::CoordinateSystem &imcoordsys, build 12-Sep-2018 15:30:24 - casacore::IPosition imshape, const int nfacets, build 12-Sep-2018 15:30:24 - const casacore::Bool overwrite=false, casacore::uInt ntaylorterms=1,casacore::Bool useweightimage=false); build 12-Sep-2018 15:30:24 + SIImageStoreMultiTerm(const casacore::String &imagename, casacore::uInt ntaylorterms=1, build 12-Sep-2018 15:30:24 + const casacore::Bool ignorefacets=false); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + SIImageStoreMultiTerm(const casacore::String &imagename, build 12-Sep-2018 15:30:24 + const casacore::CoordinateSystem &imcoordsys, build 12-Sep-2018 15:30:24 + const casacore::IPosition &imshape, build 12-Sep-2018 15:30:24 + const casacore::String &objectname, build 12-Sep-2018 15:30:24 + const casacore::Record &miscinfo, build 12-Sep-2018 15:30:24 + const int nfacets, build 12-Sep-2018 15:30:24 + const casacore::Bool overwrite=false, build 12-Sep-2018 15:30:24 + casacore::uInt ntaylorterms=1,casacore::Bool useweightimage=false); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 /* build 12-Sep-2018 15:30:24 SIImageStoreMultiTerm(casacore::Block > >modelims, build 12-Sep-2018 15:30:24 @@ -70,23 +77,25 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 SHARED_PTR > newbeta); build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SIImageStoreMultiTerm(casacore::Block > >modelims, build 12-Sep-2018 15:30:24 - casacore::Block > >residims, build 12-Sep-2018 15:30:24 - casacore::Block > >psfims, build 12-Sep-2018 15:30:24 - casacore::Block > >weightims, build 12-Sep-2018 15:30:24 - casacore::Block > >restoredims, build 12-Sep-2018 15:30:24 - casacore::Block > >sumwtims, build 12-Sep-2018 15:30:24 - casacore::Block > >pbims, build 12-Sep-2018 15:30:24 - casacore::Block > >restoredpbcorims, build 12-Sep-2018 15:30:24 - SHARED_PTR > newmask, build 12-Sep-2018 15:30:24 - SHARED_PTR > newalpha, build 12-Sep-2018 15:30:24 - SHARED_PTR > newbeta, build 12-Sep-2018 15:30:24 - SHARED_PTR > newalphaerror, build 12-Sep-2018 15:30:24 - SHARED_PTR > newalphapbcor, build 12-Sep-2018 15:30:24 - SHARED_PTR > newbetapbcor, build 12-Sep-2018 15:30:24 - casacore::CoordinateSystem& csys, build 12-Sep-2018 15:30:24 - casacore::IPosition imshape, build 12-Sep-2018 15:30:24 - casacore::String imagename, build 12-Sep-2018 15:30:24 + SIImageStoreMultiTerm(const casacore::Block > > &modelims, build 12-Sep-2018 15:30:24 + const casacore::Block > > &residims, build 12-Sep-2018 15:30:24 + const casacore::Block > > &psfims, build 12-Sep-2018 15:30:24 + const casacore::Block > > &weightims, build 12-Sep-2018 15:30:24 + const casacore::Block > > &restoredims, build 12-Sep-2018 15:30:24 + const casacore::Block > > &sumwtims, build 12-Sep-2018 15:30:24 + const casacore::Block > > &pbims, build 12-Sep-2018 15:30:24 + const casacore::Block > > &restoredpbcorims, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &newmask, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &newalpha, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &newbeta, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &newalphaerror, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &newalphapbcor, build 12-Sep-2018 15:30:24 + const SHARED_PTR > &newbetapbcor, build 12-Sep-2018 15:30:24 + const casacore::CoordinateSystem &csys, build 12-Sep-2018 15:30:24 + const casacore::IPosition &imshape, build 12-Sep-2018 15:30:24 + const casacore::String &imagename, build 12-Sep-2018 15:30:24 + const casacore::String &objectname, build 12-Sep-2018 15:30:24 + const casacore::Record &miscinfo, build 12-Sep-2018 15:30:24 const casacore::Int facet=0, const casacore::Int nfacets=1, build 12-Sep-2018 15:30:24 const casacore::Int chan=0, const casacore::Int nchanchunks=1, build 12-Sep-2018 15:30:24 const casacore::Int pol=0, const casacore::Int npolchunks=1); build 12-Sep-2018 15:30:24 @@ -194,11 +203,11 @@ private: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 casacore::uInt itsNTerms; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - casacore::Block > > itsPsfs, itsModels, itsResiduals, itsWeights, itsImages, itsSumWts, itsImagePBcors, itsPBs; build 12-Sep-2018 15:30:24 + casacore::Block > > itsPsfs, itsModels, itsResiduals, itsWeights, itsImages, itsSumWts, itsImagePBcors, itsPBs; build 12-Sep-2018 15:30:24 casacore::Block > > itsForwardGrids, itsBackwardGrids; build 12-Sep-2018 15:30:24 - SHARED_PTR > itsAlpha, itsBeta, itsAlphaError, itsAlphaPBcor, itsBetaPBcor; build 12-Sep-2018 15:30:24 + SHARED_PTR > itsAlpha, itsBeta, itsAlphaError, itsAlphaPBcor, itsBetaPBcor; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - casacore::Block > > itsParentPsfs, itsParentModels, itsParentResiduals, itsParentWeights, itsParentImages, itsParentSumWts, itsParentPBs, itsParentImagePBcors; build 12-Sep-2018 15:30:24 + casacore::Block > > itsParentPsfs, itsParentModels, itsParentResiduals, itsParentWeights, itsParentImages, itsParentSumWts, itsParentPBs, itsParentImagePBcors; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SIIterBot.cc b/code/synthesis/ImagerObjects/SIIterBot.cc build 12-Sep-2018 15:30:24 index 82ccf3b..050cb5b 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SIIterBot.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SIIterBot.cc build 12-Sep-2018 15:30:24 @@ -179,6 +179,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 os <= itsNiter ) { stopCode=1; } build 12-Sep-2018 15:30:24 //os << "Numer of iterations. "; // (" << itsIterDone << ") >= limit (" << itsNiter << ")" ; build 12-Sep-2018 15:30:24 - if( usePeakRes <= itsThreshold ) {stopCode=2;} build 12-Sep-2018 15:30:24 - //if ( usePeakRes <= itsThreshold ) { build 12-Sep-2018 15:30:24 - // (itsThreshold >= itsNsigmaThreshold) {stopCode=2;} build 12-Sep-2018 15:30:24 - //if (itsThreshold >= itsNsigmaThreshold) {stopCode=2;} build 12-Sep-2018 15:30:24 - //else { if(itsNsigmaThreshold!=0.0) stopCode=8;} // for nsigma=0.0 this mode is turned off. build 12-Sep-2018 15:30:24 - //} build 12-Sep-2018 15:30:24 + if( usePeakRes <= itsThreshold || (usePeakRes-itsThreshold)/itsThreshold < tol) {stopCode=2; } build 12-Sep-2018 15:30:24 else if ( usePeakRes <= itsNsigmaThreshold ) { build 12-Sep-2018 15:30:24 if (itsNsigmaThreshold!=0.0) { stopCode=8; } // for nsigma=0.0 this mode is turned off build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SynthesisDeconvolver.cc b/code/synthesis/ImagerObjects/SynthesisDeconvolver.cc build 12-Sep-2018 15:30:24 index b0ca7d7..2e16258 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SynthesisDeconvolver.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SynthesisDeconvolver.cc build 12-Sep-2018 15:30:24 @@ -81,6 +81,8 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 LogIO os( LogOrigin("SynthesisDeconvolver","descructor",WHERE) ); build 12-Sep-2018 15:30:24 os << LogIO::DEBUG1 << "SynthesisDeconvolver destroyed" << LogIO::POST; build 12-Sep-2018 15:30:24 + SynthesisUtilMethods::getResource("End SynthesisDeconvolver"); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void SynthesisDeconvolver::setupDeconvolution(const SynthesisParamsDeconv& decpars) build 12-Sep-2018 15:30:24 @@ -501,7 +503,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 itsMaskHandler->fillMask( itsImages, itsMaskList); build 12-Sep-2018 15:30:24 if( itsPBMask > 0.0 ) { build 12-Sep-2018 15:30:24 - itsMaskHandler->makePBMask(itsImages, itsPBMask); build 12-Sep-2018 15:30:24 + itsMaskHandler->makePBMask(itsImages, itsPBMask, True); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else if( itsMaskType=="pb") { build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SynthesisImager.cc b/code/synthesis/ImagerObjects/SynthesisImager.cc build 12-Sep-2018 15:30:24 index d3578ca..ba4a9b3 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SynthesisImager.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SynthesisImager.cc build 12-Sep-2018 15:30:24 @@ -144,7 +144,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 // cerr << "IN DESTR"<< endl; build 12-Sep-2018 15:30:24 // VisModelData::listModel(mss4vi_p[0]); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SynthesisUtilMethods::getResource("End Run"); build 12-Sep-2018 15:30:24 + SynthesisUtilMethods::getResource("End SynthesisImager"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// build 12-Sep-2018 15:30:24 @@ -199,7 +199,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 LogIO os( LogOrigin("SynthesisImager","selectData",WHERE) ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SynthesisUtilMethods::getResource("Start Run"); build 12-Sep-2018 15:30:24 + SynthesisUtilMethods::getResource("Start SelectData"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 try build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 @@ -1248,34 +1248,34 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 try build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 + // Prepare miscellaneous image information build 12-Sep-2018 15:30:24 + auto objectName = msc.field().name()(msc.fieldId()(0)); build 12-Sep-2018 15:30:24 + ///// misc info fpr ImageStore. This will go to the 'miscinfo' table keyword build 12-Sep-2018 15:30:24 + Record miscInfo; build 12-Sep-2018 15:30:24 + auto telescop=msc.observation().telescopeName()(0); build 12-Sep-2018 15:30:24 + miscInfo.define("INSTRUME", telescop); build 12-Sep-2018 15:30:24 + miscInfo.define("distance", distance.get("m").getValue()); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if( mappertype=="default" || mappertype=="imagemosaic" ) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - imstor=std::make_shared(imageName, cSys, imShape, overwrite, (useweightimage || (mappertype=="imagemosaic") )); build 12-Sep-2018 15:30:24 - // imstor=new SIImageStore(imageName, cSys, imShape, facets, overwrite, (useweightimage || (mappertype=="imagemosaic") )); build 12-Sep-2018 15:30:24 + imstor = std::make_shared(imageName, cSys, imShape, objectName, build 12-Sep-2018 15:30:24 + miscInfo, overwrite, build 12-Sep-2018 15:30:24 + (useweightimage || (mappertype=="imagemosaic") build 12-Sep-2018 15:30:24 + )); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else if (mappertype == "multiterm" ) // Currently does not support imagemosaic. build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - //cout << "Making multiterm IS with nterms : " << ntaylorterms << endl; build 12-Sep-2018 15:30:24 - imstor=new SIImageStoreMultiTerm(imageName, cSys, imShape, facets, overwrite, ntaylorterms, useweightimage); build 12-Sep-2018 15:30:24 + // upcast with shared_ptr and then assign to CountedPtr build 12-Sep-2018 15:30:24 + std::shared_ptr multiTermStore = build 12-Sep-2018 15:30:24 + std::make_shared(imageName, cSys, imShape, build 12-Sep-2018 15:30:24 + objectName, miscInfo, facets, build 12-Sep-2018 15:30:24 + overwrite, ntaylorterms, useweightimage); build 12-Sep-2018 15:30:24 + imstor = multiTermStore; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 throw(AipsError("Internal Error : Invalid mapper type in SynthesisImager::createIMStore")); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Fill in miscellaneous information needed by FITS build 12-Sep-2018 15:30:24 - //ROMSColumns msc(mss4vi_p[0]); build 12-Sep-2018 15:30:24 - Record info; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - String objectName=msc.field().name()(msc.fieldId()(0)); build 12-Sep-2018 15:30:24 - String telescop=msc.observation().telescopeName()(0); build 12-Sep-2018 15:30:24 - info.define("OBJECT", objectName); build 12-Sep-2018 15:30:24 - info.define("TELESCOP", telescop); build 12-Sep-2018 15:30:24 - info.define("INSTRUME", telescop); build 12-Sep-2018 15:30:24 - info.define("distance", distance.get("m").getValue()); build 12-Sep-2018 15:30:24 - ////////////// Send misc info into ImageStore. build 12-Sep-2018 15:30:24 - imstor->setImageInfo( info ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Get polRep from 'msc' here, and send to imstore. build 12-Sep-2018 15:30:24 StokesImageUtil::PolRep polRep(StokesImageUtil::CIRCULAR); build 12-Sep-2018 15:30:24 @@ -1501,13 +1501,13 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 // heuristic factors multiplied to imshape based on gridder build 12-Sep-2018 15:30:24 size_t fudge_factor = 15; build 12-Sep-2018 15:30:24 if (ftm->name()=="MosaicFTNew") { build 12-Sep-2018 15:30:24 - fudge_factor = 15; build 12-Sep-2018 15:30:24 + fudge_factor = 20; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else if (ftm->name()=="GridFT") { build 12-Sep-2018 15:30:24 fudge_factor = 9; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - size_t required_mem = fudge_factor * sizeof(Float); build 12-Sep-2018 15:30:24 + Double required_mem = fudge_factor * sizeof(Float); build 12-Sep-2018 15:30:24 for (size_t i = 0; i < imshape.nelements(); i++) { build 12-Sep-2018 15:30:24 // gridding pads image and increases to composite number build 12-Sep-2018 15:30:24 if (i < 2) { build 12-Sep-2018 15:30:24 @@ -1526,7 +1526,6 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 // assumes all processes need the same amount of memory build 12-Sep-2018 15:30:24 required_mem *= nlocal_procs; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 Double usr_memfrac, usr_mem; build 12-Sep-2018 15:30:24 AipsrcValue::find(usr_memfrac, "system.resources.memfrac", 80.); build 12-Sep-2018 15:30:24 AipsrcValue::find(usr_mem, "system.resources.memory", -1024.); build 12-Sep-2018 15:30:24 @@ -1535,10 +1534,9 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 memory_avail = usr_mem * 1024. * 1024.; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 - memory_avail = HostInfo::memoryTotal(false) * (usr_memfrac / 100.) * 1024.; build 12-Sep-2018 15:30:24 + memory_avail = Double(HostInfo::memoryFree()) * (usr_memfrac / 100.) * 1024.; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // compute required chanchunks to fit into the available memory build 12-Sep-2018 15:30:24 chanchunks = (int)std::ceil((Double)required_mem / memory_avail); build 12-Sep-2018 15:30:24 if (imshape.nelements() == 4 && imshape[3] < chanchunks) { build 12-Sep-2018 15:30:24 @@ -1881,7 +1879,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 // With lazy fill ON, CFCache loads the required CFs on-demand build 12-Sep-2018 15:30:24 // from the disk. And periodically triggers garbage collection to build 12-Sep-2018 15:30:24 // release CFs that aren't required immediately. build 12-Sep-2018 15:30:24 - cfCacheObj->setLazyFill(SynthesisUtils::getenv("CFCache.LAZYFILL",0)==1); build 12-Sep-2018 15:30:24 + cfCacheObj->setLazyFill(SynthesisUtils::getenv("CFCache.LAZYFILL",1)==1); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // cerr << "Setting wtImagePrefix to " << imageNamePrefix.c_str() << endl; build 12-Sep-2018 15:30:24 cfCacheObj->setWtImagePrefix(imageNamePrefix.c_str()); build 12-Sep-2018 15:30:24 @@ -2167,7 +2165,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 //cerr << "IN SYNTHE_IMA" << endl; build 12-Sep-2018 15:30:24 //VisModelData::listModel(rvi_p->getMeasurementSet()); build 12-Sep-2018 15:30:24 - //SynthesisUtilMethods::getResource("Before finalize for all mappers"); build 12-Sep-2018 15:30:24 + SynthesisUtilMethods::getResource("Before finalize for all mappers"); build 12-Sep-2018 15:30:24 if(!dopsf) itsMappers.finalizeDegrid(*vb); build 12-Sep-2018 15:30:24 itsMappers.finalizeGrid(*vb, dopsf); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -2396,6 +2394,104 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 }// end makeSdImage build 12-Sep-2018 15:30:24 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + void SynthesisImager::makeImage(String type, const String& imagename, const String& complexImage, const Int whichModel) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + LogIO os( LogOrigin("SynthesisImager","makeImage",WHERE) ); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + FTMachine::Type seType(FTMachine::OBSERVED); build 12-Sep-2018 15:30:24 + if(type=="observed") { build 12-Sep-2018 15:30:24 + seType=FTMachine::OBSERVED; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL // Loglevel INFO build 12-Sep-2018 15:30:24 + << "Making dirty image from " << type << " data " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="model") { build 12-Sep-2018 15:30:24 + seType=FTMachine::MODEL; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL // Loglevel INFO build 12-Sep-2018 15:30:24 + << "Making dirty image from " << type << " data " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="corrected") { build 12-Sep-2018 15:30:24 + seType=FTMachine::CORRECTED; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL // Loglevel INFO build 12-Sep-2018 15:30:24 + << "Making dirty image from " << type << " data " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="psf") { build 12-Sep-2018 15:30:24 + seType=FTMachine::PSF; build 12-Sep-2018 15:30:24 + os << "Making point spread function " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="residual") { build 12-Sep-2018 15:30:24 + seType=FTMachine::RESIDUAL; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL // Loglevel INFO build 12-Sep-2018 15:30:24 + << "Making dirty image from " << type << " data " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="singledish-observed") { build 12-Sep-2018 15:30:24 + seType=FTMachine::OBSERVED; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Making single dish image from observed data" << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="singledish") { build 12-Sep-2018 15:30:24 + seType=FTMachine::CORRECTED; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Making single dish image from corrected data" << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="coverage") { build 12-Sep-2018 15:30:24 + seType=FTMachine::COVERAGE; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Making single dish coverage function " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="holography") { build 12-Sep-2018 15:30:24 + seType=FTMachine::CORRECTED; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Making complex holographic image from corrected data " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="holography-observed") { build 12-Sep-2018 15:30:24 + seType=FTMachine::OBSERVED; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Making complex holographic image from observed data " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String imageName=(itsMappers.imageStore(whichModel))->getName(); build 12-Sep-2018 15:30:24 + String cImageName(complexImage); build 12-Sep-2018 15:30:24 + Bool keepComplexImage=(complexImage!="")||(type.contains("holography")); build 12-Sep-2018 15:30:24 + if(complexImage=="") { build 12-Sep-2018 15:30:24 + cImageName=imageName+".compleximage"; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + PagedImage theImage((itsMappers.imageStore(whichModel))->getShape(), (itsMappers.imageStore(whichModel))->getCSys(), imagename); build 12-Sep-2018 15:30:24 + PagedImage cImageImage(theImage.shape(), build 12-Sep-2018 15:30:24 + theImage.coordinates(), build 12-Sep-2018 15:30:24 + cImageName); build 12-Sep-2018 15:30:24 + if(!keepComplexImage) build 12-Sep-2018 15:30:24 + cImageImage.table().markForDelete(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + Matrix weight; build 12-Sep-2018 15:30:24 + (itsMappers.getFTM(whichModel))->makeImage(seType, *rvi_p, cImageImage, weight); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if(seType==FTMachine::PSF){ build 12-Sep-2018 15:30:24 + StokesImageUtil::ToStokesPSF(theImage, cImageImage); build 12-Sep-2018 15:30:24 + StokesImageUtil::normalizePSF(theImage); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else{ build 12-Sep-2018 15:30:24 + StokesImageUtil::To(theImage, cImageImage); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + unlockMSs(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + }// end makeImage build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SynthesisImager.h b/code/synthesis/ImagerObjects/SynthesisImager.h build 12-Sep-2018 15:30:24 index 56f9ff6..1244249 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SynthesisImager.h build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SynthesisImager.h build 12-Sep-2018 15:30:24 @@ -182,7 +182,14 @@ class SynthesisImager build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 virtual void predictModel(); build 12-Sep-2018 15:30:24 virtual void makeSdImage(casacore::Bool dopsf=false); build 12-Sep-2018 15:30:24 - // void makeImage(); build 12-Sep-2018 15:30:24 + ///This should replace makeSDImage and makePSF etc in the long run build 12-Sep-2018 15:30:24 + ///But for now you can do the following images i.e string recognized by type build 12-Sep-2018 15:30:24 + ///"observed", "model", "corrected", "psf", "residual", "singledish-observed", build 12-Sep-2018 15:30:24 + ///"singledish", "coverage", "holography", "holography-observed" build 12-Sep-2018 15:30:24 + ///For holography the FTmachine should be SDGrid and the baselines build 12-Sep-2018 15:30:24 + //selected should be those that are pointed up with the antenna which is rastering. build 12-Sep-2018 15:30:24 + virtual void makeImage(casacore::String type, const casacore::String& imagename, const casacore::String& complexImage=casacore::String(""), const Int whichModel=0); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 /* Access method to the Loop Controller held in this class */ build 12-Sep-2018 15:30:24 //SIIterBot& getLoopControls(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SynthesisImagerVi2.cc b/code/synthesis/ImagerObjects/SynthesisImagerVi2.cc build 12-Sep-2018 15:30:24 index 4a69e9b..fadf399 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SynthesisImagerVi2.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SynthesisImagerVi2.cc build 12-Sep-2018 15:30:24 @@ -115,12 +115,15 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 if(mss_p[k]) build 12-Sep-2018 15:30:24 delete mss_p[k]; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 + SynthesisUtilMethods::getResource("End Run"); build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Bool SynthesisImagerVi2::selectData(const SynthesisParamsSelect& selpars){ build 12-Sep-2018 15:30:24 LogIO os( LogOrigin("SynthesisImagerVi2","selectData",WHERE) ); build 12-Sep-2018 15:30:24 Bool retval=True; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + SynthesisUtilMethods::getResource("Start Run"); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 try build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -594,7 +597,7 @@ Bool SynthesisImagerVi2::defineImage(SynthesisParamsImage& impars, build 12-Sep-2018 15:30:24 gridpars.interpolation, impars.freqFrameValid, 1000000000, 16, impars.stokes, build 12-Sep-2018 15:30:24 impars.imageName, gridpars.pointingDirCol, gridpars.skyPosThreshold, build 12-Sep-2018 15:30:24 gridpars.convSupport, gridpars.truncateSize, gridpars.gwidth, gridpars.jwidth, build 12-Sep-2018 15:30:24 - gridpars.minWeight, gridpars.clipMinMax); build 12-Sep-2018 15:30:24 + gridpars.minWeight, gridpars.clipMinMax, impars.pseudoi); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 catch(AipsError &x) build 12-Sep-2018 15:30:24 @@ -765,7 +768,8 @@ Bool SynthesisImagerVi2::defineImage(SynthesisParamsImage& impars, build 12-Sep-2018 15:30:24 vi_p->useImagingWeight(imwgt_p); build 12-Sep-2018 15:30:24 /////////////////////////////// build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + SynthesisUtilMethods::getResource("Set Weighting"); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 /// return true; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -812,13 +816,13 @@ void SynthesisImagerVi2::appendToMapperList(String imagename, build 12-Sep-2018 15:30:24 // heuristic factors multiplied to imshape based on gridder build 12-Sep-2018 15:30:24 size_t fudge_factor = 15; build 12-Sep-2018 15:30:24 if (ftm->name()=="MosaicFTNew") { build 12-Sep-2018 15:30:24 - fudge_factor = 15; build 12-Sep-2018 15:30:24 + fudge_factor = 20; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else if (ftm->name()=="GridFT") { build 12-Sep-2018 15:30:24 fudge_factor = 9; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - size_t required_mem = fudge_factor * sizeof(Float); build 12-Sep-2018 15:30:24 + Double required_mem = fudge_factor * sizeof(Float); build 12-Sep-2018 15:30:24 for (size_t i = 0; i < imshape.nelements(); i++) { build 12-Sep-2018 15:30:24 // gridding pads image and increases to composite number build 12-Sep-2018 15:30:24 if (i < 2) { build 12-Sep-2018 15:30:24 @@ -837,7 +841,6 @@ void SynthesisImagerVi2::appendToMapperList(String imagename, build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 // assumes all processes need the same amount of memory build 12-Sep-2018 15:30:24 required_mem *= nlocal_procs; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 Double usr_memfrac, usr_mem; build 12-Sep-2018 15:30:24 AipsrcValue::find(usr_memfrac, "system.resources.memfrac", 80.); build 12-Sep-2018 15:30:24 AipsrcValue::find(usr_mem, "system.resources.memory", -1.); build 12-Sep-2018 15:30:24 @@ -846,9 +849,8 @@ void SynthesisImagerVi2::appendToMapperList(String imagename, build 12-Sep-2018 15:30:24 memory_avail = usr_mem * 1024. * 1024.; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 - memory_avail = HostInfo::memoryTotal(false) * (usr_memfrac / 100.) * 1024.; build 12-Sep-2018 15:30:24 + memory_avail = Double(HostInfo::memoryFree()) * (usr_memfrac / 100.) * 1024.; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // compute required chanchunks to fit into the available memory build 12-Sep-2018 15:30:24 chanchunks = (int)std::ceil((Double)required_mem / memory_avail); build 12-Sep-2018 15:30:24 if (imshape.nelements() == 4 && imshape[3] < chanchunks) { build 12-Sep-2018 15:30:24 @@ -1256,8 +1258,149 @@ void SynthesisImagerVi2::appendToMapperList(String imagename, build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 unlockMSs(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - }// end makeImage build 12-Sep-2018 15:30:24 + }// end makeSDImage build 12-Sep-2018 15:30:24 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// build 12-Sep-2018 15:30:24 + void SynthesisImagerVi2::makeImage(String type, const String& imagename, const String& complexImage, const Int whichModel) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + LogIO os( LogOrigin("SynthesisImager","makeImage",WHERE) ); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + refim::FTMachine::Type seType(refim::FTMachine::OBSERVED); build 12-Sep-2018 15:30:24 + if(type=="observed") { build 12-Sep-2018 15:30:24 + seType=refim::FTMachine::OBSERVED; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL // Loglevel INFO build 12-Sep-2018 15:30:24 + << "Making dirty image from " << type << " data " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="model") { build 12-Sep-2018 15:30:24 + seType=refim::FTMachine::MODEL; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL // Loglevel INFO build 12-Sep-2018 15:30:24 + << "Making dirty image from " << type << " data " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="corrected") { build 12-Sep-2018 15:30:24 + seType=refim::FTMachine::CORRECTED; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL // Loglevel INFO build 12-Sep-2018 15:30:24 + << "Making dirty image from " << type << " data " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="psf") { build 12-Sep-2018 15:30:24 + seType=refim::FTMachine::PSF; build 12-Sep-2018 15:30:24 + os << "Making point spread function " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="residual") { build 12-Sep-2018 15:30:24 + seType=refim::FTMachine::RESIDUAL; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL // Loglevel INFO build 12-Sep-2018 15:30:24 + << "Making dirty image from " << type << " data " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="singledish-observed") { build 12-Sep-2018 15:30:24 + seType=refim::FTMachine::OBSERVED; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Making single dish image from observed data" << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="singledish") { build 12-Sep-2018 15:30:24 + seType=refim::FTMachine::CORRECTED; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Making single dish image from corrected data" << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="coverage") { build 12-Sep-2018 15:30:24 + seType=refim::FTMachine::COVERAGE; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Making single dish coverage function " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="holography") { build 12-Sep-2018 15:30:24 + seType=refim::FTMachine::CORRECTED; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Making complex holographic image from corrected data " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else if (type=="holography-observed") { build 12-Sep-2018 15:30:24 + seType=refim::FTMachine::OBSERVED; build 12-Sep-2018 15:30:24 + os << LogIO::NORMAL build 12-Sep-2018 15:30:24 + << "Making complex holographic image from observed data " build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + String imageName=(itsMappers.imageStore(whichModel))->getName(); build 12-Sep-2018 15:30:24 + String cImageName(complexImage); build 12-Sep-2018 15:30:24 + if(complexImage=="") { build 12-Sep-2018 15:30:24 + cImageName=imageName+".compleximage"; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + Bool keepComplexImage=(complexImage!="")||(type.contains("holography")); build 12-Sep-2018 15:30:24 + //cerr << "name " << (itsMappers.getFTM2(whichModel))->name() << endl; build 12-Sep-2018 15:30:24 + if(((itsMappers.getFTM2(whichModel))->name())!="MultiTermFTNew"){ build 12-Sep-2018 15:30:24 + ////Non multiterm case build 12-Sep-2018 15:30:24 + PagedImage theImage((itsMappers.imageStore(whichModel))->getShape(), (itsMappers.imageStore(whichModel))->getCSys(), imagename); build 12-Sep-2018 15:30:24 + PagedImage cImageImage(theImage.shape(), build 12-Sep-2018 15:30:24 + theImage.coordinates(), build 12-Sep-2018 15:30:24 + cImageName); build 12-Sep-2018 15:30:24 + if(!keepComplexImage) build 12-Sep-2018 15:30:24 + cImageImage.table().markForDelete(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + Matrix weight; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + (itsMappers.getFTM2(whichModel))->makeImage(seType, *vi_p, cImageImage, weight); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if(seType==refim::FTMachine::PSF){ build 12-Sep-2018 15:30:24 + StokesImageUtil::ToStokesPSF(theImage, cImageImage); build 12-Sep-2018 15:30:24 + StokesImageUtil::normalizePSF(theImage); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else{ build 12-Sep-2018 15:30:24 + StokesImageUtil::To(theImage, cImageImage); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else{ build 12-Sep-2018 15:30:24 + ///Multiterm build 12-Sep-2018 15:30:24 + //refim::MultiTermFTNew *theft=static_cast( (itsMappers.getFTM2(whichModel))->cloneFTM()); build 12-Sep-2018 15:30:24 + refim::MultiTermFTNew *theft=static_cast( (itsMappers.getFTM2(whichModel)).get()); build 12-Sep-2018 15:30:24 + Int ntaylor= seType==refim::FTMachine::PSF ? theft->psfNTerms() : theft->nTerms(); build 12-Sep-2018 15:30:24 + if(ntaylor<2) build 12-Sep-2018 15:30:24 + throw(AipsError("some issue with muti term setting ")); build 12-Sep-2018 15:30:24 + Vector > >theImage(ntaylor); build 12-Sep-2018 15:30:24 + Vector > >cImageImage(ntaylor); build 12-Sep-2018 15:30:24 + Vector > >weight(ntaylor); build 12-Sep-2018 15:30:24 + for (Int taylor=0; taylor < ntaylor; ++taylor){ build 12-Sep-2018 15:30:24 + theImage[taylor]=new PagedImage((itsMappers.imageStore(whichModel))->getShape(), (itsMappers.imageStore(whichModel))->getCSys(), imagename+".tt"+String::toString(taylor)); build 12-Sep-2018 15:30:24 + cImageImage[taylor]=new PagedImage (theImage[taylor]->shape(), build 12-Sep-2018 15:30:24 + theImage[taylor]->coordinates(), build 12-Sep-2018 15:30:24 + cImageName+".tt"+String::toString(taylor)); build 12-Sep-2018 15:30:24 + if(!keepComplexImage) build 12-Sep-2018 15:30:24 + static_cast *> (cImageImage[taylor].get())->table().markForDelete(); build 12-Sep-2018 15:30:24 + weight[taylor]=new Matrix(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + theft->makeMTImages(seType, *vi_p, cImageImage, weight); build 12-Sep-2018 15:30:24 + Float maxpsf=1.0; build 12-Sep-2018 15:30:24 + for (Int taylor=0; taylor < ntaylor; ++taylor){ build 12-Sep-2018 15:30:24 + if(seType==refim::FTMachine::PSF){ build 12-Sep-2018 15:30:24 + StokesImageUtil::ToStokesPSF(*(theImage[taylor]), *(cImageImage[taylor])); build 12-Sep-2018 15:30:24 + if(taylor==0){ build 12-Sep-2018 15:30:24 + maxpsf=StokesImageUtil::normalizePSF(*theImage[taylor]); build 12-Sep-2018 15:30:24 + //cerr << "maxpsf " << maxpsf << endl; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else{ build 12-Sep-2018 15:30:24 + ///divide by max; build 12-Sep-2018 15:30:24 + (*theImage[taylor]).copyData((LatticeExpr)((*theImage[taylor])/maxpsf)); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else{ build 12-Sep-2018 15:30:24 + StokesImageUtil::To(*(theImage[taylor]), *(cImageImage[taylor])); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + //delete theft; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + unlockMSs(); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + }// end makeImage build 12-Sep-2018 15:30:24 + ///////////////////////////////////////////////////// build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 CountedPtr SynthesisImagerVi2::createSIMapper(String mappertype, build 12-Sep-2018 15:30:24 @@ -1361,7 +1504,8 @@ void SynthesisImagerVi2::unlockMSs() build 12-Sep-2018 15:30:24 const Quantity &gwidth, build 12-Sep-2018 15:30:24 const Quantity &jwidth, build 12-Sep-2018 15:30:24 const Float minWeight, build 12-Sep-2018 15:30:24 - const Bool clipMinMax build 12-Sep-2018 15:30:24 + const Bool clipMinMax, build 12-Sep-2018 15:30:24 + const Bool pseudoI build 12-Sep-2018 15:30:24 ) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 @@ -1479,7 +1623,13 @@ void SynthesisImagerVi2::unlockMSs() build 12-Sep-2018 15:30:24 theIFT->setSpwChanSelection(chanSel_p); build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + // Set pseudo-I if requested. build 12-Sep-2018 15:30:24 + if(pseudoI==true) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + os << "Turning on Pseudo-I gridding" << LogIO::POST; build 12-Sep-2018 15:30:24 + theFT->setPseudoIStokes(true); build 12-Sep-2018 15:30:24 + theIFT->setPseudoIStokes(true); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1599,7 +1749,7 @@ void SynthesisImagerVi2::unlockMSs() build 12-Sep-2018 15:30:24 // With lazy fill ON, CFCache loads the required CFs on-demand build 12-Sep-2018 15:30:24 // from the disk. And periodically triggers garbage collection to build 12-Sep-2018 15:30:24 // release CFs that aren't required immediately. build 12-Sep-2018 15:30:24 - cfCacheObj->setLazyFill(SynthesisUtils::getenv("CFCache.LAZYFILL",0)==1); build 12-Sep-2018 15:30:24 + cfCacheObj->setLazyFill(refim::SynthesisUtils::getenv("CFCache.LAZYFILL",1)==1); build 12-Sep-2018 15:30:24 // cerr << "Setting wtImagePrefix to " << imageNamePrefix.c_str() << endl; build 12-Sep-2018 15:30:24 cfCacheObj->setWtImagePrefix(imageNamePrefix.c_str()); build 12-Sep-2018 15:30:24 cfCacheObj->initCache2(); build 12-Sep-2018 15:30:24 @@ -1671,6 +1821,7 @@ void SynthesisImagerVi2::unlockMSs() build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 refim::VPSkyJones* vps=NULL; build 12-Sep-2018 15:30:24 + //cerr << "rec " << rec << " kpb " << kpb << endl; build 12-Sep-2018 15:30:24 if(rec.asString("name")=="COMMONPB" && kpb !=PBMath::UNKNOWN ){ build 12-Sep-2018 15:30:24 vps= new refim::VPSkyJones(msc, true, Quantity(rotatePAStep, "deg"), BeamSquint::GOFIGURE, Quantity(360.0, "deg")); build 12-Sep-2018 15:30:24 /////Don't know which parameter has pb threshold cutoff that the user want build 12-Sep-2018 15:30:24 @@ -1684,7 +1835,7 @@ void SynthesisImagerVi2::unlockMSs() build 12-Sep-2018 15:30:24 PBMathInterface::namePBClass(myPB.whichPBClass(), whichPBMath); build 12-Sep-2018 15:30:24 os << "Using the PB defined by " << whichPBMath << " for beam calculation for telescope " << telescop << LogIO::POST; build 12-Sep-2018 15:30:24 vps= new refim::VPSkyJones(telescop, myPB, Quantity(rotatePAStep, "deg"), BeamSquint::GOFIGURE, Quantity(360.0, "deg")); build 12-Sep-2018 15:30:24 - kpb=PBMath::DEFAULT; build 12-Sep-2018 15:30:24 + //kpb=PBMath::DEFAULT; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1696,7 +1847,7 @@ void SynthesisImagerVi2::unlockMSs() build 12-Sep-2018 15:30:24 ///Use Heterogenous array mode for the following build 12-Sep-2018 15:30:24 if((kpb == PBMath::UNKNOWN) || (kpb==PBMath::OVRO) || (kpb==PBMath::ACA) build 12-Sep-2018 15:30:24 || (kpb==PBMath::ALMA) || (kpb==PBMath::EVLA) || multiTel){ build 12-Sep-2018 15:30:24 - CountedPtr mospb=new refim::HetArrayConvFunc(pbtype, ""); build 12-Sep-2018 15:30:24 + CountedPtr mospb=new refim::HetArrayConvFunc(pbtype, itsVpTable); build 12-Sep-2018 15:30:24 static_cast(*theFT).setConvFunc(mospb); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 ///////////////////make sure both FTMachine share the same conv functions. build 12-Sep-2018 15:30:24 @@ -1721,7 +1872,8 @@ void SynthesisImagerVi2::unlockMSs() build 12-Sep-2018 15:30:24 const Bool clipMinMax, build 12-Sep-2018 15:30:24 const Int cache, build 12-Sep-2018 15:30:24 const Int tile, build 12-Sep-2018 15:30:24 - const String &stokes) { build 12-Sep-2018 15:30:24 + const String &stokes, build 12-Sep-2018 15:30:24 + const Bool pseudoI) { build 12-Sep-2018 15:30:24 // // member variable itsVPTable is VP table name build 12-Sep-2018 15:30:24 LogIO os(LogOrigin("SynthesisImagerVi2", "createSDFTMachine", WHERE)); build 12-Sep-2018 15:30:24 os << LogIO::NORMAL // Loglevel INFO build 12-Sep-2018 15:30:24 @@ -1799,7 +1951,7 @@ void SynthesisImagerVi2::unlockMSs() build 12-Sep-2018 15:30:24 theFT->setPointingDirColumn(pointingDirCol); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // turn on Pseudo Stokes mode if necessary build 12-Sep-2018 15:30:24 - if (stokes == "XX" || stokes == "YY" || stokes == "XXYY" build 12-Sep-2018 15:30:24 + if (pseudoI || stokes == "XX" || stokes == "YY" || stokes == "XXYY" build 12-Sep-2018 15:30:24 || stokes == "RR" || stokes == "LL" || stokes == "RRLL") { build 12-Sep-2018 15:30:24 theFT->setPseudoIStokes(True); build 12-Sep-2018 15:30:24 theIFT->setPseudoIStokes(True); build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SynthesisImagerVi2.h b/code/synthesis/ImagerObjects/SynthesisImagerVi2.h build 12-Sep-2018 15:30:24 index cdaed96..7e61dd2 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SynthesisImagerVi2.h build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SynthesisImagerVi2.h build 12-Sep-2018 15:30:24 @@ -65,6 +65,13 @@ public: build 12-Sep-2018 15:30:24 casacore::Bool setWeightDensity(); build 12-Sep-2018 15:30:24 void predictModel(); build 12-Sep-2018 15:30:24 virtual void makeSdImage(casacore::Bool dopsf=false); build 12-Sep-2018 15:30:24 + ///This should replace makeSDImage and makePSF etc in the long run build 12-Sep-2018 15:30:24 + ///But for now you can do the following images i.e string recognized by type build 12-Sep-2018 15:30:24 + ///"observed", "model", "corrected", "psf", "residual", "singledish-observed", build 12-Sep-2018 15:30:24 + ///"singledish", "coverage", "holography", "holography-observed" build 12-Sep-2018 15:30:24 + ///For holography the FTmachine should be SDGrid and the baselines build 12-Sep-2018 15:30:24 + //selected should be those that are pointed up with the antenna which is rastering. build 12-Sep-2018 15:30:24 + virtual void makeImage(casacore::String type, const casacore::String& imagename, const casacore::String& complexImage=casacore::String(""), const Int whichModel=0); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void dryGridding(const casacore::Vector& cfList); build 12-Sep-2018 15:30:24 void fillCFCache(const casacore::Vector& cfList, build 12-Sep-2018 15:30:24 @@ -127,7 +134,8 @@ public: build 12-Sep-2018 15:30:24 const casacore::Quantity &gwidth=casacore::Quantity(-1), build 12-Sep-2018 15:30:24 const casacore::Quantity &jwidth=casacore::Quantity(-1), build 12-Sep-2018 15:30:24 const casacore::Float minWeight=0.1, build 12-Sep-2018 15:30:24 - const casacore::Bool clipMinMax=false); build 12-Sep-2018 15:30:24 + const casacore::Bool clipMinMax=false, build 12-Sep-2018 15:30:24 + const casacore::Bool pseudoI=false); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void createAWPFTMachine(casacore::CountedPtr& theFT, casacore::CountedPtr& theIFT, build 12-Sep-2018 15:30:24 const casacore::String& ftmName, build 12-Sep-2018 15:30:24 @@ -168,7 +176,8 @@ public: build 12-Sep-2018 15:30:24 const casacore::Bool clipMinMax, build 12-Sep-2018 15:30:24 const casacore::Int cache, build 12-Sep-2018 15:30:24 const casacore::Int tile, build 12-Sep-2018 15:30:24 - const casacore::String &stokes); build 12-Sep-2018 15:30:24 + const casacore::String &stokes, build 12-Sep-2018 15:30:24 + const casacore::Bool pseudoI=false); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Do the major cycle build 12-Sep-2018 15:30:24 virtual void runMajorCycle(const casacore::Bool dopsf=false, const casacore::Bool savemodel=false); build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SynthesisIterBot.cc b/code/synthesis/ImagerObjects/SynthesisIterBot.cc build 12-Sep-2018 15:30:24 index bb8350f..0433152 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SynthesisIterBot.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SynthesisIterBot.cc build 12-Sep-2018 15:30:24 @@ -53,6 +53,7 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -92,6 +93,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 LogIO os( LogOrigin("SynthesisIterBot","destructor",WHERE) ); build 12-Sep-2018 15:30:24 os << LogIO::DEBUG1 << "SynthesisIterBot destroyed" << LogIO::POST; build 12-Sep-2018 15:30:24 + SynthesisUtilMethods::getResource("End SynthesisIterBot"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void SynthesisIterBot::setIterationDetails(Record iterpars) { build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SynthesisNormalizer.cc b/code/synthesis/ImagerObjects/SynthesisNormalizer.cc build 12-Sep-2018 15:30:24 index 7b6f650..b4d19c1 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SynthesisNormalizer.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SynthesisNormalizer.cc build 12-Sep-2018 15:30:24 @@ -75,6 +75,8 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 LogIO os( LogOrigin("SynthesisNormalizer","destructor",WHERE) ); build 12-Sep-2018 15:30:24 os << LogIO::DEBUG1 << "SynthesisNormalizer destroyed" << LogIO::POST; build 12-Sep-2018 15:30:24 + SynthesisUtilMethods::getResource("End SynthesisNormalizer"); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -147,7 +149,6 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void SynthesisNormalizer::gatherImages(Bool dopsf, Bool doresidual, Bool dodensity) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // cout << " partimagenames :" << itsPartImageNames << endl; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Bool needToGatherImages = setupImagesOnDisk(); build 12-Sep-2018 15:30:24 @@ -223,14 +224,25 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 os << "Send the model from : " << itsImageName << " to all nodes :" << itsPartImageNames << LogIO::POST; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Make the list of model images. This list is of length >1 only for multi-term runs. build 12-Sep-2018 15:30:24 + // Vector modelNames( itsImages->getNTaylorTerms() ); build 12-Sep-2018 15:30:24 + // if( modelNames.nelements() ==1 ) modelNames[0] = itsImages->getName()+".model"; build 12-Sep-2018 15:30:24 + // if( modelNames.nelements() > 1 ) build 12-Sep-2018 15:30:24 + // { build 12-Sep-2018 15:30:24 + // for( uInt nt=0;ntgetNTaylorTerms();nt++) build 12-Sep-2018 15:30:24 + // modelNames[nt] = itsImages->getName()+".model.tt" + String::toString(nt); build 12-Sep-2018 15:30:24 + // } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 Vector modelNames( itsImages->getNTaylorTerms() ); build 12-Sep-2018 15:30:24 - if( modelNames.nelements() ==1 ) modelNames[0] = itsImages->getName()+".model"; build 12-Sep-2018 15:30:24 - if( modelNames.nelements() > 1 ) build 12-Sep-2018 15:30:24 + if( itsImages->getType()=="default" ) modelNames[0] = itsImages->getName()+".model"; build 12-Sep-2018 15:30:24 + if( itsImages->getType()=="multiterm" ) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 for( uInt nt=0;ntgetNTaylorTerms();nt++) build 12-Sep-2018 15:30:24 modelNames[nt] = itsImages->getName()+".model.tt" + String::toString(nt); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 for( uInt part=0;partsetModelImage( modelNames ); build 12-Sep-2018 15:30:24 @@ -437,14 +449,13 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 throw(AipsError("Cannot find partial image psf or residual for " +itsImages->getName() +err)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - PagedImage temppart( imopen ); build 12-Sep-2018 15:30:24 - IPosition tempshape = temppart.shape(); build 12-Sep-2018 15:30:24 - CoordinateSystem tempcsys = temppart.coordinates(); build 12-Sep-2018 15:30:24 + PagedImage temppart(imopen); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Bool useweightimage = itsImages->getUseWeightImage( *(itsImages->sumwt()) ); build 12-Sep-2018 15:30:24 for( uInt part=0; part temppart( imopen ); build 12-Sep-2018 15:30:24 - IPosition tempshape = temppart.shape(); build 12-Sep-2018 15:30:24 - CoordinateSystem tempcsys = temppart.coordinates(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Bool useweightimage = itsPartImages[0]->getUseWeightImage( *(itsPartImages[0]->sumwt()) ); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - itsImages = makeImageStore ( itsImageName, tempcsys, tempshape, useweightimage ); build 12-Sep-2018 15:30:24 + itsImages = makeImageStore (itsImageName, temppart, useweightimage); build 12-Sep-2018 15:30:24 foundFullImage = true; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -569,7 +577,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 }// end of setupImagesOnDisk build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SHARED_PTR SynthesisNormalizer::makeImageStore( String imagename ) build 12-Sep-2018 15:30:24 + SHARED_PTR SynthesisNormalizer::makeImageStore(const String &imagename ) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 if( itsMapperType == "multiterm" ) build 12-Sep-2018 15:30:24 { return SHARED_PTR(new SIImageStoreMultiTerm( imagename, itsNTaylorTerms, true )); } build 12-Sep-2018 15:30:24 @@ -578,15 +586,37 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SHARED_PTR SynthesisNormalizer::makeImageStore( String imagename, build 12-Sep-2018 15:30:24 - CoordinateSystem& csys, build 12-Sep-2018 15:30:24 - IPosition shp, Bool useweightimage ) build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * build a new ImageStore, whether SIImageStore or SIImageStoreMultiTerm, borrowing build 12-Sep-2018 15:30:24 + * image information from one partial image. build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @param imagename image name for the new SIStorageManager build 12-Sep-2018 15:30:24 + * @param part partial image from which miscinfo, etc. data will be borrowed build 12-Sep-2018 15:30:24 + * @param useweightimage useweight option for the new SIStorageManager build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @return A new SIImageStore object for the image name given. build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + SHARED_PTR SynthesisNormalizer::makeImageStore(const String &imagename, build 12-Sep-2018 15:30:24 + const PagedImage &part, build 12-Sep-2018 15:30:24 + Bool useweightimage) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 + // borrow shape, coord, imageinfo and miscinfo build 12-Sep-2018 15:30:24 + auto shape = part.shape(); build 12-Sep-2018 15:30:24 + auto csys = part.coordinates(); build 12-Sep-2018 15:30:24 + auto objectname = part.imageInfo().objectName(); build 12-Sep-2018 15:30:24 + auto miscinfo = part.miscInfo(); build 12-Sep-2018 15:30:24 if( itsMapperType == "multiterm" ) build 12-Sep-2018 15:30:24 - { return SHARED_PTR(new SIImageStoreMultiTerm( imagename, csys, shp, itsNFacets, false, itsNTaylorTerms, useweightimage )); } build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + std::shared_ptr multiTermStore = build 12-Sep-2018 15:30:24 + std::make_shared(imagename, csys, shape, objectname, build 12-Sep-2018 15:30:24 + miscinfo, itsNFacets, false, itsNTaylorTerms, useweightimage ); build 12-Sep-2018 15:30:24 + return multiTermStore; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 - { return SHARED_PTR(new SIImageStore( imagename, csys, shp, false, useweightimage )); } build 12-Sep-2018 15:30:24 - // { return new SIImageStore( imagename, csys, shp, itsNFacets, false, useweightimage ); } build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + return std::make_shared(imagename, csys, shape, objectname, miscinfo, build 12-Sep-2018 15:30:24 + false, useweightimage); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SynthesisNormalizer.h b/code/synthesis/ImagerObjects/SynthesisNormalizer.h build 12-Sep-2018 15:30:24 index 9336956..e60190b 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SynthesisNormalizer.h build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SynthesisNormalizer.h build 12-Sep-2018 15:30:24 @@ -99,8 +99,10 @@ protected: build 12-Sep-2018 15:30:24 casacore::Bool setupImagesOnDisk(); build 12-Sep-2018 15:30:24 casacore::Bool doImagesExist( casacore::String imagename ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - SHARED_PTR makeImageStore( casacore::String imagename ); build 12-Sep-2018 15:30:24 - SHARED_PTR makeImageStore( casacore::String imagename, casacore::CoordinateSystem& csys, casacore::IPosition shp, casacore::Bool useweightimage ); build 12-Sep-2018 15:30:24 + SHARED_PTR makeImageStore( const casacore::String &imagename ); build 12-Sep-2018 15:30:24 + SHARED_PTR makeImageStore( const casacore::String &imagename, build 12-Sep-2018 15:30:24 + const casacore::PagedImage &part, build 12-Sep-2018 15:30:24 + casacore::Bool useweightimage ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 void setPsfFromOneFacet(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SynthesisUtilMethods.cc b/code/synthesis/ImagerObjects/SynthesisUtilMethods.cc build 12-Sep-2018 15:30:24 index f08c16e..b1c0234 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SynthesisUtilMethods.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SynthesisUtilMethods.cc build 12-Sep-2018 15:30:24 @@ -56,7 +56,7 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 -#include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -74,7 +74,12 @@ using namespace std; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using namespace casacore; build 12-Sep-2018 15:30:24 namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + casacore::String SynthesisUtilMethods::g_hostname; build 12-Sep-2018 15:30:24 + casacore::String SynthesisUtilMethods::g_startTimestamp; build 12-Sep-2018 15:30:24 + const casacore::String SynthesisUtilMethods::g_enableOptMemProfile = build 12-Sep-2018 15:30:24 + "synthesis.imager.memprofile.enable"; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 SynthesisUtilMethods::SynthesisUtilMethods() build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -178,73 +183,158 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - Int SynthesisUtilMethods::parseLine(char* line){ build 12-Sep-2018 15:30:24 - int i = strlen(line); build 12-Sep-2018 15:30:24 - while (*line < '0' || *line > '9') line++; build 12-Sep-2018 15:30:24 - line[i-3] = '\0'; build 12-Sep-2018 15:30:24 - i = atoi(line); build 12-Sep-2018 15:30:24 - return i; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - void SynthesisUtilMethods::getResource(String label, String fname) build 12-Sep-2018 15:30:24 - { build 12-Sep-2018 15:30:24 - return; build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * Get values from lines of a /proc/self/status file. For example: build 12-Sep-2018 15:30:24 + * 'VmRSS: 600 kB' build 12-Sep-2018 15:30:24 + * @param str line from status file build 12-Sep-2018 15:30:24 + * @return integer value (memory amount, etc.) build 12-Sep-2018 15:30:24 + */ build 12-Sep-2018 15:30:24 + Int SynthesisUtilMethods::parseProcStatusLine(const std::string &str) { build 12-Sep-2018 15:30:24 + istringstream is(str); build 12-Sep-2018 15:30:24 + std::string token; build 12-Sep-2018 15:30:24 + is >> token; build 12-Sep-2018 15:30:24 + is >> token; build 12-Sep-2018 15:30:24 + Int value = stoi(token); build 12-Sep-2018 15:30:24 + return value; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - LogIO os( LogOrigin("SynthesisUtilMethods","getResource",WHERE) ); build 12-Sep-2018 15:30:24 + /** build 12-Sep-2018 15:30:24 + * Produces a name for a 'memprofile' output file. For example: build 12-Sep-2018 15:30:24 + * casa.synthesis.imager.memprofile.23514.pc22555.hq.eso.org.20171209_120446.txt build 12-Sep-2018 15:30:24 + * (where 23514 is the PID passed as input parameter). build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @param pid PID of the process running the imager build 12-Sep-2018 15:30:24 + * build 12-Sep-2018 15:30:24 + * @return a longish 'memprofile' filename including PID, machine, timestamp, etc. build 12-Sep-2018 15:30:24 + **/ build 12-Sep-2018 15:30:24 + String SynthesisUtilMethods::makeResourceFilename(int pid) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if (g_hostname.empty() or g_startTimestamp.empty()) { build 12-Sep-2018 15:30:24 + // TODO: not using HOST_NAME_MAX because of issues with __APPLE__ build 12-Sep-2018 15:30:24 + // somehow tests tAWPFTM, tSynthesisImager, and tSynthesisImagerVi2 fail. build 12-Sep-2018 15:30:24 + const int strMax = 255; build 12-Sep-2018 15:30:24 + char hostname[strMax]; build 12-Sep-2018 15:30:24 + gethostname(hostname, strMax); build 12-Sep-2018 15:30:24 + g_hostname = hostname; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + auto time = std::time(nullptr); build 12-Sep-2018 15:30:24 + auto gmt = std::gmtime(&time); build 12-Sep-2018 15:30:24 + const char* format = "%Y%m%d_%H%M%S"; build 12-Sep-2018 15:30:24 + char timestr[strMax]; build 12-Sep-2018 15:30:24 + std::strftime(timestr, strMax, format, gmt); build 12-Sep-2018 15:30:24 + g_startTimestamp = timestr; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + return String("casa.synthesis.imager.memprofile." + String::toString(pid) + build 12-Sep-2018 15:30:24 + "." + g_hostname + "." + g_startTimestamp + ".txt"); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - FILE* file = fopen("/proc/self/status", "r"); build 12-Sep-2018 15:30:24 - int vmSize = -1, vmRSS=-1, pid=-1; build 12-Sep-2018 15:30:24 - int fdSize=-1; build 12-Sep-2018 15:30:24 - char line[128]; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - while (fgets(line, 128, file) != NULL){ build 12-Sep-2018 15:30:24 - if (strncmp(line, "VmSize:", 7) == 0){ build 12-Sep-2018 15:30:24 - vmSize = parseLine(line)/1024.0; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if (strncmp(line, "VmRSS:", 6) == 0){ build 12-Sep-2018 15:30:24 - vmRSS = parseLine(line)/1024.0; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if (strncmp(line, "FDSize:", 7) == 0){ build 12-Sep-2018 15:30:24 - fdSize = parseLine(line); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if (strncmp(line, "Pid:", 4) == 0){ build 12-Sep-2018 15:30:24 - pid = parseLine(line); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - fclose(file); build 12-Sep-2018 15:30:24 + void SynthesisUtilMethods::getResource(String label, String fname) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + // TODO: not tested on anything else than LINUX (MACOS for the future) build 12-Sep-2018 15:30:24 +#if !defined(AIPS_LINUX) build 12-Sep-2018 15:30:24 + return; build 12-Sep-2018 15:30:24 +#endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - struct rusage usage; build 12-Sep-2018 15:30:24 - struct timeval now; build 12-Sep-2018 15:30:24 - getrusage(RUSAGE_SELF, &usage); build 12-Sep-2018 15:30:24 - now = usage.ru_utime; build 12-Sep-2018 15:30:24 + Bool isOn = false; build 12-Sep-2018 15:30:24 + AipsrcValue::find(isOn, g_enableOptMemProfile); build 12-Sep-2018 15:30:24 + if (!isOn) build 12-Sep-2018 15:30:24 + return; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // TODO: reorganize, use struct or something to hold and pass info over. ifdef lnx build 12-Sep-2018 15:30:24 + LogIO casalog( LogOrigin("SynthesisUtilMethods", "getResource", WHERE) ); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // To hold memory stats, in MB build 12-Sep-2018 15:30:24 + int vmRSS = -1, vmHWM = -1, vmSize = -1, vmPeak = -1, vmSwap = -1; build 12-Sep-2018 15:30:24 + pid_t pid = -1; build 12-Sep-2018 15:30:24 + int fdSize = -1; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // TODO: this won't probably work on anything but linux build 12-Sep-2018 15:30:24 + ifstream procFile("/proc/self/status"); build 12-Sep-2018 15:30:24 + if (procFile.is_open()) { build 12-Sep-2018 15:30:24 + std::string line; build 12-Sep-2018 15:30:24 + while (not procFile.eof()) { build 12-Sep-2018 15:30:24 + getline(procFile, line); build 12-Sep-2018 15:30:24 + const std::string startVmRSS = "VmRSS:"; build 12-Sep-2018 15:30:24 + const std::string startVmWHM = "VmHWM:"; build 12-Sep-2018 15:30:24 + const std::string startVmSize = "VmSize:"; build 12-Sep-2018 15:30:24 + const std::string startVmPeak = "VmPeak:"; build 12-Sep-2018 15:30:24 + const std::string startVmSwap = "VmSwap:"; build 12-Sep-2018 15:30:24 + const std::string startFDSize = "FDSize:"; build 12-Sep-2018 15:30:24 + const double KB_TO_MB = 1024.0; build 12-Sep-2018 15:30:24 + if (startVmRSS == line.substr(0, startVmRSS.size())) { build 12-Sep-2018 15:30:24 + vmRSS = parseProcStatusLine(line.c_str()) / KB_TO_MB; build 12-Sep-2018 15:30:24 + } else if (startVmWHM == line.substr(0, startVmWHM.size())) { build 12-Sep-2018 15:30:24 + vmHWM = parseProcStatusLine(line.c_str()) / KB_TO_MB; build 12-Sep-2018 15:30:24 + } else if (startVmSize == line.substr(0, startVmSize.size())) { build 12-Sep-2018 15:30:24 + vmSize = parseProcStatusLine(line.c_str()) / KB_TO_MB; build 12-Sep-2018 15:30:24 + } else if (startVmPeak == line.substr(0, startVmPeak.size())) { build 12-Sep-2018 15:30:24 + vmPeak = parseProcStatusLine(line.c_str()) / KB_TO_MB; build 12-Sep-2018 15:30:24 + } else if (startVmSwap == line.substr(0, startVmSwap.size())) { build 12-Sep-2018 15:30:24 + vmSwap = parseProcStatusLine(line.c_str()) / KB_TO_MB; build 12-Sep-2018 15:30:24 + } else if (startFDSize == line.substr(0, startFDSize.size())) { build 12-Sep-2018 15:30:24 + fdSize = parseProcStatusLine(line.c_str()); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + procFile.close(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - ostringstream oss; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - oss << " PID: " << pid ; build 12-Sep-2018 15:30:24 - oss << " MemRSS: " << vmRSS << " MB."; build 12-Sep-2018 15:30:24 - oss << " VirtMem: " << vmSize << " MB."; build 12-Sep-2018 15:30:24 - oss << " ProcTime: " << now.tv_sec << "." << now.tv_usec; build 12-Sep-2018 15:30:24 - oss << " FDSize: " << fdSize; build 12-Sep-2018 15:30:24 - oss << " [" << label << "] "; build 12-Sep-2018 15:30:24 + pid = getpid(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + struct rusage usage; build 12-Sep-2018 15:30:24 + struct timeval now; build 12-Sep-2018 15:30:24 + getrusage(RUSAGE_SELF, &usage); build 12-Sep-2018 15:30:24 + now = usage.ru_utime; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - os << oss.str() << LogIO::NORMAL3 << LogIO::POST; build 12-Sep-2018 15:30:24 - // cout << oss.str() << endl; build 12-Sep-2018 15:30:24 + // TODO: check if this works as expected when /proc/self/status is not there build 12-Sep-2018 15:30:24 + // Not clear at all if VmHWM and .ru_maxrss measure the same thing build 12-Sep-2018 15:30:24 + // Some alternative is needed for the other fields as well: VmSize, VMHWM, FDSize. build 12-Sep-2018 15:30:24 + if (vmHWM < 0) { build 12-Sep-2018 15:30:24 + vmHWM = usage.ru_maxrss; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // Write this to a file too... build 12-Sep-2018 15:30:24 - fname = "memprofile"; build 12-Sep-2018 15:30:24 - if( fname.size() > 0 ) build 12-Sep-2018 15:30:24 - { build 12-Sep-2018 15:30:24 - ofstream myfile; build 12-Sep-2018 15:30:24 - myfile.open (fname+"."+String::toString(pid), ios::app); build 12-Sep-2018 15:30:24 - myfile << oss.str() << endl; build 12-Sep-2018 15:30:24 - myfile.close(); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 + ostringstream oss; build 12-Sep-2018 15:30:24 + oss << "PID: " << pid ; build 12-Sep-2018 15:30:24 + oss << " MemRSS (VmRSS): " << vmRSS << " MB."; build 12-Sep-2018 15:30:24 + oss << " VmWHM: " << vmHWM << " MB."; build 12-Sep-2018 15:30:24 + oss << " VirtMem (VmSize): " << vmSize << " MB."; build 12-Sep-2018 15:30:24 + oss << " VmPeak: " << vmPeak << " MB."; build 12-Sep-2018 15:30:24 + oss << " VmSwap: " << vmSwap << " MB."; build 12-Sep-2018 15:30:24 + oss << " ProcTime: " << now.tv_sec << '.' << now.tv_usec; build 12-Sep-2018 15:30:24 + oss << " FDSize: " << fdSize; build 12-Sep-2018 15:30:24 + oss << " [" << label << "] "; build 12-Sep-2018 15:30:24 + casalog << oss.str() << LogIO::NORMAL3 << LogIO::POST; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // Write this to a file too... build 12-Sep-2018 15:30:24 + try { build 12-Sep-2018 15:30:24 + if (fname.empty()) { build 12-Sep-2018 15:30:24 + fname = makeResourceFilename(pid); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + ofstream ofile(fname, ios::app); build 12-Sep-2018 15:30:24 + if (ofile.is_open()) { build 12-Sep-2018 15:30:24 + if (0 == ofile.tellp()) { build 12-Sep-2018 15:30:24 + casalog << g_enableOptMemProfile << " is enabled, initializing output file for " build 12-Sep-2018 15:30:24 + "imager profiling information (memory and run time): " << fname << build 12-Sep-2018 15:30:24 + LogIO::NORMAL << LogIO::POST; build 12-Sep-2018 15:30:24 + ostringstream header; build 12-Sep-2018 15:30:24 + header << "# PID, MemRSS_(VmRSS)_MB, VmWHM_MB, VirtMem_(VmSize)_MB, VmPeak_MB, " build 12-Sep-2018 15:30:24 + "VmSwap_MB, ProcTime_sec, FDSize, label_checkpoint"; build 12-Sep-2018 15:30:24 + ofile << header.str() << '\n'; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + ostringstream line; build 12-Sep-2018 15:30:24 + line << pid << ',' << vmRSS << ',' << vmHWM << ',' << vmSize << ',' build 12-Sep-2018 15:30:24 + << vmPeak << ','<< vmSwap << ',' << now.tv_sec << '.' << now.tv_usec << ',' build 12-Sep-2018 15:30:24 + << fdSize << ',' << '[' << label << ']'; build 12-Sep-2018 15:30:24 + ofile << line.str() << '\n'; build 12-Sep-2018 15:30:24 + ofile.close(); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } catch(std::runtime_error &exc) { build 12-Sep-2018 15:30:24 + casalog << "Could not write imager memory+runtime information into output file: " build 12-Sep-2018 15:30:24 + << fname << LogIO::WARN << LogIO::POST; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 // Data partitioning rules for CONTINUUM imaging build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 // ALL members of the selection parameters in selpars are strings build 12-Sep-2018 15:30:24 @@ -1180,7 +1270,15 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 //// stokes build 12-Sep-2018 15:30:24 err += readVal( inrec, String("stokes"), stokes); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + if(stokes.matches("pseudoI")) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + stokes="I"; build 12-Sep-2018 15:30:24 + pseudoi=true; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else {pseudoi=false;} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + /// PseudoI build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 ////nchan build 12-Sep-2018 15:30:24 err += readVal( inrec, String("nchan"), nchan); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1732,6 +1830,9 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 startModel=Vector(0); build 12-Sep-2018 15:30:24 overwrite=false; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + // PseudoI build 12-Sep-2018 15:30:24 + pseudoi=false; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // Spectral coordinates build 12-Sep-2018 15:30:24 nchan=1; build 12-Sep-2018 15:30:24 mode="mfs"; build 12-Sep-2018 15:30:24 @@ -1771,7 +1872,8 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 cells[0] = QuantityToString( cellsize[0] ); build 12-Sep-2018 15:30:24 cells[1] = QuantityToString( cellsize[1] ); build 12-Sep-2018 15:30:24 impar.define("cell", cells ); build 12-Sep-2018 15:30:24 - impar.define("stokes", stokes); build 12-Sep-2018 15:30:24 + if(pseudoi==true){impar.define("stokes","pseudoI");} build 12-Sep-2018 15:30:24 + else{impar.define("stokes", stokes);} build 12-Sep-2018 15:30:24 impar.define("nchan", nchan); build 12-Sep-2018 15:30:24 impar.define("nterms", nTaylorTerms); build 12-Sep-2018 15:30:24 impar.define("deconvolver",deconvolver); build 12-Sep-2018 15:30:24 @@ -1864,6 +1966,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 // else cout << " NO CSYS INFO to write to output record " << endl; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 return impar; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -3521,7 +3624,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 if( inrec.dataType("restoringbeam")==TpString ) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 err += readVal( inrec, String("restoringbeam"), usebeam); build 12-Sep-2018 15:30:24 - if( ! usebeam.matches("common") && ! usebeam.length()==0 ) build 12-Sep-2018 15:30:24 + if( (! usebeam.matches("common")) && ! usebeam.length()==0 ) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 Quantity bsize; build 12-Sep-2018 15:30:24 err += readVal( inrec, String("restoringbeam"), bsize ); build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects/SynthesisUtilMethods.h b/code/synthesis/ImagerObjects/SynthesisUtilMethods.h build 12-Sep-2018 15:30:24 index af4cb5b..220ff26 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects/SynthesisUtilMethods.h build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects/SynthesisUtilMethods.h build 12-Sep-2018 15:30:24 @@ -133,8 +133,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 static casacore::Int getOptimumSize(const casacore::Int npix); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - static casacore::Int parseLine(char* line); build 12-Sep-2018 15:30:24 - static void getResource(casacore::String label="",casacore::String fname=""); build 12-Sep-2018 15:30:24 + static void getResource(casacore::String label="", casacore::String fname=""); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // return comprehensible direction string from given MDirection object build 12-Sep-2018 15:30:24 static casacore::String asComprehensibleDirectionString(casacore::MDirection const &direction); build 12-Sep-2018 15:30:24 @@ -144,6 +143,14 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 static casacore::Vector primeFactors(casacore::uInt n, casacore::Bool douniq=true); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + private: build 12-Sep-2018 15:30:24 + static casacore::String makeResourceFilename(int pid); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + static casacore::String g_hostname; build 12-Sep-2018 15:30:24 + static casacore::String g_startTimestamp; build 12-Sep-2018 15:30:24 + static const casacore::String g_enableOptMemProfile; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + static casacore::Int parseProcStatusLine(const std::string &str); build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 class SynthesisParams build 12-Sep-2018 15:30:24 @@ -252,6 +259,9 @@ public: build 12-Sep-2018 15:30:24 casacore::MDirection phaseCenter; build 12-Sep-2018 15:30:24 casacore::Int phaseCenterFieldId; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + // Stokes info build 12-Sep-2018 15:30:24 + casacore::Bool pseudoi; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // Spectral coordinates ( TT : Add other params here ) build 12-Sep-2018 15:30:24 casacore::Int nchan, nTaylorTerms, chanStart, chanStep; build 12-Sep-2018 15:30:24 casacore::Quantity freqStart, freqStep, refFreq, velStart, velStep; build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/ImagerObjects2/SynthesisImager.cc b/code/synthesis/ImagerObjects2/SynthesisImager.cc build 12-Sep-2018 15:30:24 index 82abb8a..c0da2d6 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/ImagerObjects2/SynthesisImager.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/ImagerObjects2/SynthesisImager.cc build 12-Sep-2018 15:30:24 @@ -823,33 +823,34 @@ using namespace casa::vi; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 try build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + // Prepare miscellaneous image information build 12-Sep-2018 15:30:24 + auto objectName = msc.field().name()(msc.fieldId()(0)); build 12-Sep-2018 15:30:24 + ///// misc info fpr ImageStore. This will go to the 'miscinfo' table keyword build 12-Sep-2018 15:30:24 + Record miscInfo; build 12-Sep-2018 15:30:24 + auto telescop=msc.observation().telescopeName()(0); build 12-Sep-2018 15:30:24 + miscInfo.define("INSTRUME", telescop); build 12-Sep-2018 15:30:24 + miscInfo.define("distance", distance.get("m").getValue()); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 if( mappertype=="default" || mappertype=="imagemosaic" ) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - imstor=new SIImageStore(imageName, cSys, imShape, overwrite, (useweightimage || (mappertype=="imagemosaic") )); build 12-Sep-2018 15:30:24 - // imstor=new SIImageStore(imageName, cSys, imShape, facets, overwrite, (useweightimage || (mappertype=="imagemosaic") )); build 12-Sep-2018 15:30:24 + imstor = std::make_shared(imageName, cSys, imShape, objectName, build 12-Sep-2018 15:30:24 + miscInfo, overwrite, build 12-Sep-2018 15:30:24 + (useweightimage || (mappertype=="imagemosaic") build 12-Sep-2018 15:30:24 + )); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else if (mappertype == "multiterm" ) // Currently does not support imagemosaic. build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - //cout << "Making multiterm IS with nterms : " << ntaylorterms << endl; build 12-Sep-2018 15:30:24 - imstor=new SIImageStoreMultiTerm(imageName, cSys, imShape, facets, overwrite, ntaylorterms, useweightimage); build 12-Sep-2018 15:30:24 + // upcast with shared_ptr and then assign to CountedPtr build 12-Sep-2018 15:30:24 + std::shared_ptr multiTermStore = build 12-Sep-2018 15:30:24 + std::make_shared(imageName, cSys, imShape, build 12-Sep-2018 15:30:24 + objectName, miscInfo, facets, build 12-Sep-2018 15:30:24 + overwrite, ntaylorterms, useweightimage); build 12-Sep-2018 15:30:24 + imstor = multiTermStore; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 throw(AipsError("Internal Error : Invalid mapper type in SynthesisImager::createIMStore")); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // Fill in miscellaneous information needed by FITS build 12-Sep-2018 15:30:24 - ROMSColumns msc(*mss_p[0]); build 12-Sep-2018 15:30:24 - Record info; build 12-Sep-2018 15:30:24 - String objectName=msc.field().name()(msc.fieldId()(0)); build 12-Sep-2018 15:30:24 - String telescop=msc.observation().telescopeName()(0); build 12-Sep-2018 15:30:24 - info.define("OBJECT", objectName); build 12-Sep-2018 15:30:24 - info.define("TELESCOP", telescop); build 12-Sep-2018 15:30:24 - info.define("INSTRUME", telescop); build 12-Sep-2018 15:30:24 - info.define("distance", distance.get("m").getValue()); build 12-Sep-2018 15:30:24 - ////////////// Send misc info into ImageStore. build 12-Sep-2018 15:30:24 - imstor->setImageInfo( info ); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Get polRep from 'msc' here, and send to imstore. build 12-Sep-2018 15:30:24 StokesImageUtil::PolRep polRep(StokesImageUtil::CIRCULAR); build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/MeasurementComponents/FringeJones.cc b/code/synthesis/MeasurementComponents/FringeJones.cc build 12-Sep-2018 15:30:24 index 40f64b9..a596295 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/MeasurementComponents/FringeJones.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/MeasurementComponents/FringeJones.cc build 12-Sep-2018 15:30:24 @@ -331,12 +331,12 @@ DelayRateFFT::DelayRateFFT(SDBList& sdbs, Int refant) : build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 DelayRateFFT::DelayRateFFT(Array& data, Int nPadFactor, Float f0, Float df, Float dt, SDBList& s) : build 12-Sep-2018 15:30:24 - gm_(s), build 12-Sep-2018 15:30:24 refant_(0), build 12-Sep-2018 15:30:24 + gm_(s), build 12-Sep-2018 15:30:24 nPadFactor_(nPadFactor), build 12-Sep-2018 15:30:24 + dt_(dt), build 12-Sep-2018 15:30:24 f0_(f0), build 12-Sep-2018 15:30:24 df_(df), build 12-Sep-2018 15:30:24 - dt_(dt), build 12-Sep-2018 15:30:24 Vpad_(), build 12-Sep-2018 15:30:24 sumw_(), build 12-Sep-2018 15:30:24 sumww_(), build 12-Sep-2018 15:30:24 @@ -1336,7 +1336,7 @@ expb_hess(gsl_vector *param, AuxParamBundle *bundle, gsl_matrix *hess, Double xi build 12-Sep-2018 15:30:24 Double h = gsl_matrix_get(inv_hess, i, i); build 12-Sep-2018 15:30:24 Double snr0 = sqrt(sigma2*h*0.5); build 12-Sep-2018 15:30:24 snr0 = min(snr0, 9999.999); build 12-Sep-2018 15:30:24 - Double snr = (snr0 > 1e-20) ? snr = 1.0/snr0 : snr0; build 12-Sep-2018 15:30:24 + Double snr = (snr0 > 1e-20) ? 1.0/snr0 : snr0; build 12-Sep-2018 15:30:24 // cerr << "Antenna " << i/3 << " h " << h << " SNR0 " << snr0 << " SNR = " << snr << endl; build 12-Sep-2018 15:30:24 gsl_vector_set(snr_vector, i, snr); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -1467,7 +1467,8 @@ least_squares_driver(SDBList& sdbs, Matrix& casa_param, Matrix& cas build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 gsl_vector_sub(gp_orig, w->x); build 12-Sep-2018 15:30:24 gsl_vector *diff = gp_orig; build 12-Sep-2018 15:30:24 - double diffsize = gsl_blas_dnrm2(diff); build 12-Sep-2018 15:30:24 + // double diffsize = build 12-Sep-2018 15:30:24 + gsl_blas_dnrm2(diff); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 gsl_vector *res = gsl_multilarge_nlinear_position(w); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -1479,7 +1480,7 @@ least_squares_driver(SDBList& sdbs, Matrix& casa_param, Matrix& cas build 12-Sep-2018 15:30:24 gsl_vector_set_zero(snr_vector); build 12-Sep-2018 15:30:24 expb_hess(gp, &bundle, hess, chi1*chi1, snr_vector, logSink); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - Double log_det = 0; build 12-Sep-2018 15:30:24 + // Double log_det = 0; build 12-Sep-2018 15:30:24 // cerr << "Hessian diagonal: [" ; build 12-Sep-2018 15:30:24 // for (size_t i=0; i& casa_param, Matrix& cas build 12-Sep-2018 15:30:24 Int iparam = bundle.get_param_corr_index(iant); build 12-Sep-2018 15:30:24 if (iparam<0) continue; build 12-Sep-2018 15:30:24 if (0) { build 12-Sep-2018 15:30:24 - bool flag = false; build 12-Sep-2018 15:30:24 - if (fabs(gsl_vector_get(diff, iparam + 0) > FLT_EPSILON)) { build 12-Sep-2018 15:30:24 - flag = true; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if (fabs(gsl_vector_get(diff, iparam + 1) > FLT_EPSILON)) { build 12-Sep-2018 15:30:24 - flag = true; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if (fabs(gsl_vector_get(diff, iparam + 2) > 1e-30)) { build 12-Sep-2018 15:30:24 - flag = true; build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 + // flag unused build 12-Sep-2018 15:30:24 + // bool flag = false; build 12-Sep-2018 15:30:24 + // if (fabs(gsl_vector_get(diff, iparam + 0) > FLT_EPSILON)) { build 12-Sep-2018 15:30:24 + // flag = true; build 12-Sep-2018 15:30:24 + // } build 12-Sep-2018 15:30:24 + // if (fabs(gsl_vector_get(diff, iparam + 1) > FLT_EPSILON)) { build 12-Sep-2018 15:30:24 + // flag = true; build 12-Sep-2018 15:30:24 + // } build 12-Sep-2018 15:30:24 + // if (fabs(gsl_vector_get(diff, iparam + 2) > 1e-30)) { build 12-Sep-2018 15:30:24 + // flag = true; build 12-Sep-2018 15:30:24 + // } build 12-Sep-2018 15:30:24 if (DEVDEBUG) { build 12-Sep-2018 15:30:24 logSink << "Old values for ant " << iant << " correlation " << icor build 12-Sep-2018 15:30:24 << ": Angle " << casa_param(3*icor + 0, iant) build 12-Sep-2018 15:30:24 @@ -2035,13 +2037,15 @@ FringeJones::selfSolveOne(SDBList& sdbs) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 for (Int iant=0; iant != nAnt(); iant++) { build 12-Sep-2018 15:30:24 for (size_t icor=0; icor != nCorr; icor++) { build 12-Sep-2018 15:30:24 - Double df_bootleg = drf.get_df_all(); build 12-Sep-2018 15:30:24 + // Double df_bootleg = build 12-Sep-2018 15:30:24 + drf.get_df_all(); build 12-Sep-2018 15:30:24 Double phi0 = sRP(3*icor + 0, iant); build 12-Sep-2018 15:30:24 Double delay = sRP(3*icor + 1, iant); build 12-Sep-2018 15:30:24 Double rate = sRP(3*icor + 2, iant); build 12-Sep-2018 15:30:24 // Double delta1 = df0*delay; build 12-Sep-2018 15:30:24 // Double delta1 = 0.5*df_bootleg*delay/1e9; build 12-Sep-2018 15:30:24 - auto it = aggregateTime.find(iant); build 12-Sep-2018 15:30:24 + // auto it = build 12-Sep-2018 15:30:24 + aggregateTime.find(iant); build 12-Sep-2018 15:30:24 // We assume the reference frequency for fringe fitting build 12-Sep-2018 15:30:24 // (which is NOT the one stored in the SPECTRAL_WINDOW build 12-Sep-2018 15:30:24 // table) is the left-hand edge of the frequency grid. build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/MeasurementComponents/KJones.cc b/code/synthesis/MeasurementComponents/KJones.cc build 12-Sep-2018 15:30:24 index 30b4aef..c853ac1 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/MeasurementComponents/KJones.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/MeasurementComponents/KJones.cc build 12-Sep-2018 15:30:24 @@ -2017,7 +2017,7 @@ bool KAntPosJones::vlaTrDelCorrApplicable(bool checkCalTable) { build 12-Sep-2018 15:30:24 // Keyword not present in caltable == TURN IT OFF build 12-Sep-2018 15:30:24 doTrDelCorr_=false; build 12-Sep-2018 15:30:24 logSink() << "No VLATrDelCorr keyword in the antpos caltable; turning trop delay correction OFF." build 12-Sep-2018 15:30:24 - << LogIO::WARN << LogIO::POST; build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/MeasurementComponents/SDGrid.cc b/code/synthesis/MeasurementComponents/SDGrid.cc build 12-Sep-2018 15:30:24 index 86fe744..94d5a5d 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/MeasurementComponents/SDGrid.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/MeasurementComponents/SDGrid.cc build 12-Sep-2018 15:30:24 @@ -1574,6 +1574,13 @@ Bool SDGrid::getXYPos(const VisBuffer& vb, Int row) { build 12-Sep-2018 15:30:24 if (!isSplineInterpolationReady) { build 12-Sep-2018 15:30:24 interpolator = new SDPosInterpolator(vb, pointingDirCol_p); build 12-Sep-2018 15:30:24 isSplineInterpolationReady = true; build 12-Sep-2018 15:30:24 + } else { build 12-Sep-2018 15:30:24 + if (!interpolator->inTimeRange(vb.time()(row), vb.antenna1()(row))) { build 12-Sep-2018 15:30:24 + // setup spline interpolator for the current dataset (CAS-11261, 2018/5/22 WK) build 12-Sep-2018 15:30:24 + delete interpolator; build 12-Sep-2018 15:30:24 + interpolator = 0; build 12-Sep-2018 15:30:24 + interpolator = new SDPosInterpolator(vb, pointingDirCol_p); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/MeasurementEquations/Imager.cc b/code/synthesis/MeasurementEquations/Imager.cc build 12-Sep-2018 15:30:24 index a70700b..091eddd 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/MeasurementEquations/Imager.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/MeasurementEquations/Imager.cc build 12-Sep-2018 15:30:24 @@ -4900,7 +4900,8 @@ Record Imager::setjy(const Vector& /*fieldid*/, build 12-Sep-2018 15:30:24 throw(AipsError(standard + " is not a recognized flux density scale")); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 FluxStandard fluxStd(fluxScaleEnum); build 12-Sep-2018 15:30:24 - if (fluxScaleEnum==FluxStandard::PERLEY_BUTLER_2013) { build 12-Sep-2018 15:30:24 + if (fluxScaleEnum==FluxStandard::PERLEY_BUTLER_2013 || build 12-Sep-2018 15:30:24 + fluxScaleEnum==FluxStandard::PERLEY_BUTLER_2017 ) { build 12-Sep-2018 15:30:24 fluxStd.setInterpMethod(interpolation); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -5273,7 +5274,12 @@ String Imager::make_comp(const String& objName, build 12-Sep-2018 15:30:24 returnFluxErrs[0].resize(nfreqs); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 MDirection objDir; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + if (fluxScaleEnum==FluxStandard::PERLEY_BUTLER_2013 || build 12-Sep-2018 15:30:24 + fluxScaleEnum==FluxStandard::PERLEY_BUTLER_2017) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + fluxStd.setInterpMethod("nearest"); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 foundSrc = fluxStd.computeCL(objName, mfreqs, mtime, objDir, build 12-Sep-2018 15:30:24 returnFluxes, returnFluxErrs, build 12-Sep-2018 15:30:24 clistnames, prefix); build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/MeasurementEquations/Imager2.cc b/code/synthesis/MeasurementEquations/Imager2.cc build 12-Sep-2018 15:30:24 index 38f9e3d..cc7e7db 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/MeasurementEquations/Imager2.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/MeasurementEquations/Imager2.cc build 12-Sep-2018 15:30:24 @@ -318,6 +318,7 @@ Bool Imager::imagecoordinates2(CoordinateSystem& coordInfo, const Bool verbose) build 12-Sep-2018 15:30:24 os << LogIO::DEBUG1 << "Using user defined location: " build 12-Sep-2018 15:30:24 << mLocation_p.getRefString() << " " << mLocation_p.get("m") build 12-Sep-2018 15:30:24 << LogIO::POST; build 12-Sep-2018 15:30:24 + obsPosition = mLocation_p; build 12-Sep-2018 15:30:24 freqFrameValid_p = true; build 12-Sep-2018 15:30:24 } else if(!(MeasTable::Observatory(obsPosition, telescop))){ build 12-Sep-2018 15:30:24 os << LogIO::WARN << "Did not get the position of " << telescop build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines/HetArrayConvFunc.cc b/code/synthesis/TransformMachines/HetArrayConvFunc.cc build 12-Sep-2018 15:30:24 index 8c73c83..f853902 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines/HetArrayConvFunc.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines/HetArrayConvFunc.cc build 12-Sep-2018 15:30:24 @@ -71,6 +71,7 @@ build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -478,6 +479,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 spCoord.setReferenceValue(Vector(1, beamFreqs(0))); build 12-Sep-2018 15:30:24 if(beamFreqs.nelements() >1) build 12-Sep-2018 15:30:24 spCoord.setIncrement(Vector(1, beamFreqs(1)-beamFreqs(0))); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 coords.replaceCoordinate(spCoord, spind); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 IPosition pbShape(4, convSize_p, convSize_p, 1, nBeamChans); build 12-Sep-2018 15:30:24 @@ -737,6 +739,8 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 */ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 makerowmap(vb, convFuncRowMap); build 12-Sep-2018 15:30:24 ///need to deal with only the maximum of different baselines available in this build 12-Sep-2018 15:30:24 ///vb build 12-Sep-2018 15:30:24 @@ -1029,16 +1033,22 @@ typedef unsigned long long ooLong; build 12-Sep-2018 15:30:24 Float minAbsConvFunc=min(amplitude(convPlane)); build 12-Sep-2018 15:30:24 Bool found=false; build 12-Sep-2018 15:30:24 Int trial=0; build 12-Sep-2018 15:30:24 + Float cutlevel=2.5e-2; build 12-Sep-2018 15:30:24 + //numeric needs a larger ft build 12-Sep-2018 15:30:24 + for (uInt k=0; k < antMath_p.nelements() ; ++k){ build 12-Sep-2018 15:30:24 + if((antMath_p[k]->whichPBClass()) == PBMathInterface::NUMERIC) build 12-Sep-2018 15:30:24 + cutlevel=1e-3; build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 for (trial=convSize/2-2;trial>0;trial--) { build 12-Sep-2018 15:30:24 - //Searching down a diagonal build 12-Sep-2018 15:30:24 - if(abs(convPlane(convSize/2-trial,convSize/2-trial)) > (1e-3*maxAbsConvFunc)) { build 12-Sep-2018 15:30:24 + //largest of either build 12-Sep-2018 15:30:24 + if((abs(convPlane(convSize/2-trial-1,convSize/2-1)) > (cutlevel*maxAbsConvFunc)) || (abs(convPlane(convSize/2-1,convSize/2-trial-1)) > (cutlevel*maxAbsConvFunc))) { build 12-Sep-2018 15:30:24 found=true; build 12-Sep-2018 15:30:24 trial=Int(sqrt(2.0*Float(trial*trial))); build 12-Sep-2018 15:30:24 break; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 if(!found){ build 12-Sep-2018 15:30:24 - if((maxAbsConvFunc-minAbsConvFunc) > (1.0e-3*maxAbsConvFunc)) build 12-Sep-2018 15:30:24 + if((maxAbsConvFunc-minAbsConvFunc) > (cutlevel*maxAbsConvFunc)) build 12-Sep-2018 15:30:24 found=true; build 12-Sep-2018 15:30:24 // if it drops by more than 2 magnitudes per pixel build 12-Sep-2018 15:30:24 trial=( (10*convSampling) < convSize) ? 5*convSampling : (convSize/2 - 4*convSampling); build 12-Sep-2018 15:30:24 @@ -1258,6 +1268,7 @@ typedef unsigned long long ooLong; build 12-Sep-2018 15:30:24 IPosition shp=inarray.shape(); build 12-Sep-2018 15:30:24 shp(0)=Int(nx*factor); build 12-Sep-2018 15:30:24 shp(1)=Int(ny*factor); build 12-Sep-2018 15:30:24 + cerr << "nx " << nx << " ny " << ny << " shape " << shp << endl; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Array out(shp); build 12-Sep-2018 15:30:24 ArrayIterator inIt(inarray, 2); build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines/PBMath.cc b/code/synthesis/TransformMachines/PBMath.cc build 12-Sep-2018 15:30:24 index 8514e0b..ba44163 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines/PBMath.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines/PBMath.cc build 12-Sep-2018 15:30:24 @@ -73,20 +73,26 @@ PBMath::PBMath() build 12-Sep-2018 15:30:24 pb_pointer_p = 0; build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 -PBMath::PBMath(const RecordInterface& rec) build 12-Sep-2018 15:30:24 -{ build 12-Sep-2018 15:30:24 + PBMath::PBMath(const RecordInterface& rec){ build 12-Sep-2018 15:30:24 + pb_pointer_p=pbMathInterfaceFromRecord(rec); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + PBMathInterface* PBMath::pbMathInterfaceFromRecord(const RecordInterface& rec){ build 12-Sep-2018 15:30:24 String name; build 12-Sep-2018 15:30:24 + PBMathInterface *pbPoint=nullptr; build 12-Sep-2018 15:30:24 const Int nameFieldNumber=rec.fieldNumber("name"); build 12-Sep-2018 15:30:24 if (nameFieldNumber!=-1) build 12-Sep-2018 15:30:24 name = rec.asString(nameFieldNumber); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + //cerr << "Name " << name << endl; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 if (name == "COMMONPB") { build 12-Sep-2018 15:30:24 String commonpb; build 12-Sep-2018 15:30:24 PBMath::CommonPB commonpbEnum; build 12-Sep-2018 15:30:24 commonpb = rec.asString (rec.fieldNumber("commonpb")); build 12-Sep-2018 15:30:24 PBMath::enumerateCommonPB(commonpb, commonpbEnum); build 12-Sep-2018 15:30:24 - PBMath aPBMath(commonpbEnum); build 12-Sep-2018 15:30:24 - *this = aPBMath; build 12-Sep-2018 15:30:24 + pbPoint=pbMathInterfaceForCommonPB(commonpbEnum, False); build 12-Sep-2018 15:30:24 } else if (name == "AIRY") { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -105,7 +111,7 @@ PBMath::PBMath(const RecordInterface& rec) build 12-Sep-2018 15:30:24 Bool usesymmetricbeam; build 12-Sep-2018 15:30:24 usesymmetricbeam=rec.asBool( rec.fieldNumber("usesymmetricbeam")); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - pb_pointer_p = new PBMath1DAiry( dishdiam, blockagediam, build 12-Sep-2018 15:30:24 + pbPoint = new PBMath1DAiry( dishdiam, blockagediam, build 12-Sep-2018 15:30:24 maxrad, reffreq, build 12-Sep-2018 15:30:24 BeamSquint(squintdir, squintreffreq), build 12-Sep-2018 15:30:24 usesymmetricbeam); build 12-Sep-2018 15:30:24 @@ -128,7 +134,7 @@ PBMath::PBMath(const RecordInterface& rec) build 12-Sep-2018 15:30:24 Bool isthisvp; build 12-Sep-2018 15:30:24 isthisvp=rec.asBool( rec.fieldNumber("isthisvp")); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - pb_pointer_p = new PBMath1DGauss( halfwidth, maxrad, reffreq, build 12-Sep-2018 15:30:24 + pbPoint = new PBMath1DGauss( halfwidth, maxrad, reffreq, build 12-Sep-2018 15:30:24 isthisvp, build 12-Sep-2018 15:30:24 BeamSquint(squintdir, squintreffreq), build 12-Sep-2018 15:30:24 usesymmetricbeam); build 12-Sep-2018 15:30:24 @@ -151,7 +157,7 @@ PBMath::PBMath(const RecordInterface& rec) build 12-Sep-2018 15:30:24 Bool isthisvp; build 12-Sep-2018 15:30:24 isthisvp=rec.asBool( rec.fieldNumber("isthisvp")); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - pb_pointer_p = new PBMath1DPoly( coeff, maxrad, reffreq, build 12-Sep-2018 15:30:24 + pbPoint = new PBMath1DPoly( coeff, maxrad, reffreq, build 12-Sep-2018 15:30:24 isthisvp, build 12-Sep-2018 15:30:24 BeamSquint(squintdir, squintreffreq), build 12-Sep-2018 15:30:24 usesymmetricbeam); build 12-Sep-2018 15:30:24 @@ -177,14 +183,14 @@ PBMath::PBMath(const RecordInterface& rec) build 12-Sep-2018 15:30:24 coeff=rec.asArrayDouble( rec.fieldNumber("coeff")); build 12-Sep-2018 15:30:24 Vector freqs; build 12-Sep-2018 15:30:24 freqs=rec.asArrayDouble( rec.fieldNumber("fitfreqs")); build 12-Sep-2018 15:30:24 - pb_pointer_p = new PBMath1DIPoly( coeff, freqs, maxrad, reffreq, build 12-Sep-2018 15:30:24 + pbPoint = new PBMath1DIPoly( coeff, freqs, maxrad, reffreq, build 12-Sep-2018 15:30:24 isthisvp, build 12-Sep-2018 15:30:24 BeamSquint(squintdir, squintreffreq), build 12-Sep-2018 15:30:24 usesymmetricbeam); build 12-Sep-2018 15:30:24 } else { build 12-Sep-2018 15:30:24 Vector coeff; build 12-Sep-2018 15:30:24 coeff=rec.asArrayDouble( rec.fieldNumber("coeff")); build 12-Sep-2018 15:30:24 - pb_pointer_p = new PBMath1DIPoly( coeff, maxrad, reffreq, build 12-Sep-2018 15:30:24 + pbPoint = new PBMath1DIPoly( coeff, maxrad, reffreq, build 12-Sep-2018 15:30:24 isthisvp, build 12-Sep-2018 15:30:24 BeamSquint(squintdir, squintreffreq), build 12-Sep-2018 15:30:24 usesymmetricbeam); build 12-Sep-2018 15:30:24 @@ -211,7 +217,7 @@ PBMath::PBMath(const RecordInterface& rec) build 12-Sep-2018 15:30:24 Bool isthisvp; build 12-Sep-2018 15:30:24 isthisvp=rec.asBool( rec.fieldNumber("isthisvp")); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - pb_pointer_p = new PBMath1DCosPoly( coeff, scale, maxrad, reffreq, build 12-Sep-2018 15:30:24 + pbPoint = new PBMath1DCosPoly( coeff, scale, maxrad, reffreq, build 12-Sep-2018 15:30:24 isthisvp, build 12-Sep-2018 15:30:24 BeamSquint(squintdir, squintreffreq), build 12-Sep-2018 15:30:24 usesymmetricbeam); build 12-Sep-2018 15:30:24 @@ -237,8 +243,9 @@ PBMath::PBMath(const RecordInterface& rec) build 12-Sep-2018 15:30:24 for (uInt i = 0; i< vect.nelements(); i++) { build 12-Sep-2018 15:30:24 aTempVector(i) = (Float)vect(i); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - pb_pointer_p = new PBMath1DNumeric( aTempVector, maxrad, reffreq, build 12-Sep-2018 15:30:24 + //cerr << "reffreq "<< reffreq << " maxrad " << maxrad << " isvp " << isthisvp << endl; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + pbPoint = new PBMath1DNumeric( aTempVector, maxrad, reffreq, build 12-Sep-2018 15:30:24 isthisvp, build 12-Sep-2018 15:30:24 BeamSquint(squintdir, squintreffreq), build 12-Sep-2018 15:30:24 usesymmetricbeam); build 12-Sep-2018 15:30:24 @@ -248,7 +255,7 @@ PBMath::PBMath(const RecordInterface& rec) build 12-Sep-2018 15:30:24 rec.get("compleximage", complexIm); build 12-Sep-2018 15:30:24 if(Table::isReadable(complexIm)) { build 12-Sep-2018 15:30:24 PagedImage cim(complexIm); build 12-Sep-2018 15:30:24 - pb_pointer_p=new PBMath2DImage(cim); build 12-Sep-2018 15:30:24 + pbPoint=new PBMath2DImage(cim); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else{ build 12-Sep-2018 15:30:24 throw(AipsError("Complex Image "+ complexIm + " is not readable")); build 12-Sep-2018 15:30:24 @@ -262,19 +269,22 @@ PBMath::PBMath(const RecordInterface& rec) build 12-Sep-2018 15:30:24 PagedImage realImage(realImageName); build 12-Sep-2018 15:30:24 if(Table::isReadable(imagImageName)) { build 12-Sep-2018 15:30:24 PagedImage imagImage(imagImageName); build 12-Sep-2018 15:30:24 - pb_pointer_p = new PBMath2DImage(realImage, imagImage); build 12-Sep-2018 15:30:24 + pbPoint = new PBMath2DImage(realImage, imagImage); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 if(!Table::isReadable(imagImageName)) { build 12-Sep-2018 15:30:24 - pb_pointer_p = new PBMath2DImage(realImage); build 12-Sep-2018 15:30:24 + pbPoint = new PBMath2DImage(realImage); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 else { build 12-Sep-2018 15:30:24 throw(AipsError("Image "+ realImageName + " is not readable or does not exist")); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - } else build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else{ build 12-Sep-2018 15:30:24 throw AipsError("Unrecognized PB name: " + name); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return pbPoint; build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 PBMath::PBMath(PBMath::CommonPB myPBType, Bool useSymmetricBeam) build 12-Sep-2018 15:30:24 @@ -1013,7 +1023,7 @@ void PBMath::enumerateCommonPB(const String & str, PBMath::CommonPB& ipb) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Bool build 12-Sep-2018 15:30:24 PBMath::getQuantity(const RecordInterface& rec, const String& item, build 12-Sep-2018 15:30:24 - Quantity& returnedQuantity) const build 12-Sep-2018 15:30:24 + Quantity& returnedQuantity) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 String error; build 12-Sep-2018 15:30:24 QuantumHolder h; build 12-Sep-2018 15:30:24 @@ -1032,7 +1042,7 @@ PBMath::getQuantity(const RecordInterface& rec, const String& item, build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Bool build 12-Sep-2018 15:30:24 PBMath::getMDirection(const RecordInterface& rec, const String& item, build 12-Sep-2018 15:30:24 - MDirection& returnedMDirection) const build 12-Sep-2018 15:30:24 + MDirection& returnedMDirection) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 String error; build 12-Sep-2018 15:30:24 MeasureHolder h; build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines/PBMath.h b/code/synthesis/TransformMachines/PBMath.h build 12-Sep-2018 15:30:24 index ada7d04..24bc684 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines/PBMath.h build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines/PBMath.h build 12-Sep-2018 15:30:24 @@ -364,7 +364,7 @@ public: build 12-Sep-2018 15:30:24 const casacore::Int iChan, build 12-Sep-2018 15:30:24 const SkyJones::SizeType); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - casacore::Int support (const casacore::CoordinateSystem& cs); build 12-Sep-2018 15:30:24 + virtual casacore::Int support (const casacore::CoordinateSystem& cs); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // given the Telescope name and the frequency, guess the most approrpiate build 12-Sep-2018 15:30:24 // CommonPB primary beam type and the band build 12-Sep-2018 15:30:24 @@ -382,10 +382,12 @@ public: build 12-Sep-2018 15:30:24 // return a PBMathInteface for a commonPB ; caller needs to delete pointer build 12-Sep-2018 15:30:24 static PBMathInterface* pbMathInterfaceForCommonPB(const PBMath::CommonPB ipb, bool useSymmetricBeam); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + // return a PBMathInteface from a Vpmanager record ; caller needs to delete pointer build 12-Sep-2018 15:30:24 + static PBMathInterface* pbMathInterfaceFromRecord(const casacore::RecordInterface& rec); build 12-Sep-2018 15:30:24 // gives the name of the PB Class that has been used build 12-Sep-2018 15:30:24 void namePBClass(casacore::String & name) { pb_pointer_p->namePBClass(name); } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // Gradient stuff: this needs more thought, as it is not build 12-Sep-2018 15:30:24 // really connected with the stuff in VPSkyJones and all. build 12-Sep-2018 15:30:24 // This will return the partial derivatives of chi^2 w.r.t build 12-Sep-2018 15:30:24 @@ -437,10 +439,10 @@ private: build 12-Sep-2018 15:30:24 // These should probably move to casacore::RecordInterface when we are happy with their performance build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - casacore::Bool getQuantity(const casacore::RecordInterface& rec, const casacore::String& item, build 12-Sep-2018 15:30:24 - casacore::Quantity& returnedQuantity) const; build 12-Sep-2018 15:30:24 - casacore::Bool getMDirection(const casacore::RecordInterface& rec, const casacore::String& item, build 12-Sep-2018 15:30:24 - casacore::MDirection& returnedMDirection) const; build 12-Sep-2018 15:30:24 + static casacore::Bool getQuantity(const casacore::RecordInterface& rec, const casacore::String& item, build 12-Sep-2018 15:30:24 + casacore::Quantity& returnedQuantity) ; build 12-Sep-2018 15:30:24 + static casacore::Bool getMDirection(const casacore::RecordInterface& rec, const casacore::String& item, build 12-Sep-2018 15:30:24 + casacore::MDirection& returnedMDirection); build 12-Sep-2018 15:30:24 //casacore::Function to initialize the state of the tool build 12-Sep-2018 15:30:24 void initByTelescope(PBMath::CommonPB myPBType, casacore::Bool useSymmetricBeam=false, build 12-Sep-2018 15:30:24 casacore::Double frequency=0.0); build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines/PBMath1DNumeric.cc b/code/synthesis/TransformMachines/PBMath1DNumeric.cc build 12-Sep-2018 15:30:24 index 36c550c..5c1139d 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines/PBMath1DNumeric.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines/PBMath1DNumeric.cc build 12-Sep-2018 15:30:24 @@ -154,5 +154,16 @@ PBMath1DNumeric::summary(Int nValues) build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 }; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + Int PBMath1DNumeric::support (const CoordinateSystem& cs){ build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + Int value=PBMath1D::support(cs); build 12-Sep-2018 15:30:24 + //As the maxRadius is determines where the numeric value stop...the support should be a bit larger build 12-Sep-2018 15:30:24 + value=Int(Double(value)*0.55)*2; build 12-Sep-2018 15:30:24 + return value; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + }; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 } //# NAMESPACE CASA - END build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines/PBMath1DNumeric.h b/code/synthesis/TransformMachines/PBMath1DNumeric.h build 12-Sep-2018 15:30:24 index 9b704fe..6a70577 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines/PBMath1DNumeric.h build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines/PBMath1DNumeric.h build 12-Sep-2018 15:30:24 @@ -142,6 +142,8 @@ public: build 12-Sep-2018 15:30:24 // Summarize the construction data for this primary beam build 12-Sep-2018 15:30:24 void summary(casacore::Int nValues=0); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + virtual casacore::Int support (const casacore::CoordinateSystem& cs); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 protected: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Fill in vp_p array from construction parameters build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines/PBMath2DImage.cc b/code/synthesis/TransformMachines/PBMath2DImage.cc build 12-Sep-2018 15:30:24 index ae01b71..0f2c90b 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines/PBMath2DImage.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines/PBMath2DImage.cc build 12-Sep-2018 15:30:24 @@ -52,6 +52,7 @@ build 12-Sep-2018 15:30:24 #endif build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 using namespace casacore; build 12-Sep-2018 15:30:24 +typedef unsigned long long ooLong; build 12-Sep-2018 15:30:24 namespace casa { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 PBMath2DImage::PBMath2DImage(ImageInterface& reJonesImage): build 12-Sep-2018 15:30:24 @@ -316,7 +317,8 @@ PBMath2DImage::applyJonesFast(const Float*& reJones, build 12-Sep-2018 15:30:24 << LogIO::EXCEPTION; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - Vector polmap1=polmap; build 12-Sep-2018 15:30:24 + Bool delpolmap; build 12-Sep-2018 15:30:24 + const Int *polmap1=polmap.getStorage(delpolmap); build 12-Sep-2018 15:30:24 const Float* reJones1=reJones; build 12-Sep-2018 15:30:24 const Float* imJones1=imJones; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -351,7 +353,6 @@ PBMath2DImage::applyJonesFast(const Float*& reJones, build 12-Sep-2018 15:30:24 applyJonesFastX(reJones1, imJones1, instor, outstor, polmap1, build 12-Sep-2018 15:30:24 lala, lala,ipower, // ie, 1=VP, 2=PB build 12-Sep-2018 15:30:24 laloo,circular,forward,ix, nx, ny, npol); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 /* for (Int iy=0; iy& polmap, build 12-Sep-2018 15:30:24 + const Int*& polmap, build 12-Sep-2018 15:30:24 Bool /*inverse*/, build 12-Sep-2018 15:30:24 Bool /*conjugate*/, build 12-Sep-2018 15:30:24 Int ipower, // ie, 1=VP, 2=PB build 12-Sep-2018 15:30:24 @@ -469,21 +473,21 @@ PBMath2DImage::applyJonesFastX(const Float*& reJones, build 12-Sep-2018 15:30:24 Bool forward, build 12-Sep-2018 15:30:24 const Int ix, const Int nx, const Int ny, const Int npol){ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - Int ind0, ind1, ind2, ind3; build 12-Sep-2018 15:30:24 + ooLong ind0, ind1, ind2, ind3; build 12-Sep-2018 15:30:24 // Loop through x, y coordinates of this cube build 12-Sep-2018 15:30:24 Matrix cmat(2,2); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - for (Int iy=0; iy& polmap, build 12-Sep-2018 15:30:24 + const casacore::Int*& polmap, build 12-Sep-2018 15:30:24 casacore::Bool /*inverse*/, build 12-Sep-2018 15:30:24 casacore::Bool /*conjugate*/, build 12-Sep-2018 15:30:24 casacore::Int ipower, // ie, 1=VP, 2=PB build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines/StokesImageUtil.cc b/code/synthesis/TransformMachines/StokesImageUtil.cc build 12-Sep-2018 15:30:24 index 5c997ba..77e8b40 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines/StokesImageUtil.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines/StokesImageUtil.cc build 12-Sep-2018 15:30:24 @@ -271,6 +271,50 @@ void StokesImageUtil::MakeGaussianPSF(ImageInterface& psf, Vector& build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 +Float StokesImageUtil::normalizePSF(casacore::ImageInterface& psf){ build 12-Sep-2018 15:30:24 + AlwaysAssert(psf.ndim()==4,AipsError); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + Float retval=-1e10; build 12-Sep-2018 15:30:24 + Vector map; build 12-Sep-2018 15:30:24 + AlwaysAssert(StokesMap(map, psf.coordinates()), AipsError); build 12-Sep-2018 15:30:24 + Int nx = psf.shape()(map(0)); build 12-Sep-2018 15:30:24 + Int ny = psf.shape()(map(1)); build 12-Sep-2018 15:30:24 + if(nx < 32 || ny < 32) build 12-Sep-2018 15:30:24 + throw(AipsError("Will not normalize images less than 32 pixels")); build 12-Sep-2018 15:30:24 + Int npol = psf.shape()(map(2)); build 12-Sep-2018 15:30:24 + Int nchan = psf.shape()(map(3)); build 12-Sep-2018 15:30:24 + IPosition blc(4); build 12-Sep-2018 15:30:24 + IPosition trc(4); build 12-Sep-2018 15:30:24 + IPosition blc8(4,0,0,0,0); build 12-Sep-2018 15:30:24 + IPosition trc8(4,0,0,0,0); build 12-Sep-2018 15:30:24 + blc(map(0))=0; blc(map(1))=0; build 12-Sep-2018 15:30:24 + trc(map(0))=nx-1; trc(map(1))=ny-1; build 12-Sep-2018 15:30:24 + blc8(map(0))=nx/2-nx/16; blc8(map(1))=ny/2-ny/16; build 12-Sep-2018 15:30:24 + trc8(map(0))=nx/2+nx/16; trc8(map(1))=ny/2+ny/16; build 12-Sep-2018 15:30:24 + Slicer inner8(blc8, trc8, Slicer::endIsLast); build 12-Sep-2018 15:30:24 + for (Int k=0; k < nchan ; ++k){ build 12-Sep-2018 15:30:24 + blc(map(3))=k; build 12-Sep-2018 15:30:24 + trc(map(3))=k; build 12-Sep-2018 15:30:24 + for (Int j=0; j < npol; ++j){ build 12-Sep-2018 15:30:24 + blc(map(2))=j; build 12-Sep-2018 15:30:24 + trc(map(2))=j; build 12-Sep-2018 15:30:24 + Slicer sl(blc, trc, Slicer::endIsLast); build 12-Sep-2018 15:30:24 + SubImage psfSub(psf, sl, True); build 12-Sep-2018 15:30:24 + Float maxCenter=max(psfSub.getSlice(inner8)); build 12-Sep-2018 15:30:24 + if(maxCenter > retval) build 12-Sep-2018 15:30:24 + retval=maxCenter; build 12-Sep-2018 15:30:24 + if(maxCenter !=0){ build 12-Sep-2018 15:30:24 + psfSub.copyData( (LatticeExpr)(psfSub/maxCenter)); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else{ build 12-Sep-2018 15:30:24 + psfSub.set(0.0); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + return retval; build 12-Sep-2018 15:30:24 +} build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // Zero specified elements of a Stokes image build 12-Sep-2018 15:30:24 void StokesImageUtil::Zero(ImageInterface& image, Vector& mask) { build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines/StokesImageUtil.h b/code/synthesis/TransformMachines/StokesImageUtil.h build 12-Sep-2018 15:30:24 index f8a4895..2b4d7a4 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines/StokesImageUtil.h build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines/StokesImageUtil.h build 12-Sep-2018 15:30:24 @@ -91,6 +91,10 @@ public: build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 static void locatePeakPSF(casacore::ImageInterface& psf, casacore::Int& xpos, casacore::Int& ypos, build 12-Sep-2018 15:30:24 casacore::Float& amp, casacore::Matrix& psfplane); build 12-Sep-2018 15:30:24 + ////make the psf of each plane have peak 1.0 (i.e peak in the inner 1/8 of each plane) build 12-Sep-2018 15:30:24 + /// you are on your own if the peak outside that zone :( build 12-Sep-2018 15:30:24 + /// It returns the maximum of the peak value found build 12-Sep-2018 15:30:24 + static casacore::Float normalizePSF(casacore::ImageInterface& psf); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Convolve a casacore::Stokes Image in place build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines/Utils.cc b/code/synthesis/TransformMachines/Utils.cc build 12-Sep-2018 15:30:24 index 1c7b4d3..79ee61f 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines/Utils.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines/Utils.cc build 12-Sep-2018 15:30:24 @@ -759,7 +759,9 @@ namespace casa{ build 12-Sep-2018 15:30:24 if (val==defaultVal) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 char *valStr=NULL; build 12-Sep-2018 15:30:24 - if ((valStr = std::getenv(name)) != NULL) build 12-Sep-2018 15:30:24 + std::string tt(name); build 12-Sep-2018 15:30:24 + tt.replace(tt.find("."), 1, "_"); build 12-Sep-2018 15:30:24 + if ((valStr = std::getenv(tt.c_str())) != NULL) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 stringstream toT2(valStr); build 12-Sep-2018 15:30:24 toT2 >> val; build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines/WPConvFunc.cc b/code/synthesis/TransformMachines/WPConvFunc.cc build 12-Sep-2018 15:30:24 index 1d1f0f9..a3516e0 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines/WPConvFunc.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines/WPConvFunc.cc build 12-Sep-2018 15:30:24 @@ -246,8 +246,8 @@ void WPConvFunc::findConvFunction(const ImageInterface& image, build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Int warner=0; build 12-Sep-2018 15:30:24 Vector maxes(wConvSize); build 12-Sep-2018 15:30:24 - Bool maxdel; build 12-Sep-2018 15:30:24 - Complex* maxptr=maxes.getStorage(maxdel); build 12-Sep-2018 15:30:24 + // Bool maxdel; build 12-Sep-2018 15:30:24 + // Complex* maxptr=maxes.getStorage(maxdel); build 12-Sep-2018 15:30:24 Matrix corr(inner, inner); build 12-Sep-2018 15:30:24 Vector correction(inner); build 12-Sep-2018 15:30:24 for (Int iy=-inner/2;iy build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 #include build 12-Sep-2018 15:30:24 @@ -202,6 +204,10 @@ AWConvFunc::AWConvFunc(const casacore::CountedPtr aTerm, build 12-Sep-2018 15:30:24 //Double vbPA = getPA(vb); build 12-Sep-2018 15:30:24 Complex cpeak,wtcpeak; build 12-Sep-2018 15:30:24 aTerm.cacheVBInfo(vb); build 12-Sep-2018 15:30:24 + Int totalCFs=muellerElements.shape().product()*freqValues.shape().product()*wValues.shape().product()*2, build 12-Sep-2018 15:30:24 + cfsDone=0; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + ProgressMeter pm(1.0, Double(totalCFs), "fillCF", "","","",true); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 for (uInt imx=0;imx aTerm, build 12-Sep-2018 15:30:24 // psTerm.reinit(dummy, uvScale_l, dummyoffset,pss); build 12-Sep-2018 15:30:24 // } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - IPosition pbshp(4,nx,ny,1,1); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + IPosition pbshp(4,nx, ny,1,1); build 12-Sep-2018 15:30:24 + // Set the shape to 2x2 pixel images for dry gridding build 12-Sep-2018 15:30:24 + if (isDryRun) pbshp[0]=pbshp[1]=2; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 // Cache the A-Term for this polarization and frequency build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 @@ -369,7 +379,7 @@ AWConvFunc::AWConvFunc(const casacore::CountedPtr aTerm, build 12-Sep-2018 15:30:24 //psTerm.applySky(cfBufMat, false); // Assign (psScale set in psTerm.init() build 12-Sep-2018 15:30:24 //psTerm.applySky(cfWtBufMat, false); // Assign build 12-Sep-2018 15:30:24 psTerm.applySky(cfBufMat, s, cfBufMat.shape()(0)/s(0)); // Assign (psScale set in psTerm.init() build 12-Sep-2018 15:30:24 - psTerm.applySky(cfWtBufMat, s, cfWtBufMat.shape()(0)/s(0)); // Assign build 12-Sep-2018 15:30:24 + psTerm.applySky(cfWtBufMat, s, cfWtBufMat.shape()(0)/s(0)); // Assign build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 cfWtBuf *= cfWtBuf; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -517,7 +527,15 @@ AWConvFunc::AWConvFunc(const casacore::CountedPtr aTerm, build 12-Sep-2018 15:30:24 ftRef(0)=cfWtBuf.shape()(0)/2.0; build 12-Sep-2018 15:30:24 ftRef(1)=cfWtBuf.shape()(1)/2.0; build 12-Sep-2018 15:30:24 CoordinateSystem ftCoords=cs_l; build 12-Sep-2018 15:30:24 - SynthesisUtils::makeFTCoordSys(cs_l, cfWtBuf.shape()(0), ftRef, ftCoords); build 12-Sep-2018 15:30:24 + if (isDryRun) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + ftRef(0)=nx/2.0; build 12-Sep-2018 15:30:24 + ftRef(1)=ny/2.0; build 12-Sep-2018 15:30:24 + SynthesisUtils::makeFTCoordSys(cs_l, nx,ftRef , ftCoords); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else build 12-Sep-2018 15:30:24 + SynthesisUtils::makeFTCoordSys(cs_l, cfWtBuf.shape()(0), ftRef, ftCoords); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 CountedPtr cfCellPtr; build 12-Sep-2018 15:30:24 cfWtb.setParams(inu,iw,imx,imy,//muellerElements(imx)(imy), build 12-Sep-2018 15:30:24 freqValues(inu), String(""), wValues(iw), muellerElements(imx)(imy), build 12-Sep-2018 15:30:24 @@ -585,7 +603,15 @@ AWConvFunc::AWConvFunc(const casacore::CountedPtr aTerm, build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 //tim.mark(); build 12-Sep-2018 15:30:24 ftCoords=cs_l; build 12-Sep-2018 15:30:24 - SynthesisUtils::makeFTCoordSys(cs_l, cfBuf.shape()(0), ftRef, ftCoords); build 12-Sep-2018 15:30:24 + if (isDryRun) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + ftRef(0) = nx/2.0; build 12-Sep-2018 15:30:24 + ftRef(1) = ny/2.0; build 12-Sep-2018 15:30:24 + SynthesisUtils::makeFTCoordSys(cs_l, nx, ftRef, ftCoords); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + else build 12-Sep-2018 15:30:24 + SynthesisUtils::makeFTCoordSys(cs_l, cfBuf.shape()(0), ftRef, ftCoords); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 cfb.setParams(inu,iw,imx,imy,//muellerElements(imx)(imy), build 12-Sep-2018 15:30:24 freqValues(inu), String(""), wValues(iw), muellerElements(imx)(imy), build 12-Sep-2018 15:30:24 ftCoords, sampling, xSupport, ySupport, build 12-Sep-2018 15:30:24 @@ -607,6 +633,7 @@ AWConvFunc::AWConvFunc(const casacore::CountedPtr aTerm, build 12-Sep-2018 15:30:24 (cfb.getCFCellPtr(freqValues(inu), wValues(iw), build 12-Sep-2018 15:30:24 muellerElements(imx)(imy)))->initCache(isDryRun); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + pm.update((Double)cfsDone++); build 12-Sep-2018 15:30:24 //tim.show("End*2:"); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -954,7 +981,7 @@ AWConvFunc::AWConvFunc(const casacore::CountedPtr aTerm, build 12-Sep-2018 15:30:24 Matrix uniqueBaselineTypeList=makeBaselineList(aTerm_p->getAntTypeList()); build 12-Sep-2018 15:30:24 //Quantity dPA(360.0,"deg"); build 12-Sep-2018 15:30:24 Quantity dPA(dpa,"rad"); build 12-Sep-2018 15:30:24 - Int totalCFs=uniqueBaselineTypeList.shape().product()*wConvSize*freqValues.nelements()*polMap.shape().product(); build 12-Sep-2018 15:30:24 + Int totalCFs=uniqueBaselineTypeList.shape().product()*wConvSize*freqValues.nelements()*polMap.shape().product()*2; build 12-Sep-2018 15:30:24 ProgressMeter pm(1.0, Double(totalCFs), "makeCF", "","","",true); build 12-Sep-2018 15:30:24 int cfDone=0; build 12-Sep-2018 15:30:24 for(Int ib=0;ib aTerm, build 12-Sep-2018 15:30:24 // psScale when using SynthesisUtils::libreSpheroidal() is build 12-Sep-2018 15:30:24 // 2.0/nSupport. nSupport is in pixels and the 2.0 is due to build 12-Sep-2018 15:30:24 // the center being at Nx/2. Here the nSupport is determined build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - Double lambdaByD = 1.22*C::c/min(freqValues)/25.0; build 12-Sep-2018 15:30:24 + innerQuaterFraction=refim::SynthesisUtils::getenv("AWCF.FUDGE",innerQuaterFraction); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + Double lambdaByD = innerQuaterFraction*1.22*C::c/min(freqValues)/25.0; build 12-Sep-2018 15:30:24 Double FoV_x = fabs(nx*skyIncr(0)); build 12-Sep-2018 15:30:24 Double FoV_y = fabs(nx*skyIncr(1)); build 12-Sep-2018 15:30:24 Vector uvScale_l(3); build 12-Sep-2018 15:30:24 @@ -1129,8 +1157,8 @@ AWConvFunc::AWConvFunc(const casacore::CountedPtr aTerm, build 12-Sep-2018 15:30:24 threshold = real(abs(cffunc(IPosition(4,convFuncOrigin,convFuncOrigin,0,0)))); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 //threshold *= aTerm_p->getSupportThreshold(); build 12-Sep-2018 15:30:24 - //threshold *= 1e-3; build 12-Sep-2018 15:30:24 - threshold *= 7.5e-2; build 12-Sep-2018 15:30:24 + threshold *= 1e-3; build 12-Sep-2018 15:30:24 + //threshold *= 7.5e-2; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // threshold *= 0.1; build 12-Sep-2018 15:30:24 // if (aTerm_p->isNoOp()) build 12-Sep-2018 15:30:24 @@ -1972,8 +2000,9 @@ AWConvFunc::AWConvFunc(const casacore::CountedPtr aTerm, build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 //Float psScale = (2*coords.increment()(0))/(nx*image.coordinates().increment()(0)); build 12-Sep-2018 15:30:24 Float innerQuaterFraction=1.0; build 12-Sep-2018 15:30:24 + innerQuaterFraction=refim::SynthesisUtils::getenv("AWCF.FUDGE",innerQuaterFraction); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - Double lambdaByD = 1.22*C::c/skyMinFreq/miscInfo.diameter; build 12-Sep-2018 15:30:24 + Double lambdaByD = innerQuaterFraction*1.22*C::c/skyMinFreq/miscInfo.diameter; build 12-Sep-2018 15:30:24 Double FoV_x = fabs(skyNX*skyIncr(0)); build 12-Sep-2018 15:30:24 Double FoV_y = fabs(skyNY*skyIncr(1)); build 12-Sep-2018 15:30:24 Vector uvScale_l(3); build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines2/AWConvFuncEPJones.cc b/code/synthesis/TransformMachines2/AWConvFuncEPJones.cc build 12-Sep-2018 15:30:24 index ce63939..4be1c57 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines2/AWConvFuncEPJones.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines2/AWConvFuncEPJones.cc build 12-Sep-2018 15:30:24 @@ -161,10 +161,11 @@ namespace casa{ build 12-Sep-2018 15:30:24 tel = vb.subtableColumns().observation().telescopeName() build 12-Sep-2018 15:30:24 (mscol.observationId()(0)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - if (tel.length() == 0 || build 12-Sep-2018 15:30:24 + if (tel.length() == 0 || !tel.contains("VLA") || build 12-Sep-2018 15:30:24 !MeasTable::Observatory(pos,tel)) { build 12-Sep-2018 15:30:24 // unknown observatory, use first antenna build 12-Sep-2018 15:30:24 - pos=vb.subtableColumns().antenna().positionMeas()(0); build 12-Sep-2018 15:30:24 + Int ant1 = vb.antenna1()(0); build 12-Sep-2018 15:30:24 + pos=vb.subtableColumns().antenna().positionMeas()(ant1); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 //cout << "TELESCOPE " << tel << endl; build 12-Sep-2018 15:30:24 //Store this to build epochs via the time access of visbuffer later build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines2/AWProjectFT.cc b/code/synthesis/TransformMachines2/AWProjectFT.cc build 12-Sep-2018 15:30:24 index 99d7f6c..cd04fc0 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines2/AWProjectFT.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines2/AWProjectFT.cc build 12-Sep-2018 15:30:24 @@ -125,7 +125,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 LogIO os(LogOrigin("AWProjectFT2", "createTelescopeATerm",WHERE)); build 12-Sep-2018 15:30:24 os << "Telescope name ('"+ build 12-Sep-2018 15:30:24 telescopeName+"') in the MS not recognized to create the telescope specific ATerm" build 12-Sep-2018 15:30:24 - << LogIO::WARN; build 12-Sep-2018 15:30:24 + << LogIO::EXCEPTION; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 return NULL; build 12-Sep-2018 15:30:24 @@ -2039,11 +2039,11 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // { build 12-Sep-2018 15:30:24 - // // TempImage tt(lattice->shape(), image->coordinates()); build 12-Sep-2018 15:30:24 - // // tt.put(lattice->get()); build 12-Sep-2018 15:30:24 - // storeImg(String("uvgrid.im"), *image); build 12-Sep-2018 15:30:24 - // } build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + // TempImage tt(lattice->shape(), image->coordinates()); build 12-Sep-2018 15:30:24 + // tt.put(lattice->get()); build 12-Sep-2018 15:30:24 + //storeImg(String("uvgrid.im"), *image); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 return *image; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -2066,8 +2066,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 Int nx=latticeShape(0); build 12-Sep-2018 15:30:24 Int ny=latticeShape(1); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - IPosition loc(2, 0); build 12-Sep-2018 15:30:24 - IPosition cursorShape(4, nx, ny, 1, 1); build 12-Sep-2018 15:30:24 + IPosition cursorShape(4, nx, ny, latticeShape(2), latticeShape(3)); build 12-Sep-2018 15:30:24 IPosition axisPath(4, 0, 1, 2, 3); build 12-Sep-2018 15:30:24 LatticeStepper lsx(latticeShape, cursorShape, axisPath); build 12-Sep-2018 15:30:24 LatticeIterator lix(weightImage, lsx); build 12-Sep-2018 15:30:24 @@ -2079,6 +2078,13 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 //lix.rwCursor()=weights(pol,chan); build 12-Sep-2018 15:30:24 lix.rwCursor()=liy.rwCursor(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // { build 12-Sep-2018 15:30:24 + // String name("wtim.im"); build 12-Sep-2018 15:30:24 + // storeImg(name,weightImage); build 12-Sep-2018 15:30:24 + // String nameavgpb("avgpb.im"); build 12-Sep-2018 15:30:24 + // storeImg(nameavgpb,*avgPB_p); build 12-Sep-2018 15:30:24 + // } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 //--------------------------------------------------------------- build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines2/AWProjectWBFT.cc b/code/synthesis/TransformMachines2/AWProjectWBFT.cc build 12-Sep-2018 15:30:24 index 61b60bd..1c76125 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines2/AWProjectWBFT.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines2/AWProjectWBFT.cc build 12-Sep-2018 15:30:24 @@ -377,10 +377,6 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 // storeArrayAsImage(name,griddedWeights.coordinates(),wtImage.get()); build 12-Sep-2018 15:30:24 // } build 12-Sep-2018 15:30:24 LatticeFFT::cfft2d(wtImage,false); build 12-Sep-2018 15:30:24 - // { build 12-Sep-2018 15:30:24 - // String name("ftwtimg.im"); build 12-Sep-2018 15:30:24 - // storeArrayAsImage(name,griddedWeights.coordinates(),wtImage.get()); build 12-Sep-2018 15:30:24 - // } build 12-Sep-2018 15:30:24 wtImageFTDone_p=true; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Int sizeX=wtImage.shape()(0), sizeY=wtImage.shape()(1); build 12-Sep-2018 15:30:24 @@ -431,6 +427,20 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 // weightRatio_p = maxval * Float(sizeX)*Float(sizeY) / sumwt_l; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + // { build 12-Sep-2018 15:30:24 + // String name("ftwtimg.im"); build 12-Sep-2018 15:30:24 + // ArrayLattice tt(wtImage.shape()); build 12-Sep-2018 15:30:24 + // Array ttbuf; build 12-Sep-2018 15:30:24 + // Array wtBUF; build 12-Sep-2018 15:30:24 + // wtImage.get(wtBUF,false); build 12-Sep-2018 15:30:24 + // tt.get(ttbuf,false); build 12-Sep-2018 15:30:24 + // for (int i=0;i tmp(senImIter.rwMatrixCursor().shape()); build 12-Sep-2018 15:30:24 tmp = 1.0; build 12-Sep-2018 15:30:24 - for(wtImIter.reset(); !wtImIter.atEnd(); wtImIter++) build 12-Sep-2018 15:30:24 + for(wtImIter.reset(), senImIter.reset(); !wtImIter.atEnd(); wtImIter++, senImIter++) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 Matrix tmp_ref;tmp_ref.reference(wtImIter.rwMatrixCursor().nonDegenerate()); build 12-Sep-2018 15:30:24 for (int i=0;iComplex) build 12-Sep-2018 15:30:24 + senImIter.rwMatrixCursor() = real(tmp); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - for(senImIter.reset(); !senImIter.atEnd(); senImIter++) build 12-Sep-2018 15:30:24 - senImIter.rwMatrixCursor() = real(tmp); build 12-Sep-2018 15:30:24 + // { build 12-Sep-2018 15:30:24 + // String name("ftwtimg.im"); build 12-Sep-2018 15:30:24 + // storeArrayAsImage(name,griddedWeights_D.coordinates(),sensitivityImage.get()); build 12-Sep-2018 15:30:24 + // } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // for(senImIter.reset(); !senImIter.atEnd(); senImIter++) build 12-Sep-2018 15:30:24 + // { build 12-Sep-2018 15:30:24 + // cerr << "Sen: " << senImIter.position() << endl; build 12-Sep-2018 15:30:24 + // senImIter.rwMatrixCursor() = real(tmp); build 12-Sep-2018 15:30:24 + // } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 if (tt_pp == "") build 12-Sep-2018 15:30:24 cfCache_p->flush(sensitivityImage,sensitivityPatternQualifierStr_p); build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines2/AWVisResampler.cc b/code/synthesis/TransformMachines2/AWVisResampler.cc build 12-Sep-2018 15:30:24 index daa6b70..eabae83 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines2/AWVisResampler.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines2/AWVisResampler.cc build 12-Sep-2018 15:30:24 @@ -65,6 +65,18 @@ namespace casa{ build 12-Sep-2018 15:30:24 const Int* __restrict__ & iPos, build 12-Sep-2018 15:30:24 const Vector& inc, build 12-Sep-2018 15:30:24 Complex& nvalue, Complex& wt) __restrict__; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + template build 12-Sep-2018 15:30:24 + void AWVisResampler::addTo4DArray_ptr(DComplex* __restrict__ & store, build 12-Sep-2018 15:30:24 + const Int* __restrict__ & iPos, build 12-Sep-2018 15:30:24 + const Int* __restrict__ & inc, build 12-Sep-2018 15:30:24 + Complex& nvalue, Complex& wt) __restrict__ ; build 12-Sep-2018 15:30:24 + template build 12-Sep-2018 15:30:24 + void AWVisResampler::addTo4DArray_ptr(Complex* __restrict__ & store, build 12-Sep-2018 15:30:24 + const Int* __restrict__ & iPos, build 12-Sep-2018 15:30:24 + const Int* __restrict__ & inc, build 12-Sep-2018 15:30:24 + Complex& nvalue, Complex& wt) __restrict__ ; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 template build 12-Sep-2018 15:30:24 void AWVisResampler::DataToGridImpl_p(Array& grid, VBStore& vbs, build 12-Sep-2018 15:30:24 Matrix& sumwt,const Bool& dopsf, build 12-Sep-2018 15:30:24 @@ -197,7 +209,7 @@ namespace casa{ build 12-Sep-2018 15:30:24 Array tt=SynthesisUtils::getCFPixels(cfb.getCFCacheDir(), cfcell->fileName_p); build 12-Sep-2018 15:30:24 cfcell->setStorage(tt); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - cerr << (cfcell->isRotationallySymmetric_p?"o":"+"); build 12-Sep-2018 15:30:24 + //cerr << (cfcell->isRotationallySymmetric_p?"o":"+"); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // No rotation necessary if the CF is rotationally symmetric build 12-Sep-2018 15:30:24 if (!(cfcell->isRotationallySymmetric_p)) build 12-Sep-2018 15:30:24 @@ -235,8 +247,8 @@ namespace casa{ build 12-Sep-2018 15:30:24 const Int* convOrigin, build 12-Sep-2018 15:30:24 Complex& nvalue, build 12-Sep-2018 15:30:24 Double& wVal, build 12-Sep-2018 15:30:24 - Bool& finitePointingOffset, build 12-Sep-2018 15:30:24 - Bool& doPSFOnly, build 12-Sep-2018 15:30:24 + Bool& /*finitePointingOffset*/, build 12-Sep-2018 15:30:24 + Bool& /*doPSFOnly*/, build 12-Sep-2018 15:30:24 T* __restrict__ gridStore, build 12-Sep-2018 15:30:24 Int* iloc, build 12-Sep-2018 15:30:24 Complex& norm, build 12-Sep-2018 15:30:24 @@ -274,105 +286,65 @@ namespace casa{ build 12-Sep-2018 15:30:24 Vector& /*cfShape*/, Vector& loc, Vector& igrdpos, build 12-Sep-2018 15:30:24 Double& /*sinDPA*/, Double& /*cosDPA*/, build 12-Sep-2018 15:30:24 Bool& finitePointingOffset, build 12-Sep-2018 15:30:24 - Bool doPSFOnly) build 12-Sep-2018 15:30:24 + Bool /*doPSFOnly*/) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - Vector iloc(4,0), tiloc(4); build 12-Sep-2018 15:30:24 + Vector iloc(4,0); build 12-Sep-2018 15:30:24 Bool Dummy; build 12-Sep-2018 15:30:24 - Complex wt, cfArea=1.0; build 12-Sep-2018 15:30:24 + Complex wt;//, cfArea=1.0; build 12-Sep-2018 15:30:24 Complex norm=0.0; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + Vector iCFPos(4,0); build 12-Sep-2018 15:30:24 + const Int * __restrict__ gridInc_p_ptr= gridInc_p.getStorage(Dummy); build 12-Sep-2018 15:30:24 const Int * __restrict__ iGrdPosPtr = igrdpos.getStorage(Dummy); build 12-Sep-2018 15:30:24 T* __restrict__ gridStore = grid.getStorage(Dummy); build 12-Sep-2018 15:30:24 - Int Nth = 1; build 12-Sep-2018 15:30:24 -#ifdef _OPENMP build 12-Sep-2018 15:30:24 - Nth=max(omp_get_max_threads()-2,1); build 12-Sep-2018 15:30:24 -#endif build 12-Sep-2018 15:30:24 - Nth = Nth; build 12-Sep-2018 15:30:24 +// Int Nth = 1; build 12-Sep-2018 15:30:24 +// #ifdef _OPENMP build 12-Sep-2018 15:30:24 +// Nth=max(omp_get_max_threads()-2,1); build 12-Sep-2018 15:30:24 +// #endif build 12-Sep-2018 15:30:24 +// Nth = Nth; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 const Int* scaledSupport_ptr=scaledSupport.getStorage(Dummy); build 12-Sep-2018 15:30:24 const Float *scaledSampling_ptr=scaledSampling.getStorage(Dummy); build 12-Sep-2018 15:30:24 const Double *off_ptr=off.getStorage(Dummy); build 12-Sep-2018 15:30:24 const Int *loc_ptr = loc.getStorage(Dummy); build 12-Sep-2018 15:30:24 + Int *iCFPos_ptr = iCFPos.getStorage(Dummy); build 12-Sep-2018 15:30:24 const Int* convOrigin_ptr=convOrigin.getStorage(Dummy); build 12-Sep-2018 15:30:24 Int *iloc_ptr=iloc.getStorage(Dummy); build 12-Sep-2018 15:30:24 Int *igrdpos_ptr=igrdpos.getStorage(Dummy); build 12-Sep-2018 15:30:24 - Vector iCFPos(4,0); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - Bool finitePointingOffset_l=finitePointingOffset; build 12-Sep-2018 15:30:24 - Bool doPSFOnly_l=doPSFOnly; build 12-Sep-2018 15:30:24 - Double wVal_l=wVal; build 12-Sep-2018 15:30:24 - Complex nvalue_l=nvalue; build 12-Sep-2018 15:30:24 - Complex *convFuncV_l=convFuncV; build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // !!!!! Compute cfArea for high precision work build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // cfArea = getCFArea(convFuncV, wVal, scaledSupport, scaledSampling, build 12-Sep-2018 15:30:24 - // off, convOrigin, cfShape, sinDPA,cosDPA); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // cerr << "Cfarea = " << cfArea << endl; build 12-Sep-2018 15:30:24 - IPosition phaseGradOrigin_l; build 12-Sep-2018 15:30:24 - phaseGradOrigin_l = cached_phaseGrad_p.shape()/2; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 -// #pragma omp parallel default(none) \ build 12-Sep-2018 15:30:24 -// shared(gridStore) \ build 12-Sep-2018 15:30:24 -// firstprivate(scaledSupport_ptr,scaledSampling_ptr,off_ptr,loc_ptr,cfArea,iGrdPosPtr, \ build 12-Sep-2018 15:30:24 -// convFuncV_l, convOrigin_ptr, nvalue_l, wVal_l, finitePointingOffset_l, doPSFOnly_l, \ build 12-Sep-2018 15:30:24 -// iloc_ptr, norm,igrdpos_ptr) num_threads(Nth) build 12-Sep-2018 15:30:24 - { build 12-Sep-2018 15:30:24 -// #pragma omp for build 12-Sep-2018 15:30:24 - for(Int iy=-scaledSupport[1]; iy <= scaledSupport[1]; iy++) build 12-Sep-2018 15:30:24 + Int *cfInc_p_ptr = cfInc_p.getStorage(Dummy); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + //Bool finitePointingOffset_l=finitePointingOffset; build 12-Sep-2018 15:30:24 + //Bool doPSFOnly_l=doPSFOnly; build 12-Sep-2018 15:30:24 + //Double wVal_l=wVal; build 12-Sep-2018 15:30:24 + //Complex nvalue_l=nvalue; build 12-Sep-2018 15:30:24 + //Complex *convFuncV_l=convFuncV; build 12-Sep-2018 15:30:24 + Int phaseGradOrigin_l[2]; build 12-Sep-2018 15:30:24 + phaseGradOrigin_l[0] = cached_phaseGrad_p.shape()(0)/2; build 12-Sep-2018 15:30:24 + phaseGradOrigin_l[1] = cached_phaseGrad_p.shape()(1)/2; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + for(Int iy=-scaledSupport_ptr[1]; iy <= scaledSupport_ptr[1]; iy++) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - //iloc_ptr[1]=(Int)((scaledSampling[1]*iy+off[1])-1); build 12-Sep-2018 15:30:24 - iloc_ptr[1]=SynthesisUtils::nint((scaledSampling[1]*iy+off[1])-1); build 12-Sep-2018 15:30:24 - igrdpos[1]=loc[1]+iy; build 12-Sep-2018 15:30:24 - iCFPos[1] =iloc_ptr[1]+convOrigin[1]; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // XInnerLoop(scaledSupport_ptr, scaledSampling_ptr, build 12-Sep-2018 15:30:24 - // off_ptr, build 12-Sep-2018 15:30:24 - // loc_ptr, cfArea, build 12-Sep-2018 15:30:24 - // iGrdPosPtr, build 12-Sep-2018 15:30:24 - // convFuncV_l, build 12-Sep-2018 15:30:24 - // convOrigin_ptr, build 12-Sep-2018 15:30:24 - // nvalue_l, build 12-Sep-2018 15:30:24 - // wVal_l, build 12-Sep-2018 15:30:24 - // finitePointingOffset_l, build 12-Sep-2018 15:30:24 - // doPSFOnly_l, build 12-Sep-2018 15:30:24 - // gridStore, build 12-Sep-2018 15:30:24 - // iloc_ptr, build 12-Sep-2018 15:30:24 - // norm, build 12-Sep-2018 15:30:24 - // igrdpos_ptr); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - for(Int ix=-scaledSupport[0]; ix <= scaledSupport[0]; ix++) build 12-Sep-2018 15:30:24 + iloc_ptr[1]=SynthesisUtils::nint((scaledSampling_ptr[1]*iy+off_ptr[1])-1); build 12-Sep-2018 15:30:24 + igrdpos_ptr[1]=loc_ptr[1]+iy; build 12-Sep-2018 15:30:24 + iCFPos_ptr[1] =iloc_ptr[1]+convOrigin_ptr[1]; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + for(Int ix=-scaledSupport_ptr[0]; ix <= scaledSupport_ptr[0]; ix++) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - //iloc[0]=(Int)((scaledSampling[0]*ix+off[0])-1); build 12-Sep-2018 15:30:24 - iloc[0]=SynthesisUtils::nint((scaledSampling[0]*ix+off[0])-1); build 12-Sep-2018 15:30:24 - igrdpos[0]=loc[0]+ix; build 12-Sep-2018 15:30:24 - iCFPos[0] =iloc_ptr[0]+convOrigin[0]; build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // reindex() is for historical reasons and does three build 12-Sep-2018 15:30:24 - // operations: (1) rotate the co-ord. sys. using build 12-Sep-2018 15:30:24 - // sin/cosDPA, (2) add convOrigin to iloc and return the build 12-Sep-2018 15:30:24 - // result in tiloc and add convOrigin to tiloc, and (3) build 12-Sep-2018 15:30:24 - // return true if tiloc lines with in the cfShape. build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // if (reindex(iloc,tiloc,sinDPA, cosDPA, convOrigin, cfShape)) build 12-Sep-2018 15:30:24 + iloc_ptr[0]=SynthesisUtils::nint((scaledSampling_ptr[0]*ix+off_ptr[0])-1); build 12-Sep-2018 15:30:24 + igrdpos_ptr[0]=loc_ptr[0]+ix; build 12-Sep-2018 15:30:24 + iCFPos_ptr[0] =iloc_ptr[0]+convOrigin_ptr[0]; build 12-Sep-2018 15:30:24 + wt = getFrom4DArray((const Complex * __restrict__ &)convFuncV, build 12-Sep-2018 15:30:24 + iCFPos_ptr,cfInc_p_ptr);//cfArea; build 12-Sep-2018 15:30:24 + if (wVal > 0.0) {wt = conj(wt);} build 12-Sep-2018 15:30:24 + norm += (wt); build 12-Sep-2018 15:30:24 + if (finitePointingOffset)// && !doPSFOnly) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - wt = getFrom4DArray((const Complex * __restrict__ &)convFuncV, build 12-Sep-2018 15:30:24 - iCFPos,cfInc_p)/cfArea; build 12-Sep-2018 15:30:24 - if (wVal > 0.0) {wt = conj(wt);} build 12-Sep-2018 15:30:24 - norm += (wt); build 12-Sep-2018 15:30:24 - if (finitePointingOffset)// && !doPSFOnly) build 12-Sep-2018 15:30:24 - { build 12-Sep-2018 15:30:24 - wt *= cached_phaseGrad_p(iloc[0]+phaseGradOrigin_l[0], build 12-Sep-2018 15:30:24 - iloc[1]+phaseGradOrigin_l[1]); build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - // The following uses raw index on the 4D grid build 12-Sep-2018 15:30:24 - addTo4DArray(gridStore,iGrdPosPtr,gridInc_p, nvalue,wt); build 12-Sep-2018 15:30:24 + wt *= cached_phaseGrad_p(iloc_ptr[0]+phaseGradOrigin_l[0], build 12-Sep-2018 15:30:24 + iloc_ptr[1]+phaseGradOrigin_l[1]); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 + addTo4DArray_ptr(gridStore,iGrdPosPtr,gridInc_p_ptr, nvalue,wt); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 return norm; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 // Moved the accumulateFromGrid() method to file to play with build 12-Sep-2018 15:30:24 @@ -391,8 +363,10 @@ namespace casa{ build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 //cout << "# " << cfRefFreq << " " << imRefFreq << endl; build 12-Sep-2018 15:30:24 //cerr << pointingOffset << " " << cached_PointingOffset_p << endl; build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 if ( build 12-Sep-2018 15:30:24 - (sum(fabs(pointingOffset-cached_PointingOffset_p)) > 1e-6) || build 12-Sep-2018 15:30:24 + ((fabs(pointingOffset[0]-cached_PointingOffset_p[0])) > 1e-6) || build 12-Sep-2018 15:30:24 + ((fabs(pointingOffset[0]-cached_PointingOffset_p[0])) > 1e-6) || build 12-Sep-2018 15:30:24 (cached_phaseGrad_p.shape()[0] < cfShape[0]) || build 12-Sep-2018 15:30:24 (cached_phaseGrad_p.shape()[1] < cfShape[1]) build 12-Sep-2018 15:30:24 ) build 12-Sep-2018 15:30:24 @@ -401,7 +375,8 @@ namespace casa{ build 12-Sep-2018 15:30:24 log_l << "Computing phase gradiant for pointing offset " build 12-Sep-2018 15:30:24 << pointingOffset << cfShape << " " << cached_phaseGrad_p.shape() build 12-Sep-2018 15:30:24 << "(SPW: " << spwID << " Field: " << fieldId << ")" build 12-Sep-2018 15:30:24 - << LogIO::DEBUGGING << LogIO::POST; build 12-Sep-2018 15:30:24 + << LogIO::DEBUGGING build 12-Sep-2018 15:30:24 + << LogIO::POST; build 12-Sep-2018 15:30:24 Int nx=cfShape(0), ny=cfShape(1); build 12-Sep-2018 15:30:24 Double grad; build 12-Sep-2018 15:30:24 Complex phx,phy; build 12-Sep-2018 15:30:24 @@ -466,7 +441,7 @@ namespace casa{ build 12-Sep-2018 15:30:24 Int startChan, endChan; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Vector sampling(2),scaledSampling(2); build 12-Sep-2018 15:30:24 - Vector support(2),loc(3), iloc(4),tiloc(4),scaledSupport(2); build 12-Sep-2018 15:30:24 + Vector support(2),loc(3), iloc(4),scaledSupport(2); build 12-Sep-2018 15:30:24 Vector pos(3), off(3); build 12-Sep-2018 15:30:24 Vector igrdpos(4); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 @@ -476,7 +451,7 @@ namespace casa{ build 12-Sep-2018 15:30:24 cfShape=vbRow2CFBMap_p(0)->getStorage()(0,0,0)->getStorage()->shape().asVector(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 Vector convOrigin = (cfShape)/2; build 12-Sep-2018 15:30:24 - Double sinDPA=0.0, cosDPA=1.0, cfRefFreq; build 12-Sep-2018 15:30:24 + Double cfRefFreq; build 12-Sep-2018 15:30:24 // Double cfScale=1.0; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 //timer_p.mark(); build 12-Sep-2018 15:30:24 @@ -707,18 +682,15 @@ namespace casa{ build 12-Sep-2018 15:30:24 // loops re-written in FORTRAN (in synthesis/fortran/faccumulateOnGrid.f) build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 //timer_p.mark(); build 12-Sep-2018 15:30:24 - norm += accumulateOnGrid(grid,convFuncV,nvalue,dataWVal, build 12-Sep-2018 15:30:24 - support,sampling, build 12-Sep-2018 15:30:24 - off, convOrigin, cfShape, loc, igrdpos, build 12-Sep-2018 15:30:24 - sinDPA, cosDPA,finitePointingOffsets,psfOnly); build 12-Sep-2018 15:30:24 -// cerr << vbs.vb_p->spectralWindow() << " " << vbs.vb_p->rowIds()(irow) << " " << irow << " " << ichan << " " << ipol << " " << mRow << endl; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + // norm += accumulateOnGrid(grid,convFuncV,nvalue,dataWVal, build 12-Sep-2018 15:30:24 + // support,sampling, build 12-Sep-2018 15:30:24 + // off, convOrigin, cfShape, loc, igrdpos, build 12-Sep-2018 15:30:24 + // sinDPA, cosDPA,finitePointingOffsets,psfOnly); build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 //#include build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 //clLoopsToGrid(); build 12-Sep-2018 15:30:24 //runTimeG7_p += timer_p.real(); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - // cerr << "Norm = " << norm << endl; build 12-Sep-2018 15:30:24 sumwt(targetIMPol,targetIMChan) += vbs.imagingWeight_p(ichan, irow)*abs(norm); build 12-Sep-2018 15:30:24 // *(sumWt_ptr+apol+achan*nGridChan)+= *(imgWts_ptr+ichan+irow*nDataChan); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 @@ -744,7 +716,7 @@ namespace casa{ build 12-Sep-2018 15:30:24 Int nDataChan, nDataPol, nGridPol, nGridChan, nx, ny,nw;//, nCFFreq; build 12-Sep-2018 15:30:24 Int achan, apol, rbeg, rend;//, PolnPlane, ConjPlane; build 12-Sep-2018 15:30:24 Vector sampling(2);//scaledSampling(2); build 12-Sep-2018 15:30:24 - Vector support(2),loc(3), iloc(4),tiloc(4);// scaledSupport(2); build 12-Sep-2018 15:30:24 + Vector support(2),loc(3), iloc(4); build 12-Sep-2018 15:30:24 Vector pos(3), off(3); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 IPosition grdpos(4); build 12-Sep-2018 15:30:24 @@ -756,7 +728,7 @@ namespace casa{ build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 // Vector convOrigin = (cfShape-1)/2; build 12-Sep-2018 15:30:24 Vector convOrigin = (cfShape)/2; build 12-Sep-2018 15:30:24 - Double sinDPA=0.0, cosDPA=1.0, cfRefFreq;//cfScale=1.0 build 12-Sep-2018 15:30:24 + Double cfRefFreq;//cfScale=1.0 build 12-Sep-2018 15:30:24 // Int wndx = 0, fndx=0; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 rbeg=0; build 12-Sep-2018 15:30:24 @@ -850,126 +822,79 @@ namespace casa{ build 12-Sep-2018 15:30:24 Bool isOnGrid; build 12-Sep-2018 15:30:24 // if ((isOnGrid=onGrid(nx, ny, nw, loc, support))) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 - for(Int ipol=0; ipol < nDataPol; ipol++) { build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - if(!flagCube(ipol,ichan,irow)) { build 12-Sep-2018 15:30:24 - apol=polMap_p[ipol]; build 12-Sep-2018 15:30:24 + for(Int ipol=0; ipol < nDataPol; ipol++) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + if(!flagCube(ipol,ichan,irow)) build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + apol=polMap_p[ipol]; build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - if((apol>=0) && (apol=0) && (apol" << visGridElement << "-->" << ipol << " " << polMap_p[ipol] << " " << polMap_p[visGridElement] << endl; build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // Compute the incrmenets and center pixel for the current CF build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - if ((isOnGrid=onGrid(nx, ny, nw, loc, support))==false) break; build 12-Sep-2018 15:30:24 - cacheAxisIncrements(cfShape, cfInc_p); build 12-Sep-2018 15:30:24 - convOrigin = (cfShape)/2; build 12-Sep-2018 15:30:24 - if (finitePointingOffset) build 12-Sep-2018 15:30:24 - cachePhaseGrad_p(pointingOffset, cfShape, convOrigin, cfRefFreq, vbs.imRefFreq(), build 12-Sep-2018 15:30:24 - vbSpw, vbFieldID); build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // ALERT: The -1 in the expression for iloc build 12-Sep-2018 15:30:24 - // was determined by comparing with a working build 12-Sep-2018 15:30:24 - // old code (fpbmos.f). build 12-Sep-2018 15:30:24 - // build 12-Sep-2018 15:30:24 - // Complex tt=0.0; build 12-Sep-2018 15:30:24 - // int nn=0; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - // accumulateFromGrid() is a local C++ method with the inner loops. The include build 12-Sep-2018 15:30:24 - // file (FortanizedLoopsFromGrid.cc) has the interface code to call the inner build 12-Sep-2018 15:30:24 - // loops re-written in FORTRAN (in synthesis/fortran/faccumulateOnGrid.f) build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 - accumulateFromGrid(nvalue, norm[ipol], gridStore, igrdpos, convFuncV, dataWVal, build 12-Sep-2018 15:30:24 - support, sampling, off, convOrigin, build 12-Sep-2018 15:30:24 - cfShape, loc, phasor, sinDPA, cosDPA, build 12-Sep-2018 15:30:24 - finitePointingOffset, cached_phaseGrad_p); build 12-Sep-2018 15:30:24 + for (uInt mCol=0; mCol" << visGridElement << "-->" << ipol << " " << polMap_p[ipol] << " " << polMap_p[visGridElement] << endl; build 12-Sep-2018 15:30:24 + // build 12-Sep-2018 15:30:24 + // Compute the incrmenets and center pixel for the current CF build 12-Sep-2018 15:30:24 + // build 12-Sep-2018 15:30:24 + if ((isOnGrid=onGrid(nx, ny, nw, loc, support))==false) break; build 12-Sep-2018 15:30:24 + cacheAxisIncrements(cfShape, cfInc_p); build 12-Sep-2018 15:30:24 + convOrigin = (cfShape)/2; build 12-Sep-2018 15:30:24 + if (finitePointingOffset) build 12-Sep-2018 15:30:24 + cachePhaseGrad_p(pointingOffset, cfShape, convOrigin, cfRefFreq, vbs.imRefFreq(), build 12-Sep-2018 15:30:24 + vbSpw, vbFieldID); build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 + // accumulateFromGrid() is a local C++ method with the inner loops. The include build 12-Sep-2018 15:30:24 + // file (FortanizedLoopsFromGrid.cc) has the interface code to call the inner build 12-Sep-2018 15:30:24 + // loops re-written in FORTRAN (in synthesis/fortran/faccumulateOnGrid.f) build 12-Sep-2018 15:30:24 // Timer timer; build 12-Sep-2018 15:30:24 + // accumulateFromGrid(nvalue, norm[ipol], gridStore, igrdpos, convFuncV, dataWVal, build 12-Sep-2018 15:30:24 + // support, sampling, off, convOrigin, build 12-Sep-2018 15:30:24 + // cfShape, loc, phasor, dummy, dummy, build 12-Sep-2018 15:30:24 + // finitePointingOffset, cached_phaseGrad_p); build 12-Sep-2018 15:30:24 +#include build 12-Sep-2018 15:30:24 //#include build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // runTimeDG_p += timer.real(); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 - // //-------------------------------------------------------------------------------- build 12-Sep-2018 15:30:24 - // IPosition phaseGradOrigin_l = cached_phaseGrad_p.shape()/2; build 12-Sep-2018 15:30:24 - // for(Int iy=-support[1]; iy <= support[1]; iy++) build 12-Sep-2018 15:30:24 - // { build 12-Sep-2018 15:30:24 - // // iloc(1)=(Int)(scaledSampling[1]*iy+off[1]-1);//+convOrigin[1]; build 12-Sep-2018 15:30:24 - // iloc(1)=(sampling[1]*iy+off[1]);//+convOrigin[1]; build 12-Sep-2018 15:30:24 - // igrdpos[1]=loc[1]+iy; build 12-Sep-2018 15:30:24 - // for(Int ix=-support[0]; ix <= support[0]; ix++) build 12-Sep-2018 15:30:24 - // { build 12-Sep-2018 15:30:24 - // // iloc(0)=(Int)(scaledSampling[0]*ix+off[0]-1);//+convOrigin[0]; build 12-Sep-2018 15:30:24 - // iloc(0)=(sampling[0]*ix+off[0]);//+convOrigin[0]; build 12-Sep-2018 15:30:24 - // igrdpos[0]=loc[0]+ix; build 12-Sep-2018 15:30:24 - // tiloc=iloc; build 12-Sep-2018 15:30:24 - // if (reindex(iloc,tiloc,sinDPA, cosDPA, convOrigin, cfShape)) build 12-Sep-2018 15:30:24 - // { build 12-Sep-2018 15:30:24 - // wt=getFrom4DArray((const Complex * __restrict__ &)convFuncV, build 12-Sep-2018 15:30:24 - // tiloc,cfInc_p); build 12-Sep-2018 15:30:24 - // if (dataWVal > 0.0) wt = conj(wt); build 12-Sep-2018 15:30:24 - // norm(apol)+=(wt); build 12-Sep-2018 15:30:24 - // if (finitePointingOffset) build 12-Sep-2018 15:30:24 - // { build 12-Sep-2018 15:30:24 - // wt *= (cached_phaseGrad_p(iloc[0]+phaseGradOrigin_l(0), iloc[1]+phaseGradOrigin_l(1))); build 12-Sep-2018 15:30:24 - // // ttt += (cached_phaseGrad_p(iloc[0]+phaseGradOrigin_l(0), iloc[1]+phaseGradOrigin_l(1))); build 12-Sep-2018 15:30:24 - // // cerr << "## " << (cached_phaseGrad_p(iloc[0]+phaseGradOrigin_l(0), iloc[1]+phaseGradOrigin_l(1))) << " " build 12-Sep-2018 15:30:24 - // // << iloc << " " << phaseGradOrigin_l << endl; build 12-Sep-2018 15:30:24 - // } build 12-Sep-2018 15:30:24 - // // nvalue+=wt*grid(grdpos); build 12-Sep-2018 15:30:24 - // // The following uses raw index on the 4D grid build 12-Sep-2018 15:30:24 - // // nvalue+=wt*getFrom4DArray(gridStore,iPosPtr,gridInc); build 12-Sep-2018 15:30:24 - // nvalue+=wt*getFrom4DArray(gridStore,igrdpos,gridInc_p); build 12-Sep-2018 15:30:24 - // } build 12-Sep-2018 15:30:24 - // } build 12-Sep-2018 15:30:24 - // } build 12-Sep-2018 15:30:24 - // //-------------------------------------------------------------------------------- build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - if (norm[ipol] != Complex(0.0)) visCube(ipol,ichan,irow)=nvalue/norm[ipol]; // Goes with FortranizedLoopsFromGrid.cc build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + if (norm[ipol] != Complex(0.0)) visCube(ipol,ichan,irow)=nvalue/norm[ipol]; // Goes with FortranizedLoopsFromGrid.cc build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - } build 12-Sep-2018 15:30:24 - } // End row-loop build 12-Sep-2018 15:30:24 -} build 12-Sep-2018 15:30:24 -// build 12-Sep-2018 15:30:24 -//----------------------------------------------------------------------------------- build 12-Sep-2018 15:30:24 -// build 12-Sep-2018 15:30:24 + } // End row-loop build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + // build 12-Sep-2018 15:30:24 + //----------------------------------------------------------------------------------- build 12-Sep-2018 15:30:24 + // build 12-Sep-2018 15:30:24 void AWVisResampler::sgrid(Vector& pos, Vector& loc, build 12-Sep-2018 15:30:24 Vector& off, Complex& phasor, build 12-Sep-2018 15:30:24 const Int& irow, const Matrix& uvw, build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines2/AWVisResampler.h b/code/synthesis/TransformMachines2/AWVisResampler.h build 12-Sep-2018 15:30:24 index 1c96281..ab328e9 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines2/AWVisResampler.h build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines2/AWVisResampler.h build 12-Sep-2018 15:30:24 @@ -267,6 +267,17 @@ namespace casa { //# NAMESPACE CASA - BEGIN build 12-Sep-2018 15:30:24 store[iPos[0] + iPos[1]*inc[1] + iPos[2]*inc[2] +iPos[3]*inc[3]] += (nvalue*wt); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 + template build 12-Sep-2018 15:30:24 + void addTo4DArray_ptr(T *__restrict__& store, build 12-Sep-2018 15:30:24 + const casacore::Int *__restrict__& iPos, build 12-Sep-2018 15:30:24 + const casacore::Int *__restrict__& inc, build 12-Sep-2018 15:30:24 + casacore::Complex& nvalue, casacore::Complex& wt) __restrict__ build 12-Sep-2018 15:30:24 + { build 12-Sep-2018 15:30:24 + // T *tmp=store+(iPos[0] + iPos[1]*inc[1] + iPos[2]*inc[2] +iPos[3]*inc[3]); build 12-Sep-2018 15:30:24 + // *tmp += nvalue*wt; build 12-Sep-2018 15:30:24 + store[iPos[0] + iPos[1]*inc[1] + iPos[2]*inc[2] +iPos[3]*inc[3]] += (nvalue*wt); build 12-Sep-2018 15:30:24 + } build 12-Sep-2018 15:30:24 + build 12-Sep-2018 15:30:24 // build 12-Sep-2018 15:30:24 // This rotates the convolution function by rotating the build 12-Sep-2018 15:30:24 // co-ordinate system. For the accuracies already required for build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines2/BeamSkyJones.cc b/code/synthesis/TransformMachines2/BeamSkyJones.cc build 12-Sep-2018 15:30:24 index 2b1b61c..7c039c5 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines2/BeamSkyJones.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines2/BeamSkyJones.cc build 12-Sep-2018 15:30:24 @@ -295,7 +295,7 @@ void BeamSkyJones::update(const vi::VisBuffer2& vb, Int row) build 12-Sep-2018 15:30:24 MDirection pointingDirection2 = vbutil_p->getPointingDir(vb, vb.antenna2()(row), row); build 12-Sep-2018 15:30:24 //cerr << "DIR1 " << pointingDirection1.toString() << " " << pointingDirection2.toString() << endl; build 12-Sep-2018 15:30:24 // Look up correct telescope build 12-Sep-2018 15:30:24 - const ROMSObservationColumns& msoc=ROMSColumns(vb.ms()).observation(); build 12-Sep-2018 15:30:24 + const ROMSObservationColumns& msoc=vb.subtableColumns().observation(); build 12-Sep-2018 15:30:24 telescope_p = msoc.telescopeName()(vb.arrayId()(0)); build 12-Sep-2018 15:30:24 build 12-Sep-2018 15:30:24 updatePBMathIndices(vb,row); // lastUpdateIndex?_p are now valid build 12-Sep-2018 15:30:24 @@ -724,14 +724,14 @@ MDirection BeamSkyJones::convertDir(const vi::VisBuffer2& vb, const MDirection& build 12-Sep-2018 15:30:24 MPosition pos; build 12-Sep-2018 15:30:24 String tel(""); build 12-Sep-2018 15:30:24 ROMSColumns msc(vb.ms()); build 12-Sep-2018 15:30:24 - if (msc.observation().nrow() > 0) { build 12-Sep-2018 15:30:24 - tel = msc.observation().telescopeName()(msc.observationId()(0)); build 12-Sep-2018 15:30:24 + if (vb.subtableColumns().observation().nrow() > 0) { build 12-Sep-2018 15:30:24 + tel = vb.subtableColumns().observation().telescopeName()(vb.observationId()(0)); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 if (tel.length() == 0 || !tel.contains("VLA") || build 12-Sep-2018 15:30:24 !MeasTable::Observatory(pos,tel)) { build 12-Sep-2018 15:30:24 // unknown observatory, use first antenna build 12-Sep-2018 15:30:24 Int ant1=vb.antenna1()(0); build 12-Sep-2018 15:30:24 - pos=msc.antenna().positionMeas()(ant1); build 12-Sep-2018 15:30:24 + pos=vb.subtableColumns().antenna().positionMeas()(ant1); build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 MEpoch::Types timeMType=MEpoch::castType(msc.timeMeas()(0).getRef().getType()); build 12-Sep-2018 15:30:24 Unit timeUnit=Unit(msc.timeMeas().measDesc().getUnits()(0).getName()); build 12-Sep-2018 15:30:24 diff --git a/code/synthesis/TransformMachines2/CFCache.cc b/code/synthesis/TransformMachines2/CFCache.cc build 12-Sep-2018 15:30:24 index 75d73ac..7491675 100644 build 12-Sep-2018 15:30:24 --- a/code/synthesis/TransformMachines2/CFCache.cc build 12-Sep-2018 15:30:24 +++ b/code/synthesis/TransformMachines2/CFCache.cc build 12-Sep-2018 15:30:24 @@ -158,9 +158,9 @@ namespace casa{ build 12-Sep-2018 15:30:24 memStore[0].getParams(pa, ant1, ant2, iPA, iBL); build 12-Sep-2018 15:30:24 log_l << pa.getValue("deg") << " "; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - log_l << LogIO::POST; build 12-Sep-2018 15:30:24 + log_l << LogIO::NORMAL1; build 12-Sep-2018 15:30:24 } build 12-Sep-2018 15:30:24 - log_l << message << LogIO::POST; build 12-Sep-2018 15:30:24 + log_l << message << LogIO::NORMAL1; build 12-Sep-2018 15:30:24 for(Int iBL=0; iBL::nearestNeighbour), build 12-Sep-2018 15:30:24 pointingDirCol_p("DIRECTION"), build 12-Sep-2018 15:30:24 cfStokes_p(), cfCache_p(), cfs_p(), cfwts_p(), cfs2_p(), cfwts2_p(), build 12-Sep-2018 15:30:24 canComputeResiduals_p(false), toVis_p(true), build 12-Sep-2018 15:30:24 - numthreads_p(-1), pbLimit_p(0.05),sj_p(0), cmplxImage_p( ), vbutil_p(), phaseCenterTime_p(-1.0), doneThreadPartition_p(False) build 12-Sep-2018 15:30:24 + numthreads_p(-1), pbLimit_p(0.05),sj_p(0), cmplxImage_p( ), vbutil_p(), phaseCenterTime_p(-1.0), doneThreadPartition_p(-1) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 spectralCoord_p=SpectralCoordinate(); build 12-Sep-2018 15:30:24 isPseudoI_p=false; build 12-Sep-2018 15:30:24 @@ -109,14 +109,14 @@ using namespace casa::vi; build 12-Sep-2018 15:30:24 FTMachine::FTMachine(CountedPtr& cfcache,CountedPtr& cf): build 12-Sep-2018 15:30:24 isDryRun(false), image(0), uvwMachine_p(0), build 12-Sep-2018 15:30:24 tangentSpecified_p(false), fixMovingSource_p(false), movingDirShift_p(0.0), build 12-Sep-2018 15:30:24 - distance_p(0.0), lastFieldId_p(-1),lastMSId_p(-1), build 12-Sep-2018 15:30:24 + distance_p(0.0), lastFieldId_p(-1),lastMSId_p(-1), romscol_p(nullptr), build 12-Sep-2018 15:30:24 useDoubleGrid_p(false), build 12-Sep-2018 15:30:24 freqFrameValid_p(false), build 12-Sep-2018 15:30:24 freqInterpMethod_p(InterpolateArray1D::nearestNeighbour), build 12-Sep-2018 15:30:24 pointingDirCol_p("DIRECTION"), build 12-Sep-2018 15:30:24 cfStokes_p(), cfCache_p(cfcache), cfs_p(), cfwts_p(), cfs2_p(), cfwts2_p(), build 12-Sep-2018 15:30:24 convFuncCtor_p(cf),canComputeResiduals_p(false), toVis_p(true), numthreads_p(-1), build 12-Sep-2018 15:30:24 - pbLimit_p(0.05),sj_p(0), cmplxImage_p( ), vbutil_p(), phaseCenterTime_p(-1.0), doneThreadPartition_p(False) build 12-Sep-2018 15:30:24 + pbLimit_p(0.05),sj_p(0), cmplxImage_p( ), vbutil_p(), phaseCenterTime_p(-1.0), doneThreadPartition_p(-1) build 12-Sep-2018 15:30:24 { build 12-Sep-2018 15:30:24 spectralCoord_p=SpectralCoordinate(); build 12-Sep-2018 15:30:24 isPseudoI_p=false; build 12-Sep-2018 15:30:24 @@ -137,7 +137,7 @@ using namespace casa::vi; build 12-Sep-2018 15:30:24 distance_p=other.distance_p; build 12-Sep-2018 15:30:24 lastFieldId_p=other.lastFieldId_p; build 12-Sep-2018 15:30:24 lastMSId_p=other.lastMSId_p; build 12-Sep-2018 15:30:24 - build 12-Sep-2018 15:30:24 + romscol_p=other.romscol_p; build 12-Sep-2018 15:30:24 tangentSpecified_p=other.tangentSpecified_p; build 12-Sep-2018 15:30:24 mTangent_p=other.mTangent_p; build 12-Sep-2018 15:30:24 mImage_p=other.mImage_p; build 12-Sep-2018 15:30:24 @@ -269,10 +269,11 @@ using namespace casa::vi; build 12-Sep-2018 15:30:24 // Set the frame for the UVWMachine build 12-Sep-2018 15:30:24 if(vb.isAttached()){ build 12-Sep-2018 15:30:24 //mFrame_p=MeasFrame(MEpoch(Quantity(vb.time()(0), "s"), ROMSColumns(vb.ms()).timeMeas()(0).getRef()), mLocation_p); build 12-Sep-2018 15:30:24 + romscol_p=new ROMSColumns(vb.ms()); build 12-Sep-2018 15:30:24 if(!mFrame_p.epoch()) build 12-Sep-2018 15:30:24 - mFrame_p.set(MEpoch(Quantity(vb.time()(0), "s"), ROMSColumns(vb.ms()).timeMeas()(0).getRef())); build 12-Sep-2018 15:30:24 + mFrame_p.set(MEpoch(Quantity(vb.time()(0), "s"), (romscol_p->timeMeas())(0).getRef())); build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 - mFrame_p.resetEpoch(MEpoch(Quantity(vb.time()(0), "s"), ROMSColumns(vb.ms()).timeMeas()(0).getRef())); build 12-Sep-2018 15:30:24 + mFrame_p.resetEpoch(MEpoch(Quantity(vb.time()(0), "s"), (romscol_p->timeMeas())(0).getRef())); build 12-Sep-2018 15:30:24 if(!mFrame_p.position()) build 12-Sep-2018 15:30:24 mFrame_p.set(mLocation_p); build 12-Sep-2018 15:30:24 else build 12-Sep-2018 15:30:24 @@ -355,7 +356,7 @@ using namespace casa::vi; build 12-Sep-2018 15:30:24 if(uvwMachine_p) delete uvwMachine_p; uvwMachine_p=0; build 12-Sep-2018 15:30:24 String observatory; build 12-Sep-2018 15:30:24 if(vb.isAttached()) build 12-Sep-2018 15:30:24 - observatory=ROMSColumns(vb.ms()).observation().telescopeName()(0); build 12-Sep-2018 15:30:25 + observatory=(vb.subtableColumns().observation()).telescopeName()(0); build 12-Sep-2018 15:30:25 else build 12-Sep-2018 15:30:25 throw(AipsError("Cannot define frame because of no access to OBSERVATION table")); build 12-Sep-2018 15:30:25 if(observatory.contains("ATCA") || observatory.contains("DRAO") build 12-Sep-2018 15:30:25 @@ -887,8 +888,8 @@ using namespace casa::vi; build 12-Sep-2018 15:30:25 //the uvw rotation is done for common tangent reprojection or if the build 12-Sep-2018 15:30:25 //image center is different from the phasecenter build 12-Sep-2018 15:30:25 // UVrotation is false only if field never changes build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ROMSColumns mscol(vb.ms()); build 12-Sep-2018 15:30:25 + if(lastMSId_p != vb.msId()) build 12-Sep-2018 15:30:25 + romscol_p=new ROMSColumns(vb.ms()); build 12-Sep-2018 15:30:25 if((vb.fieldId()(0)!=lastFieldId_p) || (vb.msId()!=lastMSId_p)){ build 12-Sep-2018 15:30:25 doUVWRotation_p=true; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 @@ -902,7 +903,7 @@ using namespace casa::vi; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 mFrame_p.epoch() != 0 ? build 12-Sep-2018 15:30:25 mFrame_p.resetEpoch(MEpoch(Quantity(vb.time()(0), "s"))): build 12-Sep-2018 15:30:25 - mFrame_p.set(mLocation_p, MEpoch(Quantity(vb.time()(0), "s"), mscol.timeMeas()(0).getRef())); build 12-Sep-2018 15:30:25 + mFrame_p.set(mLocation_p, MEpoch(Quantity(vb.time()(0), "s"), (romscol_p->timeMeas())(0).getRef())); build 12-Sep-2018 15:30:25 MDirection::Types outType; build 12-Sep-2018 15:30:25 MDirection::getType(outType, mImage_p.getRefString()); build 12-Sep-2018 15:30:25 MDirection phasecenter=MDirection::Convert(vbutil_p->getPhaseCenter(vb, phaseCenterTime_p), MDirection::Ref(outType, mFrame_p))(); build 12-Sep-2018 15:30:25 @@ -934,7 +935,7 @@ using namespace casa::vi; build 12-Sep-2018 15:30:25 // will reproject to that plane iso the image plane build 12-Sep-2018 15:30:25 if(doUVWRotation_p || fixMovingSource_p) { build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - String observatory=mscol.observation().telescopeName()(0); build 12-Sep-2018 15:30:25 + String observatory=(vb.subtableColumns().observation()).telescopeName()(0); build 12-Sep-2018 15:30:25 if(uvwMachine_p) delete uvwMachine_p; uvwMachine_p=0; build 12-Sep-2018 15:30:25 if(observatory.contains("ATCA") || observatory.contains("WSRT")){ build 12-Sep-2018 15:30:25 //Tangent specified is being wrongly used...it should be for a build 12-Sep-2018 15:30:25 @@ -1005,7 +1006,8 @@ using namespace casa::vi; build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + if(lastMSId_p != vb.msId()) build 12-Sep-2018 15:30:25 + romscol_p=new ROMSColumns(vb.ms()); build 12-Sep-2018 15:30:25 //the uvw rotation is done for common tangent reprojection or if the build 12-Sep-2018 15:30:25 //image center is different from the phasecenter build 12-Sep-2018 15:30:25 // UVrotation is false only if field never changes build 12-Sep-2018 15:30:25 @@ -1026,7 +1028,7 @@ using namespace casa::vi; build 12-Sep-2018 15:30:25 mFrame_p.epoch() != 0 ? build 12-Sep-2018 15:30:25 mFrame_p.resetEpoch(MEpoch(Quantity(vb.time()(0), "s"))): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - mFrame_p.set(mLocation_p, MEpoch(Quantity(vb.time()(0), "s"), ROMSColumns(vb.ms()).timeMeas()(0).getRef())); build 12-Sep-2018 15:30:25 + mFrame_p.set(mLocation_p, MEpoch(Quantity(vb.time()(0), "s"), (romscol_p->timeMeas())(0).getRef())); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 MDirection phasecenter=mImage_p; build 12-Sep-2018 15:30:25 if(fixMovingSource_p){ build 12-Sep-2018 15:30:25 @@ -1058,7 +1060,7 @@ using namespace casa::vi; build 12-Sep-2018 15:30:25 // will reproject to that plane iso the image plane build 12-Sep-2018 15:30:25 if(doUVWRotation_p || fixMovingSource_p) { build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - String observatory=ROMSColumns(vb.ms()).observation().telescopeName()(0); build 12-Sep-2018 15:30:25 + String observatory=(vb.subtableColumns().observation()).telescopeName()(0); build 12-Sep-2018 15:30:25 if(uvwMachine_p) delete uvwMachine_p; uvwMachine_p=0; build 12-Sep-2018 15:30:25 if(observatory.contains("ATCA") || observatory.contains("WSRT")){ build 12-Sep-2018 15:30:25 //Tangent specified is being wrongly used...it should be for a build 12-Sep-2018 15:30:25 @@ -1470,7 +1472,7 @@ using namespace casa::vi; build 12-Sep-2018 15:30:25 inRecord.get("phasecentertime", phaseCenterTime_p); build 12-Sep-2018 15:30:25 ///No need to store this...recalculate thread partion because environment build 12-Sep-2018 15:30:25 ///may have changed. build 12-Sep-2018 15:30:25 - doneThreadPartition_p=False; build 12-Sep-2018 15:30:25 + doneThreadPartition_p=-1; build 12-Sep-2018 15:30:25 return true; build 12-Sep-2018 15:30:25 }; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2350,18 +2352,23 @@ void FTMachine::findGridSector(const Int& nxp, const Int& nyp, const Int& ixsub, build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 Int elrow=icounter/ixsub; build 12-Sep-2018 15:30:25 Int elcol=(icounter-elrow*ixsub); build 12-Sep-2018 15:30:25 - //cerr << "row "<< elrow << " col " << elcol; build 12-Sep-2018 15:30:25 + //cerr << "row "<< elrow << " col " << elcol << endl; build 12-Sep-2018 15:30:25 //nxsub=Int(floor(((ceil(fabs(float(2*elcol+1-ixsub)/2.0))-1.0)*5 +1)*nxp/36.0 + 0.5)); build 12-Sep-2018 15:30:25 Float factor=0; build 12-Sep-2018 15:30:25 - for (Int k=0; k < ixsub/2; ++k) build 12-Sep-2018 15:30:25 - factor= linear ? factor+(k+1): factor+sqrt(Float(k+1)); build 12-Sep-2018 15:30:25 + if(ixsub > 1){ build 12-Sep-2018 15:30:25 + for (Int k=0; k < ixsub/2; ++k) build 12-Sep-2018 15:30:25 + factor= linear ? factor+(k+1): factor+sqrt(Float(k+1)); build 12-Sep-2018 15:30:25 //factor= linear ? factor+(k+1): factor+(k+1)*(k+1)*(k+1); build 12-Sep-2018 15:30:25 - factor *= 2.0; build 12-Sep-2018 15:30:25 - if(linear) build 12-Sep-2018 15:30:25 - nxsub=Int(floor((ceil(fabs(float(2*elcol+1-ixsub)/2.0))/factor)*nxp + 0.5)); build 12-Sep-2018 15:30:25 - else build 12-Sep-2018 15:30:25 - //nxsub=Int(floor((ceil(fabs(float(2*elcol+1-ixsub)/2.0))*ceil(fabs(float(2*elcol+1-ixsub)/2.0))*ceil(fabs(float(2*elcol+1-ixsub)/2.0))/factor)*nxp + 0.5)); build 12-Sep-2018 15:30:25 - nxsub=Int(floor((sqrt(ceil(fabs(float(2*elcol+1-ixsub)/2.0)))/factor)*nxp + 0.5)); build 12-Sep-2018 15:30:25 + factor *= 2.0; build 12-Sep-2018 15:30:25 + if(linear) build 12-Sep-2018 15:30:25 + nxsub=Int(floor((ceil(fabs(float(2*elcol+1-ixsub)/2.0))/factor)*nxp + 0.5)); build 12-Sep-2018 15:30:25 + else build 12-Sep-2018 15:30:25 + //nxsub=Int(floor((ceil(fabs(float(2*elcol+1-ixsub)/2.0))*ceil(fabs(float(2*elcol+1-ixsub)/2.0))*ceil(fabs(float(2*elcol+1-ixsub)/2.0))/factor)*nxp + 0.5)); build 12-Sep-2018 15:30:25 + nxsub=Int(floor((sqrt(ceil(fabs(float(2*elcol+1-ixsub)/2.0)))/factor)*nxp + 0.5)); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else{ build 12-Sep-2018 15:30:25 + nxsub=nxp; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 //cerr << nxp << " col " << elcol << " nxsub " << nxsub << endl; build 12-Sep-2018 15:30:25 x0=minx; build 12-Sep-2018 15:30:25 elcol-=1; build 12-Sep-2018 15:30:25 @@ -2376,15 +2383,20 @@ void FTMachine::findGridSector(const Int& nxp, const Int& nyp, const Int& ixsub, build 12-Sep-2018 15:30:25 elcol-=1; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 factor=0; build 12-Sep-2018 15:30:25 - for (Int k=0; k < iysub/2; ++k) build 12-Sep-2018 15:30:25 - //factor=linear ? factor+(k+1): factor+(k+1)*(k+1)*(k+1); build 12-Sep-2018 15:30:25 - factor= linear ? factor+(k+1): factor+sqrt(Float(k+1)); build 12-Sep-2018 15:30:25 - factor *= 2.0; build 12-Sep-2018 15:30:25 - //nysub=Int(floor(((ceil(fabs(float(2*elrow+1-iysub)/2.0))-1.0)*5 +1)*nyp/36.0+0.5)); build 12-Sep-2018 15:30:25 - if(linear) build 12-Sep-2018 15:30:25 - nysub=Int(floor((ceil(fabs(float(2*elrow+1-iysub)/2.0))/factor)*nyp + 0.5)); build 12-Sep-2018 15:30:25 - else build 12-Sep-2018 15:30:25 - nysub=Int(floor((sqrt(ceil(fabs(float(2*elrow+1-iysub)/2.0)))/factor)*nyp + 0.5)); build 12-Sep-2018 15:30:25 + if(iysub >1){ build 12-Sep-2018 15:30:25 + for (Int k=0; k < iysub/2; ++k) build 12-Sep-2018 15:30:25 + //factor=linear ? factor+(k+1): factor+(k+1)*(k+1)*(k+1); build 12-Sep-2018 15:30:25 + factor= linear ? factor+(k+1): factor+sqrt(Float(k+1)); build 12-Sep-2018 15:30:25 + factor *= 2.0; build 12-Sep-2018 15:30:25 + //nysub=Int(floor(((ceil(fabs(float(2*elrow+1-iysub)/2.0))-1.0)*5 +1)*nyp/36.0+0.5)); build 12-Sep-2018 15:30:25 + if(linear) build 12-Sep-2018 15:30:25 + nysub=Int(floor((ceil(fabs(float(2*elrow+1-iysub)/2.0))/factor)*nyp + 0.5)); build 12-Sep-2018 15:30:25 + else build 12-Sep-2018 15:30:25 + nysub=Int(floor((sqrt(ceil(fabs(float(2*elrow+1-iysub)/2.0)))/factor)*nyp + 0.5)); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else{ build 12-Sep-2018 15:30:25 + nysub=nyp; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 //nysub=Int(floor((ceil(fabs(float(2*elrow+1-iysub)/2.0))*ceil(fabs(float(2*elrow+1-iysub)/2.0))*ceil(fabs(float(2*elrow+1-iysub)/2.0))/factor)*nyp + 0.5)); build 12-Sep-2018 15:30:25 y0=miny; build 12-Sep-2018 15:30:25 elrow-=1; build 12-Sep-2018 15:30:25 @@ -2403,13 +2415,15 @@ void FTMachine::findGridSector(const Int& nxp, const Int& nyp, const Int& ixsub, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 y0+=1; build 12-Sep-2018 15:30:25 x0+=1; build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + //cerr << icounter << " x0, y0 " << x0 << " " << y0 << " ixsub, iysub " << nxsub << " " << nysub << endl; build 12-Sep-2018 15:30:25 + if(doneThreadPartition_p < 0) build 12-Sep-2018 15:30:25 + doneThreadPartition_p=1; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 void FTMachine::tweakGridSector(const Int& nx, const Int& ny, const Int& ixsub, const Int& iysub){ build 12-Sep-2018 15:30:25 - if(doneThreadPartition_p) build 12-Sep-2018 15:30:25 - return; build 12-Sep-2018 15:30:25 + //if(doneThreadPartition_p) build 12-Sep-2018 15:30:25 + // return; build 12-Sep-2018 15:30:25 Vector x0, y0, nxsub, nysub; build 12-Sep-2018 15:30:25 Vector xcut(nx/2); build 12-Sep-2018 15:30:25 Vector ycut(ny/2); build 12-Sep-2018 15:30:25 @@ -2491,7 +2505,8 @@ void FTMachine::findGridSector(const Int& nxp, const Int& nyp, const Int& ixsub, build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 nysub(iysub-1)+=1; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + if(anyEQ(nxsub, 0) || anyEQ(nysub, 0)) build 12-Sep-2018 15:30:25 + return; build 12-Sep-2018 15:30:25 //cerr << " x0 " << x0 << " nxsub " << nxsub << endl; build 12-Sep-2018 15:30:25 //cerr << " y0 " << y0 << " nysub " << nysub << endl; build 12-Sep-2018 15:30:25 x0+=1; build 12-Sep-2018 15:30:25 @@ -2510,7 +2525,7 @@ void FTMachine::findGridSector(const Int& nxp, const Int& nyp, const Int& ixsub, build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + ++doneThreadPartition_p; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/FTMachine.h b/code/synthesis/TransformMachines2/FTMachine.h build 12-Sep-2018 15:30:25 index 202a5da..7bacf9d 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/FTMachine.h build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/FTMachine.h build 12-Sep-2018 15:30:25 @@ -409,6 +409,7 @@ protected: build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 casacore::Int lastFieldId_p; build 12-Sep-2018 15:30:25 casacore::Int lastMSId_p; build 12-Sep-2018 15:30:25 + casacore::CountedPtr romscol_p; build 12-Sep-2018 15:30:25 //Use douple precision grid in gridding process build 12-Sep-2018 15:30:25 casacore::Bool useDoubleGrid_p; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -517,7 +518,7 @@ protected: build 12-Sep-2018 15:30:25 casacore::CountedPtr vbutil_p; build 12-Sep-2018 15:30:25 casacore::Double phaseCenterTime_p; build 12-Sep-2018 15:30:25 ///Some parameters and helpers for multithreaded gridders build 12-Sep-2018 15:30:25 - casacore::Bool doneThreadPartition_p; build 12-Sep-2018 15:30:25 + casacore::Int doneThreadPartition_p; build 12-Sep-2018 15:30:25 casacore::Vector xsect_p, ysect_p, nxsect_p, nysect_p; build 12-Sep-2018 15:30:25 virtual void findGridSector(const casacore::Int& nxp, const casacore::Int& nyp, const casacore::Int& ixsub, const casacore::Int& iysub, const casacore::Int& minx, const casacore::Int& miny, const casacore::Int& icounter, casacore::Int& x0, casacore::Int& y0, casacore::Int& nxsub, casacore::Int& nysub, const casacore::Bool linear); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/FortranizedLoopsFromGrid.cc b/code/synthesis/TransformMachines2/FortranizedLoopsFromGrid.cc build 12-Sep-2018 15:30:25 index a83bfbb..fa08283 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/FortranizedLoopsFromGrid.cc build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/FortranizedLoopsFromGrid.cc build 12-Sep-2018 15:30:25 @@ -35,6 +35,7 @@ build 12-Sep-2018 15:30:25 Float *samplingPtr; build 12-Sep-2018 15:30:25 Double *offPtr; build 12-Sep-2018 15:30:25 Bool dummy; build 12-Sep-2018 15:30:25 + Double sinDPA=0.0, cosDPA=1.0; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 gridPtr = grid.getStorage(dummy); build 12-Sep-2018 15:30:25 phaseGradPtr = cached_phaseGrad_p.getStorage(dummy); build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/FortranizedLoopsToGrid.cc b/code/synthesis/TransformMachines2/FortranizedLoopsToGrid.cc build 12-Sep-2018 15:30:25 index fe37ae6..45f5e2e 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/FortranizedLoopsToGrid.cc build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/FortranizedLoopsToGrid.cc build 12-Sep-2018 15:30:25 @@ -32,11 +32,13 @@ build 12-Sep-2018 15:30:25 // T *gridPtr; build 12-Sep-2018 15:30:25 Complex *cfPtr, *phaseGradPtr,typeComplex; build 12-Sep-2018 15:30:25 Int *supportPtr, *cfShapePtr, build 12-Sep-2018 15:30:25 - *locPtr, *igrdposPtr, *ilocPtr, *tilocPtr, build 12-Sep-2018 15:30:25 + *locPtr, *igrdposPtr, *ilocPtr, //*tilocPtr, build 12-Sep-2018 15:30:25 *convOriginPtr; build 12-Sep-2018 15:30:25 Float *samplingPtr; build 12-Sep-2018 15:30:25 Double *offPtr; build 12-Sep-2018 15:30:25 Bool dummy; build 12-Sep-2018 15:30:25 + Double sinDPA=0.0, cosDPA=1.0; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 // gridPtr = grid.getStorage(dummy); build 12-Sep-2018 15:30:25 cfPtr = convFuncV; build 12-Sep-2018 15:30:25 phaseGradPtr = cached_phaseGrad_p.getStorage(dummy); build 12-Sep-2018 15:30:25 @@ -46,12 +48,12 @@ build 12-Sep-2018 15:30:25 locPtr = loc.getStorage(dummy); build 12-Sep-2018 15:30:25 igrdposPtr = igrdpos.getStorage(dummy); build 12-Sep-2018 15:30:25 ilocPtr = iloc.getStorage(dummy); build 12-Sep-2018 15:30:25 - tilocPtr = tiloc.getStorage(dummy); build 12-Sep-2018 15:30:25 + //tilocPtr = tiloc.getStorage(dummy); build 12-Sep-2018 15:30:25 offPtr = off.getStorage(dummy); build 12-Sep-2018 15:30:25 convOriginPtr = convOrigin.getStorage(dummy); build 12-Sep-2018 15:30:25 (void)cfPtr; build 12-Sep-2018 15:30:25 (void)ilocPtr; build 12-Sep-2018 15:30:25 - (void)tilocPtr; build 12-Sep-2018 15:30:25 + //(void)tilocPtr; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Int finitePointingOffsets_int = (finitePointingOffsets?1:0), build 12-Sep-2018 15:30:25 psfOnly_int = (psfOnly?1:0); build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/GridFT.cc b/code/synthesis/TransformMachines2/GridFT.cc build 12-Sep-2018 15:30:25 index d2edbac..4260fb1 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/GridFT.cc build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/GridFT.cc build 12-Sep-2018 15:30:25 @@ -785,7 +785,7 @@ void GridFT::put(const vi::VisBuffer2& vb, Int row, Bool dopsf, build 12-Sep-2018 15:30:25 else{ build 12-Sep-2018 15:30:25 nth= omp_get_max_threads(); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - nth=min(4,nth); build 12-Sep-2018 15:30:25 + //nth=min(4,nth); build 12-Sep-2018 15:30:25 #endif build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -816,7 +816,7 @@ void GridFT::put(const vi::VisBuffer2& vb, Int row, Bool dopsf, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 /////////////Some extra stuff for openmp build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Int x0, y0, nxsub, nysub, ixsub, iysub, icounter, ix, iy; build 12-Sep-2018 15:30:25 + Int ixsub, iysub, icounter; build 12-Sep-2018 15:30:25 Int csupp=convSupport_p; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 const Double * convfuncstor=(convFunc_p).getStorage(del); build 12-Sep-2018 15:30:25 @@ -827,19 +827,16 @@ void GridFT::put(const vi::VisBuffer2& vb, Int row, Bool dopsf, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ixsub=1; build 12-Sep-2018 15:30:25 iysub=1; build 12-Sep-2018 15:30:25 - if (nth >3){ build 12-Sep-2018 15:30:25 - ixsub=2; build 12-Sep-2018 15:30:25 - iysub=2; build 12-Sep-2018 15:30:25 + if (nth >4){ build 12-Sep-2018 15:30:25 + ixsub=16; build 12-Sep-2018 15:30:25 + iysub=16; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - else if(nth >1){ build 12-Sep-2018 15:30:25 + else if(nth >1) { build 12-Sep-2018 15:30:25 ixsub=2; build 12-Sep-2018 15:30:25 - iysub=1; build 12-Sep-2018 15:30:25 + iysub=2; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - x0=1; build 12-Sep-2018 15:30:25 - y0=1; build 12-Sep-2018 15:30:25 - nxsub=nx; build 12-Sep-2018 15:30:25 - nysub=ny; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Int rbeg=startRow+1; build 12-Sep-2018 15:30:25 Int rend=endRow+1; build 12-Sep-2018 15:30:25 Block > sumwgt(ixsub*iysub); build 12-Sep-2018 15:30:25 @@ -847,6 +844,17 @@ void GridFT::put(const vi::VisBuffer2& vb, Int row, Bool dopsf, build 12-Sep-2018 15:30:25 sumwgt[icounter].resize(sumWeight.shape()); build 12-Sep-2018 15:30:25 sumwgt[icounter].set(0.0); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + if(doneThreadPartition_p < 0){ build 12-Sep-2018 15:30:25 + xsect_p.resize(ixsub*iysub); build 12-Sep-2018 15:30:25 + ysect_p.resize(ixsub*iysub); build 12-Sep-2018 15:30:25 + nxsect_p.resize(ixsub*iysub); build 12-Sep-2018 15:30:25 + nysect_p.resize(ixsub*iysub); build 12-Sep-2018 15:30:25 + for (icounter=0; icounter < ixsub*iysub; ++icounter){ build 12-Sep-2018 15:30:25 + findGridSector(nx, ny, ixsub, iysub, 0, 0, icounter, xsect_p(icounter), ysect_p(icounter), nxsect_p(icounter), nysect_p(icounter), true); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + Vector xsect, ysect, nxsect, nysect; build 12-Sep-2018 15:30:25 + xsect=xsect_p; ysect=ysect_p; nxsect=nxsect_p; nysect=nysect_p; build 12-Sep-2018 15:30:25 const Int* pmapstor=polMap.getStorage(del); build 12-Sep-2018 15:30:25 const Int *cmapstor=chanMap.getStorage(del); build 12-Sep-2018 15:30:25 Int nc=nchan; build 12-Sep-2018 15:30:25 @@ -860,25 +868,18 @@ void GridFT::put(const vi::VisBuffer2& vb, Int row, Bool dopsf, build 12-Sep-2018 15:30:25 Bool gridcopy; build 12-Sep-2018 15:30:25 if(useDoubleGrid_p){ build 12-Sep-2018 15:30:25 DComplex *gridstor=griddedData2.getStorage(gridcopy); build 12-Sep-2018 15:30:25 -#pragma omp parallel default(none) private(icounter,ix,iy,x0,y0,nxsub,nysub, del) firstprivate(idopsf, datStorage, wgtStorage, flagstor, rowflagstor, convfuncstor, pmapstor, cmapstor, gridstor, nxp, nyp, np, nc,ixsub, iysub, rend, rbeg, csamp, csupp, nvispol, nvischan, nvisrow, phasorstor, locstor, offstor) shared(sumwgt) num_threads(ixsub*iysub) build 12-Sep-2018 15:30:25 +#pragma omp parallel default(none) private(icounter, del) firstprivate(idopsf, datStorage, wgtStorage, flagstor, rowflagstor, convfuncstor, pmapstor, cmapstor, gridstor, nxp, nyp, np, nc,ixsub, iysub, rend, rbeg, csamp, csupp, nvispol, nvischan, nvisrow, phasorstor, locstor, offstor, xsect, ysect, nxsect, nysect) shared(sumwgt) num_threads(nth) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 //cerr << "numthreads " << omp_get_num_threads() << endl; build 12-Sep-2018 15:30:25 #pragma omp for build 12-Sep-2018 15:30:25 for(icounter=0; icounter < ixsub*iysub; ++icounter){ build 12-Sep-2018 15:30:25 //cerr << "thread id " << omp_get_thread_num() << endl; build 12-Sep-2018 15:30:25 - ix= (icounter+1)-((icounter)/ixsub)*ixsub; build 12-Sep-2018 15:30:25 - iy=(icounter)/ixsub+1; build 12-Sep-2018 15:30:25 - y0=(nyp/iysub)*(iy-1)+1; build 12-Sep-2018 15:30:25 - nysub=nyp/iysub; build 12-Sep-2018 15:30:25 - if( iy == iysub) { build 12-Sep-2018 15:30:25 - nysub=nyp-(nyp/iysub)*(iy-1); build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - x0=(nxp/ixsub)*(ix-1)+1; build 12-Sep-2018 15:30:25 - nxsub=nxp/ixsub; build 12-Sep-2018 15:30:25 - if( ix == ixsub){ build 12-Sep-2018 15:30:25 - nxsub=nxp-(nxp/ixsub)*(ix-1); build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 + Int x0=xsect(icounter); build 12-Sep-2018 15:30:25 + Int y0=ysect(icounter); build 12-Sep-2018 15:30:25 + Int nxsub=nxsect(icounter); build 12-Sep-2018 15:30:25 + Int nysub=nysect(icounter); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 sectggridd(datStorage, build 12-Sep-2018 15:30:25 &nvispol, build 12-Sep-2018 15:30:25 &nvischan, build 12-Sep-2018 15:30:25 @@ -907,28 +908,25 @@ void GridFT::put(const vi::VisBuffer2& vb, Int row, Bool dopsf, build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 //phasor.putStorage(phasorstor, delphase); build 12-Sep-2018 15:30:25 griddedData2.putStorage(gridstor, gridcopy); build 12-Sep-2018 15:30:25 + if(dopsf && (nth >4)) build 12-Sep-2018 15:30:25 + tweakGridSector(nx, ny, ixsub, iysub); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 else{ build 12-Sep-2018 15:30:25 Complex *gridstor=griddedData.getStorage(gridcopy); build 12-Sep-2018 15:30:25 -#pragma omp parallel default(none) private(icounter,ix,iy,x0,y0,nxsub,nysub, del) firstprivate(idopsf, datStorage, wgtStorage, flagstor, rowflagstor, convfuncstor, pmapstor, cmapstor, gridstor, nxp, nyp, np, nc,ixsub, iysub, rend, rbeg, csamp, csupp, nvispol, nvischan, nvisrow, phasorstor, locstor, offstor) shared(sumwgt) num_threads(ixsub*iysub) build 12-Sep-2018 15:30:25 +#pragma omp parallel default(none) private(icounter, del) firstprivate(idopsf, datStorage, wgtStorage, flagstor, rowflagstor, convfuncstor, pmapstor, cmapstor, gridstor, nxp, nyp, np, nc,ixsub, iysub, rend, rbeg, csamp, csupp, nvispol, nvischan, nvisrow, phasorstor, locstor, offstor, xsect, ysect, nxsect, nysect) shared(sumwgt) num_threads(ixsub*iysub) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 //cerr << "numthreads " << omp_get_num_threads() << endl; build 12-Sep-2018 15:30:25 #pragma omp for build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 for(icounter=0; icounter < ixsub*iysub; ++icounter){ build 12-Sep-2018 15:30:25 //cerr << "thread id " << omp_get_thread_num() << endl; build 12-Sep-2018 15:30:25 - ix= (icounter+1)-((icounter)/ixsub)*ixsub; build 12-Sep-2018 15:30:25 - iy=(icounter)/ixsub+1; build 12-Sep-2018 15:30:25 - y0=(nyp/iysub)*(iy-1)+1; build 12-Sep-2018 15:30:25 - nysub=nyp/iysub; build 12-Sep-2018 15:30:25 - if( iy == iysub) { build 12-Sep-2018 15:30:25 - nysub=nyp-(nyp/iysub)*(iy-1); build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - x0=(nxp/ixsub)*(ix-1)+1; build 12-Sep-2018 15:30:25 - nxsub=nxp/ixsub; build 12-Sep-2018 15:30:25 - if( ix == ixsub){ build 12-Sep-2018 15:30:25 - nxsub=nxp-(nxp/ixsub)*(ix-1); build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 + Int x0=xsect(icounter); build 12-Sep-2018 15:30:25 + Int y0=ysect(icounter); build 12-Sep-2018 15:30:25 + Int nxsub=nxsect(icounter); build 12-Sep-2018 15:30:25 + Int nysub=nysect(icounter); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 //cerr << "x0 " << x0 << " y0 " << y0 << " nxsub " << nxsub << " nysub " << nysub << endl; build 12-Sep-2018 15:30:25 sectggrids(datStorage, build 12-Sep-2018 15:30:25 &nvispol, build 12-Sep-2018 15:30:25 @@ -958,6 +956,8 @@ void GridFT::put(const vi::VisBuffer2& vb, Int row, Bool dopsf, build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 griddedData.putStorage(gridstor, gridcopy); build 12-Sep-2018 15:30:25 + if(dopsf && (nth > 4)) build 12-Sep-2018 15:30:25 + tweakGridSector(nx, ny, ixsub, iysub); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 // cerr << "sunweight " << sumWeight << endl; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1073,7 +1073,7 @@ void GridFT::get(vi::VisBuffer2& vb, Int row) build 12-Sep-2018 15:30:25 else{ build 12-Sep-2018 15:30:25 nth= omp_get_max_threads(); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - nth=min(4,nth); build 12-Sep-2018 15:30:25 + //nth=min(4,nth); build 12-Sep-2018 15:30:25 #endif build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1124,13 +1124,8 @@ void GridFT::get(vi::VisBuffer2& vb, Int row) build 12-Sep-2018 15:30:25 const Int * rowflagstor=rowFlags.getStorage(del); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Int npart=1; build 12-Sep-2018 15:30:25 - if (nth >3){ build 12-Sep-2018 15:30:25 - npart=4; build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - else if(nth >1){ build 12-Sep-2018 15:30:25 - npart=2; build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 + Int npart=nth*2; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Int ix=0; build 12-Sep-2018 15:30:25 #pragma omp parallel default(none) private(ix, rbeg, rend) firstprivate(datStorage, flagstor, rowflagstor, convfuncstor, pmapstor, cmapstor, gridstor, nxp, nyp, np, nc, csamp, csupp, nvp, nvc, nvisrow, phasorstor, locstor, offstor) shared(npart) num_threads(npart) build 12-Sep-2018 15:30:25 @@ -1220,6 +1215,8 @@ ImageInterface& GridFT::getImage(Matrix& weights, Bool normalize build 12-Sep-2018 15:30:25 griddedData.resize(griddedData2.shape()); build 12-Sep-2018 15:30:25 convertArray(griddedData, griddedData2); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + SynthesisUtilMethods::getResource("mem peak in getImage"); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 //Don't need the double-prec grid anymore... build 12-Sep-2018 15:30:25 griddedData2.resize(); build 12-Sep-2018 15:30:25 arrayLattice.reset( new ArrayLattice(griddedData) ); build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/HetArrayConvFunc.cc b/code/synthesis/TransformMachines2/HetArrayConvFunc.cc build 12-Sep-2018 15:30:25 index d648a6c..cd5e38a 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/HetArrayConvFunc.cc build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/HetArrayConvFunc.cc build 12-Sep-2018 15:30:25 @@ -88,7 +88,7 @@ using namespace casacore; build 12-Sep-2018 15:30:25 using namespace casa::refim; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -HetArrayConvFunc::HetArrayConvFunc() : convFunctionMap_p(0), nDefined_p(0), antDiam2IndexMap_p(-1),msId_p(-1), actualConvIndex_p(-1) build 12-Sep-2018 15:30:25 + HetArrayConvFunc::HetArrayConvFunc() : convFunctionMap_p(0), nDefined_p(0), antDiam2IndexMap_p(-1),msId_p(-1), actualConvIndex_p(-1), vpTable_p("") build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 calcFluxScale_p=true; build 12-Sep-2018 15:30:25 init(PBMathInterface::AIRY); build 12-Sep-2018 15:30:25 @@ -121,23 +121,23 @@ void HetArrayConvFunc::init(const PBMathInterface::PBClass typeTouse) { build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 void HetArrayConvFunc::findAntennaSizes(const vi::VisBuffer2& vb) { build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - if(msId_p != vb.msId()) { build 12-Sep-2018 15:30:25 + if(msId_p != vb.msId()) { build 12-Sep-2018 15:30:25 msId_p=vb.msId(); build 12-Sep-2018 15:30:25 - ROMSColumns mscol(vb.ms()); build 12-Sep-2018 15:30:25 - const ROMSAntennaColumns& ac=mscol.antenna(); build 12-Sep-2018 15:30:25 + //ROMSColumns mscol(vb.ms()); build 12-Sep-2018 15:30:25 + const ROMSAntennaColumns& ac=vb.subtableColumns().antenna(); build 12-Sep-2018 15:30:25 antIndexToDiamIndex_p.resize(ac.nrow()); build 12-Sep-2018 15:30:25 antIndexToDiamIndex_p.set(-1); build 12-Sep-2018 15:30:25 Int diamIndex=antDiam2IndexMap_p.ndefined(); build 12-Sep-2018 15:30:25 Vector dishDiam=ac.dishDiameter().getColumn(); build 12-Sep-2018 15:30:25 VectordishName=ac.name().getColumn(); build 12-Sep-2018 15:30:25 - String telescop=mscol.observation().telescopeName()(0); build 12-Sep-2018 15:30:25 + String telescop=vb.subtableColumns().observation().telescopeName()(0); build 12-Sep-2018 15:30:25 PBMath::CommonPB whichPB; build 12-Sep-2018 15:30:25 if(pbClass_p==PBMathInterface::COMMONPB) { build 12-Sep-2018 15:30:25 String band; build 12-Sep-2018 15:30:25 String commonPBName; build 12-Sep-2018 15:30:25 // This frequency is ONLY required to determine which PB model to use: build 12-Sep-2018 15:30:25 // The VLA, the ATNF, and WSRT have frequency - dependent PB models build 12-Sep-2018 15:30:25 - Quantity freq( mscol.spectralWindow().refFrequency()(0), "Hz"); build 12-Sep-2018 15:30:25 + Quantity freq( vb.subtableColumns().spectralWindow().refFrequency()(0), "Hz"); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 PBMath::whichCommonPBtoUse( telescop, freq, band, whichPB, commonPBName ); build 12-Sep-2018 15:30:25 @@ -165,7 +165,7 @@ void HetArrayConvFunc::findAntennaSizes(const vi::VisBuffer2& vb) { build 12-Sep-2018 15:30:25 Quantity blockDiam= Quantity(dishDiam(k)/12.0*.75, "m"); build 12-Sep-2018 15:30:25 ///For ALMA 12m dish it is effectively 10.7 m according to Todd Hunter build 12-Sep-2018 15:30:25 ///@ 2011-12-06 build 12-Sep-2018 15:30:25 - if((mscol.observation().telescopeName()(0) =="ALMA") || (mscol.observation().telescopeName()(0) =="ACA")){ build 12-Sep-2018 15:30:25 + if((vb.subtableColumns().observation().telescopeName()(0) =="ALMA") || (vb.subtableColumns().observation().telescopeName()(0) =="ACA")){ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 if((abs(dishDiam[k] - 12.0) < 0.5)) { build 12-Sep-2018 15:30:25 qdiam= Quantity(10.7, "m"); build 12-Sep-2018 15:30:25 @@ -296,6 +296,25 @@ void HetArrayConvFunc::findAntennaSizes(const vi::VisBuffer2& vb) { build 12-Sep-2018 15:30:25 //Get rid of the static class build 12-Sep-2018 15:30:25 vpman->reset(); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + else if(vpTable_p != String("")){ build 12-Sep-2018 15:30:25 + ////When we get vpmanager to give beams on antenna name we build 12-Sep-2018 15:30:25 + //should change this key to antenna name and loop over all antenna names build 12-Sep-2018 15:30:25 + if((diamIndex !=0) && antDiam2IndexMap_p.isDefined(telescop+String("_")+String::toString(dishDiam(0)))) { build 12-Sep-2018 15:30:25 + antIndexToDiamIndex_p.set(antDiam2IndexMap_p(telescop+String("_")+String::toString(dishDiam(0)))); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else{ build 12-Sep-2018 15:30:25 + antDiam2IndexMap_p.define(telescop+"_"+String::toString(dishDiam(0)), diamIndex); build 12-Sep-2018 15:30:25 + antIndexToDiamIndex_p.set(diamIndex); build 12-Sep-2018 15:30:25 + VPManager *vpman=VPManager::Instance(); build 12-Sep-2018 15:30:25 + vpman->loadfromtable(vpTable_p); build 12-Sep-2018 15:30:25 + Record rec; build 12-Sep-2018 15:30:25 + vpman->getvp(rec, telescop); build 12-Sep-2018 15:30:25 + antMath_p.resize(diamIndex+1); build 12-Sep-2018 15:30:25 + antMath_p[diamIndex]=PBMath::pbMathInterfaceFromRecord(rec); build 12-Sep-2018 15:30:25 + vpman->reset(); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 else if(pbClass_p==PBMathInterface::COMMONPB) { build 12-Sep-2018 15:30:25 //cerr << "Doing the commonPB thing" << endl; build 12-Sep-2018 15:30:25 ///Have to use telescop part as string as in multims case different build 12-Sep-2018 15:30:25 @@ -310,10 +329,6 @@ void HetArrayConvFunc::findAntennaSizes(const vi::VisBuffer2& vb) { build 12-Sep-2018 15:30:25 antMath_p.resize(diamIndex+1); build 12-Sep-2018 15:30:25 antMath_p[diamIndex]=PBMath::pbMathInterfaceForCommonPB(whichPB, True); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 else { build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -463,11 +478,14 @@ void HetArrayConvFunc::findConvFunction(const ImageInterface& iimage, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 if(!doneMainConv_p[actualConvIndex_p]) { build 12-Sep-2018 15:30:25 + //cerr << "doneMainConv_p " << actualConvIndex_p << endl; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Vector sampling; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 sampling = dc.increment(); build 12-Sep-2018 15:30:25 - sampling*=Double(convSampling); build 12-Sep-2018 15:30:25 - sampling(0)*=Double(nx)/Double(convSize_p); build 12-Sep-2018 15:30:25 - sampling(1)*=Double(ny)/Double(convSize_p); build 12-Sep-2018 15:30:25 + sampling*=Double(convSampling); build 12-Sep-2018 15:30:25 + sampling(0)*=Double(nx)/Double(convSize_p); build 12-Sep-2018 15:30:25 + sampling(1)*=Double(ny)/Double(convSize_p); build 12-Sep-2018 15:30:25 dc.setIncrement(sampling); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Vector unitVec(2); build 12-Sep-2018 15:30:25 @@ -483,15 +501,24 @@ void HetArrayConvFunc::findConvFunction(const ImageInterface& iimage, build 12-Sep-2018 15:30:25 spCoord.setReferenceValue(Vector(1, beamFreqs(0))); build 12-Sep-2018 15:30:25 if(beamFreqs.nelements() >1) build 12-Sep-2018 15:30:25 spCoord.setIncrement(Vector(1, beamFreqs(1)-beamFreqs(0))); build 12-Sep-2018 15:30:25 + //cerr << "spcoord " ; build 12-Sep-2018 15:30:25 + //spCoord.print(std::cerr); build 12-Sep-2018 15:30:25 coords.replaceCoordinate(spCoord, spind); build 12-Sep-2018 15:30:25 CoordinateSystem conjCoord=coords; build 12-Sep-2018 15:30:25 Double centerFreq=SpectralImageUtil::worldFreq(csys_p, 0.0); build 12-Sep-2018 15:30:25 SpectralCoordinate conjSpCoord=spCoord; build 12-Sep-2018 15:30:25 //cerr << "centreFreq " << centerFreq << " beamFreqs " << beamFreqs(0) << " " << beamFreqs(1) << endl; build 12-Sep-2018 15:30:25 - conjSpCoord.setReferenceValue(Vector(1, 2*centerFreq-beamFreqs(0))); build 12-Sep-2018 15:30:25 + conjSpCoord.setReferenceValue(Vector(1, sqrt(2*centerFreq*centerFreq-beamFreqs(0)*beamFreqs(0)))); build 12-Sep-2018 15:30:25 ///Increment should go in the reverse direction build 12-Sep-2018 15:30:25 - if(beamFreqs.nelements() >1) build 12-Sep-2018 15:30:25 - conjSpCoord.setIncrement(Vector(1, beamFreqs(0)-beamFreqs(1))); build 12-Sep-2018 15:30:25 + if(beamFreqs.nelements() >1){ build 12-Sep-2018 15:30:25 + Vector conjFreqs(beamFreqs.nelements()); build 12-Sep-2018 15:30:25 + for (uInt kk=0; kk< beamFreqs.nelements(); ++kk){ build 12-Sep-2018 15:30:25 + //conjFreqs[kk]=sqrt(2*centerFreq*centerFreq-beamFreqs(kk)*beamFreqs(kk)); build 12-Sep-2018 15:30:25 + conjFreqs[kk]=SynthesisUtils::conjFreq(beamFreqs[kk], centerFreq); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + conjSpCoord=SpectralCoordinate(spCoord.frequencySystem(), conjFreqs, spCoord.restFrequency()); build 12-Sep-2018 15:30:25 + //conjSpCoord.setIncrement(Vector(1, beamFreqs(0)-beamFreqs(1))); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 conjCoord.replaceCoordinate(conjSpCoord, spind); build 12-Sep-2018 15:30:25 IPosition pbShape(4, convSize_p, convSize_p, 1, nBeamChans); build 12-Sep-2018 15:30:25 //TempImage twoDPB(pbShape, coords); build 12-Sep-2018 15:30:25 @@ -586,6 +613,7 @@ void HetArrayConvFunc::findConvFunction(const ImageInterface& iimage, build 12-Sep-2018 15:30:25 //wtime1+=omp_get_wtime()-wtime0; build 12-Sep-2018 15:30:25 //subim.copyData((LatticeExpr) (iif(abs(subim)> 5e-2, subim, 0))); build 12-Sep-2018 15:30:25 //subim2.copyData((LatticeExpr) (iif(abs(subim2)> 25e-4, subim2, 0))); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 //wtime0=omp_get_wtime(); build 12-Sep-2018 15:30:25 ft_p.c2cFFTInDouble(subim); build 12-Sep-2018 15:30:25 ft_p.c2cFFTInDouble(subim2); build 12-Sep-2018 15:30:25 @@ -791,15 +819,15 @@ void HetArrayConvFunc::findConvFunction(const ImageInterface& iimage, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 */ build 12-Sep-2018 15:30:25 - /*////////////////TESTOOO build 12-Sep-2018 15:30:25 - CoordinateSystem TMP = coords; build 12-Sep-2018 15:30:25 - CoordinateUtil::addLinearAxes(TMP, Vector(1,"gulu"), IPosition(1,nBeamChans)); build 12-Sep-2018 15:30:25 - PagedImage SCREEN(TiledShape(convFunctions_p[actualConvIndex_p]->shape()), TMP, "NONCONJUVI2"+String::toString(actualConvIndex_p)); build 12-Sep-2018 15:30:25 - SCREEN.put(*convFunctions_p[actualConvIndex_p] ); build 12-Sep-2018 15:30:25 - PagedImage SCREEN3(TiledShape(convWeights_p[actualConvIndex_p]->shape()), TMP, "FTWEIGHTVI2"+String::toString(actualConvIndex_p)); build 12-Sep-2018 15:30:25 - SCREEN3.put(*convWeights_p[actualConvIndex_p] ); build 12-Sep-2018 15:30:25 + ////////////////TESTOOO build 12-Sep-2018 15:30:25 + // CoordinateSystem TMP = coords; build 12-Sep-2018 15:30:25 + // CoordinateUtil::addLinearAxes(TMP, Vector(1,"gulu"), IPosition(1,nBeamChans)); build 12-Sep-2018 15:30:25 + // PagedImage SCREEN(TiledShape(convFunctions_p[actualConvIndex_p]->shape()), TMP, "NONCONJUVI2"+String::toString(actualConvIndex_p)); build 12-Sep-2018 15:30:25 + // SCREEN.put(*convFunctions_p[actualConvIndex_p] ); build 12-Sep-2018 15:30:25 + // PagedImage SCREEN3(TiledShape(convWeights_p[actualConvIndex_p]->shape()), TMP, "FTWEIGHTVI2"+String::toString(actualConvIndex_p)); build 12-Sep-2018 15:30:25 + // SCREEN3.put(*convWeights_p[actualConvIndex_p] ); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - /////////////////*/ build 12-Sep-2018 15:30:25 + ///////////////// build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 makerowmap(vb, convFuncRowMap); build 12-Sep-2018 15:30:25 ///need to deal with only the maximum of different baselines available in this build 12-Sep-2018 15:30:25 @@ -820,7 +848,7 @@ void HetArrayConvFunc::findConvFunction(const ImageInterface& iimage, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 convFunc_p.resize(); build 12-Sep-2018 15:30:25 if((nchan_p == 1) && getConjConvFunc) { build 12-Sep-2018 15:30:25 - //cerr << this << " recovering " << actualConvIndex_p << " " <& fre build 12-Sep-2018 15:30:25 Double centerFreq=SpectralImageUtil::worldFreq(csys_p, 0.0); build 12-Sep-2018 15:30:25 Double maxRatio=-1.0; build 12-Sep-2018 15:30:25 for (Int k=0; k < freqs.shape()[0]; ++k) { build 12-Sep-2018 15:30:25 - Double conjFreq=(centerFreq-freqs[k])+centerFreq; build 12-Sep-2018 15:30:25 + //Double conjFreq=(centerFreq-freqs[k])+centerFreq; build 12-Sep-2018 15:30:25 + Double conjFreq=SynthesisUtils::conjFreq(freqs[k], centerFreq); build 12-Sep-2018 15:30:25 if(maxRatio < conjFreq/freqs[k] ) build 12-Sep-2018 15:30:25 maxRatio=conjFreq/freqs[k]; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 @@ -1181,20 +1210,25 @@ void HetArrayConvFunc::supportAndNormalizeLatt(Int plane, Int convSampling, Temp build 12-Sep-2018 15:30:25 Float minAbsConvFunc=min(amplitude(convPlane)); build 12-Sep-2018 15:30:25 Bool found=false; build 12-Sep-2018 15:30:25 Int trial=0; build 12-Sep-2018 15:30:25 + Float cutlevel=2.5e-2; build 12-Sep-2018 15:30:25 + //numeric needs a larger ft build 12-Sep-2018 15:30:25 + for (uInt k=0; k < antMath_p.nelements() ; ++k){ build 12-Sep-2018 15:30:25 + if((antMath_p[k]->whichPBClass()) == PBMathInterface::NUMERIC) build 12-Sep-2018 15:30:25 + cutlevel=5e-3; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 for (trial=0; trial< (convSize/2-2); ++trial) { build 12-Sep-2018 15:30:25 - //Searching down a diagonal build 12-Sep-2018 15:30:25 - if((abs(convPlane(convSize/2-trial-1,convSize/2-1-trial)) < (7.5e-2*maxAbsConvFunc)) || (real(convPlane(convSize/2-trial-2,convSize/2-trial-2)) <0.0 )) build 12-Sep-2018 15:30:25 + ///largest along either axis build 12-Sep-2018 15:30:25 + if((abs(convPlane(convSize/2-trial-1,convSize/2-1)) < (cutlevel*maxAbsConvFunc)) &&(abs(convPlane(convSize/2-1,convSize/2-trial-1)) < (cutlevel*maxAbsConvFunc)) )// || (real(convPlane(convSize/2-trial-2,convSize/2-trial-2)) <0.0 )) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 //|| (real(convPlane(convSize/2-trial-2,convSize/2-trial-2)) <0.0 )) { build 12-Sep-2018 15:30:25 found=true; build 12-Sep-2018 15:30:25 - trial=Int(sqrt(2.0*Float(trial*trial))); build 12-Sep-2018 15:30:25 + //trial=Int(sqrt(2.0*Float(trial*trial))); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 break; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 if(!found) { build 12-Sep-2018 15:30:25 - if((maxAbsConvFunc-minAbsConvFunc) > (7.5e-2*maxAbsConvFunc)) build 12-Sep-2018 15:30:25 + if((maxAbsConvFunc-minAbsConvFunc) > (cutlevel*maxAbsConvFunc)) build 12-Sep-2018 15:30:25 found=true; build 12-Sep-2018 15:30:25 // if it drops by more than 2 magnitudes per pixel build 12-Sep-2018 15:30:25 trial=( (10*convSampling) < convSize) ? 5*convSampling : (convSize/2 - 4*convSampling); build 12-Sep-2018 15:30:25 @@ -1222,7 +1256,6 @@ void HetArrayConvFunc::supportAndNormalizeLatt(Int plane, Int convSampling, Temp build 12-Sep-2018 15:30:25 //OTF may have flagged stuff ... build 12-Sep-2018 15:30:25 convSupport=0; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 convSupport_p(plane)=convSupport; build 12-Sep-2018 15:30:25 Double pbSum=0.0; build 12-Sep-2018 15:30:25 /* build 12-Sep-2018 15:30:25 @@ -1411,7 +1444,6 @@ Array HetArrayConvFunc::resample(const Array& inarray, const D build 12-Sep-2018 15:30:25 shp(1)=Int(ny*factor/2.0)*2; build 12-Sep-2018 15:30:25 Int newNx=shp(0); build 12-Sep-2018 15:30:25 Int newNy=shp(1); build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Array out(shp, 0.0); build 12-Sep-2018 15:30:25 // cerr << "SHP " << shp << endl; build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/MosaicFT.cc b/code/synthesis/TransformMachines2/MosaicFT.cc build 12-Sep-2018 15:30:25 index 7615b41..c800a8f 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/MosaicFT.cc build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/MosaicFT.cc build 12-Sep-2018 15:30:25 @@ -98,7 +98,7 @@ using namespace casa::refim; build 12-Sep-2018 15:30:25 isTiled(false), build 12-Sep-2018 15:30:25 maxAbsData(0.0), centerLoc(IPosition(4,0)), offsetLoc(IPosition(4,0)), build 12-Sep-2018 15:30:25 mspc(0), msac(0), pointingToImage(0), usezero_p(usezero), convSampling(1), build 12-Sep-2018 15:30:25 - skyCoverage_p( ), machineName_p("MosaicFT"), stokes_p(stokes), useConjConvFunc_p(useConjConvFunc) build 12-Sep-2018 15:30:25 + skyCoverage_p( ), machineName_p("MosaicFT"), stokes_p(stokes), useConjConvFunc_p(useConjConvFunc), timemass_p(0.0), timegrid_p(0.0), timedegrid_p(0.0) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 convSize=0; build 12-Sep-2018 15:30:25 lastIndex_p=0; build 12-Sep-2018 15:30:25 @@ -171,6 +171,9 @@ MosaicFT& MosaicFT::operator=(const MosaicFT& other) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 useConjConvFunc_p=other.useConjConvFunc_p; build 12-Sep-2018 15:30:25 + timemass_p=other.timemass_p; build 12-Sep-2018 15:30:25 + timegrid_p=other.timegrid_p; build 12-Sep-2018 15:30:25 + timedegrid_p=other.timedegrid_p; build 12-Sep-2018 15:30:25 }; build 12-Sep-2018 15:30:25 return *this; build 12-Sep-2018 15:30:25 }; build 12-Sep-2018 15:30:25 @@ -426,6 +429,9 @@ void MosaicFT::prepGridForDegrid(){ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 void MosaicFT::finalizeToVis() build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 + //cerr << "Time degrid " << timedegrid_p << endl; build 12-Sep-2018 15:30:25 + timedegrid_p=0.0; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 if(!arrayLattice.null()) arrayLattice=0; build 12-Sep-2018 15:30:25 if(!lattice.null()) lattice=0; build 12-Sep-2018 15:30:25 griddedData.resize(); build 12-Sep-2018 15:30:25 @@ -570,7 +576,11 @@ void MosaicFT::reset(){ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 void MosaicFT::finalizeToSky() build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + //cerr<< "time massage data " << timemass_p << endl; build 12-Sep-2018 15:30:25 + //cerr << "time gridding " << timegrid_p << endl; build 12-Sep-2018 15:30:25 + timemass_p=0.0; build 12-Sep-2018 15:30:25 + timegrid_p=0.0; build 12-Sep-2018 15:30:25 // Now we flush the cache and report statistics build 12-Sep-2018 15:30:25 // For memory based, we don't write anything out yet. build 12-Sep-2018 15:30:25 /*if(isTiled) { build 12-Sep-2018 15:30:25 @@ -960,7 +970,8 @@ void MosaicFT::put(const vi::VisBuffer2& vb, Int row, Bool dopsf, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + Timer tim; build 12-Sep-2018 15:30:25 + tim.mark(); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 matchChannel(vb); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1095,7 +1106,7 @@ void MosaicFT::put(const vi::VisBuffer2& vb, Int row, Bool dopsf, build 12-Sep-2018 15:30:25 else{ build 12-Sep-2018 15:30:25 nth= omp_get_max_threads(); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - nth=min(4,nth); build 12-Sep-2018 15:30:25 + //nth=min(4,nth); build 12-Sep-2018 15:30:25 #endif build 12-Sep-2018 15:30:25 Double cinv=Double(1.0)/C::c; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1111,24 +1122,24 @@ void MosaicFT::put(const vi::VisBuffer2& vb, Int row, Bool dopsf, build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 }//end pragma parallel build 12-Sep-2018 15:30:25 -Int x0, y0, nxsub, nysub, ixsub, iysub, icounter, ix, iy; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +timemass_p +=tim.real(); build 12-Sep-2018 15:30:25 +Int ixsub, iysub, icounter; build 12-Sep-2018 15:30:25 ixsub=1; build 12-Sep-2018 15:30:25 iysub=1; build 12-Sep-2018 15:30:25 //////***********************DEBUGGING build 12-Sep-2018 15:30:25 //nth=1; build 12-Sep-2018 15:30:25 ////////*************** build 12-Sep-2018 15:30:25 if (nth >3){ build 12-Sep-2018 15:30:25 - ixsub=2; build 12-Sep-2018 15:30:25 - iysub=2; build 12-Sep-2018 15:30:25 + ixsub=16; build 12-Sep-2018 15:30:25 + iysub=16; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 else if(nth >1){ build 12-Sep-2018 15:30:25 ixsub=2; build 12-Sep-2018 15:30:25 - iysub=1; build 12-Sep-2018 15:30:25 + iysub=2; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - x0=1; build 12-Sep-2018 15:30:25 - y0=1; build 12-Sep-2018 15:30:25 - nxsub=nx; build 12-Sep-2018 15:30:25 - nysub=ny; build 12-Sep-2018 15:30:25 Int rbeg=startRow+1; build 12-Sep-2018 15:30:25 Int rend=endRow+1; build 12-Sep-2018 15:30:25 Block > sumwgt(ixsub*iysub); build 12-Sep-2018 15:30:25 @@ -1139,6 +1150,19 @@ Int x0, y0, nxsub, nysub, ixsub, iysub, icounter, ix, iy; build 12-Sep-2018 15:30:25 sumwgt[icounter].set(0.0); build 12-Sep-2018 15:30:25 swgtptr[icounter]=sumwgt[icounter].getStorage(swgtdel(icounter)); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + //cerr << "done thread " << doneThreadPartition_p << " " << ixsub*iysub << endl; build 12-Sep-2018 15:30:25 + if(doneThreadPartition_p < 0){ build 12-Sep-2018 15:30:25 + xsect_p.resize(ixsub*iysub); build 12-Sep-2018 15:30:25 + ysect_p.resize(ixsub*iysub); build 12-Sep-2018 15:30:25 + nxsect_p.resize(ixsub*iysub); build 12-Sep-2018 15:30:25 + nysect_p.resize(ixsub*iysub); build 12-Sep-2018 15:30:25 + for (icounter=0; icounter < ixsub*iysub; ++icounter){ build 12-Sep-2018 15:30:25 + findGridSector(nx, ny, ixsub, iysub, 0, 0, icounter, xsect_p(icounter), ysect_p(icounter), nxsect_p(icounter), nysect_p(icounter), true); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + Vector xsect, ysect, nxsect, nysect; build 12-Sep-2018 15:30:25 + xsect=xsect_p; ysect=ysect_p; nxsect=nxsect_p; nysect=nysect_p; build 12-Sep-2018 15:30:25 + //cerr << xsect.shape() << " " << xsect << endl; build 12-Sep-2018 15:30:25 const Int* pmapstor=polMap.getStorage(del); build 12-Sep-2018 15:30:25 const Int* cmapstor=chanMap.getStorage(del); build 12-Sep-2018 15:30:25 Int nc=nchan; build 12-Sep-2018 15:30:25 @@ -1153,15 +1177,21 @@ Int x0, y0, nxsub, nysub, ixsub, iysub, icounter, ix, iy; build 12-Sep-2018 15:30:25 const Int *convchanmapstor=convChanMap_p.getStorage(del); build 12-Sep-2018 15:30:25 const Int *convpolmapstor=convPolMap_p.getStorage(del); build 12-Sep-2018 15:30:25 ////////*************************** build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + tim.mark(); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 if(useDoubleGrid_p) { build 12-Sep-2018 15:30:25 DComplex *gridstor=griddedData2.getStorage(gridcopy); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -#pragma omp parallel default(none) private(icounter,ix,iy,x0,y0,nxsub,nysub, del) firstprivate(idopsf, doWeightGridding, datStorage, wgtStorage, flagstor, rowflagstor, convstor, wconvstor, pmapstor, cmapstor, gridstor, csupp, nxp, nyp, np, nc,ixsub, iysub, rend, rbeg, csamp, csize, nvp, nvc, nvisrow, phasorstor, locstor, offstor, convrowmapstor, convchanmapstor, convpolmapstor, nPolConv, nChanConv, nConvFunc) shared(swgtptr) num_threads(ixsub*iysub) build 12-Sep-2018 15:30:25 +#pragma omp parallel default(none) private(icounter, del) firstprivate(idopsf, doWeightGridding, datStorage, wgtStorage, flagstor, rowflagstor, convstor, wconvstor, pmapstor, cmapstor, gridstor, csupp, nxp, nyp, np, nc,ixsub, iysub, rend, rbeg, csamp, csize, nvp, nvc, nvisrow, phasorstor, locstor, offstor, convrowmapstor, convchanmapstor, convpolmapstor, nPolConv, nChanConv, nConvFunc,xsect, ysect, nxsect, nysect) shared(swgtptr) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 -#pragma omp for schedule(dynamic, 1) build 12-Sep-2018 15:30:25 +#pragma omp for schedule(dynamic) build 12-Sep-2018 15:30:25 for(icounter=0; icounter < ixsub*iysub; ++icounter){ build 12-Sep-2018 15:30:25 + Int x0=xsect(icounter); build 12-Sep-2018 15:30:25 + Int y0=ysect(icounter); build 12-Sep-2018 15:30:25 + Int nxsub=nxsect(icounter); build 12-Sep-2018 15:30:25 + Int nysub=nysect(icounter); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + /* build 12-Sep-2018 15:30:25 ix= (icounter+1)-((icounter)/ixsub)*ixsub; build 12-Sep-2018 15:30:25 iy=(icounter)/ixsub+1; build 12-Sep-2018 15:30:25 y0=(nyp/iysub)*(iy-1)+1; build 12-Sep-2018 15:30:25 @@ -1174,7 +1204,7 @@ Int x0, y0, nxsub, nysub, ixsub, iysub, icounter, ix, iy; build 12-Sep-2018 15:30:25 if( ix == ixsub){ build 12-Sep-2018 15:30:25 nxsub=nxp-(nxp/ixsub)*(ix-1); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + */ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 sectgmosd2(datStorage, build 12-Sep-2018 15:30:25 &nvp, build 12-Sep-2018 15:30:25 @@ -1209,7 +1239,12 @@ Int x0, y0, nxsub, nysub, ixsub, iysub, icounter, ix, iy; build 12-Sep-2018 15:30:25 sumwgt[icounter].putStorage(swgtptr[icounter],swgtdel[icounter]); build 12-Sep-2018 15:30:25 sumWeight=sumWeight+sumwgt[icounter]; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 griddedData2.putStorage(gridstor, gridcopy); build 12-Sep-2018 15:30:25 + if(dopsf && (nth >4)) build 12-Sep-2018 15:30:25 + tweakGridSector(nx, ny, ixsub, iysub); build 12-Sep-2018 15:30:25 + timegrid_p+=tim.real(); build 12-Sep-2018 15:30:25 + tim.mark(); build 12-Sep-2018 15:30:25 if(!doneWeightImage_p){ build 12-Sep-2018 15:30:25 //This can be parallelized by making copy of the central part of the griddedWeight build 12-Sep-2018 15:30:25 //and adding it after dooing the gridding build 12-Sep-2018 15:30:25 @@ -1224,16 +1259,17 @@ Int x0, y0, nxsub, nysub, ixsub, iysub, icounter, ix, iy; build 12-Sep-2018 15:30:25 griddedWeight2.putStorage(gridwgtstor, weightcopy); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + timemass_p+=tim.real(); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 else { build 12-Sep-2018 15:30:25 //cerr << "maps " << convChanMap_p << " " << chanMap << endl; build 12-Sep-2018 15:30:25 //cerr << "nchan " << nchan << " nchanconv " << nChanConv << endl; build 12-Sep-2018 15:30:25 Complex *gridstor=griddedData.getStorage(gridcopy); build 12-Sep-2018 15:30:25 -#pragma omp parallel default(none) private(icounter,ix,iy,x0,y0,nxsub,nysub, del) firstprivate(idopsf, doWeightGridding, datStorage, wgtStorage, flagstor, rowflagstor, convstor, wconvstor, pmapstor, cmapstor, gridstor, csupp, nxp, nyp, np, nc,ixsub, iysub, rend, rbeg, csamp, csize, nvp, nvc, nvisrow, phasorstor, locstor, offstor, convrowmapstor, convchanmapstor, convpolmapstor, nPolConv, nChanConv, nConvFunc) shared(swgtptr) num_threads(ixsub*iysub) build 12-Sep-2018 15:30:25 +#pragma omp parallel default(none) private(icounter, del) firstprivate(idopsf, doWeightGridding, datStorage, wgtStorage, flagstor, rowflagstor, convstor, wconvstor, pmapstor, cmapstor, gridstor, csupp, nxp, nyp, np, nc,ixsub, iysub, rend, rbeg, csamp, csize, nvp, nvc, nvisrow, phasorstor, locstor, offstor, convrowmapstor, convchanmapstor, convpolmapstor, nPolConv, nChanConv, nConvFunc, xsect, ysect, nxsect, nysect) shared(swgtptr) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 -#pragma omp for schedule(dynamic, 1) build 12-Sep-2018 15:30:25 +#pragma omp for schedule(dynamic) build 12-Sep-2018 15:30:25 for(icounter=0; icounter < ixsub*iysub; ++icounter){ build 12-Sep-2018 15:30:25 - ix= (icounter+1)-((icounter)/ixsub)*ixsub; build 12-Sep-2018 15:30:25 + /*ix= (icounter+1)-((icounter)/ixsub)*ixsub; build 12-Sep-2018 15:30:25 iy=(icounter)/ixsub+1; build 12-Sep-2018 15:30:25 y0=(nyp/iysub)*(iy-1)+1; build 12-Sep-2018 15:30:25 nysub=nyp/iysub; build 12-Sep-2018 15:30:25 @@ -1245,7 +1281,12 @@ Int x0, y0, nxsub, nysub, ixsub, iysub, icounter, ix, iy; build 12-Sep-2018 15:30:25 if( ix == ixsub){ build 12-Sep-2018 15:30:25 nxsub=nxp-(nxp/ixsub)*(ix-1); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + */ build 12-Sep-2018 15:30:25 + Int x0=xsect(icounter); build 12-Sep-2018 15:30:25 + Int y0=ysect(icounter); build 12-Sep-2018 15:30:25 + Int nxsub=nxsect(icounter); build 12-Sep-2018 15:30:25 + Int nysub=nysect(icounter); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 sectgmoss2(datStorage, build 12-Sep-2018 15:30:25 &nvp, build 12-Sep-2018 15:30:25 &nvc, build 12-Sep-2018 15:30:25 @@ -1282,6 +1323,10 @@ Int x0, y0, nxsub, nysub, ixsub, iysub, icounter, ix, iy; build 12-Sep-2018 15:30:25 sumWeight=sumWeight+sumwgt[icounter]; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 griddedData.putStorage(gridstor, gridcopy); build 12-Sep-2018 15:30:25 + if(dopsf && (nth > 4)) build 12-Sep-2018 15:30:25 + tweakGridSector(nx, ny, ixsub, iysub); build 12-Sep-2018 15:30:25 + timegrid_p+=tim.real(); build 12-Sep-2018 15:30:25 + tim.mark(); build 12-Sep-2018 15:30:25 if(!doneWeightImage_p){ build 12-Sep-2018 15:30:25 Complex *gridwgtstor=griddedWeight.getStorage(weightcopy); build 12-Sep-2018 15:30:25 gmoswgts(&nvp, &nvc,flagstor, rowflagstor, wgtStorage, &nvisrow, build 12-Sep-2018 15:30:25 @@ -1294,7 +1339,7 @@ Int x0, y0, nxsub, nysub, ixsub, iysub, icounter, ix, iy; build 12-Sep-2018 15:30:25 griddedWeight.putStorage(gridwgtstor, weightcopy); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + timemass_p+=tim.real(); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 convFunc.freeStorage(convstor, convcopy); build 12-Sep-2018 15:30:25 weightConvFunc_p.freeStorage(wconvstor, wconvcopy); build 12-Sep-2018 15:30:25 @@ -1417,8 +1462,12 @@ void MosaicFT::get(vi::VisBuffer2& vb, Int row) build 12-Sep-2018 15:30:25 else{ build 12-Sep-2018 15:30:25 nth= omp_get_max_threads(); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - nth=min(4,nth); build 12-Sep-2018 15:30:25 + //nth=min(4,nth); build 12-Sep-2018 15:30:25 #endif build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Timer tim; build 12-Sep-2018 15:30:25 + tim.mark(); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Int dow=0; build 12-Sep-2018 15:30:25 Double cinv=Double(1.0)/C::c; build 12-Sep-2018 15:30:25 #pragma omp parallel default(none) private(irow) firstprivate(visfreqstor, nvc, scalestor, offsetstor, csamp, phasorstor, uvwstor, locstor, offstor, dpstor, dow, cinv) shared(startRow, endRow) num_threads(nth) build 12-Sep-2018 15:30:25 @@ -1436,13 +1485,8 @@ void MosaicFT::get(vi::VisBuffer2& vb, Int row) build 12-Sep-2018 15:30:25 }//end pragma parallel build 12-Sep-2018 15:30:25 Int rbeg=startRow+1; build 12-Sep-2018 15:30:25 Int rend=endRow+1; build 12-Sep-2018 15:30:25 - Int npart=1; build 12-Sep-2018 15:30:25 - if (nth >3){ build 12-Sep-2018 15:30:25 - npart=4; build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - else if(nth >1){ build 12-Sep-2018 15:30:25 - npart=2; build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 + Int npart=nth*2; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Bool gridcopy; build 12-Sep-2018 15:30:25 const Complex *gridstor=griddedData.getStorage(gridcopy); build 12-Sep-2018 15:30:25 Bool convcopy; build 12-Sep-2018 15:30:25 @@ -1452,7 +1496,7 @@ void MosaicFT::get(vi::VisBuffer2& vb, Int row) build 12-Sep-2018 15:30:25 Int ix=0; build 12-Sep-2018 15:30:25 #pragma omp parallel default(none) private(ix, rbeg, rend) firstprivate(uvwstor, datStorage, flagstor, rowflagstor, convstor, pmapstor, cmapstor, gridstor, nxp, nyp, np, nc, csamp, csize, csupp, nvp, nvc, nvisrow, phasorstor, locstor, offstor, nPolConv, nChanConv, nConvFunc, convrowmapstor, convpolmapstor, convchanmapstor, npart) num_threads(npart) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 - #pragma omp for schedule(dynamic,1) build 12-Sep-2018 15:30:25 + #pragma omp for schedule(dynamic) build 12-Sep-2018 15:30:25 for (ix=0; ix< npart; ++ix){ build 12-Sep-2018 15:30:25 rbeg=ix*(nvisrow/npart)+1; build 12-Sep-2018 15:30:25 rend=(ix != (npart-1)) ? (rbeg+(nvisrow/npart)-1) : (rbeg+(nvisrow/npart)-1+nvisrow%npart) ; build 12-Sep-2018 15:30:25 @@ -1491,7 +1535,7 @@ void MosaicFT::get(vi::VisBuffer2& vb, Int row) build 12-Sep-2018 15:30:25 griddedData.freeStorage(gridstor, gridcopy); build 12-Sep-2018 15:30:25 convFunc.freeStorage(convstor, convcopy); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + timedegrid_p+=tim.real(); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 interpolateFrequencyFromgrid(vb, data, FTMachine::MODEL); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/MosaicFT.h b/code/synthesis/TransformMachines2/MosaicFT.h build 12-Sep-2018 15:30:25 index d1ab929..8f0aeef 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/MosaicFT.h build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/MosaicFT.h build 12-Sep-2018 15:30:25 @@ -343,7 +343,7 @@ protected: build 12-Sep-2018 15:30:25 casacore::Bool doneWeightImage_p; build 12-Sep-2018 15:30:25 casacore::String stokes_p; build 12-Sep-2018 15:30:25 casacore::Bool useConjConvFunc_p; build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + casacore::Double timemass_p, timegrid_p, timedegrid_p; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 }; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/MultiTermFTNew.cc b/code/synthesis/TransformMachines2/MultiTermFTNew.cc build 12-Sep-2018 15:30:25 index db56a7e..4b84e39 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/MultiTermFTNew.cc build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/MultiTermFTNew.cc build 12-Sep-2018 15:30:25 @@ -51,6 +51,7 @@ build 12-Sep-2018 15:30:25 #include build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 #include build 12-Sep-2018 15:30:25 +#include build 12-Sep-2018 15:30:25 #include build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 // This is the list of FTMachine types supported by MultiTermFTNew build 12-Sep-2018 15:30:25 @@ -93,8 +94,16 @@ using namespace casa::vi; build 12-Sep-2018 15:30:25 for(uInt termindex=0;termindexname() << endl; build 12-Sep-2018 15:30:25 - if( termindex==0 ){ subftms_p[termindex] = subftm; } build 12-Sep-2018 15:30:25 - else { subftms_p[termindex] = getNewFTM(subftm); } build 12-Sep-2018 15:30:25 + if( termindex==0 ){ build 12-Sep-2018 15:30:25 + subftms_p[termindex] = subftm; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + subftms_p[termindex] = getNewFTM(subftm); build 12-Sep-2018 15:30:25 + if((subftms_p[termindex]->name())=="MosaicFTNew"){ build 12-Sep-2018 15:30:25 + (static_cast(subftms_p[termindex].get()))->setConvFunc( (static_cast(subftm.get()))->getConvFunc()); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 subftms_p[termindex]->setMiscInfo(termindex); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 @@ -400,7 +409,6 @@ void MultiTermFTNew::initializeToSkyNew(const Bool dopsf, build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 subftms_p[0]->put(vb,row,dopsf,type); build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 if (!dryRun()) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 Int gridnterms=nterms_p; build 12-Sep-2018 15:30:25 @@ -409,7 +417,7 @@ void MultiTermFTNew::initializeToSkyNew(const Bool dopsf, build 12-Sep-2018 15:30:25 gridnterms=2*nterms_p-1; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - //cout << " Calling put for " << gridnterms << " terms, nelements : " << subftms_p.nelements() << " and dopsf " << dopsf << endl; build 12-Sep-2018 15:30:25 + //cerr << " Calling put for " << gridnterms << " terms, nelements : " << subftms_p.nelements() << " and dopsf " << dopsf << " reffreq " << reffreq_p << endl; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 for(Int tix=1;tixmakeImage(type, vi, theImage, weight); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + void MultiTermFTNew::makeMTImages(refim::FTMachine::Type type, build 12-Sep-2018 15:30:25 + vi::VisibilityIterator2& vi, build 12-Sep-2018 15:30:25 + casacore::Vector > >& theImage, build 12-Sep-2018 15:30:25 + casacore::Vector > >& weight){ build 12-Sep-2018 15:30:25 + Int ntaylor= (type== refim::FTMachine::PSF) ? psfnterms_p : nterms_p; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + vi::VisBuffer2* vb=vi.getVisBuffer(); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + // Initialize put (i.e. transform to Sky) for this model build 12-Sep-2018 15:30:25 + vi.origin(); build 12-Sep-2018 15:30:25 + for(Int taylor=0;taylor< ntaylor ; ++taylor) { build 12-Sep-2018 15:30:25 + if(vb->polarizationFrame()==MSIter::Linear) { build 12-Sep-2018 15:30:25 + StokesImageUtil::changeCStokesRep(*(theImage[taylor]), StokesImageUtil::LINEAR); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + StokesImageUtil::changeCStokesRep(*(theImage[taylor]), StokesImageUtil::CIRCULAR); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + subftms_p[taylor]->initializeToSky(*(theImage[taylor]), *(weight[taylor]),*vb); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + { build 12-Sep-2018 15:30:25 + Vector refpix = (theImage[0]->coordinates().spectralCoordinate()).referencePixel(); build 12-Sep-2018 15:30:25 + (theImage[0]->coordinates().spectralCoordinate()).toWorld( reffreq_p, refpix[0] ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + Bool useCorrected= !(ROMSColumns(vi.ms()).correctedData().isNull()); build 12-Sep-2018 15:30:25 + if((type==FTMachine::CORRECTED) && (!useCorrected)) build 12-Sep-2018 15:30:25 + type=FTMachine::OBSERVED; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + // Loop over the visibilities, putting VisBuffers build 12-Sep-2018 15:30:25 + for (vi.originChunks();vi.moreChunks();vi.nextChunk()) { build 12-Sep-2018 15:30:25 + for (vi.origin(); vi.more(); vi.next()) { build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + switch(type) { build 12-Sep-2018 15:30:25 + case FTMachine::RESIDUAL: build 12-Sep-2018 15:30:25 + vb->setVisCube(vb->visCubeCorrected()); build 12-Sep-2018 15:30:25 + vb->setVisCube(vb->visCube()-vb->visCubeModel()); build 12-Sep-2018 15:30:25 + put(*vb, -1, false); build 12-Sep-2018 15:30:25 + break; build 12-Sep-2018 15:30:25 + case FTMachine::CORRECTED: build 12-Sep-2018 15:30:25 + put(*vb, -1, false, FTMachine::CORRECTED); build 12-Sep-2018 15:30:25 + break; build 12-Sep-2018 15:30:25 + case FTMachine::PSF: build 12-Sep-2018 15:30:25 + vb->setVisCube(Complex(1.0,0.0)); build 12-Sep-2018 15:30:25 + put(*vb, -1, true, FTMachine::PSF); build 12-Sep-2018 15:30:25 + break; build 12-Sep-2018 15:30:25 + case FTMachine::OBSERVED: build 12-Sep-2018 15:30:25 + put(*vb, -1, false, FTMachine::OBSERVED); build 12-Sep-2018 15:30:25 + break; build 12-Sep-2018 15:30:25 + default: build 12-Sep-2018 15:30:25 + throw(AipsError("Cannot make multiterm image of type requested")); build 12-Sep-2018 15:30:25 + break; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + /// build 12-Sep-2018 15:30:25 + for(Int taylor=0;taylor< ntaylor ; ++taylor) { build 12-Sep-2018 15:30:25 + subftms_p[taylor]->finalizeToSky(); build 12-Sep-2018 15:30:25 + subftms_p[taylor]->getImage(*(weight[taylor]), false); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 //--------------------------------------------------------------------------------------------------- build 12-Sep-2018 15:30:25 //------------------------ To / From Records --------------------------------------------------------- build 12-Sep-2018 15:30:25 //--------------------------------------------------------------------------------------------------- build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/MultiTermFTNew.h b/code/synthesis/TransformMachines2/MultiTermFTNew.h build 12-Sep-2018 15:30:25 index a0e5637..80e3c4b 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/MultiTermFTNew.h build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/MultiTermFTNew.h build 12-Sep-2018 15:30:25 @@ -131,7 +131,12 @@ public: build 12-Sep-2018 15:30:25 vi::VisibilityIterator2& vs, build 12-Sep-2018 15:30:25 casacore::ImageInterface& image, build 12-Sep-2018 15:30:25 casacore::Matrix& weight); build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + ////Make the multi term images build 12-Sep-2018 15:30:25 + ////caller make sure vector is the size of nterms or npsfterms required build 12-Sep-2018 15:30:25 + void makeMTImages(refim::FTMachine::Type type, build 12-Sep-2018 15:30:25 + vi::VisibilityIterator2& vi, build 12-Sep-2018 15:30:25 + casacore::Vector > >& image, build 12-Sep-2018 15:30:25 + casacore::Vector > >& weight); build 12-Sep-2018 15:30:25 // Get the final image: do the Fourier transform grid-correct, then build 12-Sep-2018 15:30:25 // optionally normalize by the summed weights build 12-Sep-2018 15:30:25 // Note : Post-gridding residual-image divisions by PBs will go here. build 12-Sep-2018 15:30:25 @@ -180,6 +185,10 @@ public: build 12-Sep-2018 15:30:25 }; build 12-Sep-2018 15:30:25 virtual casacore::Bool isUsingCFCache() {casacore::Bool v=false; if (subftms_p.nelements() > 0) v=subftms_p[0]->isUsingCFCache(); return v;}; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + ///return number of terms build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + virtual casacore::Int nTerms(){ return nterms_p;}; build 12-Sep-2018 15:30:25 + virtual casacore::Int psfNTerms(){ return psfnterms_p;}; build 12-Sep-2018 15:30:25 protected: build 12-Sep-2018 15:30:25 // have to call the initmaps of subftm build 12-Sep-2018 15:30:25 virtual void initMaps(const vi::VisBuffer2& vb); build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/SDGrid.cc b/code/synthesis/TransformMachines2/SDGrid.cc build 12-Sep-2018 15:30:25 index e7ca6ef..53dbce7 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/SDGrid.cc build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/SDGrid.cc build 12-Sep-2018 15:30:25 @@ -1556,6 +1556,13 @@ Bool SDGrid::getXYPos(const vi::VisBuffer2& vb, Int row) { build 12-Sep-2018 15:30:25 if (!isSplineInterpolationReady) { build 12-Sep-2018 15:30:25 interpolator = new SDPosInterpolator(vb, pointingDirCol_p); build 12-Sep-2018 15:30:25 isSplineInterpolationReady = true; build 12-Sep-2018 15:30:25 + } else { build 12-Sep-2018 15:30:25 + if (!interpolator->inTimeRange(vb.time()(row), vb.antenna1()(row))) { build 12-Sep-2018 15:30:25 + // setup spline interpolator for the current dataset (CAS-11261, 2018/6/13 WK) build 12-Sep-2018 15:30:25 + delete interpolator; build 12-Sep-2018 15:30:25 + interpolator = 0; build 12-Sep-2018 15:30:25 + interpolator = new SDPosInterpolator(vb, pointingDirCol_p); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/SimplePBConvFunc.cc b/code/synthesis/TransformMachines2/SimplePBConvFunc.cc build 12-Sep-2018 15:30:25 index 285cbae..2615cb3 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/SimplePBConvFunc.cc build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/SimplePBConvFunc.cc build 12-Sep-2018 15:30:25 @@ -122,14 +122,14 @@ SimplePBConvFunc::SimplePBConvFunc(): nchan_p(-1), build 12-Sep-2018 15:30:25 String tel= imInfo.telescope(); build 12-Sep-2018 15:30:25 MPosition pos; build 12-Sep-2018 15:30:25 ROMSColumns mscol(vb.ms()); build 12-Sep-2018 15:30:25 - if (mscol.observation().nrow() > 0) { build 12-Sep-2018 15:30:25 - tel =mscol.observation().telescopeName()(mscol.observationId()(0)); build 12-Sep-2018 15:30:25 + if (vb.subtableColumns().observation().nrow() > 0) { build 12-Sep-2018 15:30:25 + tel =vb.subtableColumns().observation().telescopeName()(mscol.observationId()(0)); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 if (tel.length() == 0 || !tel.contains("VLA") || build 12-Sep-2018 15:30:25 !MeasTable::Observatory(pos,tel)) { build 12-Sep-2018 15:30:25 // unknown observatory, use first antenna build 12-Sep-2018 15:30:25 Int ant1=vb.antenna1()(0); build 12-Sep-2018 15:30:25 - pos=mscol.antenna().positionMeas()(ant1); build 12-Sep-2018 15:30:25 + pos=vb.subtableColumns().antenna().positionMeas()(ant1); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 //cout << "TELESCOPE " << tel << endl; build 12-Sep-2018 15:30:25 //Store this to build epochs via the time access of visbuffer later build 12-Sep-2018 15:30:25 @@ -175,7 +175,7 @@ SimplePBConvFunc::SimplePBConvFunc(): nchan_p(-1), build 12-Sep-2018 15:30:25 //use first antenna as direction1_p is used to calculate pointing build 12-Sep-2018 15:30:25 // as only VLA uses observatory pos for calculations build 12-Sep-2018 15:30:25 Int ant1=vb.antenna1()(0); build 12-Sep-2018 15:30:25 - MPosition pos=ROMSColumns(vb.ms()).antenna().positionMeas()(ant1); build 12-Sep-2018 15:30:25 + MPosition pos=vb.subtableColumns().antenna().positionMeas()(ant1); build 12-Sep-2018 15:30:25 pointFrame_p.resetPosition(pos); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 MEpoch timenow(Quantity(vb.time()(0), timeUnit_p), timeMType_p); build 12-Sep-2018 15:30:25 @@ -841,7 +841,7 @@ void SimplePBConvFunc::findConvFunction(const ImageInterface& iimage, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Int spw=vb.spectralWindows()(0); build 12-Sep-2018 15:30:25 - bandName_p=ROMSColumns(vb.ms()).spectralWindow().name()(spw); build 12-Sep-2018 15:30:25 + bandName_p=vb.subtableColumns().spectralWindow().name()(spw); build 12-Sep-2018 15:30:25 chanMap.resize(freq.nelements()); build 12-Sep-2018 15:30:25 Vector localfreq=vb.getFrequencies(0, MFrequency::TOPO); build 12-Sep-2018 15:30:25 Double minfreq=min(freq); build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/Utils.cc b/code/synthesis/TransformMachines2/Utils.cc build 12-Sep-2018 15:30:25 index e259936..5a3d237 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/Utils.cc build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/Utils.cc build 12-Sep-2018 15:30:25 @@ -766,7 +766,9 @@ namespace casa{ build 12-Sep-2018 15:30:25 if (val==defaultVal) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 char *valStr=NULL; build 12-Sep-2018 15:30:25 - if ((valStr = std::getenv(name)) != NULL) build 12-Sep-2018 15:30:25 + std::string tt(name); build 12-Sep-2018 15:30:25 + tt.replace(tt.find("."), 1, "_"); build 12-Sep-2018 15:30:25 + if ((valStr = std::getenv(tt.c_str())) != NULL) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 stringstream toT2(valStr); build 12-Sep-2018 15:30:25 toT2 >> val; build 12-Sep-2018 15:30:25 @@ -774,10 +776,12 @@ namespace casa{ build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 return val; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - template build 12-Sep-2018 15:30:25 - Int SynthesisUtils::getenv(const char *name, const Int defaultVal); build 12-Sep-2018 15:30:25 -template build 12-Sep-2018 15:30:25 - Bool SynthesisUtils::getenv(const char *name, const Bool defaultVal); build 12-Sep-2018 15:30:25 + template build 12-Sep-2018 15:30:25 + Int SynthesisUtils::getenv(const char *name, const Int defaultVal); build 12-Sep-2018 15:30:25 + template build 12-Sep-2018 15:30:25 + Bool SynthesisUtils::getenv(const char *name, const Bool defaultVal); build 12-Sep-2018 15:30:25 + template build 12-Sep-2018 15:30:25 + Float SynthesisUtils::getenv(const char *name, const Float defaultVal); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Float SynthesisUtils::libreSpheroidal(Float nu) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/WPConvFunc.cc b/code/synthesis/TransformMachines2/WPConvFunc.cc build 12-Sep-2018 15:30:25 index 611c0ae..6abf3d9 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/WPConvFunc.cc build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/WPConvFunc.cc build 12-Sep-2018 15:30:25 @@ -253,8 +253,8 @@ void WPConvFunc::findConvFunction(const ImageInterface& image, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Int warner=0; build 12-Sep-2018 15:30:25 Vector maxes(wConvSize); build 12-Sep-2018 15:30:25 - Bool maxdel; build 12-Sep-2018 15:30:25 - Complex* maxptr=maxes.getStorage(maxdel); build 12-Sep-2018 15:30:25 + // Bool maxdel; build 12-Sep-2018 15:30:25 + // Complex* maxptr=maxes.getStorage(maxdel); build 12-Sep-2018 15:30:25 Matrix corr(inner, inner); build 12-Sep-2018 15:30:25 Vector correction(inner); build 12-Sep-2018 15:30:25 for (Int iy=-inner/2;iy xsect, ysect, nxsect, nysect; build 12-Sep-2018 15:30:25 xsect=xsect_p; ysect=ysect_p; nxsect=nxsect_p; nysect=nysect_p; build 12-Sep-2018 15:30:25 @@ -1008,7 +1007,8 @@ void WProjectFT::put(const VisBuffer2& vb, Int row, Bool dopsf, build 12-Sep-2018 15:30:25 phasorstor); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 }//end pragma parallel build 12-Sep-2018 15:30:25 - //tweakGridSector(nx, ny, ixsub, iysub); build 12-Sep-2018 15:30:25 + if(dopsf && (nth > 4)) build 12-Sep-2018 15:30:25 + tweakGridSector(nx, ny, ixsub, iysub); build 12-Sep-2018 15:30:25 timegrid_p+=tim.real(); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 for (icounter=0; icounter < ixsub*iysub; ++icounter){ build 12-Sep-2018 15:30:25 @@ -1055,7 +1055,8 @@ void WProjectFT::put(const VisBuffer2& vb, Int row, Bool dopsf, build 12-Sep-2018 15:30:25 phasorstor); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 }//end pragma parallel build 12-Sep-2018 15:30:25 - //tweakGridSector(nx, ny, ixsub, iysub); build 12-Sep-2018 15:30:25 + if(dopsf && (nth > 4)) build 12-Sep-2018 15:30:25 + tweakGridSector(nx, ny, ixsub, iysub); build 12-Sep-2018 15:30:25 timegrid_p+=tim.real(); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 for (icounter=0; icounter < ixsub*iysub; ++icounter){ build 12-Sep-2018 15:30:25 @@ -1288,6 +1289,7 @@ ImageInterface& WProjectFT::getImage(Matrix& weights, build 12-Sep-2018 15:30:25 LatticeFFT::cfft2d(darrayLattice,false); build 12-Sep-2018 15:30:25 griddedData.resize(griddedData2.shape()); build 12-Sep-2018 15:30:25 convertArray(griddedData, griddedData2); build 12-Sep-2018 15:30:25 + SynthesisUtilMethods::getResource("mem peak in getImage"); build 12-Sep-2018 15:30:25 griddedData2.resize(); build 12-Sep-2018 15:30:25 arrayLattice = new ArrayLattice(griddedData); build 12-Sep-2018 15:30:25 lattice=arrayLattice; build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/accumulateFromGrid.cc b/code/synthesis/TransformMachines2/accumulateFromGrid.cc build 12-Sep-2018 15:30:25 index b572160..3afaecb 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/TransformMachines2/accumulateFromGrid.cc build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/accumulateFromGrid.cc build 12-Sep-2018 15:30:25 @@ -4,51 +4,58 @@ build 12-Sep-2018 15:30:25 template build 12-Sep-2018 15:30:25 void AWVisResampler::accumulateFromGrid(T& nvalue, build 12-Sep-2018 15:30:25 Complex& norm, build 12-Sep-2018 15:30:25 - const T* __restrict__& grid, Vector& iGrdPos, build 12-Sep-2018 15:30:25 - Complex* __restrict__& convFuncV, Double& wVal, build 12-Sep-2018 15:30:25 - Vector& scaledSupport, Vector& scaledSampling, build 12-Sep-2018 15:30:25 - Vector& offset, Vector& convOrigin, Vector& cfShape, build 12-Sep-2018 15:30:25 - Vector& loc, Complex& phasor, Double& sinDPA, Double& cosDPA, build 12-Sep-2018 15:30:25 - Bool& finitePointingOffset, Matrix& cached_phaseGrad_p) build 12-Sep-2018 15:30:25 + const T* __restrict__& grid, Vector& iGrdPos, build 12-Sep-2018 15:30:25 + Complex* __restrict__& convFuncV, Double& wVal, build 12-Sep-2018 15:30:25 + Vector& scaledSupport, Vector& scaledSampling, build 12-Sep-2018 15:30:25 + Vector& offset, Vector& convOrigin, Vector& cfShape, build 12-Sep-2018 15:30:25 + Vector& loc, Complex& phasor, Double& sinDPA, Double& cosDPA, build 12-Sep-2018 15:30:25 + Bool& finitePointingOffset, Matrix& cached_phaseGrad_p) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 (void)sinDPA; (void)cosDPA; (void)cfShape; // Keep the compiler warnings off for now build 12-Sep-2018 15:30:25 Complex wt;//, norm=0.0; build 12-Sep-2018 15:30:25 - Vector iCFPos(4,0),iLoc(4,0); build 12-Sep-2018 15:30:25 + Bool Dummy; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - // cerr << scaledSupport << endl build 12-Sep-2018 15:30:25 - // << scaledSampling << endl build 12-Sep-2018 15:30:25 - // << offset << endl build 12-Sep-2018 15:30:25 - // << cfShape << endl build 12-Sep-2018 15:30:25 - // << convOrigin << endl; build 12-Sep-2018 15:30:25 + Vector iCFPos(4,0),iLoc(4,0); build 12-Sep-2018 15:30:25 IPosition phaseGradOrigin_l; build 12-Sep-2018 15:30:25 phaseGradOrigin_l = cached_phaseGrad_p.shape()/2; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - for(Int iy=-scaledSupport[1]; iy <= scaledSupport[1]; iy++) build 12-Sep-2018 15:30:25 + const Int* scaledSupport_ptr=scaledSupport.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Float *scaledSampling_ptr=scaledSampling.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Double *offset_ptr=offset.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Int *loc_ptr = loc.getStorage(Dummy); build 12-Sep-2018 15:30:25 + Int *iCFPos_ptr = iCFPos.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Int* convOrigin_ptr=convOrigin.getStorage(Dummy); build 12-Sep-2018 15:30:25 + Int *iLoc_ptr=iLoc.getStorage(Dummy); build 12-Sep-2018 15:30:25 + Int *iGrdPos_ptr=iGrdPos.getStorage(Dummy); build 12-Sep-2018 15:30:25 + Int *gridInc_p_ptr = gridInc_p.getStorage(Dummy); build 12-Sep-2018 15:30:25 + Int *cfInc_p_ptr = cfInc_p.getStorage(Dummy); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + for(Int iy=-scaledSupport_ptr[1]; iy <= scaledSupport_ptr[1]; iy++) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 // iLoc[1] = static_cast(scaledSampling[1]*iy+offset[1]); build 12-Sep-2018 15:30:25 - iLoc[1] = SynthesisUtils::nint(scaledSampling[1]*iy+offset[1]); build 12-Sep-2018 15:30:25 - iCFPos[1] = iLoc[1] + convOrigin[1]; build 12-Sep-2018 15:30:25 - iGrdPos[1] = loc[1]+iy; build 12-Sep-2018 15:30:25 + iLoc_ptr[1] = SynthesisUtils::nint(scaledSampling_ptr[1]*iy+offset_ptr[1]); build 12-Sep-2018 15:30:25 + iCFPos_ptr[1] = iLoc_ptr[1] + convOrigin_ptr[1]; build 12-Sep-2018 15:30:25 + iGrdPos_ptr[1] = loc_ptr[1]+iy; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - for(Int ix=-scaledSupport[0]; ix <= scaledSupport[0]; ix++) build 12-Sep-2018 15:30:25 + for(Int ix=-scaledSupport_ptr[0]; ix <= scaledSupport_ptr[0]; ix++) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 //iLoc[0] = static_cast(scaledSampling[0]*ix+offset[0]); build 12-Sep-2018 15:30:25 - iLoc[0] = SynthesisUtils::nint(scaledSampling[0]*ix+offset[0]); build 12-Sep-2018 15:30:25 - iCFPos[0] = iLoc[0] + convOrigin[0]; build 12-Sep-2018 15:30:25 - iGrdPos[0] = loc[0]+ix; build 12-Sep-2018 15:30:25 + iLoc_ptr[0] = SynthesisUtils::nint(scaledSampling_ptr[0]*ix+offset_ptr[0]); build 12-Sep-2018 15:30:25 + iCFPos_ptr[0] = iLoc_ptr[0] + convOrigin_ptr[0]; build 12-Sep-2018 15:30:25 + iGrdPos_ptr[0] = loc_ptr[0]+ix; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 wt = getFrom4DArray((const Complex* __restrict__ &) convFuncV, build 12-Sep-2018 15:30:25 - iCFPos,cfInc_p); build 12-Sep-2018 15:30:25 + iCFPos_ptr,cfInc_p_ptr); build 12-Sep-2018 15:30:25 // wt = convFuncV(iCFPos); build 12-Sep-2018 15:30:25 if (wVal <= 0.0) wt = conj(wt); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 norm+=(wt); build 12-Sep-2018 15:30:25 if (finitePointingOffset) build 12-Sep-2018 15:30:25 - wt *= cached_phaseGrad_p(iLoc[0]+phaseGradOrigin_l[0], build 12-Sep-2018 15:30:25 - iLoc[1]+phaseGradOrigin_l[1]); build 12-Sep-2018 15:30:25 + wt *= conj(cached_phaseGrad_p(iLoc_ptr[0]+phaseGradOrigin_l[0], build 12-Sep-2018 15:30:25 + iLoc_ptr[1]+phaseGradOrigin_l[1])); build 12-Sep-2018 15:30:25 // nvalue+=wt*grid(iGrdPos); build 12-Sep-2018 15:30:25 - nvalue += wt * getFrom4DArray(grid, iGrdPos, gridInc_p); build 12-Sep-2018 15:30:25 + nvalue += wt * getFrom4DArray(grid, iGrdPos_ptr, gridInc_p_ptr); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/accumulateFromGrid.inc b/code/synthesis/TransformMachines2/accumulateFromGrid.inc build 12-Sep-2018 15:30:25 new file mode 100644 build 12-Sep-2018 15:30:25 index 0000000..e67d1c8 build 12-Sep-2018 15:30:25 --- /dev/null build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/accumulateFromGrid.inc build 12-Sep-2018 15:30:25 @@ -0,0 +1,61 @@ build 12-Sep-2018 15:30:25 +// -*- C++ -*- build 12-Sep-2018 15:30:25 +// build 12-Sep-2018 15:30:25 +// File to include to have the inner loops for de-gridding build 12-Sep-2018 15:30:25 +// (prediction) without a function call. build 12-Sep-2018 15:30:25 +// build 12-Sep-2018 15:30:25 +//-------------------------------------------------------------------------------- build 12-Sep-2018 15:30:25 +{ build 12-Sep-2018 15:30:25 + Vector iCFPos(4,0); build 12-Sep-2018 15:30:25 + Int iLoc[2]; build 12-Sep-2018 15:30:25 + Bool Dummy; build 12-Sep-2018 15:30:25 + Complex wt; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + const Int * __restrict__ gridInc_p_ptr = gridInc_p.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Complex * __restrict__ gridStore = grid.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Int* support_ptr = support.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Float *sampling_ptr = sampling.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Double *off_ptr = off.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Int* convOrigin_ptr = convOrigin.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Int *loc_ptr = loc.getStorage(Dummy); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Int * __restrict__ igrdpos_ptr = igrdpos.getStorage(Dummy); build 12-Sep-2018 15:30:25 + Int *iCFPos_ptr = iCFPos.getStorage(Dummy); build 12-Sep-2018 15:30:25 + Int *cfInc_p_ptr = cfInc_p.getStorage(Dummy); build 12-Sep-2018 15:30:25 + Int phaseGradOrigin_l[2]; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + phaseGradOrigin_l[0] = cached_phaseGrad_p.shape()(0)/2; build 12-Sep-2018 15:30:25 + phaseGradOrigin_l[1] = cached_phaseGrad_p.shape()(1)/2; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + for(Int iy=-support_ptr[1]; iy <= support_ptr[1]; iy++) build 12-Sep-2018 15:30:25 + { build 12-Sep-2018 15:30:25 + iLoc[1] = SynthesisUtils::nint(sampling_ptr[1]*iy+off_ptr[1]-1); build 12-Sep-2018 15:30:25 + igrdpos_ptr[1] = loc_ptr[1]+iy; build 12-Sep-2018 15:30:25 + iCFPos_ptr[1] = iLoc[1] + convOrigin_ptr[1]; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + for(Int ix=-support_ptr[0]; ix <= support_ptr[0]; ix++) build 12-Sep-2018 15:30:25 + { build 12-Sep-2018 15:30:25 + iLoc[0] = SynthesisUtils::nint(sampling_ptr[0]*ix+off_ptr[0]-1); build 12-Sep-2018 15:30:25 + igrdpos_ptr[0] = loc_ptr[0]+ix; build 12-Sep-2018 15:30:25 + iCFPos_ptr[0] = iLoc[0] + convOrigin_ptr[0]; build 12-Sep-2018 15:30:25 + { build 12-Sep-2018 15:30:25 + wt=getFrom4DArray((const Complex * __restrict__ &)convFuncV, build 12-Sep-2018 15:30:25 + //igrdpos,cfInc_p); build 12-Sep-2018 15:30:25 + iCFPos_ptr,cfInc_p_ptr); build 12-Sep-2018 15:30:25 + if (dataWVal <= 0.0) wt = conj(wt); build 12-Sep-2018 15:30:25 + norm(ipol)+=(wt); build 12-Sep-2018 15:30:25 + if (finitePointingOffset) build 12-Sep-2018 15:30:25 + { build 12-Sep-2018 15:30:25 + wt *= conj(cached_phaseGrad_p(iLoc[0]+phaseGradOrigin_l[0], build 12-Sep-2018 15:30:25 + iLoc[1]+phaseGradOrigin_l[1])); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + // nvalue+=wt*grid(grdpos); build 12-Sep-2018 15:30:25 + // The following uses raw index on the 4D grid build 12-Sep-2018 15:30:25 + // nvalue+=wt*getFrom4DArray(gridStore,iPosPtr,gridInc); build 12-Sep-2018 15:30:25 + nvalue+=wt*getFrom4DArray(gridStore,igrdpos_ptr,gridInc_p_ptr); build 12-Sep-2018 15:30:25 + //nvalue+=wt*getFrom4DArray(gridStore,igrdpos,gridInc_p); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + nvalue = nvalue *conj(phasor); build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 +//-------------------------------------------------------------------------------- build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/TransformMachines2/accumulateToGrid.inc b/code/synthesis/TransformMachines2/accumulateToGrid.inc build 12-Sep-2018 15:30:25 new file mode 100644 build 12-Sep-2018 15:30:25 index 0000000..0accd1d build 12-Sep-2018 15:30:25 --- /dev/null build 12-Sep-2018 15:30:25 +++ b/code/synthesis/TransformMachines2/accumulateToGrid.inc build 12-Sep-2018 15:30:25 @@ -0,0 +1,54 @@ build 12-Sep-2018 15:30:25 +// -*- C++ -*- build 12-Sep-2018 15:30:25 +// build 12-Sep-2018 15:30:25 +// File to include to get the inner gridding loops without a function call build 12-Sep-2018 15:30:25 +// build 12-Sep-2018 15:30:25 +//-------------------------------------------------------------------------------- build 12-Sep-2018 15:30:25 + { build 12-Sep-2018 15:30:25 + Int iLoc[2]; build 12-Sep-2018 15:30:25 + Bool Dummy; build 12-Sep-2018 15:30:25 + Complex wt; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Vector iCFPos(4,0); build 12-Sep-2018 15:30:25 + const Int * __restrict__ gridInc_p_ptr= gridInc_p.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Int * __restrict__ iGrdPosPtr = igrdpos.getStorage(Dummy); build 12-Sep-2018 15:30:25 + T* __restrict__ gridStore = grid.getStorage(Dummy); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + const Int* scaledSupport_ptr=support.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Float *scaledSampling_ptr=sampling.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Double *off_ptr=off.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Int *loc_ptr = loc.getStorage(Dummy); build 12-Sep-2018 15:30:25 + Int *iCFPos_ptr = iCFPos.getStorage(Dummy); build 12-Sep-2018 15:30:25 + const Int* convOrigin_ptr=convOrigin.getStorage(Dummy); build 12-Sep-2018 15:30:25 + Int *igrdpos_ptr=igrdpos.getStorage(Dummy); build 12-Sep-2018 15:30:25 + Int *cfInc_p_ptr = cfInc_p.getStorage(Dummy); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Int phaseGradOrigin_l[2]; build 12-Sep-2018 15:30:25 + phaseGradOrigin_l[0] = cached_phaseGrad_p.shape()(0)/2; build 12-Sep-2018 15:30:25 + phaseGradOrigin_l[1] = cached_phaseGrad_p.shape()(1)/2; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + for(Int iy=-scaledSupport_ptr[1]; iy <= scaledSupport_ptr[1]; iy++) build 12-Sep-2018 15:30:25 + { build 12-Sep-2018 15:30:25 + // iloc_ptr[1]=SynthesisUtils::nint((scaledSampling_ptr[1]*iy+off_ptr[1])-1); build 12-Sep-2018 15:30:25 + iLoc[1]=(Int)((scaledSampling_ptr[1]*iy+off_ptr[1])-1); build 12-Sep-2018 15:30:25 + igrdpos_ptr[1]=loc_ptr[1]+iy; build 12-Sep-2018 15:30:25 + iCFPos_ptr[1] =iLoc[1]+convOrigin_ptr[1]; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + for(Int ix=-scaledSupport_ptr[0]; ix <= scaledSupport_ptr[0]; ix++) build 12-Sep-2018 15:30:25 + { build 12-Sep-2018 15:30:25 + // iloc_ptr[0]=SynthesisUtils::nint((scaledSampling_ptr[0]*ix+off_ptr[0])-1); build 12-Sep-2018 15:30:25 + iLoc[0]=(Int)((scaledSampling_ptr[0]*ix+off_ptr[0])-1); build 12-Sep-2018 15:30:25 + igrdpos_ptr[0]=loc_ptr[0]+ix; build 12-Sep-2018 15:30:25 + iCFPos_ptr[0] =iLoc[0]+convOrigin_ptr[0]; build 12-Sep-2018 15:30:25 + wt = getFrom4DArray((const Complex * __restrict__ &)convFuncV, build 12-Sep-2018 15:30:25 + iCFPos_ptr,cfInc_p_ptr);//cfArea; build 12-Sep-2018 15:30:25 + if (dataWVal > 0.0) {wt = conj(wt);} build 12-Sep-2018 15:30:25 + norm += (wt); build 12-Sep-2018 15:30:25 + if (finitePointingOffsets) build 12-Sep-2018 15:30:25 + { build 12-Sep-2018 15:30:25 + wt *= cached_phaseGrad_p(iLoc[0]+phaseGradOrigin_l[0], build 12-Sep-2018 15:30:25 + iLoc[1]+phaseGradOrigin_l[1]); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + addTo4DArray_ptr(gridStore,iGrdPosPtr,gridInc_p_ptr, nvalue,wt); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/Utilities/SDPosInterpolator.cc b/code/synthesis/Utilities/SDPosInterpolator.cc build 12-Sep-2018 15:30:25 index a5404c9..b6b3363 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/Utilities/SDPosInterpolator.cc build 12-Sep-2018 15:30:25 +++ b/code/synthesis/Utilities/SDPosInterpolator.cc build 12-Sep-2018 15:30:25 @@ -84,6 +84,14 @@ void SDPosInterpolator::setup(const Vector >& time, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 calcSplineCoeff(timePointing(i), dirPointing(i), splineCoeff(i)); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + //(3) keep time range build 12-Sep-2018 15:30:25 + timeRangeStart.resize(nant); build 12-Sep-2018 15:30:25 + timeRangeEnd.resize(nant); build 12-Sep-2018 15:30:25 + for (Int iant = 0; iant < nant; ++iant) { build 12-Sep-2018 15:30:25 + timeRangeStart(iant) = timePointing(iant)(0); build 12-Sep-2018 15:30:25 + timeRangeEnd(iant) = timePointing(iant)(timePointing(iant).nelements()-1); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 void SDPosInterpolator::setup(const VisBuffer& vb, const String& pointingDirCol_p) { build 12-Sep-2018 15:30:25 @@ -170,6 +178,14 @@ void SDPosInterpolator::setup(const VisBuffer& vb, const String& pointingDirCol_ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 calcSplineCoeff(timePointing(i), dirPointing(i), splineCoeff(i)); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + //(3) keep time range build 12-Sep-2018 15:30:25 + timeRangeStart.resize(nant); build 12-Sep-2018 15:30:25 + timeRangeEnd.resize(nant); build 12-Sep-2018 15:30:25 + for (Int iant = 0; iant < nant; ++iant) { build 12-Sep-2018 15:30:25 + timeRangeStart(iant) = timePointing(iant)(0); build 12-Sep-2018 15:30:25 + timeRangeEnd(iant) = timePointing(iant)(timePointing(iant).nelements()-1); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 void SDPosInterpolator::setup(const vi::VisBuffer2& vb, const String& pointingDirCol_p) { build 12-Sep-2018 15:30:25 @@ -256,6 +272,14 @@ void SDPosInterpolator::setup(const vi::VisBuffer2& vb, const String& pointingDi build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 calcSplineCoeff(timePointing(i), dirPointing(i), splineCoeff(i)); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + //(3) keep time range build 12-Sep-2018 15:30:25 + timeRangeStart.resize(nant); build 12-Sep-2018 15:30:25 + timeRangeEnd.resize(nant); build 12-Sep-2018 15:30:25 + for (Int iant = 0; iant < nant; ++iant) { build 12-Sep-2018 15:30:25 + timeRangeStart(iant) = timePointing(iant)(0); build 12-Sep-2018 15:30:25 + timeRangeEnd(iant) = timePointing(iant)(timePointing(iant).nelements()-1); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 void SDPosInterpolator::calcSplineCoeff(const Vector& time, build 12-Sep-2018 15:30:25 @@ -365,4 +389,12 @@ Vector > > > SDPosInterpolator::getSplineCoeff() { build 12-Sep-2018 15:30:25 return splineCoeff; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 +Bool SDPosInterpolator::inTimeRange(const Double& time, const Int& antid) { build 12-Sep-2018 15:30:25 + Bool inrange = false; build 12-Sep-2018 15:30:25 + if ((timeRangeStart(antid) <= time) && (time <= timeRangeEnd(antid))) { build 12-Sep-2018 15:30:25 + inrange = true; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return inrange; build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 } //#End casa namespace build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/Utilities/SDPosInterpolator.h b/code/synthesis/Utilities/SDPosInterpolator.h build 12-Sep-2018 15:30:25 index 5b6f8ae..dcb3c11 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/Utilities/SDPosInterpolator.h build 12-Sep-2018 15:30:25 +++ b/code/synthesis/Utilities/SDPosInterpolator.h build 12-Sep-2018 15:30:25 @@ -59,10 +59,13 @@ public: build 12-Sep-2018 15:30:25 const casacore::Int& index, build 12-Sep-2018 15:30:25 const casacore::Int& antid); build 12-Sep-2018 15:30:25 casacore::Vector > > > getSplineCoeff(); build 12-Sep-2018 15:30:25 + casacore::Bool inTimeRange(const casacore::Double& time, const casacore::Int& antid); build 12-Sep-2018 15:30:25 private: build 12-Sep-2018 15:30:25 casacore::Vector > timePointing; //(antid)(index) build 12-Sep-2018 15:30:25 casacore::Vector > > dirPointing; //(antid)(index)(xy) build 12-Sep-2018 15:30:25 casacore::Vector > > > splineCoeff; //(antid)(index)(xy)(order) build 12-Sep-2018 15:30:25 + casacore::Vector timeRangeStart; //(antid) build 12-Sep-2018 15:30:25 + casacore::Vector timeRangeEnd; //(antid) build 12-Sep-2018 15:30:25 void setup(const VisBuffer& vb, build 12-Sep-2018 15:30:25 const casacore::String& pointingDirCol_p); build 12-Sep-2018 15:30:25 void setup(const vi::VisBuffer2& vb, build 12-Sep-2018 15:30:25 diff --git a/code/synthesis/fortran/faccumulateFromGrid.f b/code/synthesis/fortran/faccumulateFromGrid.f build 12-Sep-2018 15:30:25 index 3b43b64..7dbfd44 100644 build 12-Sep-2018 15:30:25 --- a/code/synthesis/fortran/faccumulateFromGrid.f build 12-Sep-2018 15:30:25 +++ b/code/synthesis/fortran/faccumulateFromGrid.f build 12-Sep-2018 15:30:25 @@ -37,17 +37,14 @@ build 12-Sep-2018 15:30:25 data iloc/1,1,1,1/, iCFPos/1,1,1,1/ build 12-Sep-2018 15:30:25 l_igrdpos(3) = igrdpos(3)+1 build 12-Sep-2018 15:30:25 l_igrdpos(4) = igrdpos(4)+1 build 12-Sep-2018 15:30:25 -c norm=0.0 build 12-Sep-2018 15:30:25 l_phaseGradOriginX=phNX/2 + 1 build 12-Sep-2018 15:30:25 l_phaseGradOriginY=phNY/2 + 1 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 do iy=-scaledSupport(2),scaledSupport(2) build 12-Sep-2018 15:30:25 -c iloc(2)=nint(scaledSampling(2)*iy+off(2)) build 12-Sep-2018 15:30:25 iloc(2)=nint(scaledSampling(2)*iy+off(2)-1) build 12-Sep-2018 15:30:25 iCFPos(2)=iloc(2)+convOrigin(2)+1 build 12-Sep-2018 15:30:25 l_igrdpos(2) = loc(2)+iy+1 build 12-Sep-2018 15:30:25 do ix=-scaledSupport(1),scaledSupport(1) build 12-Sep-2018 15:30:25 -c iloc(1)=nint(scaledSampling(1)*ix+off(1)) build 12-Sep-2018 15:30:25 iloc(1)=nint(scaledSampling(1)*ix+off(1)-1) build 12-Sep-2018 15:30:25 iCFPos(1) = iloc(1) + convOrigin(1) + 1 build 12-Sep-2018 15:30:25 l_igrdpos(1) = loc(1) + ix + 1 build 12-Sep-2018 15:30:25 @@ -72,36 +69,12 @@ C build 12-Sep-2018 15:30:25 $ iloc(2) + l_phaseGradOriginY)) build 12-Sep-2018 15:30:25 endif build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -c$$$ tt = phaseGrad(iloc(1) + l_phaseGradOriginX, build 12-Sep-2018 15:30:25 -c$$$ $ iloc(2) + l_phaseGradOriginY) build 12-Sep-2018 15:30:25 -c$$$ if (scaledSupport(1) .eq. 5) then build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -c$$$ if ((iCFPos(1) .gt. cfNX) .or. (iCFPos(2) .gt. cfNY) .or. build 12-Sep-2018 15:30:25 -c$$$ $ (l_igrdpos(1) .gt. imNX) .or. (l_igrdpos(2) .gt. imNY) build 12-Sep-2018 15:30:25 -c$$$ $ .or. (l_igrdpos(3) .gt. imNP) build 12-Sep-2018 15:30:25 -c$$$ $ .or. (l_igrdpos(4) .gt. imNC)) then build 12-Sep-2018 15:30:25 -c$$$ write(*,*) "DG: ", build 12-Sep-2018 15:30:25 -c$$$c $ tt, build 12-Sep-2018 15:30:25 -c$$$ $ iCFPos(1), iCFPos(2), l_igrdpos(1), l_igrdpos(2), build 12-Sep-2018 15:30:25 -c$$$ $ l_igrdpos(3),l_igrdpos(4), scaledSampling(1), build 12-Sep-2018 15:30:25 -c$$$ $ scaledSupport(1) build 12-Sep-2018 15:30:25 -c$$$ endif build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 nvalue = nvalue + wt * grid(l_igrdpos(1), l_igrdpos(2), build 12-Sep-2018 15:30:25 $ l_igrdpos(3), l_igrdpos(4)) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -c$$$ write (*,*) (nvalue), build 12-Sep-2018 15:30:25 -c$$$ $ (wt), build 12-Sep-2018 15:30:25 -c$$$ $ (grid(l_igrdpos(1), l_igrdpos(2), build 12-Sep-2018 15:30:25 -c$$$ $ l_igrdpos(3), l_igrdpos(4))), build 12-Sep-2018 15:30:25 -c$$$ $ abs(wt * grid(l_igrdpos(1), l_igrdpos(2), build 12-Sep-2018 15:30:25 -c$$$ $ l_igrdpos(3), l_igrdpos(4))), build 12-Sep-2018 15:30:25 -c$$$ $ phaseGrad(iloc(1) + l_phaseGradOriginX, build 12-Sep-2018 15:30:25 -c$$$ $ iloc(2) + l_phaseGradOriginY),ix,iy,norm build 12-Sep-2018 15:30:25 enddo build 12-Sep-2018 15:30:25 enddo build 12-Sep-2018 15:30:25 -c nvalue = nvalue *conjg(phasor)/norm build 12-Sep-2018 15:30:25 +c nvalue = nvalue *conjg(phasor)/norm build 12-Sep-2018 15:30:25 c Normalization by norm is done in the Mueller loop in AWVR. build 12-Sep-2018 15:30:25 nvalue = nvalue *conjg(phasor) build 12-Sep-2018 15:30:25 -c$$$ stop build 12-Sep-2018 15:30:25 end build 12-Sep-2018 15:30:25 diff --git a/gcwrap/CMakeLists.txt b/gcwrap/CMakeLists.txt build 12-Sep-2018 15:30:25 index 7ea2c92..5a2f74f 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/CMakeLists.txt build 12-Sep-2018 15:30:25 +++ b/gcwrap/CMakeLists.txt build 12-Sep-2018 15:30:25 @@ -37,6 +37,7 @@ endif() build 12-Sep-2018 15:30:25 set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/install ) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 add_definitions ("-DUseCasacoreNamespace") build 12-Sep-2018 15:30:25 +add_definitions ("-DWITHOUT_BOOST") build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 execute_process( COMMAND svn info build 12-Sep-2018 15:30:25 RESULT_VARIABLE SVNINFOSTATUS build 12-Sep-2018 15:30:25 @@ -67,7 +68,7 @@ include( target ) build 12-Sep-2018 15:30:25 include( CASA ) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 set( CASA_MAJOR_VERSION 5 ) build 12-Sep-2018 15:30:25 -set( CASA_MINOR_VERSION 3 ) build 12-Sep-2018 15:30:25 +set( CASA_MINOR_VERSION 4 ) build 12-Sep-2018 15:30:25 set( CASA_PATCH_VERSION 0 ) build 12-Sep-2018 15:30:25 set( CASA_API_VERSION "${CASA_MAJOR_VERSION}.${CASA_MINOR_VERSION}.${CASA_PATCH_VERSION}" ) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1249,72 +1250,6 @@ casa_find( XERCES build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # build 12-Sep-2018 15:30:25 -# Boost build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# Use the Boost finder that ships with CMake. It needs to be told where boost is. build 12-Sep-2018 15:30:25 -# If the version is >= 1.35, require also boost-system. build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# Note, find_package( Boost ... ) must be called for every cmake invocation build 12-Sep-2018 15:30:25 -# in order to setup non-cached variables build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -if( NOT BOOST_ROOT ) build 12-Sep-2018 15:30:25 - set( BOOST_ROOT ${casa_packages} ) build 12-Sep-2018 15:30:25 -endif() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -set( boost_components regex program_options filesystem thread) build 12-Sep-2018 15:30:25 -find_package( Boost REQUIRED ${boost_components} ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -if( NOT Boost_FOUND ) build 12-Sep-2018 15:30:25 - message( FATAL_ERROR "Boost could not be found. Please check!" ) build 12-Sep-2018 15:30:25 -endif() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# For boost >= 1.35, we need to link also to boost-system build 12-Sep-2018 15:30:25 -if( Boost_VERSION GREATER 103499 ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Force redetection by resetting these variables build 12-Sep-2018 15:30:25 - if( NOT Boost_SYSTEM_FOUND ) build 12-Sep-2018 15:30:25 - message( STATUS "Boost version (${Boost_VERSION}) is 1.35.0 or newer" ) build 12-Sep-2018 15:30:25 - unset( Boost_FOUND ) build 12-Sep-2018 15:30:25 - unset( Boost_INCLUDE_DIR CACHE ) build 12-Sep-2018 15:30:25 - endif() build 12-Sep-2018 15:30:25 - set( boost_components regex program_options filesystem system ) build 12-Sep-2018 15:30:25 - find_package( Boost REQUIRED ${boost_components} ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if( NOT Boost_FOUND ) build 12-Sep-2018 15:30:25 - message( FATAL_ERROR "Boost-system could not be found. Please check!" ) build 12-Sep-2018 15:30:25 - endif() build 12-Sep-2018 15:30:25 -endif() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -if( NOT Boost_VERSION GREATER 104099 AND NOT CASA_IGNORE_VERSION ) build 12-Sep-2018 15:30:25 - message( FATAL_ERROR "Boost version (${Boost_VERSION}) is too old! Must be 104100 (1.41.0) or newer. Please check!" ) build 12-Sep-2018 15:30:25 -endif() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# boost regex drags in dependencencies on international unicode libraries, if they are not build 12-Sep-2018 15:30:25 -# explicitly referenced, loading is left until runtime based upon transitive dependencies. build 12-Sep-2018 15:30:25 -# This thwarts creation of a cleanly relocatable distribution. build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -if(CMAKE_SYSTEM_NAME STREQUAL Linux AND Boost_LIBRARIES) build 12-Sep-2018 15:30:25 - if(EXISTS "/usr/lib64/libicuuc.so") build 12-Sep-2018 15:30:25 - set( Boost_LIBRARIES "${Boost_LIBRARIES};/usr/lib64/libicuuc.so" ) build 12-Sep-2018 15:30:25 - endif( ) build 12-Sep-2018 15:30:25 - if(EXISTS "/usr/lib64/libicudata.so") build 12-Sep-2018 15:30:25 - set( Boost_LIBRARIES "${Boost_LIBRARIES};/usr/lib64/libicudata.so" ) build 12-Sep-2018 15:30:25 - endif( ) build 12-Sep-2018 15:30:25 - if(EXISTS "/usr/lib64/libicui18n.so") build 12-Sep-2018 15:30:25 - set( Boost_LIBRARIES "${Boost_LIBRARIES};/usr/lib64/libicui18n.so" ) build 12-Sep-2018 15:30:25 - endif( ) build 12-Sep-2018 15:30:25 - message(STATUS "Boost_LIBRARIES=${Boost_LIBRARIES}") build 12-Sep-2018 15:30:25 -endif( ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -message( STATUS "Boost_INCLUDE_DIRS=${Boost_INCLUDE_DIRS}; Boost_LIBRARIES=${Boost_LIBRARIES}") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -if( NOT Boost_FOUND ) build 12-Sep-2018 15:30:25 - message( FATAL_ERROR "Boost could not be found. Please check!" ) build 12-Sep-2018 15:30:25 -endif() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 # RPFITS (Fortran) build 12-Sep-2018 15:30:25 # build 12-Sep-2018 15:30:25 casa_find( RPFITS build 12-Sep-2018 15:30:25 @@ -1362,7 +1297,7 @@ endif() build 12-Sep-2018 15:30:25 # The modules must be defined in dependency order! build 12-Sep-2018 15:30:25 # This will set up include paths, and which libraries to link to build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -casa_add_module( tools CASACORE Boost PYTHON QT4 DBUS READLINE DL XERCES LIBSAKURA CASACODE ) build 12-Sep-2018 15:30:25 +casa_add_module( tools CASACORE PYTHON QT4 DBUS READLINE DL XERCES LIBSAKURA CASACODE ) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # build 12-Sep-2018 15:30:25 # ASAP's build depends on something called a makedefs file. Fake one of those. build 12-Sep-2018 15:30:25 @@ -1415,7 +1350,6 @@ endforeach() build 12-Sep-2018 15:30:25 #PYTHONLIBD = ${pythonlibd}\n build 12-Sep-2018 15:30:25 #PYTHONINCD = ${_ii}\n build 12-Sep-2018 15:30:25 #PYTHONLIB = ${PYTHON_LIBRARIES}\n build 12-Sep-2018 15:30:25 -#BOOSTROOT = ${BOOST_ROOT}\n build 12-Sep-2018 15:30:25 #RPFITSLIBD = ${rpfitslibd}\n build 12-Sep-2018 15:30:25 #CFITSIOLIBD = ${cfitsiolibd}\n build 12-Sep-2018 15:30:25 #CFITSIOINCD = ${CFITSIO_INCLUDE_DIRS}\n build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/CMakeLists.txt b/gcwrap/python/CMakeLists.txt build 12-Sep-2018 15:30:25 index d06bec0..cef738e 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/CMakeLists.txt build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/CMakeLists.txt build 12-Sep-2018 15:30:25 @@ -90,21 +90,17 @@ scripts/TablePlotTkAgg.py build 12-Sep-2018 15:30:25 scripts/task_accor.py build 12-Sep-2018 15:30:25 scripts/task_accum.py build 12-Sep-2018 15:30:25 scripts/task_applycal.py build 12-Sep-2018 15:30:25 -scripts/task_autoclean.py build 12-Sep-2018 15:30:25 scripts/task_asdmsummary.py build 12-Sep-2018 15:30:25 scripts/task_bandpass.py build 12-Sep-2018 15:30:25 scripts/task_blcal.py build 12-Sep-2018 15:30:25 -scripts/task_boxit.py build 12-Sep-2018 15:30:25 scripts/task_browsetable.py build 12-Sep-2018 15:30:25 scripts/task_calstat.py build 12-Sep-2018 15:30:25 scripts/task_caltabconvert.py build 12-Sep-2018 15:30:25 scripts/task_clean.py build 12-Sep-2018 15:30:25 scripts/task_clearcal.py build 12-Sep-2018 15:30:25 -scripts/task_clearplot.py build 12-Sep-2018 15:30:25 scripts/task_clearstat.py build 12-Sep-2018 15:30:25 scripts/task_concat.py build 12-Sep-2018 15:30:25 scripts/task_conjugatevis.py build 12-Sep-2018 15:30:25 -scripts/task_csvclean.py build 12-Sep-2018 15:30:25 scripts/task_cvel.py build 12-Sep-2018 15:30:25 scripts/task_cvel2.py build 12-Sep-2018 15:30:25 scripts/task_deconvolve.py build 12-Sep-2018 15:30:25 @@ -124,7 +120,6 @@ scripts/task_ft.py build 12-Sep-2018 15:30:25 scripts/task_gaincal.py build 12-Sep-2018 15:30:25 scripts/task_gencal.py build 12-Sep-2018 15:30:25 scripts/task_hanningsmooth.py build 12-Sep-2018 15:30:25 -#scripts/task_hanningsmooth2.py build 12-Sep-2018 15:30:25 scripts/task_help.py build 12-Sep-2018 15:30:25 scripts/task_imcollapse.py build 12-Sep-2018 15:30:25 scripts/task_imcontsub.py build 12-Sep-2018 15:30:25 @@ -138,7 +133,6 @@ scripts/task_impbcor.py build 12-Sep-2018 15:30:25 scripts/task_importatca.py build 12-Sep-2018 15:30:25 scripts/task_importasap.py build 12-Sep-2018 15:30:25 scripts/task_importasdm.py build 12-Sep-2018 15:30:25 -scripts/task_importevla.py build 12-Sep-2018 15:30:25 scripts/task_importfits.py build 12-Sep-2018 15:30:25 scripts/task_importfitsidi.py build 12-Sep-2018 15:30:25 scripts/task_importgmrt.py build 12-Sep-2018 15:30:25 @@ -166,21 +160,16 @@ scripts/task_listpartition.py build 12-Sep-2018 15:30:25 scripts/task_listsdm.py build 12-Sep-2018 15:30:25 scripts/task_listvis.py build 12-Sep-2018 15:30:25 scripts/task_makemask.py build 12-Sep-2018 15:30:25 -scripts/task_mosaic.py build 12-Sep-2018 15:30:25 scripts/task_mstransform.py build 12-Sep-2018 15:30:25 scripts/task_msuvbin.py build 12-Sep-2018 15:30:25 +scripts/task_partition.py build 12-Sep-2018 15:30:25 scripts/task_plotants.py build 12-Sep-2018 15:30:25 scripts/task_plotbandpass.py build 12-Sep-2018 15:30:25 scripts/task_plotcal.py build 12-Sep-2018 15:30:25 scripts/task_plotms.py build 12-Sep-2018 15:30:25 -scripts/task_plotuv.py build 12-Sep-2018 15:30:25 scripts/task_plotweather.py build 12-Sep-2018 15:30:25 scripts/task_plotprofilemap.py build 12-Sep-2018 15:30:25 -#scripts/task_plotxy.py build 12-Sep-2018 15:30:25 -scripts/task_oldhanningsmooth.py build 12-Sep-2018 15:30:25 -scripts/task_oldplotants.py build 12-Sep-2018 15:30:25 scripts/task_oldsplit.py build 12-Sep-2018 15:30:25 -scripts/task_partition.py build 12-Sep-2018 15:30:25 scripts/task_polcal.py build 12-Sep-2018 15:30:25 scripts/task_predictcomp.py build 12-Sep-2018 15:30:25 scripts/task_rerefant.py build 12-Sep-2018 15:30:25 @@ -196,7 +185,6 @@ scripts/task_tsdimaging.py build 12-Sep-2018 15:30:25 scripts/task_sdsidebandsplit.py build 12-Sep-2018 15:30:25 scripts/task_sdsmooth.py build 12-Sep-2018 15:30:25 scripts/task_setjy.py build 12-Sep-2018 15:30:25 -scripts/task_ssoflux.py build 12-Sep-2018 15:30:25 scripts/task_simalma.py build 12-Sep-2018 15:30:25 scripts/task_simobserve.py build 12-Sep-2018 15:30:25 scripts/task_simanalyze.py build 12-Sep-2018 15:30:25 @@ -209,8 +197,8 @@ scripts/task_splattotable.py build 12-Sep-2018 15:30:25 scripts/task_split.py build 12-Sep-2018 15:30:25 #scripts/task_split2.py build 12-Sep-2018 15:30:25 scripts/task_spxfit.py build 12-Sep-2018 15:30:25 +scripts/task_oldstatwt.py build 12-Sep-2018 15:30:25 scripts/task_statwt.py build 12-Sep-2018 15:30:25 -scripts/task_statwt2.py build 12-Sep-2018 15:30:25 scripts/task_tclean.py build 12-Sep-2018 15:30:25 scripts/task_tclean2.py build 12-Sep-2018 15:30:25 scripts/task_testconcat.py build 12-Sep-2018 15:30:25 @@ -224,11 +212,8 @@ scripts/task_wvrgcal.py build 12-Sep-2018 15:30:25 scripts/task_msview.py build 12-Sep-2018 15:30:25 scripts/task_imview.py build 12-Sep-2018 15:30:25 scripts/task_vishead.py build 12-Sep-2018 15:30:25 -scripts/task_visstatold.py build 12-Sep-2018 15:30:25 scripts/task_visstat.py build 12-Sep-2018 15:30:25 -scripts/task_visstat2.py build 12-Sep-2018 15:30:25 scripts/task_widebandpbcor.py build 12-Sep-2018 15:30:25 -scripts/task_widefield.py build 12-Sep-2018 15:30:25 scripts/TerminalController.py build 12-Sep-2018 15:30:25 scripts/tget.py build 12-Sep-2018 15:30:25 scripts/update_spw.py build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/casa.py b/gcwrap/python/scripts/casa.py build 12-Sep-2018 15:30:25 index c912385..8513bd3 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/casa.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/casa.py build 12-Sep-2018 15:30:25 @@ -166,20 +166,16 @@ attool = _casac.atmosphere build 12-Sep-2018 15:30:25 from accum import accum build 12-Sep-2018 15:30:25 from applycal import applycal build 12-Sep-2018 15:30:25 from asdmsummary import asdmsummary build 12-Sep-2018 15:30:25 -from autoclean import autoclean build 12-Sep-2018 15:30:25 from bandpass import bandpass build 12-Sep-2018 15:30:25 from blcal import blcal build 12-Sep-2018 15:30:25 -from boxit import boxit build 12-Sep-2018 15:30:25 from browsetable import browsetable build 12-Sep-2018 15:30:25 from calstat import calstat build 12-Sep-2018 15:30:25 from caltabconvert import caltabconvert build 12-Sep-2018 15:30:25 from clean import clean build 12-Sep-2018 15:30:25 from clearcal import clearcal build 12-Sep-2018 15:30:25 -from clearplot import clearplot build 12-Sep-2018 15:30:25 from clearstat import clearstat build 12-Sep-2018 15:30:25 from concat import concat build 12-Sep-2018 15:30:25 from conjugatevis import conjugatevis build 12-Sep-2018 15:30:25 -from csvclean import csvclean build 12-Sep-2018 15:30:25 from cvel import cvel build 12-Sep-2018 15:30:25 from cvel2 import cvel2 build 12-Sep-2018 15:30:25 from deconvolve import deconvolve build 12-Sep-2018 15:30:25 @@ -211,7 +207,6 @@ from impbcor import impbcor build 12-Sep-2018 15:30:25 from importatca import importatca build 12-Sep-2018 15:30:25 from importasap import importasap build 12-Sep-2018 15:30:25 from importasdm import importasdm build 12-Sep-2018 15:30:25 -from importevla import importevla build 12-Sep-2018 15:30:25 from importfits import importfits build 12-Sep-2018 15:30:25 from importfitsidi import importfitsidi build 12-Sep-2018 15:30:25 from importgmrt import importgmrt build 12-Sep-2018 15:30:25 @@ -236,17 +231,13 @@ from listpartition import listpartition build 12-Sep-2018 15:30:25 from listsdm import listsdm build 12-Sep-2018 15:30:25 from listvis import listvis build 12-Sep-2018 15:30:25 from makemask import makemask build 12-Sep-2018 15:30:25 -from mosaic import mosaic build 12-Sep-2018 15:30:25 from mstransform import mstransform build 12-Sep-2018 15:30:25 from msuvbin import msuvbin build 12-Sep-2018 15:30:25 -from oldhanningsmooth import oldhanningsmooth build 12-Sep-2018 15:30:25 -from oldplotants import oldplotants build 12-Sep-2018 15:30:25 from oldsplit import oldsplit build 12-Sep-2018 15:30:25 from plotants import plotants build 12-Sep-2018 15:30:25 from plotbandpass import plotbandpass build 12-Sep-2018 15:30:25 from plotcal import plotcal build 12-Sep-2018 15:30:25 from plotms import plotms build 12-Sep-2018 15:30:25 -from plotuv import plotuv build 12-Sep-2018 15:30:25 from plotweather import plotweather build 12-Sep-2018 15:30:25 from plotprofilemap import plotprofilemap build 12-Sep-2018 15:30:25 from partition import partition build 12-Sep-2018 15:30:25 @@ -264,7 +255,6 @@ from sdimaging import sdimaging build 12-Sep-2018 15:30:25 from sdsidebandsplit import sdsidebandsplit build 12-Sep-2018 15:30:25 from sdsmooth import sdsmooth build 12-Sep-2018 15:30:25 from setjy import setjy build 12-Sep-2018 15:30:25 -from ssoflux import ssoflux build 12-Sep-2018 15:30:25 from simalma import simalma build 12-Sep-2018 15:30:25 from simobserve import simobserve build 12-Sep-2018 15:30:25 from simanalyze import simanalyze build 12-Sep-2018 15:30:25 @@ -277,8 +267,8 @@ from splattotable import splattotable build 12-Sep-2018 15:30:25 from split import split build 12-Sep-2018 15:30:25 #from split2 import split2 build 12-Sep-2018 15:30:25 from spxfit import spxfit build 12-Sep-2018 15:30:25 +from oldstatwt import oldstatwt build 12-Sep-2018 15:30:25 from statwt import statwt build 12-Sep-2018 15:30:25 -from statwt2 import statwt2 build 12-Sep-2018 15:30:25 from tclean import tclean build 12-Sep-2018 15:30:25 from tclean2 import tclean2 build 12-Sep-2018 15:30:25 from testconcat import testconcat build 12-Sep-2018 15:30:25 @@ -290,7 +280,4 @@ from wvrgcal import wvrgcal build 12-Sep-2018 15:30:25 from virtualconcat import virtualconcat build 12-Sep-2018 15:30:25 from vishead import vishead build 12-Sep-2018 15:30:25 from visstat import visstat build 12-Sep-2018 15:30:25 -from visstat2 import visstat2 build 12-Sep-2018 15:30:25 -from visstatold import visstatold build 12-Sep-2018 15:30:25 from widebandpbcor import widebandpbcor build 12-Sep-2018 15:30:25 -from widefield import widefield build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/imagerhelpers/CMakeLists.txt b/gcwrap/python/scripts/imagerhelpers/CMakeLists.txt build 12-Sep-2018 15:30:25 index 2ac2770..4e3b4ec 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/imagerhelpers/CMakeLists.txt build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/imagerhelpers/CMakeLists.txt build 12-Sep-2018 15:30:25 @@ -1,4 +1,4 @@ build 12-Sep-2018 15:30:25 -# Copyright (C) 2010 build 12-Sep-2018 15:30:25 +# Copyright (C) 2010...2017 build 12-Sep-2018 15:30:25 # Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:25 # build 12-Sep-2018 15:30:25 # This library is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:25 @@ -25,6 +25,7 @@ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 casa_add_python( tools tools_imagerhelpers lib/python${PYTHONV}/imagerhelpers build 12-Sep-2018 15:30:25 + fixedDict.py build 12-Sep-2018 15:30:25 imager_base.py build 12-Sep-2018 15:30:25 imager_parallel_cube.py build 12-Sep-2018 15:30:25 parallel_imager_helper.py build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/imagerhelpers/fixedDict.py b/gcwrap/python/scripts/imagerhelpers/fixedDict.py build 12-Sep-2018 15:30:25 new file mode 100644 build 12-Sep-2018 15:30:25 index 0000000..44573bc build 12-Sep-2018 15:30:25 --- /dev/null build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/imagerhelpers/fixedDict.py build 12-Sep-2018 15:30:25 @@ -0,0 +1,41 @@ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class fixedDict(dict): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + This allows for imposing a set keys. When using as parameters it forces build 12-Sep-2018 15:30:25 + the user to use only allowed keys build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + def __init__(self, *args, **kwargs): build 12-Sep-2018 15:30:25 + self.update(*args, **kwargs) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def __delitem__(self, key): build 12-Sep-2018 15:30:25 + dict.__delitem__(self, key) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def __setitem__(self, key, item): build 12-Sep-2018 15:30:25 + if key not in self.keys(): build 12-Sep-2018 15:30:25 + raise KeyError("The key {} is not defined.".format(key)) build 12-Sep-2018 15:30:25 + dict.__setitem__(self, key, item) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def __repr__(self): build 12-Sep-2018 15:30:25 + dictrepr = dict.__repr__(self) build 12-Sep-2018 15:30:25 + return dictrepr build 12-Sep-2018 15:30:25 +# return '%s(%s)' % (type(self).__name__, dictrepr) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def clear(self): build 12-Sep-2018 15:30:25 + dict.clear(self) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def copy(self): build 12-Sep-2018 15:30:25 + copydict = dict.copy(self) build 12-Sep-2018 15:30:25 + return fixedDict(copydict) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def items(self): build 12-Sep-2018 15:30:25 + return zip(self.keys(), self.values()) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def keys(self): build 12-Sep-2018 15:30:25 + return dict.keys(self) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def update(self, *args, **kwargs): build 12-Sep-2018 15:30:25 + for key, value in dict(*args, **kwargs).iteritems(): build 12-Sep-2018 15:30:25 + dict.__setitem__(self, key,value) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/imagerhelpers/imager_base.py b/gcwrap/python/scripts/imagerhelpers/imager_base.py build 12-Sep-2018 15:30:25 index c13dc3e..6cef130 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/imagerhelpers/imager_base.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/imagerhelpers/imager_base.py build 12-Sep-2018 15:30:25 @@ -381,6 +381,18 @@ class PySynthesisImager: build 12-Sep-2018 15:30:25 self.SItool.makesdpsf() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ############################################# build 12-Sep-2018 15:30:25 + def makeImage(self, imagetype='observed', image='', compleximage='', imagefieldid=0): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + This should replace makeSDImage, makeSDPSF and makePSF build 12-Sep-2018 15:30:25 + etc in the long run build 12-Sep-2018 15:30:25 + But for now you can do the following images i.e string recognized by type build 12-Sep-2018 15:30:25 + "observed", "model", "corrected", "psf", "residual", "singledish-observed", build 12-Sep-2018 15:30:25 + "singledish", "coverage", "holography", "holography-observed" build 12-Sep-2018 15:30:25 + For holography the FTmachine should be SDGrid and the baselines build 12-Sep-2018 15:30:25 + selected should be those that are pointed up with the antenna which is rastering. build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + self.SItool.makeimage(imagetype, image, compleximage, imagefieldid) build 12-Sep-2018 15:30:25 +############################################# build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ## Overloaded for parallel runs build 12-Sep-2018 15:30:25 def setWeighting(self): build 12-Sep-2018 15:30:25 @@ -538,7 +550,18 @@ class PySynthesisImager: build 12-Sep-2018 15:30:25 pl.ion() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 return summ; build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + ############################################# build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def unlockimages( self, imageid=0 ): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + Will try to unlock images attached for the image or outlier field id build 12-Sep-2018 15:30:25 + in this instance build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + retval=False; build 12-Sep-2018 15:30:25 + if(len(self.PStools)> imageid): build 12-Sep-2018 15:30:25 + retval=self.SItool.unlockimages(imageid) build 12-Sep-2018 15:30:25 + retval=retval and self.PStools[imageid].unlockimages() build 12-Sep-2018 15:30:25 + return retval build 12-Sep-2018 15:30:25 ####################################################### build 12-Sep-2018 15:30:25 ####################################################### build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/imagerhelpers/input_parameters.py b/gcwrap/python/scripts/imagerhelpers/input_parameters.py build 12-Sep-2018 15:30:25 index a99f205..320f191 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/imagerhelpers/input_parameters.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/imagerhelpers/input_parameters.py build 12-Sep-2018 15:30:25 @@ -7,7 +7,8 @@ import time build 12-Sep-2018 15:30:25 import re; build 12-Sep-2018 15:30:25 from taskinit import * build 12-Sep-2018 15:30:25 import copy build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 +#from imagerhelpers.fixedDict import fixedDict build 12-Sep-2018 15:30:25 +fixedDict=dict build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ''' build 12-Sep-2018 15:30:25 A set of helper functions for the tasks tclean build 12-Sep-2018 15:30:25 @@ -146,14 +147,15 @@ class ImagerParameters(): build 12-Sep-2018 15:30:25 minweight=0.0, build 12-Sep-2018 15:30:25 clipminmax=False build 12-Sep-2018 15:30:25 ): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + self.allparameters=fixedDict(locals()) build 12-Sep-2018 15:30:25 + del self.allparameters['self'] build 12-Sep-2018 15:30:25 self.defaultKey="0"; build 12-Sep-2018 15:30:25 ## Selection params. For multiple MSs, all are lists. build 12-Sep-2018 15:30:25 ## For multiple nodes, the selection parameters are modified inside PySynthesisImager build 12-Sep-2018 15:30:25 - self.allselpars = {'msname':msname, 'field':field, 'spw':spw, 'scan':scan, build 12-Sep-2018 15:30:25 + self.allselpars = fixedDict({'msname':msname, 'field':field, 'spw':spw, 'scan':scan, build 12-Sep-2018 15:30:25 'timestr':timestr, 'uvdist':uvdist, 'antenna':antenna, 'obs':obs,'state':state, build 12-Sep-2018 15:30:25 'datacolumn':datacolumn, build 12-Sep-2018 15:30:25 - 'savemodel':savemodel } build 12-Sep-2018 15:30:25 + 'savemodel':savemodel }) build 12-Sep-2018 15:30:25 # 'usescratch':usescratch, 'readonly':readonly} build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ## Imaging/deconvolution parameters build 12-Sep-2018 15:30:25 @@ -163,15 +165,15 @@ class ImagerParameters(): build 12-Sep-2018 15:30:25 self.outlierfile = outlierfile build 12-Sep-2018 15:30:25 ## Initialize the parameter lists with the 'main' or '0' field's parameters build 12-Sep-2018 15:30:25 ######### Image definition build 12-Sep-2018 15:30:25 - self.allimpars = { self.defaultKey :{'imagename':imagename, 'nchan':nchan, 'imsize':imsize, build 12-Sep-2018 15:30:25 + self.allimpars = fixedDict({ self.defaultKey :fixedDict({'imagename':imagename, 'nchan':nchan, 'imsize':imsize, build 12-Sep-2018 15:30:25 'cell':cell, 'phasecenter':phasecenter, 'stokes': stokes, build 12-Sep-2018 15:30:25 'specmode':specmode, 'start':start, 'width':width, 'veltype':veltype, build 12-Sep-2018 15:30:25 'nterms':nterms,'restfreq':restfreq, build 12-Sep-2018 15:30:25 'outframe':outframe, 'reffreq':reffreq, 'sysvel':sysvel, 'sysvelframe':sysvelframe, build 12-Sep-2018 15:30:25 'projection':projection, build 12-Sep-2018 15:30:25 - 'restart':restart, 'startmodel':startmodel,'deconvolver':deconvolver} } build 12-Sep-2018 15:30:25 + 'restart':restart, 'startmodel':startmodel,'deconvolver':deconvolver}) }) build 12-Sep-2018 15:30:25 ######### Gridding build 12-Sep-2018 15:30:25 - self.allgridpars = { self.defaultKey :{'gridder':gridder, build 12-Sep-2018 15:30:25 + self.allgridpars = fixedDict({ self.defaultKey :fixedDict({'gridder':gridder, build 12-Sep-2018 15:30:25 'aterm': aterm, 'psterm':psterm, 'mterm': mterm, 'wbawp': wbawp, build 12-Sep-2018 15:30:25 'cfcache': cfcache,'dopointing':dopointing, 'dopbcorr':dopbcorr, build 12-Sep-2018 15:30:25 'conjbeams':conjbeams, 'computepastep':computepastep, build 12-Sep-2018 15:30:25 @@ -182,37 +184,38 @@ class ImagerParameters(): build 12-Sep-2018 15:30:25 ## single-dish specific build 12-Sep-2018 15:30:25 'convfunc': gridfunction, 'convsupport': convsupport, build 12-Sep-2018 15:30:25 'truncate': truncate, 'gwidth': gwidth, 'jwidth': jwidth, build 12-Sep-2018 15:30:25 - 'minweight': minweight, 'clipminmax': clipminmax} } build 12-Sep-2018 15:30:25 + 'minweight': minweight, 'clipminmax': clipminmax, 'imagename':imagename}) }) build 12-Sep-2018 15:30:25 ######### weighting build 12-Sep-2018 15:30:25 - self.weightpars = {'type':weighting,'robust':robust, 'npixels':npixels,'uvtaper':uvtaper} build 12-Sep-2018 15:30:25 + self.weightpars = fixedDict({'type':weighting,'robust':robust, 'npixels':npixels,'uvtaper':uvtaper}) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ######### Normalizers ( this is where flat noise, flat sky rules will go... ) build 12-Sep-2018 15:30:25 - self.allnormpars = { self.defaultKey : {#'mtype': mtype, build 12-Sep-2018 15:30:25 + self.allnormpars = fixedDict({ self.defaultKey : fixedDict({#'mtype': mtype, build 12-Sep-2018 15:30:25 'pblimit': pblimit,'nterms':nterms,'facets':facets, build 12-Sep-2018 15:30:25 'normtype':normtype, 'workdir':workdir, build 12-Sep-2018 15:30:25 - 'deconvolver':deconvolver} } build 12-Sep-2018 15:30:25 + 'deconvolver':deconvolver, 'imagename': imagename} ) }) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ######### Deconvolution build 12-Sep-2018 15:30:25 - self.alldecpars = { self.defaultKey: { 'id':0, 'deconvolver':deconvolver, 'nterms':nterms, build 12-Sep-2018 15:30:25 + self.alldecpars = fixedDict({ self.defaultKey: fixedDict({ 'id':0, 'deconvolver':deconvolver, 'nterms':nterms, build 12-Sep-2018 15:30:25 'scales':scales, 'scalebias':scalebias, 'restoringbeam':restoringbeam, 'usemask':usemask, build 12-Sep-2018 15:30:25 'mask':mask, 'pbmask':pbmask, 'maskthreshold':maskthreshold, build 12-Sep-2018 15:30:25 'maskresolution':maskresolution, 'nmask':nmask, build 12-Sep-2018 15:30:25 #'maskresolution':maskresolution, 'nmask':nmask,'autoadjust':autoadjust, build 12-Sep-2018 15:30:25 'sidelobethreshold':sidelobethreshold, 'noisethreshold':noisethreshold, build 12-Sep-2018 15:30:25 'lownoisethreshold':lownoisethreshold, 'negativethreshold':negativethreshold,'smoothfactor':smoothfactor, build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 'minbeamfrac':minbeamfrac, 'cutthreshold':cutthreshold, 'growiterations':growiterations, build 12-Sep-2018 15:30:25 'dogrowprune':dogrowprune, 'minpercentchange':minpercentchange, 'verbose':verbose, build 12-Sep-2018 15:30:25 - 'interactive':interactive, 'startmodel':startmodel, 'nsigma':nsigma} } build 12-Sep-2018 15:30:25 + 'interactive':interactive, 'startmodel':startmodel, 'nsigma':nsigma, 'imagename':imagename}) }) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ######### Iteration control. build 12-Sep-2018 15:30:25 - self.iterpars = { 'niter':niter, 'cycleniter':cycleniter, 'threshold':threshold, build 12-Sep-2018 15:30:25 + self.iterpars = fixedDict({ 'niter':niter, 'cycleniter':cycleniter, 'threshold':threshold, build 12-Sep-2018 15:30:25 'loopgain':loopgain, 'interactive':interactive, build 12-Sep-2018 15:30:25 'cyclefactor':cyclefactor, 'minpsffraction':minpsffraction, build 12-Sep-2018 15:30:25 'maxpsffraction':maxpsffraction, build 12-Sep-2018 15:30:25 - 'savemodel':savemodel,'nsigma':nsigma} build 12-Sep-2018 15:30:25 + 'savemodel':savemodel,'nsigma':nsigma}) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ######### CFCache params. build 12-Sep-2018 15:30:25 - self.cfcachepars = {'cflist': cflist}; build 12-Sep-2018 15:30:25 + self.cfcachepars = fixedDict({'cflist': cflist}); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 #self.reusename=reuse build 12-Sep-2018 15:30:25 @@ -234,6 +237,9 @@ class ImagerParameters(): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 self.printParameters() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + def getAllPars(self): build 12-Sep-2018 15:30:25 + """Return the state of all parameters""" build 12-Sep-2018 15:30:25 + return self.allparameters build 12-Sep-2018 15:30:25 def getSelPars(self): build 12-Sep-2018 15:30:25 return self.allselpars build 12-Sep-2018 15:30:25 def getImagePars(self): build 12-Sep-2018 15:30:25 @@ -252,19 +258,26 @@ class ImagerParameters(): build 12-Sep-2018 15:30:25 return self.cfcachepars; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def setSelPars(self,selpars): build 12-Sep-2018 15:30:25 - self.allselpars = selpars build 12-Sep-2018 15:30:25 + for key in selpars.keys(): build 12-Sep-2018 15:30:25 + self.allselpars[key] = selpars[key] build 12-Sep-2018 15:30:25 def setImagePars(self,impars): build 12-Sep-2018 15:30:25 - self.allimpars = impars build 12-Sep-2018 15:30:25 + for key in impars.keys(): build 12-Sep-2018 15:30:25 + self.allimpars[key] = impars[key] build 12-Sep-2018 15:30:25 def setGridPars(self,gridpars): build 12-Sep-2018 15:30:25 - self.allgridpars = gridpars build 12-Sep-2018 15:30:25 + for key in gridpars.keys(): build 12-Sep-2018 15:30:25 + self.allgridpars[key] = gridpars[key] build 12-Sep-2018 15:30:25 def setWeightPars(self,weightpars): build 12-Sep-2018 15:30:25 - self.weightpars = weightpars build 12-Sep-2018 15:30:25 + for key in weightpars.keys(): build 12-Sep-2018 15:30:25 + self.weightpars[key] = weightpars[key] build 12-Sep-2018 15:30:25 def setDecPars(self,decpars): build 12-Sep-2018 15:30:25 - self.alldecpars = decpars build 12-Sep-2018 15:30:25 + for key in decpars.keys(): build 12-Sep-2018 15:30:25 + self.alldecpars[key] = decpars[key] build 12-Sep-2018 15:30:25 def setIterPars(self,iterpars): build 12-Sep-2018 15:30:25 - self.iterpars = iterpars build 12-Sep-2018 15:30:25 + for key in iterpars.keys(): build 12-Sep-2018 15:30:25 + self.iterpars[key] = iterpars[key] build 12-Sep-2018 15:30:25 def setNormPars(self,normpars): build 12-Sep-2018 15:30:25 - self.allnormpars = normpars build 12-Sep-2018 15:30:25 + for key in normpars.keys(): build 12-Sep-2018 15:30:25 + self.allnormpars[key] = normpars[key] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -284,7 +297,7 @@ class ImagerParameters(): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ### MOVE this segment of code to the constructor so that it's clear which parameters go where ! build 12-Sep-2018 15:30:25 ### Copy them from 'impars' to 'normpars' and 'decpars' build 12-Sep-2018 15:30:25 - self.iterpars['allimages']={} build 12-Sep-2018 15:30:25 + self.iterpars.update({'allimages':{} }) build 12-Sep-2018 15:30:25 for immod in self.allimpars.keys() : build 12-Sep-2018 15:30:25 self.allnormpars[immod]['imagename'] = self.allimpars[immod]['imagename'] build 12-Sep-2018 15:30:25 self.alldecpars[immod]['imagename'] = self.allimpars[immod]['imagename'] build 12-Sep-2018 15:30:25 @@ -387,13 +400,13 @@ class ImagerParameters(): build 12-Sep-2018 15:30:25 # Update outlier parameters with modifications from outlier files build 12-Sep-2018 15:30:25 for immod in range(0, len(outlierpars)): build 12-Sep-2018 15:30:25 modelid = str(immod+1) build 12-Sep-2018 15:30:25 - self.allimpars[ modelid ] = copy.deepcopy(self.allimpars[ '0' ]) build 12-Sep-2018 15:30:25 + self.allimpars.update({modelid : self.allimpars[ '0' ].copy()}) build 12-Sep-2018 15:30:25 self.allimpars[ modelid ].update(outlierpars[immod]['impars']) build 12-Sep-2018 15:30:25 - self.allgridpars[ modelid ] = copy.deepcopy(self.allgridpars[ '0' ]) build 12-Sep-2018 15:30:25 + self.allgridpars.update({ modelid : self.allgridpars[ '0' ].copy()}) build 12-Sep-2018 15:30:25 self.allgridpars[ modelid ].update(outlierpars[immod]['gridpars']) build 12-Sep-2018 15:30:25 - self.alldecpars[ modelid ] = copy.deepcopy(self.alldecpars[ '0' ]) build 12-Sep-2018 15:30:25 + self.alldecpars.update( {modelid : self.alldecpars[ '0' ].copy()}) build 12-Sep-2018 15:30:25 self.alldecpars[ modelid ].update(outlierpars[immod]['decpars']) build 12-Sep-2018 15:30:25 - self.allnormpars[ modelid ] = copy.deepcopy(self.allnormpars[ '0' ]) build 12-Sep-2018 15:30:25 + self.allnormpars.update( {modelid : self.allnormpars[ '0' ].copy()}) build 12-Sep-2018 15:30:25 self.allnormpars[ modelid ].update(outlierpars[immod]['normpars']) build 12-Sep-2018 15:30:25 self.alldecpars[ modelid ][ 'id' ] = immod+1 ## Try to eliminate. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/imagerhelpers/test_imager_helper.py b/gcwrap/python/scripts/imagerhelpers/test_imager_helper.py build 12-Sep-2018 15:30:25 index a10cb42..7cc5274 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/imagerhelpers/test_imager_helper.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/imagerhelpers/test_imager_helper.py build 12-Sep-2018 15:30:25 @@ -210,6 +210,7 @@ class TestHelpers(): build 12-Sep-2018 15:30:25 if imexist != None: build 12-Sep-2018 15:30:25 if type(imexist)==list: build 12-Sep-2018 15:30:25 pstr += self.checkims(imexist, True) build 12-Sep-2018 15:30:25 + pstr += self.check_keywords(imexist) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 if imexistnot != None: build 12-Sep-2018 15:30:25 if type(imexistnot)==list: build 12-Sep-2018 15:30:25 @@ -458,6 +459,124 @@ class TestHelpers(): build 12-Sep-2018 15:30:25 _ia.close() build 12-Sep-2018 15:30:25 return csys build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + def check_keywords(self, imlist): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + Keyword related checks (presence/absence of records and entries in these records, build 12-Sep-2018 15:30:25 + in the keywords of the image table). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + :param imlist: names of the images produced by a test execution. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + :returns: the usual (test_imager_helper) string with success/error messages. build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + # Keeping the general approach. This is fragile! build 12-Sep-2018 15:30:25 + testname = inspect.stack()[2][3] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # accumulator of error strings build 12-Sep-2018 15:30:25 + pstr = '' build 12-Sep-2018 15:30:25 + for imname in imlist: build 12-Sep-2018 15:30:25 + if os.path.exists(imname): build 12-Sep-2018 15:30:25 + issues = self.check_im_keywords(imname, check_misc=True, build 12-Sep-2018 15:30:25 + check_extended=True) build 12-Sep-2018 15:30:25 + if issues: build 12-Sep-2018 15:30:25 + pstr += '[{0}] {1}: {2}'.format(testname, imname, issues) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if not pstr: build 12-Sep-2018 15:30:25 + pstr += 'All expected keywords in imageinfo, miscinfo, and coords found.\n' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + return pstr build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def check_im_keywords(self, imname, check_misc=True, check_extended=True): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + Checks several lists of expected and forbidden keywords and entries of these build 12-Sep-2018 15:30:25 + keywords. build 12-Sep-2018 15:30:25 + Forbidden keywords lists introduced with CAS-9231 (prevent duplication of build 12-Sep-2018 15:30:25 + TELESCOP and OBJECT). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Note that if imname is the top level of a refconcat image, there's no table to open build 12-Sep-2018 15:30:25 + to look for its keywords. In these cases nothing is checked. We would not have the build 12-Sep-2018 15:30:25 + 'imageinfo' keywords, only the MiscInfo that goes in imageconcat.json and I'm not build 12-Sep-2018 15:30:25 + sure yet how that one is supposed to behave. build 12-Sep-2018 15:30:25 + Tests should check the 'getNParts() from imname' to make sure the components of build 12-Sep-2018 15:30:25 + the refconcat image exist, have the expected keywords, etc. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + :param imname: image name (output image from tclean) build 12-Sep-2018 15:30:25 + :param check_misc: whether to check miscinfo in addition to imageinfo' build 12-Sep-2018 15:30:25 + :param check_extended: can leave enabled for images other than .tt?, .alpha, etc. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + :returns: the usual (test_imager_helper) string with success/error messages. build 12-Sep-2018 15:30:25 + Errors marked with '(Fail' as per self.verdict(). build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + tbt = tbtool() build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + tbt.open(imname) build 12-Sep-2018 15:30:25 + keys = tbt.getkeywords() build 12-Sep-2018 15:30:25 + except RuntimeError as exc: build 12-Sep-2018 15:30:25 + if os.path.isfile(os.path.join(os.path.dirname(imname), 'imageconcat.json')): build 12-Sep-2018 15:30:25 + # Looks like a refconcat image, nothing to check build 12-Sep-2018 15:30:25 + return '' build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + pstr = 'Cannot open image table to check keywords: {0}'.format(imname) build 12-Sep-2018 15:30:25 + return pstr build 12-Sep-2018 15:30:25 + finally: build 12-Sep-2018 15:30:25 + tbt.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + pstr = '' build 12-Sep-2018 15:30:25 + if len(keys) <= 0: build 12-Sep-2018 15:30:25 + pstr += ('No keywords found ({0})'. build 12-Sep-2018 15:30:25 + format(self.verdict(False))) build 12-Sep-2018 15:30:25 + return pstr build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # Records that need to be present build 12-Sep-2018 15:30:25 + imageinfo = 'imageinfo' build 12-Sep-2018 15:30:25 + miscinfo = 'miscinfo' build 12-Sep-2018 15:30:25 + coords = 'coords' build 12-Sep-2018 15:30:25 + mandatory_recs = [imageinfo, coords] build 12-Sep-2018 15:30:25 + if check_misc: build 12-Sep-2018 15:30:25 + mandatory_recs.append(miscinfo) build 12-Sep-2018 15:30:25 + for rec in mandatory_recs: build 12-Sep-2018 15:30:25 + if rec not in keys: build 12-Sep-2018 15:30:25 + pstr += ('{0} record not found ({1})\n'. build 12-Sep-2018 15:30:25 + format(rec, self.verdict(False))) build 12-Sep-2018 15:30:25 + if len(pstr) > 0: build 12-Sep-2018 15:30:25 + return pstr build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + mandatory_imageinfo = ['objectname', 'imagetype'] build 12-Sep-2018 15:30:25 + pstr += self.check_expected_entries(mandatory_imageinfo, imageinfo, keys) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if check_misc: build 12-Sep-2018 15:30:25 + if check_extended: build 12-Sep-2018 15:30:25 + mandatory_miscinfo = ['INSTRUME', 'distance'] build 12-Sep-2018 15:30:25 + pstr += self.check_expected_entries(mandatory_miscinfo, miscinfo, keys) build 12-Sep-2018 15:30:25 + forbidden_miscinfo = ['OBJECT', 'TELESCOP'] build 12-Sep-2018 15:30:25 + pstr += self.check_forbidden_entries(forbidden_miscinfo, miscinfo, keys) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + mandatory_coords = ['telescope'] build 12-Sep-2018 15:30:25 + pstr += self.check_expected_entries(mandatory_coords, coords, keys) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + return pstr build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def check_expected_entries(self, entries, record, keys): build 12-Sep-2018 15:30:25 + pstr = '' build 12-Sep-2018 15:30:25 + for entry in entries: build 12-Sep-2018 15:30:25 + if entry not in keys[record]: build 12-Sep-2018 15:30:25 + pstr += ('entry {0} not found in record {1} ({2})\n'. build 12-Sep-2018 15:30:25 + format(entry, record, self.verdict(False))) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + # TODO: many tests leave 'distance' empty. Assume that's acceptable... build 12-Sep-2018 15:30:25 + if entry != 'distance' and not keys[record][entry]: build 12-Sep-2018 15:30:25 + pstr += ('entry {0} is found in record {1} but it is empty ({2})\n'. build 12-Sep-2018 15:30:25 + format(entry, record, self.verdict(False))) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + return pstr build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def check_forbidden_entries(self, entries, record, keys): build 12-Sep-2018 15:30:25 + pstr = '' build 12-Sep-2018 15:30:25 + for entry in entries: build 12-Sep-2018 15:30:25 + if entry in keys[record]: build 12-Sep-2018 15:30:25 + pstr += ('entry {0} should not be in record {1} ({2})\n'. build 12-Sep-2018 15:30:25 + format(entry, record, self.verdict(False))) build 12-Sep-2018 15:30:25 + return pstr build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def modeltype(self,msname): build 12-Sep-2018 15:30:25 """has no model, otf model, modelcol""" build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/mpi4casa/task_wrappers.py b/gcwrap/python/scripts/mpi4casa/task_wrappers.py build 12-Sep-2018 15:30:25 index df444a5..c9fcd46 100755 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/mpi4casa/task_wrappers.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/mpi4casa/task_wrappers.py build 12-Sep-2018 15:30:25 @@ -4,17 +4,13 @@ build 12-Sep-2018 15:30:25 from imstat_pg import imstat_pg as imstat build 12-Sep-2018 15:30:25 from flagdata_pg import flagdata_pg as flagdata build 12-Sep-2018 15:30:25 from flagcmd_pg import flagcmd_pg as flagcmd build 12-Sep-2018 15:30:25 -from importevla_pg import importevla_pg as importevla build 12-Sep-2018 15:30:25 from split_pg import split_pg as split build 12-Sep-2018 15:30:25 from oldsplit_pg import oldsplit_pg as oldsplit build 12-Sep-2018 15:30:25 from importvla_pg import importvla_pg as importvla build 12-Sep-2018 15:30:25 from hanningsmooth_pg import hanningsmooth_pg as hanningsmooth build 12-Sep-2018 15:30:25 -from oldhanningsmooth_pg import oldhanningsmooth_pg as oldhanningsmooth build 12-Sep-2018 15:30:25 -from widefield_pg import widefield_pg as widefield build 12-Sep-2018 15:30:25 from immoments_pg import immoments_pg as immoments build 12-Sep-2018 15:30:25 from uvcontsub_pg import uvcontsub_pg as uvcontsub build 12-Sep-2018 15:30:25 from listhistory_pg import listhistory_pg as listhistory build 12-Sep-2018 15:30:25 -from mosaic_pg import mosaic_pg as mosaic build 12-Sep-2018 15:30:25 from importfits_pg import importfits_pg as importfits build 12-Sep-2018 15:30:25 from imfit_pg import imfit_pg as imfit build 12-Sep-2018 15:30:25 from deconvolve_pg import deconvolve_pg as deconvolve build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/recipes/CMakeLists.txt b/gcwrap/python/scripts/recipes/CMakeLists.txt build 12-Sep-2018 15:30:25 index 82c9995..cb4d14b 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/recipes/CMakeLists.txt build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/recipes/CMakeLists.txt build 12-Sep-2018 15:30:25 @@ -34,6 +34,7 @@ casa_add_python( tools tools_recipes_python lib/python${PYTHONV}/recipes build 12-Sep-2018 15:30:25 find_autocorr.py build 12-Sep-2018 15:30:25 gaincal_unflag_nearest.py build 12-Sep-2018 15:30:25 getazel.py build 12-Sep-2018 15:30:25 + imager_resource_predictor.py build 12-Sep-2018 15:30:25 __init__.py build 12-Sep-2018 15:30:25 linfeedpolhelpers.py build 12-Sep-2018 15:30:25 lsms.py build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/recipes/drawmaskinimage.py b/gcwrap/python/scripts/recipes/drawmaskinimage.py build 12-Sep-2018 15:30:25 index 4edcae3..5e3a721 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/recipes/drawmaskinimage.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/recipes/drawmaskinimage.py build 12-Sep-2018 15:30:25 @@ -1,6 +1,7 @@ build 12-Sep-2018 15:30:25 -from casa import imager as im build 12-Sep-2018 15:30:25 -from casa import image as ia build 12-Sep-2018 15:30:25 -from casa import regionmanager as rg build 12-Sep-2018 15:30:25 +from casac import casac build 12-Sep-2018 15:30:25 +im=casac.imager() build 12-Sep-2018 15:30:25 +ia=casac.image() build 12-Sep-2018 15:30:25 +rg=casac.regionmanager() build 12-Sep-2018 15:30:25 import os build 12-Sep-2018 15:30:25 import shutil build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/recipes/imager_resource_predictor.py b/gcwrap/python/scripts/recipes/imager_resource_predictor.py build 12-Sep-2018 15:30:25 new file mode 100644 build 12-Sep-2018 15:30:25 index 0000000..94f4c8c build 12-Sep-2018 15:30:25 --- /dev/null build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/recipes/imager_resource_predictor.py build 12-Sep-2018 15:30:25 @@ -0,0 +1,184 @@ build 12-Sep-2018 15:30:25 +from taskinit import casalog build 12-Sep-2018 15:30:25 +from imagerhelpers.input_parameters import ImagerParameters build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +def predict_tclean_mem_use(imager_params): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + Takes an ImagerParameters object as input and estimates/predict memory use in tclean. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + :param imager_params: tclean parameters as ImagerParameters object build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + :returns: a dictionary with memory use estimations build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + if not isinstance(imager_params, ImagerParameters): build 12-Sep-2018 15:30:25 + raise ValueError('Error: the input parameter must be a valid ImagerParameters' build 12-Sep-2018 15:30:25 + 'object, but its type is: {0}'.format(type(imager_params))) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if not imager_params.checkParameters(): build 12-Sep-2018 15:30:25 + raise ValueError('Error: this ImagerParameter objects has not been built correctly. ' build 12-Sep-2018 15:30:25 + 'This should not have happened if the constructor of the object ' build 12-Sep-2018 15:30:25 + 'finished without errors.') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + im_pars = imager_params.getImagePars()['0'] build 12-Sep-2018 15:30:25 + imsize = im_pars['imsize'] build 12-Sep-2018 15:30:25 + one_plane = _mem_per_plane(imsize) build 12-Sep-2018 15:30:25 + casalog.post('One image takes: {0:5.2f} MB'.format(one_plane)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + dec_pars = imager_params.getDecPars()['0'] build 12-Sep-2018 15:30:25 + nterms = im_pars['nterms'] build 12-Sep-2018 15:30:25 + decpeak = _predict_minor_cycle(dec_pars, one_plane, imsize, nterms) build 12-Sep-2018 15:30:25 + casalog.post('Estimated peak memory in minor cycle: {0:5.2f} MB ({1:5.1f} images)'. build 12-Sep-2018 15:30:25 + format(decpeak, decpeak/one_plane)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + grid_pars = imager_params.getGridPars()['0'] build 12-Sep-2018 15:30:25 + ftmpeak = _predict_major_cycle(grid_pars, one_plane, im_pars['nchan']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if dec_pars['deconvolver'] == 'mtmfs': build 12-Sep-2018 15:30:25 + casalog.post('Estimated peak memory in major cycle: {0:5.2f} MB ({1:5.1f} ' build 12-Sep-2018 15:30:25 + 'images) for the PSF and {2:5.2f} MB ({3:5.1f} images) thereafter'. build 12-Sep-2018 15:30:25 + format(ftmpeak*(2*nterms-1), ftmpeak*(2*nterms-1)/one_plane, build 12-Sep-2018 15:30:25 + ftmpeak*(nterms), ftmpeak*(nterms)/one_plane)) build 12-Sep-2018 15:30:25 + # (2*nterms-1) times for the PSF calc, 2 times otherwise build 12-Sep-2018 15:30:25 + # It's less than a factor of 2. Maybe the complex image grids disappear after each build 12-Sep-2018 15:30:25 + # FTM build 12-Sep-2018 15:30:25 + ftmpeak = ftmpeak * nterms build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + casalog.post('Estimated peak memory in major cycle: {0:5.2f} MB ({1:5.1f} images)'. build 12-Sep-2018 15:30:25 + format(ftmpeak, ftmpeak/one_plane)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + result = {'peak': ftmpeak+decpeak, build 12-Sep-2018 15:30:25 + 'peak_in_minor_cycle': decpeak, build 12-Sep-2018 15:30:25 + 'peak_in_major_cycle': ftmpeak, build 12-Sep-2018 15:30:25 + 'mem_per_image': one_plane} build 12-Sep-2018 15:30:25 + casalog.post('Result from memory predictor: {0}'.format(result)) build 12-Sep-2018 15:30:25 + return result build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +def _mem_per_plane(imsize): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + Get MB per image/plane. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + :param imsize: image/plane size in pixels build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + :returns: memory per image/plane in MB build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + size_float = 4 # bytes build 12-Sep-2018 15:30:25 + bytes_per_mb = 1024*1024.0 build 12-Sep-2018 15:30:25 + # backgroundmem = 150 # ~150MB mem use at casa startup build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # Peak memory should be a multiple of a single image plane, depending on algorithm build 12-Sep-2018 15:30:25 + one_plane = (imsize * imsize * 1 * size_float) / bytes_per_mb build 12-Sep-2018 15:30:25 + return one_plane build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +def _predict_minor_cycle(dec_pars, one_plane, imsize, nterms): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + Estimate memory peak for the minor cycles (deconvolvers). This adds up on top of the build 12-Sep-2018 15:30:25 + major cycle peaks (see _predict_major_cycle). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + :param dec_pars: dict of deconvolver parameters for tclean, as you would get from build 12-Sep-2018 15:30:25 + ImagerParameters.getDecPars() build 12-Sep-2018 15:30:25 + :param one_plane: memory for one plane/image, in MB build 12-Sep-2018 15:30:25 + :param imsize: image/plane size in pixels, from image parameters, needed for mtmfs build 12-Sep-2018 15:30:25 + :param nterms: nterms from image parameters, needed for mtmfs build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + :returns: memory use for the deconvolver / minor cycles, in MB build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + # these need to come from outside later build 12-Sep-2018 15:30:25 + nscales = 1 build 12-Sep-2018 15:30:25 + ntotal = 0 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if dec_pars['deconvolver'] == 'hogbom': build 12-Sep-2018 15:30:25 + npsf = 1 build 12-Sep-2018 15:30:25 + nresidual = 1 build 12-Sep-2018 15:30:25 + nmodel = 1 build 12-Sep-2018 15:30:25 + nmask = 1 build 12-Sep-2018 15:30:25 + ndeltamodel = 0 build 12-Sep-2018 15:30:25 + misc = 0 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ntotal = npsf + nresidual + nmodel + nmask + ndeltamodel + misc build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if dec_pars['deconvolver'] == 'multiscale': build 12-Sep-2018 15:30:25 + # itsPsfConvScales , #copy of input PSF build 12-Sep-2018 15:30:25 + npsf = nscales + 1 build 12-Sep-2018 15:30:25 + # itsDirty, itsXfr(complex), itsDirtyConvScales, copy of input dirty build 12-Sep-2018 15:30:25 + nresidual = 1 + 2 + nscales + 1 build 12-Sep-2018 15:30:25 + nmodel = 1 build 12-Sep-2018 15:30:25 + nmask = 1 + 1 + nscales # itsMask, itsScaleMasks, copy of input mask build 12-Sep-2018 15:30:25 + misc = nscales*2 # itsScales, itsScalesXfrs , build 12-Sep-2018 15:30:25 + # Wow.... MatrixCleaner COPIES all of the images it gets ?!!!! build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + nfftserver = 1 + 2*2 # Created for each FFT - so lots of spikes, but not present in accumulated mem use. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ntotal = npsf + nresidual + nmodel + nmask + misc build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if dec_pars['deconvolver'] == 'mtmfs': build 12-Sep-2018 15:30:25 + # psf patches in the Hessian build 12-Sep-2018 15:30:25 + n4d = (nscales * (nscales+1) / 2.0) * (nterms * (nterms+1) / 2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + nsupport = ((100.0/imsize)**2 * (n4d + nscales)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + nfull = 2 + 2 + 3 * nscales + 3 * nterms + (2 * nterms - 1) + 2 * nterms * nscales build 12-Sep-2018 15:30:25 + nfftserver = 1 + 2*2 # 1 float and 2 complex build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + mystery = 1 + 1 # TODO build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ntotal = nsupport + nfull + nfftserver + mystery build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if dec_pars['deconvolver'] == 'clark': build 12-Sep-2018 15:30:25 + npsf = 1 build 12-Sep-2018 15:30:25 + nresidual = 2 build 12-Sep-2018 15:30:25 + nmodel = 1 build 12-Sep-2018 15:30:25 + nmask = 1 build 12-Sep-2018 15:30:25 + ndeltamodel = 1 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ntotal = npsf + nresidual + nmodel + nmask + ndeltamodel build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # Deconvolver total build 12-Sep-2018 15:30:25 + decpeak = one_plane * ntotal build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + return decpeak build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +def _predict_major_cycle(grid_pars, one_plane, nchan): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + Estimate memory peak for the major cycles (gridder). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + :param grid_pars: dict of gridder parameters for tclean, as you would get from build 12-Sep-2018 15:30:25 + ImagerParameters.getGridPars() build 12-Sep-2018 15:30:25 + :param one_plane: memory for one plane/image, in MB build 12-Sep-2018 15:30:25 + :param nchan: number of channels, from the image parameters build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + :returns: memory use for the gridder / major cycles, per channel, in MB build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + ntotalgrid = 0 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if grid_pars['gridder'] == 'gridft': build 12-Sep-2018 15:30:25 + # Gridder peak memory use is in getImage when copying double to float grids build 12-Sep-2018 15:30:25 + ngrid = 6 # griddedData(float complex)=2 + griddedData2(double complex)=4 build 12-Sep-2018 15:30:25 + # De-gridder uses only float grid. build 12-Sep-2018 15:30:25 + ndegrid = 2 # griddedData(float complex)=2 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # TODO: no idea. needed to make the prediction match measurements. build 12-Sep-2018 15:30:25 + # Needs tracking down. build 12-Sep-2018 15:30:25 + nmystery = 1 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ntotalgrid = ngrid + ndegrid + nmystery build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if grid_pars['gridder'] == 'wproject': build 12-Sep-2018 15:30:25 + ngrid = 6 build 12-Sep-2018 15:30:25 + ndegrid = 2 build 12-Sep-2018 15:30:25 + ntotalgrid = ngrid + ndegrid build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if grid_pars['gridder'] == 'mosaic': build 12-Sep-2018 15:30:25 + ngrid = 6 build 12-Sep-2018 15:30:25 + ndegrid = 2 build 12-Sep-2018 15:30:25 + ntotalgrid = ngrid + ndegrid build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if grid_pars['gridder'] == 'awproject': build 12-Sep-2018 15:30:25 + ngrid = 6 build 12-Sep-2018 15:30:25 + ndegrid = 2 build 12-Sep-2018 15:30:25 + ntotalgrid = ngrid + ndegrid build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ftmpeak = ntotalgrid * one_plane * nchan build 12-Sep-2018 15:30:25 + return ftmpeak build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/regressions/admin/extractCASAscript.py b/gcwrap/python/scripts/regressions/admin/extractCASAscript.py build 12-Sep-2018 15:30:25 index 8d2fa31..542e080 100755 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/regressions/admin/extractCASAscript.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/regressions/admin/extractCASAscript.py build 12-Sep-2018 15:30:25 @@ -78,7 +78,7 @@ casa_tasks = ['accum', 'applycal', 'asdmsummary', 'bandpass', build 12-Sep-2018 15:30:25 'rmtables', 'sdbaseline', 'sdcal', 'sdfit', 'sdfixscan', 'sdgaincal', build 12-Sep-2018 15:30:25 'sdimaging', 'sdsmooth', 'setjy', 'simalma', 'simanalyze', 'simobserve', build 12-Sep-2018 15:30:25 'slsearch', 'smoothcal', 'specfit', 'splattotable', 'split', 'spxfit', build 12-Sep-2018 15:30:25 -'startup', 'statwt', 'taskhelp', 'tasklist', 'tclean', 'testconcat', 'toolhelp', build 12-Sep-2018 15:30:25 +'startup', 'oldstatwt', 'taskhelp', 'tasklist', 'tclean', 'testconcat', 'toolhelp', build 12-Sep-2018 15:30:25 'uvcontsub', 'uvcontsub3', 'uvmodelfit', 'uvsub', 'viewer', 'virtualconcat', build 12-Sep-2018 15:30:25 'vishead', 'visstat', 'widebandpbcor', 'widefield', 'wvrgcal'] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -198,8 +198,8 @@ def make_func_noninteractive(line): build 12-Sep-2018 15:30:25 # Set argument interactive to false build 12-Sep-2018 15:30:25 pattern = r'''interactive\ *=\ *(True)''' build 12-Sep-2018 15:30:25 new_line = re.sub( pattern, 'interactive = False', line ) build 12-Sep-2018 15:30:25 - # Leave the mask parameter for testing build 12-Sep-2018 15:30:25 - #if funcName == "clean": build 12-Sep-2018 15:30:25 + # Leave the mask parameter for testing build 12-Sep-2018 15:30:25 + #if funcName == "clean": build 12-Sep-2018 15:30:25 # # Remove clean mask parameter if it exists build 12-Sep-2018 15:30:25 # pattern = r'''mask\ *=\ *['"].*['"].*?,?''' build 12-Sep-2018 15:30:25 # new_line = re.sub( pattern, '', new_line ) build 12-Sep-2018 15:30:25 @@ -245,10 +245,10 @@ def suppress_gui( line ): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 if extract_task(line) == "flagdata": build 12-Sep-2018 15:30:25 pattern = r"""display\ *=\ *['"].*['"]""" build 12-Sep-2018 15:30:25 - if re.search( pattern, line ): build 12-Sep-2018 15:30:25 + if re.search( pattern, line ): build 12-Sep-2018 15:30:25 # if showgui is specified, make sure it is false build 12-Sep-2018 15:30:25 - new_line = re.sub( pattern, "display=''", line ) build 12-Sep-2018 15:30:25 - return new_line build 12-Sep-2018 15:30:25 + new_line = re.sub( pattern, "display=''", line ) build 12-Sep-2018 15:30:25 + return new_line build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Suppress GUIs for other tasks here... build 12-Sep-2018 15:30:25 return line build 12-Sep-2018 15:30:25 @@ -393,7 +393,7 @@ def pythonize_shell_commands( line ): build 12-Sep-2018 15:30:25 if firstWord in commands: build 12-Sep-2018 15:30:25 line = 'os.system("' + line + '")' build 12-Sep-2018 15:30:25 if 'wget' in line: build 12-Sep-2018 15:30:25 - line = '\n' build 12-Sep-2018 15:30:25 + line = '\n' build 12-Sep-2018 15:30:25 return line build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def make_system_call_noninteractive( line ): build 12-Sep-2018 15:30:25 @@ -427,9 +427,9 @@ def include_raw_input( task,line ): build 12-Sep-2018 15:30:25 * line = a python statement build 12-Sep-2018 15:30:25 """ build 12-Sep-2018 15:30:25 if is_task_call(line): build 12-Sep-2018 15:30:25 - if extract_task(line) == task: build 12-Sep-2018 15:30:25 - line = ''*indentation(line) + line + '\n' build 12-Sep-2018 15:30:25 - line += ' '*indentation(line) + 'user_check=raw_input("press enter to continue script")\n' build 12-Sep-2018 15:30:25 + if extract_task(line) == task: build 12-Sep-2018 15:30:25 + line = ''*indentation(line) + line + '\n' build 12-Sep-2018 15:30:25 + line += ' '*indentation(line) + 'user_check=raw_input("press enter to continue script")\n' build 12-Sep-2018 15:30:25 return line build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def exclude_raw_input( line ): build 12-Sep-2018 15:30:25 @@ -439,7 +439,7 @@ def exclude_raw_input( line ): build 12-Sep-2018 15:30:25 """ build 12-Sep-2018 15:30:25 pattern = r'''raw_input\ *\(''' build 12-Sep-2018 15:30:25 if re.search( pattern, line ): build 12-Sep-2018 15:30:25 - #newline = ' ' * indentation(line) + 'print("script will continue")\n' build 12-Sep-2018 15:30:25 + #newline = ' ' * indentation(line) + 'print("script will continue")\n' build 12-Sep-2018 15:30:25 newline = ' ' * indentation(line) + '#' + line build 12-Sep-2018 15:30:25 newline += '\n' + ' '*indentation(line) + 'pass\n' build 12-Sep-2018 15:30:25 line = newline build 12-Sep-2018 15:30:25 @@ -452,9 +452,9 @@ def correct_casa_builtins_inp( line ): build 12-Sep-2018 15:30:25 """ build 12-Sep-2018 15:30:25 pattern = r''' *(inp )''' build 12-Sep-2018 15:30:25 if re.search( pattern, line ): build 12-Sep-2018 15:30:25 - new_line = re.sub( pattern, 'inp(', line ) build 12-Sep-2018 15:30:25 - new_line = ' ' * indentation(line) + new_line + ')' build 12-Sep-2018 15:30:25 - line = new_line build 12-Sep-2018 15:30:25 + new_line = re.sub( pattern, 'inp(', line ) build 12-Sep-2018 15:30:25 + new_line = ' ' * indentation(line) + new_line + ')' build 12-Sep-2018 15:30:25 + line = new_line build 12-Sep-2018 15:30:25 return line build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def correct_casa_builtins_help( line ): build 12-Sep-2018 15:30:25 @@ -464,10 +464,10 @@ def correct_casa_builtins_help( line ): build 12-Sep-2018 15:30:25 """ build 12-Sep-2018 15:30:25 pattern = r''' *(help )''' build 12-Sep-2018 15:30:25 if re.search( pattern, line ): build 12-Sep-2018 15:30:25 - new_line = re.sub( pattern, 'help(', line ) build 12-Sep-2018 15:30:25 - new_line = ' ' * indentation(line) + new_line + ')' build 12-Sep-2018 15:30:25 - new_line = "#" + new_line build 12-Sep-2018 15:30:25 - line = new_line build 12-Sep-2018 15:30:25 + new_line = re.sub( pattern, 'help(', line ) build 12-Sep-2018 15:30:25 + new_line = ' ' * indentation(line) + new_line + ')' build 12-Sep-2018 15:30:25 + new_line = "#" + new_line build 12-Sep-2018 15:30:25 + line = new_line build 12-Sep-2018 15:30:25 return line build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def make_noninteractive( line ): build 12-Sep-2018 15:30:25 @@ -555,7 +555,7 @@ def main( URL, options ): build 12-Sep-2018 15:30:25 if os.uname()[0] == 'Darwin': #http://stackoverflow.com/questions/27835619/ssl-certificate-verify-failed-error build 12-Sep-2018 15:30:25 import ssl build 12-Sep-2018 15:30:25 req = urllib2.Request(URL) build 12-Sep-2018 15:30:25 - gcontext = ssl.SSLContext(ssl.PROTOCOL_TLSv1) build 12-Sep-2018 15:30:25 + gcontext = ssl.SSLContext(ssl.PROTOCOL_TLS) # Fix for python versions > 2.7.13 to match new certificates build 12-Sep-2018 15:30:25 response = urllib2.urlopen(req,context=gcontext) build 12-Sep-2018 15:30:25 responseLines = response.read().split("\n") build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -587,21 +587,21 @@ def main( URL, options ): build 12-Sep-2018 15:30:25 else: build 12-Sep-2018 15:30:25 # Loop over the lines read from the web page build 12-Sep-2018 15:30:25 for line in responseLines: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 # If we are not currently reading code, see if this line build 12-Sep-2018 15:30:25 # begins a python code block. build 12-Sep-2018 15:30:25 if (readingCode == False): build 12-Sep-2018 15:30:25 - # This needs to written in better python syntax. This is temp build 12-Sep-2018 15:30:25 + # This needs to written in better python syntax. This is temp build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - if (beginBlock in line) or (beginBlock1 in line) or (beginBlock2 in line) or (beginBlock3 in line) or (beginBlock4 in line): # TODO: Convert to More Pythonic Syntax build 12-Sep-2018 15:30:25 - readingCode = True build 12-Sep-2018 15:30:25 - outline = loseTheJunk(line) build 12-Sep-2018 15:30:25 - lineList += [outline] build 12-Sep-2018 15:30:25 - if endBlock in line: build 12-Sep-2018 15:30:25 - readingCode = False build 12-Sep-2018 15:30:25 + if (beginBlock in line) or (beginBlock1 in line) or (beginBlock2 in line) or (beginBlock3 in line) or (beginBlock4 in line): # TODO: Convert to More Pythonic Syntax build 12-Sep-2018 15:30:25 + readingCode = True build 12-Sep-2018 15:30:25 + outline = loseTheJunk(line) build 12-Sep-2018 15:30:25 + lineList += [outline] build 12-Sep-2018 15:30:25 + if endBlock in line: build 12-Sep-2018 15:30:25 + readingCode = False build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 #else: build 12-Sep-2018 15:30:25 - #continue build 12-Sep-2018 15:30:25 + #continue build 12-Sep-2018 15:30:25 #outline = loseTheJunk(line) build 12-Sep-2018 15:30:25 #lineList += [outline] build 12-Sep-2018 15:30:25 #if endBlock in line: build 12-Sep-2018 15:30:25 @@ -680,24 +680,24 @@ def main( URL, options ): build 12-Sep-2018 15:30:25 #print "Turning off diagnostic plots..." build 12-Sep-2018 15:30:25 line = turnDiagPlotsOff(line) build 12-Sep-2018 15:30:25 elif options.plotmsoff: build 12-Sep-2018 15:30:25 - #print "Turning off plotms..." build 12-Sep-2018 15:30:25 + #print "Turning off plotms..." build 12-Sep-2018 15:30:25 line = turnPlotmsOff(line) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 elif options.noninteractive: build 12-Sep-2018 15:30:25 - #print "Turning on Non Interactive features..." build 12-Sep-2018 15:30:25 - line = exclude_raw_input(line) build 12-Sep-2018 15:30:25 - # NOTE compressedList iterates through make_noninteractive build 12-Sep-2018 15:30:25 + #print "Turning on Non Interactive features..." build 12-Sep-2018 15:30:25 + line = exclude_raw_input(line) build 12-Sep-2018 15:30:25 + # NOTE compressedList iterates through make_noninteractive build 12-Sep-2018 15:30:25 if extract_task(line) == 'plotms': build 12-Sep-2018 15:30:25 - line = addNonInteractivePause(line) build 12-Sep-2018 15:30:25 + line = addNonInteractivePause(line) build 12-Sep-2018 15:30:25 else: #interactive build 12-Sep-2018 15:30:25 #line = exclude_raw_input(line) build 12-Sep-2018 15:30:25 #mtch = interactive.match(line) build 12-Sep-2018 15:30:25 #if (mtch and not ("showgui=F" in line)): build 12-Sep-2018 15:30:25 # line = addInteractivePause(line) build 12-Sep-2018 15:30:25 - line = line build 12-Sep-2018 15:30:25 - line = correct_casa_builtins_inp( line ) build 12-Sep-2018 15:30:25 - line = correct_casa_builtins_help( line ) build 12-Sep-2018 15:30:25 - #print line build 12-Sep-2018 15:30:25 + line = line build 12-Sep-2018 15:30:25 + line = correct_casa_builtins_inp( line ) build 12-Sep-2018 15:30:25 + line = correct_casa_builtins_help( line ) build 12-Sep-2018 15:30:25 + #print line build 12-Sep-2018 15:30:25 print >>f, line.decode('utf-8') build 12-Sep-2018 15:30:25 f.close() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/regressions/pipelineTest_regression.py b/gcwrap/python/scripts/regressions/pipelineTest_regression.py build 12-Sep-2018 15:30:25 index 0721b47..cb110bb 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/regressions/pipelineTest_regression.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/regressions/pipelineTest_regression.py build 12-Sep-2018 15:30:25 @@ -14,6 +14,7 @@ rootdatapath = pathname+'/data/regression/pipeline/' build 12-Sep-2018 15:30:25 B. Kent, May 2015 build 12-Sep-2018 15:30:25 Update September 1, 2015 build 12-Sep-2018 15:30:25 Update April 20, 2018 build 12-Sep-2018 15:30:25 + Update June 01, 2018 build 12-Sep-2018 15:30:25 ''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 THISHOME = "working/" build 12-Sep-2018 15:30:25 @@ -58,22 +59,22 @@ def pipeline_regression(): build 12-Sep-2018 15:30:25 try: build 12-Sep-2018 15:30:25 import pipeline.recipes.hifv as hifv build 12-Sep-2018 15:30:25 except ImportError, e: build 12-Sep-2018 15:30:25 - print e build 12-Sep-2018 15:30:25 + print(e) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Check to see if the ASDM exists build 12-Sep-2018 15:30:25 if not os.path.exists(ASDM): build 12-Sep-2018 15:30:25 - print "Unable to open ASDM " + ASDM build 12-Sep-2018 15:30:25 + print("Unable to open ASDM ", ASDM) build 12-Sep-2018 15:30:25 regstate=False build 12-Sep-2018 15:30:25 raise IOError build 12-Sep-2018 15:30:25 else: build 12-Sep-2018 15:30:25 - print "Using " + ASDM build 12-Sep-2018 15:30:25 + print("Using ", ASDM) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Run the CASA VLA Pipeline standard recipe build 12-Sep-2018 15:30:25 try: build 12-Sep-2018 15:30:25 hifv.hifv([ASDM], importonly=False) build 12-Sep-2018 15:30:25 - except Exception, e: build 12-Sep-2018 15:30:25 - print e build 12-Sep-2018 15:30:25 + except Exception as e: build 12-Sep-2018 15:30:25 + print(e) build 12-Sep-2018 15:30:25 regstage=False build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -88,37 +89,37 @@ def run(): build 12-Sep-2018 15:30:25 pipeline_regression() build 12-Sep-2018 15:30:25 endTime = time.time() build 12-Sep-2018 15:30:25 endProc = time.clock() build 12-Sep-2018 15:30:25 - print "Run Time = ",endTime-startTime,endProc-startProc build 12-Sep-2018 15:30:25 + print("Run Time = ",endTime-startTime,endProc-startProc) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def stats(): build 12-Sep-2018 15:30:25 global startTime, endTime, startProc, endProc, regstate, standard_context_file build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - datestring=datetime.datetime.isoformat(datetime.datetime.today()) build 12-Sep-2018 15:30:25 - outfile='vlapipeline.'+datestring+'.log' build 12-Sep-2018 15:30:25 - logfile=open(outfile,'w') build 12-Sep-2018 15:30:25 + datestring = datetime.datetime.isoformat(datetime.datetime.today()) build 12-Sep-2018 15:30:25 + outfile = 'vlapipeline.'+datestring+'.log' build 12-Sep-2018 15:30:25 + logfile = open(outfile,'w') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 try: build 12-Sep-2018 15:30:25 import pipeline build 12-Sep-2018 15:30:25 except ImportError, e: build 12-Sep-2018 15:30:25 print e build 12-Sep-2018 15:30:25 print >>logfile, "Unable to import the CASA pipeline" build 12-Sep-2018 15:30:25 - regstate=False build 12-Sep-2018 15:30:25 + regstate = False build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 try: build 12-Sep-2018 15:30:25 # Open context build 12-Sep-2018 15:30:25 context = pipeline.Pipeline(context='last').context build 12-Sep-2018 15:30:25 - regstate=True build 12-Sep-2018 15:30:25 + regstate = True build 12-Sep-2018 15:30:25 print >>logfile,"VLA pipeline context created." build 12-Sep-2018 15:30:25 - print "VLA pipeline context created." build 12-Sep-2018 15:30:25 + print("VLA pipeline context created.") build 12-Sep-2018 15:30:25 print >>logfile,"Context verification - VLA pipeline regression PASSED." build 12-Sep-2018 15:30:25 - print "Context verification - VLA pipeline regression PASSED." build 12-Sep-2018 15:30:25 + print("Context verification - VLA pipeline regression PASSED.") build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - except Exception, e: build 12-Sep-2018 15:30:25 - regstate=False build 12-Sep-2018 15:30:25 + except Exception as e: build 12-Sep-2018 15:30:25 + regstate = False build 12-Sep-2018 15:30:25 print >>logfile,"VLA pipeline context NOT created." build 12-Sep-2018 15:30:25 - print "VLA pipeline context NOT created." build 12-Sep-2018 15:30:25 + print("VLA pipeline context NOT created.") build 12-Sep-2018 15:30:25 print >>logfile,"Context verification - VLA pipeline regression FAILED." build 12-Sep-2018 15:30:25 - print "Context verification - VLA pipeline regression FAILED." build 12-Sep-2018 15:30:25 + print("Context verification - VLA pipeline regression FAILED.") build 12-Sep-2018 15:30:25 print >>logfile, e build 12-Sep-2018 15:30:25 print e build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -139,12 +140,13 @@ def stats(): build 12-Sep-2018 15:30:25 # value_compare = 0.71857779577 # CASA-prerelease 5.0.0-187, pipeline r40156 build 12-Sep-2018 15:30:25 # value_compare = 0.718551806637 # CASA-prerelease 5.1.0-34, pipeline r40615 build 12-Sep-2018 15:30:25 # value_compare = 0.718519030402 # CASA-prerelease 5.3.0-26, pipeline r40909 build 12-Sep-2018 15:30:25 - value_compare = 0.718342661383 # CASA-prerelease 5.3.0-114, pipeline r41386 build 12-Sep-2018 15:30:25 + # value_compare = 0.718342661383 # CASA-prerelease 5.3.0-114, pipeline r41386 build 12-Sep-2018 15:30:25 + value_compare = 0.717434107414 # CASA-prerelease 5.4.0-3, pipeline r41527 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 result_bool = np.isclose(fluxlist[0][0], value_compare, rtol=rtol, atol=atol, equal_nan=False) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - print >>logfile, "Accepted test value is: ", value_compare, " from CASA-prerelease 5.3.0-114, pipeline r41386 (trunk)" build 12-Sep-2018 15:30:25 - print "Accepted test value is: ", value_compare, " from CASA-prerelease 5.3.0-114, pipeline r41386 (trunk)" build 12-Sep-2018 15:30:25 + print >>logfile, "Accepted test value is: ", value_compare, " from CASA-prerelease 5.4.0-3, pipeline r41527 (trunk)" build 12-Sep-2018 15:30:25 + print "Accepted test value is: ", value_compare, " from CASA-prerelease 5.4.0-3, pipeline r41527 (trunk)" build 12-Sep-2018 15:30:25 print >>logfile, "Regression generated value is: ", fluxlist[0][0] build 12-Sep-2018 15:30:25 print "Regression generated value is: ", fluxlist[0][0] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -161,7 +163,7 @@ def stats(): build 12-Sep-2018 15:30:25 print >>logfile,"hifv_fluxboot test FAILED." build 12-Sep-2018 15:30:25 print "hifv_fluxboot test FAILED." build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - except Exception, e: build 12-Sep-2018 15:30:25 + except Exception as e: build 12-Sep-2018 15:30:25 regstate=False build 12-Sep-2018 15:30:25 print >>logfile,"hifv_fluxboot values are not within tolerances." build 12-Sep-2018 15:30:25 print "hifv_fluxboot values are not within tolerances." build 12-Sep-2018 15:30:25 @@ -177,7 +179,7 @@ def main(): build 12-Sep-2018 15:30:25 run() build 12-Sep-2018 15:30:25 stats() build 12-Sep-2018 15:30:25 except KeyboardInterrupt: build 12-Sep-2018 15:30:25 - print "Interrupt requested...exiting" build 12-Sep-2018 15:30:25 + print("Interrupt requested...exiting") build 12-Sep-2018 15:30:25 except Exception: build 12-Sep-2018 15:30:25 traceback.print_exc(file=sys.stdout) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -185,6 +187,6 @@ if __name__ == "__main__": build 12-Sep-2018 15:30:25 main() build 12-Sep-2018 15:30:25 print "Regstate:" , regstate build 12-Sep-2018 15:30:25 if regstate: build 12-Sep-2018 15:30:25 - print "Regression PASSED" build 12-Sep-2018 15:30:25 + print("Regression PASSED") build 12-Sep-2018 15:30:25 else: build 12-Sep-2018 15:30:25 - print "Regression FAILED" build 12-Sep-2018 15:30:25 + print("Regression FAILED") build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/regressions/tests/CMakeLists.txt b/gcwrap/python/scripts/regressions/tests/CMakeLists.txt build 12-Sep-2018 15:30:25 index b0171ec..45e5e40 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/regressions/tests/CMakeLists.txt build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/regressions/tests/CMakeLists.txt build 12-Sep-2018 15:30:25 @@ -50,8 +50,6 @@ casa_add_python( tools tools_regressions_tests_python lib/python${PYTHONV}/regre build 12-Sep-2018 15:30:25 ngc2403.py build 12-Sep-2018 15:30:25 ngc5921redux.py build 12-Sep-2018 15:30:25 ngc5921uvcontsub2.py build 12-Sep-2018 15:30:25 - orionmosaic.py build 12-Sep-2018 15:30:25 -# plotxy_test.py build 12-Sep-2018 15:30:25 pointing_test.py build 12-Sep-2018 15:30:25 polcal_20080224_cband.py build 12-Sep-2018 15:30:25 pylabmem.py build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/regressions/tests/orionmosaic.py b/gcwrap/python/scripts/regressions/tests/orionmosaic.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 7d332dd..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/regressions/tests/orionmosaic.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,32 +0,0 @@ build 12-Sep-2018 15:30:25 -import sys build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -import string build 12-Sep-2018 15:30:25 -from locatescript import locatescript build 12-Sep-2018 15:30:25 -import inspect build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -a=inspect.stack() build 12-Sep-2018 15:30:25 -stacklevel=0 build 12-Sep-2018 15:30:25 -for k in range(len(a)): build 12-Sep-2018 15:30:25 - if (string.find(a[k][1], 'ipython console') > 0): build 12-Sep-2018 15:30:25 - stacklevel=k build 12-Sep-2018 15:30:25 - break build 12-Sep-2018 15:30:25 -gl=sys._getframe(stacklevel).f_globals build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def description(): build 12-Sep-2018 15:30:25 - return "feather, image mosaic" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def data(): build 12-Sep-2018 15:30:25 - ### return the data files that is needed by the regression script build 12-Sep-2018 15:30:25 - return [] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def run(fetch=False): build 12-Sep-2018 15:30:25 - lepath=locatescript('orion_regression.py') build 12-Sep-2018 15:30:25 - print 'Script used is ',lepath build 12-Sep-2018 15:30:25 - gl['regstate']=True build 12-Sep-2018 15:30:25 - execfile(lepath, gl) build 12-Sep-2018 15:30:25 - print 'regstate =', gl['regstate'] build 12-Sep-2018 15:30:25 - if not gl['regstate']: build 12-Sep-2018 15:30:25 - raise Exception, 'regstate = False' build 12-Sep-2018 15:30:25 -# import lepath+'/g192_regression.py' build 12-Sep-2018 15:30:25 -###resturn the images that will be templated and compared in future runs build 12-Sep-2018 15:30:25 - return ['orion_tfeather.im','orion_tfeather2.im','orion_tsdmem.image','orion_tsdms.image','orion_tjoint3.image'] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_autoclean.py b/gcwrap/python/scripts/task_autoclean.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 351f79e..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_autoclean.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,509 +0,0 @@ build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 -from clean import clean build 12-Sep-2018 15:30:25 -from cleanhelper import * build 12-Sep-2018 15:30:25 -from immath import immath # Not needed? build 12-Sep-2018 15:30:25 -from sys import stdout # Not needed? build 12-Sep-2018 15:30:25 -from math import ceil build 12-Sep-2018 15:30:25 -from math import floor build 12-Sep-2018 15:30:25 -from math import sqrt build 12-Sep-2018 15:30:25 -import numpy build 12-Sep-2018 15:30:25 -import shutil build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -##################################################################### build 12-Sep-2018 15:30:25 -# iterative cleaning while automatically selecting new clean regions build 12-Sep-2018 15:30:25 -##################################################################### build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# Some places in code commented by #TMP# indicate temporary fixes that build 12-Sep-2018 15:30:25 -# should be removed/modified once certain features or bugs in CASA have build 12-Sep-2018 15:30:25 -# been implemented or fixed. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def autoclean(vis, imagename, field, spw, selectdata, timerange, uvrange, build 12-Sep-2018 15:30:25 - antenna, scan, mode, nchan, start, width, interpolation, doconcat, build 12-Sep-2018 15:30:25 - psfmode, imagermode, cyclefactor, cyclespeedup, imsize, cell, build 12-Sep-2018 15:30:25 - phasecenter, restfreq, stokes, weighting, robust, noise, npixels, build 12-Sep-2018 15:30:25 - interactive, mask, modelimage, uvtaper, outertaper, innertaper, build 12-Sep-2018 15:30:25 - niter, npercycle, npercycle_speedup, gain, pbcor, minpb, build 12-Sep-2018 15:30:25 - clean_threshold, Nrms, eps_maxres, useabsresid, allow_maxres_inc, build 12-Sep-2018 15:30:25 - island_rms, diag, peak_rms, gain_threshold, Npeak, shape, build 12-Sep-2018 15:30:25 - boxstretch, irregsize): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.origin('autoclean') build 12-Sep-2018 15:30:25 - casalog.post("Task autoclean has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - orig_npercycle = npercycle build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # set up initial mask values if input by user build 12-Sep-2018 15:30:25 - inputmask = None build 12-Sep-2018 15:30:25 - if(mask): build 12-Sep-2018 15:30:25 - casalog.post('Using input mask from user.') build 12-Sep-2018 15:30:25 - imCln = imtool() build 12-Sep-2018 15:30:25 - imset = cleanhelper(imCln, vis) build 12-Sep-2018 15:30:25 - imset.defineimages(imsize=imsize, cell=cell, stokes=stokes, build 12-Sep-2018 15:30:25 - mode=mode, spw=spw, nchan=1, build 12-Sep-2018 15:30:25 - start=start, width=width, build 12-Sep-2018 15:30:25 - restfreq=restfreq, field=field, build 12-Sep-2018 15:30:25 - phasecenter=phasecenter) build 12-Sep-2018 15:30:25 - imset.datselweightfilter(field=field, spw=spw, timerange=timerange, build 12-Sep-2018 15:30:25 - uvrange=uvrange, antenna=antenna, scan=scan, build 12-Sep-2018 15:30:25 - wgttype=weighting, robust=robust, noise=noise, build 12-Sep-2018 15:30:25 - npixels=npixels, build 12-Sep-2018 15:30:25 - #mosweight=mosweight, build 12-Sep-2018 15:30:25 - innertaper=innertaper, outertaper=outertaper, build 12-Sep-2018 15:30:25 - calready=False) build 12-Sep-2018 15:30:25 - inputmask = '__temporary.mask' build 12-Sep-2018 15:30:25 - imset.makemaskimage(outputmask=inputmask, maskobject=mask) build 12-Sep-2018 15:30:25 - imCln.close() build 12-Sep-2018 15:30:25 - ia.open(inputmask) build 12-Sep-2018 15:30:25 - maskVals = ia.getchunk() build 12-Sep-2018 15:30:25 - ia.close() build 12-Sep-2018 15:30:25 - ia.removefile(inputmask) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # begin loop over all channels build 12-Sep-2018 15:30:25 - for ichan in xrange(nchan): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if imagermode!='mfs': build 12-Sep-2018 15:30:25 - casalog.post('***** Beginning channel %d of %d' % (ichan, nchan)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if (mode=='mfs') or (nchan==1): build 12-Sep-2018 15:30:25 - thisImage = imagename build 12-Sep-2018 15:30:25 - thisStart = start build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - thisImage = imagename + '.channel.' + str(ichan) build 12-Sep-2018 15:30:25 - if mode=='channel': build 12-Sep-2018 15:30:25 - thisStart = start + ichan*width build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - thisStart = qa.add(start, qa.mul(width, qa.quantity(ichan))) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # create dirty image from which to choose initial clean regions build 12-Sep-2018 15:30:25 - clean(vis=vis, imagename=thisImage, field=field, spw=spw, build 12-Sep-2018 15:30:25 - selectdata=selectdata, timerange=timerange, uvrange=uvrange, build 12-Sep-2018 15:30:25 - antenna=antenna, scan=scan, mode=mode, nchan=1, start=thisStart, build 12-Sep-2018 15:30:25 - width=width, interpolation=interpolation, psfmode=psfmode, build 12-Sep-2018 15:30:25 - imagermode=imagermode, cyclefactor=cyclefactor, build 12-Sep-2018 15:30:25 - cyclespeedup=cyclespeedup, imsize=imsize, cell=cell, build 12-Sep-2018 15:30:25 - phasecenter=phasecenter, restfreq=restfreq, stokes=stokes, build 12-Sep-2018 15:30:25 - weighting=weighting, robust=robust, noise=noise, npixels=npixels, build 12-Sep-2018 15:30:25 - modelimage=modelimage, uvtaper=uvtaper, outertaper=outertaper, build 12-Sep-2018 15:30:25 - innertaper=innertaper, niter=0, gain=gain, minpb=minpb) build 12-Sep-2018 15:30:25 - casalog.origin('autoclean') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # make the mask image build 12-Sep-2018 15:30:25 - ia_tool = ia.newimagefromimage(infile=thisImage+'.image', build 12-Sep-2018 15:30:25 - outfile=thisImage+'.mask', build 12-Sep-2018 15:30:25 - overwrite=True) build 12-Sep-2018 15:30:25 - if(mask): build 12-Sep-2018 15:30:25 - ia_tool.putchunk(pixels=maskVals) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - ia_tool.set(pixels=0.0) build 12-Sep-2018 15:30:25 - ia_tool.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # keep track of changes in maximum residual over iterations build 12-Sep-2018 15:30:25 - maxres_increased = 0 build 12-Sep-2018 15:30:25 - post_max = 5000 build 12-Sep-2018 15:30:25 - # iterations variable stores number of clean internal iterations build 12-Sep-2018 15:30:25 - iterations = 0 build 12-Sep-2018 15:30:25 - # new_npercycle: number of minor cycles this iteration (can change) build 12-Sep-2018 15:30:25 - new_npercycle = orig_npercycle build 12-Sep-2018 15:30:25 - while iterations < niter: build 12-Sep-2018 15:30:25 - cleanmore, nregions = \ build 12-Sep-2018 15:30:25 - autowindow(imagename=thisImage, Npeak=Npeak, build 12-Sep-2018 15:30:25 - shape=shape, irregsize=irregsize, build 12-Sep-2018 15:30:25 - boxstretch=boxstretch, Nrms=Nrms, build 12-Sep-2018 15:30:25 - island_rms=island_rms, peak_rms=peak_rms, build 12-Sep-2018 15:30:25 - gain_threshold=gain_threshold, build 12-Sep-2018 15:30:25 - clean_threshold=clean_threshold, diag=diag, build 12-Sep-2018 15:30:25 - useabsresid=useabsresid, ichan=ichan) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # if first iteration, make sure CLEAN is cleaning build 12-Sep-2018 15:30:25 - if not(cleanmore): build 12-Sep-2018 15:30:25 - if not(iterations): build 12-Sep-2018 15:30:25 - casalog.post('Input parameters do not induce cleaning of ' build 12-Sep-2018 15:30:25 - 'channel %d.' % ichan) build 12-Sep-2018 15:30:25 - break build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # did autowindow make new clean regions? build 12-Sep-2018 15:30:25 - if(nregions): build 12-Sep-2018 15:30:25 - new_npercycle = orig_npercycle build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - casalog.post('Will continue cleaning with current clean regions.') build 12-Sep-2018 15:30:25 - new_npercycle = int(round(new_npercycle * npercycle_speedup)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # maximum absolute residual before next clean iteration build 12-Sep-2018 15:30:25 - if (eps_maxres) or (allow_maxres_inc >= 0): build 12-Sep-2018 15:30:25 - pre_max = post_max build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # niter-iterations is the *total* number of iterations left, and might build 12-Sep-2018 15:30:25 - # be less than npercycle. Use the minimum of (npercycle, niter-iterations) build 12-Sep-2018 15:30:25 - casalog.post('Starting clean at iteration %d' % iterations) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #TMP# CAS-1623: an improvement will be made to CLEAN to allow it to build 12-Sep-2018 15:30:25 - # start from an existing residual image. The call to clean may need build 12-Sep-2018 15:30:25 - # to be changed to reflect this. build 12-Sep-2018 15:30:25 - clean(vis=vis, imagename=thisImage, field=field, spw=spw, build 12-Sep-2018 15:30:25 - selectdata=selectdata, timerange=timerange, uvrange=uvrange, build 12-Sep-2018 15:30:25 - antenna=antenna, scan=scan, mode=mode, nchan=1, width=width, build 12-Sep-2018 15:30:25 - start=thisStart, interpolation=interpolation, psfmode=psfmode, build 12-Sep-2018 15:30:25 - imagermode=imagermode, imsize=imsize, build 12-Sep-2018 15:30:25 - cyclefactor=cyclefactor, cyclespeedup=cyclespeedup, build 12-Sep-2018 15:30:25 - cell=cell, phasecenter=phasecenter, restfreq=restfreq, build 12-Sep-2018 15:30:25 - stokes=stokes, weighting=weighting, robust=robust, build 12-Sep-2018 15:30:25 - noise=noise, npixels=npixels, modelimage=modelimage, build 12-Sep-2018 15:30:25 - uvtaper=uvtaper, outertaper=outertaper, innertaper=innertaper, build 12-Sep-2018 15:30:25 - niter=min(new_npercycle,niter-iterations), build 12-Sep-2018 15:30:25 - mask=thisImage+'.mask', gain=gain, minpb=minpb, npercycle=niter, build 12-Sep-2018 15:30:25 - interactive=bool(nregions and interactive)) build 12-Sep-2018 15:30:25 - casalog.origin('autoclean') build 12-Sep-2018 15:30:25 - iterations += new_npercycle build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # stop if we've reached maximum number of clean minor cycles build 12-Sep-2018 15:30:25 - if iterations >= niter: build 12-Sep-2018 15:30:25 - casalog.post('Reached maximum number of CLEAN cycles (%d)' % niter) build 12-Sep-2018 15:30:25 - break build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # check maximum residual value build 12-Sep-2018 15:30:25 - if (eps_maxres) or (allow_maxres_inc >= 0): build 12-Sep-2018 15:30:25 - residualImage = thisImage+'.residual' build 12-Sep-2018 15:30:25 - ia.open(residualImage) build 12-Sep-2018 15:30:25 - stats = ia.statistics(list=False, verbose=True) build 12-Sep-2018 15:30:25 - ia.close() build 12-Sep-2018 15:30:25 - if(useabsresid): build 12-Sep-2018 15:30:25 - post_max = max([ stats['max'][0], abs(stats['min'][0]) ]) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - post_max = stats['max'][0] build 12-Sep-2018 15:30:25 - # check fractional change of maximum residual build 12-Sep-2018 15:30:25 - if(eps_maxres): build 12-Sep-2018 15:30:25 - if abs(post_max-pre_max)/pre_max < eps_maxres: build 12-Sep-2018 15:30:25 - casalog.post('Maximum residual has changed by less ' build 12-Sep-2018 15:30:25 - 'than %.3f; stopping' % eps_maxres) build 12-Sep-2018 15:30:25 - break build 12-Sep-2018 15:30:25 - if post_max >= pre_max: build 12-Sep-2018 15:30:25 - maxres_increased += 1 build 12-Sep-2018 15:30:25 - casalog.post('Maximum residual has increased.')#, 'INFO1') build 12-Sep-2018 15:30:25 - if maxres_increased > allow_maxres_inc: build 12-Sep-2018 15:30:25 - casalog.post('Maximum residual has increased %d times; ' build 12-Sep-2018 15:30:25 - 'stopping.' % maxres_increased) build 12-Sep-2018 15:30:25 - break build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # finished with all channels: concatenate if there are multiple channels build 12-Sep-2018 15:30:25 - if (mode!='mfs') and (nchan!=1) and (doconcat): build 12-Sep-2018 15:30:25 - concat_images(imagename, '.image', nchan) build 12-Sep-2018 15:30:25 - concat_images(imagename, '.mask', nchan) build 12-Sep-2018 15:30:25 - concat_images(imagename, '.flux', nchan) build 12-Sep-2018 15:30:25 - concat_images(imagename, '.psf', nchan) build 12-Sep-2018 15:30:25 - concat_images(imagename, '.model', nchan) build 12-Sep-2018 15:30:25 - concat_images(imagename, '.residual', nchan) build 12-Sep-2018 15:30:25 - concat_regions(imagename, '.rgn', nchan) build 12-Sep-2018 15:30:25 - # The individual .channel. tables are no longer needed build 12-Sep-2018 15:30:25 - shutil.rmtree(imagename + '.channel.*') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if(pbcor): build 12-Sep-2018 15:30:25 - # user wants primary beam corrected .image file and .residual file build 12-Sep-2018 15:30:25 - ia.open(imagename+'.image') build 12-Sep-2018 15:30:25 - ia.calc(imagename+'.image/'+imagename+'.flux') build 12-Sep-2018 15:30:25 - ia.open(imagename+'.residual') build 12-Sep-2018 15:30:25 - ia.calc(imagename+'.residual/'+imagename+'.flux') build 12-Sep-2018 15:30:25 - ia.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# Autowindow selects the clean region based on peaks in each island above threshold build 12-Sep-2018 15:30:25 -def autowindow(imagename='', island_rms=0, gain_threshold=0, peak_rms=0, Nrms=0, build 12-Sep-2018 15:30:25 - boxstretch=0, clean_threshold=0, Npeak=None, shape=0, build 12-Sep-2018 15:30:25 - irregsize=100, diag=False, useabsresid=False, ichan=0): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - maskImage = imagename+'.mask' build 12-Sep-2018 15:30:25 - residualImage = imagename+'.residual' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # what is the rms of the residual image outside the current clean regions? build 12-Sep-2018 15:30:25 - # option: could modify this to get rms by iterative sigma clipping build 12-Sep-2018 15:30:25 - ia.open(residualImage) build 12-Sep-2018 15:30:25 - rms = ia.statistics(mask=maskImage+'==0',list=False, verbose=True)['rms'][0] build 12-Sep-2018 15:30:25 - max_residual = ia.statistics(list=False, verbose=True)['max'][0] build 12-Sep-2018 15:30:25 - if(useabsresid): build 12-Sep-2018 15:30:25 - min_residual = ia.statistics(list=False, verbose=True)['min'][0] build 12-Sep-2018 15:30:25 - if abs(min_residual) > max_residual: build 12-Sep-2018 15:30:25 - max_residual = abs(min_residual) build 12-Sep-2018 15:30:25 - ia.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # threshold values for selecting clean regions build 12-Sep-2018 15:30:25 - threshold = max(peak_rms*rms, max_residual*gain_threshold) build 12-Sep-2018 15:30:25 - casalog.post('peak_threshold = %f' % threshold, 'INFO1') build 12-Sep-2018 15:30:25 - casalog.post('island_threshold = %f' % (island_rms*rms), 'INFO1') build 12-Sep-2018 15:30:25 - casalog.post('max_residual (%.5f) is %.1f times rms (%.5f)' % build 12-Sep-2018 15:30:25 - (max_residual, max_residual/rms, rms)) build 12-Sep-2018 15:30:25 - # If no units for clean_threshold, assume mJy for consistency with CLEAN. build 12-Sep-2018 15:30:25 - # But convert to Jy, because that's what units the images are in. build 12-Sep-2018 15:30:25 - clean_threshold = qa.convert(qa.quantity(clean_threshold,'mJy'),'Jy') build 12-Sep-2018 15:30:25 - clean_threshold_Jy = qa.getvalue(clean_threshold) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # if max_res. is below thresholds, no need to continue build 12-Sep-2018 15:30:25 - if (max_residual < clean_threshold_Jy) or (max_residual < rms*Nrms): build 12-Sep-2018 15:30:25 - if max_residual < clean_threshold_Jy: build 12-Sep-2018 15:30:25 - casalog.post('Max_residual is less than clean_threshold.') build 12-Sep-2018 15:30:25 - if max_residual < rms*Nrms: build 12-Sep-2018 15:30:25 - casalog.post('Max_residual is less than '+str(Nrms)+' times rms.') build 12-Sep-2018 15:30:25 - return 0, 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # if max_res. below peak threshold, need more cleaning with current regions build 12-Sep-2018 15:30:25 - if max_residual < peak_rms*rms: build 12-Sep-2018 15:30:25 - casalog.post('Max_residual is less than box threshold for peaks.') build 12-Sep-2018 15:30:25 - return 1, 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # select the new clean regions; put them in the mask build 12-Sep-2018 15:30:25 - casalog.post('Selecting clean regions.') build 12-Sep-2018 15:30:25 - Nregions = get_islands(imagename, Npeak, island_rms*rms, threshold, shape, build 12-Sep-2018 15:30:25 - boxstretch, irregsize, diag, ichan) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if not(Nregions): build 12-Sep-2018 15:30:25 - casalog.post('No new peaks passed selection.') build 12-Sep-2018 15:30:25 - return 1, 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - return 1, Nregions build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# Starting with peak in image, find islands: contiguous pixels above threshold. build 12-Sep-2018 15:30:25 -# Tests peak: bright enough to cleanbox? Then adds chosen region shape to mask. build 12-Sep-2018 15:30:25 -# Continues with next peak pixel until Npeak peaks have been found. build 12-Sep-2018 15:30:25 -# Won't always add Npeak new clean regions if current clean regions still build 12-Sep-2018 15:30:25 -# contain peaks. But isolated bright pixels (<2.5*peak_threshold) are ignored. build 12-Sep-2018 15:30:25 -def get_islands(imagename='', Npeak=3, island_threshold=0, peak_threshold=0, build 12-Sep-2018 15:30:25 - shape=0, boxstretch=0, irregsize=100, diag=False, ichan=0): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - maskImage = imagename+'.mask' build 12-Sep-2018 15:30:25 - residualImage = imagename+'.residual' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # types for the recarrays that will store pixel and island info. build 12-Sep-2018 15:30:25 - island_dtype = [('box', '4i4'), ('peak_flux', 'f4')] build 12-Sep-2018 15:30:25 - pix_dtype = [('x','i4'),('y','i4'),('tmp_mask','f4'),('cln_mask','f4')] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Get mask for all current clean regions which we'll call cln_mask build 12-Sep-2018 15:30:25 - ia.open(maskImage) build 12-Sep-2018 15:30:25 - cln_mask = ia.getregion().squeeze() build 12-Sep-2018 15:30:25 - ia.close() build 12-Sep-2018 15:30:25 - # Find all pixels above the threshold; make temporary mask: tmp_mask build 12-Sep-2018 15:30:25 - ia.open(residualImage) build 12-Sep-2018 15:30:25 - tmp_mask = ia.getregion(mask=residualImage+'>'+str(island_threshold), build 12-Sep-2018 15:30:25 - getmask=True).squeeze() build 12-Sep-2018 15:30:25 - # pixel values build 12-Sep-2018 15:30:25 - pixelVals = ia.getregion().squeeze() build 12-Sep-2018 15:30:25 - ia.close() build 12-Sep-2018 15:30:25 - # store pixel positions, mask values, clean region status in recarray build 12-Sep-2018 15:30:25 - grid = numpy.indices(tmp_mask.shape) build 12-Sep-2018 15:30:25 - xyMask = numpy.rec.fromarrays([grid[0], grid[1], tmp_mask, cln_mask], build 12-Sep-2018 15:30:25 - dtype=pix_dtype) build 12-Sep-2018 15:30:25 - nx, ny = tmp_mask.shape build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # keep going until we've found Npeak islands build 12-Sep-2018 15:30:25 - # or there are no more pixels above the island_threshold build 12-Sep-2018 15:30:25 - # or the peak is less than the peak_threshold build 12-Sep-2018 15:30:25 - Nregions = 0 build 12-Sep-2018 15:30:25 - Nkept = 0 build 12-Sep-2018 15:30:25 - while Nregions < Npeak: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if not(xyMask['tmp_mask'].max()): build 12-Sep-2018 15:30:25 - # no more pixels above island threshold: we're done build 12-Sep-2018 15:30:25 - break build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # find the next peak and its location build 12-Sep-2018 15:30:25 - xok, yok = numpy.where(xyMask['tmp_mask']) build 12-Sep-2018 15:30:25 - pixok = pixelVals[xok,yok] build 12-Sep-2018 15:30:25 - peak = pixok.max() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if peak < peak_threshold: build 12-Sep-2018 15:30:25 - # peak is below peak threshold for clean boxing: we're done build 12-Sep-2018 15:30:25 - break build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # store location of peak build 12-Sep-2018 15:30:25 - peakind = pixok == peak build 12-Sep-2018 15:30:25 - xpeak = xok[peakind][0] build 12-Sep-2018 15:30:25 - ypeak = yok[peakind][0] build 12-Sep-2018 15:30:25 - x = xpeak build 12-Sep-2018 15:30:25 - y = ypeak build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # since we've already checked this pixel, set its tmp mask to 0 build 12-Sep-2018 15:30:25 - xyMask[x,y]['tmp_mask'] = 0 build 12-Sep-2018 15:30:25 - listPix = [xyMask[x,y]] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # find all above-threshold contiguous pixels of this island build 12-Sep-2018 15:30:25 - # python lets us loop over items in a list while adding to the list! build 12-Sep-2018 15:30:25 - for pixel in listPix: build 12-Sep-2018 15:30:25 - x = pixel['x'] build 12-Sep-2018 15:30:25 - y = pixel['y'] build 12-Sep-2018 15:30:25 - # search the pixels surrounding the pixel of interest build 12-Sep-2018 15:30:25 - xLook1 = max(0,x-1) # in case we're at the image edge... build 12-Sep-2018 15:30:25 - xLook2 = min(x+2,nx-1) # | build 12-Sep-2018 15:30:25 - yLook1 = max(0,y-1) # | build 12-Sep-2018 15:30:25 - yLook2 = min(y+2,ny-1) # V build 12-Sep-2018 15:30:25 - # add new above-threshold pixels to the list for this island build 12-Sep-2018 15:30:25 - if(diag): build 12-Sep-2018 15:30:25 - contig_pix = xyMask[xLook1:xLook2, yLook1:yLook2] build 12-Sep-2018 15:30:25 - listPix += [pix for pix in contig_pix.ravel() if(pix['tmp_mask'])] build 12-Sep-2018 15:30:25 - # since we've already added these pixels, set their tmp mask to 0 build 12-Sep-2018 15:30:25 - contig_pix['tmp_mask'] = 0 build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - contig_pix = [] build 12-Sep-2018 15:30:25 - contig_pix += xyMask[xLook1:xLook2, y] build 12-Sep-2018 15:30:25 - contig_pix += xyMask[x, yLook1:yLook2] build 12-Sep-2018 15:30:25 - listPix += [pix for pix in contig_pix if(pix['tmp_mask'])] build 12-Sep-2018 15:30:25 - # since we've already added these pixels, set their tmp mask to 0 build 12-Sep-2018 15:30:25 - xyMask[xLook1:xLook2, y]['tmp_mask'] = 0 build 12-Sep-2018 15:30:25 - xyMask[x, yLook1:yLook2]['tmp_mask'] = 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if peak < peak_threshold: build 12-Sep-2018 15:30:25 - # reject islands with peak < peak_threshold build 12-Sep-2018 15:30:25 - continue build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # found all pixels in this island; get bounding box build 12-Sep-2018 15:30:25 - islandPix = numpy.rec.fromrecords(listPix, dtype=pix_dtype) build 12-Sep-2018 15:30:25 - xmin = islandPix['x'].min() build 12-Sep-2018 15:30:25 - xmax = islandPix['x'].max() build 12-Sep-2018 15:30:25 - ymin = islandPix['y'].min() build 12-Sep-2018 15:30:25 - ymax = islandPix['y'].max() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if (xmin==xmax) or (ymin==ymax): build 12-Sep-2018 15:30:25 - # reject islands that are only 1 pixel wide, unless very bright build 12-Sep-2018 15:30:25 - if peak < 2.5 * peak_threshold: build 12-Sep-2018 15:30:25 - continue build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Nregions += 1 # This island should be in a clean region. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Is the peak already in a clean region? build 12-Sep-2018 15:30:25 - if(islandPix[0]['cln_mask']): build 12-Sep-2018 15:30:25 - casalog.post('Peak of %f ' % peak + 'at pixel ' + build 12-Sep-2018 15:30:25 - str([xpeak,ypeak]) + ' is already in mask.', 'INFO1') build 12-Sep-2018 15:30:25 - continue build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # This is a new island for clean boxing. Prepare to mask! build 12-Sep-2018 15:30:25 - Nkept += 1 build 12-Sep-2018 15:30:25 - newIsland = numpy.array(([xmin, ymin, xmax, ymax], peak), build 12-Sep-2018 15:30:25 - dtype=island_dtype) build 12-Sep-2018 15:30:25 - if (irregsize) and (min([xmax-xmin, ymax-ymin]) >= irregsize): build 12-Sep-2018 15:30:25 - # user wants clean region to be outline of island build 12-Sep-2018 15:30:25 - # for large islands build 12-Sep-2018 15:30:25 - mask_island(imagename, newIsland, islandPix) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - # region will be circle or box build 12-Sep-2018 15:30:25 - mask_region(imagename, newIsland, shape, boxstretch, ichan) build 12-Sep-2018 15:30:25 - return Nkept build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# If user prefers, large islands (size >= irregsize) will be masked 'as-is' build 12-Sep-2018 15:30:25 -# instead of surrounding them by a box-shaped or circular clean region build 12-Sep-2018 15:30:25 -def mask_island(imagename='', island=None, pixels=None): build 12-Sep-2018 15:30:25 - ia.open(imagename+'.mask') build 12-Sep-2018 15:30:25 - csys = ia.coordsys() # Not needed? build 12-Sep-2018 15:30:25 - mask = ia.getregion() build 12-Sep-2018 15:30:25 - mask[pixels['x'], pixels['y']] = 1 build 12-Sep-2018 15:30:25 - ia.putchunk(mask) build 12-Sep-2018 15:30:25 - ia.close() build 12-Sep-2018 15:30:25 - casalog.post('Adding irregular region for peak of %f ' % build 12-Sep-2018 15:30:25 - island['peak_flux'] + 'inside box ' + str(island['box'])) build 12-Sep-2018 15:30:25 - #TMP# for now, can only write boxes out to a region file. So for a build 12-Sep-2018 15:30:25 - # temporary fix, will continue putting irregular region in mask, build 12-Sep-2018 15:30:25 - # but will also output a box covering the island to the .rgn file. build 12-Sep-2018 15:30:25 - box_to_regionfile(imagename, island['box']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# Chooses appropriate shape (box or circle) for clean region build 12-Sep-2018 15:30:25 -def mask_region(imagename='', island=None, shape=0, boxstretch=0, ichan=0): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - peak_flux = island['peak_flux'] build 12-Sep-2018 15:30:25 - box = island['box'] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if shape==2: build 12-Sep-2018 15:30:25 - xsize = box[2] - box[0] build 12-Sep-2018 15:30:25 - ysize = box[3] - box[1] build 12-Sep-2018 15:30:25 - if abs(xsize-ysize) <= 1: build 12-Sep-2018 15:30:25 - shape = 0 build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - shape = 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if(shape): build 12-Sep-2018 15:30:25 - add_box(imagename, box, peak_flux, boxstretch) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - add_circle(imagename, box, peak_flux, boxstretch) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# Add a circular region to the mask image build 12-Sep-2018 15:30:25 -def add_circle(imagename, box, peak_flux, boxstretch=0): build 12-Sep-2018 15:30:25 - #TMP# At some point im.regiontoimagemask should allow circles that build 12-Sep-2018 15:30:25 - # specify a particular channel build 12-Sep-2018 15:30:25 - xsize = box[2] - box[0] build 12-Sep-2018 15:30:25 - ysize = box[3] - box[1] build 12-Sep-2018 15:30:25 - radius = max(sqrt(xsize**2+ysize**2)/2. + boxstretch, 1) build 12-Sep-2018 15:30:25 - xcen = numpy.average([box[0], box[2]]) build 12-Sep-2018 15:30:25 - ycen = numpy.average([box[1], box[3]]) build 12-Sep-2018 15:30:25 - circle = [radius, xcen, ycen] build 12-Sep-2018 15:30:25 - im.regiontoimagemask(mask=imagename+'.mask', circles=circle) build 12-Sep-2018 15:30:25 - casalog.post('Adding circle for peak of %f with center (%.1f,%.1f) and ' build 12-Sep-2018 15:30:25 - 'radius %.1f' % (peak_flux, xcen, ycen, radius)) build 12-Sep-2018 15:30:25 - #TMP# can't write out circular regions to a region file, build 12-Sep-2018 15:30:25 - # so for now add a box that encompasses the circle build 12-Sep-2018 15:30:25 - # Since we increased size of circle to include potential "corners" build 12-Sep-2018 15:30:25 - # of emission outside a smaller (max(xsize,ysize)) radius, must build 12-Sep-2018 15:30:25 - # now make a box that completely encompasses the circle build 12-Sep-2018 15:30:25 - newbox = [floor(xcen - radius), floor(ycen - radius), build 12-Sep-2018 15:30:25 - ceil(xcen + radius), ceil(ycen + radius)] build 12-Sep-2018 15:30:25 - box_to_regionfile(imagename, newbox) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# Add a box region to the mask image; save new region in region file build 12-Sep-2018 15:30:25 -def add_box(imagename, box, peak_flux, boxstretch=0): build 12-Sep-2018 15:30:25 - box[0:2] -= boxstretch build 12-Sep-2018 15:30:25 - box[2:4] += boxstretch build 12-Sep-2018 15:30:25 - # in case we used boxstretch < 0 and a one-pixel sized box: build 12-Sep-2018 15:30:25 - if box[0] > box[2]: build 12-Sep-2018 15:30:25 - box[0] += boxstretch build 12-Sep-2018 15:30:25 - box[2] -= boxstretch build 12-Sep-2018 15:30:25 - if box[1] > box[3]: build 12-Sep-2018 15:30:25 - box[1] += boxstretch build 12-Sep-2018 15:30:25 - box[3] -= boxstretch build 12-Sep-2018 15:30:25 - im.regiontoimagemask(mask=imagename+'.mask', boxes=box) build 12-Sep-2018 15:30:25 - casalog.post('Adding box for peak of %f ' % peak_flux + 'with coordinates ' build 12-Sep-2018 15:30:25 - + str(box)) build 12-Sep-2018 15:30:25 - box_to_regionfile(imagename, box) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# concatenate multiple-channel images build 12-Sep-2018 15:30:25 -def concat_images(imagename='', suffix='', number=0, relax=False): build 12-Sep-2018 15:30:25 - imagelist = [imagename + '.channel.' + i + suffix build 12-Sep-2018 15:30:25 - for i in map(str, range(number))] build 12-Sep-2018 15:30:25 - ia.imageconcat(imagename + suffix, imagelist, overwrite=True, relax=relax) build 12-Sep-2018 15:30:25 - ia.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# read in multiple region (.rgn) files; save to one file build 12-Sep-2018 15:30:25 -def concat_regions(imagename='', suffix='', number=0): build 12-Sep-2018 15:30:25 - regions = {} build 12-Sep-2018 15:30:25 - for file in [imagename + '.channel.' + i + suffix build 12-Sep-2018 15:30:25 - for i in map(str, range(number))]: build 12-Sep-2018 15:30:25 - if(os.path.exists(file)): build 12-Sep-2018 15:30:25 - regions[file] = rg.fromfiletorecord(file) build 12-Sep-2018 15:30:25 - nregion = len(regions) build 12-Sep-2018 15:30:25 - if(nregion): build 12-Sep-2018 15:30:25 - regionfile = imagename + '.rgn' build 12-Sep-2018 15:30:25 - if(os.path.exists(regionfile)): build 12-Sep-2018 15:30:25 - os.system('rm -f '+regionfile) build 12-Sep-2018 15:30:25 - if nregion > 1: build 12-Sep-2018 15:30:25 - rg.tofile(regionfile, rg.makeunion(regions)) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - rg.tofile(regionfile, regions[file]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def box_to_regionfile(imagename, box): build 12-Sep-2018 15:30:25 - ia.open(imagename+'.image') build 12-Sep-2018 15:30:25 - csys = ia.coordsys() build 12-Sep-2018 15:30:25 - # need pixel corners, not pixel centers, for region file build 12-Sep-2018 15:30:25 - blccoord = [box[0]-0.5, box[1]-0.5] build 12-Sep-2018 15:30:25 - trccoord = [box[2]+0.5, box[3]+0.5] build 12-Sep-2018 15:30:25 - blc = ia.toworld(blccoord, 's')['string'] build 12-Sep-2018 15:30:25 - trc = ia.toworld(trccoord, 's')['string'] build 12-Sep-2018 15:30:25 - ia.close() build 12-Sep-2018 15:30:25 - newregion = rg.wbox(blc=blc, trc=trc, csys=csys.torecord()) build 12-Sep-2018 15:30:25 - regionfile = imagename+'.rgn' build 12-Sep-2018 15:30:25 - if(os.path.exists(regionfile)): build 12-Sep-2018 15:30:25 - oldregion = rg.fromfiletorecord(regionfile) build 12-Sep-2018 15:30:25 - regions = {'0':oldregion, '1':newregion} build 12-Sep-2018 15:30:25 - unionregion = rg.makeunion(regions) build 12-Sep-2018 15:30:25 - os.system('rm -f '+regionfile) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - unionregion = newregion build 12-Sep-2018 15:30:25 - rg.tofile(regionfile, unionregion) build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_boxit.py b/gcwrap/python/scripts/task_boxit.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 0cbb348..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_boxit.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,229 +0,0 @@ build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 -import numpy build 12-Sep-2018 15:30:25 -import sys build 12-Sep-2018 15:30:25 -import re build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# Writes out regions above threshold to regionfile+'.box' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def boxit(imagename, regionfile, threshold, maskname, chanrange, polrange, minsize, diag, boxstretch, overwrite): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.origin('boxit') build 12-Sep-2018 15:30:25 - casalog.post("Task boxit has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - myia = iatool() build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - if not(regionfile): build 12-Sep-2018 15:30:25 - regionfile = imagename + '.box' build 12-Sep-2018 15:30:25 - if not regionfile.endswith('.box'): build 12-Sep-2018 15:30:25 - regionfile = regionfile + '.box' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if not(overwrite): build 12-Sep-2018 15:30:25 - if(os.path.exists(regionfile)): build 12-Sep-2018 15:30:25 - casalog.post('file "' + regionfile + '" already exists.', 'WARN') build 12-Sep-2018 15:30:25 - return build 12-Sep-2018 15:30:25 - if(maskname and os.path.exists(maskname)): build 12-Sep-2018 15:30:25 - casalog.post('output mask "' + maskname + '" already exists.', 'WARN') build 12-Sep-2018 15:30:25 - return build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # If no units, assume mJy for consistency with auto/clean tasks. build 12-Sep-2018 15:30:25 - # But convert to Jy, because that's what units the images are in. build 12-Sep-2018 15:30:25 - threshold = qa.getvalue(qa.convert(qa.quantity(threshold,'mJy'),'Jy'))[0] build 12-Sep-2018 15:30:25 - casalog.post("Setting threshold to " + str(threshold) + "Jy", "INFO") build 12-Sep-2018 15:30:25 - newIsland = numpy.zeros(1, dtype=[('box','4i4'),('npix','i4')]) build 12-Sep-2018 15:30:25 - # Find all pixels above the threshold build 12-Sep-2018 15:30:25 - myia.open(imagename) build 12-Sep-2018 15:30:25 - if len(myia.shape()) != 4: build 12-Sep-2018 15:30:25 - raise Exception("Only 4D images with direction, spectral, and stokes coordinates are supported") build 12-Sep-2018 15:30:25 - # CAS-2059/CAS-7202 escape characters in image name that will confuse the lattice expression processor build 12-Sep-2018 15:30:25 - mask = "'" + imagename + "'>" + str(threshold) build 12-Sep-2018 15:30:25 - fullmask = myia.getregion(mask=mask, getmask=True) build 12-Sep-2018 15:30:25 - if not(fullmask.max()): build 12-Sep-2018 15:30:25 - casalog.post('Maximum flux in image is below threshold.', 'WARN') build 12-Sep-2018 15:30:25 - return build 12-Sep-2018 15:30:25 - writemask = bool(maskname) build 12-Sep-2018 15:30:25 - csys = myia.coordsys() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - shape = fullmask.shape build 12-Sep-2018 15:30:25 - nx = int(shape[0]) build 12-Sep-2018 15:30:25 - ny = int(shape[1]) build 12-Sep-2018 15:30:25 - n2 = n3 = 1 build 12-Sep-2018 15:30:25 - if len(shape)==3: build 12-Sep-2018 15:30:25 - n2 = int(shape[2]) build 12-Sep-2018 15:30:25 - if len(shape)==4: build 12-Sep-2018 15:30:25 - n2 = int(shape[2]) build 12-Sep-2018 15:30:25 - n3 = int(shape[3]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #casa generated images always 4d and in order of [ra, dec, stokes, freq] build 12-Sep-2018 15:30:25 - #other images can be in the order of [ra, dec, freq, stokes] build 12-Sep-2018 15:30:25 - nms = csys.names() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - chmax=n3 build 12-Sep-2018 15:30:25 - pomax=n2 build 12-Sep-2018 15:30:25 - chmin=0 build 12-Sep-2018 15:30:25 - pomin=0 build 12-Sep-2018 15:30:25 - if len(nms)==4 and nms[3]=='Stokes': build 12-Sep-2018 15:30:25 - chmax=n2 build 12-Sep-2018 15:30:25 - pomax=n3 build 12-Sep-2018 15:30:25 - if chanrange: build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - if str.count(chanrange, '~') == 1: build 12-Sep-2018 15:30:25 - ch1=int(str.split(chanrange, '~')[0]) build 12-Sep-2018 15:30:25 - ch2=int(str.split(chanrange, '~')[1]) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - ch1=int(chanrange) build 12-Sep-2018 15:30:25 - ch2=ch1 build 12-Sep-2018 15:30:25 - if ch1 > ch2 or ch1 < 0 or ch2 > chmax: build 12-Sep-2018 15:30:25 - casalog('invalid channel range', "SEVERE") build 12-Sep-2018 15:30:25 - return build 12-Sep-2018 15:30:25 - if ch1>chmin: build 12-Sep-2018 15:30:25 - chmin = ch1 build 12-Sep-2018 15:30:25 - if ch2 po2 or po1 < 0 or po2 > pomax: build 12-Sep-2018 15:30:25 - casalog( 'invalid stokes range', "SEVERE") build 12-Sep-2018 15:30:25 - return build 12-Sep-2018 15:30:25 - if po1>pomin: build 12-Sep-2018 15:30:25 - pomin = po1 build 12-Sep-2018 15:30:25 - if po2 box[2]: build 12-Sep-2018 15:30:25 - box[0] += boxstretch build 12-Sep-2018 15:30:25 - box[2] -= boxstretch build 12-Sep-2018 15:30:25 - if box[1] > box[3]: build 12-Sep-2018 15:30:25 - box[1] += boxstretch build 12-Sep-2018 15:30:25 - box[3] -= boxstretch build 12-Sep-2018 15:30:25 - if writemask: build 12-Sep-2018 15:30:25 - # avoid pixels in boxes that have been stretched beyond the image limits build 12-Sep-2018 15:30:25 - for ii in range(max(0, box[0]), min(box[2], outputmask.shape[0] - 1)): build 12-Sep-2018 15:30:25 - for jj in range(max(0, box[1]), min(box[3], outputmask.shape[1] - 1)): build 12-Sep-2018 15:30:25 - outputmask[ii][jj][i2][i3] = True build 12-Sep-2018 15:30:25 - blccoord = [box[0]-0.5, box[1]-0.5, i2, i3] build 12-Sep-2018 15:30:25 - trccoord = [box[2]+0.5, box[3]+0.5, i2, i3] build 12-Sep-2018 15:30:25 - # note that the toworld() calls are likely very expensive for many boxes. But then build 12-Sep-2018 15:30:25 - # again, the box-finding algorithm itself seems pretty inefficient, but resource build 12-Sep-2018 15:30:25 - # constraints only permit a band aid fix at this time. build 12-Sep-2018 15:30:25 - blc = myia.toworld(blccoord, 'm', False)['measure'] build 12-Sep-2018 15:30:25 - trc = myia.toworld(trccoord, 'm', False)['measure'] build 12-Sep-2018 15:30:25 - # RA/Dec reference frame build 12-Sep-2018 15:30:25 - outstring = "worldbox " + blc['direction']['refer'] build 12-Sep-2018 15:30:25 - # RA blc/trc build 12-Sep-2018 15:30:25 - outstring += " [" + quantity_to_string(blc["direction"]["m0"], "rad") + ", " build 12-Sep-2018 15:30:25 - outstring += quantity_to_string(trc["direction"]["m0"], "rad") + "]" build 12-Sep-2018 15:30:25 - # Dec blc/trc build 12-Sep-2018 15:30:25 - outstring += " [" + quantity_to_string(blc["direction"]["m1"], "rad") + ", " build 12-Sep-2018 15:30:25 - outstring += quantity_to_string(trc["direction"]["m1"], "rad") + "]" build 12-Sep-2018 15:30:25 - # frequency blc/trc build 12-Sep-2018 15:30:25 - freq = blc["spectral"]['frequency']['refer'] + " " build 12-Sep-2018 15:30:25 - freq += quantity_to_string(blc["spectral"]["frequency"]["m0"], "Hz", False) build 12-Sep-2018 15:30:25 - outstring += " ['" + freq + "', '" + freq + "']" build 12-Sep-2018 15:30:25 - # Stokes blc/trc build 12-Sep-2018 15:30:25 - outstring += " ['" + blc["stokes"] + "', '" + trc["stokes"] + "']" build 12-Sep-2018 15:30:25 - # add the mask flag build 12-Sep-2018 15:30:25 - outstring += " " + str(1) build 12-Sep-2018 15:30:25 - f.write(outstring + "\n") build 12-Sep-2018 15:30:25 - casalog.post("Wrote " + str(totregions) + " regions to file " + regionfile, 'INFO') build 12-Sep-2018 15:30:25 - if writemask: build 12-Sep-2018 15:30:25 - myia.fromimage(infile=imagename, outfile=maskname, overwrite=True) build 12-Sep-2018 15:30:25 - myia.done() build 12-Sep-2018 15:30:25 - myia.open(maskname) build 12-Sep-2018 15:30:25 - myia.putchunk(outputmask) build 12-Sep-2018 15:30:25 - myia.done() build 12-Sep-2018 15:30:25 - f.close() build 12-Sep-2018 15:30:25 - return True build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - casalog.post( str( '*** Error *** ') + str(instance), 'SEVERE') build 12-Sep-2018 15:30:25 - raise build 12-Sep-2018 15:30:25 - finally: build 12-Sep-2018 15:30:25 - if myia: build 12-Sep-2018 15:30:25 - myia.done() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def quantity_to_string(quantity, unit=None, quotes=True): build 12-Sep-2018 15:30:25 - if unit != None: build 12-Sep-2018 15:30:25 - quantity = qa.convert(quantity, unit) build 12-Sep-2018 15:30:25 - string = str(quantity['value']) + quantity['unit'] build 12-Sep-2018 15:30:25 - if quotes: build 12-Sep-2018 15:30:25 - string = "'" + string + "'" build 12-Sep-2018 15:30:25 - return string build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def find_nearby_island_pixels(island, mask, pos, xmax, ymax, diag): build 12-Sep-2018 15:30:25 - # blank this position so we don't deal with it again build 12-Sep-2018 15:30:25 - mask[pos] = False build 12-Sep-2018 15:30:25 - xref = pos[0] build 12-Sep-2018 15:30:25 - yref = pos[1] build 12-Sep-2018 15:30:25 - for x in range(max(xref-1, 0), min(xref+2, xmax)): build 12-Sep-2018 15:30:25 - for y in range(max(yref-1, 0), min(yref+2, ymax)): build 12-Sep-2018 15:30:25 - if x == xref and y == yref: build 12-Sep-2018 15:30:25 - # same position as reference build 12-Sep-2018 15:30:25 - continue build 12-Sep-2018 15:30:25 - if ( (not diag) and (x-xref != 0) and (y-yref != 0)): build 12-Sep-2018 15:30:25 - # diagonal pixels only used if diag is true build 12-Sep-2018 15:30:25 - continue build 12-Sep-2018 15:30:25 - if mask[x][y]: build 12-Sep-2018 15:30:25 - # found another pixel in this island build 12-Sep-2018 15:30:25 - island['box'][0] = min(island['box'][0],x) build 12-Sep-2018 15:30:25 - island['box'][1] = min(island['box'][1],y) build 12-Sep-2018 15:30:25 - island['box'][2] = max(island['box'][2],x) build 12-Sep-2018 15:30:25 - island['box'][3] = max(island['box'][3],y) build 12-Sep-2018 15:30:25 - island['npix'] += 1 build 12-Sep-2018 15:30:25 - # look for island pixels next to this one build 12-Sep-2018 15:30:25 - find_nearby_island_pixels(island, mask, (x,y), xmax, ymax, diag) build 12-Sep-2018 15:30:25 - return build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_clearplot.py b/gcwrap/python/scripts/task_clearplot.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 267786f..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_clearplot.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,17 +0,0 @@ build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 -import pylab as pl build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def clearplot(): build 12-Sep-2018 15:30:25 - """Clear the matplotlib plotter and all layers: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - casalog.origin('clearplot') build 12-Sep-2018 15:30:25 - casalog.post("Task clearplot has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - mytp = tptool() build 12-Sep-2018 15:30:25 - pl.ion() build 12-Sep-2018 15:30:25 - print "Calling tp.clearplot()" build 12-Sep-2018 15:30:25 - ok=mytp.clearplot(0,0,0) build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - print '*** Error ***',instance build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_csvclean.py b/gcwrap/python/scripts/task_csvclean.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index cd5d6a9..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_csvclean.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,381 +0,0 @@ build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -import shutil build 12-Sep-2018 15:30:25 -import traceback build 12-Sep-2018 15:30:25 -import pdb build 12-Sep-2018 15:30:25 -import numpy as np build 12-Sep-2018 15:30:25 -import sys build 12-Sep-2018 15:30:25 -from cleanhelper import * build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 -from casa_stack_manip import stack_frame_find build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -im,cb,ms,tb,me,ia,po,sm,cl,cs,rg,sl,dc,vp,msmd,fi,fn,imd,sdms=gentools(['im','cb','ms','tb','me','ia','po','sm','cl','cs','rg','sl','dc','vp','msmd','fi','fn','imd','sdms']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def csvclean(vis, imagename,field, spw, advise, mode, nchan, width, imsize, cell, phasecenter, niter, weighting, restoringbeam, interactive): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - """ This task does an invert of the visibilities and deconvolve in the build 12-Sep-2018 15:30:25 - image plane. It does not do a uvdata subtraction (aka Cotton-Schwab build 12-Sep-2018 15:30:25 - major cycle) of model visibility as in clean. - For ALMA Commissioning build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file build 12-Sep-2018 15:30:25 - default: none; example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imagename -- Name of output CASA image. (only the prefix) build 12-Sep-2018 15:30:25 - default: none; example: imagename='m2' build 12-Sep-2018 15:30:25 - output images are: build 12-Sep-2018 15:30:25 - m2.image; cleaned and restored image build 12-Sep-2018 15:30:25 - With or without primary beam correction build 12-Sep-2018 15:30:25 - m2dirty.image; dirty image build 12-Sep-2018 15:30:25 - m2psf.image; point-spread function (dirty beam) build 12-Sep-2018 15:30:25 - m2.model; image of clean components build 12-Sep-2018 15:30:25 - m2.mask; image containing clean regions, when interative=True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - field -- Select fields in MS. Use field id(s) or field name(s). build 12-Sep-2018 15:30:25 - ['go listobs' to obtain the list id's or names] build 12-Sep-2018 15:30:25 - default: ''= all fields build 12-Sep-2018 15:30:25 - If field string is a non-negative integer, it is assumed to build 12-Sep-2018 15:30:25 - be a field index otherwise, it is assumed to be a build 12-Sep-2018 15:30:25 - field name build 12-Sep-2018 15:30:25 - field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 - field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 - field='3C286,3C295'; field named 3C286 and 3C295 build 12-Sep-2018 15:30:25 - field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - spw --Select spectral window/channels build 12-Sep-2018 15:30:25 - NOTE: This selects the data passed as the INPUT to mode build 12-Sep-2018 15:30:25 - default: ''=all spectral windows and channels build 12-Sep-2018 15:30:25 - spw='0~2,4'; spectral windows 0,1,2,4 (all channels) build 12-Sep-2018 15:30:25 - spw='0:5~61'; spw 0, channels 5 to 61 build 12-Sep-2018 15:30:25 - spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 - spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, build 12-Sep-2018 15:30:25 - channels 3 to 45. build 12-Sep-2018 15:30:25 - spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. build 12-Sep-2018 15:30:25 - spw='0:0~10;15~60'; spectral window 0 with channels build 12-Sep-2018 15:30:25 - 0-10,15-60 build 12-Sep-2018 15:30:25 - spw='0:0~10,1:20~30,2:1;2;3'; spw 0, channels 0-10, build 12-Sep-2018 15:30:25 - spw 1, channels 20-30, and spw 2, channels, 1,2 and 3 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imsize -- Image pixel size (x,y). DOES NOT HAVE TO BE A POWER OF 2 build 12-Sep-2018 15:30:25 - default = [256,256]; example: imsize=[350,350] build 12-Sep-2018 15:30:25 - imsize = 500 is equivalent to [500,500] build 12-Sep-2018 15:30:25 - Avoid odd-numbered imsize. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - cell -- Cell size (x,y) build 12-Sep-2018 15:30:25 - default= '1.0arcsec'; build 12-Sep-2018 15:30:25 - example: cell=['0.5arcsec,'0.5arcsec'] or build 12-Sep-2018 15:30:25 - cell=['1arcmin', '1arcmin'] build 12-Sep-2018 15:30:25 - cell = '1arcsec' is equivalent to ['1arcsec','1arcsec'] build 12-Sep-2018 15:30:25 - NOTE:cell = 2.0 => ['2arcsec', '2arcsec'] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - phasecenter -- direction measure or fieldid for the mosaic center build 12-Sep-2018 15:30:25 - default: '' => first field selected ; example: phasecenter=6 build 12-Sep-2018 15:30:25 - or phasecenter='J2000 19h30m00 -40d00m00' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - niter -- Maximum number iterations, build 12-Sep-2018 15:30:25 - if niter=0, then no CLEANing is done ("invert" only) build 12-Sep-2018 15:30:25 - default: 500; example: niter=5000 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - weighting -- Weighting to apply to visibilities: build 12-Sep-2018 15:30:25 - default='natural'; example: weighting='uniform'; build 12-Sep-2018 15:30:25 - Options: 'natural','uniform','briggs', build 12-Sep-2018 15:30:25 - 'superuniform','briggsabs','radial' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - restoringbeam -- Output Gaussian restoring beam for CLEAN image build 12-Sep-2018 15:30:25 - [bmaj, bmin, bpa] elliptical Gaussian restoring beam build 12-Sep-2018 15:30:25 - default units are in arc-seconds for bmaj,bmin, degrees build 12-Sep-2018 15:30:25 - for bpa default: restoringbeam=[]; Use PSF calculated build 12-Sep-2018 15:30:25 - from dirty beam. build 12-Sep-2018 15:30:25 - example: restoringbeam=['10arcsec'] or restorinbeam='10arcsec', circular Gaussian. build 12-Sep-2018 15:30:25 - FWHM 10 arcseconds example: build 12-Sep-2018 15:30:25 - restoringbeam=['10.0','5.0','45.0deg'] 10"x5" build 12-Sep-2018 15:30:25 - at 45 degrees build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - interactive -- Create a mask interactively or not. build 12-Sep-2018 15:30:25 - default=False; example: interactive=True build 12-Sep-2018 15:30:25 - The viewer will open with the image displayed. Select the build 12-Sep-2018 15:30:25 - region for the mask and double click in the middle of it. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #Python script build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.origin('csvclean') build 12-Sep-2018 15:30:25 - casalog.post("Task csvclean has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - ms = casac.ms() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - parsummary = 'vis="'+str(vis)+'", imagename="'+str(imagename)+'", ' build 12-Sep-2018 15:30:25 - parsummary += 'field="'+str(field)+'", spw="'+str(spw)+'", ' build 12-Sep-2018 15:30:25 - parsummary = 'cell="'+str(cell)+'",' build 12-Sep-2018 15:30:25 - parsummary = 'phasecenter='+str(phasecenter)+',' build 12-Sep-2018 15:30:25 - parsummary += 'imsize='+str(imsize)+', niter='+str(niter)+', ' build 12-Sep-2018 15:30:25 - parsummary += 'weighting="'+str(weighting)+'", ' build 12-Sep-2018 15:30:25 - parsummary += 'restoringbeam="'+str(restoringbeam)+'", ' build 12-Sep-2018 15:30:25 - parsummary += 'interactive='+str(interactive)+'' build 12-Sep-2018 15:30:25 - casalog.post(parsummary,'INFO') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# if (not (type(vis)==str) & (os.path.exists(vis))): build 12-Sep-2018 15:30:25 -# raise Exception, 'Visibility data set not found - please verify the name' build 12-Sep-2018 15:30:25 - if ((type(vis)==str) & (os.path.exists(vis))): build 12-Sep-2018 15:30:25 - ms.open(vis) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - raise Exception, 'Visibility data set not found - please verify the name' build 12-Sep-2018 15:30:25 - if(not advise): build 12-Sep-2018 15:30:25 - if (imagename == ""): build 12-Sep-2018 15:30:25 - # ms.close() build 12-Sep-2018 15:30:25 - raise Exception, "Must provide output image name in parameter imagename." build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if os.path.exists(imagename): build 12-Sep-2018 15:30:25 - # ms.close() build 12-Sep-2018 15:30:25 - raise Exception, "Output image %s already exists - will not overwrite." % imagename build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if (field == ''): build 12-Sep-2018 15:30:25 - field = '*' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if (spw == ''): build 12-Sep-2018 15:30:25 - spw = '*' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if ((type(imsize)==int)): build 12-Sep-2018 15:30:25 - imsize=[imsize,imsize] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if ((len(imsize)==1)): build 12-Sep-2018 15:30:25 - imsize=[imsize[0],imsize[0]] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - nx = imsize[0] build 12-Sep-2018 15:30:25 - ny = imsize[1] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if ((type(cell)==int) | (type(cell)==float) | (type(cell)==str)): build 12-Sep-2018 15:30:25 - cell=[cell,cell] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if ((len(cell)==1)): build 12-Sep-2018 15:30:25 - cell=[cell[0],cell[0]] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - cellx=cell[0] build 12-Sep-2018 15:30:25 - celly=cell[1] build 12-Sep-2018 15:30:25 - if((type(cell[0])==int) or (type(cell[0])==float)): build 12-Sep-2018 15:30:25 - cellx=qa.quantity(cell[0], 'arcsec') build 12-Sep-2018 15:30:25 - celly=qa.quantity(cell[1], 'arcsec') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if(type(phasecenter)==str): build 12-Sep-2018 15:30:25 - ### blank means take field[0] build 12-Sep-2018 15:30:25 - if (phasecenter==''): build 12-Sep-2018 15:30:25 - fieldoo=field build 12-Sep-2018 15:30:25 - if(fieldoo==''): build 12-Sep-2018 15:30:25 - fieldoo='0' build 12-Sep-2018 15:30:25 - phasecenter=int(ms.msseltoindex(vis,field=fieldoo)['field'][0]) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - tmppc=phasecenter build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - if(len(ms.msseltoindex(vis, field=phasecenter)['field']) > 0): build 12-Sep-2018 15:30:25 - tmppc = int(ms.msseltoindex(vis, build 12-Sep-2018 15:30:25 - field=phasecenter)['field'][0]) build 12-Sep-2018 15:30:25 - ##succesful must be string like '0' or 'NGC*' build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - #failed must be a string type J2000 18h00m00 10d00m00 build 12-Sep-2018 15:30:25 - tmppc = phasecenter build 12-Sep-2018 15:30:25 - phasecenter = tmppc build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if restoringbeam == [''] or len(restoringbeam) == 0: build 12-Sep-2018 15:30:25 - # calculate from fit below build 12-Sep-2018 15:30:25 - bmaj = '' build 12-Sep-2018 15:30:25 - bmin = '' build 12-Sep-2018 15:30:25 - bpa = '' build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - if (type(restoringbeam)==str): build 12-Sep-2018 15:30:25 - restoringbeam=[restoringbeam,restoringbeam,'0deg'] build 12-Sep-2018 15:30:25 - if (type(restoringbeam)==list and (len(restoringbeam)==1)): build 12-Sep-2018 15:30:25 - restoringbeam=[restoringbeam[0],restoringbeam[0],'0deg'] build 12-Sep-2018 15:30:25 - if (type(restoringbeam)==list and (len(restoringbeam)==2)): build 12-Sep-2018 15:30:25 - restoringbeam=[restoringbeam[0],restoringbeam[1],'0deg'] build 12-Sep-2018 15:30:25 - if (type(restoringbeam)==list and (len(restoringbeam)==2)): build 12-Sep-2018 15:30:25 - restoringbeam=[restoringbeam[0],restoringbeam[1],restoringbeam[2]] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if(qa.quantity(restoringbeam[0])['unit'] == ''): build 12-Sep-2018 15:30:25 - restoringbeam[0]=restoringbeam[0]+'arcsec' build 12-Sep-2018 15:30:25 - if(qa.quantity(restoringbeam[1])['unit'] == ''): build 12-Sep-2018 15:30:25 - restoringbeam[1]=restoringbeam[1]+'arcsec' build 12-Sep-2018 15:30:25 - if(qa.quantity(restoringbeam[2])['unit'] == ''): build 12-Sep-2018 15:30:25 - restoringbeam[2]=restoringbeam[2]+'deg' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - bmaj = restoringbeam[0] build 12-Sep-2018 15:30:25 - bmin = restoringbeam[1] build 12-Sep-2018 15:30:25 - bpa = restoringbeam[2] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Create output names based on imagename parameter build 12-Sep-2018 15:30:25 - dirtyim = imagename+'dirty.image' build 12-Sep-2018 15:30:25 - psfim = imagename+'psf.image' build 12-Sep-2018 15:30:25 - modelname = imagename+'.model' build 12-Sep-2018 15:30:25 - imname = imagename+'.image' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Make sure all tables and images are closed build 12-Sep-2018 15:30:25 -# ms.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Add scratch columns if they don't exist build 12-Sep-2018 15:30:25 - #tb.open(vis) build 12-Sep-2018 15:30:25 - #hasit = tb.colnames().count('CORRECTED_DATA')>0 build 12-Sep-2018 15:30:25 - #tb.close() build 12-Sep-2018 15:30:25 - #if not hasit: build 12-Sep-2018 15:30:25 - # cb.open(vis) build 12-Sep-2018 15:30:25 - # cb.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # make the dirty image and psf build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - im.open(vis, usescratch=True) build 12-Sep-2018 15:30:25 - im.selectvis(spw=spw, field=field) build 12-Sep-2018 15:30:25 - spwsel=ms.msseltoindex(vis=vis, spw=spw)['spw'] build 12-Sep-2018 15:30:25 - ch=ms.msseltoindex(vis=vis, spw=spw)['channel'] build 12-Sep-2018 15:30:25 - if(nchan < 1): build 12-Sep-2018 15:30:25 - nchan=0 build 12-Sep-2018 15:30:25 - for k in range(len(spwsel)): build 12-Sep-2018 15:30:25 - nchan += ch[k,2]-ch[k,1]+1 build 12-Sep-2018 15:30:25 - nchan=nchan/width build 12-Sep-2018 15:30:25 - if(nchan < 1): build 12-Sep-2018 15:30:25 - nchan=1 build 12-Sep-2018 15:30:25 - if(advise): build 12-Sep-2018 15:30:25 - tb.open(vis+'/SPECTRAL_WINDOW') build 12-Sep-2018 15:30:25 - allreffreq=tb.getcol('REF_FREQUENCY') build 12-Sep-2018 15:30:25 - reffreq=0.0 build 12-Sep-2018 15:30:25 - if(len(allreffreq) > 1): build 12-Sep-2018 15:30:25 - reffreq=0.0; build 12-Sep-2018 15:30:25 - for f in allreffreq: build 12-Sep-2018 15:30:25 - reffreq+=f build 12-Sep-2018 15:30:25 - reffreq=reffreq/float(len(allreffreq)) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - reffreq=allreffreq[0] build 12-Sep-2018 15:30:25 - tb.done() build 12-Sep-2018 15:30:25 - tb.open(vis+'/ANTENNA') build 12-Sep-2018 15:30:25 - diams=tb.getcol('DISH_DIAMETER') build 12-Sep-2018 15:30:25 - diam=np.min(diams) build 12-Sep-2018 15:30:25 - tb.done() build 12-Sep-2018 15:30:25 - fov=qa.quantity(3.0e8/reffreq/diam, 'rad') build 12-Sep-2018 15:30:25 - adv=im.advise(fieldofview=fov) build 12-Sep-2018 15:30:25 - cellx=qa.tos(adv[2], prec=4) build 12-Sep-2018 15:30:25 - celly=cellx build 12-Sep-2018 15:30:25 - myf = stack_frame_find( ) build 12-Sep-2018 15:30:25 - myf['cell']=[cellx,cellx] build 12-Sep-2018 15:30:25 - myf['imsize']=[adv[1], adv[1]] build 12-Sep-2018 15:30:25 - nx=ny=adv[1] build 12-Sep-2018 15:30:25 - myf['advise']=False build 12-Sep-2018 15:30:25 - return build 12-Sep-2018 15:30:25 - redopsf=True build 12-Sep-2018 15:30:25 - redokounter=0 build 12-Sep-2018 15:30:25 - immode='mfs' build 12-Sep-2018 15:30:25 - start=ch[0,1] build 12-Sep-2018 15:30:25 - if(mode=='cube'): build 12-Sep-2018 15:30:25 - immode='channel' build 12-Sep-2018 15:30:25 - if(width >1): build 12-Sep-2018 15:30:25 - start=start+ width/2 build 12-Sep-2018 15:30:25 - while(redopsf): build 12-Sep-2018 15:30:25 - im.defineimage(nx=nx, ny=ny, cellx=cellx, celly=celly, phasecenter=phasecenter, spw=spwsel.tolist(), mode=immode, start=start, step=width, nchan=nchan) build 12-Sep-2018 15:30:25 - im.weight(weighting) build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - im.makeimage(type='corrected', image=dirtyim) build 12-Sep-2018 15:30:25 - im.makeimage(type='psf', image=psfim) build 12-Sep-2018 15:30:25 - ###make an empty model build 12-Sep-2018 15:30:25 - im.make(modelname) build 12-Sep-2018 15:30:25 - if((redokounter==2) and (np.min(nx,ny) > 25)): build 12-Sep-2018 15:30:25 - #pdb.set_trace() build 12-Sep-2018 15:30:25 - ia.open(psfim) build 12-Sep-2018 15:30:25 - csys=ia.coordsys() build 12-Sep-2018 15:30:25 - rg.setcoordinates(csys=csys.torecord()) build 12-Sep-2018 15:30:25 - shp=ia.shape() build 12-Sep-2018 15:30:25 - blc=['10pix', '10pix', '0pix', '0pix'] build 12-Sep-2018 15:30:25 - trc=[str(shp[0]-10)+'pix',str(shp[1]-10)+'pix', build 12-Sep-2018 15:30:25 - str(shp[2]-1)+'pix', str(shp[3]-1)+'pix'] build 12-Sep-2018 15:30:25 - reg=rg.wbox(blc=blc, trc=trc) build 12-Sep-2018 15:30:25 - ia.set(pixels=0, region=rg.complement(reg)) build 12-Sep-2018 15:30:25 - ia.done() build 12-Sep-2018 15:30:25 - #im.done() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Calculate bpa, bmin, bmaj if not given build 12-Sep-2018 15:30:25 - if restoringbeam == [''] or len(restoringbeam) == 0: build 12-Sep-2018 15:30:25 - cx = nx/2 build 12-Sep-2018 15:30:25 - cy = ny/2 build 12-Sep-2018 15:30:25 - box = '' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #if (nx > 100 and ny > 100): build 12-Sep-2018 15:30:25 - # rrg = [cx-10, cy-10, cx+10, cy+10] build 12-Sep-2018 15:30:25 - # box = '%s,%s,%s,%s'%(rrg[0],rrg[1],rrg[2],rrg[3]) build 12-Sep-2018 15:30:25 - #ia.open(psfim) build 12-Sep-2018 15:30:25 - #shp=ia.shape() build 12-Sep-2018 15:30:25 - #coords = ia.fitcomponents(box=box) build 12-Sep-2018 15:30:25 - #ia.close() build 12-Sep-2018 15:30:25 - #if(coords['converged'] == True): build 12-Sep-2018 15:30:25 - coords=im.fitpsf(psfim) build 12-Sep-2018 15:30:25 - if(coords[0]): build 12-Sep-2018 15:30:25 - bmaj=coords[1] build 12-Sep-2018 15:30:25 - bmin=coords[2] build 12-Sep-2018 15:30:25 - bpa=coords[3] build 12-Sep-2018 15:30:25 - redopsf=False build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - redopsf=True build 12-Sep-2018 15:30:25 - nx=nx+1 build 12-Sep-2018 15:30:25 - ny=ny+1 build 12-Sep-2018 15:30:25 - redokounter += 1 build 12-Sep-2018 15:30:25 - if(redokounter==3): build 12-Sep-2018 15:30:25 - casalog.post('Failed to find a decent psf','SEVERE') build 12-Sep-2018 15:30:25 - return False build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - casalog.post('Trying new image with 1 extra pixel','WARN') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - except : build 12-Sep-2018 15:30:25 - redopsf=True build 12-Sep-2018 15:30:25 - nx=nx+1 build 12-Sep-2018 15:30:25 - ny=ny+1 build 12-Sep-2018 15:30:25 - redokounter += 1 build 12-Sep-2018 15:30:25 - if(redokounter==3): build 12-Sep-2018 15:30:25 - casalog.post('Failed to find a decent psf','SEVERE') build 12-Sep-2018 15:30:25 - im.done() build 12-Sep-2018 15:30:25 - return False build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - casalog.post('Trying new image with 1 extra pixel','WARN') build 12-Sep-2018 15:30:25 - im.done() build 12-Sep-2018 15:30:25 - parsummary = 'restoringbeam values = [\'%s\',\'%s\',\'%s\']'%(qa.tos(bmaj),qa.tos(bmin),qa.tos(bpa)) build 12-Sep-2018 15:30:25 - casalog.post(parsummary,'INFO') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Make a mask build 12-Sep-2018 15:30:25 - maskname='' build 12-Sep-2018 15:30:25 - if(interactive): build 12-Sep-2018 15:30:25 - maskname=imagename+'.mask' build 12-Sep-2018 15:30:25 - if(os.path.exists(maskname)): build 12-Sep-2018 15:30:25 - ia.open(dirtyim) build 12-Sep-2018 15:30:25 - csys=ia.coordsys() build 12-Sep-2018 15:30:25 - shp=ia.shape() build 12-Sep-2018 15:30:25 - ia.done() build 12-Sep-2018 15:30:25 - ia.open(maskname) build 12-Sep-2018 15:30:25 - ia.regrid(outfile='__tmpmask__', shape=shp, csys=csys.torecord(), axes=[0,1], asvelocity=False) build 12-Sep-2018 15:30:25 - ia.remove(True) build 12-Sep-2018 15:30:25 - ia.done() build 12-Sep-2018 15:30:25 - shutil.move('__tmpmask__', maskname) build 12-Sep-2018 15:30:25 - im.drawmask(dirtyim, maskname) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # use deconvolver to do image plane deconvolution build 12-Sep-2018 15:30:25 - # using a mask image as the mask build 12-Sep-2018 15:30:25 - dc.open(dirty=dirtyim, psf=psfim) build 12-Sep-2018 15:30:25 - # NOTE: use the parameter mask which can be an empty build 12-Sep-2018 15:30:25 - # string if no mask build 12-Sep-2018 15:30:25 - dc.clean(niter=niter, model=modelname, mask=maskname) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # create the restored image build 12-Sep-2018 15:30:25 - if restoringbeam == [''] or len(restoringbeam) == 0: build 12-Sep-2018 15:30:25 - dc.restore(model=modelname, image=imname, bmaj=bmaj, bmin=bmin, bpa=bpa) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - dc.restore(model=modelname, image=imname, bmaj=restoringbeam[0], bmin=restoringbeam[1], bpa=restoringbeam[2]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - dc.done() build 12-Sep-2018 15:30:25 - return True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - im.close() build 12-Sep-2018 15:30:25 - ia.close() build 12-Sep-2018 15:30:25 - dc.close() build 12-Sep-2018 15:30:25 - print '*** Error *** ',instance build 12-Sep-2018 15:30:25 - casalog.post("Error ...", 'SEVERE') build 12-Sep-2018 15:30:25 - traceback.print_exc() build 12-Sep-2018 15:30:25 - raise Exception, instance build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_importevla.py b/gcwrap/python/scripts/task_importevla.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 927331f..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_importevla.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,423 +0,0 @@ build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 -import flaghelper as fh build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -debug = False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def importevla( build 12-Sep-2018 15:30:25 - asdm=None, build 12-Sep-2018 15:30:25 - vis=None, build 12-Sep-2018 15:30:25 - ocorr_mode=None, build 12-Sep-2018 15:30:25 - compression=None, build 12-Sep-2018 15:30:25 - asis=None, build 12-Sep-2018 15:30:25 - scans=None, build 12-Sep-2018 15:30:25 - verbose=None, build 12-Sep-2018 15:30:25 - overwrite=None, build 12-Sep-2018 15:30:25 - online=None, build 12-Sep-2018 15:30:25 - tbuff=None, build 12-Sep-2018 15:30:25 - flagzero=None, build 12-Sep-2018 15:30:25 - flagpol=None, build 12-Sep-2018 15:30:25 - shadow=None, build 12-Sep-2018 15:30:25 - tolerance=None, build 12-Sep-2018 15:30:25 - addantenna=None, build 12-Sep-2018 15:30:25 - applyflags=None, build 12-Sep-2018 15:30:25 - savecmds=None, build 12-Sep-2018 15:30:25 - outfile=None, build 12-Sep-2018 15:30:25 - flagbackup=None, build 12-Sep-2018 15:30:25 - polyephem_tabtimestep=None, build 12-Sep-2018 15:30:25 - ): build 12-Sep-2018 15:30:25 - """ Convert a Science Data Model (SDM) dataset into a CASA Measurement Set (MS) build 12-Sep-2018 15:30:25 -....This version is under development and is geared to handling EVLA specific flag and build 12-Sep-2018 15:30:25 -....system files, and is otherwise equivalent to importasdm. build 12-Sep-2018 15:30:25 -.... build 12-Sep-2018 15:30:25 -....Keyword arguments: build 12-Sep-2018 15:30:25 -....asdm -- Name of input SDM file (directory) build 12-Sep-2018 15:30:25 -........default: none; example: asdm='TOSR0001_sb1308595_1.55294.83601028935' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -....""" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Python script build 12-Sep-2018 15:30:25 - # Origninator: Steven T. Myers build 12-Sep-2018 15:30:25 - # Written (3.0.1) STM 2010-03-11 modify importasdm to include flagging from xml build 12-Sep-2018 15:30:25 - # Vers1.0 (3.0.1) STM 2010-03-16 add tbuff argument build 12-Sep-2018 15:30:25 - # Vers2.0 (3.0.1) STM 2010-03-29 minor improvements build 12-Sep-2018 15:30:25 - # Vers3.0 (3.0.2) STM 2010-04-13 add flagzero, doshadow build 12-Sep-2018 15:30:25 - # Vers4.0 (3.0.2) STM 2010-04-20 add flagpol build 12-Sep-2018 15:30:25 - # Vers5.0 (3.0.2) STM 2010-05-27 combine flagzero clips build 12-Sep-2018 15:30:25 - # Vers6.0 (3.1.0) STM 2010-07-01 flagbackup option build 12-Sep-2018 15:30:25 - # Vers7.0 (3.1.0) STM 2010-08-18 remove corr_mode,wvr_corrected_data,singledish,antenna build 12-Sep-2018 15:30:25 - # Vers7.1 (3.1.0) STM 2010-10-07 remove time_sampling, srt build 12-Sep-2018 15:30:25 - # Vers7.1 (3.1.0) STM 2010-10-07 use helper functions, flagger tool, fill FLAG_CMD build 12-Sep-2018 15:30:25 - # Vers7.2 (3.1.0) STM 2010-10-29 minor modifications to defaults and messages build 12-Sep-2018 15:30:25 - # Vers8.0 (3.2.0) STM 2010-11-23 tbuff not sub-par of applyflags=T build 12-Sep-2018 15:30:25 - # Vers8.1 (3.2.0) STM 2010-12-01 prec=9 on timestamps build 12-Sep-2018 15:30:25 - # Vers8.2 (3.2.0) MKH 2010-12-06 added scan selection build 12-Sep-2018 15:30:25 - # Vers8.3 (3.2.0) GAM 2011-01-18 added switchedpower option (sw power gain/tsys) build 12-Sep-2018 15:30:25 - # Vers8.4 (3.2.0) STM 2011-03-24 fix casalog.post line-length bug build 12-Sep-2018 15:30:25 - # Vers8.5 (3.4.0) STM 2011-12-08 new readflagxml for new Flag.xml format build 12-Sep-2018 15:30:25 - # Vers8.6 (3.4.0) STM 2011-02-22 full handling of new Flag.xml ant+spw+pol flags build 12-Sep-2018 15:30:25 - # Vers9.0 (3.4.0) SMC 2012-03-13 ported to use the new flagger tool (agentflagger) build 12-Sep-2018 15:30:25 - # Vers9.1 (4.7.0) DP 2016-06-17 introduced polyephem_tabtimestep parameter build 12-Sep-2018 15:30:25 - # Version 9.2 (5.0) 2016-11-03 added --with-pointing-correction always build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Create local versions of the flagger and ms tools build 12-Sep-2018 15:30:25 - aflocal = casac.agentflagger() build 12-Sep-2018 15:30:25 - mslocal = casac.ms() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - casalog.origin('importevla') build 12-Sep-2018 15:30:25 - casalog.post("Task importevla has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - casalog.post('You are using importevla v9.1 SMC Updated 2016-06-17' build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - viso = '' build 12-Sep-2018 15:30:25 - casalog.post('corr_mode is forcibly set to all.') build 12-Sep-2018 15:30:25 - if len(vis) > 0: build 12-Sep-2018 15:30:25 - viso = vis build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - viso = asdm + '.ms' build 12-Sep-2018 15:30:25 - vis = asdm build 12-Sep-2018 15:30:25 - corr_mode = 'all' build 12-Sep-2018 15:30:25 - wvr_corrected_data = 'no' build 12-Sep-2018 15:30:25 - singledish = False build 12-Sep-2018 15:30:25 - srt = 'all' build 12-Sep-2018 15:30:25 - time_sampling = 'all' build 12-Sep-2018 15:30:25 - showversion = True build 12-Sep-2018 15:30:25 - execute_string = 'asdm2MS --with-pointing-correction --icm "' + corr_mode + '" --isrt "' \ build 12-Sep-2018 15:30:25 - + srt + '" --its "' + time_sampling + '" --ocm "' \ build 12-Sep-2018 15:30:25 - + ocorr_mode + '" --wvr-corrected-data "' \ build 12-Sep-2018 15:30:25 - + wvr_corrected_data + '" --asis "' + asis + '" --scans "' \ build 12-Sep-2018 15:30:25 - + scans + '" --logfile "' + casalog.logfile() + '"' build 12-Sep-2018 15:30:25 - if showversion: build 12-Sep-2018 15:30:25 - casalog.post('asdm2MS --revision --logfile "' build 12-Sep-2018 15:30:25 - + casalog.logfile() + '"') build 12-Sep-2018 15:30:25 - os.system('asdm2MS --revision --logfile "' build 12-Sep-2018 15:30:25 - + casalog.logfile() + '"') build 12-Sep-2018 15:30:25 - if compression: build 12-Sep-2018 15:30:25 - execute_string = execute_string + ' --compression' build 12-Sep-2018 15:30:25 - if verbose: build 12-Sep-2018 15:30:25 - execute_string = execute_string + ' --verbose' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if (polyephem_tabtimestep!=None) and (type(polyephem_tabtimestep)==int or type(polyephem_tabtimestep)==float): build 12-Sep-2018 15:30:25 - if polyephem_tabtimestep>0: build 12-Sep-2018 15:30:25 - casalog.post('Will tabulate all attached polynomial ephemerides with a time step of ' build 12-Sep-2018 15:30:25 - +str(polyephem_tabtimestep)+' days.') build 12-Sep-2018 15:30:25 - if polyephem_tabtimestep>1.: build 12-Sep-2018 15:30:25 - casalog.post('A tabulation timestep of <= 1 days is recommended.', 'WARN') build 12-Sep-2018 15:30:25 - execute_string = execute_string + ' --polyephem-tabtimestep '+str(polyephem_tabtimestep) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if not overwrite and os.path.exists(viso): build 12-Sep-2018 15:30:25 - raise Exception, \ build 12-Sep-2018 15:30:25 - 'You have specified and existing ms and have indicated you do not wish to overwrite it' build 12-Sep-2018 15:30:25 - # build 12-Sep-2018 15:30:25 - # If viso+".flagversions" then process differently depending on the value of overwrite.. build 12-Sep-2018 15:30:25 - # build 12-Sep-2018 15:30:25 - dotFlagversion = viso + '.flagversions' build 12-Sep-2018 15:30:25 - if os.path.exists(dotFlagversion): build 12-Sep-2018 15:30:25 - if overwrite: build 12-Sep-2018 15:30:25 - casalog.post("Found '" + dotFlagversion build 12-Sep-2018 15:30:25 - + "' . It'll be deleted before running the filler." build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - os.system('rm -rf %s' % dotFlagversion) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - casalog.post("Found '%s' but can't overwrite it." build 12-Sep-2018 15:30:25 - % dotFlagversion) build 12-Sep-2018 15:30:25 - raise Exception, "Found '%s' but can't overwrite it." \ build 12-Sep-2018 15:30:25 - % dotFlagversion build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - execute_string = execute_string + ' ' + asdm + ' ' + viso build 12-Sep-2018 15:30:25 - casalog.post('Running the asdm2MS standalone invoked as:') build 12-Sep-2018 15:30:25 - # Print execute_string build 12-Sep-2018 15:30:25 - casalog.post(execute_string) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Catch the return status and exit on failure build 12-Sep-2018 15:30:25 - ret_status = os.system(execute_string) build 12-Sep-2018 15:30:25 - if ret_status != 0: build 12-Sep-2018 15:30:25 - casalog.post('asdm2MS failed to execute with exit error '+str(ret_status), 'SEVERE') build 12-Sep-2018 15:30:25 - raise Exception, 'ASDM conversion error, please check if it is a valid ASDM.' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if compression: build 12-Sep-2018 15:30:25 - visover = viso build 12-Sep-2018 15:30:25 - viso = visover.replace('.ms','.compressed.ms') build 12-Sep-2018 15:30:25 - if flagbackup: build 12-Sep-2018 15:30:25 - ok = aflocal.open(viso) build 12-Sep-2018 15:30:25 - ok = aflocal.saveflagversion('Original', build 12-Sep-2018 15:30:25 - comment='Original flags on import', merge='save') build 12-Sep-2018 15:30:25 - ok = aflocal.done() build 12-Sep-2018 15:30:25 - print 'Backed up original flag column to ' + viso \ build 12-Sep-2018 15:30:25 - + '.flagversions' build 12-Sep-2018 15:30:25 - casalog.post('Backed up original flag column to ' + viso build 12-Sep-2018 15:30:25 - + '.flagversions') build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - casalog.post('Warning: will not back up original flag column' build 12-Sep-2018 15:30:25 - , 'WARN') build 12-Sep-2018 15:30:25 - # build 12-Sep-2018 15:30:25 - # ============================= build 12-Sep-2018 15:30:25 - # Begin EVLA specific code here build 12-Sep-2018 15:30:25 - # ============================= build 12-Sep-2018 15:30:25 - nflags = 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # All flag cmds build 12-Sep-2018 15:30:25 - allflags = {} build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if os.access(asdm + '/Flag.xml', os.F_OK): build 12-Sep-2018 15:30:25 - # Find (and copy) Flag.xml build 12-Sep-2018 15:30:25 - print ' Found Flag.xml in SDM, copying to MS' build 12-Sep-2018 15:30:25 - casalog.post('Found Flag.xml in SDM, copying to MS') build 12-Sep-2018 15:30:25 - os.system('cp -rf ' + asdm + '/Flag.xml ' + viso + '/') build 12-Sep-2018 15:30:25 - # Find (and copy) Antenna.xml build 12-Sep-2018 15:30:25 - if os.access(asdm + '/Antenna.xml', os.F_OK): build 12-Sep-2018 15:30:25 - print ' Found Antenna.xml in SDM, copying to MS' build 12-Sep-2018 15:30:25 - casalog.post('Found Antenna.xml in SDM, copying to MS') build 12-Sep-2018 15:30:25 - os.system('cp -rf ' + asdm + '/Antenna.xml ' + viso build 12-Sep-2018 15:30:25 - + '/') build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - raise Exception, 'Failed to find Antenna.xml in SDM' build 12-Sep-2018 15:30:25 - # Find (and copy) SpectralWindow.xml build 12-Sep-2018 15:30:25 - if os.access(asdm + '/SpectralWindow.xml', os.F_OK): build 12-Sep-2018 15:30:25 - print ' Found SpectralWindow.xml in SDM, copying to MS' build 12-Sep-2018 15:30:25 - casalog.post('Found SpectralWindow.xml in SDM, copying to MS' build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - os.system('cp -rf ' + asdm + '/SpectralWindow.xml ' build 12-Sep-2018 15:30:25 - + viso + '/') build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - raise Exception, \ build 12-Sep-2018 15:30:25 - 'Failed to find SpectralWindow.xml in SDM' build 12-Sep-2018 15:30:25 - # build 12-Sep-2018 15:30:25 - # Parse Flag.xml into flag dictionary build 12-Sep-2018 15:30:25 - # build 12-Sep-2018 15:30:25 - if online: build 12-Sep-2018 15:30:25 -# flago = fh.readXML(asdm, tbuff) build 12-Sep-2018 15:30:25 - flago = fh.parseXML(asdm, tbuff) build 12-Sep-2018 15:30:25 - onlinekeys = flago.keys() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - nkeys = onlinekeys.__len__() build 12-Sep-2018 15:30:25 - nflags += nkeys build 12-Sep-2018 15:30:25 - allflags = flago.copy() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.post('Created %s commands for online flags'%str(nflags)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - if online: build 12-Sep-2018 15:30:25 - casalog.post('ERROR: No Flag.xml in SDM', 'SEVERE') build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - casalog.post('WARNING: No Flag.xml in SDM', 'WARN') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if flagzero or shadow: build 12-Sep-2018 15:30:25 - # Get overall MS time range for later use (if needed) build 12-Sep-2018 15:30:25 - (ms_startmjds, ms_endmjds, ms_starttime, ms_endtime) = \ build 12-Sep-2018 15:30:25 - getmsmjds(viso) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Now add zero and shadow flags build 12-Sep-2018 15:30:25 - if flagzero: build 12-Sep-2018 15:30:25 - flagz = {} build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # clip zero data build 12-Sep-2018 15:30:25 - # NOTE: currently hard-wired to RL basis build 12-Sep-2018 15:30:25 - # assemble into flagging commands and add to myflagd build 12-Sep-2018 15:30:25 - flagz['time'] = 0.5 * (ms_startmjds + ms_endmjds) build 12-Sep-2018 15:30:25 - flagz['interval'] = ms_endmjds - ms_startmjds build 12-Sep-2018 15:30:25 - flagz['level'] = 0 build 12-Sep-2018 15:30:25 - flagz['severity'] = 0 build 12-Sep-2018 15:30:25 - flagz['type'] = 'FLAG' build 12-Sep-2018 15:30:25 - flagz['applied'] = False build 12-Sep-2018 15:30:25 - flagz['antenna'] = '' build 12-Sep-2018 15:30:25 - flagz['mode'] = 'clip' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Flag cross-hands too build 12-Sep-2018 15:30:25 - if flagpol: build 12-Sep-2018 15:30:25 - flagz['reason'] = 'CLIP_ZERO_ALL' build 12-Sep-2018 15:30:25 -# flagz['command'] = \ build 12-Sep-2018 15:30:25 -# "mode='clip' clipzeros=True correlation='ABS_ALL'" build 12-Sep-2018 15:30:25 - command = {} build 12-Sep-2018 15:30:25 - command['mode'] = 'clip' build 12-Sep-2018 15:30:25 - command['clipzeros'] = True build 12-Sep-2018 15:30:25 - command['correlation'] = 'ABS_ALL' build 12-Sep-2018 15:30:25 - flagz['command'] = command build 12-Sep-2018 15:30:25 - flagz['id'] = 'ZERO_ALL' build 12-Sep-2018 15:30:25 - allflags[nflags] = flagz.copy() build 12-Sep-2018 15:30:25 - nflags += 1 build 12-Sep-2018 15:30:25 - nflagz = 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - flagz['reason'] = 'CLIP_ZERO_RR' build 12-Sep-2018 15:30:25 -# flagz['command'] = \ build 12-Sep-2018 15:30:25 -# "mode='clip' clipzeros=True correlation='ABS_RR'" build 12-Sep-2018 15:30:25 - command = {} build 12-Sep-2018 15:30:25 - command['mode'] = 'clip' build 12-Sep-2018 15:30:25 - command['clipzeros'] = True build 12-Sep-2018 15:30:25 - command['correlation'] = 'ABS_RR' build 12-Sep-2018 15:30:25 - flagz['command'] = command build 12-Sep-2018 15:30:25 - flagz['id'] = 'ZERO_RR' build 12-Sep-2018 15:30:25 - allflags[nflags] = flagz.copy() build 12-Sep-2018 15:30:25 - nflags += 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - flagz['reason'] = 'CLIP_ZERO_LL' build 12-Sep-2018 15:30:25 -# flagz['command'] = \ build 12-Sep-2018 15:30:25 -# "mode='clip' clipzeros=True correlation='ABS_LL'" build 12-Sep-2018 15:30:25 - command = {} build 12-Sep-2018 15:30:25 - command['mode'] = 'clip' build 12-Sep-2018 15:30:25 - command['clipzeros'] = True build 12-Sep-2018 15:30:25 - command['correlation'] = 'ABS_LL' build 12-Sep-2018 15:30:25 - flagz['command'] = command build 12-Sep-2018 15:30:25 - flagz['id'] = 'ZERO_LL' build 12-Sep-2018 15:30:25 - allflags[nflags] = flagz.copy() build 12-Sep-2018 15:30:25 - nflags += 1 build 12-Sep-2018 15:30:25 - nflagz = 2 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.post('Created %s command(s) to clip zeros'%str(nflagz)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if shadow: build 12-Sep-2018 15:30:25 - flagh = {} build 12-Sep-2018 15:30:25 - command = {} build 12-Sep-2018 15:30:25 - # flag shadowed data build 12-Sep-2018 15:30:25 - flagh['time'] = 0.5 * (ms_startmjds + ms_endmjds) build 12-Sep-2018 15:30:25 - flagh['interval'] = ms_endmjds - ms_startmjds build 12-Sep-2018 15:30:25 - flagh['level'] = 0 build 12-Sep-2018 15:30:25 - flagh['severity'] = 0 build 12-Sep-2018 15:30:25 - flagh['type'] = 'FLAG' build 12-Sep-2018 15:30:25 - flagh['applied'] = False build 12-Sep-2018 15:30:25 - flagh['antenna'] = '' build 12-Sep-2018 15:30:25 - flagh['mode'] = 'shadow' build 12-Sep-2018 15:30:25 - flagh['reason'] = 'SHADOW' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# scmd = 'mode=shadow tolerance=' + str(tolerance) build 12-Sep-2018 15:30:25 -# scmd = "mode='shadow' tolerance=" + str(tolerance) build 12-Sep-2018 15:30:25 - command['mode'] = 'shadow' build 12-Sep-2018 15:30:25 - command['tolerance'] = tolerance build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if type(addantenna) == str: build 12-Sep-2018 15:30:25 - if addantenna != '': build 12-Sep-2018 15:30:25 - # it's a filename, create a dictionary build 12-Sep-2018 15:30:25 - antdict = fh.readAntennaList(addantenna) build 12-Sep-2018 15:30:25 -# scmd = scmd +' addantenna='+str(antdict) build 12-Sep-2018 15:30:25 - command['addantenna'] = antdict build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - elif type(addantenna) == dict: build 12-Sep-2018 15:30:25 - if addantenna != {}: build 12-Sep-2018 15:30:25 -# scmd = scmd +' addantenna='+str(addantenna) build 12-Sep-2018 15:30:25 - command['addantenna'] = addantenna build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# flagh['command'] = scmd build 12-Sep-2018 15:30:25 - flagh['command'] = command build 12-Sep-2018 15:30:25 - flagh['id'] = 'SHADOW' build 12-Sep-2018 15:30:25 - allflags[nflags] = flagh.copy() build 12-Sep-2018 15:30:25 - nflags += 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.post('Created 1 command to flag shadowed data') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # List of rows to save build 12-Sep-2018 15:30:25 - allkeys = allflags.keys() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Apply the flags build 12-Sep-2018 15:30:25 - if applyflags: build 12-Sep-2018 15:30:25 - if nflags > 0: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Open the MS and attach the tool build 12-Sep-2018 15:30:25 - aflocal.open(viso) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Select the data build 12-Sep-2018 15:30:25 - aflocal.selectdata() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Setup the agent's parameters build 12-Sep-2018 15:30:25 - fh.parseAgents(aflocal, allflags, [], True, True, '') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Initialize the agents build 12-Sep-2018 15:30:25 - aflocal.init() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Run the tool build 12-Sep-2018 15:30:25 - stats = aflocal.run(True, True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.post('Applied %s flag commands to data'%str(nflags)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Destroy the tool build 12-Sep-2018 15:30:25 - aflocal.done() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Save the flags to FLAG_CMD and update the APPLIED column build 12-Sep-2018 15:30:25 -# fh.writeFlagCmd(viso, allflags, allkeys, True, '', '') build 12-Sep-2018 15:30:25 - fh.writeFlagCommands(viso,allflags,True,'','', True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.post('There are no flags to apply') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - else : build 12-Sep-2018 15:30:25 - casalog.post('Will not apply flags (applyflags=False), use flagcmd to apply') build 12-Sep-2018 15:30:25 - if nflags > 0: build 12-Sep-2018 15:30:25 -# fh.writeFlagCmd(viso, allflags, allkeys, False, '', '') build 12-Sep-2018 15:30:25 - fh.writeFlagCommands(viso,allflags,False,'','', True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Save the flag commads to an ASCII file build 12-Sep-2018 15:30:25 - if savecmds: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if nflags > 0: build 12-Sep-2018 15:30:25 - # Save the cmds to a file build 12-Sep-2018 15:30:25 - if outfile == '': build 12-Sep-2018 15:30:25 - # Save to standard filename build 12-Sep-2018 15:30:25 - outfile = viso.replace('.ms','_cmd.txt') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# fh.writeFlagCmd(viso, allflags, allkeys, False, '', outfile) build 12-Sep-2018 15:30:25 - fh.writeFlagCommands(viso,allflags,False,'',outfile, True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.post('Saved %s flag commands to %s'%(nflags,outfile)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - casalog.post('There are no flag commands to save') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.post('%s' % instance, 'ERROR') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # write history build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - retval = True build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - param_names = importevla.func_code.co_varnames[:importevla.func_code.co_argcount] build 12-Sep-2018 15:30:25 - param_vals = [eval(p) for p in param_names] build 12-Sep-2018 15:30:25 - retval &= write_history(mslocal, vis, 'importevla', param_names, build 12-Sep-2018 15:30:25 - param_vals, casalog) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - casalog.post("*** Error \'%s\' updating HISTORY" % (instance), build 12-Sep-2018 15:30:25 - 'WARN') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# =============================================================================== build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def getmsmjds(vis): build 12-Sep-2018 15:30:25 - # Get start and end times from MS, return in mjds build 12-Sep-2018 15:30:25 - # this might take too long for large MS build 12-Sep-2018 15:30:25 - # NOTE: could also use values from OBSERVATION table col TIME_RANGE build 12-Sep-2018 15:30:25 - mslocal2 = casac.ms() build 12-Sep-2018 15:30:25 - success = True build 12-Sep-2018 15:30:25 - ms_time1 = '' build 12-Sep-2018 15:30:25 - ms_time2 = '' build 12-Sep-2018 15:30:25 - ms_startmjds = 0.0 build 12-Sep-2018 15:30:25 - ms_endmjds = 0.0 build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - mslocal2.open(vis) build 12-Sep-2018 15:30:25 - timd = mslocal2.range(['time']) build 12-Sep-2018 15:30:25 - mslocal2.close() build 12-Sep-2018 15:30:25 - except: build 12-Sep-2018 15:30:25 - success = False build 12-Sep-2018 15:30:25 - print 'Error opening MS ' + vis build 12-Sep-2018 15:30:25 - if success: build 12-Sep-2018 15:30:25 - ms_startmjds = timd['time'][0] build 12-Sep-2018 15:30:25 - ms_endmjds = timd['time'][1] build 12-Sep-2018 15:30:25 - t = qa.quantity(ms_startmjds, 's') build 12-Sep-2018 15:30:25 - t1sd = t['value'] build 12-Sep-2018 15:30:25 - ms_time1 = qa.time(t, form='ymd', prec=9)[0] build 12-Sep-2018 15:30:25 - t = qa.quantity(ms_endmjds, 's') build 12-Sep-2018 15:30:25 - t2sd = t['value'] build 12-Sep-2018 15:30:25 - ms_time2 = qa.time(t, form='ymd', prec=9)[0] build 12-Sep-2018 15:30:25 - casalog.post('MS spans timerange ' + ms_time1 + ' to ' build 12-Sep-2018 15:30:25 - + ms_time2) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - print 'WARNING: Could not open vis as MS to find times' build 12-Sep-2018 15:30:25 - casalog.post('WARNING: Could not open vis as MS to find times') build 12-Sep-2018 15:30:25 - return (ms_startmjds, ms_endmjds, ms_time1, ms_time2) build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_imregrid.py b/gcwrap/python/scripts/task_imregrid.py build 12-Sep-2018 15:30:25 index bb4b121..288de14 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_imregrid.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/task_imregrid.py build 12-Sep-2018 15:30:25 @@ -36,8 +36,8 @@ def imregrid( build 12-Sep-2018 15:30:25 'MECLIPTIC', 'TECLIPTIC', 'SUPERGAL' build 12-Sep-2018 15:30:25 ): build 12-Sep-2018 15:30:25 outia = _imregrid_to_new_ref_frame( build 12-Sep-2018 15:30:25 - _myia, imagename, template, output, build 12-Sep-2018 15:30:25 - axes, shape, overwrite build 12-Sep-2018 15:30:25 + _myia, imagename, template, output, axes, build 12-Sep-2018 15:30:25 + shape, overwrite, interpolation, decimate build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 try: build 12-Sep-2018 15:30:25 param_names = imregrid.func_code.co_varnames[:imregrid.func_code.co_argcount] build 12-Sep-2018 15:30:25 @@ -47,12 +47,16 @@ def imregrid( build 12-Sep-2018 15:30:25 param_names, param_vals, casalog build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 except Exception, instance: build 12-Sep-2018 15:30:25 - casalog.post("*** Error \'%s\' updating HISTORY" % (instance), 'WARN') build 12-Sep-2018 15:30:25 + casalog.post( build 12-Sep-2018 15:30:25 + "*** Error \'%s\' updating HISTORY" % (instance), 'WARN' build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 outia.done() build 12-Sep-2018 15:30:25 return True build 12-Sep-2018 15:30:25 else: build 12-Sep-2018 15:30:25 - if not os.path.isdir(template) or not os.access(template, build 12-Sep-2018 15:30:25 - os.R_OK): build 12-Sep-2018 15:30:25 + if ( build 12-Sep-2018 15:30:25 + not os.path.isdir(template) build 12-Sep-2018 15:30:25 + or not os.access(template, os.R_OK) build 12-Sep-2018 15:30:25 + ): build 12-Sep-2018 15:30:25 raise TypeError, 'Cannot read template image ' + template build 12-Sep-2018 15:30:25 template_ia = iatool() build 12-Sep-2018 15:30:25 template_ia.open(template) build 12-Sep-2018 15:30:25 @@ -64,21 +68,27 @@ def imregrid( build 12-Sep-2018 15:30:25 imshape = image_ia.shape() build 12-Sep-2018 15:30:25 axestoregrid = axes build 12-Sep-2018 15:30:25 if (axes[0] < 0): build 12-Sep-2018 15:30:25 - # default value of axes, need to determine actual axes to send to ia.regrid() build 12-Sep-2018 15:30:25 + # default value of axes, need to determine actual axes to build 12-Sep-2018 15:30:25 + # send to ia.regrid() build 12-Sep-2018 15:30:25 axestoregrid = [] build 12-Sep-2018 15:30:25 image_ncoords = image_csys.ncoordinates() build 12-Sep-2018 15:30:25 for i in range(image_ncoords): build 12-Sep-2018 15:30:25 ctype = image_csys.coordinatetype(i)[0] build 12-Sep-2018 15:30:25 template_coord = template_csys.findcoordinate(ctype) build 12-Sep-2018 15:30:25 if ctype != 'Stokes' and template_coord["return"]: build 12-Sep-2018 15:30:25 - # only regrid if not Stokes axis and coordinate exists in template build 12-Sep-2018 15:30:25 + # only regrid if not Stokes axis and coordinate build 12-Sep-2018 15:30:25 + # exists in template build 12-Sep-2018 15:30:25 for template_pix_axis in template_coord['pixel']: build 12-Sep-2018 15:30:25 if tempshape[template_pix_axis] > 1: build 12-Sep-2018 15:30:25 - # only regrid if template axis is not degenerate build 12-Sep-2018 15:30:25 - world_axes = image_csys.findcoordinate(ctype)['pixel'] build 12-Sep-2018 15:30:25 + # only regrid if template axis is not build 12-Sep-2018 15:30:25 + # degenerate build 12-Sep-2018 15:30:25 + world_axes = image_csys.findcoordinate( build 12-Sep-2018 15:30:25 + ctype build 12-Sep-2018 15:30:25 + )['pixel'] build 12-Sep-2018 15:30:25 for world_pix_axis in world_axes: build 12-Sep-2018 15:30:25 if imshape[world_pix_axis] > 1: build 12-Sep-2018 15:30:25 - # only regrid if the world axis is not degenerate build 12-Sep-2018 15:30:25 + # only regrid if the world axis is build 12-Sep-2018 15:30:25 + # not degenerate build 12-Sep-2018 15:30:25 axestoregrid.append(world_pix_axis) build 12-Sep-2018 15:30:25 # eliminate dups build 12-Sep-2018 15:30:25 axestoregrid = list(set(axestoregrid)) build 12-Sep-2018 15:30:25 @@ -119,7 +129,9 @@ def imregrid( build 12-Sep-2018 15:30:25 param_names, param_vals, casalog build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 except Exception, instance: build 12-Sep-2018 15:30:25 - casalog.post("*** Error \'%s\' updating HISTORY" % (instance), 'WARN') build 12-Sep-2018 15:30:25 + casalog.post( build 12-Sep-2018 15:30:25 + "*** Error \'%s\' updating HISTORY" % (instance), 'WARN' build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 return True build 12-Sep-2018 15:30:25 except Exception, instance: build 12-Sep-2018 15:30:25 # The error message has already been logged by ia.regrid() build 12-Sep-2018 15:30:25 @@ -134,21 +146,22 @@ def imregrid( build 12-Sep-2018 15:30:25 outia.done() build 12-Sep-2018 15:30:25 if csys: build 12-Sep-2018 15:30:25 csys.done() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def _imregrid_to_new_ref_frame( build 12-Sep-2018 15:30:25 - _myia, imagename, template, output, build 12-Sep-2018 15:30:25 - axes, shape, overwrite build 12-Sep-2018 15:30:25 + _myia, imagename, template, output, axes, build 12-Sep-2018 15:30:25 + shape, overwrite, interpolation, decimate build 12-Sep-2018 15:30:25 ): build 12-Sep-2018 15:30:25 _myia.open(imagename) build 12-Sep-2018 15:30:25 csys = _myia.coordsys() build 12-Sep-2018 15:30:25 if len(shape) > 0 and shape != [-1]: build 12-Sep-2018 15:30:25 casalog.post( build 12-Sep-2018 15:30:25 - "Specified shape parameter will be ignored when regridding to a new reference frame", build 12-Sep-2018 15:30:25 - "WARN" build 12-Sep-2018 15:30:25 + "Specified shape parameter will be ignored when regridding to a " build 12-Sep-2018 15:30:25 + + "new reference frame", "WARN" build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 if len(axes) > 0 and axes != [-1]: build 12-Sep-2018 15:30:25 casalog.post( build 12-Sep-2018 15:30:25 - "Specified axes parameter will be ignored when regridding to a new reference frame", build 12-Sep-2018 15:30:25 + "Specified axes parameter will be ignored when " build 12-Sep-2018 15:30:25 + + "regridding to a new reference frame", build 12-Sep-2018 15:30:25 "WARN" build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 dirinfo = csys.findcoordinate("direction") build 12-Sep-2018 15:30:25 @@ -180,7 +193,9 @@ def _imregrid_to_new_ref_frame( build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 diraxes = dirinfo['pixel'] build 12-Sep-2018 15:30:25 if len(diraxes) != 2: build 12-Sep-2018 15:30:25 - raise Exception("Unsupported number of direction axes. There must be exactly 2.") build 12-Sep-2018 15:30:25 + raise Exception( build 12-Sep-2018 15:30:25 + "Unsupported number of direction axes. There must be exactly 2." build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 dirrefpix = csys.referencepixel("direction")["numeric"] build 12-Sep-2018 15:30:25 shape = _myia.shape() build 12-Sep-2018 15:30:25 centerpix = [int(shape[diraxes[0]]/2), int(shape[diraxes[1]]/2)] build 12-Sep-2018 15:30:25 @@ -204,9 +219,13 @@ def _imregrid_to_new_ref_frame( build 12-Sep-2018 15:30:25 _myia = tsub build 12-Sep-2018 15:30:25 _myia.dohistory(False) build 12-Sep-2018 15:30:25 _myia.setcoordsys(csys.torecord()) build 12-Sep-2018 15:30:25 + doref = ( build 12-Sep-2018 15:30:25 + csys.referencecode("direction")[0] == csys.conversiontype("direction") build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 angle = csys.convertdirection(newrefcode) build 12-Sep-2018 15:30:25 - mysin = qa.getvalue(qa.sin(angle)) build 12-Sep-2018 15:30:25 - mycos = qa.getvalue(qa.cos(angle)) build 12-Sep-2018 15:30:25 + myqa = qatool() build 12-Sep-2018 15:30:25 + mysin = myqa.getvalue(myqa.sin(angle)) build 12-Sep-2018 15:30:25 + mycos = myqa.getvalue(myqa.cos(angle)) build 12-Sep-2018 15:30:25 xnew = 0 build 12-Sep-2018 15:30:25 ynew = 0 build 12-Sep-2018 15:30:25 for xx in [-centerpix[0], centerpix[0]]: build 12-Sep-2018 15:30:25 @@ -217,7 +236,7 @@ def _imregrid_to_new_ref_frame( build 12-Sep-2018 15:30:25 if pad > 0: build 12-Sep-2018 15:30:25 casalog.post( build 12-Sep-2018 15:30:25 "Padding image by " + str(pad) build 12-Sep-2018 15:30:25 - + " pixels so no pixels are cut off in the rotation", build 12-Sep-2018 15:30:25 + + " pixels so no pixels are cut off in the regridding", build 12-Sep-2018 15:30:25 "NORMAL" build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 _myia = _myia.pad("", pad, wantreturn=True) build 12-Sep-2018 15:30:25 @@ -227,19 +246,23 @@ def _imregrid_to_new_ref_frame( build 12-Sep-2018 15:30:25 newrefpix[diraxes[0]] = newrefpix[diraxes[0]] + pad build 12-Sep-2018 15:30:25 newrefpix[diraxes[1]] = newrefpix[diraxes[1]] + pad build 12-Sep-2018 15:30:25 csys.setreferencepixel(newrefpix) build 12-Sep-2018 15:30:25 + regridded = _myia.regrid( build 12-Sep-2018 15:30:25 + outfile="",shape=shape, csys=csys.torecord(), axes=diraxes, build 12-Sep-2018 15:30:25 + method=interpolation, decimate=decimate ,doref=doref build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + regridded.dohistory(False) build 12-Sep-2018 15:30:25 + # beam is rotated counterclockwise build 12-Sep-2018 15:30:25 + angle_in_deg = format("%7.3f" % myqa.convert(angle, "deg")['value']) build 12-Sep-2018 15:30:25 casalog.post( build 12-Sep-2018 15:30:25 - "Will rotate direction coordinate by " build 12-Sep-2018 15:30:25 - + qa.tos(qa.convert(angle, "deg")) build 12-Sep-2018 15:30:25 - , 'NORMAL' build 12-Sep-2018 15:30:25 + "Will rotate beams counterclockwise by " + angle_in_deg + " degrees, " build 12-Sep-2018 15:30:25 + + "if necessary, to account for angle between original and new frame " build 12-Sep-2018 15:30:25 + + "at the reference pixel", 'NORMAL' build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 - rot = _myia.rotate(outfile="", shape=shape, pa=angle) build 12-Sep-2018 15:30:25 - rot.dohistory(False) build 12-Sep-2018 15:30:25 - rot.rotatebeam(angle=angle) build 12-Sep-2018 15:30:25 - rot.setcoordsys(csys.torecord()) build 12-Sep-2018 15:30:25 + regridded.rotatebeam(angle=myqa.mul(-1, angle)) build 12-Sep-2018 15:30:25 # now crop build 12-Sep-2018 15:30:25 casalog.post("Cropping masked image boundaries", "NORMAL") build 12-Sep-2018 15:30:25 - cropped = rot.crop(outfile=output, axes=diraxes, overwrite=overwrite) build 12-Sep-2018 15:30:25 - rot.done() build 12-Sep-2018 15:30:25 + cropped = regridded.crop(outfile=output, axes=diraxes, overwrite=overwrite) build 12-Sep-2018 15:30:25 + regridded.done() build 12-Sep-2018 15:30:25 _myia.done() build 12-Sep-2018 15:30:25 return cropped build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -247,12 +270,11 @@ def _imregrid_handle_default_shape( build 12-Sep-2018 15:30:25 imshape, image_csys, template_csys, build 12-Sep-2018 15:30:25 axestoregrid, tempshape, original_axes build 12-Sep-2018 15:30:25 ): build 12-Sep-2018 15:30:25 - # CAS-4959, output shape should have template shape build 12-Sep-2018 15:30:25 - # for axes being regridded, input image shape for axes build 12-Sep-2018 15:30:25 - # not being regridded, build 12-Sep-2018 15:30:25 - # CAS-4960 in cases where the input image and template both have multiple stokes, build 12-Sep-2018 15:30:25 - # the number of pixels on the output stokes axis is to be the number of stokes the build 12-Sep-2018 15:30:25 - # input and template have in common build 12-Sep-2018 15:30:25 + # CAS-4959, output shape should have template shape for axes being build 12-Sep-2018 15:30:25 + # regridded, input image shape for axes not being regridded, CAS-4960 in build 12-Sep-2018 15:30:25 + # cases where the input image and template both have multiple stokes, the build 12-Sep-2018 15:30:25 + # number of pixels on the output stokes axis is to be the number of stokes build 12-Sep-2018 15:30:25 + # the input and template have in common build 12-Sep-2018 15:30:25 shape = imshape build 12-Sep-2018 15:30:25 targetaxesnames = image_csys.names() build 12-Sep-2018 15:30:25 template_spectral_info = template_csys.findcoordinate("Spectral") build 12-Sep-2018 15:30:25 @@ -264,8 +286,8 @@ def _imregrid_handle_default_shape( build 12-Sep-2018 15:30:25 atr_count = 0 build 12-Sep-2018 15:30:25 for j in atr: build 12-Sep-2018 15:30:25 if i == j: build 12-Sep-2018 15:30:25 - # axis numbers may not correspond so have to look for the template axis build 12-Sep-2018 15:30:25 - # location by the axis name, CAS-4960 build 12-Sep-2018 15:30:25 + # axis numbers may not correspond so have to look for the build 12-Sep-2018 15:30:25 + # template axis location by the axis name, CAS-4960 build 12-Sep-2018 15:30:25 template_axis = template_csys.findaxisbyname(targetaxesnames[i]) build 12-Sep-2018 15:30:25 template_axis_length = tempshape[template_axis] build 12-Sep-2018 15:30:25 if ( build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_initweights.py b/gcwrap/python/scripts/task_initweights.py build 12-Sep-2018 15:30:25 index cefdc49..b0d674a 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_initweights.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/task_initweights.py build 12-Sep-2018 15:30:25 @@ -7,7 +7,7 @@ def initweights(vis=None,wtmode=None,tsystable=None,gainfield=None,interp=None,s build 12-Sep-2018 15:30:25 casalog.origin('initweights') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Do the trivial parallelization build 12-Sep-2018 15:30:25 - if ParallelTaskHelper.isParallelMS(vis): build 12-Sep-2018 15:30:25 + if ParallelTaskHelper.isMPIEnabled() and ParallelTaskHelper.isParallelMS(vis): build 12-Sep-2018 15:30:25 helper = ParallelTaskHelper('initweights', locals()) build 12-Sep-2018 15:30:25 helper.go() build 12-Sep-2018 15:30:25 # Write history to MS. build 12-Sep-2018 15:30:25 @@ -47,8 +47,9 @@ def initweights(vis=None,wtmode=None,tsystable=None,gainfield=None,interp=None,s build 12-Sep-2018 15:30:25 raise Exception, 'Visibility data set not found - please verify the name' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Write history to MS. build 12-Sep-2018 15:30:25 - # When running in parallel, history will be written in the parallel seciton above build 12-Sep-2018 15:30:25 - if ParallelTaskHelper.isMPIClient: build 12-Sep-2018 15:30:25 + # When running in parallel, history will be written in the parallel section above build 12-Sep-2018 15:30:25 + # normal MSs should write the history here build 12-Sep-2018 15:30:25 + if ParallelTaskHelper.isMPIClient(): build 12-Sep-2018 15:30:25 try: build 12-Sep-2018 15:30:25 param_names = initweights.func_code.co_varnames[:initweights.func_code.co_argcount] build 12-Sep-2018 15:30:25 param_vals = [eval(p) for p in param_names] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_mosaic.py b/gcwrap/python/scripts/task_mosaic.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 245379f..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_mosaic.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,173 +0,0 @@ build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def mosaic(vis,imagename,mode,alg,imsize,cell,phasecenter,stokes,niter,gain,threshold,mask,cleanbox,nchan,start,width,field,spw,timerange,restfreq,sdimage,modelimage,weighting,mosweight,rmode,robust,ftmachine,cyclefactor,cyclespeedup,scaletype,minpb,sigma,targetflux,constrainflux,prior,negcomponent,scales,npercycle,npixels, noise): build 12-Sep-2018 15:30:25 - """Calculate a multi-field deconvolved image with selected algorithm: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ### build 12-Sep-2018 15:30:25 - #Python script build 12-Sep-2018 15:30:25 - casalog.origin('mosaic') build 12-Sep-2018 15:30:25 - casalog.post("Task mosaic has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if(mask==[]): build 12-Sep-2018 15:30:25 - mask=[''] build 12-Sep-2018 15:30:25 - isInteractive=False; build 12-Sep-2018 15:30:25 - alg = 'mf'+ alg build 12-Sep-2018 15:30:25 - if (cleanbox== 'interactive'): build 12-Sep-2018 15:30:25 - isInteractive=True build 12-Sep-2018 15:30:25 - if( (mask=='') or (mask==[''])): build 12-Sep-2018 15:30:25 - mask=[imagename+'_interactive.mask'] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #parameter_printvalues(arg_names,arg_values,arg_types) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 -###Set image parameters build 12-Sep-2018 15:30:25 - imMos=imtool() build 12-Sep-2018 15:30:25 - casalog.origin('mosaic') build 12-Sep-2018 15:30:25 - if((len(imagename)==0) or (imagename.isspace())): build 12-Sep-2018 15:30:25 - raise Exception, 'Cannot proceed with blank imagename' build 12-Sep-2018 15:30:25 - if (field==''): build 12-Sep-2018 15:30:25 - field='*' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if(type(phasecenter)==str): build 12-Sep-2018 15:30:25 - ### blank means take field 0 build 12-Sep-2018 15:30:25 - if (phasecenter==''): build 12-Sep-2018 15:30:25 - phasecenter=ms.msseltoindex(vis,field=field)['field'][0] build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - tmppc=phasecenter build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - if(len(ms.msseltoindex(vis, field=phasecenter)['field']) > 0): build 12-Sep-2018 15:30:25 - tmppc=ms.msseltoindex(vis, field=phasecenter)['field'][0] build 12-Sep-2018 15:30:25 - ##succesful must be string like '0' or 'NGC*' build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - ##failed must be a string 'J2000 18h00m00 10d00m00' build 12-Sep-2018 15:30:25 - tmppc=phasecenter build 12-Sep-2018 15:30:25 - phasecenter=tmppc build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - spwindex=-1; build 12-Sep-2018 15:30:25 - if( (spw==-1) or (spw=='-1') or (spw=='') or (spw==' ')): build 12-Sep-2018 15:30:25 - spwindex=-1 build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - spwindex=ms.msseltoindex(vis, spw=spw)['spw'].tolist() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - fieldindex=ms.msseltoindex(vis,field=field)['field'].tolist() build 12-Sep-2018 15:30:25 - if ((type(vis)==str) & (os.path.exists(vis))): build 12-Sep-2018 15:30:25 - imMos.open(vis, usescratch=mosweight) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - raise Exception, 'Visibility data set not found - please verify the name' build 12-Sep-2018 15:30:25 - imMos.setvp(dovp=True) build 12-Sep-2018 15:30:25 - if ((type(imsize)==int)): build 12-Sep-2018 15:30:25 - imsize=[imsize,imsize] build 12-Sep-2018 15:30:25 - if ((type(cell)==int) | (type(cell)==float) | (type(cell)==str)): build 12-Sep-2018 15:30:25 - cell=[cell,cell] build 12-Sep-2018 15:30:25 - if ((len(imsize)==1)): build 12-Sep-2018 15:30:25 - imsize=[imsize[0],imsize[0]] build 12-Sep-2018 15:30:25 - if ((len(cell)==1)): build 12-Sep-2018 15:30:25 - cell=[cell[0],cell[0]] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - cellx=cell[0] build 12-Sep-2018 15:30:25 - celly=cell[1] build 12-Sep-2018 15:30:25 - if((type(cell[0])==int) or (type(cell[0])==float)): build 12-Sep-2018 15:30:25 - cellx=qa.quantity(cell[0], 'arcsec') build 12-Sep-2018 15:30:25 - celly=qa.quantity(cell[1], 'arcsec') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - print 'phasecenter= ', phasecenter build 12-Sep-2018 15:30:25 - #parameter_printvalues(arg_names,arg_values,arg_types) build 12-Sep-2018 15:30:25 - if(mode=='frequency'): build 12-Sep-2018 15:30:25 - ##check that start and step have units build 12-Sep-2018 15:30:25 - if(qa.quantity(start)['unit'].find('Hz') < 1): build 12-Sep-2018 15:30:25 - raise TypeError, "start parameter is not a valid frequency quantity " build 12-Sep-2018 15:30:25 - if(qa.quantity(width)['unit'].find('Hz') < 1): build 12-Sep-2018 15:30:25 - raise TypeError, "start parameter is not a valid frequency quantity " build 12-Sep-2018 15:30:25 - elif(mode=='velocity'): build 12-Sep-2018 15:30:25 - ##check that start and step have units build 12-Sep-2018 15:30:25 - if(qa.quantity(start)['unit'].find('m/s') < 0): build 12-Sep-2018 15:30:25 - raise TypeError, "start parameter is not a valid velocity quantity " build 12-Sep-2018 15:30:25 - if(qa.quantity(width)['unit'].find('m/s') < 0): build 12-Sep-2018 15:30:25 - raise TypeError, "start parameter is not a valid velocity quantity " build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - if((type(width) != int) build 12-Sep-2018 15:30:25 - or (type(start) != int)): build 12-Sep-2018 15:30:25 - raise TypeError, "start, width have to be integers with mode %s" %mode build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imMos.defineimage(nx=imsize[0],ny=imsize[1],cellx=cellx,celly=celly,mode=mode,nchan=nchan,start=start,step=width,phasecenter=phasecenter,spw=spwindex,stokes=stokes, restfreq=restfreq) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -###try to minimize the number of data selection build 12-Sep-2018 15:30:25 - ### when natural mosweight is irrelevant build 12-Sep-2018 15:30:25 - if(weighting=='natural'): build 12-Sep-2018 15:30:25 - mosweight=False build 12-Sep-2018 15:30:25 - imMos.selectvis(field=field,spw=spw,time=timerange, usescratch=True) build 12-Sep-2018 15:30:25 - imMos.weight(type=weighting,rmode=rmode,robust=robust,npixels=npixels, noise=noise, mosaic=mosweight) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -##### build 12-Sep-2018 15:30:25 -###Set clean region (file or list) build 12-Sep-2018 15:30:25 - if (((mask==['']) or (mask=='')) & ( (len(cleanbox) !=0) and (type(cleanbox)==list))): build 12-Sep-2018 15:30:25 - setcleanbox=False build 12-Sep-2018 15:30:25 - if (type(cleanbox[0])==int): build 12-Sep-2018 15:30:25 - cleanbox=[cleanbox] build 12-Sep-2018 15:30:25 - setcleanbox = True build 12-Sep-2018 15:30:25 - if ((type(cleanbox[0])==str) & (cleanbox[0]!='') & (cleanbox != 'interactive')): build 12-Sep-2018 15:30:25 - cleanbox=readboxfile(cleanbox) build 12-Sep-2018 15:30:25 - setcleanbox = True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if setcleanbox : build 12-Sep-2018 15:30:25 - mask=[imagename+'.cleanbox.mask'] build 12-Sep-2018 15:30:25 - if(os.path.exists(mask[0])): build 12-Sep-2018 15:30:25 - print 'mask',mask[0], 'exists on disk, will add new mask to it' build 12-Sep-2018 15:30:25 - casalog.post('mask '+mask[0]+' exists on disk, will add new mask to it', 'WARN') build 12-Sep-2018 15:30:25 - imMos.regionmask(mask=mask[0], boxes=cleanbox) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -##### build 12-Sep-2018 15:30:25 - if (ftmachine!='ft'): imMos.setoptions(ftmachine=ftmachine,padding=1.0) build 12-Sep-2018 15:30:25 - #imMos.setmfcontrol(scaletype=scaletype,minpb=minpb) build 12-Sep-2018 15:30:25 - #hardwire minpb for now build 12-Sep-2018 15:30:25 - sclt=scaletype build 12-Sep-2018 15:30:25 - if(scaletype=='PBCOR'): build 12-Sep-2018 15:30:25 - sclt='NONE' build 12-Sep-2018 15:30:25 - imMos.setmfcontrol(stoplargenegatives=negcomponent,scaletype=sclt,minpb=minpb,cyclefactor=cyclefactor,cyclespeedup=cyclespeedup,fluxscale=[imagename+'.flux']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if (modelimage==''): modelimage=imagename+'.model' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# imMos.make(modelimage) build 12-Sep-2018 15:30:25 -# Using SD image as model build 12-Sep-2018 15:30:25 - if (sdimage!=''): build 12-Sep-2018 15:30:25 - if (mask[0]==''): build 12-Sep-2018 15:30:25 - imMos.makemodelfromsd(sdimage=sdimage,modelimage=modelimage,maskimage=imagename+'.mask') build 12-Sep-2018 15:30:25 - mask[0]=imagename+'.mask' build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - imMos.makemodelfromsd(sdimage=sdimage,modelimage=modelimage,maskimage=imagename+'.sdmask') build 12-Sep-2018 15:30:25 - mask[0]=imagename+'.sdmask' build 12-Sep-2018 15:30:25 -##### build 12-Sep-2018 15:30:25 -###Determine algorithm to use build 12-Sep-2018 15:30:25 - if (alg=='mfentropy' or alg=='mfemptiness'): build 12-Sep-2018 15:30:25 - imMos.mem(algorithm=alg,niter=niter,sigma=sigma,targetflux=targetflux,constrainflux=constrainflux,keepfixed=[False],prior=prior,model=[modelimage],residual=[imagename+'.residual'],image=[imagename+'.image'],mask=mask) build 12-Sep-2018 15:30:25 - elif (alg=='mfmultiscale'): build 12-Sep-2018 15:30:25 - if (len(scales)==1): build 12-Sep-2018 15:30:25 - imMos.setscales('nscales',nscales=scales) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - imMos.setscales('uservector',uservector=scales) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imMos.clean(algorithm=alg,niter=niter,gain=gain,threshold=qa.quantity(threshold,'mJy'),model=[modelimage],residual=[imagename+'.residual'],image=[imagename+'.image'],mask=mask,interactive=isInteractive,npercycle=npercycle) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - imMos.clean(algorithm=alg,niter=niter,gain=gain,threshold=qa.quantity(threshold,'mJy'),model=[modelimage],residual=[imagename+'.residual'],image=[imagename+'.image'],mask=mask,interactive=isInteractive,npercycle=npercycle) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imMos.close() build 12-Sep-2018 15:30:25 - del imMos build 12-Sep-2018 15:30:25 - #if (scaletype=='PBCOR'): build 12-Sep-2018 15:30:25 - # print 'dividing by fluxscale image',imagename+'.flux' build 12-Sep-2018 15:30:25 - # ia.open(imagename+'.image') build 12-Sep-2018 15:30:25 - # result=imagename+'.image' build 12-Sep-2018 15:30:25 - # fluxscale_image=imagename+'.flux' build 12-Sep-2018 15:30:25 - # pixels=result+'/'+fluxscale_image build 12-Sep-2018 15:30:25 - # ia.calc(pixels=pixels) build 12-Sep-2018 15:30:25 - # ia.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - print '*** Error *** ',instance build 12-Sep-2018 15:30:25 - raise Exception, instance build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_oldhanningsmooth.py b/gcwrap/python/scripts/task_oldhanningsmooth.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 733fe97..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_oldhanningsmooth.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,72 +0,0 @@ build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# This file was generated using xslt from its XML file build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# Copyright 2007, Associated Universities Inc., Washington DC build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def oldhanningsmooth(vis=None, datacolumn=None, outputvis=None): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - """Hanning smooth frequency channel data to remove Gibbs ringing build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - oldhanningsmooth(vis='ngc5921.ms') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - This function Hanning smooths the frequency channels with build 12-Sep-2018 15:30:25 - a weighted running average of smoothedData[i] = build 12-Sep-2018 15:30:25 - 0.25*correctedData[i-1] + 0.50*correctedData[i] + build 12-Sep-2018 15:30:25 - 0.25*correctedData[i+1]. The first and last channels are flagged. build 12-Sep-2018 15:30:25 - Inclusion of a flagged value in an average causes that data value build 12-Sep-2018 15:30:25 - to be flagged. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file (MS) build 12-Sep-2018 15:30:25 - default: none; example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - datacolumn -- the name of the MS column into which to write the smoothed data build 12-Sep-2018 15:30:25 - default='corrected'; example: datacolumn='data' build 12-Sep-2018 15:30:25 - options: 'corrected' or 'data' build 12-Sep-2018 15:30:25 - outputvis -- name of the output visibility file (MS) build 12-Sep-2018 15:30:25 - default=none (write to the input MS); example: outputvis='ngc5921_src.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #Python script build 12-Sep-2018 15:30:25 - # build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - casalog.origin('oldhanningsmooth') build 12-Sep-2018 15:30:25 - casalog.post("Task oldhanningsmooth has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - casalog.post('vis=\''+vis+'\', datacolumn=\''+datacolumn+'\', outputvis=\''+outputvis+'\'', 'INFO') build 12-Sep-2018 15:30:25 - newvis = vis; build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if os.path.exists(outputvis): build 12-Sep-2018 15:30:25 - ms.close() build 12-Sep-2018 15:30:25 - raise Exception, "Output MS %s already exists - will not overwrite." % outputvis build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if(type(outputvis)==str and not outputvis==''): build 12-Sep-2018 15:30:25 - newvis = outputvis build 12-Sep-2018 15:30:25 - casalog.post('copying '+vis+' to '+newvis , 'INFO') build 12-Sep-2018 15:30:25 - tb.open(vis) build 12-Sep-2018 15:30:25 - tmptb = tb.copy(newvis, deep=True, valuecopy=True) build 12-Sep-2018 15:30:25 - tmptb.close() build 12-Sep-2018 15:30:25 - # note that the resulting copy is writable even if the original was read-only build 12-Sep-2018 15:30:25 - tb.close() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - newvis = vis build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if ((type(newvis)==str) & (os.path.exists(newvis))): build 12-Sep-2018 15:30:25 - ms.open(thems=newvis,nomodify=False) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - raise Exception, 'Visibility data set not found - please verify the name' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ms.hanningsmooth(datacolumn=str.lower(datacolumn)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # write history build 12-Sep-2018 15:30:25 - ms.writehistory(message='taskname = oldhanningsmooth',origin='oldhanningsmooth') build 12-Sep-2018 15:30:25 - ms.writehistory(message='vis = "'+str(vis)+'"',origin='oldhanningsmooth') build 12-Sep-2018 15:30:25 - ms.writehistory(message='datacolumn = "'+str(datacolumn)+'"',origin='oldhanningsmooth') build 12-Sep-2018 15:30:25 - ms.writehistory(message='outputvis = "'+str(outputvis)+'"',origin='oldhanningsmooth') build 12-Sep-2018 15:30:25 - ms.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - print '*** Error ***',instance build 12-Sep-2018 15:30:25 - return build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_oldpartition.py b/gcwrap/python/scripts/task_oldpartition.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 30f18d2..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_oldpartition.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,659 +0,0 @@ build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -import shutil build 12-Sep-2018 15:30:25 -import string build 12-Sep-2018 15:30:25 -import copy build 12-Sep-2018 15:30:25 -import math build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 -from parallel.parallel_task_helper import ParallelTaskHelper, JobData build 12-Sep-2018 15:30:25 -import partitionhelper as ph build 12-Sep-2018 15:30:25 -import flaghelper as fh build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -class PartitionHelper(ParallelTaskHelper): build 12-Sep-2018 15:30:25 - def __init__(self, args = {}): build 12-Sep-2018 15:30:25 - ParallelTaskHelper.__init__(self,'oldpartition', args) build 12-Sep-2018 15:30:25 - self._calScanList = None build 12-Sep-2018 15:30:25 - self._selectionScanList = None build 12-Sep-2018 15:30:25 - self._msTool = None build 12-Sep-2018 15:30:25 - self._tbTool = None build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def initialize(self): build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - This method will prepare the system for working, in particular: build 12-Sep-2018 15:30:25 - * Open the input MS as a msTool build 12-Sep-2018 15:30:25 - * Create the Output Directory and the Data subdirectory build 12-Sep-2018 15:30:25 - * Populate the global data selection filter (if necessary) build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - ParallelTaskHelper.initialize(self) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - for (arg,value) in self._arg.items(): build 12-Sep-2018 15:30:25 - if value == None: build 12-Sep-2018 15:30:25 - self._arg[arg] = '' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Since we are here we know that the outputvis should not be '' build 12-Sep-2018 15:30:25 - if self._arg['outputvis'] == '': build 12-Sep-2018 15:30:25 - raise ValueError, "An output vis was required." build 12-Sep-2018 15:30:25 - if os.path.exists(self._arg['outputvis']): build 12-Sep-2018 15:30:25 - raise ValueError, \ build 12-Sep-2018 15:30:25 - "Vis directory for output (%s) already exists" %\ build 12-Sep-2018 15:30:25 - self._arg['outputvis'] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Find the absolute path to the outputvis build 12-Sep-2018 15:30:25 - self._arg['outputvis'] = os.path.abspath(self._arg['outputvis']) build 12-Sep-2018 15:30:25 - outputPath, self.outputBase = os.path.split(self._arg['outputvis']) build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - self.outputBase = self.outputBase[:self.outputBase.rindex('.')] build 12-Sep-2018 15:30:25 - except ValueError: build 12-Sep-2018 15:30:25 - # outputBase must not have a trailing . build 12-Sep-2018 15:30:25 - pass build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.dataDir = outputPath + '/' + self.outputBase+'.data' build 12-Sep-2018 15:30:25 - if self._arg['createmms']: build 12-Sep-2018 15:30:25 - if os.path.exists(self.dataDir): build 12-Sep-2018 15:30:25 - shutil.rmtree(self.dataDir) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.mkdir(self.dataDir) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## handle the POINTING and SYSCAL tables ## build 12-Sep-2018 15:30:25 - self.ptab = self._arg['vis']+'/POINTING' build 12-Sep-2018 15:30:25 - self.stab = self._arg['vis']+'/SYSCAL' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mytb = tbtool() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # test their properties build 12-Sep-2018 15:30:25 - self.pointingisempty = True build 12-Sep-2018 15:30:25 - self.makepointinglinks = False build 12-Sep-2018 15:30:25 - self.pwriteaccess = True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mytb.open(self.ptab) build 12-Sep-2018 15:30:25 - self.pointingisempty = (mytb.nrows()==0) build 12-Sep-2018 15:30:25 - mytb.close() build 12-Sep-2018 15:30:25 - self.makepointinglinks = not self.pointingisempty build 12-Sep-2018 15:30:25 - self.pwriteaccess = True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.syscalisempty = True build 12-Sep-2018 15:30:25 - self.makesyscallinks = False build 12-Sep-2018 15:30:25 - self.swriteaccess = True build 12-Sep-2018 15:30:25 - if(os.path.exists(self.stab)): # syscal is optional build 12-Sep-2018 15:30:25 - mytb.open(self.stab) build 12-Sep-2018 15:30:25 - self.syscalisempty = (mytb.nrows()==0) build 12-Sep-2018 15:30:25 - mytb.close() build 12-Sep-2018 15:30:25 - self.makesyscallinks = not self.syscalisempty build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if not self.pointingisempty: build 12-Sep-2018 15:30:25 - if os.access(os.path.dirname(self.ptab), os.W_OK) \ build 12-Sep-2018 15:30:25 - and not os.path.islink(self.ptab): build 12-Sep-2018 15:30:25 - # move to datadir build 12-Sep-2018 15:30:25 - os.system('mv '+self.ptab+' '+self.dataDir) build 12-Sep-2018 15:30:25 - # create empty copy in original place so partition does not need to deal with it build 12-Sep-2018 15:30:25 - mytb.open(self.dataDir+'/POINTING') build 12-Sep-2018 15:30:25 - tmpp = mytb.copy(newtablename=self.ptab, norows=True) build 12-Sep-2018 15:30:25 - tmpp.close() build 12-Sep-2018 15:30:25 - mytb.close() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - self.pwriteaccess = False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if not self.syscalisempty: build 12-Sep-2018 15:30:25 - if os.access(os.path.dirname(self.stab), os.W_OK) \ build 12-Sep-2018 15:30:25 - and not os.path.islink(self.stab): build 12-Sep-2018 15:30:25 - # move to datadir build 12-Sep-2018 15:30:25 - os.system('mv '+self.stab+' '+self.dataDir) build 12-Sep-2018 15:30:25 - # create empty copy in original place so partition does not need to deal with it build 12-Sep-2018 15:30:25 - mytb.open(self.dataDir+'/SYSCAL') build 12-Sep-2018 15:30:25 - tmpp = mytb.copy(newtablename=self.stab, norows=True) build 12-Sep-2018 15:30:25 - tmpp.close() build 12-Sep-2018 15:30:25 - mytb.close() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - self.swriteaccess = False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def generateJobs(self): build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - This method overrides the method in the TaskHelper baseclass build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - if self._arg['calmsselection'] in ['auto','manual']: build 12-Sep-2018 15:30:25 - casalog.post("Analyzing MS for Calibration MS Creation") build 12-Sep-2018 15:30:25 - self._createCalMSCommand() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if self._arg['outputvis'] != '': build 12-Sep-2018 15:30:25 - casalog.post("Analyzing MS for partitioning") build 12-Sep-2018 15:30:25 - self._createPrimarySplitCommand() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - return True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def _createCalMSCommand(self): build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - Create a command which will generate a MS with only those subMSs build 12-Sep-2018 15:30:25 - in the selected calibration build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - self._selectMS(True) build 12-Sep-2018 15:30:25 - self._calScanList = self._getScanList() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Now create the command dict. for this build 12-Sep-2018 15:30:25 - calCmd = copy.copy(self._arg) build 12-Sep-2018 15:30:25 - calCmd['createmms'] = False build 12-Sep-2018 15:30:25 - calCmd['calmsselection'] = 'none' build 12-Sep-2018 15:30:25 - calCmd['scan'] = ParallelTaskHelper.listToCasaString(self._calScanList) build 12-Sep-2018 15:30:25 - if self._arg['createmms']: build 12-Sep-2018 15:30:25 - calCmd['outputvis'] = self.dataDir + '/%s.cal.ms' % self.outputBase build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - calCmd['outputvis'] = self._arg['calmsname'] build 12-Sep-2018 15:30:25 - self._executionList.append(JobData(self._taskName, calCmd)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def _createPrimarySplitCommand(self): build 12-Sep-2018 15:30:25 - if self._arg['createmms']: build 12-Sep-2018 15:30:25 - if self._arg['separationaxis'].lower() == 'scan': build 12-Sep-2018 15:30:25 - self._createScanSeparationCommands() build 12-Sep-2018 15:30:25 - elif self._arg['separationaxis'].lower() == 'spw': build 12-Sep-2018 15:30:25 - self._createSPWSeparationCommands() build 12-Sep-2018 15:30:25 - elif self._arg['separationaxis'].lower() == 'both': build 12-Sep-2018 15:30:25 - self._createDefaultSeparationCommands() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - # Single mms case build 12-Sep-2018 15:30:25 - singleCmd = copy.copy(self._arg) build 12-Sep-2018 15:30:25 - singleCmd['calmsselection'] = 'none' build 12-Sep-2018 15:30:25 - if scanList is not None: build 12-Sep-2018 15:30:25 - singleCmd['scan'] = ParallelTaskHelper.\ build 12-Sep-2018 15:30:25 - listToCasaString(scanList) build 12-Sep-2018 15:30:25 - self._executionList.append(JobData(self._taskName, singleCmd)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def _createScanSeparationCommands(self): build 12-Sep-2018 15:30:25 - scanList = self._selectionScanList build 12-Sep-2018 15:30:25 - if scanList is None: build 12-Sep-2018 15:30:25 - self._selectMS() build 12-Sep-2018 15:30:25 - scanList = self._getScanList() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Make sure we have enough scans to create the needed number of build 12-Sep-2018 15:30:25 - # subMSs. If not change the total expected. build 12-Sep-2018 15:30:25 - numSubMS = self._arg['numsubms'] build 12-Sep-2018 15:30:25 - numSubMS = min(len(scanList),numSubMS) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - partitionedScans = self.__partition(scanList, numSubMS) build 12-Sep-2018 15:30:25 - for output in xrange(numSubMS): build 12-Sep-2018 15:30:25 - mmsCmd = copy.copy(self._arg) build 12-Sep-2018 15:30:25 - mmsCmd['createmms'] = False build 12-Sep-2018 15:30:25 - mmsCmd['calmsselection'] = 'none' build 12-Sep-2018 15:30:25 - mmsCmd['scan']= ParallelTaskHelper.\ build 12-Sep-2018 15:30:25 - listToCasaString(partitionedScans[output]) build 12-Sep-2018 15:30:25 - mmsCmd['outputvis'] = self.dataDir+'/%s.%04d.ms' \ build 12-Sep-2018 15:30:25 - % (self.outputBase, output) build 12-Sep-2018 15:30:25 - self._executionList.append(JobData(self._taskName, mmsCmd)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def _createSPWSeparationCommands(self): build 12-Sep-2018 15:30:25 - # This method is to generate a list of commands to partition build 12-Sep-2018 15:30:25 - # the data based on SPW. build 12-Sep-2018 15:30:25 - self._selectMS() build 12-Sep-2018 15:30:25 - spwList = self._getSPWList() build 12-Sep-2018 15:30:25 - numSubMS = self._arg['numsubms'] build 12-Sep-2018 15:30:25 - numSubMS = min(len(spwList),numSubMS) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - partitionedSPWs = self.__partition(spwList,numSubMS) build 12-Sep-2018 15:30:25 - for output in xrange(numSubMS): build 12-Sep-2018 15:30:25 - mmsCmd = copy.copy(self._arg) build 12-Sep-2018 15:30:25 - mmsCmd['createmms'] = False build 12-Sep-2018 15:30:25 - mmsCmd['calmsselection'] = 'none' build 12-Sep-2018 15:30:25 - if self._selectionScanList is not None: build 12-Sep-2018 15:30:25 - mmsCmd['scan'] = ParallelTaskHelper.\ build 12-Sep-2018 15:30:25 - listToCasaString(self._selectionScanList) build 12-Sep-2018 15:30:25 - mmsCmd['spw'] = ParallelTaskHelper.\ build 12-Sep-2018 15:30:25 - listToCasaString(partitionedSPWs[output]) build 12-Sep-2018 15:30:25 - mmsCmd['outputvis'] = self.dataDir+'/%s.%04d.ms' \ build 12-Sep-2018 15:30:25 - % (self.outputBase, output) build 12-Sep-2018 15:30:25 - self._executionList.append(JobData(self._taskName, mmsCmd)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def _createDefaultSeparationCommands(self): build 12-Sep-2018 15:30:25 - # This method is similar to the SPW Separation mode above, except build 12-Sep-2018 15:30:25 - # that if there are not enough SPW to satisfy the numSubMS it uses build 12-Sep-2018 15:30:25 - # build 12-Sep-2018 15:30:25 - self._selectMS() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Get the list of spectral windows build 12-Sep-2018 15:30:25 - spwList = self._getSPWList() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check if we can just divide on SPW or if we need to do SPW and build 12-Sep-2018 15:30:25 - # scan build 12-Sep-2018 15:30:25 - numSubMS = self._arg['numsubms'] build 12-Sep-2018 15:30:25 - numSpwPartitions = min(len(spwList),numSubMS) build 12-Sep-2018 15:30:25 - numScanPartitions = int(math.ceil(numSubMS/float(numSpwPartitions))) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if numScanPartitions > 1: build 12-Sep-2018 15:30:25 - # Check that the scanlist is not null build 12-Sep-2018 15:30:25 - scanList = self._selectionScanList build 12-Sep-2018 15:30:25 - if scanList is None: build 12-Sep-2018 15:30:25 - scanList = self._getScanList() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check that the number of scans is enough for the partitions build 12-Sep-2018 15:30:25 - if len(scanList) < numScanPartitions: build 12-Sep-2018 15:30:25 - numScanPartitions = len(scanList) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - scanList = None build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - partitionedSpws = self.__partition(spwList,numSpwPartitions) build 12-Sep-2018 15:30:25 - partitionedScans = self.__partition(scanList,numScanPartitions) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - for output in xrange(numSpwPartitions*numScanPartitions): build 12-Sep-2018 15:30:25 - mmsCmd = copy.copy(self._arg) build 12-Sep-2018 15:30:25 - mmsCmd['createmms'] = False build 12-Sep-2018 15:30:25 - mmsCmd['calmsselection'] = 'none' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mmsCmd['scan'] = ParallelTaskHelper.listToCasaString \ build 12-Sep-2018 15:30:25 - (partitionedScans[output%numScanPartitions]) build 12-Sep-2018 15:30:25 - mmsCmd['spw'] = ParallelTaskHelper.listToCasaString\ build 12-Sep-2018 15:30:25 - (partitionedSpws[output/numScanPartitions]) build 12-Sep-2018 15:30:25 - mmsCmd['outputvis'] = self.dataDir+'/%s.%04d.ms' \ build 12-Sep-2018 15:30:25 - % (self.outputBase, output) build 12-Sep-2018 15:30:25 - self._executionList.append(JobData(self._taskName, mmsCmd)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def _selectMS(self, doCalibrationSelection = False): build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - This method will open the MS and ensure whatever selection critera build 12-Sep-2018 15:30:25 - have been requested are honored. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - If doCalibrationSelection is true then the MS is selected to the build 12-Sep-2018 15:30:25 - calibration criteria. If scanList is not None then it used as the build 12-Sep-2018 15:30:25 - scan selectior criteria. build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - print "Start of Select MS" build 12-Sep-2018 15:30:25 - if self._msTool is None: build 12-Sep-2018 15:30:25 - # Open up the msTool build 12-Sep-2018 15:30:25 - self._msTool = mstool() build 12-Sep-2018 15:30:25 - self._msTool.open(self._arg['vis']) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - self._msTool.reset() build 12-Sep-2018 15:30:25 - print "MS Tool Initialized" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - print "Getting Selection Filter" build 12-Sep-2018 15:30:25 - selectionFilter = self._getSelectionFilter() build 12-Sep-2018 15:30:25 - print "Selection Filter Complete" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if not doCalibrationSelection and self._calScanList is not None: build 12-Sep-2018 15:30:25 - print "Augmenting Cal Selection" build 12-Sep-2018 15:30:25 - # We need to augment the selection to remove cal scans build 12-Sep-2018 15:30:25 - if self._selectionScanList is None: build 12-Sep-2018 15:30:25 - # Generate the selection scan list if needed build 12-Sep-2018 15:30:25 - if selectionFilter is not None: build 12-Sep-2018 15:30:25 - self._msTool.msselect(selectionFilter) build 12-Sep-2018 15:30:25 - print "Getting Scan List" build 12-Sep-2018 15:30:25 - self._selectionScanList = self._getScanList() build 12-Sep-2018 15:30:25 - print "Scan List Complete" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - for scan in self._calScanList: build 12-Sep-2018 15:30:25 - self._selectionScanList.remove(scan) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Augment the selection build 12-Sep-2018 15:30:25 - if selectionFilter is None: build 12-Sep-2018 15:30:25 - selectionFilter = {} build 12-Sep-2018 15:30:25 - selectionFilter['scan'] = ParallelTaskHelper.listToCasaString\ build 12-Sep-2018 15:30:25 - (self._selectionScanList) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - print "Doing Primary Selection" build 12-Sep-2018 15:30:25 - if selectionFilter is not None: build 12-Sep-2018 15:30:25 - print selectionFilter build 12-Sep-2018 15:30:25 - self._msTool.msselect(selectionFilter) build 12-Sep-2018 15:30:25 - print "Primary Selection Complete" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if doCalibrationSelection: build 12-Sep-2018 15:30:25 - print "Doing Calibration Selection" build 12-Sep-2018 15:30:25 - calFilter = self._getCalibrationFilter() build 12-Sep-2018 15:30:25 - self._msTool.msselect(calFilter) build 12-Sep-2018 15:30:25 - print "Calibration Selection Complete" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def _getSPWList(self): build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - This method returns the spectral window list from the current build 12-Sep-2018 15:30:25 - ms. Be careful about having selection already done when you call this. build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - if self._msTool is None: build 12-Sep-2018 15:30:25 - self._selectMS() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Now get the list of SPWs in the selected ms build 12-Sep-2018 15:30:25 - ddInfo = self._msTool.getspectralwindowinfo() build 12-Sep-2018 15:30:25 - spwList = [info['SpectralWindowId'] for info in ddInfo.values()] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Return a unique sorted list: build 12-Sep-2018 15:30:25 - sorted = list(set(spwList)) build 12-Sep-2018 15:30:25 - sorted.sort() build 12-Sep-2018 15:30:25 - return sorted build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def _getScanList(self): build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - This method returns the scan list from the current ms. Be careful build 12-Sep-2018 15:30:25 - about having selection already done when you call this. build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - if self._msTool is None: build 12-Sep-2018 15:30:25 - self._selectMS() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - scanSummary = self._msTool.getscansummary() build 12-Sep-2018 15:30:25 - scanList = [int(scan) for scan in scanSummary] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if len(scanList) == 0: build 12-Sep-2018 15:30:25 - raise ValueError, "No Scans present in the created MS." build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - return scanList build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def postExecution(self): build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - This overrides the post execution portion of the task helper build 12-Sep-2018 15:30:25 - in this case we probably need to generate the output reference build 12-Sep-2018 15:30:25 - ms. build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if self._arg['createmms']: build 12-Sep-2018 15:30:25 - casalog.post("Finalizing MMS structure") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # restore POINTING and SYSCAL build 12-Sep-2018 15:30:25 - if self.pwriteaccess and not self.pointingisempty: build 12-Sep-2018 15:30:25 - print "restoring POINTING" build 12-Sep-2018 15:30:25 - os.system('rm -rf '+self.ptab) # remove empty copy build 12-Sep-2018 15:30:25 - os.system('mv '+self.dataDir+'/POINTING '+self.ptab) build 12-Sep-2018 15:30:25 - if self.swriteaccess and not self.syscalisempty: build 12-Sep-2018 15:30:25 - print "restoring SYSCAL" build 12-Sep-2018 15:30:25 - os.system('rm -rf '+self.stab) # remove empty copy build 12-Sep-2018 15:30:25 - os.system('mv '+self.dataDir+'/SYSCAL '+self.stab) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # jagonzal (CAS-4287): Add a cluster-less mode to by-pass parallel processing for MMSs as requested build 12-Sep-2018 15:30:25 - if (ParallelTaskHelper.getBypassParallelProcessing()==1): build 12-Sep-2018 15:30:25 - outputList = self._sequential_return_list build 12-Sep-2018 15:30:25 - self._sequential_return_list = {} build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - outputList = self._jobQueue.getOutputJobs() build 12-Sep-2018 15:30:25 - # We created a data directory and many SubMSs, build 12-Sep-2018 15:30:25 - # now build the reference MS build 12-Sep-2018 15:30:25 - if self._arg['calmsselection'] in ['auto','manual']: build 12-Sep-2018 15:30:25 - # A Cal MS was created in the data directory, see if it was build 12-Sep-2018 15:30:25 - # successful, if so build a multi-MS build 12-Sep-2018 15:30:25 - if os.path.exists(self._arg['calmsname']): build 12-Sep-2018 15:30:25 - raise ValueError, "Output MS already exists" build 12-Sep-2018 15:30:25 - self._msTool.createmultims(self._arg['calmsname'], build 12-Sep-2018 15:30:25 - [self.dataDir +'/%s.cal.ms'%self.outputBase]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - subMSList = [] build 12-Sep-2018 15:30:25 - if (ParallelTaskHelper.getBypassParallelProcessing()==1): build 12-Sep-2018 15:30:25 - for subMS in outputList: build 12-Sep-2018 15:30:25 - subMSList.append(subMS) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - for job in outputList: build 12-Sep-2018 15:30:25 - if job.status == 'done': build 12-Sep-2018 15:30:25 - subMSList.append(job.getCommandArguments()['outputvis']) build 12-Sep-2018 15:30:25 - subMSList.sort() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if len(subMSList) == 0: build 12-Sep-2018 15:30:25 - casalog.post("Error: no subMSs were created.", 'WARN') build 12-Sep-2018 15:30:25 - return False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mastersubms = subMSList[0] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - subtabs_to_omit = [] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # deal with POINTING table build 12-Sep-2018 15:30:25 - if not self.pointingisempty: build 12-Sep-2018 15:30:25 - shutil.rmtree(mastersubms+'/POINTING', ignore_errors=True) build 12-Sep-2018 15:30:25 - shutil.copytree(self.ptab, mastersubms+'/POINTING') # master subms gets a full copy of the original build 12-Sep-2018 15:30:25 - if self.makepointinglinks: build 12-Sep-2018 15:30:25 - for i in xrange(1,len(subMSList)): build 12-Sep-2018 15:30:25 - theptab = subMSList[i]+'/POINTING' build 12-Sep-2018 15:30:25 - shutil.rmtree(theptab, ignore_errors=True) build 12-Sep-2018 15:30:25 - os.symlink('../'+os.path.basename(mastersubms)+'/POINTING', theptab) build 12-Sep-2018 15:30:25 - # (link in target will be created my makeMMS) build 12-Sep-2018 15:30:25 - subtabs_to_omit.append('POINTING') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # deal with SYSCAL table build 12-Sep-2018 15:30:25 - if not self.syscalisempty: build 12-Sep-2018 15:30:25 - shutil.rmtree(mastersubms+'/SYSCAL', ignore_errors=True) build 12-Sep-2018 15:30:25 - shutil.copytree(self.stab, mastersubms+'/SYSCAL') # master subms gets a full copy of the original build 12-Sep-2018 15:30:25 - if self.makesyscallinks: build 12-Sep-2018 15:30:25 - for i in xrange(1,len(subMSList)): build 12-Sep-2018 15:30:25 - thestab = subMSList[i]+'/SYSCAL' build 12-Sep-2018 15:30:25 - shutil.rmtree(thestab, ignore_errors=True) build 12-Sep-2018 15:30:25 - os.symlink('../'+os.path.basename(mastersubms)+'/SYSCAL', thestab) build 12-Sep-2018 15:30:25 - # (link in target will be created my makeMMS) build 12-Sep-2018 15:30:25 - subtabs_to_omit.append('SYSCAL') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ph.makeMMS(self._arg['outputvis'], subMSList, build 12-Sep-2018 15:30:25 - True, # copy subtables build 12-Sep-2018 15:30:25 - subtabs_to_omit # omitting these build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - thesubmscontainingdir = os.path.dirname(subMSList[0].rstrip('/')) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.rmdir(thesubmscontainingdir) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - return True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def _getSelectionFilter(self): build 12-Sep-2018 15:30:25 - # This method takes the list of specified selection criteria and build 12-Sep-2018 15:30:25 - # puts them into a dictionary. There is a bit of name managling build 12-Sep-2018 15:30:25 - # necessary. build 12-Sep-2018 15:30:25 - # The pairs are: (msselection syntax, split task syntanc) build 12-Sep-2018 15:30:25 - selectionPairs = [] build 12-Sep-2018 15:30:25 - selectionPairs.append(('field','field')) build 12-Sep-2018 15:30:25 - selectionPairs.append(('spw','spw')) build 12-Sep-2018 15:30:25 - selectionPairs.append(('baseline','antenna')) build 12-Sep-2018 15:30:25 - selectionPairs.append(('time','timerange')) build 12-Sep-2018 15:30:25 - selectionPairs.append(('scan','scan')) build 12-Sep-2018 15:30:25 - selectionPairs.append(('uvdist','uvrange')) build 12-Sep-2018 15:30:25 - selectionPairs.append(('scanintent','scanintent')) build 12-Sep-2018 15:30:25 - selectionPairs.append(('observation','observation')) build 12-Sep-2018 15:30:25 - return self.__generateFilter(selectionPairs) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def _getCalibrationFilter(self): build 12-Sep-2018 15:30:25 - # Now get the calibrationSelectionFilter build 12-Sep-2018 15:30:25 - if self._arg['calmsselection'].lower() == 'auto': build 12-Sep-2018 15:30:25 - return {'scanintent':'CALIBRATE_*'} build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - selectionPairs = [] build 12-Sep-2018 15:30:25 - selectionPairs.append(('field','calfield')) build 12-Sep-2018 15:30:25 - selectionPairs.append(('scan','calscan')) build 12-Sep-2018 15:30:25 - selectionPairs.append(('scanintent','calintent')) build 12-Sep-2018 15:30:25 - return self.__generateFilter(selectionPairs) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def __generateFilter(self, selectionPairs): build 12-Sep-2018 15:30:25 - filter = None build 12-Sep-2018 15:30:25 - for (selSyntax, argSyntax) in selectionPairs: build 12-Sep-2018 15:30:25 - if self._arg[argSyntax] != '': build 12-Sep-2018 15:30:25 - if filter is None: build 12-Sep-2018 15:30:25 - filter = {} build 12-Sep-2018 15:30:25 - filter[selSyntax] = self._arg[argSyntax] build 12-Sep-2018 15:30:25 - return filter build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def __partition(self, lst, n): build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - This method will split the list lst into "n" almost equal parts build 12-Sep-2018 15:30:25 - if lst is none, then we assume an empty list build 12-Sep-2018 15:30:25 - ''' build 12-Sep-2018 15:30:25 - if lst is None: build 12-Sep-2018 15:30:25 - lst = [] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - division = len(lst)/float(n) build 12-Sep-2018 15:30:25 - return [ lst[int(round(division * i)): build 12-Sep-2018 15:30:25 - int(round(division * (i+1)))] for i in xrange(int(n))] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def oldpartition(vis, build 12-Sep-2018 15:30:25 - outputvis, build 12-Sep-2018 15:30:25 - createmms, build 12-Sep-2018 15:30:25 - separationaxis, build 12-Sep-2018 15:30:25 - numsubms, build 12-Sep-2018 15:30:25 - datacolumn, build 12-Sep-2018 15:30:25 - calmsselection, build 12-Sep-2018 15:30:25 - calmsname, build 12-Sep-2018 15:30:25 - calfield, build 12-Sep-2018 15:30:25 - calscan, build 12-Sep-2018 15:30:25 - calintent, build 12-Sep-2018 15:30:25 - field, build 12-Sep-2018 15:30:25 - spw, build 12-Sep-2018 15:30:25 - antenna, build 12-Sep-2018 15:30:25 - timebin, build 12-Sep-2018 15:30:25 - combine, build 12-Sep-2018 15:30:25 - timerange, build 12-Sep-2018 15:30:25 - scan, build 12-Sep-2018 15:30:25 - scanintent, build 12-Sep-2018 15:30:25 - array, build 12-Sep-2018 15:30:25 - uvrange, build 12-Sep-2018 15:30:25 - observation build 12-Sep-2018 15:30:25 - ): build 12-Sep-2018 15:30:25 - """Create a multi visibility set from an existing visibility set: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file (MS) build 12-Sep-2018 15:30:25 - default: none; example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - outputvis -- Name of output visibility file (MS) build 12-Sep-2018 15:30:25 - default: none; example: outputvis='ngc5921_src.ms' build 12-Sep-2018 15:30:25 - createmms -- Boolean flag if we're creating Multi MS build 12-Sep-2018 15:30:25 - default: True build 12-Sep-2018 15:30:25 - separationaxis -- what axis do we intend to split on. build 12-Sep-2018 15:30:25 - default = 'scan' build 12-Sep-2018 15:30:25 - Options: 'scan','spw','both' build 12-Sep-2018 15:30:25 - numsubms -- Number of sub-MSs to create. build 12-Sep-2018 15:30:25 - default: 64 build 12-Sep-2018 15:30:25 - datacolumn -- Which data column to split out build 12-Sep-2018 15:30:25 - default='corrected'; example: datacolumn='data' build 12-Sep-2018 15:30:25 - Options: 'data', 'corrected', 'model', 'all', build 12-Sep-2018 15:30:25 - 'float_data', 'lag_data', 'float_data,data', and build 12-Sep-2018 15:30:25 - 'lag_data,data'. build 12-Sep-2018 15:30:25 - note: 'all' = whichever of the above that are present. build 12-Sep-2018 15:30:25 - calmsselection -- Method by which to create a separate Calibration ms build 12-Sep-2018 15:30:25 - default = 'none' build 12-Sep-2018 15:30:25 - options: 'none','auto','manual' build 12-Sep-2018 15:30:25 - calmsname -- Name of output calibration visibility file (MS) build 12-Sep-2018 15:30:25 - default: none; example: outputvis='ngc5921_CAL.ms' build 12-Sep-2018 15:30:25 - calfield -- Field selection for calibration MS. build 12-Sep-2018 15:30:25 - default: '' build 12-Sep-2018 15:30:25 - calscans -- Scan selection for calibration MS. build 12-Sep-2018 15:30:25 - default: '' build 12-Sep-2018 15:30:25 - calintent -- Scan intent selection for calibration MS. build 12-Sep-2018 15:30:25 - default: '' build 12-Sep-2018 15:30:25 - field -- Field name build 12-Sep-2018 15:30:25 - default: field = '' means use all sources build 12-Sep-2018 15:30:25 - field = 1 # will get field_id=1 (if you give it an build 12-Sep-2018 15:30:25 - integer, it will retrieve the source with that index) build 12-Sep-2018 15:30:25 - field = '1328+307' specifies source '1328+307'. build 12-Sep-2018 15:30:25 - Minimum match can be used, egs field = '13*' will build 12-Sep-2018 15:30:25 - retrieve '1328+307' if it is unique or exists. build 12-Sep-2018 15:30:25 - Source names with imbedded blanks cannot be included. build 12-Sep-2018 15:30:25 - spw -- Spectral window index identifier build 12-Sep-2018 15:30:25 - default=-1 (all); example: spw=1 build 12-Sep-2018 15:30:25 - antenna -- antenna names build 12-Sep-2018 15:30:25 - default '' (all), build 12-Sep-2018 15:30:25 - antenna = '3 & 7' gives one baseline with antennaid = 3,7. build 12-Sep-2018 15:30:25 - timebin -- Interval width for time averaging. build 12-Sep-2018 15:30:25 - default: '0s' or '-1s' (no averaging) build 12-Sep-2018 15:30:25 - example: timebin='30s' build 12-Sep-2018 15:30:25 - combine -- Data descriptors that time averaging can ignore: build 12-Sep-2018 15:30:25 - scan, and/or state build 12-Sep-2018 15:30:25 - Default '' (none) build 12-Sep-2018 15:30:25 - timerange -- Time range build 12-Sep-2018 15:30:25 - default='' means all times. examples: build 12-Sep-2018 15:30:25 - timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss' build 12-Sep-2018 15:30:25 - timerange='< YYYY/MM/DD/HH:MM:SS.sss' build 12-Sep-2018 15:30:25 - timerange='> YYYY/MM/DD/HH:MM:SS.sss' build 12-Sep-2018 15:30:25 - timerange='< ddd/HH:MM:SS.sss' build 12-Sep-2018 15:30:25 - timerange='> ddd/HH:MM:SS.sss' build 12-Sep-2018 15:30:25 - scan -- Scan numbers to select. build 12-Sep-2018 15:30:25 - default '' (all). build 12-Sep-2018 15:30:25 - scanintent -- Select based on the scan intent. build 12-Sep-2018 15:30:25 - default '' (all) build 12-Sep-2018 15:30:25 - array -- (Sub)array IDs to select. build 12-Sep-2018 15:30:25 - default '' (all). build 12-Sep-2018 15:30:25 - uvrange -- uv distance range to select. build 12-Sep-2018 15:30:25 - default '' (all). build 12-Sep-2018 15:30:25 - observation -- observation ID(s) to select. build 12-Sep-2018 15:30:25 - default '' (all). build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - #retval = True build 12-Sep-2018 15:30:25 - casalog.origin('partition') build 12-Sep-2018 15:30:25 - casalog.post("Task oldpartition has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Start by going through and checking all the parameters build 12-Sep-2018 15:30:25 - if not isinstance(vis, str) or not os.path.exists(vis): build 12-Sep-2018 15:30:25 - raise ValueError, \ build 12-Sep-2018 15:30:25 - 'Visibility data set (%s) not found - please verify the name' % \ build 12-Sep-2018 15:30:25 - vis build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # SMC: The outputvis must be given build 12-Sep-2018 15:30:25 - # NOTE: added print statement because the exception msgs are build 12-Sep-2018 15:30:25 - # not being printed at this moment. build 12-Sep-2018 15:30:25 - if not outputvis or outputvis.isspace(): build 12-Sep-2018 15:30:25 - print 'Please specify outputvis' build 12-Sep-2018 15:30:25 - raise ValueError, 'Please specify outputvis' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - outputvis = outputvis.rstrip('/') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if outputvis != '' and os.path.exists(outputvis): build 12-Sep-2018 15:30:25 - print 'Output MS %s already exists - will not overwrite.'%outputvis build 12-Sep-2018 15:30:25 - raise ValueError, "Output MS %s already exists - will not overwrite."%\ build 12-Sep-2018 15:30:25 - outputvis build 12-Sep-2018 15:30:25 - if isinstance(antenna,list): build 12-Sep-2018 15:30:25 - antenna = ', '.join([str(ant) for ant in antenna]) build 12-Sep-2018 15:30:25 - if isinstance(spw, list): build 12-Sep-2018 15:30:25 - spw = ','.join([str(s) for s in spw]) build 12-Sep-2018 15:30:25 - elif isinstance(spw,int): build 12-Sep-2018 15:30:25 - spw = str(spw) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Accept digits without units ...assume seconds build 12-Sep-2018 15:30:25 - timebin = qa.convert(qa.quantity(timebin), 's')['value'] build 12-Sep-2018 15:30:25 - timebin = str(timebin) + 's' build 12-Sep-2018 15:30:25 - if timebin == '0s': build 12-Sep-2018 15:30:25 - timebin= '-1s' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if hasattr(combine, '_iter_'): build 12-Sep-2018 15:30:25 - combine = ', '.join(combine) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if calmsselection in ['auto','manual']: build 12-Sep-2018 15:30:25 - if os.path.exists(calmsname): build 12-Sep-2018 15:30:25 - raise ValueError, ("Output calibration MS %s already exists "+\ build 12-Sep-2018 15:30:25 - "will not overwrite." ) % calmsname build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if createmms or not \ build 12-Sep-2018 15:30:25 - ((calmsselection in ['auto','manual']) ^ (outputvis != '')): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # This means we are creating more than a single MS do it in parallel build 12-Sep-2018 15:30:25 - ph = PartitionHelper(locals()) build 12-Sep-2018 15:30:25 - ph.go() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Create a backup of the flags that are in the MMS build 12-Sep-2018 15:30:25 - casalog.origin('partition') build 12-Sep-2018 15:30:25 - casalog.post('Create a backup of the flags that are in the MMS') build 12-Sep-2018 15:30:25 - fh.backupFlags(aflocal=None, msfile=outputvis, prename='partition') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - return build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Create the msTool build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - msTool = mstool() build 12-Sep-2018 15:30:25 - msTool.open(vis) build 12-Sep-2018 15:30:25 - msTool.partition(outputms=outputvis, build 12-Sep-2018 15:30:25 - field=field, build 12-Sep-2018 15:30:25 - spw=spw, build 12-Sep-2018 15:30:25 - baseline=antenna, build 12-Sep-2018 15:30:25 - subarray=array, build 12-Sep-2018 15:30:25 - timebin=timebin, build 12-Sep-2018 15:30:25 - time=timerange, build 12-Sep-2018 15:30:25 - whichcol=datacolumn, build 12-Sep-2018 15:30:25 - scan=scan, build 12-Sep-2018 15:30:25 - uvrange=uvrange, build 12-Sep-2018 15:30:25 - combine=combine, build 12-Sep-2018 15:30:25 - intent=scanintent, build 12-Sep-2018 15:30:25 - obs=str(observation)) build 12-Sep-2018 15:30:25 - msTool.close() build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - casalog.post("*** Error \'%s\' captured in partition" % (instance),'WARN') build 12-Sep-2018 15:30:25 - msTool.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Write history to output MS, not the input ms. build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - param_names = oldpartition.func_code.co_varnames[:oldpartition.func_code.co_argcount] build 12-Sep-2018 15:30:25 - param_vals = [eval(p) for p in param_names] build 12-Sep-2018 15:30:25 - write_history(msTool, outputvis, 'oldpartition', param_names, build 12-Sep-2018 15:30:25 - param_vals, casalog) build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - casalog.post("*** Error \'%s\' updating HISTORY" % (instance), build 12-Sep-2018 15:30:25 - 'WARN') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - return True build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_oldplotants.py b/gcwrap/python/scripts/task_oldplotants.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 39e2677..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_oldplotants.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,58 +0,0 @@ build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -import pylab as pl build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 -from __casac__ import msplot build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def oldplotants(vis=None,figfile=''): build 12-Sep-2018 15:30:25 - """Plot the antenna distribution in the local reference frame: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The location of the antennas in the MS will be plotted with build 12-Sep-2018 15:30:25 - X-toward local east; Y-toward local north. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file. build 12-Sep-2018 15:30:25 - default: none. example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - figfile -- Save the plotted figure in this file. build 12-Sep-2018 15:30:25 - default: ''. example: figfile='myFigure.png' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The name of each antenna (egs. vla=antenna number) is build 12-Sep-2018 15:30:25 - shown next to its respective location. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - DO NOT use the buttons on the Mark Region line. These are build 12-Sep-2018 15:30:25 - not implemented yet and might abort CASA. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - You can zoom in by pressing the magnifier button (bottom, build 12-Sep-2018 15:30:25 - third from left) and making a rectangular region with build 12-Sep-2018 15:30:25 - the mouse. Press the home button (left most button) to build 12-Sep-2018 15:30:25 - remove zoom. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - A hard-copy of this plot can be obtained by pressing the build 12-Sep-2018 15:30:25 - button on the right at the bottom of the display. This build 12-Sep-2018 15:30:25 - produces a png format file. build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - casalog.origin('oldplotants') build 12-Sep-2018 15:30:25 - casalog.post("Task oldplotants has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - mp = mptool() build 12-Sep-2018 15:30:25 - if type(vis) == str and os.path.isdir(vis): build 12-Sep-2018 15:30:25 - mp.open(vis) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - raise Exception, 'Visibility data set not found - please verify the name' build 12-Sep-2018 15:30:25 - pl.ion() # countering tableplot's inadequacies with poor practice build 12-Sep-2018 15:30:25 - pl.clf() build 12-Sep-2018 15:30:25 - mp.plotoptions(plotsymbol='ro'); build 12-Sep-2018 15:30:25 - mp.plot(type='array') build 12-Sep-2018 15:30:25 - mp.reset() build 12-Sep-2018 15:30:25 - pl.axis('equal') build 12-Sep-2018 15:30:25 - pl.axis('scaled') build 12-Sep-2018 15:30:25 - #pl.ylabel('Y (m)') # Replace mp's "X (m)". build 12-Sep-2018 15:30:25 - pl.title(vis) build 12-Sep-2018 15:30:25 - if ( len(figfile) > 0 ) : build 12-Sep-2018 15:30:25 - mp.savefig( figfile ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - print '*** Error ***',instance build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mp.done() build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_oldsplit.py b/gcwrap/python/scripts/task_oldsplit.py build 12-Sep-2018 15:30:25 index c05bd87..dc8fd4f 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_oldsplit.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/task_oldsplit.py build 12-Sep-2018 15:30:25 @@ -51,7 +51,7 @@ def oldsplit(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 default '' (all). build 12-Sep-2018 15:30:25 intent -- Scan intents to select. build 12-Sep-2018 15:30:25 default '' (all). build 12-Sep-2018 15:30:25 - array -- (Sub)array IDs to select. build 12-Sep-2018 15:30:25 + array -- (Sub)array IDs to select. build 12-Sep-2018 15:30:25 default '' (all). build 12-Sep-2018 15:30:25 uvrange -- uv distance range to select. build 12-Sep-2018 15:30:25 default '' (all). build 12-Sep-2018 15:30:25 @@ -67,23 +67,24 @@ def oldsplit(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 keepmms -- If the input is a multi-MS, make the output one, too. (experimental) build 12-Sep-2018 15:30:25 Default: False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 """ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 casalog.origin('oldsplit') build 12-Sep-2018 15:30:25 + casalog.post("Warning: the oldsplit task is only for testing. Please use split or mstransform instead.", "WARN") build 12-Sep-2018 15:30:25 mylocals = locals() build 12-Sep-2018 15:30:25 rval = True build 12-Sep-2018 15:30:25 try: build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - if (keepmms and ParallelTaskHelper.isParallelMS(vis)): build 12-Sep-2018 15:30:25 - if (timebin!='0s' and timebin!='-1s'): build 12-Sep-2018 15:30:25 + if (keepmms and ParallelTaskHelper.isParallelMS(vis)): build 12-Sep-2018 15:30:25 + if (timebin!='0s' and timebin!='-1s'): build 12-Sep-2018 15:30:25 casalog.post('Averaging over time with keepmms=True may lead to results different\n' build 12-Sep-2018 15:30:25 +' from those obtained with keepmms=False due to different binning.', 'WARN') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 myms = mstool() build 12-Sep-2018 15:30:25 myms.open(vis) build 12-Sep-2018 15:30:25 mses = myms.getreferencedtables() build 12-Sep-2018 15:30:25 - myms.close() build 12-Sep-2018 15:30:25 + myms.close() build 12-Sep-2018 15:30:25 mses.sort() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 nfail = 0 build 12-Sep-2018 15:30:25 @@ -97,7 +98,7 @@ def oldsplit(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 emptyptab = tempout+'/EMPTY_POINTING' build 12-Sep-2018 15:30:25 nochangeinpointing = (str(antenna)+str(timerange)=='') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - if nochangeinpointing: build 12-Sep-2018 15:30:25 + if nochangeinpointing: build 12-Sep-2018 15:30:25 # resulting pointing table is the same for all build 12-Sep-2018 15:30:25 # -> replace by empty table if it is a link and won't be modified anyway build 12-Sep-2018 15:30:25 # and put back original into the master after split build 12-Sep-2018 15:30:25 @@ -125,7 +126,7 @@ def oldsplit(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 replaced = [] build 12-Sep-2018 15:30:25 outputviss = [] build 12-Sep-2018 15:30:25 theptabs = [] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 for m in mses: build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # make sure the SORTED_TABLE keywords are disabled build 12-Sep-2018 15:30:25 @@ -186,7 +187,7 @@ def oldsplit(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 if not goretval[m]: build 12-Sep-2018 15:30:25 casalog.post(os.path.basename(m)+': '+str(goretval[m]), 'WARN') build 12-Sep-2018 15:30:25 else: build 12-Sep-2018 15:30:25 - casalog.post(os.path.basename(m)+': '+str(goretval[m]), 'NORMAL') build 12-Sep-2018 15:30:25 + casalog.post(os.path.basename(m)+': '+str(goretval[m]), 'NORMAL') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 casalog.post('Will construct MMS from subMSs with successful selection ...', 'NORMAL') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -197,7 +198,7 @@ def oldsplit(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 # copy the original masterptab into the new master build 12-Sep-2018 15:30:25 shutil.rmtree(successfulmses[0]+'/POINTING') build 12-Sep-2018 15:30:25 shutil.copytree(masterptab, successfulmses[0]+'/POINTING') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 if rval: # construct new MMS from the output build 12-Sep-2018 15:30:25 if(width==1 and str(field)+str(spw)+str(antenna)+str(timerange)+str(scan)+str(intent)\ build 12-Sep-2018 15:30:25 +str(array)+str(uvrange)+str(correlation)+str(observation)==''): build 12-Sep-2018 15:30:25 @@ -209,7 +210,7 @@ def oldsplit(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 myms.virtconcatenate(successfulmses[i], auxfile, '1Hz', '10mas', True) build 12-Sep-2018 15:30:25 myms.close() build 12-Sep-2018 15:30:25 os.remove(auxfile) build 12-Sep-2018 15:30:25 - ph.makeMMS(outputvis, successfulmses, True, ['POINTING']) build 12-Sep-2018 15:30:25 + ph.makeMMS(outputvis, successfulmses, True, ['POINTING']) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 shutil.rmtree(tempout, ignore_errors=True) build 12-Sep-2018 15:30:25 @@ -225,7 +226,7 @@ def oldsplit(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 except Exception, instance: build 12-Sep-2018 15:30:25 casalog.post("*** Error: %s" % (instance), 'SEVERE') build 12-Sep-2018 15:30:25 rval = False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 return rval build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -259,14 +260,14 @@ def split_core(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 # work properly when spw=''. build 12-Sep-2018 15:30:25 #if(spw == ''): build 12-Sep-2018 15:30:25 # spw = '*' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 if(type(antenna) == list): build 12-Sep-2018 15:30:25 antenna = ', '.join([str(ant) for ant in antenna]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ## Accept digits without units ...assume seconds build 12-Sep-2018 15:30:25 timebin = qa.convert(qa.quantity(timebin), 's')['value'] build 12-Sep-2018 15:30:25 timebin = str(timebin) + 's' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 if timebin == '0s': build 12-Sep-2018 15:30:25 timebin = '-1s' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -280,7 +281,7 @@ def split_core(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 if '^' in spw: build 12-Sep-2018 15:30:25 casalog.post("The interpretation of ^n in split's spw strings has changed from 'average n' to 'skip n' channels!", 'WARN') build 12-Sep-2018 15:30:25 casalog.post("Watch for Slicer errors", 'WARN') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 if type(width) == str: build 12-Sep-2018 15:30:25 try: build 12-Sep-2018 15:30:25 if(width.isdigit()): build 12-Sep-2018 15:30:25 @@ -292,7 +293,7 @@ def split_core(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 width = [] build 12-Sep-2018 15:30:25 for ws in splitwidth: build 12-Sep-2018 15:30:25 if(ws.isdigit()): build 12-Sep-2018 15:30:25 - width.append(string.atoi(ws)) build 12-Sep-2018 15:30:25 + width.append(string.atoi(ws)) build 12-Sep-2018 15:30:25 else: build 12-Sep-2018 15:30:25 width = [1] build 12-Sep-2018 15:30:25 except: build 12-Sep-2018 15:30:25 @@ -349,7 +350,7 @@ def split_core(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 import shutil build 12-Sep-2018 15:30:25 shutil.rmtree(cavms) build 12-Sep-2018 15:30:25 return False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 # The selection was already made, so blank them before time averaging. build 12-Sep-2018 15:30:25 field = '' build 12-Sep-2018 15:30:25 spw = '' build 12-Sep-2018 15:30:25 @@ -393,7 +394,7 @@ def split_core(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 # Write history to output MS, not the input ms. build 12-Sep-2018 15:30:25 try: build 12-Sep-2018 15:30:25 param_names = split_core.func_code.co_varnames[:split_core.func_code.co_argcount] build 12-Sep-2018 15:30:25 - param_vals = [eval(p) for p in param_names] build 12-Sep-2018 15:30:25 + param_vals = [eval(p) for p in param_names] build 12-Sep-2018 15:30:25 retval &= write_history(myms, outputvis, 'oldsplit', param_names, param_vals, build 12-Sep-2018 15:30:25 casalog) build 12-Sep-2018 15:30:25 except Exception, instance: build 12-Sep-2018 15:30:25 @@ -401,7 +402,7 @@ def split_core(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 'WARN') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Update FLAG_CMD if necessary. build 12-Sep-2018 15:30:25 - # If the spw selection is by name or FLAG_CMD contains spw with names, skip the updating build 12-Sep-2018 15:30:25 + # If the spw selection is by name or FLAG_CMD contains spw with names, skip the updating build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 if ((spw != '') and (spw != '*')) or do_chan_mod: build 12-Sep-2018 15:30:25 isopen = False build 12-Sep-2018 15:30:25 @@ -410,7 +411,7 @@ def split_core(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 mytb.open(outputvis + '/FLAG_CMD', nomodify=False) build 12-Sep-2018 15:30:25 isopen = True build 12-Sep-2018 15:30:25 nflgcmds = mytb.nrows() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 if nflgcmds > 0: build 12-Sep-2018 15:30:25 updateFlagCmd = False build 12-Sep-2018 15:30:25 # If spw selection is by name in FLAG_CMD, do not update, CAS-7751 build 12-Sep-2018 15:30:25 @@ -423,10 +424,10 @@ def split_core(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 spwstr = re.search('^[^a-zA-Z]+$', cmd) build 12-Sep-2018 15:30:25 if spwstr != None and spwstr.string.__len__() > 0: build 12-Sep-2018 15:30:25 updateFlagCmd = True build 12-Sep-2018 15:30:25 - break build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if updateFlagCmd: build 12-Sep-2018 15:30:25 + break build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if updateFlagCmd: build 12-Sep-2018 15:30:25 mademod = False build 12-Sep-2018 15:30:25 cmds = mytb.getcol('COMMAND') build 12-Sep-2018 15:30:25 widths = {} build 12-Sep-2018 15:30:25 @@ -447,7 +448,7 @@ def split_core(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 w = width build 12-Sep-2018 15:30:25 for i in xrange(nspw): build 12-Sep-2018 15:30:25 widths[i] = w build 12-Sep-2018 15:30:25 - #print 'widths =', widths build 12-Sep-2018 15:30:25 + #print 'widths =', widths build 12-Sep-2018 15:30:25 for rownum in xrange(nflgcmds): build 12-Sep-2018 15:30:25 # Matches a bare number or a string quoted any way. build 12-Sep-2018 15:30:25 spwmatch = re.search(r'spw\s*=\s*(\S+)', cmds[rownum]) build 12-Sep-2018 15:30:25 @@ -488,7 +489,7 @@ def split_core(vis, outputvis, datacolumn, field, spw, width, antenna, build 12-Sep-2018 15:30:25 casalog.post('FLAG_CMD table contains spw selection by name. Will not update it!','DEBUG') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 mytb.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 except Exception, instance: build 12-Sep-2018 15:30:25 if isopen: build 12-Sep-2018 15:30:25 mytb.close() build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_oldstatwt.py b/gcwrap/python/scripts/task_oldstatwt.py build 12-Sep-2018 15:30:25 new file mode 100644 build 12-Sep-2018 15:30:25 index 0000000..6874c0a build 12-Sep-2018 15:30:25 --- /dev/null build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/task_oldstatwt.py build 12-Sep-2018 15:30:25 @@ -0,0 +1,81 @@ build 12-Sep-2018 15:30:25 +from taskinit import mstool, tbtool, casalog, write_history build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +def oldstatwt(vis, dorms, byantenna, sepacs, fitspw, fitcorr, combine, build 12-Sep-2018 15:30:25 + timebin, minsamp, field, spw, antenna, timerange, scan, intent, build 12-Sep-2018 15:30:25 + array, correlation, obs, datacolumn): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + Sets WEIGHT and SIGMA using the scatter of the visibilities. build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + casalog.origin('oldstatwt') build 12-Sep-2018 15:30:25 + retval = True build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + mytb = tbtool() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # parameter check for those not fully implemeted build 12-Sep-2018 15:30:25 + # (should be taken out once implemented) build 12-Sep-2018 15:30:25 + if byantenna: build 12-Sep-2018 15:30:25 + raise ValueError("byantenna=True is not supported yet") build 12-Sep-2018 15:30:25 + if fitcorr !='': build 12-Sep-2018 15:30:25 + raise ValueError("fitcorr is not supported yet") build 12-Sep-2018 15:30:25 + if timebin !='0s' and timebin !='-1s': build 12-Sep-2018 15:30:25 + raise ValueError("timebin is not supported yet") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + datacol = 'DATA' build 12-Sep-2018 15:30:25 + mytb.open(vis) build 12-Sep-2018 15:30:25 + colnames = mytb.colnames() build 12-Sep-2018 15:30:25 + mytb.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + for datacol in ['CORRECTED_DATA', 'DATA', 'junk']: build 12-Sep-2018 15:30:25 + if datacol in colnames: build 12-Sep-2018 15:30:25 + break build 12-Sep-2018 15:30:25 + if datacol == 'junk': build 12-Sep-2018 15:30:25 + raise ValueError(vis + " does not have a data column") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if datacolumn == 'float_data': build 12-Sep-2018 15:30:25 + raise ValueError("float_data is not yet supported") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if datacolumn == 'corrected' and datacol == 'DATA': # no CORRECTED_DATA case (fall back to DATA) build 12-Sep-2018 15:30:25 + casalog.post("No %s column found, using %s column" % (datacolumn.upper()+'_DATA', datacol),'WARN') build 12-Sep-2018 15:30:25 + datacolumn = datacol build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + if datacolumn=='corrected': build 12-Sep-2018 15:30:25 + datacolumn_name=datacolumn.upper()+'_DATA' build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + datacolumn_name=datacolumn.upper() build 12-Sep-2018 15:30:25 + casalog.post("Using %s column to determine visibility scatter" % datacolumn_name) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if ':' in spw: build 12-Sep-2018 15:30:25 + casalog.post('The channel selection part of spw will be ignored.', 'WARN') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if len(correlation)>0: build 12-Sep-2018 15:30:25 + correlation='' build 12-Sep-2018 15:30:25 + casalog.post('Correlation selection in oldstatwt has been disabled as of CASA v4.5', 'WARN') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + myms.open(vis, nomodify=False) build 12-Sep-2018 15:30:25 + retval = myms.oldstatwt(dorms, byantenna, sepacs, fitspw, fitcorr, combine, build 12-Sep-2018 15:30:25 + timebin, minsamp, field, spw, antenna, timerange, scan, intent, build 12-Sep-2018 15:30:25 + array, correlation, obs, datacolumn) build 12-Sep-2018 15:30:25 + myms.close() build 12-Sep-2018 15:30:25 + except Exception, e: build 12-Sep-2018 15:30:25 + casalog.post("Error setting WEIGHT and SIGMA for %s:" % vis, 'SEVERE') build 12-Sep-2018 15:30:25 + casalog.post("%s" % e, 'SEVERE') build 12-Sep-2018 15:30:25 + if False: # Set True for debugging. build 12-Sep-2018 15:30:25 + for p in oldstatwt.func_code.co_varnames[:statwt.func_code.co_argcount]: build 12-Sep-2018 15:30:25 + v = eval(p) build 12-Sep-2018 15:30:25 + print p, "=", v, ", type =", type(v) build 12-Sep-2018 15:30:25 + retval = False build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if retval: build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + param_names = oldstatwt.func_code.co_varnames[:oldstatwt.func_code.co_argcount] build 12-Sep-2018 15:30:25 + param_vals = [eval(p) for p in param_names] build 12-Sep-2018 15:30:25 + retval &= write_history(myms, vis, 'oldstatwt', param_names, param_vals, build 12-Sep-2018 15:30:25 + casalog) build 12-Sep-2018 15:30:25 + except Exception, instance: build 12-Sep-2018 15:30:25 + casalog.post("*** Error \'%s\' updating HISTORY" % (instance), build 12-Sep-2018 15:30:25 + 'WARN') build 12-Sep-2018 15:30:25 + return retval build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_plotms.py b/gcwrap/python/scripts/task_plotms.py build 12-Sep-2018 15:30:25 index e19a271..d38f07c 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_plotms.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/task_plotms.py build 12-Sep-2018 15:30:25 @@ -551,7 +551,13 @@ def plotms(vis=None, build 12-Sep-2018 15:30:25 return False build 12-Sep-2018 15:30:25 if not yselfscale and ysharedaxis: build 12-Sep-2018 15:30:25 casalog.post( "Plots cannot share a y-axis unless they use the same y-axis scale.", "ERROR") build 12-Sep-2018 15:30:25 - return False build 12-Sep-2018 15:30:25 + return False build 12-Sep-2018 15:30:25 + if xsharedaxis and gridrows < 2: build 12-Sep-2018 15:30:25 + casalog.post( "Plots cannot share an x-axis when gridrows=1.", "WARN") build 12-Sep-2018 15:30:25 + xsharedaxis=False build 12-Sep-2018 15:30:25 + if ysharedaxis and gridcols < 2: build 12-Sep-2018 15:30:25 + casalog.post( "Plots cannot share a y-axis when gridcols=1.", "WARN") build 12-Sep-2018 15:30:25 + ysharedaxis=False build 12-Sep-2018 15:30:25 pm.setPlotMSIterate(iteraxis,rowindex,colindex, build 12-Sep-2018 15:30:25 xselfscale,yselfscale, build 12-Sep-2018 15:30:25 xsharedaxis,ysharedaxis,False,plotindex); build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_plotuv.py b/gcwrap/python/scripts/task_plotuv.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index ad20c6e..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_plotuv.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,370 +0,0 @@ build 12-Sep-2018 15:30:25 -from matplotlib.widgets import Button build 12-Sep-2018 15:30:25 -from taskinit import ms, tbtool, casalog build 12-Sep-2018 15:30:25 -from update_spw import expand_tilde build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -#from taskutil import get_global_namespace build 12-Sep-2018 15:30:25 -#my_globals = get_global_namespace() build 12-Sep-2018 15:30:25 -#pl = my_globals['pl'] build 12-Sep-2018 15:30:25 -#del my_globals build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -import pylab as pl build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def plotuv(vis=None, field=None, antenna=None, spw=None, observation=None, array=None, build 12-Sep-2018 15:30:25 - maxnpts=None, colors=None, symb=None, ncycles=None, figfile=None): build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - Plots the uv coverage of vis in klambda. ncycles of colors will be build 12-Sep-2018 15:30:25 - allocated to representative wavelengths. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - colors: a list of matplotlib color codes. build 12-Sep-2018 15:30:25 - symb: One of matplotlib's codes for plot symbols: .:,o^v<>s+xDd234hH|_ build 12-Sep-2018 15:30:25 - default: ',': The smallest points I could find. build 12-Sep-2018 15:30:25 - maxnpts: Save memory and/or screen space by plotting a maximum of maxnpts build 12-Sep-2018 15:30:25 - (or all of them if maxnpts < 1). There is a very sharp build 12-Sep-2018 15:30:25 - slowdown if the plotter starts swapping. build 12-Sep-2018 15:30:25 - spw: spw selection string (ignores channel specifications for now). build 12-Sep-2018 15:30:25 - field: field selection string (for now, only 1 field will be plotted). build 12-Sep-2018 15:30:25 - antenna: antenna selection string (currently ignored). build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - casalog.origin('plotuv') build 12-Sep-2018 15:30:25 - casalog.post("Task plotuv has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - uvplotinfo = UVPlotInfo(vis, spw, field, antenna, observation, array, build 12-Sep-2018 15:30:25 - ncycles, colors, symb, figfile, maxnpts) build 12-Sep-2018 15:30:25 - except Exception, e: build 12-Sep-2018 15:30:25 - casalog.post("Error plotting the UVWs of %s:" % vis, 'SEVERE') build 12-Sep-2018 15:30:25 - casalog.post("%s" % e, 'SEVERE') build 12-Sep-2018 15:30:25 - return False build 12-Sep-2018 15:30:25 - retval = True build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - if len(uvplotinfo.selindices['field']) > 1: build 12-Sep-2018 15:30:25 - fldnav = NavField(uvplotinfo) build 12-Sep-2018 15:30:25 - #inprogress = fldnav.show() build 12-Sep-2018 15:30:25 - fldnav.next("dummy") build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - retval = plotfield(uvplotinfo.selindices['field'][0], uvplotinfo) build 12-Sep-2018 15:30:25 - except Exception, e: build 12-Sep-2018 15:30:25 - casalog.post("Error plotting the UVWs of %s:" % vis, 'SEVERE') build 12-Sep-2018 15:30:25 - casalog.post("%s" % e, 'SEVERE') build 12-Sep-2018 15:30:25 - return False build 12-Sep-2018 15:30:25 - return retval build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -class UVPlotInfo: build 12-Sep-2018 15:30:25 - """Gathers and holds info for a uv plot or set of them.""" build 12-Sep-2018 15:30:25 - def __init__(self, vis, spw, field, antenna, observation, array, build 12-Sep-2018 15:30:25 - ncycles, colors, symb, figfile, maxnpts): build 12-Sep-2018 15:30:25 - self.ncolors = ncycles * len(colors) build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - self.symbs = [c + symb for c in colors] build 12-Sep-2018 15:30:25 - except Exception, e: build 12-Sep-2018 15:30:25 - raise ValueError, "Exception %s forming the plot symbols out of %s and %s" % (e, colors, symb) build 12-Sep-2018 15:30:25 - self.nsymbs = len(self.symbs) build 12-Sep-2018 15:30:25 - self.maxnpts = maxnpts build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - self.figfile = figfile build 12-Sep-2018 15:30:25 - if figfile: build 12-Sep-2018 15:30:25 - figfileparts = figfile.split('.') build 12-Sep-2018 15:30:25 - self.ext = '.' + figfileparts[-1] build 12-Sep-2018 15:30:25 - self.figfile = '.'.join(figfileparts[:-1]) + '_fld' build 12-Sep-2018 15:30:25 - except Exception, e: build 12-Sep-2018 15:30:25 - raise ValueError, "Exception %s parsing figfile" % e build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = vis build 12-Sep-2018 15:30:25 - self.title = vis build 12-Sep-2018 15:30:25 - self.tb = tbtool() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Convert '' to '*' for ms.msseltoindex. build 12-Sep-2018 15:30:25 - if not spw: build 12-Sep-2018 15:30:25 - spw = '*' build 12-Sep-2018 15:30:25 - if not field: build 12-Sep-2018 15:30:25 - field = '*' build 12-Sep-2018 15:30:25 - if not antenna: build 12-Sep-2018 15:30:25 - antenna = '*' build 12-Sep-2018 15:30:25 - self.selindices = ms.msseltoindex(vis, field=field, spw=spw, build 12-Sep-2018 15:30:25 - baseline=antenna, build 12-Sep-2018 15:30:25 - observation=str(observation)) build 12-Sep-2018 15:30:25 - basequery = "" build 12-Sep-2018 15:30:25 - if observation: build 12-Sep-2018 15:30:25 - basequery += 'OBSERVATION_ID in %s' % self.selindices['obsids'] build 12-Sep-2018 15:30:25 - if antenna != '*': build 12-Sep-2018 15:30:25 - if basequery: build 12-Sep-2018 15:30:25 - basequery += ' and ' build 12-Sep-2018 15:30:25 - basequery += 'ANTENNA1 in [%s] and ANTENNA2 in [%s]' % ( build 12-Sep-2018 15:30:25 - ','.join(map(str, self.selindices['antenna1'])), build 12-Sep-2018 15:30:25 - ','.join(map(str, self.selindices['antenna2']))) build 12-Sep-2018 15:30:25 - if array: build 12-Sep-2018 15:30:25 - if basequery: build 12-Sep-2018 15:30:25 - basequery += ' and ' build 12-Sep-2018 15:30:25 - arrids = expand_tilde(array) build 12-Sep-2018 15:30:25 - basequery += 'ARRAY_ID in [%s]' % ','.join(map(str, arrids)) build 12-Sep-2018 15:30:25 - self.basequery = basequery build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - self.fldnames = {} build 12-Sep-2018 15:30:25 - self.listfield = False build 12-Sep-2018 15:30:25 - if field != '*' or len(self.selindices['field']) > 1: build 12-Sep-2018 15:30:25 - self.listfield = True build 12-Sep-2018 15:30:25 - self.tb.open(vis + '/FIELD') build 12-Sep-2018 15:30:25 - fldnamarr = self.tb.getcol('NAME') build 12-Sep-2018 15:30:25 - self.tb.close() build 12-Sep-2018 15:30:25 - for i in xrange(len(fldnamarr)): build 12-Sep-2018 15:30:25 - self.fldnames[i] = fldnamarr[i] build 12-Sep-2018 15:30:25 - self.subtitle = '' build 12-Sep-2018 15:30:25 - if spw != '*' or antenna != '*' or observation: build 12-Sep-2018 15:30:25 - subtitles = [] build 12-Sep-2018 15:30:25 - if spw != '*': build 12-Sep-2018 15:30:25 - subtitles.append("spw='%s'" % spw) build 12-Sep-2018 15:30:25 - if antenna != '*': build 12-Sep-2018 15:30:25 - subtitles.append("antenna='%s'" % antenna) build 12-Sep-2018 15:30:25 - if observation: build 12-Sep-2018 15:30:25 - subtitles.append("observation='%s'" % observation) build 12-Sep-2018 15:30:25 - self.subtitle = '(' + ', '.join(subtitles) + ')' build 12-Sep-2018 15:30:25 - except Exception, e: build 12-Sep-2018 15:30:25 - raise ValueError, "Exception %s parsing the selection." % e build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - self.tb.open(vis + '/SPECTRAL_WINDOW') build 12-Sep-2018 15:30:25 - self.chfs = self.tb.getvarcol('CHAN_FREQ') build 12-Sep-2018 15:30:25 - self.tb.close() build 12-Sep-2018 15:30:25 - self.nspw = len(self.chfs) build 12-Sep-2018 15:30:25 - if self.nspw > 1: build 12-Sep-2018 15:30:25 - # Bite the bullet now instead of while the main table is open. build 12-Sep-2018 15:30:25 - self.tb.open(vis + '/DATA_DESCRIPTION') build 12-Sep-2018 15:30:25 - self.dd_to_spw = self.tb.getcol('SPECTRAL_WINDOW_ID') build 12-Sep-2018 15:30:25 - self.tb.close() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - self.dd_to_spw = [0] build 12-Sep-2018 15:30:25 - except Exception, e: build 12-Sep-2018 15:30:25 - raise ValueError, "Exception %s getting the frequencies from %s" % (e, vis) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def plotfield(fld, uvplotinfo, debug=False): build 12-Sep-2018 15:30:25 - """Plot the selected baselines of fld.""" build 12-Sep-2018 15:30:25 - fldquery = uvplotinfo.basequery build 12-Sep-2018 15:30:25 - fldtitle = uvplotinfo.title build 12-Sep-2018 15:30:25 - if uvplotinfo.listfield: build 12-Sep-2018 15:30:25 - if fldquery: build 12-Sep-2018 15:30:25 - fldquery += ' and ' build 12-Sep-2018 15:30:25 - fldquery += 'FIELD_ID==' + str(fld) build 12-Sep-2018 15:30:25 - fldtitle += ', field %d (%s)' % (fld, uvplotinfo.fldnames[fld]) build 12-Sep-2018 15:30:25 - casalog.post('Plotting field %d (%s)' % (fld, uvplotinfo.fldnames[fld])) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Figure out how to divvy up the plotting among the frequencies. build 12-Sep-2018 15:30:25 - # I'm sure nested queries can be done, but I want to avoid temp tables build 12-Sep-2018 15:30:25 - # on disk. build 12-Sep-2018 15:30:25 - casalog.post('fldquery: ' + fldquery, 'DEBUG1') build 12-Sep-2018 15:30:25 - uvplotinfo.tb.open(uvplotinfo.vis) build 12-Sep-2018 15:30:25 - ftab = uvplotinfo.tb.query(fldquery, columns='DATA_DESC_ID') build 12-Sep-2018 15:30:25 - nbl = ftab.nrows() build 12-Sep-2018 15:30:25 - casalog.post("nbl: %d" % nbl, 'DEBUG1') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if uvplotinfo.nspw > 1: build 12-Sep-2018 15:30:25 - ddids = ftab.getcol('DATA_DESC_ID') build 12-Sep-2018 15:30:25 - usedddids = {} build 12-Sep-2018 15:30:25 - for d in ddids: build 12-Sep-2018 15:30:25 - if uvplotinfo.dd_to_spw[d] in uvplotinfo.selindices['spw']: build 12-Sep-2018 15:30:25 - usedddids[d] = uvplotinfo.dd_to_spw[d] build 12-Sep-2018 15:30:25 - ddids = list(usedddids.keys()) build 12-Sep-2018 15:30:25 - ddids.sort() build 12-Sep-2018 15:30:25 - usedspws = list(set(usedddids.values())) build 12-Sep-2018 15:30:25 - usedspws.sort() build 12-Sep-2018 15:30:25 - elif uvplotinfo.nspw == 1: build 12-Sep-2018 15:30:25 - ddids = [0] build 12-Sep-2018 15:30:25 - usedspws = [0] build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - ddids = [] build 12-Sep-2018 15:30:25 - usedspws = [] build 12-Sep-2018 15:30:25 - ftab.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if not ddids: build 12-Sep-2018 15:30:25 - casalog.post('Nothing selected for field %d' % fld) build 12-Sep-2018 15:30:25 - return False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - maxddid = ddids[-1] build 12-Sep-2018 15:30:25 - minddid = ddids[0] build 12-Sep-2018 15:30:25 - minmax = {} build 12-Sep-2018 15:30:25 - globminf = -1 build 12-Sep-2018 15:30:25 - globmaxf = -1 build 12-Sep-2018 15:30:25 - for s in usedspws: build 12-Sep-2018 15:30:25 - r = 'r' + str(s + 1) build 12-Sep-2018 15:30:25 - minf = uvplotinfo.chfs[r][0, 0] build 12-Sep-2018 15:30:25 - maxf = uvplotinfo.chfs[r][-1, 0] build 12-Sep-2018 15:30:25 - if maxf < minf: build 12-Sep-2018 15:30:25 - minf, maxf = maxf, minf build 12-Sep-2018 15:30:25 - minmax[s] = (minf, maxf) build 12-Sep-2018 15:30:25 - #print "minmax[s]:", minmax[s] build 12-Sep-2018 15:30:25 - if minf < globminf or globminf < 0.0: build 12-Sep-2018 15:30:25 - globminf = minf build 12-Sep-2018 15:30:25 - if maxf > globmaxf: build 12-Sep-2018 15:30:25 - globmaxf = maxf build 12-Sep-2018 15:30:25 - freqspan = globmaxf - globminf build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def colorind(f): build 12-Sep-2018 15:30:25 - if freqspan > 0: build 12-Sep-2018 15:30:25 - return min(int(uvplotinfo.ncolors * (f - globminf) / freqspan), build 12-Sep-2018 15:30:25 - uvplotinfo.ncolors - 1) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - return 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if uvplotinfo.maxnpts > 0 and nbl * (1 + colorind(globmaxf) - build 12-Sep-2018 15:30:25 - colorind(globminf)) > uvplotinfo.maxnpts: build 12-Sep-2018 15:30:25 - casalog.post( build 12-Sep-2018 15:30:25 - "Only plotting %d out of %d (scaled) baselines to conserve memory" % (uvplotinfo.maxnpts, build 12-Sep-2018 15:30:25 - nbl * (1 + colorind(globmaxf) - colorind(globminf))), build 12-Sep-2018 15:30:25 - 'WARN') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if fldquery: build 12-Sep-2018 15:30:25 - fldquery += ' and ' build 12-Sep-2018 15:30:25 - pl.ion() # Magic incantation to make the plot build 12-Sep-2018 15:30:25 - pl.clf() # window appear (and clear it). build 12-Sep-2018 15:30:25 - pl.ioff() build 12-Sep-2018 15:30:25 - for d in ddids: build 12-Sep-2018 15:30:25 - #print "minmax[%d] = %s" % (d, minmax[d]) build 12-Sep-2018 15:30:25 - s = uvplotinfo.dd_to_spw[d] build 12-Sep-2018 15:30:25 - maxci = colorind(minmax[s][1]) build 12-Sep-2018 15:30:25 - minci = colorind(minmax[s][0]) build 12-Sep-2018 15:30:25 - ncolsspanned = 1 + maxci - minci build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Get the subset of UVW that will be plotted for this spw. build 12-Sep-2018 15:30:25 - st = uvplotinfo.tb.query(fldquery + 'DATA_DESC_ID==' + str(d), columns='UVW') build 12-Sep-2018 15:30:25 - snbl = st.nrows() build 12-Sep-2018 15:30:25 - #print "snbl:", snbl build 12-Sep-2018 15:30:25 - if snbl > 0: build 12-Sep-2018 15:30:25 - uvw = 0.001 * st.getcol('UVW') build 12-Sep-2018 15:30:25 - st.close() build 12-Sep-2018 15:30:25 - if uvplotinfo.maxnpts > 0: build 12-Sep-2018 15:30:25 - ntoplot = (uvplotinfo.maxnpts * snbl) / (nbl * ncolsspanned) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - ntoplot = snbl build 12-Sep-2018 15:30:25 - if ntoplot < snbl: build 12-Sep-2018 15:30:25 - uvinds = [((snbl - 1) * uvi) / (ntoplot - 1) for uvi in xrange(ntoplot)] build 12-Sep-2018 15:30:25 - casalog.post("(max, min)(uvinds) = %g, %g" % (max(uvinds), min(uvinds)), build 12-Sep-2018 15:30:25 - 'DEBUG1') build 12-Sep-2018 15:30:25 - casalog.post("len(uvw[0]) = %d" % len(uvw[0]), 'DEBUG1') build 12-Sep-2018 15:30:25 - u = uvw[0, uvinds] build 12-Sep-2018 15:30:25 - v = uvw[1, uvinds] build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - u = uvw[0, :] build 12-Sep-2018 15:30:25 - v = uvw[1, :] build 12-Sep-2018 15:30:25 - del uvw build 12-Sep-2018 15:30:25 - casalog.post('len(u) = %d' % len(u), 'DEBUG1') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - freqspread = minmax[s][1] - minmax[s][0] build 12-Sep-2018 15:30:25 - # It'd be easier to just divide the frequency range by ncolors, but those build 12-Sep-2018 15:30:25 - # frequencies might not land on real channels. build 12-Sep-2018 15:30:25 - chfkey = 'r' + str(s + 1) build 12-Sep-2018 15:30:25 - nchans = uvplotinfo.chfs[chfkey].shape[0] build 12-Sep-2018 15:30:25 - casalog.post("nchans: %d" % nchans, 'DEBUG1') build 12-Sep-2018 15:30:25 - if ncolsspanned > 1: build 12-Sep-2018 15:30:25 - cinds = [((nchans - 1) * c) / (ncolsspanned - 1) for c in build 12-Sep-2018 15:30:25 - xrange(ncolsspanned)] build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - cinds = [nchans / 2] build 12-Sep-2018 15:30:25 - wvlngths = 2.9978e8 / uvplotinfo.chfs[chfkey].flatten()[cinds] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # All this fussing with permutations and sieves is to give all the build 12-Sep-2018 15:30:25 - # frequencies a chance at being seen, at least in the case of a build 12-Sep-2018 15:30:25 - # single spw. This way a channel will only blot out the plot where build 12-Sep-2018 15:30:25 - # either it really does have a much higher density than the others build 12-Sep-2018 15:30:25 - # or all the channels overlap. build 12-Sep-2018 15:30:25 - perm = pl.array(range(ncolsspanned - 1, -1, -1)) build 12-Sep-2018 15:30:25 - if debug: build 12-Sep-2018 15:30:25 - print "****s:", s build 12-Sep-2018 15:30:25 - print "perm:", perm build 12-Sep-2018 15:30:25 - print "ntoplot:", ntoplot build 12-Sep-2018 15:30:25 - print "ncolsspanned:", ncolsspanned build 12-Sep-2018 15:30:25 - print "minci:", minci build 12-Sep-2018 15:30:25 - for si in perm: build 12-Sep-2018 15:30:25 - if debug: build 12-Sep-2018 15:30:25 - print '(perm + si) % ncolsspanned =', (perm + si) % ncolsspanned build 12-Sep-2018 15:30:25 - for ci in (perm + si) % ncolsspanned: build 12-Sep-2018 15:30:25 - symb = uvplotinfo.symbs[(ci + minci) % uvplotinfo.nsymbs] build 12-Sep-2018 15:30:25 - wvlngth = wvlngths[ci] build 12-Sep-2018 15:30:25 - #casalog.post("spw %d, lambda: %g" % (s, wvlngth), 'DEBUG1') build 12-Sep-2018 15:30:25 - casalog.post( build 12-Sep-2018 15:30:25 - "d %d, spw %d, si %d, ntoplot %d, ncolsspanned %d, symb %s" % build 12-Sep-2018 15:30:25 - (d, s, si, ntoplot, ncolsspanned, symb), 'DEBUG1') build 12-Sep-2018 15:30:25 - pl.plot( u[si:ntoplot:ncolsspanned] / wvlngth, build 12-Sep-2018 15:30:25 - v[si:ntoplot:ncolsspanned] / wvlngth, symb) build 12-Sep-2018 15:30:25 - pl.plot(-u[si:ntoplot:ncolsspanned] / wvlngth, build 12-Sep-2018 15:30:25 - -v[si:ntoplot:ncolsspanned] / wvlngth, symb) build 12-Sep-2018 15:30:25 - casalog.post('plotted baselines both ways', 'DEBUG1') build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - st.close() build 12-Sep-2018 15:30:25 - uvplotinfo.tb.close() build 12-Sep-2018 15:30:25 - casalog.post('Scaling axes', 'DEBUG1') build 12-Sep-2018 15:30:25 - pl.axis('equal') build 12-Sep-2018 15:30:25 - pl.axis('scaled') build 12-Sep-2018 15:30:25 - pl.xlabel('u (k$\lambda$)') build 12-Sep-2018 15:30:25 - pl.ylabel('v (k$\lambda$)') build 12-Sep-2018 15:30:25 - if uvplotinfo.subtitle: build 12-Sep-2018 15:30:25 - pl.suptitle(fldtitle, fontsize=14) build 12-Sep-2018 15:30:25 - pl.title(uvplotinfo.subtitle, fontsize=10) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - pl.title(fldtitle) build 12-Sep-2018 15:30:25 - if uvplotinfo.figfile: build 12-Sep-2018 15:30:25 - pl.savefig(uvplotinfo.figfile + str(fld) + uvplotinfo.ext) build 12-Sep-2018 15:30:25 - pl.draw() build 12-Sep-2018 15:30:25 - pl.ion() build 12-Sep-2018 15:30:25 - return True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -class NavField: build 12-Sep-2018 15:30:25 - def __init__(self, pltinfo): build 12-Sep-2018 15:30:25 - self.fld = -1 build 12-Sep-2018 15:30:25 - self.nflds = len(pltinfo.selindices['field']) build 12-Sep-2018 15:30:25 - self.pltinfo = pltinfo build 12-Sep-2018 15:30:25 - prevwidth = 0.13 build 12-Sep-2018 15:30:25 - nextwidth = 0.12 build 12-Sep-2018 15:30:25 - butheight = 0.05 build 12-Sep-2018 15:30:25 - butleft = 0.7 build 12-Sep-2018 15:30:25 - butbot = 0.025 build 12-Sep-2018 15:30:25 - butgap = 0.5 * butbot build 12-Sep-2018 15:30:25 - self.nextloc = [butleft + prevwidth + butgap, build 12-Sep-2018 15:30:25 - butbot, nextwidth, butheight] build 12-Sep-2018 15:30:25 - self.prevloc = [butleft, butbot, prevwidth, butheight] build 12-Sep-2018 15:30:25 - self.inactivecolor = '#99aaff' build 12-Sep-2018 15:30:25 - self.activecolor = '#aaffcc' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def _draw_buts(self): build 12-Sep-2018 15:30:25 - if self.fld < self.nflds - 1: build 12-Sep-2018 15:30:25 - axnext = pl.axes(self.nextloc) build 12-Sep-2018 15:30:25 - self.bnext = Button(axnext, 'Next fld >', build 12-Sep-2018 15:30:25 - color=self.inactivecolor, build 12-Sep-2018 15:30:25 - hovercolor=self.activecolor) build 12-Sep-2018 15:30:25 - self.bnext.on_clicked(self.next) build 12-Sep-2018 15:30:25 - if self.fld > 0: build 12-Sep-2018 15:30:25 - axprev = pl.axes(self.prevloc) build 12-Sep-2018 15:30:25 - self.bprev = Button(axprev, '< Prev fld', build 12-Sep-2018 15:30:25 - color=self.inactivecolor, build 12-Sep-2018 15:30:25 - hovercolor=self.activecolor) build 12-Sep-2018 15:30:25 - self.bprev.on_clicked(self.prev) build 12-Sep-2018 15:30:25 - #pl.show() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def _do_plot(self): build 12-Sep-2018 15:30:25 - didplot = plotfield(self.pltinfo.selindices['field'][self.fld], build 12-Sep-2018 15:30:25 - self.pltinfo) build 12-Sep-2018 15:30:25 - if didplot: build 12-Sep-2018 15:30:25 - self._draw_buts() build 12-Sep-2018 15:30:25 - return didplot build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def next(self, event): build 12-Sep-2018 15:30:25 - didplot = False build 12-Sep-2018 15:30:25 - startfld = self.fld build 12-Sep-2018 15:30:25 - while self.fld < self.nflds - 1 and not didplot: build 12-Sep-2018 15:30:25 - self.fld += 1 build 12-Sep-2018 15:30:25 - didplot = self._do_plot() build 12-Sep-2018 15:30:25 - if not didplot: build 12-Sep-2018 15:30:25 - print "You are on the last field with any selected baselines." build 12-Sep-2018 15:30:25 - self.fld = startfld build 12-Sep-2018 15:30:25 - #plotfield(self.pltinfo.selindices['field'][self.fld], build 12-Sep-2018 15:30:25 - # self.pltinfo, self.mytb) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def prev(self, event): build 12-Sep-2018 15:30:25 - didplot = False build 12-Sep-2018 15:30:25 - startfld = self.fld build 12-Sep-2018 15:30:25 - while self.fld > 0 and not didplot: build 12-Sep-2018 15:30:25 - self.fld -= 1 build 12-Sep-2018 15:30:25 - didplot = self._do_plot() build 12-Sep-2018 15:30:25 - if not didplot: build 12-Sep-2018 15:30:25 - print "You are on the first field with any selected baselines." build 12-Sep-2018 15:30:25 - self.fld = startfld build 12-Sep-2018 15:30:25 - #plotfield(self.pltinfo.selindices['field'][self.fld], build 12-Sep-2018 15:30:25 - # self.pltinfo, self.mytb) build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_plotxy.py b/gcwrap/python/scripts/task_plotxy.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index d78a6bf..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_plotxy.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,564 +0,0 @@ build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -import time build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def plotxy(vis=None,xaxis=None,yaxis=None,datacolumn=None,iteration=None, build 12-Sep-2018 15:30:25 - selectdata=None,antenna=None,spw=None,field=None,uvrange=None, build 12-Sep-2018 15:30:25 - timerange=None,correlation=None,scan=None,feed=None,array=None, build 12-Sep-2018 15:30:25 - averagemode=None,width=None,timebin=None,crossscans=None, build 12-Sep-2018 15:30:25 - crossbls=None,crossarrays=None,stackspw=None, build 12-Sep-2018 15:30:25 - restfreq=None,frame=None,doppler=None, build 12-Sep-2018 15:30:25 - extendflag=None,extendcorr=None,extendchan=None,extendspw=None, build 12-Sep-2018 15:30:25 - extendant=None,extendtime=None, build 12-Sep-2018 15:30:25 - subplot=None,plotsymbol=None,plotcolor=None, build 12-Sep-2018 15:30:25 - markersize=None,linewidth=None, build 12-Sep-2018 15:30:25 - plotrange=None,multicolor=None, build 12-Sep-2018 15:30:25 - selectplot=None,overplot=None,newplot=None,clearpanel=None, build 12-Sep-2018 15:30:25 - skipnrows=None,title=None,xlabels=None,ylabels=None, build 12-Sep-2018 15:30:25 - fontsize=None,windowsize=None, build 12-Sep-2018 15:30:25 - showflags=None,interactive=None,figfile=None,end=None): build 12-Sep-2018 15:30:25 - """An X-Y plotter/interactive flagger for visibility data. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Selected data can be flexibly plotted with a wide variety of build 12-Sep-2018 15:30:25 - axes options and averaging options. Data may be listed, flagged or build 12-Sep-2018 15:30:25 - unflagged interactively. The plots can be zoomed and sent to build 12-Sep-2018 15:30:25 - af file. Data can be iterated through antennas and fields build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - It is advisable to run flagmanager before using plotxy in build 12-Sep-2018 15:30:25 - order to save the current flag state before altering: build 12-Sep-2018 15:30:25 - flagmanager(vis='vis_name',mode='save',versionname='before_plotxy', build 12-Sep-2018 15:30:25 - comment=versionname) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file build 12-Sep-2018 15:30:25 - default: none. example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - xaxis -- Visibility file data to plot along the x-axis build 12-Sep-2018 15:30:25 - default: 'time' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Options for BOTH x-axis and y-axis build 12-Sep-2018 15:30:25 - 'time','uvdist','chan','corr','freq','velo', build 12-Sep-2018 15:30:25 - 'u','v','w', build 12-Sep-2018 15:30:25 - 'azimuth','elevation','baseline','hourangle','parallacticangle' build 12-Sep-2018 15:30:25 - 'amp','phase','real','imag','weight'. 'x' gives antenna array build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - yaxis -- Visibility data to plot along the y-axis build 12-Sep-2018 15:30:25 - default: 'amp' build 12-Sep-2018 15:30:25 - Options: same as on xaxis: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - >>> yaxis expandable parameter build 12-Sep-2018 15:30:25 - datacolumn -- Visibility file data column build 12-Sep-2018 15:30:25 - Note: this parameter is automatically shown whenever the build 12-Sep-2018 15:30:25 - chosen yaxis is a data quantity (i.e. amp) build 12-Sep-2018 15:30:25 - default: 'data'; example: datacolumn='model' build 12-Sep-2018 15:30:25 - Options: 'data' (raw),'corrected','model','residual'(corrected-model) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - --- Data Selection (see help par.selectdata for more detailed information) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - field -- Select field using field id(s) or field name(s). build 12-Sep-2018 15:30:25 - ['go listobs' to obtain the list id's or names] build 12-Sep-2018 15:30:25 - default: ''=all fields build 12-Sep-2018 15:30:25 - If field string is a non-negative integer, it is assumed to build 12-Sep-2018 15:30:25 - be a field index otherwise, it is assumed to be a field name build 12-Sep-2018 15:30:25 - field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 - field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 - field='3C286,3C295'; field named 3C286 and 3C295 build 12-Sep-2018 15:30:25 - field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 - spw -- Select spectral window/channels build 12-Sep-2018 15:30:25 - spw='0~2,4'; spectral windows 0,1,2,4 (all channels) build 12-Sep-2018 15:30:25 - spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 - spw='0:5~61'; spw 0, channels 5 to 61, INCLUSIVE build 12-Sep-2018 15:30:25 - spw='*:5~61'; all spw with channels 5 to 61 build 12-Sep-2018 15:30:25 - spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, channels 3 to 45. build 12-Sep-2018 15:30:25 - spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. build 12-Sep-2018 15:30:25 - spw='0:0~10;15~60'; spectral window 0 with channels 0-10,15-60 build 12-Sep-2018 15:30:25 - NOTE ';' to separate channel selections build 12-Sep-2018 15:30:25 - spw='0:0~10^2,1:20~30^5'; spw 0, channels 0,2,4,6,8,10, build 12-Sep-2018 15:30:25 - spw 1, channels 20,25,30 build 12-Sep-2018 15:30:25 - selectdata -- Other data selection parameters build 12-Sep-2018 15:30:25 - default: True build 12-Sep-2018 15:30:25 - >>> selectdata expandable parameters build 12-Sep-2018 15:30:25 - timerange -- Select data based on time range: build 12-Sep-2018 15:30:25 - default = '' (all); examples, build 12-Sep-2018 15:30:25 - timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss' build 12-Sep-2018 15:30:25 - Note: if YYYY/MM/DD is missing date defaults to first day in data set build 12-Sep-2018 15:30:25 - timerange='09:14:0~09:54:0' picks 40 min on first day build 12-Sep-2018 15:30:25 - timerange= '25:00:00~27:30:00' picks 1 hr to 3 hr 30min on next day build 12-Sep-2018 15:30:25 - timerange='09:44:00' data within one integration of time build 12-Sep-2018 15:30:25 - timerange='>10:24:00' data after this time build 12-Sep-2018 15:30:25 - antenna -- Select data based on antenna/baseline build 12-Sep-2018 15:30:25 - default: ''=all build 12-Sep-2018 15:30:25 - If antenna string is a non-negative integer, it is assumed build 12-Sep-2018 15:30:25 - to be an antenna index, otherwise it is assumed to be an build 12-Sep-2018 15:30:25 - antenna name build 12-Sep-2018 15:30:25 - antenna='5&6'; baseline between antenna index 5 and index 6. build 12-Sep-2018 15:30:25 - antenna='VA05&VA06'; baseline between VLA antenna 5 and 6. build 12-Sep-2018 15:30:25 - antenna='5&6;7&8'; baseline 5-6 and 7-8 build 12-Sep-2018 15:30:25 - antenna='5'; all baselines with antenna index 5 build 12-Sep-2018 15:30:25 - antenna= '05'; all baselines with antenna named 05 build 12-Sep-2018 15:30:25 - antenna='5,6,10'; all baselines with antennas 5,6 and 10 build 12-Sep-2018 15:30:25 - correlation -- Select correlations: build 12-Sep-2018 15:30:25 - default: '' = all correlations. Other options are any combination build 12-Sep-2018 15:30:25 - of values from one of the valid lists: build 12-Sep-2018 15:30:25 - 'RR','LL','RL','LR','RR LL','RL LR', build 12-Sep-2018 15:30:25 - 'XX','YY','XY','YX','XX YY','XY YX' build 12-Sep-2018 15:30:25 - uvrange -- Select data within uvrange (default units meters) build 12-Sep-2018 15:30:25 - default: ''=all; example: build 12-Sep-2018 15:30:25 - uvrange='0~1000klambda'; uvrange from 0-1000 kilo-lambda build 12-Sep-2018 15:30:25 - uvrange='>4klambda';uvranges greater than 4 kilo-lambda build 12-Sep-2018 15:30:25 - uvrange='0~1000km'; uvrange in kilometers build 12-Sep-2018 15:30:25 - scan -- Scan number range build 12-Sep-2018 15:30:25 - array -- Array number range - under development build 12-Sep-2018 15:30:25 - feed -- Multi-feed number range - under development build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - averagemode -- Select average mode build 12-Sep-2018 15:30:25 - default: 'vector' build 12-Sep-2018 15:30:25 - Options: 'vector' = average over real and image part separately. build 12-Sep-2018 15:30:25 - 'scalar' = scalar average of amplitude, vector build 12-Sep-2018 15:30:25 - average of the phase. build 12-Sep-2018 15:30:25 - '' = no averaging build 12-Sep-2018 15:30:25 - >>> averagemode expandable parameters build 12-Sep-2018 15:30:25 - timebin -- length of time intervals to average build 12-Sep-2018 15:30:25 - default: '0'= no time averaging build 12-Sep-2018 15:30:25 - example: timebin='60' (average over 60 seconds interval). build 12-Sep-2018 15:30:25 - crossscans -- Have time averaging cross scan boundaries build 12-Sep-2018 15:30:25 - default: False=time averaging does not cross scan boundaries build 12-Sep-2018 15:30:25 - crossbls -- Have averaging cross baseline boundaries build 12-Sep-2018 15:30:25 - default: False=averaging does not cross baseline boundaries build 12-Sep-2018 15:30:25 - crossarrays -- Have averaging cross array ids build 12-Sep-2018 15:30:25 - default: False=averaging does not cross array ids build 12-Sep-2018 15:30:25 - width -- number of channels to average build 12-Sep-2018 15:30:25 - default: '1'= no channel averaging build 12-Sep-2018 15:30:25 - example: width='32' (average 32 channels together). build 12-Sep-2018 15:30:25 - stackspw -- whether stack the spw on top of each other (for xaxis='chan') build 12-Sep-2018 15:30:25 - default: False=layout spw side by side build 12-Sep-2018 15:30:25 - extendflag -- Have flagging extend to other points build 12-Sep-2018 15:30:25 - default: '' = no extension, flag only selected data points build 12-Sep-2018 15:30:25 - >>> extendflag expandable parameters build 12-Sep-2018 15:30:25 - extendcorr -- Extend flagging based on correlation: build 12-Sep-2018 15:30:25 - default: ''= no correlation based extension build 12-Sep-2018 15:30:25 - examples: build 12-Sep-2018 15:30:25 - extendcorr = 'all' build 12-Sep-2018 15:30:25 - extendcorr = 'half' build 12-Sep-2018 15:30:25 - extendchan -- Extend flagging based on channel: build 12-Sep-2018 15:30:25 - default: ''= no channel based extension build 12-Sep-2018 15:30:25 - example: build 12-Sep-2018 15:30:25 - extendchan = 'all' build 12-Sep-2018 15:30:25 - extendspw -- Extend flagging based on spectral window: build 12-Sep-2018 15:30:25 - default: ''= no spectral window based extension build 12-Sep-2018 15:30:25 - example: build 12-Sep-2018 15:30:25 - extendspw = 'all' build 12-Sep-2018 15:30:25 - extendant -- Extend flagging based on antenna (baseline): build 12-Sep-2018 15:30:25 - default: ''= no antenna based extension build 12-Sep-2018 15:30:25 - example: build 12-Sep-2018 15:30:25 - extendant = 'all' build 12-Sep-2018 15:30:25 - extendtime -- Extend flagging based on time: build 12-Sep-2018 15:30:25 - default: ''= no time based extension build 12-Sep-2018 15:30:25 - example: build 12-Sep-2018 15:30:25 - extendtime = 'all' build 12-Sep-2018 15:30:25 - subplot -- Panel number on the display screen build 12-Sep-2018 15:30:25 - default: 111 (full screen display); example: build 12-Sep-2018 15:30:25 - if iteration is non-blank, then build 12-Sep-2018 15:30:25 - subplot=yx1 window will produce y by x plots in the window. build 12-Sep-2018 15:30:25 - if iteration = '', then build 12-Sep-2018 15:30:25 - subplot=yxn; means the window will have y rows, and x columns build 12-Sep-2018 15:30:25 - with the present execution placing the plot in location n build 12-Sep-2018 15:30:25 - n = 1,..., xy, in order upper left to right, then down. An build 12-Sep-2018 15:30:25 - example is the plotting of four fields on one frame build 12-Sep-2018 15:30:25 - field='0'; subplot=221; plotxy() build 12-Sep-2018 15:30:25 - field='1'; subplot=222; plotxy() build 12-Sep-2018 15:30:25 - field='2'; subplot=223; plotxy() build 12-Sep-2018 15:30:25 - field='3'; subplot=224; plotxy() build 12-Sep-2018 15:30:25 - overplot -- Overplot these values on current plot (if possible) build 12-Sep-2018 15:30:25 - default: False; example: overplot= True build 12-Sep-2018 15:30:25 - showflags -- Show the flagged and unflagged data. build 12-Sep-2018 15:30:25 - default: False; example: showflags=True build 12-Sep-2018 15:30:25 - iteration -- Iterate plots: build 12-Sep-2018 15:30:25 - default: ''; no iteration build 12-Sep-2018 15:30:25 - Options: 'field', 'antenna', 'baseline'. build 12-Sep-2018 15:30:25 - Use the 'NEXT' button on gui to iterate through values. build 12-Sep-2018 15:30:25 - To abort an iteration, close the gui window. build 12-Sep-2018 15:30:25 - plotsymbol -- plot symbol. (One of the .:,o^v<>s+xDd234hH|_ or build 12-Sep-2018 15:30:25 - optionally preceded by one of color code k, r, g, b, c, y) build 12-Sep-2018 15:30:25 - default: '.': points, medium-sized dots build 12-Sep-2018 15:30:25 - example: plotsymbol='bo' (blue points, large-sized dots build 12-Sep-2018 15:30:25 - r=red, b=blue, g=green, y=yellow build 12-Sep-2018 15:30:25 - ',' = small points build 12-Sep-2018 15:30:25 - '.' = medium points build 12-Sep-2018 15:30:25 - 'o' = large points build 12-Sep-2018 15:30:25 - plotcolor -- pylab color. Overrides plotsymbol color settings. build 12-Sep-2018 15:30:25 - default: 'darkcyan' build 12-Sep-2018 15:30:25 - example: plotcolor='g' (green) build 12-Sep-2018 15:30:25 - plotcolor='slateblue' build 12-Sep-2018 15:30:25 - plotcolor='#7FFF34' (RGB tuple) build 12-Sep-2018 15:30:25 - multicolor -- Multi-color plotting of channels and correlations build 12-Sep-2018 15:30:25 - options: 'none','both','chan','corr' build 12-Sep-2018 15:30:25 - default: 'corr'; example: multicolor='chan' build 12-Sep-2018 15:30:25 - plotrange -- Specifies the size of the plot [xmin, xmax, ymin, ymax] build 12-Sep-2018 15:30:25 - default: [0,0,0,0]; Range is self-selected build 12-Sep-2018 15:30:25 - example: [0,0,0.00,0.20] only y axis is specified build 12-Sep-2018 15:30:25 - To use a time range (NOTE: somewhat different sytax from timerange build 12-Sep-2018 15:30:25 - ['22:23:24, 23:42:20', 0.02, 0.20] build 12-Sep-2018 15:30:25 - The day must be included if the visibility data span more than one day build 12-Sep-2018 15:30:25 - ['1997/05/09/22:02:00, 1997/05/09/23:00:00', 0.02, 0.20] build 12-Sep-2018 15:30:25 - selectplot -- Additional plot control parameters build 12-Sep-2018 15:30:25 - default: False; example: selectplot=true build 12-Sep-2018 15:30:25 - >>> selectplot expandable parameters build 12-Sep-2018 15:30:25 - markersize -- Size of the plotted marks build 12-Sep-2018 15:30:25 - default: 5.0; example: markersize=10.0 build 12-Sep-2018 15:30:25 - linewidth -- Width of plotted lines. build 12-Sep-2018 15:30:25 - default: 1; example: linewidth=2.0 build 12-Sep-2018 15:30:25 - skipnrows -- # of points to skip build 12-Sep-2018 15:30:25 - default: 0 build 12-Sep-2018 15:30:25 - example: skipnrows=100 (plots every 100th point) build 12-Sep-2018 15:30:25 - newplot -- When overplotting, replace the last plot only build 12-Sep-2018 15:30:25 - default: False; can be useful when doing subplots build 12-Sep-2018 15:30:25 - clearpanel -- Clear nothing on the plot window, automatically build 12-Sep-2018 15:30:25 - clear plotting area, clear the current plot area, or build 12-Sep-2018 15:30:25 - clear the whole plot panel. build 12-Sep-2018 15:30:25 - options: None, Auto, Current, All build 12-Sep-2018 15:30:25 - default: Auto build 12-Sep-2018 15:30:25 - example: clearpanel='Current' build 12-Sep-2018 15:30:25 - title -- Plot title (above plot) build 12-Sep-2018 15:30:25 - default: ''; example: title='This is my title' build 12-Sep-2018 15:30:25 - xlabels -- Label for x axis build 12-Sep-2018 15:30:25 - default: ''; example: xlabels='X Axis' build 12-Sep-2018 15:30:25 - ylabels -- Label for y axis build 12-Sep-2018 15:30:25 - default: ''; example: ylabels='Y Axis' build 12-Sep-2018 15:30:25 - fontsize -- Font size for labels build 12-Sep-2018 15:30:25 - default: 10; example: fontsize=2 build 12-Sep-2018 15:30:25 - windowsize -- Window size build 12-Sep-2018 15:30:25 - default: 1.0; not yet implemented build 12-Sep-2018 15:30:25 - interactive -- turn on/off on screen display build 12-Sep-2018 15:30:25 - options: True = interactively flag data build 12-Sep-2018 15:30:25 - False = direct output to a file without on screen display build 12-Sep-2018 15:30:25 - default: True; build 12-Sep-2018 15:30:25 - figfile -- File name to save the plotted figure to. build 12-Sep-2018 15:30:25 - default: ''; example figfile=myPlot.png build 12-Sep-2018 15:30:25 - end -- Finish plotting? build 12-Sep-2018 15:30:25 - default: False; example end=True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if end: build 12-Sep-2018 15:30:25 - tp.setgui(False) build 12-Sep-2018 15:30:25 - mp.done() build 12-Sep-2018 15:30:25 - return True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.origin('plotxy') build 12-Sep-2018 15:30:25 - casalog.post("Task plotxy has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - startTime=time.time() build 12-Sep-2018 15:30:25 - startProc=time.clock() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #Python script build 12-Sep-2018 15:30:25 - #parameter_printvalues(arg_names,arg_values,arg_types) build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - # Turn the display of the plot GUI on or off build 12-Sep-2018 15:30:25 - tp.setgui( interactive ); build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if (xaxis.lower()=='velocity' or xaxis.lower()=='vel'): build 12-Sep-2018 15:30:25 - xaxis='velo' build 12-Sep-2018 15:30:25 - if (yaxis.lower()=='velocity' or yaxis.lower()=='vel'): build 12-Sep-2018 15:30:25 - yaxis='velo' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - doVel=False build 12-Sep-2018 15:30:25 - if (xaxis.lower()=='velo' or xaxis.lower()=='velo'): build 12-Sep-2018 15:30:25 - doVel=True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if ((type(vis)==str) & (os.path.exists(vis))): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #Users requested to remove this because it would build 12-Sep-2018 15:30:25 - #take too much time (in particular for large ms). build 12-Sep-2018 15:30:25 - #Originally, plotxy average would report exception build 12-Sep-2018 15:30:25 - #('could not add a column') if a scratch column was build 12-Sep-2018 15:30:25 - #corrupted. This happend mostly in the early alma/atf build 12-Sep-2018 15:30:25 - #test data. It adviced user to run 'clearcal' to build 12-Sep-2018 15:30:25 - #get rid of the corrupted column. The cb.open will build 12-Sep-2018 15:30:25 - #add scratch columns if missing. It did not repair build 12-Sep-2018 15:30:25 - #the corrupted columns. build 12-Sep-2018 15:30:25 - #this change will not go beyond active. (6/19/09) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #again, we put this back, because some external build 12-Sep-2018 15:30:25 - #people want to use interval devel. They want this. build 12-Sep-2018 15:30:25 - #casalog.post('Adding scratch columns, if necessary.') build 12-Sep-2018 15:30:25 - cb.open(vis) build 12-Sep-2018 15:30:25 - cb.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mp.open(vis, doVel, restfreq, frame, doppler) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - raise Exception, 'Visibility data set not found - please verify the name' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # If the user wants the plot window cleared then clear it. build 12-Sep-2018 15:30:25 - removeoldplots=False build 12-Sep-2018 15:30:25 - if ( clearpanel.lower()=='current' ) : build 12-Sep-2018 15:30:25 - mp.clearplot( subplot=subplot ); build 12-Sep-2018 15:30:25 - elif ( clearpanel.lower()=='all' ) : build 12-Sep-2018 15:30:25 - mp.clearplot(); build 12-Sep-2018 15:30:25 - elif ( clearpanel.lower()=='auto' ) : build 12-Sep-2018 15:30:25 - removeoldplots=True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #print 'xaxis=', xaxis build 12-Sep-2018 15:30:25 - if (xaxis.lower()=='frequency'): build 12-Sep-2018 15:30:25 - xaxis='freq' build 12-Sep-2018 15:30:25 - if (yaxis.lower()=='frequency'): build 12-Sep-2018 15:30:25 - yaxis='freq' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if (xaxis.lower()=='channel'): build 12-Sep-2018 15:30:25 - xaxis='chan' build 12-Sep-2018 15:30:25 - if (yaxis.lower()=='channel'): build 12-Sep-2018 15:30:25 - yaxis='chan' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if (multicolor.lower()=='channel'): build 12-Sep-2018 15:30:25 - multicolor='chan' build 12-Sep-2018 15:30:25 - if (multicolor.lower()=='correlation'): build 12-Sep-2018 15:30:25 - multicolor='corr' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #if (connect.lower()=='channel'): build 12-Sep-2018 15:30:25 - # connect='chan' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - timeaxis= ['azimuth','elevation','baseline','hourangle', build 12-Sep-2018 15:30:25 - 'parallacticangle','time'] build 12-Sep-2018 15:30:25 - xtime=False build 12-Sep-2018 15:30:25 - ytime=False build 12-Sep-2018 15:30:25 - for t in range(len(timeaxis)): build 12-Sep-2018 15:30:25 - if (xaxis.lower()==timeaxis[t]): build 12-Sep-2018 15:30:25 - xtime=True build 12-Sep-2018 15:30:25 - if (yaxis.lower()==timeaxis[t]): build 12-Sep-2018 15:30:25 - ytime=True build 12-Sep-2018 15:30:25 - if (xtime and ytime): build 12-Sep-2018 15:30:25 - raise Exception, 'Sorry. it cannot plot '+yaxis+' vs. '+xaxis build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #if (xaxis=='chan' and connect=='chan'): build 12-Sep-2018 15:30:25 - # connect='none' build 12-Sep-2018 15:30:25 - #if (xaxis=='time' and connect=='time'): build 12-Sep-2018 15:30:25 - # connect='none' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Handle the plotrange option making sure each value it build 12-Sep-2018 15:30:25 - # a string value. Note that msplot_cmpt expect a single build 12-Sep-2018 15:30:25 - # string of the form: 'xmin,xmax,ymin,ymax' where each build 12-Sep-2018 15:30:25 - # of the values can be a double or a time string. build 12-Sep-2018 15:30:25 - plotrange_l='' build 12-Sep-2018 15:30:25 - if ( isinstance( plotrange, list ) ) : build 12-Sep-2018 15:30:25 - for j in range( 0, len( plotrange ) ) : build 12-Sep-2018 15:30:25 - if ( j > 0 ) : build 12-Sep-2018 15:30:25 - plotrange_l = plotrange_l + ","; build 12-Sep-2018 15:30:25 - plotrange_l = plotrange_l + str( plotrange[j] ); build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - plotrange_l = plotrange; build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #print "INFO2 extendflag="+str(extendflag)+" corr="+ \ build 12-Sep-2018 15:30:25 - # extendcorr+" chan="+extendchan+" spw="+ \ build 12-Sep-2018 15:30:25 - # extendspw+" ant="+extendant+" time="+ \ build 12-Sep-2018 15:30:25 - # extendtime build 12-Sep-2018 15:30:25 - # print "INFO2 Extended Flagging Selected" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - flagextend='' build 12-Sep-2018 15:30:25 - #do extendflag in the TablePlot build 12-Sep-2018 15:30:25 - #if (extendcorr.lower().find('all') >= 0): build 12-Sep-2018 15:30:25 - # flagextend += 'P' build 12-Sep-2018 15:30:25 - #if (extendchan.lower().find('all') >= 0): build 12-Sep-2018 15:30:25 - # flagextend += 'C' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #do extendflag in the MsPlot build 12-Sep-2018 15:30:25 - if (extendflag): build 12-Sep-2018 15:30:25 - flagextend='True' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #connect='none' build 12-Sep-2018 15:30:25 - ok=mp.plotoptions(subplot=subplot,plotsymbol=plotsymbol, build 12-Sep-2018 15:30:25 - plotcolor=plotcolor,multicolor=multicolor, build 12-Sep-2018 15:30:25 - markersize=markersize,linewidth=linewidth, build 12-Sep-2018 15:30:25 - #connect=connect, build 12-Sep-2018 15:30:25 - overplot=overplot,replacetopplot=newplot, build 12-Sep-2018 15:30:25 - removeoldpanels=removeoldplots,showflags=showflags, build 12-Sep-2018 15:30:25 - title=title,xlabel=xlabels,ylabel=ylabels, build 12-Sep-2018 15:30:25 - fontsize=fontsize,windowsize=windowsize, build 12-Sep-2018 15:30:25 - plotrange=plotrange_l,timeplot=True,skipnrows=skipnrows, build 12-Sep-2018 15:30:25 - extendflag=flagextend) build 12-Sep-2018 15:30:25 - #print "=====plotoptions" build 12-Sep-2018 15:30:25 - # check if plot option was okay build 12-Sep-2018 15:30:25 - if (not ok): build 12-Sep-2018 15:30:25 - noop='noop' build 12-Sep-2018 15:30:25 - # Returns false when it shouldn't so for now do build 12-Sep-2018 15:30:25 - # nothing build 12-Sep-2018 15:30:25 - #raise Exception, 'An error occured while setting the plot options' build 12-Sep-2018 15:30:25 - if (timebin.lower()=='all'): build 12-Sep-2018 15:30:25 - timebin='8640000' build 12-Sep-2018 15:30:25 - if (width.lower()=='all'): build 12-Sep-2018 15:30:25 - width='32768' build 12-Sep-2018 15:30:25 - if (width.lower()=='allspw'): build 12-Sep-2018 15:30:25 - width='1234567' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - nChan=int(width) build 12-Sep-2018 15:30:25 - except: build 12-Sep-2018 15:30:25 - width='1' build 12-Sep-2018 15:30:25 - print "Found invalid width value, replaced with width='1'" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - fTime=float(timebin) build 12-Sep-2018 15:30:25 - except: build 12-Sep-2018 15:30:25 - timebin='0' build 12-Sep-2018 15:30:25 - print "Found invalid timebin value, replaced with timebin='0'" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if (averagemode=='scalar'): build 12-Sep-2018 15:30:25 - if (not (xaxis=='amp' or yaxis=='amp')): build 12-Sep-2018 15:30:25 - averagemode='vector' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #print width build 12-Sep-2018 15:30:25 - #print timebin build 12-Sep-2018 15:30:25 - #print averagemode build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #if (timebin=='0' and width=='1'): build 12-Sep-2018 15:30:25 - average='' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #kludge to map average into msplot averaging mode parameters. build 12-Sep-2018 15:30:25 - chanavemode='none' build 12-Sep-2018 15:30:25 - corravemode='none' build 12-Sep-2018 15:30:25 - if (average=='chanandcorr' ): build 12-Sep-2018 15:30:25 - chanavemode='vectorstep'; build 12-Sep-2018 15:30:25 - corravemode='vectorstep'; build 12-Sep-2018 15:30:25 - elif (average=='both'): build 12-Sep-2018 15:30:25 - chanavemode='vectorchunk'; build 12-Sep-2018 15:30:25 - timeavemode='scalarchunk'; build 12-Sep-2018 15:30:25 - elif (average=='correlation'): build 12-Sep-2018 15:30:25 - chanavemode='vectorstep'; build 12-Sep-2018 15:30:25 - elif (average!='' and average!='none' ): build 12-Sep-2018 15:30:25 - raise Exception, 'Unrecognized average selection' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if (averagemode==''): build 12-Sep-2018 15:30:25 - averagemode='vector' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ok=mp.avedata(chanavemode=chanavemode, build 12-Sep-2018 15:30:25 - corravemode=corravemode, build 12-Sep-2018 15:30:25 - datacolumn=datacolumn, build 12-Sep-2018 15:30:25 - averagemode=averagemode, build 12-Sep-2018 15:30:25 - averagechan=width, build 12-Sep-2018 15:30:25 - averagetime=timebin, build 12-Sep-2018 15:30:25 - averageflagged=showflags, build 12-Sep-2018 15:30:25 - averagescan=crossscans, build 12-Sep-2018 15:30:25 - averagebl=crossbls, build 12-Sep-2018 15:30:25 - averagearray=crossarrays, build 12-Sep-2018 15:30:25 - averagechanid=stackspw, build 12-Sep-2018 15:30:25 - averagevel=doVel) build 12-Sep-2018 15:30:25 - # check if averaging was okay build 12-Sep-2018 15:30:25 - if (not ok): build 12-Sep-2018 15:30:25 - raise Exception, 'Failure occured when averaging data!' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #print "scan=", scan, "uvrange=", uvrange build 12-Sep-2018 15:30:25 - if (selectdata): build 12-Sep-2018 15:30:25 - ok=mp.setdata(baseline=antenna,field=field,scan=scan, build 12-Sep-2018 15:30:25 - uvrange=uvrange,array=array,feed=feed, build 12-Sep-2018 15:30:25 - spw=spw,correlation=correlation, build 12-Sep-2018 15:30:25 - time=timerange) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - ok=mp.setdata(baseline='',field=field,scan='', build 12-Sep-2018 15:30:25 - uvrange='',array='',feed='', build 12-Sep-2018 15:30:25 - spw=spw,correlation='', build 12-Sep-2018 15:30:25 - time='') build 12-Sep-2018 15:30:25 - # check if data selection was okay build 12-Sep-2018 15:30:25 - if (not ok): build 12-Sep-2018 15:30:25 - raise Exception, 'Data selection resulted in no data!' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ok=mp.extendflag(extendcorr=extendcorr,extendchan=extendchan, build 12-Sep-2018 15:30:25 - extendspw=extendspw,extendant=extendant, build 12-Sep-2018 15:30:25 - extendtime=extendtime) build 12-Sep-2018 15:30:25 - # check if flag extension was okay build 12-Sep-2018 15:30:25 - if (not ok): build 12-Sep-2018 15:30:25 - raise Exception, 'Fail to set flag extension!' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if (xaxis=='real' or xaxis=='imag' or build 12-Sep-2018 15:30:25 - xaxis=='phase' or xaxis=='amp'): build 12-Sep-2018 15:30:25 - # data vs data plot build 12-Sep-2018 15:30:25 - #print 'data vs. data plot ************** ' build 12-Sep-2018 15:30:25 - if ((yaxis=='amp') | (yaxis=='phase') | build 12-Sep-2018 15:30:25 - (yaxis=='real') | (yaxis=='imag') ): build 12-Sep-2018 15:30:25 - ok=mp.plotxy(x='data',y='data', build 12-Sep-2018 15:30:25 - xcolumn=datacolumn,ycolumn=datacolumn, build 12-Sep-2018 15:30:25 - xvalue=xaxis,yvalue=yaxis, build 12-Sep-2018 15:30:25 - iteration=iteration) build 12-Sep-2018 15:30:25 - if (not ok): build 12-Sep-2018 15:30:25 - raise Exception, 'No data selected - please check inputs' build 12-Sep-2018 15:30:25 - elif (yaxis=='weight'): build 12-Sep-2018 15:30:25 - ok=mp.plotxy(x='data',y=yaxis, build 12-Sep-2018 15:30:25 - xcolumn=datacolumn,ycolumn=datacolumn, build 12-Sep-2018 15:30:25 - xvalue=xaxis,yvalue='amp', build 12-Sep-2018 15:30:25 - iteration=iteration) build 12-Sep-2018 15:30:25 - elif (xaxis=='weight'): build 12-Sep-2018 15:30:25 - ok=mp.plotxy(x='weight',y='data', build 12-Sep-2018 15:30:25 - xcolumn=datacolumn,ycolumn=datacolumn, build 12-Sep-2018 15:30:25 - xvalue='amp',yvalue=yaxis, build 12-Sep-2018 15:30:25 - iteration=iteration) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - raise Exception, 'Must be data versus data plot - illegal yaxis' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - elif ((yaxis=='real' or yaxis=='imag' or build 12-Sep-2018 15:30:25 - yaxis=='phase' or yaxis=='amp' or yaxis=='weight') and build 12-Sep-2018 15:30:25 - (xaxis!='x' and xaxis!='u')): build 12-Sep-2018 15:30:25 - # something vs data plot build 12-Sep-2018 15:30:25 - #print 'something vs data plot ************ ' build 12-Sep-2018 15:30:25 - if (yaxis=='weight'): build 12-Sep-2018 15:30:25 - ok=mp.plotxy(xaxis,yaxis) build 12-Sep-2018 15:30:25 - if (xaxis=='chan'): build 12-Sep-2018 15:30:25 - xaxis='vischannel' build 12-Sep-2018 15:30:25 - if (xaxis=='corr' or xaxis=='correlation'): build 12-Sep-2018 15:30:25 - xaxis='viscorr' build 12-Sep-2018 15:30:25 - if (xaxis=='freq'): build 12-Sep-2018 15:30:25 - xaxis='visfreq' build 12-Sep-2018 15:30:25 - if (xaxis=='velo'): build 12-Sep-2018 15:30:25 - xaxis='visvelocity' build 12-Sep-2018 15:30:25 - if (xaxis=='time'): build 12-Sep-2018 15:30:25 - xaxis='vistime' build 12-Sep-2018 15:30:25 - if (yaxis!='weight' and (xaxis!='v' and xaxis!='w')): build 12-Sep-2018 15:30:25 - ok=mp.plot(xaxis,datacolumn,yaxis,iteration) build 12-Sep-2018 15:30:25 - elif (xaxis=='v' or xaxis=='w'): build 12-Sep-2018 15:30:25 - ok=mp.plotxy(x=xaxis,y='data', build 12-Sep-2018 15:30:25 - xcolumn=datacolumn,ycolumn=datacolumn, build 12-Sep-2018 15:30:25 - xvalue='amp',yvalue=yaxis, build 12-Sep-2018 15:30:25 - iteration=iteration) build 12-Sep-2018 15:30:25 - if (not ok): build 12-Sep-2018 15:30:25 - raise Exception, 'No data selected - please check inputs' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - # something vs something plot build 12-Sep-2018 15:30:25 - #print 'something vs. something plot ************ ' build 12-Sep-2018 15:30:25 - if (xaxis=='chan' or yaxis=='chan'): build 12-Sep-2018 15:30:25 - raise Exception, 'Channel can not be selected versus non-data values' build 12-Sep-2018 15:30:25 - if (xaxis=='freq' or yaxis=='freq'): build 12-Sep-2018 15:30:25 - raise Exception, 'Frequency can not be selected versus non-data values' build 12-Sep-2018 15:30:25 - if (xaxis=='velo' or yaxis=='velo'): build 12-Sep-2018 15:30:25 - raise Exception, 'Velocity can not be selected versus non-data values' build 12-Sep-2018 15:30:25 - if (yaxis=='time'): build 12-Sep-2018 15:30:25 - raise Exception, 'yaxis=time is not currently supported' build 12-Sep-2018 15:30:25 - if (xaxis=='u'): build 12-Sep-2018 15:30:25 - ok=mp.plot('uvcoverage') build 12-Sep-2018 15:30:25 - if (xaxis=='x'): build 12-Sep-2018 15:30:25 - ok=mp.plot('array') build 12-Sep-2018 15:30:25 - if (xaxis!='x' and xaxis!='u'): build 12-Sep-2018 15:30:25 - #print 'getting to the right spot' build 12-Sep-2018 15:30:25 - ok=mp.plotxy(x=xaxis,y=yaxis) build 12-Sep-2018 15:30:25 - if (not ok): build 12-Sep-2018 15:30:25 - raise Exception, 'No data selected - please check inputs' build 12-Sep-2018 15:30:25 - if ( len(iteration) > 0 ): build 12-Sep-2018 15:30:25 - mp.iterplotnext() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if ( len(figfile) > 0 ) : build 12-Sep-2018 15:30:25 - mp.savefig( figfile ); build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - print 'INFO ', instance build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Close the MS to avoid table locks. This doesn't close the build 12-Sep-2018 15:30:25 - # plot window but frees the MS to be used by other CASA tools build 12-Sep-2018 15:30:25 - # And will prevent users from manipulating the build 12-Sep-2018 15:30:25 - #if ( not interactive ) : build 12-Sep-2018 15:30:25 - # mp.done(); build 12-Sep-2018 15:30:25 - #else : build 12-Sep-2018 15:30:25 - mp.closeMS(); build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - endProc=time.clock() build 12-Sep-2018 15:30:25 - endTime=time.time() build 12-Sep-2018 15:30:25 - print 'Total process time %.2f sec.' % (endProc - startProc) build 12-Sep-2018 15:30:25 - print 'Total wall clock time %.2f sec.' % (endTime - startTime) build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_predictcomp.py b/gcwrap/python/scripts/task_predictcomp.py build 12-Sep-2018 15:30:25 index c291fd4..d04572c 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_predictcomp.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/task_predictcomp.py build 12-Sep-2018 15:30:25 @@ -83,7 +83,7 @@ def predictcomp(objname=None, standard=None, epoch=None, build 12-Sep-2018 15:30:25 else: build 12-Sep-2018 15:30:25 nfreqs = 1 build 12-Sep-2018 15:30:25 freqs = pl.linspace(minfreqHz, maxfreqHz, nfreqs) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 myme = metool() build 12-Sep-2018 15:30:25 mepoch = myme.epoch('UTC', epoch) build 12-Sep-2018 15:30:25 #if not prefix: build 12-Sep-2018 15:30:25 @@ -132,6 +132,26 @@ def predictcomp(objname=None, standard=None, epoch=None, build 12-Sep-2018 15:30:25 casalog.post('Error creating a local im instance.', 'SEVERE') build 12-Sep-2018 15:30:25 return False build 12-Sep-2018 15:30:25 #print "FREQS=",freqs build 12-Sep-2018 15:30:25 + # output CL file name is fixed : prefix+"spw0_"+minfreq+mepoch.cl build 12-Sep-2018 15:30:25 + minfreqGHz = qa.convert(qa.quantity(minfreq), 'GHz')['value'] build 12-Sep-2018 15:30:25 + decimalfreq = minfreqGHz - int(minfreqGHz) build 12-Sep-2018 15:30:25 + decimalepoch = mepoch['m0']['value'] - int(mepoch['m0']['value']) build 12-Sep-2018 15:30:25 + if decimalfreq == 0.0: build 12-Sep-2018 15:30:25 + minfreqGHzStr = str(int(minfreqGHz))+'GHz' build 12-Sep-2018 15:30:25 + else : build 12-Sep-2018 15:30:25 + minfreqGHzStr = str(minfreqGHz)+'GHz' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if decimalepoch == 0.0: build 12-Sep-2018 15:30:25 + epochStr = str(int(mepoch['m0']['value']))+'d' build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + epochStr=str(mepoch['m0']['value'])+'d' build 12-Sep-2018 15:30:25 + outfilename = "spw0_"+objname+"_"+minfreqGHzStr+epochStr+'.cl' build 12-Sep-2018 15:30:25 + outfilename = prefix+outfilename build 12-Sep-2018 15:30:25 + if (os.path.exists(outfilename) and os.path.isdir(outfilename)) : build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + shutil.rmtree(outfilename) build 12-Sep-2018 15:30:25 + casalog.post("Removing the existing componentlist, "+outfilename) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 if standard=='Butler-JPL-Horizons 2012': build 12-Sep-2018 15:30:25 clist = predictSolarObjectCompList(objname, mepoch, freqs.tolist(), prefix) build 12-Sep-2018 15:30:25 else: build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_sdsidebandsplit.py b/gcwrap/python/scripts/task_sdsidebandsplit.py build 12-Sep-2018 15:30:25 index 182fee6..3a9f312 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_sdsidebandsplit.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/task_sdsidebandsplit.py build 12-Sep-2018 15:30:25 @@ -9,7 +9,7 @@ from taskinit import * build 12-Sep-2018 15:30:25 # imsize, cell, phasecenter, ephemsrcname, pointingcolumn, build 12-Sep-2018 15:30:25 # restfreq, stokes, minweight, clipminmax): build 12-Sep-2018 15:30:25 def sdsidebandsplit(imagename, outfile, overwrite, signalshift, imageshift, build 12-Sep-2018 15:30:25 - getbothside, refpix, refval, useother, threshold): build 12-Sep-2018 15:30:25 + getbothside, refchan, refval, useother, threshold): build 12-Sep-2018 15:30:25 casalog.origin('sdsidebandsplit') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 separator = casac.sidebandseparator() build 12-Sep-2018 15:30:25 @@ -26,7 +26,7 @@ def sdsidebandsplit(imagename, outfile, overwrite, signalshift, imageshift, build 12-Sep-2018 15:30:25 else: build 12-Sep-2018 15:30:25 myqa = qatool() build 12-Sep-2018 15:30:25 qrefval = myqa.quantity(refval) build 12-Sep-2018 15:30:25 - separator.set_imageband_frequency(refpix, qrefval) build 12-Sep-2018 15:30:25 + separator.set_imageband_frequency(refchan, qrefval) build 12-Sep-2018 15:30:25 separator.setsolveother(useother) build 12-Sep-2018 15:30:25 separator.separate(outfile, overwrite) build 12-Sep-2018 15:30:25 finally: build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_ssoflux.py b/gcwrap/python/scripts/task_ssoflux.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 376dff6..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_ssoflux.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,98 +0,0 @@ build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def ssoflux(vis=None,field=None,spw=None,modimage=None,fluxdensity=None,standard=None): build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - *This is an experimental clone of setjy while flux calibration with build 12-Sep-2018 15:30:25 - Solar System objects is being tested. It will eventually be merged build 12-Sep-2018 15:30:25 - back into setjy.* build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Fills the model column for flux density calibrators: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The task places the model visibility amp and phase associated build 12-Sep-2018 15:30:25 - with a specified clean components image into the model column build 12-Sep-2018 15:30:25 - of the data set. The simplest way is to enter the flux density build 12-Sep-2018 15:30:25 - (I,Q,U,V) explicitly. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Models are available for 3C48, 3C138, and 3C286 between build 12-Sep-2018 15:30:25 - 1.4 and 43 GHz. 3C147 is available above 13 GHz. These models build 12-Sep-2018 15:30:25 - are scaled to the precise frequency of the data. Only I models are build 12-Sep-2018 15:30:25 - presently available. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The location of the models are system dependent: At the AOC, the build 12-Sep-2018 15:30:25 - models are in the directory::/usr/lib/casapy/data/nrao/VLA/CalModels build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ssoflux need only be run on the calibrator sources with a know flux build 12-Sep-2018 15:30:25 - density and/or model. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file build 12-Sep-2018 15:30:25 - default: none. example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - field -- Select field using field id(s) or field name(s). build 12-Sep-2018 15:30:25 - [run listobs to obtain the list id's or names of calibrators] build 12-Sep-2018 15:30:25 - default: ''=all fields build 12-Sep-2018 15:30:25 - Only one field can be used if a source model or specific fluxdensity build 12-Sep-2018 15:30:25 - is inserted. build 12-Sep-2018 15:30:25 - If field string is a non-negative integer, it is assumed a field index build 12-Sep-2018 15:30:25 - otherwise, it is assumed a field name build 12-Sep-2018 15:30:25 - field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 - field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 - field='3C286,3C295'; fields named 3C286 and 3C295 build 12-Sep-2018 15:30:25 - field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 - spw -- Select spectral window/channels build 12-Sep-2018 15:30:25 - default: ''=all spectral windows and channels build 12-Sep-2018 15:30:25 - spw='0~2,4'; spectral windows 0,1,2,4 (all channels) build 12-Sep-2018 15:30:25 - spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 - spw='0:5~61'; spw 0, channels 5 to 61 build 12-Sep-2018 15:30:25 - spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, channels 3 to 45. build 12-Sep-2018 15:30:25 - spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. build 12-Sep-2018 15:30:25 - spw='0:0~10;15~60'; spectral window 0 with channels 0-10,15-60 build 12-Sep-2018 15:30:25 - spw='0:0~10,1:20~30,2:1;2;4'; spw 0, channels 0-10, build 12-Sep-2018 15:30:25 - spw 1, channels 20-30, and spw 2, channels, 1,2 and 4 build 12-Sep-2018 15:30:25 - modimage -- Optional model image (I only) from which the model visibilities build 12-Sep-2018 15:30:25 - are calculated and placed in the model column. Each field must build 12-Sep-2018 15:30:25 - be done separately. The image flux density will be scaled from the build 12-Sep-2018 15:30:25 - frequency in the model to that actually used. build 12-Sep-2018 15:30:25 - In CV and the AOC, the models are located in the build 12-Sep-2018 15:30:25 - /usr/lib/casapy/data/nrao/VLA/CalModels directory build 12-Sep-2018 15:30:25 - fluxdensity -- Specified flux density [I,Q,U,V] in Jy build 12-Sep-2018 15:30:25 - default => -1, puts total flux density for known standard source build 12-Sep-2018 15:30:25 - places [1,0,0,0] for any other source. build 12-Sep-2018 15:30:25 - Otherwise, places the specified flux density for the source. This build 12-Sep-2018 15:30:25 - is the only way to insert a polarized flux density model at the build 12-Sep-2018 15:30:25 - present time (March 2008). build 12-Sep-2018 15:30:25 - example: fluxdensity=[2.63,0.21,-0.33,0.02] build 12-Sep-2018 15:30:25 - standard -- Flux density standard, used if fluxdensity<0 build 12-Sep-2018 15:30:25 - default: 'Perley-Taylor 99'; example: standard='Baars' build 12-Sep-2018 15:30:25 - Options: 'Baars','Perley 90','Perley-Taylor 95', build 12-Sep-2018 15:30:25 - 'Perley-Taylor 99' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - casalog.origin('ssoflux') build 12-Sep-2018 15:30:25 - casalog.post("Task ssoflux has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - casalog.post('ssoflux is no longer supported. Use setjy.', 'SEVERE') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## if ((type(vis)==str) & (os.path.exists(vis))): build 12-Sep-2018 15:30:25 - ## im.open(vis, usescratch=True) build 12-Sep-2018 15:30:25 - ## else: build 12-Sep-2018 15:30:25 - ## raise Exception, 'Visibility data set not found - please verify the name' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## im.ssoflux(field=field,spw=spw,modimage=modimage,fluxdensity=fluxdensity,standard=standard) build 12-Sep-2018 15:30:25 - ## im.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## #write history build 12-Sep-2018 15:30:25 - ## ms.open(vis,nomodify=False) build 12-Sep-2018 15:30:25 - ## ms.writehistory(message='taskname = ssoflux',origin='ssoflux') build 12-Sep-2018 15:30:25 - ## ms.writehistory(message='vis = "'+str(vis)+'"',origin='ssoflux') build 12-Sep-2018 15:30:25 - ## ms.writehistory(message='field = "'+str(field)+'"',origin='ssoflux') build 12-Sep-2018 15:30:25 - ## ms.writehistory(message='spw = '+str(spw),origin='ssoflux') build 12-Sep-2018 15:30:25 - ## ms.writehistory(message='modimage = '+str(modimage),origin='ssoflux') build 12-Sep-2018 15:30:25 - ## ms.writehistory(message='fluxdensity = '+str(fluxdensity),origin='ssoflux') build 12-Sep-2018 15:30:25 - ## ms.writehistory(message='standard = "'+str(standard)+'"',origin='ssoflux') build 12-Sep-2018 15:30:25 - ## ms.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - print '*** Error ***',instance build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_statwt.py b/gcwrap/python/scripts/task_statwt.py build 12-Sep-2018 15:30:25 index a66a709..51a7f03 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_statwt.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/task_statwt.py build 12-Sep-2018 15:30:25 @@ -1,81 +1,62 @@ build 12-Sep-2018 15:30:25 from taskinit import mstool, tbtool, casalog, write_history build 12-Sep-2018 15:30:25 +import flaghelper build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -def statwt(vis, dorms, byantenna, sepacs, fitspw, fitcorr, combine, build 12-Sep-2018 15:30:25 - timebin, minsamp, field, spw, antenna, timerange, scan, intent, build 12-Sep-2018 15:30:25 - array, correlation, obs, datacolumn): build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - Sets WEIGHT and SIGMA using the scatter of the visibilities. build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 +def statwt( build 12-Sep-2018 15:30:25 + vis, selectdata, field, spw, intent, array, observation, combine, build 12-Sep-2018 15:30:25 + timebin, slidetimebin, chanbin, minsamp, statalg, fence, center, build 12-Sep-2018 15:30:25 + lside, zscore, maxiter, excludechans, wtrange, build 12-Sep-2018 15:30:25 + flagbackup, preview, datacolumn build 12-Sep-2018 15:30:25 +): build 12-Sep-2018 15:30:25 casalog.origin('statwt') build 12-Sep-2018 15:30:25 - retval = True build 12-Sep-2018 15:30:25 + if not selectdata: build 12-Sep-2018 15:30:25 + # CAS-10761, requirement provided by Urvashi build 12-Sep-2018 15:30:25 + if field or spw or intent or array or observation: build 12-Sep-2018 15:30:25 + casalog.post( build 12-Sep-2018 15:30:25 + "selectdata=False, any explicitly set data " build 12-Sep-2018 15:30:25 + + "selection parameters will be ignored", build 12-Sep-2018 15:30:25 + "WARN" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + field = "" build 12-Sep-2018 15:30:25 + spw = "" build 12-Sep-2018 15:30:25 + intent = "" build 12-Sep-2018 15:30:25 + array = "" build 12-Sep-2018 15:30:25 + observation = "" build 12-Sep-2018 15:30:25 try: build 12-Sep-2018 15:30:25 + if (flagbackup): build 12-Sep-2018 15:30:25 + if (preview): build 12-Sep-2018 15:30:25 + casalog.post( build 12-Sep-2018 15:30:25 + "Running in preview mode. No flags will be " build 12-Sep-2018 15:30:25 + + "modified, so existing flags will not be backed up." build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + casalog.post('Backup original flags before applying new flags') build 12-Sep-2018 15:30:25 + flaghelper.backupFlags(aflocal=None, msfile=vis, prename='statwt') build 12-Sep-2018 15:30:25 myms = mstool() build 12-Sep-2018 15:30:25 - mytb = tbtool() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # parameter check for those not fully implemeted build 12-Sep-2018 15:30:25 - # (should be taken out once implemented) build 12-Sep-2018 15:30:25 - if byantenna: build 12-Sep-2018 15:30:25 - raise ValueError("byantenna=True is not supported yet") build 12-Sep-2018 15:30:25 - if fitcorr !='': build 12-Sep-2018 15:30:25 - raise ValueError("fitcorr is not supported yet") build 12-Sep-2018 15:30:25 - if timebin !='0s' and timebin !='-1s': build 12-Sep-2018 15:30:25 - raise ValueError("timebin is not supported yet") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - datacol = 'DATA' build 12-Sep-2018 15:30:25 - mytb.open(vis) build 12-Sep-2018 15:30:25 - colnames = mytb.colnames() build 12-Sep-2018 15:30:25 - mytb.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - for datacol in ['CORRECTED_DATA', 'DATA', 'junk']: build 12-Sep-2018 15:30:25 - if datacol in colnames: build 12-Sep-2018 15:30:25 - break build 12-Sep-2018 15:30:25 - if datacol == 'junk': build 12-Sep-2018 15:30:25 - raise ValueError(vis + " does not have a data column") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if datacolumn == 'float_data': build 12-Sep-2018 15:30:25 - raise ValueError("float_data is not yet supported") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if datacolumn == 'corrected' and datacol == 'DATA': # no CORRECTED_DATA case (fall back to DATA) build 12-Sep-2018 15:30:25 - casalog.post("No %s column found, using %s column" % (datacolumn.upper()+'_DATA', datacol),'WARN') build 12-Sep-2018 15:30:25 - datacolumn = datacol build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - if datacolumn=='corrected': build 12-Sep-2018 15:30:25 - datacolumn_name=datacolumn.upper()+'_DATA' build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - datacolumn_name=datacolumn.upper() build 12-Sep-2018 15:30:25 - casalog.post("Using %s column to determine visibility scatter" % datacolumn_name) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if ':' in spw: build 12-Sep-2018 15:30:25 - casalog.post('The channel selection part of spw will be ignored.', 'WARN') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if len(correlation)>0: build 12-Sep-2018 15:30:25 - correlation='' build 12-Sep-2018 15:30:25 - casalog.post('Correlation selection in statwt has been disabled as of CASA v4.5', 'WARN') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - myms.open(vis, nomodify=False) build 12-Sep-2018 15:30:25 - retval = myms.statwt(dorms, byantenna, sepacs, fitspw, fitcorr, combine, build 12-Sep-2018 15:30:25 - timebin, minsamp, field, spw, antenna, timerange, scan, intent, build 12-Sep-2018 15:30:25 - array, correlation, obs, datacolumn) build 12-Sep-2018 15:30:25 - myms.close() build 12-Sep-2018 15:30:25 - except Exception, e: build 12-Sep-2018 15:30:25 - casalog.post("Error setting WEIGHT and SIGMA for %s:" % vis, 'SEVERE') build 12-Sep-2018 15:30:25 - casalog.post("%s" % e, 'SEVERE') build 12-Sep-2018 15:30:25 - if False: # Set True for debugging. build 12-Sep-2018 15:30:25 - for p in statwt.func_code.co_varnames[:statwt.func_code.co_argcount]: build 12-Sep-2018 15:30:25 - v = eval(p) build 12-Sep-2018 15:30:25 - print p, "=", v, ", type =", type(v) build 12-Sep-2018 15:30:25 - retval = False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if retval: build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - param_names = statwt.func_code.co_varnames[:statwt.func_code.co_argcount] build 12-Sep-2018 15:30:25 - param_vals = [eval(p) for p in param_names] build 12-Sep-2018 15:30:25 - retval &= write_history(myms, vis, 'statwt', param_names, param_vals, build 12-Sep-2018 15:30:25 - casalog) build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - casalog.post("*** Error \'%s\' updating HISTORY" % (instance), build 12-Sep-2018 15:30:25 - 'WARN') build 12-Sep-2018 15:30:25 - return retval build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + myms.open(vis, nomodify=preview) build 12-Sep-2018 15:30:25 + sel = {} build 12-Sep-2018 15:30:25 + sel['spw'] = spw build 12-Sep-2018 15:30:25 + #sel['time'] = timerange build 12-Sep-2018 15:30:25 + sel['field'] = field build 12-Sep-2018 15:30:25 + #sel['baseline'] = antenna build 12-Sep-2018 15:30:25 + #sel['scan'] = scan build 12-Sep-2018 15:30:25 + sel['scanintent'] = intent build 12-Sep-2018 15:30:25 + #sel['polarization'] = correlation build 12-Sep-2018 15:30:25 + #sel['uvdist'] = uvrange build 12-Sep-2018 15:30:25 + sel['observation'] = str(observation) build 12-Sep-2018 15:30:25 + sel['array'] = array build 12-Sep-2018 15:30:25 + #sel['feed'] = feed build 12-Sep-2018 15:30:25 + # Select the data. Only-parse is set to false. build 12-Sep-2018 15:30:25 + myms.msselect(sel, False) build 12-Sep-2018 15:30:25 + return myms.statwt( build 12-Sep-2018 15:30:25 + combine=combine, timebin=timebin, build 12-Sep-2018 15:30:25 + slidetimebin=slidetimebin, chanbin=chanbin, build 12-Sep-2018 15:30:25 + minsamp=minsamp, statalg=statalg, fence=fence, build 12-Sep-2018 15:30:25 + center=center, lside=lside, zscore=zscore, build 12-Sep-2018 15:30:25 + maxiter=maxiter, excludechans=excludechans, build 12-Sep-2018 15:30:25 + wtrange=wtrange, preview=preview, datacolumn=datacolumn build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + except Exception, instance: build 12-Sep-2018 15:30:25 + casalog.post( '*** Error ***'+str(instance), 'SEVERE' ) build 12-Sep-2018 15:30:25 + raise build 12-Sep-2018 15:30:25 + finally: build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_statwt2.py b/gcwrap/python/scripts/task_statwt2.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 0a308df..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_statwt2.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,62 +0,0 @@ build 12-Sep-2018 15:30:25 -from taskinit import mstool, tbtool, casalog, write_history build 12-Sep-2018 15:30:25 -import flaghelper build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def statwt2( build 12-Sep-2018 15:30:25 - vis, selectdata, field, spw, intent, array, observation, combine, build 12-Sep-2018 15:30:25 - timebin, slidetimebin, chanbin, minsamp, statalg, fence, center, build 12-Sep-2018 15:30:25 - lside, zscore, maxiter, excludechans, wtrange, build 12-Sep-2018 15:30:25 - flagbackup, preview, datacolumn build 12-Sep-2018 15:30:25 -): build 12-Sep-2018 15:30:25 - casalog.origin('statwt2') build 12-Sep-2018 15:30:25 - if not selectdata: build 12-Sep-2018 15:30:25 - # CAS-10761, requirement provided by Urvashi build 12-Sep-2018 15:30:25 - if field or spw or intent or array or observation: build 12-Sep-2018 15:30:25 - casalog.post( build 12-Sep-2018 15:30:25 - "selectdata=False, any explicitly set data " build 12-Sep-2018 15:30:25 - + "selection parameters will be ignored", build 12-Sep-2018 15:30:25 - "WARN" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - field = "" build 12-Sep-2018 15:30:25 - spw = "" build 12-Sep-2018 15:30:25 - intent = "" build 12-Sep-2018 15:30:25 - array = "" build 12-Sep-2018 15:30:25 - observation = "" build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - if (flagbackup): build 12-Sep-2018 15:30:25 - if (preview): build 12-Sep-2018 15:30:25 - casalog.post( build 12-Sep-2018 15:30:25 - "Running in preview mode. No flags will be " build 12-Sep-2018 15:30:25 - + "modified, so existing flags will not be backed up." build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - casalog.post('Backup original flags before applying new flags') build 12-Sep-2018 15:30:25 - flaghelper.backupFlags(aflocal=None, msfile=vis, prename='statwt2') build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - myms.open(vis, nomodify=preview) build 12-Sep-2018 15:30:25 - sel = {} build 12-Sep-2018 15:30:25 - sel['spw'] = spw build 12-Sep-2018 15:30:25 - #sel['time'] = timerange build 12-Sep-2018 15:30:25 - sel['field'] = field build 12-Sep-2018 15:30:25 - #sel['baseline'] = antenna build 12-Sep-2018 15:30:25 - #sel['scan'] = scan build 12-Sep-2018 15:30:25 - sel['scanintent'] = intent build 12-Sep-2018 15:30:25 - #sel['polarization'] = correlation build 12-Sep-2018 15:30:25 - #sel['uvdist'] = uvrange build 12-Sep-2018 15:30:25 - sel['observation'] = str(observation) build 12-Sep-2018 15:30:25 - sel['array'] = array build 12-Sep-2018 15:30:25 - #sel['feed'] = feed build 12-Sep-2018 15:30:25 - # Select the data. Only-parse is set to false. build 12-Sep-2018 15:30:25 - myms.msselect(sel, False) build 12-Sep-2018 15:30:25 - return myms.statwt2( build 12-Sep-2018 15:30:25 - combine=combine, timebin=timebin, build 12-Sep-2018 15:30:25 - slidetimebin=slidetimebin, chanbin=chanbin, build 12-Sep-2018 15:30:25 - minsamp=minsamp, statalg=statalg, fence=fence, build 12-Sep-2018 15:30:25 - center=center, lside=lside, zscore=zscore, build 12-Sep-2018 15:30:25 - maxiter=maxiter, excludechans=excludechans, build 12-Sep-2018 15:30:25 - wtrange=wtrange, preview=preview, datacolumn=datacolumn build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - casalog.post( '*** Error ***'+str(instance), 'SEVERE' ) build 12-Sep-2018 15:30:25 - raise build 12-Sep-2018 15:30:25 - finally: build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_tclean.py b/gcwrap/python/scripts/task_tclean.py build 12-Sep-2018 15:30:25 index e68dd61..6e60f7f 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_tclean.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/task_tclean.py build 12-Sep-2018 15:30:25 @@ -13,7 +13,7 @@ import numpy build 12-Sep-2018 15:30:25 from taskinit import * build 12-Sep-2018 15:30:25 import copy build 12-Sep-2018 15:30:25 import time; build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 +import pdb build 12-Sep-2018 15:30:25 #from refimagerhelper import PySynthesisImager build 12-Sep-2018 15:30:25 #from refimagerhelper import PyParallelContSynthesisImager,PyParallelCubeSynthesisImager build 12-Sep-2018 15:30:25 #from refimagerhelper import ImagerParameters build 12-Sep-2018 15:30:25 @@ -62,8 +62,9 @@ def tclean( build 12-Sep-2018 15:30:25 interpolation,#='', build 12-Sep-2018 15:30:25 ## build 12-Sep-2018 15:30:25 ####### Gridding parameters build 12-Sep-2018 15:30:25 - gridder,#='ft', build 12-Sep-2018 15:30:25 + gridder,#='ft', build 12-Sep-2018 15:30:25 facets,#=1, build 12-Sep-2018 15:30:25 + psfphasecenter, #='' build 12-Sep-2018 15:30:25 chanchunks,#=1, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 wprojplanes,#=1, build 12-Sep-2018 15:30:25 @@ -154,14 +155,22 @@ def tclean( build 12-Sep-2018 15:30:25 ##################################################### build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ### Move these checks elsewhere ? build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + inpparams=locals().copy() build 12-Sep-2018 15:30:25 + ###now deal with parameters which are not the same name build 12-Sep-2018 15:30:25 + inpparams['msname']= inpparams.pop('vis') build 12-Sep-2018 15:30:25 + inpparams['timestr']= inpparams.pop('timerange') build 12-Sep-2018 15:30:25 + inpparams['uvdist']= inpparams.pop('uvrange') build 12-Sep-2018 15:30:25 + inpparams['obs']= inpparams.pop('observation') build 12-Sep-2018 15:30:25 + inpparams['state']= inpparams.pop('intent') build 12-Sep-2018 15:30:25 + inpparams['loopgain']=inpparams.pop('gain') build 12-Sep-2018 15:30:25 + inpparams['scalebias']=inpparams.pop('smallscalebias') build 12-Sep-2018 15:30:25 if specmode=='cont': build 12-Sep-2018 15:30:25 specmode='mfs' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 # if specmode=='mfs' and nterms==1 and deconvolver == "mtmfs": build 12-Sep-2018 15:30:25 # casalog.post( "The MTMFS deconvolution algorithm (deconvolver='mtmfs') needs nterms>1.Please set nterms=2 (or more). ", "WARN", "task_tclean" ) build 12-Sep-2018 15:30:25 # return build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + inpparams['specmode']='mfs' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 if specmode!='mfs' and deconvolver=="mtmfs": build 12-Sep-2018 15:30:25 casalog.post( "The MSMFS algorithm (deconvolver='mtmfs') applies only to specmode='mfs'.", "WARN", "task_tclean" ) build 12-Sep-2018 15:30:25 return build 12-Sep-2018 15:30:25 @@ -172,118 +181,18 @@ def tclean( build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 imager = None build 12-Sep-2018 15:30:25 paramList = None build 12-Sep-2018 15:30:25 + # Put all parameters into dictionaries and check them. build 12-Sep-2018 15:30:25 + ##make a dictionary of parameters that ImagerParameters take build 12-Sep-2018 15:30:25 + defparm=dict(zip(ImagerParameters.__init__.__func__.__code__.co_varnames[1:], ImagerParameters.__init__.func_defaults)) build 12-Sep-2018 15:30:25 + ###assign values to the ones passed to tclean and if not defined yet in tclean... build 12-Sep-2018 15:30:25 + ###assign them the default value of the constructor build 12-Sep-2018 15:30:25 + bparm={k: inpparams[k] if inpparams.has_key(k) else defparm[k] for k in ImagerParameters.__init__.__func__.__code__.co_varnames[1:-1]} build 12-Sep-2018 15:30:25 + paramList=ImagerParameters(**bparm) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # deprecation message build 12-Sep-2018 15:30:25 if usemask=='auto-thresh' or usemask=='auto-thresh2': build 12-Sep-2018 15:30:25 casalog.post(usemask+" is deprecated, will be removed in CASA 5.4. It is recommended to use auto-multithresh instead", "WARN") build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # Put all parameters into dictionaries and check them. build 12-Sep-2018 15:30:25 - paramList = ImagerParameters( build 12-Sep-2018 15:30:25 - msname =vis, build 12-Sep-2018 15:30:25 - field=field, build 12-Sep-2018 15:30:25 - spw=spw, build 12-Sep-2018 15:30:25 - timestr=timerange, build 12-Sep-2018 15:30:25 - uvdist=uvrange, build 12-Sep-2018 15:30:25 - antenna=antenna, build 12-Sep-2018 15:30:25 - scan=scan, build 12-Sep-2018 15:30:25 - obs=observation, build 12-Sep-2018 15:30:25 - state=intent, build 12-Sep-2018 15:30:25 - datacolumn=datacolumn, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ### Image.... build 12-Sep-2018 15:30:25 - imagename=imagename, build 12-Sep-2018 15:30:25 - #### Direction Image Coords build 12-Sep-2018 15:30:25 - imsize=imsize, build 12-Sep-2018 15:30:25 - cell=cell, build 12-Sep-2018 15:30:25 - phasecenter=phasecenter, build 12-Sep-2018 15:30:25 - stokes=stokes, build 12-Sep-2018 15:30:25 - projection=projection, build 12-Sep-2018 15:30:25 - startmodel=startmodel, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ### Spectral Image Coords build 12-Sep-2018 15:30:25 - specmode=specmode, build 12-Sep-2018 15:30:25 - reffreq=reffreq, build 12-Sep-2018 15:30:25 - nchan=nchan, build 12-Sep-2018 15:30:25 - start=start, build 12-Sep-2018 15:30:25 - width=width, build 12-Sep-2018 15:30:25 - outframe=outframe, build 12-Sep-2018 15:30:25 - veltype=veltype, build 12-Sep-2018 15:30:25 - restfreq=restfreq, build 12-Sep-2018 15:30:25 - sysvel='', #sysvel, build 12-Sep-2018 15:30:25 - sysvelframe='', #sysvelframe, build 12-Sep-2018 15:30:25 - interpolation=interpolation, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - gridder=gridder, build 12-Sep-2018 15:30:25 -# ftmachine=ftmachine, build 12-Sep-2018 15:30:25 - facets=facets, build 12-Sep-2018 15:30:25 - chanchunks=chanchunks, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - wprojplanes=wprojplanes, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - vptable=vptable, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ### Gridding.... build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - aterm=aterm, build 12-Sep-2018 15:30:25 - psterm=psterm, build 12-Sep-2018 15:30:25 - wbawp = wbawp, build 12-Sep-2018 15:30:25 - cfcache = cfcache, build 12-Sep-2018 15:30:25 - conjbeams = conjbeams, build 12-Sep-2018 15:30:25 - computepastep =computepastep, build 12-Sep-2018 15:30:25 - rotatepastep = rotatepastep, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - pblimit=pblimit, build 12-Sep-2018 15:30:25 - normtype=normtype, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - outlierfile=outlierfile, build 12-Sep-2018 15:30:25 - restart=restart, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - weighting=weighting, build 12-Sep-2018 15:30:25 - robust=robust, build 12-Sep-2018 15:30:25 - npixels=npixels, build 12-Sep-2018 15:30:25 - uvtaper=uvtaper, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ### Deconvolution build 12-Sep-2018 15:30:25 - niter=niter, build 12-Sep-2018 15:30:25 - cycleniter=cycleniter, build 12-Sep-2018 15:30:25 - loopgain=gain, build 12-Sep-2018 15:30:25 - threshold=threshold, build 12-Sep-2018 15:30:25 - nsigma=nsigma, build 12-Sep-2018 15:30:25 - cyclefactor=cyclefactor, build 12-Sep-2018 15:30:25 - minpsffraction=minpsffraction, build 12-Sep-2018 15:30:25 - maxpsffraction=maxpsffraction, build 12-Sep-2018 15:30:25 - interactive=interactive, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - deconvolver=deconvolver, build 12-Sep-2018 15:30:25 - scales=scales, build 12-Sep-2018 15:30:25 - nterms=nterms, build 12-Sep-2018 15:30:25 - scalebias=smallscalebias, build 12-Sep-2018 15:30:25 - restoringbeam=restoringbeam, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ### new mask params build 12-Sep-2018 15:30:25 - usemask=usemask, build 12-Sep-2018 15:30:25 - mask=mask, build 12-Sep-2018 15:30:25 - pbmask=pbmask, build 12-Sep-2018 15:30:25 - maskthreshold=maskthreshold, build 12-Sep-2018 15:30:25 - maskresolution=maskresolution, build 12-Sep-2018 15:30:25 - nmask=nmask, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ### automask multithresh params build 12-Sep-2018 15:30:25 - sidelobethreshold=sidelobethreshold, build 12-Sep-2018 15:30:25 - noisethreshold=noisethreshold, build 12-Sep-2018 15:30:25 - lownoisethreshold=lownoisethreshold, build 12-Sep-2018 15:30:25 - negativethreshold=negativethreshold, build 12-Sep-2018 15:30:25 - smoothfactor=smoothfactor, build 12-Sep-2018 15:30:25 - minbeamfrac=minbeamfrac, build 12-Sep-2018 15:30:25 - cutthreshold=cutthreshold, build 12-Sep-2018 15:30:25 - growiterations=growiterations, build 12-Sep-2018 15:30:25 - dogrowprune=dogrowprune, build 12-Sep-2018 15:30:25 - minpercentchange=minpercentchange, build 12-Sep-2018 15:30:25 - verbose=verbose, build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - savemodel=savemodel build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 #paramList.printParameters() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 pcube=False build 12-Sep-2018 15:30:25 @@ -298,13 +207,16 @@ def tclean( build 12-Sep-2018 15:30:25 return False build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ## Setup Imager objects, for different parallelization schemes. build 12-Sep-2018 15:30:25 + imagerInst=PySynthesisImager build 12-Sep-2018 15:30:25 if parallel==False and pcube==False: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 imager = PySynthesisImager(params=paramList) build 12-Sep-2018 15:30:25 + imagerInst=PySynthesisImager build 12-Sep-2018 15:30:25 elif parallel==True: build 12-Sep-2018 15:30:25 imager = PyParallelContSynthesisImager(params=paramList) build 12-Sep-2018 15:30:25 + imagerInst=PyParallelContSynthesisImager build 12-Sep-2018 15:30:25 elif pcube==True: build 12-Sep-2018 15:30:25 imager = PyParallelCubeSynthesisImager(params=paramList) build 12-Sep-2018 15:30:25 + imagerInst=PyParallelCubeSynthesisImager build 12-Sep-2018 15:30:25 # virtualconcat type - changed from virtualmove to virtualcopy 2016-07-20 build 12-Sep-2018 15:30:25 concattype='virtualcopy' build 12-Sep-2018 15:30:25 else: build 12-Sep-2018 15:30:25 @@ -346,9 +258,18 @@ def tclean( build 12-Sep-2018 15:30:25 ## Make PSF build 12-Sep-2018 15:30:25 if calcpsf==True: build 12-Sep-2018 15:30:25 t0=time.time(); build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 imager.makePSF() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + if((psfphasecenter != '') and (gridder=='mosaic')): build 12-Sep-2018 15:30:25 + print "doing with different phasecenter psf" build 12-Sep-2018 15:30:25 + imager.unlockimages(0) build 12-Sep-2018 15:30:25 + psfParameters=paramList.getAllPars() build 12-Sep-2018 15:30:25 + psfParameters['phasecenter']=psfphasecenter build 12-Sep-2018 15:30:25 + psfParamList=ImagerParameters(**psfParameters) build 12-Sep-2018 15:30:25 + psfimager=imagerInst(params=psfParamList) build 12-Sep-2018 15:30:25 + psfimager.initializeImagers() build 12-Sep-2018 15:30:25 + psfimager.setWeighting() build 12-Sep-2018 15:30:25 + psfimager.makeImage('psf', psfParameters['imagename']+'.psf') build 12-Sep-2018 15:30:25 t1=time.time(); build 12-Sep-2018 15:30:25 casalog.post("***Time for making PSF: "+"%.2f"%(t1-t0)+" sec", "INFO3", "task_tclean"); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -364,7 +285,7 @@ def tclean( build 12-Sep-2018 15:30:25 t0=time.time(); build 12-Sep-2018 15:30:25 imager.runMajorCycle() build 12-Sep-2018 15:30:25 t1=time.time(); build 12-Sep-2018 15:30:25 - casalog.post("***Time for major cycle (calcres=T): "+"%.2f"%(t1-t0)+" sec", "INFO3", "task_tclean"); build 12-Sep-2018 15:30:25 + casalog.post("***Time for major cycle (calcres=T): "+"%.2f"%(t1-t0)+" sec", "INFO3", "task_tclean"); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ## In case of no deconvolution iterations.... build 12-Sep-2018 15:30:25 if niter==0 and calcres==False: build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_tclean2.py b/gcwrap/python/scripts/task_tclean2.py build 12-Sep-2018 15:30:25 index 2d14a0d..7c86a4c 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_tclean2.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/task_tclean2.py build 12-Sep-2018 15:30:25 @@ -119,6 +119,7 @@ def tclean2( build 12-Sep-2018 15:30:25 #### Sanity checks and controls build 12-Sep-2018 15:30:25 ##################################################### build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + casalog.post("Warning: the tclean2 task is only for testing. Please use tclean instead.", "WARN") build 12-Sep-2018 15:30:25 ### Move these checks elsewhere ? build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 if specmode=='mfs' and nterms==1 and deconvolver == "mtmfs": build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_visstat2.py b/gcwrap/python/scripts/task_visstat2.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 56e8089..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_visstat2.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,56 +0,0 @@ build 12-Sep-2018 15:30:25 -from taskinit import casalog build 12-Sep-2018 15:30:25 -from visstat import visstat build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def visstat2(vis=None, build 12-Sep-2018 15:30:25 - axis=None, build 12-Sep-2018 15:30:25 - datacolumn=None, build 12-Sep-2018 15:30:25 - useflags=None, build 12-Sep-2018 15:30:25 - spw=None, build 12-Sep-2018 15:30:25 - field=None, build 12-Sep-2018 15:30:25 - selectdata=None, build 12-Sep-2018 15:30:25 - antenna=None, build 12-Sep-2018 15:30:25 - uvrange=None, build 12-Sep-2018 15:30:25 - timerange=None, build 12-Sep-2018 15:30:25 - correlation=None, build 12-Sep-2018 15:30:25 - scan=None, build 12-Sep-2018 15:30:25 - array=None, build 12-Sep-2018 15:30:25 - observation=None, build 12-Sep-2018 15:30:25 - timeaverage=None, build 12-Sep-2018 15:30:25 - timebin=None, build 12-Sep-2018 15:30:25 - timespan=None, build 12-Sep-2018 15:30:25 - maxuvwdistance=None, build 12-Sep-2018 15:30:25 - disableparallel=None, build 12-Sep-2018 15:30:25 - ddistart=None, build 12-Sep-2018 15:30:25 - taql=None, build 12-Sep-2018 15:30:25 - monolithic_processing=None, build 12-Sep-2018 15:30:25 - intent=None, build 12-Sep-2018 15:30:25 - reportingaxes=None): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.origin('visstat2') build 12-Sep-2018 15:30:25 - casalog.post("Task visstat2 has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - casalog.post('"visstat2" has been renamed "visstat"; use of visstat2 is deprecated; please replace calls to visstat2 with calls to visstat', priority='INFO') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - return visstat(vis, build 12-Sep-2018 15:30:25 - axis, build 12-Sep-2018 15:30:25 - datacolumn, build 12-Sep-2018 15:30:25 - useflags, build 12-Sep-2018 15:30:25 - spw, build 12-Sep-2018 15:30:25 - field, build 12-Sep-2018 15:30:25 - selectdata, build 12-Sep-2018 15:30:25 - antenna, build 12-Sep-2018 15:30:25 - uvrange, build 12-Sep-2018 15:30:25 - timerange, build 12-Sep-2018 15:30:25 - correlation, build 12-Sep-2018 15:30:25 - scan, build 12-Sep-2018 15:30:25 - array, build 12-Sep-2018 15:30:25 - observation, build 12-Sep-2018 15:30:25 - timeaverage, build 12-Sep-2018 15:30:25 - timebin, build 12-Sep-2018 15:30:25 - timespan, build 12-Sep-2018 15:30:25 - maxuvwdistance, build 12-Sep-2018 15:30:25 - disableparallel, build 12-Sep-2018 15:30:25 - ddistart, build 12-Sep-2018 15:30:25 - taql, build 12-Sep-2018 15:30:25 - monolithic_processing, build 12-Sep-2018 15:30:25 - intent, build 12-Sep-2018 15:30:25 - reportingaxes) build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_visstatold.py b/gcwrap/python/scripts/task_visstatold.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 486d79f..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_visstatold.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,79 +0,0 @@ build 12-Sep-2018 15:30:25 -from taskinit import mstool, casalog build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def visstatold(vis=None, build 12-Sep-2018 15:30:25 - axis=None, build 12-Sep-2018 15:30:25 - datacolumn=None, build 12-Sep-2018 15:30:25 - useflags=None, build 12-Sep-2018 15:30:25 - spw=None, build 12-Sep-2018 15:30:25 - field=None, build 12-Sep-2018 15:30:25 - selectdata=None, build 12-Sep-2018 15:30:25 - antenna=None, build 12-Sep-2018 15:30:25 - uvrange=None, build 12-Sep-2018 15:30:25 - timerange=None, build 12-Sep-2018 15:30:25 - correlation=None, build 12-Sep-2018 15:30:25 - scan=None, build 12-Sep-2018 15:30:25 - array=None, build 12-Sep-2018 15:30:25 - observation=None): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.origin('visstatold') build 12-Sep-2018 15:30:25 - casalog.post("Task visstatold has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - casalog.post('Use of visstatold is deprecated; please replace calls to visstatold with calls to visstat', priority='WARN') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mslocal = mstool() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mslocal.open(vis) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if axis in ['amp', 'amplitude', 'phase', 'imag', 'imaginary', 'real']: build 12-Sep-2018 15:30:25 - complex_type = axis build 12-Sep-2018 15:30:25 - col = datacolumn build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - complex_type = '' build 12-Sep-2018 15:30:25 - col = axis build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if (not selectdata): build 12-Sep-2018 15:30:25 - antenna='' build 12-Sep-2018 15:30:25 - uvrange='' build 12-Sep-2018 15:30:25 - timerange='' build 12-Sep-2018 15:30:25 - correlation='' build 12-Sep-2018 15:30:25 - scan='' build 12-Sep-2018 15:30:25 - array='' build 12-Sep-2018 15:30:25 - observation = '' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - s = mslocal.statisticsold(column=col.upper(), build 12-Sep-2018 15:30:25 - complex_value=complex_type, build 12-Sep-2018 15:30:25 - useflags=useflags, build 12-Sep-2018 15:30:25 - spw=spw, build 12-Sep-2018 15:30:25 - field=field, build 12-Sep-2018 15:30:25 - baseline=antenna, build 12-Sep-2018 15:30:25 - uvrange=uvrange, build 12-Sep-2018 15:30:25 - time=timerange, build 12-Sep-2018 15:30:25 - correlation=correlation, build 12-Sep-2018 15:30:25 - scan=scan, build 12-Sep-2018 15:30:25 - array=array, build 12-Sep-2018 15:30:25 - obs=str(observation)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mslocal.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - for stats in s.keys(): build 12-Sep-2018 15:30:25 - casalog.post(stats + " values --- ", "NORMAL") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if s[stats]['npts'] > 0: build 12-Sep-2018 15:30:25 - casalog.post(" -- number of points [npts]: " + str(int(round(s[stats]['npts']))), "NORMAL") build 12-Sep-2018 15:30:25 - casalog.post(" -- minimum value [min]: " + str(s[stats]['min' ]), "NORMAL") build 12-Sep-2018 15:30:25 - casalog.post(" -- maximum value [max]: " + str(s[stats]['max' ]), "NORMAL") build 12-Sep-2018 15:30:25 - casalog.post(" -- Sum of values [sum]: " + str(s[stats]['sum' ]), "NORMAL") build 12-Sep-2018 15:30:25 - casalog.post(" -- Sum of squared values [sumsq]: " + str(s[stats]['sumsq']), "NORMAL") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.post(stats + " statistics --- ", "NORMAL") build 12-Sep-2018 15:30:25 - if s[stats]['npts'] > 0: build 12-Sep-2018 15:30:25 - casalog.post(" -- Mean of the values [mean]: " + str(s[stats]['mean']), "NORMAL") build 12-Sep-2018 15:30:25 - casalog.post(" -- Variance of the values [var]: " + str(s[stats]['var']), "NORMAL") build 12-Sep-2018 15:30:25 - casalog.post(" -- Standard deviation of the values [stddev]: " + str(s[stats]['stddev']), "NORMAL") build 12-Sep-2018 15:30:25 - casalog.post(" -- Root mean square [rms]: " + str(s[stats]['rms']), "NORMAL") build 12-Sep-2018 15:30:25 - casalog.post(" -- Median of the pixel values [median]: " + str(s[stats]['median']), "NORMAL") build 12-Sep-2018 15:30:25 - casalog.post(" -- Median of the deviations [medabsdevmed]: " + str(s[stats]['medabsdevmed']), "NORMAL") build 12-Sep-2018 15:30:25 - casalog.post(" -- Quartile [quartile]: " + str(s[stats]['quartile']), "NORMAL") build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - casalog.post(stats + " -- No valid points found", "WARN") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - return s build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/task_widefield.py b/gcwrap/python/scripts/task_widefield.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index cd59449..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/task_widefield.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,221 +0,0 @@ build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -#import pdb build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 -from cleanhelper import * build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def widefield(vis, imagename, outlierfile, field, spw, selectdata, timerange, uvrange, antenna, scan, mode, niter, gain, threshold, psfmode, ftmachine, facets, wprojplanes,multiscale, negcomponent, interactive, mask, nchan, start, width, imsize, cell, phasecenter, restfreq, stokes, weighting, robust, npixels, noise, cyclefactor, cyclespeedup, npercycle, uvtaper, outertaper, innertaper, restoringbeam, calready): build 12-Sep-2018 15:30:25 - """Calculate a wide-field deconvolved image with selected algorithm: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - ms1=mstool() build 12-Sep-2018 15:30:25 - ### build 12-Sep-2018 15:30:25 - #Python script build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - casalog.origin('widefield') build 12-Sep-2018 15:30:25 - multims=False build 12-Sep-2018 15:30:25 - if((type(vis)==list)): build 12-Sep-2018 15:30:25 - if(len(vis) > 1): build 12-Sep-2018 15:30:25 - multims=True build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - vis=vis[0] build 12-Sep-2018 15:30:25 - multifield=False build 12-Sep-2018 15:30:25 - if(multims): build 12-Sep-2018 15:30:25 - print ' multiple ms not handle for now' build 12-Sep-2018 15:30:25 - return build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if((type(imagename)==list) & (len(imagename) >1)): build 12-Sep-2018 15:30:25 - multifield=True build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - if((type(phasecenter) == list) and (len(phasecenter) >1)): build 12-Sep-2018 15:30:25 - raise TypeError, 'Number of phasecenters has be equal to number of images' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -###Set image parameters build 12-Sep-2018 15:30:25 - casalog.origin('widefield') build 12-Sep-2018 15:30:25 - casalog.post("Task widefield has been deprecated and will be removed in release 5.4.", "WARN") build 12-Sep-2018 15:30:25 - im1=imtool() build 12-Sep-2018 15:30:25 - if(multims): build 12-Sep-2018 15:30:25 - imset=cleanhelper() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - imset=cleanhelper(im1, vis, calready) build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# if(multims): build 12-Sep-2018 15:30:25 -# visi=vis[len(vis)-1] build 12-Sep-2018 15:30:25 -# else: build 12-Sep-2018 15:30:25 -# visi=vis build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# if(multifield): build 12-Sep-2018 15:30:25 -# if(type(phasecenter) != list): build 12-Sep-2018 15:30:25 -# raise TypeError, 'Number of phasecenters has be equal to number of images' build 12-Sep-2018 15:30:25 -# for k in range(len(phasecenter)): build 12-Sep-2018 15:30:25 -# pc=phasecenter[k] build 12-Sep-2018 15:30:25 -# phasecenter[k]=test_phasecenter(pc, visi) build 12-Sep-2018 15:30:25 -# else: build 12-Sep-2018 15:30:25 -# phasecenter=test_phasecenter(phasecenter, visi) build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# spwindex=-1; build 12-Sep-2018 15:30:25 -# spws=spw build 12-Sep-2018 15:30:25 -# if(multims & (type(spw)==list)): build 12-Sep-2018 15:30:25 -# spws=spw[0] build 12-Sep-2018 15:30:25 -# if( (spws==-1) or (spws=='-1') or (spws=='') or (spws==[-1])): build 12-Sep-2018 15:30:25 -# spwindex=-1 build 12-Sep-2018 15:30:25 -# spws='' build 12-Sep-2018 15:30:25 -# else: build 12-Sep-2018 15:30:25 -# thems=vis build 12-Sep-2018 15:30:25 -# if(multims): build 12-Sep-2018 15:30:25 -# thems=vis[0] build 12-Sep-2018 15:30:25 -# spwindex=ms1.msseltoindex(thems, spw=spws)['spw'].tolist() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -##### build 12-Sep-2018 15:30:25 - imageids=[] build 12-Sep-2018 15:30:25 - imsizes=[] build 12-Sep-2018 15:30:25 - phasecenters=[] build 12-Sep-2018 15:30:25 - rootname='' build 12-Sep-2018 15:30:25 - if(len(outlierfile) != 0): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imsizes,phasecenters,imageids=imset.readoutlier(outlierfile) build 12-Sep-2018 15:30:25 - if(type(rootname)==list): build 12-Sep-2018 15:30:25 - rootname=imagename[0] build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - rootname=imagename build 12-Sep-2018 15:30:25 - if(len(imageids) > 1): build 12-Sep-2018 15:30:25 - multifield=True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - imsizes=imsize build 12-Sep-2018 15:30:25 - phasecenters=phasecenter build 12-Sep-2018 15:30:25 - imageids=imagename build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imset.definemultiimages(rootname, imsizes, cell, stokes, mode, spw, nchan, start,width, restfreq, field, phasecenters, imageids, facets) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -############Data Selection build 12-Sep-2018 15:30:25 - if(multims): build 12-Sep-2018 15:30:25 - if(type(spw) == list): build 12-Sep-2018 15:30:25 - if(len(spw) != len(vis)): build 12-Sep-2018 15:30:25 - raise ValueError, 'Number of spw selection should match number of data sets' build 12-Sep-2018 15:30:25 - if(type(field) == list): build 12-Sep-2018 15:30:25 - if(len(field) != len(vis)): build 12-Sep-2018 15:30:25 - raise ValueError, 'Number of field selection should match number of data sets' build 12-Sep-2018 15:30:25 - for k in range(len(vis)): build 12-Sep-2018 15:30:25 - spws=spw build 12-Sep-2018 15:30:25 - if(type(spw) != list): build 12-Sep-2018 15:30:25 - spws=spw build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - spws=spw[k] build 12-Sep-2018 15:30:25 - fields=field build 12-Sep-2018 15:30:25 - if(type(field) != list): build 12-Sep-2018 15:30:25 - fields=field build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - fields=field[k] build 12-Sep-2018 15:30:25 - if(not os.path.exists(vis[k])): build 12-Sep-2018 15:30:25 - raise Exception, 'Visibility data %s set not found - please verify the name'%vis[k] build 12-Sep-2018 15:30:25 - im1.selectvis(vis=vis[k], spw=spws, field=fields) build 12-Sep-2018 15:30:25 - elif ((type(vis)==str) & (os.path.exists(vis))): build 12-Sep-2018 15:30:25 - imset.datselweightfilter(field=field, spw=spw, build 12-Sep-2018 15:30:25 - timerange=timerange, uvrange=uvrange, build 12-Sep-2018 15:30:25 - antenna=antenna, scan=scan, build 12-Sep-2018 15:30:25 - wgttype=weighting, robust=robust, build 12-Sep-2018 15:30:25 - noise=noise, npixels=npixels, build 12-Sep-2018 15:30:25 - mosweight=False, build 12-Sep-2018 15:30:25 - innertaper=innertaper, build 12-Sep-2018 15:30:25 - outertaper=outertaper, build 12-Sep-2018 15:30:25 - calready=calready) build 12-Sep-2018 15:30:25 - ############End of Data Selection build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - raise Exception, 'Visibility data set not found - please verify the name' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -###deal with masks build 12-Sep-2018 15:30:25 - maskimage='' build 12-Sep-2018 15:30:25 - if((mask==[]) or (mask=='')): build 12-Sep-2018 15:30:25 - mask=[''] build 12-Sep-2018 15:30:25 - if (interactive): build 12-Sep-2018 15:30:25 - if( (mask=='') or (mask==[''])or (mask==[])): build 12-Sep-2018 15:30:25 - if(type(imagename)==list): build 12-Sep-2018 15:30:25 - maskimage=[] build 12-Sep-2018 15:30:25 - for namoo in imagename: build 12-Sep-2018 15:30:25 - maskimage.append(namoo+'.mask') build 12-Sep-2018 15:30:25 - imset.maskimages[namoo]=namoo+'.mask' build 12-Sep-2018 15:30:25 - elif((type(imagename)==str) and (len(outlierfile) != 0)): build 12-Sep-2018 15:30:25 - maskimage=imagename+'.mask' build 12-Sep-2018 15:30:25 - imset.maskimages[imagename]=imagename+'.mask' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -#### build 12-Sep-2018 15:30:25 - padd=1.0 build 12-Sep-2018 15:30:25 - if(facets > 1): build 12-Sep-2018 15:30:25 - padd=1.2 build 12-Sep-2018 15:30:25 - im1.setoptions(ftmachine=ftmachine,padding=padd, wprojplanes=wprojplanes) build 12-Sep-2018 15:30:25 - #im1.setmfcontrol(scaletype=scaletype,minpb=minpb) build 12-Sep-2018 15:30:25 - im1.setmfcontrol(stoplargenegatives=negcomponent,cyclefactor=cyclefactor,cyclespeedup=cyclespeedup) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ##do themask build 12-Sep-2018 15:30:25 - if((maskimage=='') and (mask != [''])): build 12-Sep-2018 15:30:25 - maskimage=imset.imagelist[0]+'.mask' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if(not multifield): build 12-Sep-2018 15:30:25 - imset.makemaskimage(outputmask=maskimage, imagename=imagename, build 12-Sep-2018 15:30:25 - maskobject=mask) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - imset.makemultifieldmask(mask) build 12-Sep-2018 15:30:25 - maskimage=[] build 12-Sep-2018 15:30:25 - for k in range(len(imset.maskimages)): build 12-Sep-2018 15:30:25 - maskimage.append(imset.maskimages[imset.imagelist[k]]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imset.setrestoringbeam(restoringbeam) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - alg='mfclark' build 12-Sep-2018 15:30:25 -##### build 12-Sep-2018 15:30:25 -###Determine algorithm to use build 12-Sep-2018 15:30:25 - if((psfmode=='clark') or (psfmode=='hogbom')): build 12-Sep-2018 15:30:25 - if(facets > 1): build 12-Sep-2018 15:30:25 - alg='wf'+psfmode build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - alg='mf'+psfmode build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if(multiscale==[0]): build 12-Sep-2018 15:30:25 - multiscale=[] build 12-Sep-2018 15:30:25 - if((type(multiscale)==list) and (len(multiscale)>0)): build 12-Sep-2018 15:30:25 - if(facets >1): build 12-Sep-2018 15:30:25 - raise Exception, 'multiscale with facets > 1 not allowed for now' build 12-Sep-2018 15:30:25 - alg='mfmultiscale' build 12-Sep-2018 15:30:25 - im1.setscales(scalemethod='uservector', build 12-Sep-2018 15:30:25 - uservector=multiscale) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - modelimage=[] build 12-Sep-2018 15:30:25 - restoredimage=[] build 12-Sep-2018 15:30:25 - residualimage=[] build 12-Sep-2018 15:30:25 - for k in range(len(imset.imagelist)): build 12-Sep-2018 15:30:25 - modelimage.append(imset.imagelist[k]) build 12-Sep-2018 15:30:25 - restoredimage.append(imset.imagelist[k]+'.image') build 12-Sep-2018 15:30:25 - residualimage.append(imset.imagelist[k]+'.residual') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ##will have to enable entropy later build 12-Sep-2018 15:30:25 - if (alg=='mfentropy' or alg=='mfemptiness'): build 12-Sep-2018 15:30:25 - im1.mem(algorithm=alg,niter=niter,sigma=sigma,targetflux=targetflux,constrainflux=constrainflux,keepfixed=[False],prior=prior,model=modelimage,residual=residualimage,image=restoredimage,mask=maskimage) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - im1.clean(algorithm=alg,niter=niter,gain=gain,threshold=qa.quantity(threshold,'mJy'),model=modelimage,residual=residualimage,image=restoredimage,mask=maskimage,interactive=interactive,npercycle=npercycle) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - im1.done() build 12-Sep-2018 15:30:25 - del im1 build 12-Sep-2018 15:30:25 - # del ms1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - except Exception, instance: build 12-Sep-2018 15:30:25 - print '*** Error *** ',instance build 12-Sep-2018 15:30:25 - raise Exception, instance build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/testhelper.py b/gcwrap/python/scripts/testhelper.py build 12-Sep-2018 15:30:25 index ca71909..cc50879 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/testhelper.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/testhelper.py build 12-Sep-2018 15:30:25 @@ -364,7 +364,30 @@ def getChannels(msname, spwid, chanlist): build 12-Sep-2018 15:30:25 tb.close() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 return selchans build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +def get_channel_freqs_widths(msname, spwid): build 12-Sep-2018 15:30:25 + ''' build 12-Sep-2018 15:30:25 + Get frequencies and widths of all the channels for an spw ID build 12-Sep-2018 15:30:25 + msname --> name of MS build 12-Sep-2018 15:30:25 + spwid --> spw ID build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Return two numpy arrays (frequencies, widths), each of the same length as the number of build 12-Sep-2018 15:30:25 + channels''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + spw_table = os.path.join(msname, 'SPECTRAL_WINDOW') build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + tb.open(spw_table) build 12-Sep-2018 15:30:25 + except RuntimeError: build 12-Sep-2018 15:30:25 + print 'Cannot open table: {0}'.format(spw_table) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + freqs = tb.getcell("CHAN_FREQ", spwid) build 12-Sep-2018 15:30:25 + widths = tb.getcell("CHAN_WIDTH", spwid) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + finally: build 12-Sep-2018 15:30:25 + tb.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + return freqs, widths build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def getColDesc(table, colname): build 12-Sep-2018 15:30:25 '''Get the description of a column in a table build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/CMakeLists.txt b/gcwrap/python/scripts/tests/CMakeLists.txt build 12-Sep-2018 15:30:25 index 0e53623..4696a17 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/CMakeLists.txt build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/CMakeLists.txt build 12-Sep-2018 15:30:25 @@ -37,7 +37,6 @@ casa_add_python( tools tools_tests_python lib/python${PYTHONV}/tests build 12-Sep-2018 15:30:25 test_conjugatevis.py build 12-Sep-2018 15:30:25 test_coordsys.py build 12-Sep-2018 15:30:25 test_createmultims.py build 12-Sep-2018 15:30:25 - test_csvclean.py build 12-Sep-2018 15:30:25 test_cvel.py build 12-Sep-2018 15:30:25 test_cvel2.py build 12-Sep-2018 15:30:25 test_cvelfreqs.py build 12-Sep-2018 15:30:25 @@ -80,6 +79,7 @@ casa_add_python( tools tools_tests_python lib/python${PYTHONV}/tests build 12-Sep-2018 15:30:25 test_ia_fromrecord.py build 12-Sep-2018 15:30:25 test_ia_fromshape.py build 12-Sep-2018 15:30:25 test_ia_getregion.py build 12-Sep-2018 15:30:25 + test_ia_getslice.py build 12-Sep-2018 15:30:25 test_ia_hanning.py build 12-Sep-2018 15:30:25 test_ia_histograms.py build 12-Sep-2018 15:30:25 test_ia_imageconcat.py build 12-Sep-2018 15:30:25 @@ -120,7 +120,7 @@ casa_add_python( tools tools_tests_python lib/python${PYTHONV}/tests build 12-Sep-2018 15:30:25 test_importasdm.py build 12-Sep-2018 15:30:25 test_importasdm_mms.py build 12-Sep-2018 15:30:25 test_importatca.py build 12-Sep-2018 15:30:25 - test_importevla.py build 12-Sep-2018 15:30:25 + test_importcasa.py build 12-Sep-2018 15:30:25 test_importfitsidi.py build 12-Sep-2018 15:30:25 test_importmiriad.py build 12-Sep-2018 15:30:25 test_importnro.py build 12-Sep-2018 15:30:25 @@ -212,8 +212,8 @@ casa_add_python( tools tools_tests_python lib/python${PYTHONV}/tests build 12-Sep-2018 15:30:25 test_split.py build 12-Sep-2018 15:30:25 test_split2.py build 12-Sep-2018 15:30:25 test_spxfit.py build 12-Sep-2018 15:30:25 + test_oldstatwt.py build 12-Sep-2018 15:30:25 test_statwt.py build 12-Sep-2018 15:30:25 - test_statwt2.py build 12-Sep-2018 15:30:25 test_testconcat.py build 12-Sep-2018 15:30:25 test_uvcontsub.py build 12-Sep-2018 15:30:25 test_uvcontsub3.py build 12-Sep-2018 15:30:25 @@ -221,7 +221,6 @@ casa_add_python( tools tools_tests_python lib/python${PYTHONV}/tests build 12-Sep-2018 15:30:25 test_viewer.py build 12-Sep-2018 15:30:25 test_virtualconcat.py build 12-Sep-2018 15:30:25 test_vishead.py build 12-Sep-2018 15:30:25 - test_visstatold.py build 12-Sep-2018 15:30:25 test_visstat.py build 12-Sep-2018 15:30:25 test_vpmanager.py build 12-Sep-2018 15:30:25 test_wvrgcal.py build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_csvclean.py b/gcwrap/python/scripts/tests/test_csvclean.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index cf0428a..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_csvclean.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,289 +0,0 @@ build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -import sys build 12-Sep-2018 15:30:25 -import shutil build 12-Sep-2018 15:30:25 -from __main__ import default build 12-Sep-2018 15:30:25 -from tasks import * build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 -import unittest build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -_ia = iatool( ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -''' build 12-Sep-2018 15:30:25 -Unit tests for task csvclean. It tests the following parameters: build 12-Sep-2018 15:30:25 - vis: wrong and correct values build 12-Sep-2018 15:30:25 - imagename: if output exists build 12-Sep-2018 15:30:25 - field: wrong field type; non-default value build 12-Sep-2018 15:30:25 - spw: wrong value; non-default value build 12-Sep-2018 15:30:25 - niter: wrong type; non-default values build 12-Sep-2018 15:30:25 - imsize: zero value; non-default value build 12-Sep-2018 15:30:25 - cell: unsupported value; non-default value build 12-Sep-2018 15:30:25 - phasecenter: non-default and invalid values build 12-Sep-2018 15:30:25 - weighting: unsupported value; non-default values build 12-Sep-2018 15:30:25 - restoringbeam: non-default values build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Other tests: check the value of a pixel. build 12-Sep-2018 15:30:25 -''' build 12-Sep-2018 15:30:25 -class csvclean_test1(unittest.TestCase): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Input and output names build 12-Sep-2018 15:30:25 - msfile = 'ngc5921.ms' build 12-Sep-2018 15:30:25 - fits = 'ngc5921.fits' build 12-Sep-2018 15:30:25 - res = None build 12-Sep-2018 15:30:25 - img = 'csvcleantest1' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp(self): build 12-Sep-2018 15:30:25 - self.res = None build 12-Sep-2018 15:30:25 - if (os.path.exists(self.fits)): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.fits) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - datapath = os.environ.get('CASAPATH').split()[0] + '/data/regression/ngc5921/' build 12-Sep-2018 15:30:25 - shutil.copyfile(datapath+self.fits, self.fits) build 12-Sep-2018 15:30:25 - importuvfits(fitsfile=self.fits, vis=self.msfile) build 12-Sep-2018 15:30:25 - default(csvclean) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def tearDown(self): build 12-Sep-2018 15:30:25 - if (os.path.exists(self.msfile)): build 12-Sep-2018 15:30:25 - shutil.rmtree(self.msfile) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('rm -rf ' + self.img+'*') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def getpixval(self,img,pixel): build 12-Sep-2018 15:30:25 - _ia.open(img) build 12-Sep-2018 15:30:25 - px = _ia.pixelvalue(pixel) build 12-Sep-2018 15:30:25 - _ia.close() build 12-Sep-2018 15:30:25 - return px['value']['value'] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def verify_stats(self,stats): build 12-Sep-2018 15:30:25 - results = {'success': True, 'msgs': "", 'error_msgs': '' } build 12-Sep-2018 15:30:25 - # Reference statistical values build 12-Sep-2018 15:30:25 - ref = {'flux': ([-1.28087772]), build 12-Sep-2018 15:30:25 - 'max': ([ 0.00011397]), build 12-Sep-2018 15:30:25 - 'mean': ([ -1.18477533e-05]), build 12-Sep-2018 15:30:25 - 'min': ([-0.00013796]), build 12-Sep-2018 15:30:25 - 'npts': ([ 250000.]), build 12-Sep-2018 15:30:25 - 'rms': ([ 4.25508006e-05]), build 12-Sep-2018 15:30:25 - 'sigma': ([ 4.08681795e-05]), build 12-Sep-2018 15:30:25 - 'sum': ([-2.96193832]), build 12-Sep-2018 15:30:25 - 'sumsq': ([ 0.00045264])} build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - for r in ref: build 12-Sep-2018 15:30:25 - diff = abs(ref[r] - stats[r][0]) build 12-Sep-2018 15:30:25 - if (diff > 10e-5): build 12-Sep-2018 15:30:25 - results['success']=False build 12-Sep-2018 15:30:25 - results['error_msgs']=results['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Statistics failed for %s. "%r build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - print 'expected %s=%s, got %s=%s'%(r,stats[r], r,ref[r]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - return results build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def verify_field(self,image,phasecenter): build 12-Sep-2018 15:30:25 - #use ia.summary, get the coordinates from refval and build 12-Sep-2018 15:30:25 - #compare to the ones given to csvclean build 12-Sep-2018 15:30:25 - _ia.open(image) build 12-Sep-2018 15:30:25 - summary = _ia.summary() build 12-Sep-2018 15:30:25 - _ia.close() build 12-Sep-2018 15:30:25 - # values of refval are in radians build 12-Sep-2018 15:30:25 - ra = summary['refval'][0] build 12-Sep-2018 15:30:25 - dec = summary['refval'][1] build 12-Sep-2018 15:30:25 - RA = qa.time(qa.quantity(ra,'rad')) build 12-Sep-2018 15:30:25 - DEC = qa.time(qa.quantity(dec,'rad')) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # compare RA and DEC with what comes from listobs build 12-Sep-2018 15:30:25 - ms.open(self.msfile) build 12-Sep-2018 15:30:25 - info = ms.summary(True) build 12-Sep-2018 15:30:25 - ms.close() build 12-Sep-2018 15:30:25 - if (type(phasecenter) == int): build 12-Sep-2018 15:30:25 - fld = 'field_'+str(phasecenter) build 12-Sep-2018 15:30:25 - ra = info[fld]['direction']['m0']['value'] build 12-Sep-2018 15:30:25 - dec = info[fld]['direction']['m1']['value'] build 12-Sep-2018 15:30:25 - mRA = qa.time(qa.quantity(ra,'rad')) build 12-Sep-2018 15:30:25 - mDEC = qa.time(qa.quantity(dec,'rad')) build 12-Sep-2018 15:30:25 -# if ((RA != mRA) or (DEC != mDEC)): build 12-Sep-2018 15:30:25 -# print 'ERROR: MS: RA=%s, DEC=%s and IMG: RA=%s, DEC=%s'%(mRA,mDEC,RA,DEC) build 12-Sep-2018 15:30:25 -# return False build 12-Sep-2018 15:30:25 - elif (type(phasecenter) == str): build 12-Sep-2018 15:30:25 - for i in range(3): build 12-Sep-2018 15:30:25 - fieldid = 'field_'+str(i) build 12-Sep-2018 15:30:25 - ra = info[fieldid]['direction']['m0']['value'] build 12-Sep-2018 15:30:25 - dec = info[fieldid]['direction']['m1']['value'] build 12-Sep-2018 15:30:25 - mRA = qa.time(qa.quantity(ra,'rad')) build 12-Sep-2018 15:30:25 - mDEC = qa.time(qa.quantity(dec,'rad')) build 12-Sep-2018 15:30:25 - if ((RA == mRA) and (DEC == mDEC)): build 12-Sep-2018 15:30:25 - break build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if ((RA != mRA) or (DEC != mDEC)): build 12-Sep-2018 15:30:25 - print 'ERROR: MS: RA=%s, DEC=%s and IMG: RA=%s, DEC=%s'%(mRA,mDEC,RA,DEC) build 12-Sep-2018 15:30:25 - return False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - return True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test1(self): build 12-Sep-2018 15:30:25 - '''Csvclean 1: Default values''' build 12-Sep-2018 15:30:25 - self.res = csvclean() build 12-Sep-2018 15:30:25 - self.assertFalse(self.res) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test2(self): build 12-Sep-2018 15:30:25 - """Csvclean 2: Wrong input should return False""" build 12-Sep-2018 15:30:25 - msfile = 'badfilename' build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=msfile, imagename=self.img) build 12-Sep-2018 15:30:25 - self.assertFalse(self.res) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test3(self): build 12-Sep-2018 15:30:25 - """Csvclean 3: Good input should return True""" build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img) build 12-Sep-2018 15:30:25 - self.assertTrue(self.res) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test4(self): build 12-Sep-2018 15:30:25 - """Csvclean 4: Check if output exists""" build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.image')) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test5(self): build 12-Sep-2018 15:30:25 - """Csvclean 5: Wrong field type""" build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img,field=0) build 12-Sep-2018 15:30:25 - self.assertFalse(self.res) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test6(self): build 12-Sep-2018 15:30:25 - """Csvclean 6: Non-default field value""" build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img,field='2') build 12-Sep-2018 15:30:25 - self.assertTrue(self.res) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.image')) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test7(self): build 12-Sep-2018 15:30:25 - """Csvclean 7: Wrong spw value""" build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img,spw='10') build 12-Sep-2018 15:30:25 - self.assertFalse(os.path.exists(self.img+'.image')) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test8(self): build 12-Sep-2018 15:30:25 - """Csvclean 8: Non-default spw value""" build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img,spw='0') build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.image')) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test9(self): build 12-Sep-2018 15:30:25 - """Csvclean 9: Wrong niter type""" build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img,niter='1') build 12-Sep-2018 15:30:25 - self.assertFalse(self.res) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test10(self): build 12-Sep-2018 15:30:25 - """Csvclean 10: Non-default niter values""" build 12-Sep-2018 15:30:25 - for n in range(10,400,50): build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img,niter=n) build 12-Sep-2018 15:30:25 - self.assertTrue(self.res,'Failed for niter = %s' %n) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test11(self): build 12-Sep-2018 15:30:25 - """Csvclean 11: Zero value of imsize""" build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img,imsize=0) build 12-Sep-2018 15:30:25 - self.assertFalse(os.path.exists(self.img+'.image')) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test12(self): build 12-Sep-2018 15:30:25 - '''Csvclean 12: Non-default imsize values''' build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img,imsize=[80,80]) build 12-Sep-2018 15:30:25 - self.assertTrue(self.res) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.image'),'Image %s does not exist' %self.img) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test13(self): build 12-Sep-2018 15:30:25 - """Csvclean 13: Non-default cell values""" build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img, cell=12.5) build 12-Sep-2018 15:30:25 - self.assertTrue(self.res,'Task returned %s'%self.res) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.image')) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test14(self): build 12-Sep-2018 15:30:25 - '''Csvclean 14: Unsupported weighting mode''' build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img, weighting='median') build 12-Sep-2018 15:30:25 - self.assertFalse(self.res) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test15(self): build 12-Sep-2018 15:30:25 - '''Csvclean 15: Non-default weighting uniform''' build 12-Sep-2018 15:30:25 - retValue = {'success': True, 'msgs': "", 'error_msgs': '' } build 12-Sep-2018 15:30:25 - weights = ['natural','uniform','briggs','radial'] build 12-Sep-2018 15:30:25 - for w in weights: build 12-Sep-2018 15:30:25 - out = self.img+'.'+w build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=out, imsize=500,weighting=w) build 12-Sep-2018 15:30:25 - if not (os.path.exists(out+'.image')): build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Failed to create image=%s when weighting=%s."%(out+'.image',w) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(retValue['success'],retValue['error_msgs']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test16(self): build 12-Sep-2018 15:30:25 - '''Csvclean 16: Test parameter restoringbeam''' build 12-Sep-2018 15:30:25 - retValue = {'success': True, 'msgs': "", 'error_msgs': '' } build 12-Sep-2018 15:30:25 - p = ['0.5arcsec','0.25arcsec','0.3'] build 12-Sep-2018 15:30:25 - out = 'myimg' build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=out, imsize=500,restoringbeam='0.5arcsec') build 12-Sep-2018 15:30:25 - if not (os.path.exists(out+'.image')): build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Failed to create image=%s when restoringbeam=\'0.25arcsec\'."%out+'.image' build 12-Sep-2018 15:30:25 - os.system('rm -rf myimg.image') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - beam = ['0.5arcsec','0.25arcsec'] build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=out, imsize=500,restoringbeam=beam) build 12-Sep-2018 15:30:25 - if not (os.path.exists(out+'.image')): build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Failed to create image=%s when restoringbeam=%s."%(out+'.image',beam) build 12-Sep-2018 15:30:25 - os.system('rm -rf myimg.image') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - beam = ['0.5arcsec','0.25arcsec','0.3deg'] build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=out, imsize=500,restoringbeam=beam) build 12-Sep-2018 15:30:25 - if not (os.path.exists(out+'.image')): build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Failed to create image=%s when restoringbeam=%s."%(out+'.image',beam) build 12-Sep-2018 15:30:25 - os.system('rm -rf myimg.image') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(retValue['success'],retValue['error_msgs']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test17(self): build 12-Sep-2018 15:30:25 - '''Csvclean 17: Verify statistics of image---DISABLED''' build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img,field='2',imsize=[500,500], build 12-Sep-2018 15:30:25 - niter=10, restoringbeam=['0.5arcsec'],cell='0.35arcsec',phasecenter=0) build 12-Sep-2018 15:30:25 - _ia.open(self.img+'.image') build 12-Sep-2018 15:30:25 - stats = _ia.statistics(list=True, verbose=True) build 12-Sep-2018 15:30:25 - _ia.close() build 12-Sep-2018 15:30:25 - print stats build 12-Sep-2018 15:30:25 - retValue = self.verify_stats(stats) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ####Forcing True build 12-Sep-2018 15:30:25 - retValue['success']=True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(retValue['success'],retValue['error_msgs']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test18(self): build 12-Sep-2018 15:30:25 - '''Csvclean 18: Choose a non-default phasecenter''' build 12-Sep-2018 15:30:25 - phc = 2 build 12-Sep-2018 15:30:25 - im = self.img+'.image' build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img,imsize=[100,100], build 12-Sep-2018 15:30:25 - niter=10,phasecenter=phc) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - retValue = self.verify_field(im,phc) build 12-Sep-2018 15:30:25 - self.assertTrue(retValue,'MS and image coordinates of phasecenter are not the same') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test19(self): build 12-Sep-2018 15:30:25 - '''Csvclean 19: Choose a non-existent phasecenter''' build 12-Sep-2018 15:30:25 - phc = 4 build 12-Sep-2018 15:30:25 - im = self.img+'.image' build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img,imsize=[100,100], build 12-Sep-2018 15:30:25 - niter=10,phasecenter=phc) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertFalse(self.res,'Phasecenter does not exist and should return an error.') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test20(self): build 12-Sep-2018 15:30:25 - '''Csvclean 20: Choose a string phasecenter''' build 12-Sep-2018 15:30:25 - coord = '14h45m16 +09d58m36' build 12-Sep-2018 15:30:25 - phc = 'J2000 '+coord build 12-Sep-2018 15:30:25 - im = self.img+'.image' build 12-Sep-2018 15:30:25 - self.res = csvclean(vis=self.msfile,imagename=self.img,imsize=[100,100], build 12-Sep-2018 15:30:25 - niter=10,phasecenter=phc) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - retValue = self.verify_field(im,coord) build 12-Sep-2018 15:30:25 - self.assertTrue(retValue,'MS and image coordinates of phasecenter are not the same') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def suite(): build 12-Sep-2018 15:30:25 - return [csvclean_test1] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_exportasdm.py b/gcwrap/python/scripts/tests/test_exportasdm.py build 12-Sep-2018 15:30:25 index 82454f2..0495bff 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_exportasdm.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_exportasdm.py build 12-Sep-2018 15:30:25 @@ -40,9 +40,6 @@ class exportasdm_test(unittest.TestCase): build 12-Sep-2018 15:30:25 os.system('cp -R '+os.environ['CASAPATH'].split()[0]+'/data/regression/exportasdm/input/Itziar.ms .') build 12-Sep-2018 15:30:25 if(not os.path.exists(self.vis_g)): build 12-Sep-2018 15:30:25 os.system('cp -R '+os.environ['CASAPATH'].split()[0]+'/data/regression/exportasdm/input/M51.ms .') build 12-Sep-2018 15:30:25 - if(not os.path.exists(self.vis_h)): build 12-Sep-2018 15:30:25 - os.system('ln -sf '+os.environ['CASAPATH'].split()[0]+'/data/regression/unittest/importevla/X_osro_013.55979.93803716435') build 12-Sep-2018 15:30:25 - importevla('X_osro_013.55979.93803716435', vis = 'xosro2ref.ms', online=False, scans='0:2') build 12-Sep-2018 15:30:25 if(not os.path.exists(self.vis_i)): build 12-Sep-2018 15:30:25 os.system('ln -sf '+os.environ['CASAPATH'].split()[0]+'/data/regression/asdm-import/input/uid___A002_X72bc38_X000') build 12-Sep-2018 15:30:25 importasdm('uid___A002_X72bc38_X000', vis = 'asdm.ms', scans='0:2') build 12-Sep-2018 15:30:25 @@ -278,7 +275,6 @@ class exportasdm_test(unittest.TestCase): build 12-Sep-2018 15:30:25 myvis = self.vis_h build 12-Sep-2018 15:30:25 os.system('rm -rf xosro2ref-reimp.ms xosro2asdm') build 12-Sep-2018 15:30:25 self.rval = exportasdm(vis=myvis, asdm='xosro2asdm', apcorrected=False, verbose=True) build 12-Sep-2018 15:30:25 - importevla(asdm='xosro2asdm', vis='xosro2ref-reimp.ms', online=False, verbose=True) build 12-Sep-2018 15:30:25 self.rval = self.rval and th.compmsmainnumcol(myvis, 'xosro2ref-reimp.ms', 1E-5) build 12-Sep-2018 15:30:25 self.rval = self.rval and th.compmsmainboolcol(myvis, 'xosro2ref-reimp.ms') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_flagdata.py b/gcwrap/python/scripts/tests/test_flagdata.py build 12-Sep-2018 15:30:25 index 96007a5..b5aa909 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_flagdata.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_flagdata.py build 12-Sep-2018 15:30:25 @@ -116,16 +116,16 @@ class test_base(unittest.TestCase): build 12-Sep-2018 15:30:25 def setUp_data4tfcrop(self): build 12-Sep-2018 15:30:25 '''EVLA MS, 4 ants, scan=30,31 spw=0~15, 64 chans, RR,RL,LR,LL''' build 12-Sep-2018 15:30:25 self.vis = "Four_ants_3C286.ms" build 12-Sep-2018 15:30:25 + self._check_path_move_remove_versions_unflag_etc() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - print "The MS is already around, just unflag" build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - print "Moving data..." build 12-Sep-2018 15:30:25 - os.system('cp -RH '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('rm -rf ' + self.vis + '.flagversions') build 12-Sep-2018 15:30:25 - self.unflag_ms() build 12-Sep-2018 15:30:25 - default(flagdata) build 12-Sep-2018 15:30:25 + def setUp_data4preaveraging(self): build 12-Sep-2018 15:30:25 + # Four_ants_3C286_spw9_small_for_preaveraging.ms was generated with a command like: build 12-Sep-2018 15:30:25 + # mstransform(vis='Four_ants_3C286.ms', build 12-Sep-2018 15:30:25 + # outputvis='Four_ants_3C286_spw9_small_for_preaveraging.ms', build 12-Sep-2018 15:30:25 + # datacolumn='data',spw='9', antenna='1&2', build 12-Sep-2018 15:30:25 + # timerange='2010/10/16/14:45:08.50~2010/10/16/14:45:11.50') build 12-Sep-2018 15:30:25 + self.vis = 'Four_ants_3C286_spw9_small_for_preaveraging.ms' build 12-Sep-2018 15:30:25 + self._check_path_move_remove_versions_unflag_etc() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def setUp_shadowdata1(self): build 12-Sep-2018 15:30:25 '''ALMA ACA observation with one field in APP ref frame''' build 12-Sep-2018 15:30:25 @@ -322,6 +322,19 @@ class test_base(unittest.TestCase): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 return summary_list build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + def _check_path_move_remove_versions_unflag_etc(self): build 12-Sep-2018 15:30:25 + if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 + print "The MS is already around, just unflag" build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + print "Moving data..." build 12-Sep-2018 15:30:25 + os.system('cp -RH '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + self.vis + '.flagversions') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.unflag_ms() build 12-Sep-2018 15:30:25 + default(flagdata) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 class test_tfcrop(test_base): build 12-Sep-2018 15:30:25 """flagdata:: Test of mode = 'tfcrop'""" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -450,7 +463,7 @@ class test_rflag(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 self.setUp_data4tfcrop() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def test_rflag1(self): build 12-Sep-2018 15:30:25 '''flagdata:: mode = rflag : automatic thresholds''' build 12-Sep-2018 15:30:25 flagdata(vis=self.vis, mode='rflag', spw='9,10', timedev=[], freqdev=[], flagbackup=False, build 12-Sep-2018 15:30:25 @@ -641,7 +654,7 @@ class test_rflag(test_base): build 12-Sep-2018 15:30:25 self.assertEqual(res['report1']['antenna']['ea19']['flagged'], 18411) build 12-Sep-2018 15:30:25 self.assertEqual(res['report1']['spw']['7']['flagged'], 0,) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def test_rflag_residuals(self): build 12-Sep-2018 15:30:25 + def test_rflag_residual_data(self): build 12-Sep-2018 15:30:25 '''flagdata: rflag using MODEL and virtual MODEL columns''' build 12-Sep-2018 15:30:25 from tasks import delmod build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -673,6 +686,8 @@ class test_rflag(test_base): build 12-Sep-2018 15:30:25 # Flags should be the same build 12-Sep-2018 15:30:25 self.assertTrue(flags_mod['flagged'],flags_vmod['flagged']) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + # This test is mischievous, manipulates the model column. Don't leave a messed up MS. build 12-Sep-2018 15:30:25 + os.system('rm -rf {0}'.format(self.vis)) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class test_shadow(test_base): build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 @@ -2020,11 +2035,13 @@ class test_clip(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # STEP 1 build 12-Sep-2018 15:30:25 # Create time averaged output in mstransform build 12-Sep-2018 15:30:25 - mstransform('timeavg.ms',outputvis='step1_timeavg.ms',datacolumn='data',timeaverage=True,timebin='2s') build 12-Sep-2018 15:30:25 + mstransform('timeavg.ms',outputvis='test_residual_step1_timeavg.ms', build 12-Sep-2018 15:30:25 + datacolumn='data',timeaverage=True,timebin='2s') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # clip it build 12-Sep-2018 15:30:25 - flagdata('step1_timeavg.ms',flagbackup=False, mode='clip',clipminmax=[0.0,0.08]) build 12-Sep-2018 15:30:25 - res1 = flagdata(vis='step1_timeavg.ms', mode='summary', spwchan=True) build 12-Sep-2018 15:30:25 + flagdata('test_residual_step1_timeavg.ms',flagbackup=False, mode='clip', build 12-Sep-2018 15:30:25 + clipminmax=[0.0,0.08]) build 12-Sep-2018 15:30:25 + res1 = flagdata(vis='test_residual_step1_timeavg.ms', mode='summary', spwchan=True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # STEP 2 build 12-Sep-2018 15:30:25 # Clip with time averaging. build 12-Sep-2018 15:30:25 @@ -2033,9 +2050,10 @@ class test_clip(test_base): build 12-Sep-2018 15:30:25 timeavg=True, timebin='2s', clipminmax=[0.0,0.08]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Do another time average in mstransform to have the corrected averaged visibilities build 12-Sep-2018 15:30:25 - mstransform('timeavg.ms',outputvis='step2_timeavg.ms',datacolumn='data',timeaverage=True,timebin='2s') build 12-Sep-2018 15:30:25 + mstransform('timeavg.ms',outputvis='test_residual_step2_timeavg.ms', build 12-Sep-2018 15:30:25 + datacolumn='data',timeaverage=True,timebin='2s') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - res2 = flagdata(vis='step2_timeavg.ms', mode='summary', spwchan=True) build 12-Sep-2018 15:30:25 + res2 = flagdata(vis='test_residual_step2_timeavg.ms', mode='summary', spwchan=True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 self.assertEqual(res1['flagged'], res2['flagged']) build 12-Sep-2018 15:30:25 self.assertEqual(res2['spw:channel']['0:21']['flagged'], 1) build 12-Sep-2018 15:30:25 @@ -3338,39 +3356,12 @@ class TestMergeManualTimerange(unittest.TestCase): build 12-Sep-2018 15:30:25 self.assertEqual(res[5]['timerange'], '00:04~00:05,00:06~00:07') build 12-Sep-2018 15:30:25 self.assertEqual(res[6]['mode'], 'summary3') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -# Cleanup class build 12-Sep-2018 15:30:25 -class cleanup(test_base): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf ngc5921.*ms* testwma*ms*') build 12-Sep-2018 15:30:25 - os.system('rm -rf flagdatatest.*ms*') build 12-Sep-2018 15:30:25 - os.system('rm -rf missing-baseline.*ms*') build 12-Sep-2018 15:30:25 - os.system('rm -rf multiobs.*ms*') build 12-Sep-2018 15:30:25 - os.system('rm -rf uid___A002_X30a93d_X43e_small.*ms*') build 12-Sep-2018 15:30:25 - os.system('rm -rf Four_ants_3C286.*ms*') build 12-Sep-2018 15:30:25 - os.system('rm -rf shadow*.*ms*') build 12-Sep-2018 15:30:25 - os.system('rm -rf testmwa.*ms*') build 12-Sep-2018 15:30:25 - os.system('rm -rf cal.fewscans.bpass*') build 12-Sep-2018 15:30:25 - os.system('rm -rf X7ef.tsys* ap314.gcal*') build 12-Sep-2018 15:30:25 - os.system('rm -rf list*txt*') build 12-Sep-2018 15:30:25 - os.system('rm -rf fourrows*') build 12-Sep-2018 15:30:25 - os.system('rm -rf SDFloatColumn*') build 12-Sep-2018 15:30:25 - os.system('rm -rf *weight*ms*') build 12-Sep-2018 15:30:25 - os.system('rm -rf uid___A002_X72c4aa_X8f5_scan21_spw18*') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_runTest(self): build 12-Sep-2018 15:30:25 - '''flagdata: Cleanup''' build 12-Sep-2018 15:30:25 - pass build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class test_preaveraging(test_base): build 12-Sep-2018 15:30:25 """Test channel/time pre-averaging for visibility-based flagging""" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - self.setUp_data4tfcrop() build 12-Sep-2018 15:30:25 - mstransform(vis=self.vis,outputvis='test_preaveraging.ms',datacolumn='data',spw='9',scan='30', build 12-Sep-2018 15:30:25 - antenna='1&2',timerange='2010/10/16/14:45:08.50~2010/10/16/14:45:11.50') build 12-Sep-2018 15:30:25 - self.vis = 'test_preaveraging.ms' build 12-Sep-2018 15:30:25 + self.setUp_data4preaveraging() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 os.system('rm -rf test_preaveraging.ms') build 12-Sep-2018 15:30:25 @@ -3465,7 +3456,7 @@ class test_preaveraging(test_base): build 12-Sep-2018 15:30:25 # Unflag the original input data build 12-Sep-2018 15:30:25 flagdata(self.vis, flagbackup=False, mode='unflag') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # STEP 1: Time average with mstransform, then flagging with normal clip build 12-Sep-2018 15:30:25 + # STEP 1: Time average with mstransform, then flagging with normal rflag build 12-Sep-2018 15:30:25 mstransform(vis=self.vis,outputvis='test_rflag_timeavg_step1.ms',datacolumn='data', build 12-Sep-2018 15:30:25 timeaverage=True,timebin='2s') build 12-Sep-2018 15:30:25 flagdata(vis='test_rflag_timeavg_step1.ms',flagbackup=False, mode='rflag',extendflags=False) build 12-Sep-2018 15:30:25 @@ -3474,7 +3465,7 @@ class test_preaveraging(test_base): build 12-Sep-2018 15:30:25 # Unflag the original input data build 12-Sep-2018 15:30:25 flagdata(self.vis, flagbackup=False, mode='unflag') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # STEP 2: Flagging with clip using time average, then time average with mstransform build 12-Sep-2018 15:30:25 + # STEP 2: Flagging with rflag using time average, then time average with mstransform build 12-Sep-2018 15:30:25 flagdata(vis=self.vis, flagbackup=False, mode='rflag', datacolumn='DATA', build 12-Sep-2018 15:30:25 timeavg=True, timebin='2s', extendflags=False) build 12-Sep-2018 15:30:25 mstransform(vis=self.vis,outputvis='test_rflag_timeavg_step2.ms',datacolumn='data', build 12-Sep-2018 15:30:25 @@ -3482,15 +3473,15 @@ class test_preaveraging(test_base): build 12-Sep-2018 15:30:25 res2 = flagdata(vis='test_rflag_timeavg_step2.ms', mode='summary', spwchan=True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Compare results build 12-Sep-2018 15:30:25 - self.assertEqual(res2['flagged'], 20) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + self.assertEqual(res2['flagged'], 20) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def test_rflag_chanavg(self): build 12-Sep-2018 15:30:25 '''flagdata: rflag with chan average and compare vs mstransform''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Unflag the original input data build 12-Sep-2018 15:30:25 flagdata(self.vis, flagbackup=False, mode='unflag') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # STEP 1: Chan average with mstransform, then flagging with normal clip build 12-Sep-2018 15:30:25 + # STEP 1: Chan average with mstransform, then flagging with normal rflag build 12-Sep-2018 15:30:25 mstransform(vis=self.vis,outputvis='test_rflag_chanavg_step1.ms',datacolumn='data', build 12-Sep-2018 15:30:25 chanaverage=True,chanbin=2) build 12-Sep-2018 15:30:25 flagdata(vis='test_rflag_chanavg_step1.ms',flagbackup=False, mode='rflag',extendflags=False) build 12-Sep-2018 15:30:25 @@ -3499,8 +3490,8 @@ class test_preaveraging(test_base): build 12-Sep-2018 15:30:25 # Unflag the original input data build 12-Sep-2018 15:30:25 flagdata(vis=self.vis, flagbackup=False, mode='unflag') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # STEP 2: Flagging with clip using time average, then time average with mstransform build 12-Sep-2018 15:30:25 - flagdata(vis=self.vis, flagbackup=False, mode='rflag', datacolumn='DATA', build 12-Sep-2018 15:30:25 + # STEP 2: Flagging with rflag using time average, then time average with mstransform build 12-Sep-2018 15:30:25 + flagdata(vis=self.vis, flagbackup=False, mode='rflag', datacolumn='DATA', build 12-Sep-2018 15:30:25 channelavg=True, chanbin=2,extendflags=False) build 12-Sep-2018 15:30:25 mstransform(vis=self.vis, outputvis='test_rflag_chanavg_step2.ms',datacolumn='data', build 12-Sep-2018 15:30:25 chanaverage=True,chanbin=2) build 12-Sep-2018 15:30:25 @@ -3508,56 +3499,65 @@ class test_preaveraging(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Compare results build 12-Sep-2018 15:30:25 self.assertEqual(res1['flagged'], res2['flagged']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def test_rflag_time_chanavg(self): build 12-Sep-2018 15:30:25 '''flagdata: rflag with time/chan average and compare vs mstransform''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 # Unflag the original input data build 12-Sep-2018 15:30:25 flagdata(self.vis, flagbackup=False, mode='unflag') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # STEP 1: Chan average with mstransform, then flagging with normal clip build 12-Sep-2018 15:30:25 - mstransform(vis=self.vis,outputvis='test_rflag_time_chanavg_step1.ms',datacolumn='data', build 12-Sep-2018 15:30:25 - timeaverage=True,timebin='2s',chanaverage=True,chanbin=2) build 12-Sep-2018 15:30:25 - flagdata(vis='test_rflag_time_chanavg_step1.ms',flagbackup=False, mode='clip',extendflags=False) build 12-Sep-2018 15:30:25 - res1 = flagdata(vis='test_rflag_time_chanavg_step1.ms', mode='summary', spwchan=True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Unflag the original input data build 12-Sep-2018 15:30:25 - flagdata(vis=self.vis, flagbackup=False, mode='unflag') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # STEP 2: Flagging with clip using time average, then time average with mstransform build 12-Sep-2018 15:30:25 - flagdata(vis=self.vis, flagbackup=False, mode='clip', datacolumn='DATA', build 12-Sep-2018 15:30:25 + # STEP 1: chan+time average with mstransform, then flagging with normal rflag build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis,outputvis='test_rflag_time_chanavg_step1.ms', build 12-Sep-2018 15:30:25 + datacolumn='data', timeaverage=True, timebin='2s', build 12-Sep-2018 15:30:25 + chanaverage=True, chanbin=2) build 12-Sep-2018 15:30:25 + res1 = flagdata(vis='test_rflag_time_chanavg_step1.ms', action='calculate', build 12-Sep-2018 15:30:25 + mode='rflag', extendflags=False) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # STEP 2: rflag using chan+time average, then mstransform using chan+time avg build 12-Sep-2018 15:30:25 + flagdata(vis=self.vis, flagbackup=False, mode='rflag', datacolumn='DATA', build 12-Sep-2018 15:30:25 timeavg=True, timebin='2s', channelavg=True, chanbin=2, extendflags=False) build 12-Sep-2018 15:30:25 - mstransform(vis=self.vis, outputvis='test_rflag_time_chanavg_step2.ms',datacolumn='data', build 12-Sep-2018 15:30:25 - timeaverage=True,timebin='2s',chanaverage=True,chanbin=2) build 12-Sep-2018 15:30:25 - res2 = flagdata(vis='test_rflag_time_chanavg_step2.ms', mode='summary', spwchan=True) build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis, outputvis='test_rflag_time_chanavg_step2.ms', build 12-Sep-2018 15:30:25 + datacolumn='data', timeaverage=True, timebin='2s', build 12-Sep-2018 15:30:25 + chanaverage=True, chanbin=2) build 12-Sep-2018 15:30:25 + res2 = flagdata(vis='test_rflag_time_chanavg_step2.ms', action='calculate', build 12-Sep-2018 15:30:25 + mode='rflag', extendflags=False) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # Check results. Note when doing chan+time avg we cannot assume the thresholds and # build 12-Sep-2018 15:30:25 + # of flagged channels will be the same build 12-Sep-2018 15:30:25 + self.assertEqual(res1['type'], 'list') build 12-Sep-2018 15:30:25 + self.assertEqual(res1['type'], res2['type']) build 12-Sep-2018 15:30:25 + tol = 6.6e-1 build 12-Sep-2018 15:30:25 + import numpy as np build 12-Sep-2018 15:30:25 + for threshold_type in ['freqdev', 'timedev']: build 12-Sep-2018 15:30:25 + self.assertTrue(np.allclose(res1['report0'][threshold_type], build 12-Sep-2018 15:30:25 + res2['report0'][threshold_type], rtol=tol)) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # Compare results build 12-Sep-2018 15:30:25 - self.assertEqual(res1['flagged'], res2['flagged']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 def test_tfcrop_timeavg(self): build 12-Sep-2018 15:30:25 '''flagdata: tfcrop with time average and compare vs mstransform''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Unflag the original input data build 12-Sep-2018 15:30:25 flagdata(self.vis, flagbackup=False, mode='unflag') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # STEP 1: Time average with mstransform, then flagging with normal clip build 12-Sep-2018 15:30:25 + # STEP 1: Time average with mstransform, then flagging with normal tfcrop build 12-Sep-2018 15:30:25 mstransform(vis=self.vis,outputvis='test_tfcrop_timeavg_step1.ms',datacolumn='data', build 12-Sep-2018 15:30:25 timeaverage=True,timebin='2s') build 12-Sep-2018 15:30:25 - flagdata(vis='test_tfcrop_timeavg_step1.ms',flagbackup=False, mode='rflag',extendflags=False) build 12-Sep-2018 15:30:25 + flagdata(vis='test_tfcrop_timeavg_step1.ms',flagbackup=False, mode='tfcrop', build 12-Sep-2018 15:30:25 + extendflags=False) build 12-Sep-2018 15:30:25 res1 = flagdata(vis='test_tfcrop_timeavg_step1.ms', mode='summary', spwchan=True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Unflag the original input data build 12-Sep-2018 15:30:25 flagdata(self.vis, flagbackup=False, mode='unflag') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # STEP 2: Flagging with clip using time average, then time average with mstransform build 12-Sep-2018 15:30:25 - flagdata(vis=self.vis, flagbackup=False, mode='rflag', datacolumn='DATA', build 12-Sep-2018 15:30:25 + # STEP 2: Flagging with tfcrop using time average, then time average with mstransform build 12-Sep-2018 15:30:25 + flagdata(vis=self.vis, flagbackup=False, mode='tfcrop', datacolumn='DATA', build 12-Sep-2018 15:30:25 timeavg=True, timebin='2s', extendflags=False) build 12-Sep-2018 15:30:25 mstransform(vis=self.vis,outputvis='test_tfcrop_timeavg_step2.ms',datacolumn='data', build 12-Sep-2018 15:30:25 timeaverage=True,timebin='2s') build 12-Sep-2018 15:30:25 res2 = flagdata(vis='test_tfcrop_timeavg_step2.ms', mode='summary', spwchan=True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # Compare results build 12-Sep-2018 15:30:25 - self.assertEqual(res2['flagged'], 20) build 12-Sep-2018 15:30:25 + # Check results build 12-Sep-2018 15:30:25 + self.assertEqual(res1['flagged'], 36) build 12-Sep-2018 15:30:25 + self.assertEqual(res2['flagged'], 0) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_tfcrop_chanavg(self): build 12-Sep-2018 15:30:25 '''flagdata: tfcrop with chan average and compare vs mstransform''' build 12-Sep-2018 15:30:25 @@ -3565,17 +3565,18 @@ class test_preaveraging(test_base): build 12-Sep-2018 15:30:25 # Unflag the original input data build 12-Sep-2018 15:30:25 flagdata(self.vis, flagbackup=False, mode='unflag') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # STEP 1: Chan average with mstransform, then flagging with normal clip build 12-Sep-2018 15:30:25 + # STEP 1: Chan average with mstransform, then flagging with normal tfcrop build 12-Sep-2018 15:30:25 mstransform(vis=self.vis,outputvis='test_tfcrop_chanavg_step1.ms',datacolumn='data', build 12-Sep-2018 15:30:25 chanaverage=True,chanbin=2) build 12-Sep-2018 15:30:25 - flagdata(vis='test_tfcrop_chanavg_step1.ms',flagbackup=False, mode='rflag',extendflags=False) build 12-Sep-2018 15:30:25 + flagdata(vis='test_tfcrop_chanavg_step1.ms',flagbackup=False, mode='tfcrop', build 12-Sep-2018 15:30:25 + extendflags=False) build 12-Sep-2018 15:30:25 res1 = flagdata(vis='test_tfcrop_chanavg_step1.ms', mode='summary', spwchan=True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Unflag the original input data build 12-Sep-2018 15:30:25 flagdata(vis=self.vis, flagbackup=False, mode='unflag') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # STEP 2: Flagging with clip using time average, then time average with mstransform build 12-Sep-2018 15:30:25 - flagdata(vis=self.vis, flagbackup=False, mode='rflag', datacolumn='DATA', build 12-Sep-2018 15:30:25 + # STEP 2: Flagging with tfcrop using time average, then time average with mstransform build 12-Sep-2018 15:30:25 + flagdata(vis=self.vis, flagbackup=False, mode='tfcrop', datacolumn='DATA', build 12-Sep-2018 15:30:25 channelavg=True, chanbin=2,extendflags=False) build 12-Sep-2018 15:30:25 mstransform(vis=self.vis, outputvis='test_tfcrop_chanavg_step2.ms',datacolumn='data', build 12-Sep-2018 15:30:25 chanaverage=True,chanbin=2) build 12-Sep-2018 15:30:25 @@ -3590,17 +3591,17 @@ class test_preaveraging(test_base): build 12-Sep-2018 15:30:25 # Unflag the original input data build 12-Sep-2018 15:30:25 flagdata(self.vis, flagbackup=False, mode='unflag') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # STEP 1: Chan average with mstransform, then flagging with normal clip build 12-Sep-2018 15:30:25 + # STEP 1: Chan average with mstransform, then flagging with normal tfcrop build 12-Sep-2018 15:30:25 mstransform(vis=self.vis,outputvis='test_tfcrop_time_chanavg_step1.ms',datacolumn='data', build 12-Sep-2018 15:30:25 timeaverage=True,timebin='2s',chanaverage=True,chanbin=2) build 12-Sep-2018 15:30:25 - flagdata(vis='test_tfcrop_time_chanavg_step1.ms',flagbackup=False, mode='clip',extendflags=False) build 12-Sep-2018 15:30:25 + flagdata(vis='test_tfcrop_time_chanavg_step1.ms',flagbackup=False, mode='tfcrop',extendflags=False) build 12-Sep-2018 15:30:25 res1 = flagdata(vis='test_tfcrop_time_chanavg_step1.ms', mode='summary', spwchan=True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Unflag the original input data build 12-Sep-2018 15:30:25 flagdata(vis=self.vis, flagbackup=False, mode='unflag') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # STEP 2: Flagging with clip using time average, then time average with mstransform build 12-Sep-2018 15:30:25 - flagdata(vis=self.vis, flagbackup=False, mode='clip', datacolumn='DATA', build 12-Sep-2018 15:30:25 + # STEP 2: Flagging with tfcrop using time average, then time average with mstransform build 12-Sep-2018 15:30:25 + flagdata(vis=self.vis, flagbackup=False, mode='tfcrop', datacolumn='DATA', build 12-Sep-2018 15:30:25 timeavg=True, timebin='2s', channelavg=True, chanbin=2, extendflags=False) build 12-Sep-2018 15:30:25 mstransform(vis=self.vis, outputvis='test_tfcrop_time_chanavg_step2.ms',datacolumn='data', build 12-Sep-2018 15:30:25 timeaverage=True,timebin='2s',chanaverage=True,chanbin=2) build 12-Sep-2018 15:30:25 @@ -3609,6 +3610,125 @@ class test_preaveraging(test_base): build 12-Sep-2018 15:30:25 # Compare results build 12-Sep-2018 15:30:25 self.assertEqual(res2['flagged'], res2['flagged']) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +# Motivated by CAS-11397. test_preaveraging is about datacolumn='data', and checks what build 12-Sep-2018 15:30:25 +# flags are written to the output build 12-Sep-2018 15:30:25 +# test_preaveraging_rflag_residual is about datacolumn='residual' and doesn't write flags. It build 12-Sep-2018 15:30:25 +# checks the threshold calculations from RFlag build 12-Sep-2018 15:30:25 +class test_preaveraging_rflag_residual(test_base): build 12-Sep-2018 15:30:25 + """Test pre-averaging (channel / time) with RFlag and datacolumn='residual'""" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + self.setUp_data4tfcrop() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + os.system('rm -rf test_rflag_timeavg_residual*step2*ms') build 12-Sep-2018 15:30:25 + os.system('rm -rf test_rflag_channelavg_residual*step2*ms') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_rflag_timeavg_on_residual(self): build 12-Sep-2018 15:30:25 + '''flagdata: rflag with timeavg on residual (corrected - model), and compare build 12-Sep-2018 15:30:25 + vs mstransform + rflag without timeavg''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # Initial integration time of 'Four_ants_3C286.ms' is 1s build 12-Sep-2018 15:30:25 + timebin = '8s' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # using action calculate, which is faster (reduced I/O) and enough to test thresholds build 12-Sep-2018 15:30:25 + # using only these spws for speed build 12-Sep-2018 15:30:25 + spws = '0,1,2' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # STEP 1: rflag-calculate with original time build 12-Sep-2018 15:30:25 + res1 = flagdata(vis=self.vis, spw=spws, action='calculate', mode='rflag', build 12-Sep-2018 15:30:25 + datacolumn='residual', extendflags=False) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # STEP 2: timeavg with mstransform, then rflag-calculate on residual build 12-Sep-2018 15:30:25 + flagged2 = 'test_rflag_timeavg_residual_step2.ms' build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis, spw=spws, outputvis=flagged2, build 12-Sep-2018 15:30:25 + datacolumn='data,model,corrected', timeaverage=True, timebin=timebin) build 12-Sep-2018 15:30:25 + res2 = flagdata(vis=flagged2, spw=spws, action='calculate', mode='rflag', build 12-Sep-2018 15:30:25 + datacolumn='residual', extendflags=False) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # STEP 3: rflag-calculate with timeavg on residual build 12-Sep-2018 15:30:25 + res3 = flagdata(vis=self.vis, spw=spws, action='calculate', mode='rflag', build 12-Sep-2018 15:30:25 + datacolumn='residual', timeavg=True, timebin=timebin, build 12-Sep-2018 15:30:25 + extendflags=False) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def check_reports_timeavg(report1, report2, report3): build 12-Sep-2018 15:30:25 + import numpy as np build 12-Sep-2018 15:30:25 + self.assertEqual(report2['type'], 'rflag') build 12-Sep-2018 15:30:25 + self.assertEqual(report3['type'], report2['type']) build 12-Sep-2018 15:30:25 + freq_tol = 1e-1 build 12-Sep-2018 15:30:25 + self.assertTrue(np.allclose(report1['freqdev'], report3['freqdev'], build 12-Sep-2018 15:30:25 + rtol=freq_tol)) build 12-Sep-2018 15:30:25 + self.assertTrue(np.allclose(report2['freqdev'], report3['freqdev'], build 12-Sep-2018 15:30:25 + rtol=freq_tol)) build 12-Sep-2018 15:30:25 + # divide 3rd column (thresholds). Matrices have rows like: field, spw, threshold. build 12-Sep-2018 15:30:25 + report1['timedev'][:,2] = report1['timedev'][:,2] / np.sqrt(8) build 12-Sep-2018 15:30:25 + time_div_tol = 3.3e-1 build 12-Sep-2018 15:30:25 + self.assertTrue(np.allclose(report1['timedev'], report3['timedev'], build 12-Sep-2018 15:30:25 + rtol=time_div_tol)) build 12-Sep-2018 15:30:25 + time_tol = 1.5e-1 build 12-Sep-2018 15:30:25 + self.assertTrue(np.allclose(report2['timedev'], build 12-Sep-2018 15:30:25 + report3['timedev'], rtol=time_tol)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertEqual(res1['type'], 'list') build 12-Sep-2018 15:30:25 + self.assertEqual(res1['type'], res2['type']) build 12-Sep-2018 15:30:25 + self.assertEqual(res1['type'], res3['type']) build 12-Sep-2018 15:30:25 + check_reports_timeavg(res1['report0'], res2['report0'], res3['report0']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_rflag_channelavg_on_residual(self): build 12-Sep-2018 15:30:25 + '''flagdata: rflag with channelavg on residual (corrected - model), and compare build 12-Sep-2018 15:30:25 + vs mstransform + rflag without average''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # Initial integration time of 'Four_ants_3C286.ms' is 1s build 12-Sep-2018 15:30:25 + timebin = '8s' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # using action calculate, which is faster (reduced I/O) and enough to test thresholds build 12-Sep-2018 15:30:25 + # using only these spws for speed build 12-Sep-2018 15:30:25 + spws = '0,1,2' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # STEP 1: rflag-calculate with original MS build 12-Sep-2018 15:30:25 + res1 = flagdata(vis=self.vis, spw=spws, action='calculate', mode='rflag', build 12-Sep-2018 15:30:25 + datacolumn='residual', extendflags=False) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # STEP 2: chanavg with mstransform, then rflag-calculate on residual build 12-Sep-2018 15:30:25 + flagged2 = 'test_rflag_channelavg_residual_step2.ms' build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis, spw=spws, outputvis=flagged2, build 12-Sep-2018 15:30:25 + datacolumn='data,model,corrected', chanaverage=True, chanbin=32) build 12-Sep-2018 15:30:25 + res2 = flagdata(vis=flagged2, spw=spws, action='calculate', mode='rflag', build 12-Sep-2018 15:30:25 + datacolumn='residual', extendflags=False) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # STEP 3: rflag-calculate with channelavg on residual build 12-Sep-2018 15:30:25 + res3 = flagdata(vis=self.vis, spw=spws, action='calculate', mode='rflag', build 12-Sep-2018 15:30:25 + datacolumn='residual', channelavg=True, chanbin=32, build 12-Sep-2018 15:30:25 + extendflags=False) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def check_reports_channelavg(report1, report2, report3): build 12-Sep-2018 15:30:25 + import numpy as np build 12-Sep-2018 15:30:25 + self.assertEqual(report2['type'], 'rflag') build 12-Sep-2018 15:30:25 + self.assertEqual(report3['type'], report2['type']) build 12-Sep-2018 15:30:25 + # divide 3rd column (thresholds). Matrices have rows like: field, spw, threshold. build 12-Sep-2018 15:30:25 + report1['freqdev'][:,2] = report1['freqdev'][:,2] / 2 build 12-Sep-2018 15:30:25 + freq_div_tol = 1e-1 build 12-Sep-2018 15:30:25 + self.assertTrue(np.allclose(report1['freqdev'], report3['freqdev'], build 12-Sep-2018 15:30:25 + rtol=freq_div_tol)) build 12-Sep-2018 15:30:25 + freq_tol = 5e-2 build 12-Sep-2018 15:30:25 + self.assertTrue(np.allclose(report2['freqdev'], report3['freqdev'], build 12-Sep-2018 15:30:25 + rtol=freq_tol)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report1['timedev'][:,2] = report1['timedev'][:,2] / 4 build 12-Sep-2018 15:30:25 + time_div_tol = 6.6e-1 build 12-Sep-2018 15:30:25 + self.assertTrue(np.allclose(report1['timedev'], report3['timedev'], build 12-Sep-2018 15:30:25 + rtol=time_div_tol)) build 12-Sep-2018 15:30:25 + time_tol = 5e-2 build 12-Sep-2018 15:30:25 + self.assertTrue(np.allclose(report2['timedev'], build 12-Sep-2018 15:30:25 + report3['timedev'], rtol=time_tol)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertEqual(res1['type'], 'list') build 12-Sep-2018 15:30:25 + self.assertEqual(res1['type'], res2['type']) build 12-Sep-2018 15:30:25 + self.assertEqual(res1['type'], res3['type']) build 12-Sep-2018 15:30:25 + check_reports_channelavg(res1['report0'], res2['report0'], res3['report0']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 class test_virtual_col(test_base): build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 self.setUp_ngc5921(force=True) build 12-Sep-2018 15:30:25 @@ -3667,6 +3787,32 @@ class test_virtual_col(test_base): build 12-Sep-2018 15:30:25 self.assertEqual(res_virtual, res, 'Flagging using virtual MODEL column differs from normal MODEL column') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 +# Cleanup class build 12-Sep-2018 15:30:25 +class cleanup(test_base): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + os.system('rm -rf ngc5921.*ms* testwma*ms*') build 12-Sep-2018 15:30:25 + os.system('rm -rf flagdatatest.*ms*') build 12-Sep-2018 15:30:25 + os.system('rm -rf missing-baseline.*ms*') build 12-Sep-2018 15:30:25 + os.system('rm -rf multiobs.*ms*') build 12-Sep-2018 15:30:25 + os.system('rm -rf uid___A002_X30a93d_X43e_small.*ms*') build 12-Sep-2018 15:30:25 + os.system('rm -rf Four_ants_3C286*.ms') build 12-Sep-2018 15:30:25 + os.system('rm -rf shadow*.*ms*') build 12-Sep-2018 15:30:25 + os.system('rm -rf testmwa.*ms*') build 12-Sep-2018 15:30:25 + os.system('rm -rf cal.fewscans.bpass*') build 12-Sep-2018 15:30:25 + os.system('rm -rf X7ef.tsys* ap314.gcal*') build 12-Sep-2018 15:30:25 + os.system('rm -rf list*txt*') build 12-Sep-2018 15:30:25 + os.system('rm -rf fourrows*') build 12-Sep-2018 15:30:25 + os.system('rm -rf SDFloatColumn*') build 12-Sep-2018 15:30:25 + os.system('rm -rf *weight*ms*') build 12-Sep-2018 15:30:25 + os.system('rm -rf uid___A002_X72c4aa_X8f5_scan21_spw18*') build 12-Sep-2018 15:30:25 + os.system('rm -rf test_residual_step*.ms') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_runTest(self): build 12-Sep-2018 15:30:25 + '''flagdata: Cleanup''' build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def suite(): build 12-Sep-2018 15:30:25 return [test_antint, build 12-Sep-2018 15:30:25 test_rflag, build 12-Sep-2018 15:30:25 @@ -3691,5 +3837,6 @@ def suite(): build 12-Sep-2018 15:30:25 test_tbuff, build 12-Sep-2018 15:30:25 TestMergeManualTimerange, build 12-Sep-2018 15:30:25 test_preaveraging, build 12-Sep-2018 15:30:25 + test_preaveraging_rflag_residual, build 12-Sep-2018 15:30:25 test_virtual_col, build 12-Sep-2018 15:30:25 cleanup] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_gencal.py b/gcwrap/python/scripts/tests/test_gencal.py build 12-Sep-2018 15:30:25 index f86bdf8..68f8ada 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_gencal.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_gencal.py build 12-Sep-2018 15:30:25 @@ -86,7 +86,7 @@ class gencal_antpostest(unittest.TestCase): build 12-Sep-2018 15:30:25 # current EVLA baseline correction URL build 12-Sep-2018 15:30:25 evlabslncorrURL="http://www.vla.nrao.edu/cgi-bin/evlais_blines.cgi?Year=" build 12-Sep-2018 15:30:25 try: build 12-Sep-2018 15:30:25 - urlaccess=urllib2.urlopen(evlabslncorrURL+"2010") build 12-Sep-2018 15:30:25 + urlaccess=urllib2.urlopen(evlabslncorrURL+"2010", timeout=60.0) build 12-Sep-2018 15:30:25 gencal(vis=self.msfile, build 12-Sep-2018 15:30:25 caltable=self.caltable, build 12-Sep-2018 15:30:25 caltype='antpos', build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_getchunk.py b/gcwrap/python/scripts/tests/test_getchunk.py build 12-Sep-2018 15:30:25 index 18c1e2f..c11d300 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_getchunk.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_getchunk.py build 12-Sep-2018 15:30:25 @@ -332,23 +332,27 @@ class getchunk_test(unittest.TestCase): build 12-Sep-2018 15:30:25 "Falure on float precision pixels" build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 myia.fromshape("", [10, 10, 10], type='d') build 12-Sep-2018 15:30:25 + self.assertTrue(myia.isopen()) build 12-Sep-2018 15:30:25 bb = myia.getchunk() build 12-Sep-2018 15:30:25 bb[:] = rval build 12-Sep-2018 15:30:25 myia.putchunk(bb) build 12-Sep-2018 15:30:25 cc = myia.getchunk() build 12-Sep-2018 15:30:25 tol = 1e-20 build 12-Sep-2018 15:30:25 myia.done() build 12-Sep-2018 15:30:25 + self.assertFalse(myia.isopen()) build 12-Sep-2018 15:30:25 self.assertTrue( build 12-Sep-2018 15:30:25 numpy.isclose(cc, rval, rtol=tol, atol=tol).all(), build 12-Sep-2018 15:30:25 "Falure on double precision pixels" build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 cval = complex(rval, rval) build 12-Sep-2018 15:30:25 myia.fromshape("", [10, 10, 10], type='c') build 12-Sep-2018 15:30:25 + self.assertTrue(myia.isopen()) build 12-Sep-2018 15:30:25 bb = myia.getchunk() build 12-Sep-2018 15:30:25 bb[:] = cval build 12-Sep-2018 15:30:25 myia.putchunk(bb) build 12-Sep-2018 15:30:25 cc = myia.getchunk() build 12-Sep-2018 15:30:25 myia.done() build 12-Sep-2018 15:30:25 + self.assertFalse(myia.isopen()) build 12-Sep-2018 15:30:25 tol = 1e-8 build 12-Sep-2018 15:30:25 self.assertTrue( build 12-Sep-2018 15:30:25 numpy.isclose(cc, cval, rtol=tol, atol=tol).all(), build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_ia_fromarray.py b/gcwrap/python/scripts/tests/test_ia_fromarray.py build 12-Sep-2018 15:30:25 index e78d991..e035dde 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_ia_fromarray.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_ia_fromarray.py build 12-Sep-2018 15:30:25 @@ -112,5 +112,51 @@ class ia_fromarray_test(unittest.TestCase): build 12-Sep-2018 15:30:25 self.assertTrue("ia.fromarray" in msgs[-2]) build 12-Sep-2018 15:30:25 self.assertTrue("ia.fromarray" in msgs[-1]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + def test_precision(self): build 12-Sep-2018 15:30:25 + """Test type parameter""" build 12-Sep-2018 15:30:25 + jj = 1.2345678901234567890123456789 build 12-Sep-2018 15:30:25 + zz = numpy.array([jj, jj]) build 12-Sep-2018 15:30:25 + myia = self._myia build 12-Sep-2018 15:30:25 + self.assertRaises(Exception, myia.fromarray, "", zz, type="x") build 12-Sep-2018 15:30:25 + ia2 = iatool() build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myia.fromarray("", zz, type="f") build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + myia = ia2.newimagefromarray("", zz, type="f") build 12-Sep-2018 15:30:25 + kk = myia.getchunk()[0] build 12-Sep-2018 15:30:25 + myia.done() build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.isclose(kk, jj, 1e-8, 1e-8)) build 12-Sep-2018 15:30:25 + self.assertFalse(numpy.isclose(kk, jj, 1e-9, 1e-9)) build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myia.fromarray("", zz, type="d") build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + myia = ia2.newimagefromarray("", zz, type="d") build 12-Sep-2018 15:30:25 + kk = myia.getchunk()[0] build 12-Sep-2018 15:30:25 + myia.done() build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.isclose(kk, jj, 1e-18, 1e-18)) build 12-Sep-2018 15:30:25 + ia2.done() build 12-Sep-2018 15:30:25 + oc = 1 + 1j build 12-Sep-2018 15:30:25 + jj = jj * oc build 12-Sep-2018 15:30:25 + zz = numpy.array([jj, jj]) build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myia.fromarray("", zz, type="f") build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + myia = ia2.newimagefromarray("", zz, type="f") build 12-Sep-2018 15:30:25 + kk = myia.getchunk()[0] build 12-Sep-2018 15:30:25 + myia.done() build 12-Sep-2018 15:30:25 + print "diff", (1 - jj/kk) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.isclose(kk, jj, 1e-8*oc, 1e-8*oc)) build 12-Sep-2018 15:30:25 + self.assertFalse(numpy.isclose(kk, jj, 1e-9*oc, 1e-9*oc)) build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myia.fromarray("", zz, type="d") build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + myia = ia2.newimagefromarray("", zz, type="d") build 12-Sep-2018 15:30:25 + kk = myia.getchunk()[0] build 12-Sep-2018 15:30:25 + myia.done() build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.isclose(kk, jj, 1e-18*oc, 1e-18*oc)) build 12-Sep-2018 15:30:25 + ia2.done() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def suite(): build 12-Sep-2018 15:30:25 return [ia_fromarray_test] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_ia_fromimage.py b/gcwrap/python/scripts/tests/test_ia_fromimage.py build 12-Sep-2018 15:30:25 index 86e937b..a49ce91 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_ia_fromimage.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_ia_fromimage.py build 12-Sep-2018 15:30:25 @@ -94,5 +94,20 @@ class ia_fromimage_test(unittest.TestCase): build 12-Sep-2018 15:30:25 self.assertTrue("ia.fromimage" in msgs[-2]) build 12-Sep-2018 15:30:25 self.assertTrue("ia.fromimage" in msgs[-1]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + def test_pixeltype(self): build 12-Sep-2018 15:30:25 + myia = self._myia build 12-Sep-2018 15:30:25 + name = "myim.im" build 12-Sep-2018 15:30:25 + etype = { build 12-Sep-2018 15:30:25 + 'f': 'float', 'd': 'double', 'c': 'complex', build 12-Sep-2018 15:30:25 + 'cd': 'dcomplex' build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + for t in ("f", "c", "d", "cd"): build 12-Sep-2018 15:30:25 + myia.fromshape(name, [20,20], type=t, overwrite=True) build 12-Sep-2018 15:30:25 + myia.fromimage("", name) build 12-Sep-2018 15:30:25 + self.assertEquals( build 12-Sep-2018 15:30:25 + myia.pixeltype(), etype[t], "data tpye check failed" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + myia.done() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def suite(): build 12-Sep-2018 15:30:25 return [ia_fromimage_test] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_ia_getregion.py b/gcwrap/python/scripts/tests/test_ia_getregion.py build 12-Sep-2018 15:30:25 index 24bb250..4395168 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_ia_getregion.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_ia_getregion.py build 12-Sep-2018 15:30:25 @@ -71,6 +71,7 @@ from tasks import * build 12-Sep-2018 15:30:25 from taskinit import * build 12-Sep-2018 15:30:25 from __main__ import * build 12-Sep-2018 15:30:25 import unittest build 12-Sep-2018 15:30:25 +import numpy build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class ia_getregion_test(unittest.TestCase): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -100,5 +101,33 @@ class ia_getregion_test(unittest.TestCase): build 12-Sep-2018 15:30:25 self.assertTrue(type(zz) == type(yy.getchunk())) build 12-Sep-2018 15:30:25 yy.done() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + def test_precision(self): build 12-Sep-2018 15:30:25 + """Test support for images with pixel values of various precisions""" build 12-Sep-2018 15:30:25 + myia = iatool() build 12-Sep-2018 15:30:25 + jj = 1.2345678901234567890123456789 build 12-Sep-2018 15:30:25 + for mytype in ('f', 'd'): build 12-Sep-2018 15:30:25 + myia.fromshape("", [4,4], type=mytype) build 12-Sep-2018 15:30:25 + gg = myia.getchunk() build 12-Sep-2018 15:30:25 + gg[:] = jj build 12-Sep-2018 15:30:25 + myia.putchunk(gg) build 12-Sep-2018 15:30:25 + reg = myia.getregion() build 12-Sep-2018 15:30:25 + if mytype == 'f': build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.isclose(reg, jj, 1e-8, 1e-8).all()) build 12-Sep-2018 15:30:25 + self.assertFalse(numpy.isclose(reg, jj, 1e-9, 1e-9).all()) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + self.assertTrue((reg == jj).all()) build 12-Sep-2018 15:30:25 + jj = jj*(1+1j) build 12-Sep-2018 15:30:25 + for mytype in ('c', 'cd'): build 12-Sep-2018 15:30:25 + myia.fromshape("", [4,4], type=mytype) build 12-Sep-2018 15:30:25 + gg = myia.getchunk() build 12-Sep-2018 15:30:25 + gg[:] = jj build 12-Sep-2018 15:30:25 + myia.putchunk(gg) build 12-Sep-2018 15:30:25 + reg = myia.getregion() build 12-Sep-2018 15:30:25 + if mytype == 'c': build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.isclose(reg, jj, 1e-8, 1e-8).all()) build 12-Sep-2018 15:30:25 + self.assertFalse(numpy.isclose(reg, jj, 1e-9, 1e-9).all()) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + self.assertTrue((reg == jj).all()) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def suite(): build 12-Sep-2018 15:30:25 return [ia_getregion_test] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_ia_getslice.py b/gcwrap/python/scripts/tests/test_ia_getslice.py build 12-Sep-2018 15:30:25 new file mode 100644 build 12-Sep-2018 15:30:25 index 0000000..0e4b28d build 12-Sep-2018 15:30:25 --- /dev/null build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_ia_getslice.py build 12-Sep-2018 15:30:25 @@ -0,0 +1,146 @@ build 12-Sep-2018 15:30:25 +########################################################################## build 12-Sep-2018 15:30:25 +# imfit_test.py build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# Copyright (C) 2008, 2009 build 12-Sep-2018 15:30:25 +# Associated Universities, Inc. Washington DC, USA. build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# This script is free software; you can redistribute it and/or modify it build 12-Sep-2018 15:30:25 +# under the terms of the GNU Library General Public License as published by build 12-Sep-2018 15:30:25 +# the Free Software Foundation; either version 2 of the License, or (at your build 12-Sep-2018 15:30:25 +# option) any later version. build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# This library is distributed in the hope that it will be useful, but WITHOUT build 12-Sep-2018 15:30:25 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or build 12-Sep-2018 15:30:25 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public build 12-Sep-2018 15:30:25 +# License for more details. build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# You should have received a copy of the GNU Library General Public License build 12-Sep-2018 15:30:25 +# along with this library; if not, write to the Free Software Foundation, build 12-Sep-2018 15:30:25 +# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# Correspondence concerning AIPS++ should be adressed as follows: build 12-Sep-2018 15:30:25 +# Internet email: aips2-request@nrao.edu. build 12-Sep-2018 15:30:25 +# Postal address: AIPS++ Project Office build 12-Sep-2018 15:30:25 +# National Radio Astronomy Observatory build 12-Sep-2018 15:30:25 +# 520 Edgemont Road build 12-Sep-2018 15:30:25 +# Charlottesville, VA 22903-2475 USA build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# Dave Mehringer build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# Test suite for the CASA tool method ia.getslice() build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +#
      build 12-Sep-2018 15:30:25 +#
    build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# Test for the ia.getslice() tool method build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# Test the ia.getslice() tool method build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# This test runs as part of the CASA python unit test suite and can be run from build 12-Sep-2018 15:30:25 +# the command line via eg build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# `echo $CASAPATH/bin/casa | sed -e 's$ $/$'` --nologger --log2term -c `echo $CASAPATH | awk '{print $1}'`/code/xmlcasa/scripts/regressions/admin/runUnitTest.py test_ia_getslice[test1,test2,...] build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# To provide a test standard for the ia.getslice() tool method to ensure build 12-Sep-2018 15:30:25 +# coding changes do not break the associated bits build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +########################################################################### build 12-Sep-2018 15:30:25 +import shutil build 12-Sep-2018 15:30:25 +import casac build 12-Sep-2018 15:30:25 +from tasks import * build 12-Sep-2018 15:30:25 +from taskinit import * build 12-Sep-2018 15:30:25 +from __main__ import * build 12-Sep-2018 15:30:25 +import unittest build 12-Sep-2018 15:30:25 +import numpy build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class ia_getslice_test(unittest.TestCase): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_basic(self): build 12-Sep-2018 15:30:25 + """Test basic functionality""" build 12-Sep-2018 15:30:25 + shape = [10, 10] build 12-Sep-2018 15:30:25 + dv = numpy.zeros(shape, dtype=numpy.float64) build 12-Sep-2018 15:30:25 + cv = numpy.zeros(shape, dtype=numpy.complex128) build 12-Sep-2018 15:30:25 + for i in range(10): build 12-Sep-2018 15:30:25 + for k in range(10): build 12-Sep-2018 15:30:25 + x = i+k build 12-Sep-2018 15:30:25 + dv[i, k] = x build 12-Sep-2018 15:30:25 + cv[i, k] = complex(x, 2*x) build 12-Sep-2018 15:30:25 + myia = iatool() build 12-Sep-2018 15:30:25 + expdist = [ build 12-Sep-2018 15:30:25 + 0. , 0.31426975, 0.62853932, 0.9428091 , 1.25707865, build 12-Sep-2018 15:30:25 + 1.57134843, 1.88561797, 2.19988775, 2.5141573 , 2.82842708 build 12-Sep-2018 15:30:25 + ] build 12-Sep-2018 15:30:25 + expxpos = [ build 12-Sep-2018 15:30:25 + 1. , 1.22222221, 1.44444442, 1.66666663, 1.88888884, build 12-Sep-2018 15:30:25 + 2.11111116, 2.33333325, 2.55555558, 2.77777767, 3. build 12-Sep-2018 15:30:25 + ] build 12-Sep-2018 15:30:25 + expypos = [ build 12-Sep-2018 15:30:25 + 2. , 2.22222233, 2.44444442, 2.66666675, 2.88888884, build 12-Sep-2018 15:30:25 + 3.11111116, 3.33333325, 3.55555558, 3.77777767, 4. build 12-Sep-2018 15:30:25 + ] build 12-Sep-2018 15:30:25 + exprpix = [] build 12-Sep-2018 15:30:25 + for i in range(10): build 12-Sep-2018 15:30:25 + exprpix.append(3 + 4.0*i/9.0) build 12-Sep-2018 15:30:25 + expcpix = (1 + 2j) * numpy.array(exprpix) build 12-Sep-2018 15:30:25 + for mytype in ['f', 'd', 'c', 'cd']: build 12-Sep-2018 15:30:25 + myia.fromshape("", shape, type=mytype) build 12-Sep-2018 15:30:25 + if mytype == 'f' or mytype == 'd': build 12-Sep-2018 15:30:25 + myia.putchunk(dv) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + myia.putchunk(cv) build 12-Sep-2018 15:30:25 + bb = myia.getslice(x=[1,3], y=[2,4], npts=10, method='linear') build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.isclose(bb['distance'], expdist).all(), build 12-Sep-2018 15:30:25 + "distance is wrong" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.isclose(bb['xpos'], expxpos).all(), build 12-Sep-2018 15:30:25 + "xpos is wrong" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.isclose(bb['ypos'], expypos).all(), build 12-Sep-2018 15:30:25 + "ypos is wrong" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + bb['mask'].all(), "mask is wrong" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + if mytype == 'f' or mytype == 'd': build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.isclose(bb['pixel'], exprpix).all(), build 12-Sep-2018 15:30:25 + "data values are wrong" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.isclose(bb['pixel'], expcpix).all(), build 12-Sep-2018 15:30:25 + "data values are wrong" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + myia.done() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +def suite(): build 12-Sep-2018 15:30:25 + return [ia_getslice_test] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_ia_maskhandler.py b/gcwrap/python/scripts/tests/test_ia_maskhandler.py build 12-Sep-2018 15:30:25 index 96705d7..a1b8389 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_ia_maskhandler.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_ia_maskhandler.py build 12-Sep-2018 15:30:25 @@ -83,15 +83,17 @@ class ia_maskhandler_test(unittest.TestCase): build 12-Sep-2018 15:30:25 def test_history(self): build 12-Sep-2018 15:30:25 """Verify ia.insert writes history to image""" build 12-Sep-2018 15:30:25 myia = self.ia build 12-Sep-2018 15:30:25 - imag = "hist_zxye.im" build 12-Sep-2018 15:30:25 shape = [20, 20] build 12-Sep-2018 15:30:25 - myia.fromshape(imag, shape) build 12-Sep-2018 15:30:25 - myia.calcmask(imag + ">0") build 12-Sep-2018 15:30:25 - myia.maskhandler("rename", ["mask0", "blahmask"]) build 12-Sep-2018 15:30:25 - msgs = myia.history() build 12-Sep-2018 15:30:25 - myia.done() build 12-Sep-2018 15:30:25 - self.assertTrue("ia.maskhandler" in msgs[-2]) build 12-Sep-2018 15:30:25 - self.assertTrue("ia.maskhandler" in msgs[-1]) build 12-Sep-2018 15:30:25 + # also test support for all image pixel precision types build 12-Sep-2018 15:30:25 + for mytype in ('f', 'c', 'd', 'cd'): build 12-Sep-2018 15:30:25 + imag = "hist_zxye_" + mytype + ".im" build 12-Sep-2018 15:30:25 + myia.fromshape(imag, shape, type=mytype) build 12-Sep-2018 15:30:25 + myia.calcmask(imag + ">0") build 12-Sep-2018 15:30:25 + myia.maskhandler("rename", ["mask0", "blahmask"]) build 12-Sep-2018 15:30:25 + msgs = myia.history() build 12-Sep-2018 15:30:25 + myia.done() build 12-Sep-2018 15:30:25 + self.assertTrue("ia.maskhandler" in msgs[-2]) build 12-Sep-2018 15:30:25 + self.assertTrue("ia.maskhandler" in msgs[-1]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def suite(): build 12-Sep-2018 15:30:25 return [ia_maskhandler_test] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_ia_modify.py b/gcwrap/python/scripts/tests/test_ia_modify.py build 12-Sep-2018 15:30:25 index 06e6cc2..abec881 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_ia_modify.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_ia_modify.py build 12-Sep-2018 15:30:25 @@ -276,7 +276,10 @@ class ia_modify_test(unittest.TestCase): build 12-Sep-2018 15:30:25 stats = myim.statistics(list=False) build 12-Sep-2018 15:30:25 self.assertTrue(stats, 'failed to get statistics') build 12-Sep-2018 15:30:25 diff = abs(stats['flux']-flux)/flux build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.isclose(stats['flux'], flux, 0.001), 'model image 1 has wrong values') build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.isclose(stats['flux'], flux, 0.001), build 12-Sep-2018 15:30:25 + 'model image 1 has wrong values' build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 # Subtract it again build 12-Sep-2018 15:30:25 # debug build 12-Sep-2018 15:30:25 self.assertTrue(myim.modify(cl0.torecord(), subtract=True)) build 12-Sep-2018 15:30:25 @@ -302,7 +305,27 @@ class ia_modify_test(unittest.TestCase): build 12-Sep-2018 15:30:25 self.assertTrue(cl1['converged'], 'fitcomponents 1 did not converge') build 12-Sep-2018 15:30:25 cl1tool=cltool() build 12-Sep-2018 15:30:25 cl1tool.fromrecord(cl1['results']) build 12-Sep-2018 15:30:25 - self.assertTrue(compareComponentList(cl0,cl1tool), 'failed fitcomponents 1') build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + compareComponentList(cl0,cl1tool), 'failed fitcomponents 1' build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_point_source_fix(self): build 12-Sep-2018 15:30:25 + """Test fix of x/y swap bug CAS-11502""" build 12-Sep-2018 15:30:25 + mycl = cltool() build 12-Sep-2018 15:30:25 + # pixel [10, 30] build 12-Sep-2018 15:30:25 + mycl.addcomponent(flux=1, dir=['J2000', '00:02:40.00', '-00.20.00.0']) build 12-Sep-2018 15:30:25 + myia = iatool() build 12-Sep-2018 15:30:25 + myia.fromshape("", [100, 100, 1, 1]) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + myia.modify(model=mycl.torecord()), "Failed to run ia.modify" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + mycl.done() build 12-Sep-2018 15:30:25 + stats = myia.statistics() build 12-Sep-2018 15:30:25 + myia.done() build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + (stats['minpos'] == [10, 30, 0, 0]).all(), build 12-Sep-2018 15:30:25 + "Incorrect point source pixel posiiton" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def suite(): build 12-Sep-2018 15:30:25 return [ia_modify_test] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_ia_newimagefromimage.py b/gcwrap/python/scripts/tests/test_ia_newimagefromimage.py build 12-Sep-2018 15:30:25 index f429d3f..8f4925b 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_ia_newimagefromimage.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_ia_newimagefromimage.py build 12-Sep-2018 15:30:25 @@ -89,6 +89,22 @@ class ia_newimagefromimage_test(unittest.TestCase): build 12-Sep-2018 15:30:25 myia.done() build 12-Sep-2018 15:30:25 self.assertTrue("ia.newimagefromimage" in msgs[-2]) build 12-Sep-2018 15:30:25 self.assertTrue("ia.newimagefromimage" in msgs[-1]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_pixeltype(self): build 12-Sep-2018 15:30:25 + myia = self._myia build 12-Sep-2018 15:30:25 + name = "myim.im" build 12-Sep-2018 15:30:25 + etype = { build 12-Sep-2018 15:30:25 + 'f': 'float', 'd': 'double', 'c': 'complex', build 12-Sep-2018 15:30:25 + 'cd': 'dcomplex' build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + for t in ("f", "c", "d", "cd"): build 12-Sep-2018 15:30:25 + myia.fromshape(name, [20,20], type=t, overwrite=True) build 12-Sep-2018 15:30:25 + myia.done() build 12-Sep-2018 15:30:25 + myia = myia.newimagefromimage(name) build 12-Sep-2018 15:30:25 + self.assertEquals( build 12-Sep-2018 15:30:25 + myia.pixeltype(), etype[t], "data tpye check failed" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + myia.done() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def suite(): build 12-Sep-2018 15:30:25 return [ia_newimagefromimage_test] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_ia_putregion.py b/gcwrap/python/scripts/tests/test_ia_putregion.py build 12-Sep-2018 15:30:25 index 3718377..c946381 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_ia_putregion.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_ia_putregion.py build 12-Sep-2018 15:30:25 @@ -70,6 +70,7 @@ from tasks import * build 12-Sep-2018 15:30:25 from taskinit import * build 12-Sep-2018 15:30:25 from __main__ import * build 12-Sep-2018 15:30:25 import unittest build 12-Sep-2018 15:30:25 +import numpy build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class ia_putregion_test(unittest.TestCase): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -92,5 +93,39 @@ class ia_putregion_test(unittest.TestCase): build 12-Sep-2018 15:30:25 self.assertTrue("ia.putregion" in msgs[-2]) build 12-Sep-2018 15:30:25 self.assertTrue("ia.putregion" in msgs[-1]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + def test_precision(self): build 12-Sep-2018 15:30:25 + """Test images with pixel values of various precisions""" build 12-Sep-2018 15:30:25 + myia = self._myia build 12-Sep-2018 15:30:25 + jj = 1.234567890123456789 build 12-Sep-2018 15:30:25 + kk = jj*(1 + 2j) build 12-Sep-2018 15:30:25 + jj = numpy.array([[jj, jj], [jj, jj]], dtype=float) build 12-Sep-2018 15:30:25 + kk = numpy.array([[kk, kk], [kk, kk]], dtype=complex) build 12-Sep-2018 15:30:25 + for mytype in ('f', 'd', 'c', 'cd'): build 12-Sep-2018 15:30:25 + myia.fromshape("", [2,2], type=mytype) build 12-Sep-2018 15:30:25 + self.assertTrue(myia) build 12-Sep-2018 15:30:25 + for v in (0, 1): build 12-Sep-2018 15:30:25 + if v == 0: build 12-Sep-2018 15:30:25 + gg = jj build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + gg = kk build 12-Sep-2018 15:30:25 + if ( build 12-Sep-2018 15:30:25 + (v == 1 and (mytype == 'f' or mytype == 'd')) build 12-Sep-2018 15:30:25 + or (v == 0 and (mytype == 'c' or mytype == 'cd')) build 12-Sep-2018 15:30:25 + ): build 12-Sep-2018 15:30:25 + self.assertRaises(Exception, myia.putregion, gg) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + myia.putregion(gg) build 12-Sep-2018 15:30:25 + bb = myia.getchunk() build 12-Sep-2018 15:30:25 + if mytype == 'f' or mytype == 'c': build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.isclose(bb, gg, 1e-8, 1e-8).all() build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertFalse( build 12-Sep-2018 15:30:25 + numpy.isclose(bb, gg, 1e-9, 1e-9).all() build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + self.assertTrue((bb == gg).all()) build 12-Sep-2018 15:30:25 + myia.done() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def suite(): build 12-Sep-2018 15:30:25 return [ia_putregion_test] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_ia_subimage.py b/gcwrap/python/scripts/tests/test_ia_subimage.py build 12-Sep-2018 15:30:25 index 1871d3c..9f02629 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_ia_subimage.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_ia_subimage.py build 12-Sep-2018 15:30:25 @@ -127,7 +127,6 @@ class ia_subimage_test(unittest.TestCase): build 12-Sep-2018 15:30:25 myia.done() build 12-Sep-2018 15:30:25 self.assertFalse(imsubimage(imname, "junk", mask=mask3, stretch=True)) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 def test_beams(self): build 12-Sep-2018 15:30:25 """ Test per plane beams """ build 12-Sep-2018 15:30:25 myia = self.myia build 12-Sep-2018 15:30:25 @@ -184,13 +183,29 @@ class ia_subimage_test(unittest.TestCase): build 12-Sep-2018 15:30:25 beams = myia.restoringbeam() build 12-Sep-2018 15:30:25 self.assertTrue(len(beams['beams']) == 12) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def test_complex(self): build 12-Sep-2018 15:30:25 - """Test complex valued image support""" build 12-Sep-2018 15:30:25 + def test_precision(self): build 12-Sep-2018 15:30:25 + """Test various precision valued image support""" build 12-Sep-2018 15:30:25 myia = self.myia build 12-Sep-2018 15:30:25 - myia.fromshape("",[2,2], type='c') build 12-Sep-2018 15:30:25 - subim = myia.subimage() build 12-Sep-2018 15:30:25 - myia.done() build 12-Sep-2018 15:30:25 - self.assertTrue(type(subim.getchunk()[0,0]) == numpy.complex128) build 12-Sep-2018 15:30:25 + j = 1.2345678901234567890123456789 build 12-Sep-2018 15:30:25 + k = j*(1+1j) build 12-Sep-2018 15:30:25 + for mytype in ['f', 'c', 'd', 'cd']: build 12-Sep-2018 15:30:25 + myia.fromshape("",[2,2], type=mytype) build 12-Sep-2018 15:30:25 + zz = myia.getchunk() build 12-Sep-2018 15:30:25 + expectype = type(zz[0, 0]) build 12-Sep-2018 15:30:25 + if mytype == 'f' or mytype =='d': build 12-Sep-2018 15:30:25 + zz[:] = j build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + zz[:] = k build 12-Sep-2018 15:30:25 + myia.putchunk(zz) build 12-Sep-2018 15:30:25 + subim = myia.subimage() build 12-Sep-2018 15:30:25 + myia.done() build 12-Sep-2018 15:30:25 + yy = subim.getchunk() build 12-Sep-2018 15:30:25 + subim.done() build 12-Sep-2018 15:30:25 + self.assertTrue(type(yy[0,0]) == expectype) build 12-Sep-2018 15:30:25 + if mytype == 'f' or mytype == 'c': build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.isclose(yy, zz, 1e-8, 1e-8).all()) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + self.assertTrue((yy == zz).all()) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_CAS7704(self): build 12-Sep-2018 15:30:25 """Test CAS-7704, chans can be specified with region file""" build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_importasdm.py b/gcwrap/python/scripts/tests/test_importasdm.py build 12-Sep-2018 15:30:25 index 9683244..dff71b4 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_importasdm.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_importasdm.py build 12-Sep-2018 15:30:25 @@ -37,6 +37,7 @@ import testhelper as th build 12-Sep-2018 15:30:25 import unittest build 12-Sep-2018 15:30:25 import partitionhelper as ph build 12-Sep-2018 15:30:25 from parallel.parallel_data_helper import ParallelDataHelper build 12-Sep-2018 15:30:25 +import recipes.ephemerides.convertephem as ce build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 myname = 'test_importasdm' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -366,7 +367,6 @@ class asdm_import1(test_base): build 12-Sep-2018 15:30:25 apcorrected=False, build 12-Sep-2018 15:30:25 useversion='v3' build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 - print "rval is ", rval build 12-Sep-2018 15:30:25 if not rval: build 12-Sep-2018 15:30:25 raise Exception build 12-Sep-2018 15:30:25 os.system('rm -rf '+asdmname+'; mv exportasdm-output.asdm '+asdmname) build 12-Sep-2018 15:30:25 @@ -547,7 +547,6 @@ class asdm_import2(test_base): build 12-Sep-2018 15:30:25 apcorrected=False, build 12-Sep-2018 15:30:25 useversion='v3' build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 - print "rval is ", rval build 12-Sep-2018 15:30:25 if not rval: build 12-Sep-2018 15:30:25 raise Exception build 12-Sep-2018 15:30:25 os.system('rm -rf '+asdmname+'; mv exportasdm-output.asdm '+asdmname) build 12-Sep-2018 15:30:25 @@ -1269,36 +1268,214 @@ class asdm_import7(test_base): build 12-Sep-2018 15:30:25 print myname, ": Error Cannot open MS table", themsname build 12-Sep-2018 15:30:25 retValue['success']=False build 12-Sep-2018 15:30:25 retValue['error_msgs']=retValue['error_msgs']+'Cannot open MS table '+themsname build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - mslocal.close() build 12-Sep-2018 15:30:25 - print myname, ": OK." build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - for name in ["FIELD/EPHEM0_Mars_57034.9.tab", build 12-Sep-2018 15:30:25 - "FIELD/EPHEM1_Titania_57034.9.tab"]: build 12-Sep-2018 15:30:25 - tblocal.open(themsname+"/"+name) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + print myname, " : testing FIELD values in ms.summary()" build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + mssum = mslocal.summary() build 12-Sep-2018 15:30:25 + # only Mars appears here because this short SDM only contains a single scan and that uses Mars build 12-Sep-2018 15:30:25 + self.assertEqual(mssum['scan_1']['0']['FieldName'],'Mars') build 12-Sep-2018 15:30:25 + self.assertAlmostEqual(mssum['field_0']['direction']['m0']['value'],-0.4770797859505159,15) build 12-Sep-2018 15:30:25 + self.assertAlmostEqual(mssum['field_0']['direction']['m1']['value'],-0.2154815444753364,15) build 12-Sep-2018 15:30:25 + except: build 12-Sep-2018 15:30:25 + print myname, ": Error ms summary has an unexpect source or direction value" build 12-Sep-2018 15:30:25 + retValue['success']=False build 12-Sep-2018 15:30:25 + retValue['error_msg']=retValue['err_msg']+'Unexpected source or direction value in ms summary '+thismsname + '\n' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + mslocal.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ephems = [] build 12-Sep-2018 15:30:25 + # values from indivual rows were picked for no particular reason except verify they've not changed build 12-Sep-2018 15:30:25 + ephems.append({'name':"FIELD/EPHEM0_Mars_57034.9.tab", build 12-Sep-2018 15:30:25 + 'nrows':27, build 12-Sep-2018 15:30:25 + 'rows':[{'row':10, build 12-Sep-2018 15:30:25 + 'values':{'MJD':57035.041666666664, build 12-Sep-2018 15:30:25 + 'RA':332.7140437500001, build 12-Sep-2018 15:30:25 + 'DEC':-12.327346944444447, build 12-Sep-2018 15:30:25 + 'Rho':2.024609480125507, build 12-Sep-2018 15:30:25 + 'RadVel':723729.77502873}}, build 12-Sep-2018 15:30:25 + {'row':22, build 12-Sep-2018 15:30:25 + 'values':{'MJD':57035.208333333336, build 12-Sep-2018 15:30:25 + 'RA':332.8387870833333, build 12-Sep-2018 15:30:25 + 'DEC':-12.2793975, build 12-Sep-2018 15:30:25 + 'Rho':2.0254053468626436, build 12-Sep-2018 15:30:25 + 'RadVel':705588.202526264}} build 12-Sep-2018 15:30:25 + ] build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ephems.append({'name':"FIELD/EPHEM1_Titania_57034.9.tab", build 12-Sep-2018 15:30:25 + 'nrows':45, build 12-Sep-2018 15:30:25 + 'rows':[{'row':17, build 12-Sep-2018 15:30:25 + 'values':{'MJD':57035.055555555555, build 12-Sep-2018 15:30:25 + 'RA':11.813166666666666, build 12-Sep-2018 15:30:25 + 'DEC':4.365749999999999, build 12-Sep-2018 15:30:25 + 'Rho':20.150883673698488, build 12-Sep-2018 15:30:25 + 'RadVel':2730048.0839084117}}, build 12-Sep-2018 15:30:25 + {'row':40, build 12-Sep-2018 15:30:25 + 'values':{'MJD':57035.21527777778, build 12-Sep-2018 15:30:25 + 'RA':11.816041666666667, build 12-Sep-2018 15:30:25 + 'DEC':4.3661111111111115, build 12-Sep-2018 15:30:25 + 'Rho':20.153736461701364, build 12-Sep-2018 15:30:25 + 'RadVel':2711142.1699538543}} build 12-Sep-2018 15:30:25 + ] build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + for ephem in ephems: build 12-Sep-2018 15:30:25 + print myname,": Testing various things in ephemeris ", ephem['name'], " ..." build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + tblocal.open(themsname+"/"+ephem['name']) build 12-Sep-2018 15:30:25 kw = tblocal.getkeywords() build 12-Sep-2018 15:30:25 + nrows = tblocal.nrows() build 12-Sep-2018 15:30:25 + if not nrows==ephem['nrows']: build 12-Sep-2018 15:30:25 + print myname,": Error. unexpected number of rows in ephemeris :",ephem['name'] build 12-Sep-2018 15:30:25 + retValue['success']=False build 12-Sep-2018 15:30:25 + retValue['error_msg']=retValue['error_msgs']+' Unexpected number of rows in ephemeris table :'+ ephem['name'] + '\n' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + for row in ephem['rows']: build 12-Sep-2018 15:30:25 + thisRow = row['row'] build 12-Sep-2018 15:30:25 + for colname in row['values']: build 12-Sep-2018 15:30:25 + thisVal = tblocal.getcell(colname,thisRow) build 12-Sep-2018 15:30:25 + self.assertAlmostEqual(thisVal,row['values'][colname],10) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # unfilled columns build 12-Sep-2018 15:30:25 + self.assertEqual((tblocal.getcol('diskLong') != 0.0).sum(),0) build 12-Sep-2018 15:30:25 + self.assertEqual((tblocal.getcol('diskLat') != 0.0).sum(),0) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 tblocal.close() build 12-Sep-2018 15:30:25 geodist = kw['GeoDist'] # (km above reference ellipsoid) build 12-Sep-2018 15:30:25 geolat = kw['GeoLat'] # (deg) build 12-Sep-2018 15:30:25 geolong = kw['GeoLong'] # (deg) build 12-Sep-2018 15:30:25 - print myname, ": Testing if ephemeris ", name, " was converted to GEO ..." build 12-Sep-2018 15:30:25 if not (geodist==geolat==geolong==0.): build 12-Sep-2018 15:30:25 print myname, ": ERROR." build 12-Sep-2018 15:30:25 retValue['success']=False build 12-Sep-2018 15:30:25 retValue['error_msgs']=retValue['error_msgs']+' Ephemeris was not converted to GEO for '+themsname+'\n' build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - print myname, ": OK." build 12-Sep-2018 15:30:25 prsys = kw['posrefsys'] build 12-Sep-2018 15:30:25 - print myname, ": Testing if posrefsys was set correctly ..." build 12-Sep-2018 15:30:25 if not (prsys=="ICRF/ICRS"): build 12-Sep-2018 15:30:25 print myname, ": ERROR." build 12-Sep-2018 15:30:25 retValue['success']=False build 12-Sep-2018 15:30:25 retValue['error_msgs']=retValue['error_msgs']+' posrefsys keyword is not ICRF/ICRS '+themsname+'\n' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # fill and request an interpolated table. Tests asdm2MS directly as this option isn't build 12-Sep-2018 15:30:25 + # available in importasdm build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + print myname," filling an interpolated version of the same ephemeris" build 12-Sep-2018 15:30:25 + themsname_interp = myasdmname+".interp.ms" build 12-Sep-2018 15:30:25 + execute_string = "asdm2MS --no-pointing --interpolate-ephemeris 'yes' " + myasdmname + ' ' + themsname_interp build 12-Sep-2018 15:30:25 + print myname, ' executing : ', execute_string build 12-Sep-2018 15:30:25 + exitcode = os.system(execute_string) build 12-Sep-2018 15:30:25 + self.assertEqual(exitcode,0) build 12-Sep-2018 15:30:25 + ce.convert2geo(themsname_interp, '*') # convert the ephemeris to GEO build 12-Sep-2018 15:30:25 + # note that the recalculation of UVW and the adjustment of the SOURCE table are not build 12-Sep-2018 15:30:25 + # done here the way they would be done if filled via importasdm build 12-Sep-2018 15:30:25 + print myname, ": Success! Now checking output ..." build 12-Sep-2018 15:30:25 + for name in mscomponents: build 12-Sep-2018 15:30:25 + if not os.access(themsname_interp+"/"+name, os.F_OK): build 12-Sep-2018 15:30:25 + print myname, ": Error ", themsname_interp+"/"+name, "doesn't exist ..." build 12-Sep-2018 15:30:25 + retValue['success']=False build 12-Sep-2018 15:30:25 + retValue['error_msgs']=retValue['error_msgs']+themsname_interp+'/'+name+' does not exist' build 12-Sep-2018 15:30:25 else: build 12-Sep-2018 15:30:25 - print myname, ": OK." build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + print myname, ": ", name, "present." build 12-Sep-2018 15:30:25 + print myname, ": MS exists. All relevant tables present. Try opening as MS ..." build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + mslocal.open(themsname_interp) build 12-Sep-2018 15:30:25 + except: build 12-Sep-2018 15:30:25 + print myname, ": Error Cannot open MS table", themsname_interp build 12-Sep-2018 15:30:25 + retValue['success']=False build 12-Sep-2018 15:30:25 + retValue['error_msgs']=retValue['error_msgs']+'Cannot open MS table '+themsname_interp build 12-Sep-2018 15:30:25 + print myname, " : testing FIELD values in ms.summary()" build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + mssum = mslocal.summary() build 12-Sep-2018 15:30:25 + # only Mars appears here because this short SDM only contains a single scan and that uses Mars build 12-Sep-2018 15:30:25 + self.assertEqual(mssum['scan_1']['0']['FieldName'],'Mars') build 12-Sep-2018 15:30:25 + # difference here is < 0".0004 of the above, non-interpolated value build 12-Sep-2018 15:30:25 + self.assertAlmostEqual(mssum['field_0']['direction']['m0']['value'],-0.4770797877079177,15) build 12-Sep-2018 15:30:25 + # difference here is < 0".00005 of the above, non-interpolated value build 12-Sep-2018 15:30:25 + self.assertAlmostEqual(mssum['field_0']['direction']['m1']['value'],-0.2154815442529733,15) build 12-Sep-2018 15:30:25 + except: build 12-Sep-2018 15:30:25 + print myname, ": Error ms summary has an unexpect source or direction value" build 12-Sep-2018 15:30:25 + retValue['success']=False build 12-Sep-2018 15:30:25 + retValue['error_msg']=retValue['err_msg']+'Unexpected source or direction value in ms summary '+thismsname + '\n' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + mslocal.close() build 12-Sep-2018 15:30:25 + ephems = [] build 12-Sep-2018 15:30:25 + # values from indivual rows were picked for no particular reason except verify they've not changed build 12-Sep-2018 15:30:25 + # these rows build 12-Sep-2018 15:30:25 + ephems.append({'name':"FIELD/EPHEM0_Mars_57034.9.tab", build 12-Sep-2018 15:30:25 + 'nrows':361, build 12-Sep-2018 15:30:25 + 'rows':[{'row':105, build 12-Sep-2018 15:30:25 + 'values':{'MJD':57035.008000000001630, build 12-Sep-2018 15:30:25 + 'RA':332.688983703339886, build 12-Sep-2018 15:30:25 + 'DEC':-12.337033046664128, build 12-Sep-2018 15:30:25 + 'Rho':2.024447666954067, build 12-Sep-2018 15:30:25 + 'RadVel':722270.482337458524853}}, build 12-Sep-2018 15:30:25 + {'row':320, build 12-Sep-2018 15:30:25 + 'values':{'MJD':57035.222999999998137, build 12-Sep-2018 15:30:25 + 'RA':332.849807533339913, build 12-Sep-2018 15:30:25 + 'DEC':-12.275182948886352, build 12-Sep-2018 15:30:25 + 'Rho':2.025474163348287, build 12-Sep-2018 15:30:25 + 'RadVel':702390.653405150165781}} build 12-Sep-2018 15:30:25 + ] build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ephems.append({'name':"FIELD/EPHEM1_Titania_57034.9.tab", build 12-Sep-2018 15:30:25 + 'nrows':306, build 12-Sep-2018 15:30:25 + 'rows':[{'row':95, build 12-Sep-2018 15:30:25 + 'values':{'MJD':57035.033000000003085, build 12-Sep-2018 15:30:25 + 'RA':11.812802333333494, build 12-Sep-2018 15:30:25 + 'DEC':4.365715333333369, build 12-Sep-2018 15:30:25 + 'Rho':20.150479182212013, build 12-Sep-2018 15:30:25 + 'RadVel':2725243.279430569149554}}, build 12-Sep-2018 15:30:25 + {'row':250, build 12-Sep-2018 15:30:25 + 'values':{'MJD':57035.188000000001921, build 12-Sep-2018 15:30:25 + 'RA':11.815509000000159, build 12-Sep-2018 15:30:25 + 'DEC':4.366057555555590, build 12-Sep-2018 15:30:25 + 'Rho':20.153251583732832, build 12-Sep-2018 15:30:25 + 'RadVel':2721431.250284913461655}} build 12-Sep-2018 15:30:25 + ] build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + for ephem in ephems: build 12-Sep-2018 15:30:25 + print myname,": Testing various things in ephemeris ", ephem['name'], " ..." build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + tblocal.open(themsname_interp+"/"+ephem['name']) build 12-Sep-2018 15:30:25 + kw = tblocal.getkeywords() build 12-Sep-2018 15:30:25 + nrows = tblocal.nrows() build 12-Sep-2018 15:30:25 + if not nrows==ephem['nrows']: build 12-Sep-2018 15:30:25 + print myname,": Error. unexpected number of rows in ephemeris :",ephem['name'] build 12-Sep-2018 15:30:25 + retValue['success']=False build 12-Sep-2018 15:30:25 + retValue['error_msg']=retValue['error_msgs']+' Unexpected number of rows in ephemeris table :'+ ephem['name'] + '\n' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + for row in ephem['rows']: build 12-Sep-2018 15:30:25 + thisRow = row['row'] build 12-Sep-2018 15:30:25 + for colname in row['values']: build 12-Sep-2018 15:30:25 + thisVal = tblocal.getcell(colname,thisRow) build 12-Sep-2018 15:30:25 + self.assertAlmostEqual(thisVal,row['values'][colname],10) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # unfilled columns build 12-Sep-2018 15:30:25 + self.assertEqual((tblocal.getcol('diskLong') != 0.0).sum(),0) build 12-Sep-2018 15:30:25 + self.assertEqual((tblocal.getcol('diskLat') != 0.0).sum(),0) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + tblocal.close() build 12-Sep-2018 15:30:25 + geodist = kw['GeoDist'] # (km above reference ellipsoid) build 12-Sep-2018 15:30:25 + geolat = kw['GeoLat'] # (deg) build 12-Sep-2018 15:30:25 + geolong = kw['GeoLong'] # (deg) build 12-Sep-2018 15:30:25 + if not (geodist==geolat==geolong==0.): build 12-Sep-2018 15:30:25 + print myname, ": ERROR." build 12-Sep-2018 15:30:25 + retValue['success']=False build 12-Sep-2018 15:30:25 + retValue['error_msgs']=retValue['error_msgs']+' Ephemeris was not converted to GEO for '+themsname_interp+'\n' build 12-Sep-2018 15:30:25 + prsys = kw['posrefsys'] build 12-Sep-2018 15:30:25 + if not (prsys=="ICRF/ICRS"): build 12-Sep-2018 15:30:25 + print myname, ": ERROR." build 12-Sep-2018 15:30:25 + retValue['success']=False build 12-Sep-2018 15:30:25 + retValue['error_msgs']=retValue['error_msgs']+' posrefsys keyword is not ICRF/ICRS '+themsname_interp+'\n' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 self.assertTrue(retValue['success'],retValue['error_msgs']) build 12-Sep-2018 15:30:25 + print myname, ": OK." build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test7_lazy4(self): build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_importcasa.py b/gcwrap/python/scripts/tests/test_importcasa.py build 12-Sep-2018 15:30:25 new file mode 100644 build 12-Sep-2018 15:30:25 index 0000000..2227aa5 build 12-Sep-2018 15:30:25 --- /dev/null build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_importcasa.py build 12-Sep-2018 15:30:25 @@ -0,0 +1,11 @@ build 12-Sep-2018 15:30:25 +import unittest build 12-Sep-2018 15:30:25 +# Test that casa.py can be imported build 12-Sep-2018 15:30:25 +class casaimport_test(unittest.TestCase): build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 + def test_importcasa(self): build 12-Sep-2018 15:30:25 + import casa build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 +def suite(): build 12-Sep-2018 15:30:25 + return [casaimport_test] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_importevla.py b/gcwrap/python/scripts/tests/test_importevla.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index a58eed6..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_importevla.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,492 +0,0 @@ build 12-Sep-2018 15:30:25 -############################################################################# build 12-Sep-2018 15:30:25 -# $Id:$ build 12-Sep-2018 15:30:25 -# Test Name: # build 12-Sep-2018 15:30:25 -# Regression Test Script for ASDM version 1.0 import to MS # build 12-Sep-2018 15:30:25 -# and the "inverse filler" task importevla build 12-Sep-2018 15:30:25 -# # build 12-Sep-2018 15:30:25 -# Rationale for Inclusion: # build 12-Sep-2018 15:30:25 -# The conversion of ASDM to MS and back needs to be verified. # build 12-Sep-2018 15:30:25 -# # build 12-Sep-2018 15:30:25 -# Features tested: # build 12-Sep-2018 15:30:25 -# 1) Is the import performed without raising exceptions # build 12-Sep-2018 15:30:25 -# 2) Do all expected tables exist # build 12-Sep-2018 15:30:25 -# 3) Can the MS be opened # build 12-Sep-2018 15:30:25 -# 4) Do the tables contain expected values # build 12-Sep-2018 15:30:25 -# 5) Is exportasdm performed without raising exceptions # build 12-Sep-2018 15:30:25 -# 6) Is the created ASDM well-formed (XML) and complete # build 12-Sep-2018 15:30:25 -# 7) Can the resulting ASDM be reimported without raising exceptions # build 12-Sep-2018 15:30:25 -# 8) Does it have the same number of integrations as the original # build 12-Sep-2018 15:30:25 -# # build 12-Sep-2018 15:30:25 -# Input data: # build 12-Sep-2018 15:30:25 -# one dataset for the filler of ASDM 1.0 # build 12-Sep-2018 15:30:25 -# one simulated MS dataset # build 12-Sep-2018 15:30:25 -# # build 12-Sep-2018 15:30:25 -############################################################################# build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -import sys build 12-Sep-2018 15:30:25 -import shutil build 12-Sep-2018 15:30:25 -import commands build 12-Sep-2018 15:30:25 -from __main__ import default build 12-Sep-2018 15:30:25 -from tasks import importevla, flagdata, flagcmd build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 -import unittest build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def checktable(msname, thename, theexpectation): build 12-Sep-2018 15:30:25 - global myname build 12-Sep-2018 15:30:25 - tb.open(msname+"/"+thename) build 12-Sep-2018 15:30:25 - if thename == "": build 12-Sep-2018 15:30:25 - thename = "MAIN" build 12-Sep-2018 15:30:25 - for mycell in theexpectation: build 12-Sep-2018 15:30:25 - print myname, ": comparing ", mycell build 12-Sep-2018 15:30:25 - value = tb.getcell(mycell[0], mycell[1]) build 12-Sep-2018 15:30:25 - # see if value is array build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - isarray = value.__len__ build 12-Sep-2018 15:30:25 - except: build 12-Sep-2018 15:30:25 - # it's not an array build 12-Sep-2018 15:30:25 - # zero tolerance? build 12-Sep-2018 15:30:25 - if mycell[3] == 0: build 12-Sep-2018 15:30:25 - in_agreement = (value == mycell[2]) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - in_agreement = ( abs(value - mycell[2]) < mycell[3]) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - # it's an array build 12-Sep-2018 15:30:25 - # zero tolerance? build 12-Sep-2018 15:30:25 - if mycell[3] == 0: build 12-Sep-2018 15:30:25 - in_agreement = (value == mycell[2]).all() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - in_agreement = (abs(value - mycell[2]) < mycell[3]).all() build 12-Sep-2018 15:30:25 - if not in_agreement: build 12-Sep-2018 15:30:25 - print myname, ": Error in MS subtable", thename, ":" build 12-Sep-2018 15:30:25 - print " column ", mycell[0], " row ", mycell[1], " contains ", value build 12-Sep-2018 15:30:25 - print " expected value is ", mycell[2] build 12-Sep-2018 15:30:25 - tb.close() build 12-Sep-2018 15:30:25 - return False build 12-Sep-2018 15:30:25 - tb.close() build 12-Sep-2018 15:30:25 - print myname, ": table ", thename, " as expected." build 12-Sep-2018 15:30:25 - return True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -myname = 'importevla_ut' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -class importevla_test(unittest.TestCase): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp(self): build 12-Sep-2018 15:30:25 -# res = None build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - origname = 'X_osro_013.55979.93803716435' build 12-Sep-2018 15:30:25 - asdmname = 'xosro' build 12-Sep-2018 15:30:25 - if (not os.path.exists(asdmname)): build 12-Sep-2018 15:30:25 - datapath=os.environ.get('CASAPATH').split()[0]+'/data/regression/unittest/importevla/' build 12-Sep-2018 15:30:25 - os.system('ln -s '+datapath+origname+' '+asdmname) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.asdm = asdmname build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - default(importevla) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test1(self): build 12-Sep-2018 15:30:25 - '''Importevla test1: Good input asdm''' build 12-Sep-2018 15:30:25 - retValue = {'success': True, 'msgs': "", 'error_msgs': '' } build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - msname = 'xosro1.ms' build 12-Sep-2018 15:30:25 -# self.res = importevla(asdm=self.asdm, scans='3') build 12-Sep-2018 15:30:25 - self.res = importevla(asdm=self.asdm, vis=msname, scans='2') build 12-Sep-2018 15:30:25 - print myname, ": Success! Now checking output ..." build 12-Sep-2018 15:30:25 - mscomponents = set(["table.dat", build 12-Sep-2018 15:30:25 -# "table.f0", build 12-Sep-2018 15:30:25 - "table.f1", build 12-Sep-2018 15:30:25 - "table.f2", build 12-Sep-2018 15:30:25 - "table.f3", build 12-Sep-2018 15:30:25 - "table.f4", build 12-Sep-2018 15:30:25 - "table.f5", build 12-Sep-2018 15:30:25 - "table.f6", build 12-Sep-2018 15:30:25 - "table.f7", build 12-Sep-2018 15:30:25 - "table.f8", build 12-Sep-2018 15:30:25 - "Antenna.xml", build 12-Sep-2018 15:30:25 - "Flag.xml", build 12-Sep-2018 15:30:25 - "SpectralWindow.xml", build 12-Sep-2018 15:30:25 - "ANTENNA/table.dat", build 12-Sep-2018 15:30:25 - "DATA_DESCRIPTION/table.dat", build 12-Sep-2018 15:30:25 - "FEED/table.dat", build 12-Sep-2018 15:30:25 - "FIELD/table.dat", build 12-Sep-2018 15:30:25 - "FLAG_CMD/table.dat", build 12-Sep-2018 15:30:25 - "HISTORY/table.dat", build 12-Sep-2018 15:30:25 - "OBSERVATION/table.dat", build 12-Sep-2018 15:30:25 - "POINTING/table.dat", build 12-Sep-2018 15:30:25 - "POLARIZATION/table.dat", build 12-Sep-2018 15:30:25 - "PROCESSOR/table.dat", build 12-Sep-2018 15:30:25 - "SOURCE/table.dat", build 12-Sep-2018 15:30:25 - "SPECTRAL_WINDOW/table.dat", build 12-Sep-2018 15:30:25 - "STATE/table.dat", build 12-Sep-2018 15:30:25 - "SYSCAL/table.dat", build 12-Sep-2018 15:30:25 - "WEATHER/table.dat", build 12-Sep-2018 15:30:25 - "ANTENNA/table.f0", build 12-Sep-2018 15:30:25 - "DATA_DESCRIPTION/table.f0", build 12-Sep-2018 15:30:25 - "FEED/table.f0", build 12-Sep-2018 15:30:25 - "FIELD/table.f0", build 12-Sep-2018 15:30:25 - "FLAG_CMD/table.f0", build 12-Sep-2018 15:30:25 - "HISTORY/table.f0", build 12-Sep-2018 15:30:25 - "OBSERVATION/table.f0", build 12-Sep-2018 15:30:25 - "POINTING/table.f0", build 12-Sep-2018 15:30:25 - "POLARIZATION/table.f0", build 12-Sep-2018 15:30:25 - "PROCESSOR/table.f0", build 12-Sep-2018 15:30:25 - "SOURCE/table.f0", build 12-Sep-2018 15:30:25 - "SPECTRAL_WINDOW/table.f0", build 12-Sep-2018 15:30:25 - "STATE/table.f0", build 12-Sep-2018 15:30:25 - "SYSCAL/table.f0", build 12-Sep-2018 15:30:25 - "WEATHER/table.f0" build 12-Sep-2018 15:30:25 - ]) build 12-Sep-2018 15:30:25 - for name in mscomponents: build 12-Sep-2018 15:30:25 - if not os.access(msname+"/"+name, os.F_OK): build 12-Sep-2018 15:30:25 - print myname, ": Error ", msname+"/"+name, "doesn't exist ..." build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']+msname+'/'+name+' does not exist' build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - print myname, ": ", name, "present." build 12-Sep-2018 15:30:25 - print myname, ": MS exists. All tables present. Try opening as MS ..." build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - ms.open(msname) build 12-Sep-2018 15:30:25 - except: build 12-Sep-2018 15:30:25 - print myname, ": Error Cannot open MS table", tablename build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']+'Cannot open MS table '+tablename build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - ms.close() build 12-Sep-2018 15:30:25 - print myname, ": OK. Checking tables in detail ..." build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # check main table first build 12-Sep-2018 15:30:25 - name = "" build 12-Sep-2018 15:30:25 - # col name, row number, expected value, tolerance build 12-Sep-2018 15:30:25 - expected = [ build 12-Sep-2018 15:30:25 - ['UVW', 42, [ 1607.50778695, -1241.40287976 , 584.50368163], 1E-8], build 12-Sep-2018 15:30:25 - ['EXPOSURE', 42, 1.0, 0] build 12-Sep-2018 15:30:25 -# ['DATA', 42, [ [10.5526886+0.0j] ], 1E-7] build 12-Sep-2018 15:30:25 - ] build 12-Sep-2018 15:30:25 - results = checktable(msname, name, expected) build 12-Sep-2018 15:30:25 - if not results: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']+'Check of table MAIN failed' build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - retValue['success']=True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - expected = [ build 12-Sep-2018 15:30:25 - # old values using TAI ['UVW', 638, [-65.07623467, 1.05534109, -33.65801386], 1E-8], build 12-Sep-2018 15:30:25 - ['UVW', 638, [14.20193237, 722.59606805 , 57.57988905], 1E-8], build 12-Sep-2018 15:30:25 - ['EXPOSURE', 638, 1.0, 0] build 12-Sep-2018 15:30:25 -# ['DATA', 638, [ [0.00362284+0.00340279j] ], 1E-8] build 12-Sep-2018 15:30:25 - ] build 12-Sep-2018 15:30:25 - results = checktable(msname, name, expected) build 12-Sep-2018 15:30:25 - if not results: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']+'Check of table MAIN failed' build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - retValue['success']=True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - name = "ANTENNA" build 12-Sep-2018 15:30:25 - expected = [ ['OFFSET', 1, [ -4.80000000e-12, 0., 0.], 0], build 12-Sep-2018 15:30:25 - ['POSITION', 1, [-1599644.8611, -5042953.6623, 3554197.0332], 0.0001], build 12-Sep-2018 15:30:25 - ['DISH_DIAMETER',1, 25.0, 0] build 12-Sep-2018 15:30:25 - ] build 12-Sep-2018 15:30:25 - results = checktable(msname, name, expected) build 12-Sep-2018 15:30:25 - if not results: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']+'Check of table ANTENNA failed' build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - retValue['success']=True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# name = "POINTING" build 12-Sep-2018 15:30:25 -# expected = [ ['DIRECTION', 10, [[ 0.],[0.]], 1E-8], build 12-Sep-2018 15:30:25 -# ['INTERVAL', 10, 4.7672238080000007, 0], build 12-Sep-2018 15:30:25 -# ['TARGET', 10, [[ 0.], [ 0.]], 1E-8], build 12-Sep-2018 15:30:25 -# ['TIME', 10, 4777473953.6163883, 0], build 12-Sep-2018 15:30:25 -# ['TIME_ORIGIN', 10, 0., 0], build 12-Sep-2018 15:30:25 -# ['POINTING_OFFSET', 10, [[ 0.],[ 0.]], 0], build 12-Sep-2018 15:30:25 -# ['ENCODER', 10, [ 0., 0.], 1E-8 ] build 12-Sep-2018 15:30:25 -# ] build 12-Sep-2018 15:30:25 -# results = checktable(msname, name, expected) build 12-Sep-2018 15:30:25 -# if not results: build 12-Sep-2018 15:30:25 -# retValue['success']=False build 12-Sep-2018 15:30:25 -# retValue['error_msgs']=retValue['error_msgs']+'Check of table POINTING failed' build 12-Sep-2018 15:30:25 -# else: build 12-Sep-2018 15:30:25 -# retValue['success']=True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(results) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test2(self): build 12-Sep-2018 15:30:25 - '''Importevla test2: Good input asdm with polynomial ephemeris''' build 12-Sep-2018 15:30:25 - retValue = {'success': True, 'msgs': "", 'error_msgs': '' } build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - asdmname2 = 'polyuranus' build 12-Sep-2018 15:30:25 - if (not os.path.exists(asdmname2)): build 12-Sep-2018 15:30:25 - datapath=os.environ.get('CASAPATH').split()[0]+'/data/regression/unittest/importevla/' build 12-Sep-2018 15:30:25 - os.system('ln -s '+datapath+asdmname2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - msname2 = 'polyuranus.ms' build 12-Sep-2018 15:30:25 - self.res = importevla(asdm=asdmname2, vis=msname2, scans='0:5') build 12-Sep-2018 15:30:25 - print myname, ": Success! Now checking output ..." build 12-Sep-2018 15:30:25 - mscomponents = set(["table.dat", build 12-Sep-2018 15:30:25 - "table.f1", build 12-Sep-2018 15:30:25 - "table.f2", build 12-Sep-2018 15:30:25 - "table.f3", build 12-Sep-2018 15:30:25 - "table.f4", build 12-Sep-2018 15:30:25 - "table.f5", build 12-Sep-2018 15:30:25 - "table.f6", build 12-Sep-2018 15:30:25 - "table.f7", build 12-Sep-2018 15:30:25 - "table.f8", build 12-Sep-2018 15:30:25 - "Antenna.xml", build 12-Sep-2018 15:30:25 - "Flag.xml", build 12-Sep-2018 15:30:25 - "SpectralWindow.xml", build 12-Sep-2018 15:30:25 - "ANTENNA/table.dat", build 12-Sep-2018 15:30:25 - "DATA_DESCRIPTION/table.dat", build 12-Sep-2018 15:30:25 - "FEED/table.dat", build 12-Sep-2018 15:30:25 - "FIELD/table.dat", build 12-Sep-2018 15:30:25 - "FLAG_CMD/table.dat", build 12-Sep-2018 15:30:25 - "HISTORY/table.dat", build 12-Sep-2018 15:30:25 - "OBSERVATION/table.dat", build 12-Sep-2018 15:30:25 - "POINTING/table.dat", build 12-Sep-2018 15:30:25 - "POLARIZATION/table.dat", build 12-Sep-2018 15:30:25 - "PROCESSOR/table.dat", build 12-Sep-2018 15:30:25 - "SOURCE/table.dat", build 12-Sep-2018 15:30:25 - "SPECTRAL_WINDOW/table.dat", build 12-Sep-2018 15:30:25 - "STATE/table.dat", build 12-Sep-2018 15:30:25 - "SYSCAL/table.dat", build 12-Sep-2018 15:30:25 - "WEATHER/table.dat", build 12-Sep-2018 15:30:25 - "ANTENNA/table.f0", build 12-Sep-2018 15:30:25 - "DATA_DESCRIPTION/table.f0", build 12-Sep-2018 15:30:25 - "FEED/table.f0", build 12-Sep-2018 15:30:25 - "FIELD/table.f0", build 12-Sep-2018 15:30:25 - "FIELD/EPHEM0_URANUS_57545.8.tab/table.f0", # the ephemeris table! build 12-Sep-2018 15:30:25 - "FLAG_CMD/table.f0", build 12-Sep-2018 15:30:25 - "HISTORY/table.f0", build 12-Sep-2018 15:30:25 - "OBSERVATION/table.f0", build 12-Sep-2018 15:30:25 - "POINTING/table.f0", build 12-Sep-2018 15:30:25 - "POLARIZATION/table.f0", build 12-Sep-2018 15:30:25 - "PROCESSOR/table.f0", build 12-Sep-2018 15:30:25 - "SOURCE/table.f0", build 12-Sep-2018 15:30:25 - "SPECTRAL_WINDOW/table.f0", build 12-Sep-2018 15:30:25 - "STATE/table.f0", build 12-Sep-2018 15:30:25 - "SYSCAL/table.f0", build 12-Sep-2018 15:30:25 - "WEATHER/table.f0" build 12-Sep-2018 15:30:25 - ]) build 12-Sep-2018 15:30:25 - for name in mscomponents: build 12-Sep-2018 15:30:25 - if not os.access(msname2+"/"+name, os.F_OK): build 12-Sep-2018 15:30:25 - print myname, ": Error ", msname2+"/"+name, "doesn't exist ..." build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']+msname2+'/'+name+' does not exist' build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - print myname, ": ", name, "present." build 12-Sep-2018 15:30:25 - print myname, ": MS exists. All tables present. Try opening as MS ..." build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - ms.open(msname2) build 12-Sep-2018 15:30:25 - except: build 12-Sep-2018 15:30:25 - print myname, ": Error Cannot open MS table", tablename build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']+'Cannot open MS table '+tablename build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - ms.close() build 12-Sep-2018 15:30:25 - print myname, ": OK. Checking tables in detail ..." build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ms.open(msname2) build 12-Sep-2018 15:30:25 - mssum = ms.summary() build 12-Sep-2018 15:30:25 - ms.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if(mssum['scan_5']['0']['FieldName']=='URANUS' and mssum['field_2']['direction']['m0']['value']==0.3783275670495854): build 12-Sep-2018 15:30:25 - print myname, ": MS summary as expected." build 12-Sep-2018 15:30:25 - retValue['success']=True build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']+'Unexepcted mssummary.' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(retValue['success']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_apply1(self): build 12-Sep-2018 15:30:25 - '''importevla: apply all flags and save to file''' build 12-Sep-2018 15:30:25 - msname = 'online.ms' build 12-Sep-2018 15:30:25 - cmdfile = 'online_cmd.txt' build 12-Sep-2018 15:30:25 - if os.path.exists(msname): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+msname) build 12-Sep-2018 15:30:25 - if os.path.exists(cmdfile): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+cmdfile) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - importevla(asdm=self.asdm, vis=msname, scans='2',online=True, applyflags=True, build 12-Sep-2018 15:30:25 - shadow=True,flagzero=True,flagbackup=False, savecmds=True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check flags build 12-Sep-2018 15:30:25 - res = flagdata(vis=msname, mode='summary') build 12-Sep-2018 15:30:25 - self.assertEqual(res['flagged'],2446080) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check output file existence build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(cmdfile)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check file content build 12-Sep-2018 15:30:25 - ff = open(cmdfile,'r') build 12-Sep-2018 15:30:25 - cmdlist = ff.readlines() build 12-Sep-2018 15:30:25 - ncmds = cmdlist.__len__() build 12-Sep-2018 15:30:25 - self.assertEqual(ncmds, 216) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_apply2(self): build 12-Sep-2018 15:30:25 - '''importevla: apply only online flags''' build 12-Sep-2018 15:30:25 - msname = 'applied.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(msname): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+msname) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Save to different file build 12-Sep-2018 15:30:25 - importevla(asdm=self.asdm, vis=msname, scans='2',online=True, shadow=False, flagzero=False, build 12-Sep-2018 15:30:25 - applyflags=True, savecmds=False, flagbackup=False) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check flags only in RR and LL build 12-Sep-2018 15:30:25 - res = flagdata(vis=msname, mode='summary') build 12-Sep-2018 15:30:25 - self.assertEqual(res['flagged'],2446080) build 12-Sep-2018 15:30:25 - self.assertEqual(res['scan']['2']['flagged'],2446080) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_apply3(self): build 12-Sep-2018 15:30:25 - '''importevla: apply clip zeros on RR and LL and save to file''' build 12-Sep-2018 15:30:25 - msname = 'zeros.ms' build 12-Sep-2018 15:30:25 - cmdfile = 'zeros_cmd.txt' build 12-Sep-2018 15:30:25 - if os.path.exists(msname): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+msname) build 12-Sep-2018 15:30:25 - if os.path.exists(cmdfile): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+cmdfile) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - importevla(asdm=self.asdm, vis=msname, scans='2,13',online=False, applyflags=True, build 12-Sep-2018 15:30:25 - shadow=False,flagzero=True,flagpol=False, flagbackup=False, savecmds=True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check flags build 12-Sep-2018 15:30:25 - res = flagdata(vis=msname, mode='summary') build 12-Sep-2018 15:30:25 - self.assertEqual(res['flagged'],0,'There are no zeros in this data set') build 12-Sep-2018 15:30:25 - self.assertEqual(res['scan']['2']['flagged'],0,'No flags should have been applied') build 12-Sep-2018 15:30:25 - self.assertEqual(res['scan']['13']['flagged'],0,'No flags should have been applied') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check output file existence build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(cmdfile)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check output file existence build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(cmdfile)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check file content build 12-Sep-2018 15:30:25 - ff = open(cmdfile,'r') build 12-Sep-2018 15:30:25 - cmdlist = ff.readlines() build 12-Sep-2018 15:30:25 - ncmds = cmdlist.__len__() build 12-Sep-2018 15:30:25 - self.assertEqual(ncmds, 2, 'Only clip zeros should be saved to file') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_apply4(self): build 12-Sep-2018 15:30:25 - '''importevla: Save online flags to FLAG_CMD and file; do not apply''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Use default msname and outfile build 12-Sep-2018 15:30:25 - msname = 'xosro4.ms' build 12-Sep-2018 15:30:25 - cmdfile = msname.replace('.ms','_cmd.txt') build 12-Sep-2018 15:30:25 - if os.path.exists(msname): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+msname) build 12-Sep-2018 15:30:25 - if os.path.exists(cmdfile): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+cmdfile) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - importevla(asdm=self.asdm, vis=msname, scans='2',online=True, shadow=False, flagzero=False, build 12-Sep-2018 15:30:25 - applyflags=False,savecmds=True, flagbackup=False) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # No flags were applied build 12-Sep-2018 15:30:25 - res = flagdata(vis=msname, mode='summary') build 12-Sep-2018 15:30:25 - self.assertEqual(res['flagged'],0) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Apply only row 213 using flagcmd build 12-Sep-2018 15:30:25 - # The command in row 213 is the following: build 12-Sep-2018 15:30:25 - # antenna='ea06' timerange='2012/02/22/22:30:55.200~2012/02/22/22:35:08.199' build 12-Sep-2018 15:30:25 - # spw='EVLA_X#A0C0#0' correlation='LL,LR,RL build 12-Sep-2018 15:30:25 - flagcmd(vis=msname, action='apply', tablerows=213) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check flags. RR should no be flagged build 12-Sep-2018 15:30:25 - res = flagdata(vis=msname, mode='summary') build 12-Sep-2018 15:30:25 - self.assertEqual(res['correlation']['RR']['flagged'],0,'RR should not be flagged') build 12-Sep-2018 15:30:25 - self.assertEqual(res['correlation']['LL']['flagged'],29440) build 12-Sep-2018 15:30:25 - self.assertEqual(res['correlation']['LR']['flagged'],29440) build 12-Sep-2018 15:30:25 - self.assertEqual(res['correlation']['RL']['flagged'],29440) build 12-Sep-2018 15:30:25 - self.assertEqual(res['antenna']['ea06']['flagged'],88320) build 12-Sep-2018 15:30:25 - self.assertEqual(res['antenna']['ea07']['flagged'],3840,'Only a few baselines should be flagged') build 12-Sep-2018 15:30:25 - self.assertEqual(res['antenna']['ea08']['flagged'],3840,'Only a few baselines should be flagged') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check output file existence build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(cmdfile)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check file content build 12-Sep-2018 15:30:25 - ff = open(cmdfile,'r') build 12-Sep-2018 15:30:25 - cmdlist = ff.readlines() build 12-Sep-2018 15:30:25 - ncmds = cmdlist.__len__() build 12-Sep-2018 15:30:25 - ff.close() build 12-Sep-2018 15:30:25 - self.assertEqual(ncmds, 214, 'Only Online cmds should have been saved to file') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Unapply row 213 and apply it in flagdata using the file build 12-Sep-2018 15:30:25 - # TO DO : after row selection is available in file build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_apply5(self): build 12-Sep-2018 15:30:25 - '''importevla: Apply only shadow flags''' build 12-Sep-2018 15:30:25 - msname = 'xosro_shadow.ms' build 12-Sep-2018 15:30:25 - importevla(asdm=self.asdm, vis=msname,online=False, shadow=True, flagzero=False, build 12-Sep-2018 15:30:25 - applyflags=True,savecmds=False, flagbackup=False) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # This data set doesn't have shadow. Maybe change later! build 12-Sep-2018 15:30:25 - res = flagdata(vis=msname, mode='summary') build 12-Sep-2018 15:30:25 - self.assertEqual(res['flagged'],0,'There are shadowed antenna in this data set') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_savepars(self): build 12-Sep-2018 15:30:25 - '''importevla: save the flag commands and do not apply''' build 12-Sep-2018 15:30:25 - msname = 'notapplied.ms' build 12-Sep-2018 15:30:25 - cmdfile = msname.replace('.ms','_cmd.txt') build 12-Sep-2018 15:30:25 - if os.path.exists(msname): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+msname) build 12-Sep-2018 15:30:25 - if os.path.exists(cmdfile): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+cmdfile) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - importevla(asdm=self.asdm, vis=msname,scans='11~13',online=True,flagzero=True,shadow=True,savecmds=True, build 12-Sep-2018 15:30:25 - applyflags=False,flagbackup=False) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check flags build 12-Sep-2018 15:30:25 - res = flagdata(vis=msname, mode='summary') build 12-Sep-2018 15:30:25 - self.assertEqual(res['flagged'],0,'No flags should have been applied') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check output file existence build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(cmdfile)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Check file content build 12-Sep-2018 15:30:25 - ff = open(cmdfile,'r') build 12-Sep-2018 15:30:25 - cmdlist = ff.readlines() build 12-Sep-2018 15:30:25 - ncmds = cmdlist.__len__() build 12-Sep-2018 15:30:25 - ff.close() build 12-Sep-2018 15:30:25 - self.assertEqual(ncmds, 216, 'Online, shadow and clip zeros should be saved to file') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Apply flags using flagdata build 12-Sep-2018 15:30:25 - flagdata(vis=msname, mode='list', inpfile=cmdfile) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - res = flagdata(vis=msname, mode='summary') build 12-Sep-2018 15:30:25 - self.assertEqual(res['flagged'],6090624) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -class cleanup(unittest.TestCase): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp(self): build 12-Sep-2018 15:30:25 - pass build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf *applied*ms*') build 12-Sep-2018 15:30:25 - os.system('rm -rf *online*ms*') build 12-Sep-2018 15:30:25 - os.system('rm -rf *zeros*ms*') build 12-Sep-2018 15:30:25 - os.system('rm -rf *xosro*.ms*') build 12-Sep-2018 15:30:25 -# pass build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test1a(self): build 12-Sep-2018 15:30:25 - '''Importevla: Cleanup''' build 12-Sep-2018 15:30:25 - pass build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def suite(): build 12-Sep-2018 15:30:25 - return [importevla_test, cleanup] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_importnro.py b/gcwrap/python/scripts/tests/test_importnro.py build 12-Sep-2018 15:30:25 index 13fa319..ad3fe15 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_importnro.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_importnro.py build 12-Sep-2018 15:30:25 @@ -10,12 +10,63 @@ import unittest build 12-Sep-2018 15:30:25 import sha build 12-Sep-2018 15:30:25 import time build 12-Sep-2018 15:30:25 import numpy build 12-Sep-2018 15:30:25 +import itertools build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 from importnro import importnro build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 myms = gentools(['ms'])[0] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 +# Utilities build 12-Sep-2018 15:30:25 +def get_antenna_position(vis, row): build 12-Sep-2018 15:30:25 + (mytb,) = gentools(['tb']) build 12-Sep-2018 15:30:25 + antenna_table = os.path.join(vis, 'ANTENNA') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + mytb.open(antenna_table) build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + pos = mytb.getcell('POSITION', row) build 12-Sep-2018 15:30:25 + poskey = mytb.getcolkeywords('POSITION') build 12-Sep-2018 15:30:25 + finally: build 12-Sep-2018 15:30:25 + mytb.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + posref = poskey['MEASINFO']['Ref'] build 12-Sep-2018 15:30:25 + qpos = [qa.quantity(v,u) for v,u in itertools.izip(pos, poskey['QuantumUnits'])] build 12-Sep-2018 15:30:25 + mantpos = me.position(rf=posref, v0=qpos[0], v1=qpos[1], v2=qpos[2]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + return mantpos build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +def get_valid_pointing_info(vis): build 12-Sep-2018 15:30:25 + (mytb,) = gentools(['tb']) build 12-Sep-2018 15:30:25 + pointing_table = os.path.join(vis, 'POINTING') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + mytb.open(pointing_table) build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + timekey = mytb.getcolkeywords('TIME') build 12-Sep-2018 15:30:25 + dirkey = mytb.getcolkeywords('DIRECTION') build 12-Sep-2018 15:30:25 + nrow = mytb.nrows() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + irow = 0 build 12-Sep-2018 15:30:25 + pdir = mytb.getcell('DIRECTION', irow) build 12-Sep-2018 15:30:25 + ptime = mytb.getcell('TIME', irow) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + while numpy.all(pdir == 0.0) and irow < nrow: build 12-Sep-2018 15:30:25 + irow += 1 build 12-Sep-2018 15:30:25 + pdir = mytb.getcell('DIRECTION', irow) build 12-Sep-2018 15:30:25 + ptime = mytb.getcell('TIME', irow) build 12-Sep-2018 15:30:25 + finally: build 12-Sep-2018 15:30:25 + mytb.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + dirref = dirkey['MEASINFO']['Ref'] build 12-Sep-2018 15:30:25 + qdir = [qa.quantity(v,u) for v,u in itertools.izip(pdir[:,0], dirkey['QuantumUnits'])] build 12-Sep-2018 15:30:25 + mpdir = me.direction(rf=dirref, v0=qdir[0], v1=qdir[1]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + timeref = timekey['MEASINFO']['Ref'] build 12-Sep-2018 15:30:25 + qtime = qa.quantity(ptime, timekey['QuantumUnits'][0]) build 12-Sep-2018 15:30:25 + mepoch = me.epoch(rf=timeref, v0=qtime) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + return mepoch, mpdir build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 class importnro_test(unittest.TestCase): build 12-Sep-2018 15:30:25 """ build 12-Sep-2018 15:30:25 test_overwrite -- File existence check build 12-Sep-2018 15:30:25 @@ -69,6 +120,9 @@ class importnro_test(unittest.TestCase): build 12-Sep-2018 15:30:25 # check weight initialization build 12-Sep-2018 15:30:25 self._check_weights(self.outfile) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + # check subtables build 12-Sep-2018 15:30:25 + self._check_optional_subtables(self.outfile) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def _check_weights(self, vis): build 12-Sep-2018 15:30:25 _tb = gentools(['tb'])[0] build 12-Sep-2018 15:30:25 take_diff = lambda actual, expected: numpy.abs((actual - expected) / expected) build 12-Sep-2018 15:30:25 @@ -104,6 +158,98 @@ class importnro_test(unittest.TestCase): build 12-Sep-2018 15:30:25 _tb.close() build 12-Sep-2018 15:30:25 finally: build 12-Sep-2018 15:30:25 _tb.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def _check_optional_subtables(self, vis): build 12-Sep-2018 15:30:25 + """Check if optional subtables are valid""" build 12-Sep-2018 15:30:25 + self._check_NRO_ARRAY(vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def _check_NRO_ARRAY(self, vis): build 12-Sep-2018 15:30:25 + """Check if NRO_ARRAY table is valid""" build 12-Sep-2018 15:30:25 + table_name = 'NRO_ARRAY' build 12-Sep-2018 15:30:25 + (mytb,) = gentools(['tb']) build 12-Sep-2018 15:30:25 + mytb.open(vis) build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + self.assertTrue(table_name in mytb.keywordnames()) build 12-Sep-2018 15:30:25 + finally: build 12-Sep-2018 15:30:25 + mytb.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + table_path = os.path.join(vis, table_name) build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(table_path)) build 12-Sep-2018 15:30:25 + mytb.open(table_path) build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + cols = set(['BEAM', 'POLARIZATION', 'SPECTRAL_WINDOW', 'ARRAY']) build 12-Sep-2018 15:30:25 + self.assertEqual(set(mytb.colnames()), cols) build 12-Sep-2018 15:30:25 + beam = mytb.getcol('BEAM') build 12-Sep-2018 15:30:25 + pol = mytb.getcol('POLARIZATION') build 12-Sep-2018 15:30:25 + spw = mytb.getcol('SPECTRAL_WINDOW') build 12-Sep-2018 15:30:25 + arr = mytb.getcol('ARRAY') build 12-Sep-2018 15:30:25 + nrow = mytb.nrows() build 12-Sep-2018 15:30:25 + finally: build 12-Sep-2018 15:30:25 + mytb.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + arr_expected = numpy.arange(nrow, dtype=int) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(arr_expected == arr)) build 12-Sep-2018 15:30:25 + beam_expected = numpy.empty_like(arr_expected) build 12-Sep-2018 15:30:25 + beam_expected[0:4] = 0 build 12-Sep-2018 15:30:25 + beam_expected[4:8] = 1 build 12-Sep-2018 15:30:25 + beam_expected[8:12] = 2 build 12-Sep-2018 15:30:25 + beam_expected[12:16] = 3 build 12-Sep-2018 15:30:25 + beam_expected[16:] = -1 build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(beam_expected == beam)) build 12-Sep-2018 15:30:25 + spw_expected = numpy.empty_like(arr_expected) build 12-Sep-2018 15:30:25 + spw_expected[0:16:2] = 0 build 12-Sep-2018 15:30:25 + spw_expected[1:16:2] = 1 build 12-Sep-2018 15:30:25 + spw_expected[16:] = -1 build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(spw_expected == spw)) build 12-Sep-2018 15:30:25 + pol_expected = numpy.empty_like(arr_expected) build 12-Sep-2018 15:30:25 + pol_expected[0:16:4] = 12 build 12-Sep-2018 15:30:25 + pol_expected[1:16:4] = 12 build 12-Sep-2018 15:30:25 + pol_expected[2:16:4] = 9 build 12-Sep-2018 15:30:25 + pol_expected[3:16:4] = 9 build 12-Sep-2018 15:30:25 + pol_expected[16:] = -1 build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(pol_expected == pol)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_timestamp(self): build 12-Sep-2018 15:30:25 + """test_timestamp: Check if timestamp is properly converted to UTC""" build 12-Sep-2018 15:30:25 + ret = importnro(infile=self.infile, outputvis=self.outfile, overwrite=True) build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.outfile)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # test if telescope elevation has reasonable value build 12-Sep-2018 15:30:25 + (myme,) = gentools(['me']) build 12-Sep-2018 15:30:25 + # make sure me tool is initialized build 12-Sep-2018 15:30:25 + myme.done() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # antenna_position should be a position measure build 12-Sep-2018 15:30:25 + antenna_position = get_antenna_position(self.outfile, 0) build 12-Sep-2018 15:30:25 + self.assertTrue(myme.ismeasure(antenna_position)) build 12-Sep-2018 15:30:25 + self.assertTrue(antenna_position['type'] == 'position') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # pointing_time should be a time (epoch) measure build 12-Sep-2018 15:30:25 + # pointing_direction should be a direction measure build 12-Sep-2018 15:30:25 + # pointing_direction should not be [0,0] build 12-Sep-2018 15:30:25 + pointing_time, pointing_direction = get_valid_pointing_info(self.outfile) build 12-Sep-2018 15:30:25 + self.assertTrue(myme.ismeasure(pointing_time)) build 12-Sep-2018 15:30:25 + self.assertTrue(pointing_time['type'] == 'epoch') build 12-Sep-2018 15:30:25 + self.assertTrue(myme.ismeasure(pointing_direction)) build 12-Sep-2018 15:30:25 + self.assertTrue(pointing_direction['type'] == 'direction') build 12-Sep-2018 15:30:25 + self.assertFalse(pointing_direction['m0']['value'] == 0.0 and pointing_direction['m1']['value']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # convert pointing_direction (J2000) to AZELGEO build 12-Sep-2018 15:30:25 + # frame configuration build 12-Sep-2018 15:30:25 + myme.doframe(pointing_time) build 12-Sep-2018 15:30:25 + myme.doframe(antenna_position) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # frame cnversion build 12-Sep-2018 15:30:25 + azel = myme.measure(v=pointing_direction, rf='AZELGEO') build 12-Sep-2018 15:30:25 + myme.done() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # check if elevation is in range [0deg, 90deg] build 12-Sep-2018 15:30:25 + elevation = qa.convert(azel['m1'], 'deg') build 12-Sep-2018 15:30:25 + msg = 'Timestamp used for the conversion could be wrong.: calculated elevation={value}{unit}'.format(**elevation) build 12-Sep-2018 15:30:25 + self.assertLessEqual(elevation['value'], 90.0, msg='Elevation is above the upper limit (> 90deg). {}'.format(msg)) build 12-Sep-2018 15:30:25 + self.assertGreaterEqual(elevation['value'], 0.0, msg='Elevation is below the lower limit (< 0deg). {}'.format(msg)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def suite(): build 12-Sep-2018 15:30:25 return [importnro_test] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_imregrid.py b/gcwrap/python/scripts/tests/test_imregrid.py build 12-Sep-2018 15:30:25 index 05277f2..a7230a9 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_imregrid.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_imregrid.py build 12-Sep-2018 15:30:25 @@ -237,7 +237,12 @@ class imregrid_test(unittest.TestCase): build 12-Sep-2018 15:30:25 'MECLIPTIC', 'TECLIPTIC', build 12-Sep-2018 15:30:25 'ITRF', 'TOPO']: build 12-Sep-2018 15:30:25 rec1['coordsys']['coordsys']['direction0']['conversionSystem'] = ref build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + if ref == "COMET": build 12-Sep-2018 15:30:25 + ### To regrid to COMET frame you have to specify a COMET table or ephemeris build 12-Sep-2018 15:30:25 + ### to measures. As this is not possible in this interface, build 12-Sep-2018 15:30:25 + ### avoiding this regridding (CAS-11403) build 12-Sep-2018 15:30:25 + self.assertRaises(Exception, myia.fromrecord, rec1, out5) build 12-Sep-2018 15:30:25 + continue build 12-Sep-2018 15:30:25 myia.fromrecord(rec1, out5) build 12-Sep-2018 15:30:25 myia.close() build 12-Sep-2018 15:30:25 if ( os.path.exists(out1 ) ): build 12-Sep-2018 15:30:25 @@ -423,68 +428,84 @@ class imregrid_test(unittest.TestCase): build 12-Sep-2018 15:30:25 == myia.coordsys().referencevalue()["numeric"] build 12-Sep-2018 15:30:25 ).all() build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_ref_code(self): build 12-Sep-2018 15:30:25 - """Test regridding to a new reference frame""" build 12-Sep-2018 15:30:25 - imregrid(imagename=datapath + "myim.im", template="GALACTIC", output=out6) build 12-Sep-2018 15:30:25 - myia = self._myia build 12-Sep-2018 15:30:25 - myia.open(out6) build 12-Sep-2018 15:30:25 - got = myia.getchunk() build 12-Sep-2018 15:30:25 - myia.open(datapath + "mygal.im") build 12-Sep-2018 15:30:25 - expec = myia.getchunk() build 12-Sep-2018 15:30:25 - self.assertTrue((got == expec).all()) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imregrid( build 12-Sep-2018 15:30:25 - imagename=datapath + "nrefcode.im", template="GALACTIC", build 12-Sep-2018 15:30:25 - output=out6, overwrite=True build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - myia.open(out6) build 12-Sep-2018 15:30:25 - got = myia.getchunk() build 12-Sep-2018 15:30:25 - myia.open(datapath + "mmm.im") build 12-Sep-2018 15:30:25 - expec = myia.getchunk() build 12-Sep-2018 15:30:25 - self.assertTrue((numpy.max(numpy.abs(got- expec))) < 1e-14) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imregrid( build 12-Sep-2018 15:30:25 - imagename=datapath + "nrefcode_t.im", template="GALACTIC", build 12-Sep-2018 15:30:25 - output=out6, overwrite=True build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - myia.open(out6) build 12-Sep-2018 15:30:25 - got = myia.getchunk() build 12-Sep-2018 15:30:25 - myia.open(datapath + "mmm_t.im") build 12-Sep-2018 15:30:25 - expec = myia.getchunk() build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.max(numpy.abs(got - expec)) < 1e-12) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def test_ref_code_preserves_position(self): build 12-Sep-2018 15:30:25 """Test that regridding to new refcode preserves source positions""" build 12-Sep-2018 15:30:25 - gal = "mygalactic.im" build 12-Sep-2018 15:30:25 - imregrid(datapath+gim,template="GALACTIC", output=gal) build 12-Sep-2018 15:30:25 + shutil.copytree(datapath + gim, gim) build 12-Sep-2018 15:30:25 orig = iatool() build 12-Sep-2018 15:30:25 - orig.open(datapath+gim) build 12-Sep-2018 15:30:25 - ofit = orig.fitcomponents(box="850,150,950,250") build 12-Sep-2018 15:30:25 - orig.done() build 12-Sep-2018 15:30:25 - ocl = cltool() build 12-Sep-2018 15:30:25 - ocl.add(ofit['results']['component0']) build 12-Sep-2018 15:30:25 - orefdir = ocl.getrefdir(0) build 12-Sep-2018 15:30:25 - galtool = iatool() build 12-Sep-2018 15:30:25 - galtool.open(gal) build 12-Sep-2018 15:30:25 - gfit = galtool.fitcomponents(box="1120,520,1170,570") build 12-Sep-2018 15:30:25 - galtool.done() build 12-Sep-2018 15:30:25 - gcl = cltool() build 12-Sep-2018 15:30:25 - gcl.add(gfit['results']['component0']) build 12-Sep-2018 15:30:25 - grefdir = gcl.getrefdir(0) build 12-Sep-2018 15:30:25 myme = metool() build 12-Sep-2018 15:30:25 - self.assertTrue(qa.getvalue(qa.convert(myme.separation(orefdir, grefdir), "arcsec")) < 0.003) build 12-Sep-2018 15:30:25 - rev = "back_to_J2000.im" build 12-Sep-2018 15:30:25 - imregrid(gal,template="J2000", output=rev) build 12-Sep-2018 15:30:25 - revtool = iatool() build 12-Sep-2018 15:30:25 - revtool.open(rev) build 12-Sep-2018 15:30:25 - rfit = revtool.fitcomponents(box="850,150,950,250") build 12-Sep-2018 15:30:25 - revtool.done() build 12-Sep-2018 15:30:25 - rcl = cltool() build 12-Sep-2018 15:30:25 - rcl.add(rfit['results']['component0']) build 12-Sep-2018 15:30:25 - rrefdir = rcl.getrefdir(0) build 12-Sep-2018 15:30:25 - self.assertTrue(qa.getvalue(qa.convert(myme.separation(orefdir, rrefdir), "arcsec")) < 2e-4) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + for rah in (0, 4, 8, 12, 16, 20): build 12-Sep-2018 15:30:25 + # image has axis units of arcmin build 12-Sep-2018 15:30:25 + ra = rah*60*15 build 12-Sep-2018 15:30:25 + for decdeg in (-80, -60, -40, -20, 0, 20, 40, 68, 80): build 12-Sep-2018 15:30:25 + # image has axis units of arcmin build 12-Sep-2018 15:30:25 + dec = decdeg*60 build 12-Sep-2018 15:30:25 + orig.open(gim) build 12-Sep-2018 15:30:25 + csys = orig.coordsys() build 12-Sep-2018 15:30:25 + csys.setreferencevalue([ra, dec]) build 12-Sep-2018 15:30:25 + orig.setcoordsys(csys.torecord()) build 12-Sep-2018 15:30:25 + csys.done() build 12-Sep-2018 15:30:25 + orig.done() build 12-Sep-2018 15:30:25 + ctype_range = ["J2000"] build 12-Sep-2018 15:30:25 + if decdeg == 0 and rah == 0: build 12-Sep-2018 15:30:25 + ctype_range = ["J2000", "GALACTIC"] build 12-Sep-2018 15:30:25 + for ctype in ctype_range: build 12-Sep-2018 15:30:25 + if ctype == "GALACITC": build 12-Sep-2018 15:30:25 + orig.open(gim) build 12-Sep-2018 15:30:25 + csys = orig.coordsys() build 12-Sep-2018 15:30:25 + csys.setconversiontype(ctype) build 12-Sep-2018 15:30:25 + orig.setcoordsys(csys.torecord()) build 12-Sep-2018 15:30:25 + csys.done() build 12-Sep-2018 15:30:25 + orig.done() build 12-Sep-2018 15:30:25 + image_id = ( build 12-Sep-2018 15:30:25 + "_ra" + str(rah) + "_dec" + str(decdeg) build 12-Sep-2018 15:30:25 + + "_origconv" + ctype build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + gal = "mygalactic" + image_id + ".im" build 12-Sep-2018 15:30:25 + imregrid(gim,template="GALACTIC", output=gal) build 12-Sep-2018 15:30:25 + orig.open(gim) build 12-Sep-2018 15:30:25 + ofit = orig.fitcomponents(box="850,150,950,250") build 12-Sep-2018 15:30:25 + orig.done() build 12-Sep-2018 15:30:25 + ocl = cltool() build 12-Sep-2018 15:30:25 + ocl.add(ofit['results']['component0']) build 12-Sep-2018 15:30:25 + orefdir = ocl.getrefdir(0) build 12-Sep-2018 15:30:25 + galtool = iatool() build 12-Sep-2018 15:30:25 + galtool.open(gal) build 12-Sep-2018 15:30:25 + #gfit = galtool.fitcomponents(box="1120,520,1170,570") build 12-Sep-2018 15:30:25 + gfit = galtool.fitcomponents(mask= "'" + gal + "'> 0.001") build 12-Sep-2018 15:30:25 + galtool.done() build 12-Sep-2018 15:30:25 + gcl = cltool() build 12-Sep-2018 15:30:25 + gcl.add(gfit['results']['component0']) build 12-Sep-2018 15:30:25 + grefdir = gcl.getrefdir(0) build 12-Sep-2018 15:30:25 + print "diff", qa.getvalue( build 12-Sep-2018 15:30:25 + qa.convert( build 12-Sep-2018 15:30:25 + myme.separation(orefdir, grefdir), "arcsec" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + qa.getvalue( build 12-Sep-2018 15:30:25 + qa.convert( build 12-Sep-2018 15:30:25 + myme.separation(orefdir, grefdir), "arcsec" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + ) < 0.003 build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + rev = "back_to_J2000" + image_id + ".im" build 12-Sep-2018 15:30:25 + imregrid(gal,template="J2000", output=rev) build 12-Sep-2018 15:30:25 + revtool = iatool() build 12-Sep-2018 15:30:25 + revtool.open(rev) build 12-Sep-2018 15:30:25 + rfit = revtool.fitcomponents(box="850,150,950,250") build 12-Sep-2018 15:30:25 + revtool.done() build 12-Sep-2018 15:30:25 + rcl = cltool() build 12-Sep-2018 15:30:25 + rcl.add(rfit['results']['component0']) build 12-Sep-2018 15:30:25 + rrefdir = rcl.getrefdir(0) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + qa.getvalue( build 12-Sep-2018 15:30:25 + qa.convert( build 12-Sep-2018 15:30:25 + myme.separation(orefdir, rrefdir), "arcsec" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + ) < 1e-2 build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def test_get(self): build 12-Sep-2018 15:30:25 """Test using template='get' works""" build 12-Sep-2018 15:30:25 tempfile = "xyz.im" build 12-Sep-2018 15:30:25 @@ -1081,27 +1102,37 @@ class imregrid_test(unittest.TestCase): build 12-Sep-2018 15:30:25 def test_complex(self): build 12-Sep-2018 15:30:25 """Test regridding a complex image, CAS-1390""" build 12-Sep-2018 15:30:25 myia = self._myia build 12-Sep-2018 15:30:25 - myia.open(datapath + "real1.im") build 12-Sep-2018 15:30:25 - realpart = myia.getchunk() build 12-Sep-2018 15:30:25 - csys = myia.coordsys() build 12-Sep-2018 15:30:25 - csys.setincrement([-0.9, 0.9]) build 12-Sep-2018 15:30:25 - rrg = myia.regrid(csys=csys.torecord()) build 12-Sep-2018 15:30:25 - rrgpart = rrg.getchunk() build 12-Sep-2018 15:30:25 - rrg.done() build 12-Sep-2018 15:30:25 - myia.open(datapath + "imag1.im") build 12-Sep-2018 15:30:25 - imagpart = myia.getchunk() build 12-Sep-2018 15:30:25 - irg = myia.regrid(csys=csys.torecord()) build 12-Sep-2018 15:30:25 - irgpart = irg.getchunk() build 12-Sep-2018 15:30:25 - irg.done() build 12-Sep-2018 15:30:25 - myia.fromshape("", myia.shape(), type="c") build 12-Sep-2018 15:30:25 - comp = myia.getchunk() build 12-Sep-2018 15:30:25 - comp = realpart + imagpart*1j build 12-Sep-2018 15:30:25 - myia.putchunk(comp) build 12-Sep-2018 15:30:25 - crg = myia.regrid(csys=csys.torecord()) build 12-Sep-2018 15:30:25 - crgpart = crg.getchunk() build 12-Sep-2018 15:30:25 - crg.done() build 12-Sep-2018 15:30:25 - myia.done() build 12-Sep-2018 15:30:25 - self.assertTrue((crgpart == rrgpart + irgpart*1j).all()) build 12-Sep-2018 15:30:25 + for i in (0, 1): build 12-Sep-2018 15:30:25 + myia.open(datapath + "real1.im") build 12-Sep-2018 15:30:25 + if i == 1: build 12-Sep-2018 15:30:25 + gg = myia.getchunk() build 12-Sep-2018 15:30:25 + myia.fromarray("", gg, myia.coordsys().torecord(), type='d') build 12-Sep-2018 15:30:25 + realpart = myia.getchunk() build 12-Sep-2018 15:30:25 + csys = myia.coordsys() build 12-Sep-2018 15:30:25 + csys.setincrement([-0.9, 0.9]) build 12-Sep-2018 15:30:25 + rrg = myia.regrid(csys=csys.torecord()) build 12-Sep-2018 15:30:25 + rrgpart = rrg.getchunk() build 12-Sep-2018 15:30:25 + rrg.done() build 12-Sep-2018 15:30:25 + myia.open(datapath + "imag1.im") build 12-Sep-2018 15:30:25 + if i == 1: build 12-Sep-2018 15:30:25 + gg = myia.getchunk() build 12-Sep-2018 15:30:25 + myia.fromarray("", gg, myia.coordsys().torecord(), type='d') build 12-Sep-2018 15:30:25 + imagpart = myia.getchunk() build 12-Sep-2018 15:30:25 + irg = myia.regrid(csys=csys.torecord()) build 12-Sep-2018 15:30:25 + irgpart = irg.getchunk() build 12-Sep-2018 15:30:25 + irg.done() build 12-Sep-2018 15:30:25 + compltype = 'c' build 12-Sep-2018 15:30:25 + if i == 1: build 12-Sep-2018 15:30:25 + compltype = 'cd' build 12-Sep-2018 15:30:25 + myia.fromshape("", myia.shape(), type=compltype) build 12-Sep-2018 15:30:25 + comp = myia.getchunk() build 12-Sep-2018 15:30:25 + comp = realpart + imagpart*1j build 12-Sep-2018 15:30:25 + myia.putchunk(comp) build 12-Sep-2018 15:30:25 + crg = myia.regrid(csys=csys.torecord()) build 12-Sep-2018 15:30:25 + crgpart = crg.getchunk() build 12-Sep-2018 15:30:25 + crg.done() build 12-Sep-2018 15:30:25 + myia.done() build 12-Sep-2018 15:30:25 + self.assertTrue((crgpart == rrgpart + irgpart*1j).all()) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_multibeam(self): build 12-Sep-2018 15:30:25 """test multibeams cannot be regridded""" build 12-Sep-2018 15:30:25 @@ -1157,7 +1188,10 @@ class imregrid_test(unittest.TestCase): build 12-Sep-2018 15:30:25 myia.done() build 12-Sep-2018 15:30:25 outfile = "zz_out.im" build 12-Sep-2018 15:30:25 self.assertTrue( build 12-Sep-2018 15:30:25 - imregrid(imagename=imagename, output=outfile, template="GALACTIC") build 12-Sep-2018 15:30:25 + imregrid( build 12-Sep-2018 15:30:25 + imagename=imagename, output=outfile, build 12-Sep-2018 15:30:25 + template="GALACTIC", decimate=5 build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 myia.open(outfile) build 12-Sep-2018 15:30:25 msgs = myia.history() build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_mstransform.py b/gcwrap/python/scripts/tests/test_mstransform.py build 12-Sep-2018 15:30:25 index 1d8ac67..290ee93 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_mstransform.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_mstransform.py build 12-Sep-2018 15:30:25 @@ -60,82 +60,53 @@ def check_eq(val, expval, tol=None): build 12-Sep-2018 15:30:25 # for importing different data sets build 12-Sep-2018 15:30:25 class test_base(unittest.TestCase): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def copyfile(self,file): build 12-Sep-2018 15:30:25 + vis = None build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - if os.path.exists(file): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ file) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + file +' '+ file) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp_ngc5921(self): build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_ngc5921(cls): build 12-Sep-2018 15:30:25 # data set with spw=0, 63 channels in LSRK build 12-Sep-2018 15:30:25 - self.vis = "ngc5921.ms" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 + test_base.vis = "ngc5921.ms" build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp_4ants(self): build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_4ants(cls): build 12-Sep-2018 15:30:25 # data set with spw=0~15, 64 channels each in TOPO build 12-Sep-2018 15:30:25 - self.vis = "Four_ants_3C286.ms" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 + test_base.vis = "Four_ants_3C286.ms" build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def setUp_jupiter(self): build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_jupiter(cls): build 12-Sep-2018 15:30:25 # data col, spw=0,1 1 channel each, TOPO, field=0~12, 93 scans build 12-Sep-2018 15:30:25 - self.vis = 'jupiter6cm.demo-thinned.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 + test_base.vis = 'jupiter6cm.demo-thinned.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def setUp_g19(self): build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_g19(cls): build 12-Sep-2018 15:30:25 # data with spw=0~23 128 channel each in LSRK, field=0,1 build 12-Sep-2018 15:30:25 - self.vis = 'g19_d2usb_targets_line-shortened-thinned.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp_CAS_5076(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = 'CAS-5076.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 + test_base.vis = 'g19_d2usb_targets_line-shortened-thinned.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def setUp_almasim(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = 'sim.alma.cycle0.compact.noisy.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_CAS_5076(cls): build 12-Sep-2018 15:30:25 + test_base.vis = 'CAS-5076.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_almasim(cls): build 12-Sep-2018 15:30:25 + test_base.vis = 'sim.alma.cycle0.compact.noisy.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def setUp_floatcol(self): build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_floatcol(cls): build 12-Sep-2018 15:30:25 datapath = os.environ.get('CASAPATH').split()[0] + \ build 12-Sep-2018 15:30:25 "/data/regression/unittest/flagdata/" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # 15 rows, 3 scans, 9 spw, mixed chans, XX,YY, FLOAT_DATA col build 12-Sep-2018 15:30:25 - self.vis = 'SDFloatColumn.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 + test_base.vis = 'SDFloatColumn.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis, datapath_sp=datapath) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp_3c84(self): build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_3c84(cls): build 12-Sep-2018 15:30:25 # MS is as follows (scan=1): build 12-Sep-2018 15:30:25 # SpwID #Chans Corrs build 12-Sep-2018 15:30:25 # 0 256 RR build 12-Sep-2018 15:30:25 @@ -143,125 +114,78 @@ class test_base(unittest.TestCase): build 12-Sep-2018 15:30:25 # 1 128 RR LL build 12-Sep-2018 15:30:25 # 2 64 RR RL LR LL build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - self.vis = '3c84scan1.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 + test_base.vis = '3c84scan1.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def setUp_CAS_5013(self): build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_CAS_5013(cls): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - self.vis = 'ALMA-data-mst-science-testing-CAS-5013-one-baseline-one-timestamp.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 + test_base.vis = 'ALMA-data-mst-science-testing-CAS-5013-one-baseline-one-timestamp.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_CAS_4850(cls): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def setUp_CAS_4850(self): build 12-Sep-2018 15:30:25 + test_base.vis = 'CAS-4850-30s-limit-ALMA.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - self.vis = 'CAS-4850-30s-limit-ALMA.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_CAS_4983(cls): build 12-Sep-2018 15:30:25 + test_base.vis = 'CAS-4983.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_CAS_5172(cls): build 12-Sep-2018 15:30:25 + test_base.vis = 'CAS-5172-phase-center.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def setUp_CAS_4983(self): build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_sub_tables_evla(cls): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - self.vis = 'CAS-4983.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp_CAS_5172(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = 'CAS-5172-phase-center.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp_sub_tables_evla(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = 'test-subtables-evla.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp_sub_tables_alma(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = 'test-subtables-alma.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp_titan(self): build 12-Sep-2018 15:30:25 + test_base.vis = 'test-subtables-evla.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - self.vis = 'titan-one-baseline-one-timestamp.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp_CAS_6733(self): build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_sub_tables_alma(cls): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - self.vis = 'CAS-6733.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp_CAS_6941(self): build 12-Sep-2018 15:30:25 + test_base.vis = 'test-subtables-alma.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - self.vis = 'CAS-6941.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp_CAS_6951(self): build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_titan(cls): build 12-Sep-2018 15:30:25 + test_base.vis = 'titan-one-baseline-one-timestamp.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - self.vis = 'CAS-6951.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp_CAS_7841(self): build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_CAS_6733(cls): build 12-Sep-2018 15:30:25 + test_base.vis = 'CAS-6733.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - self.vis = 'CAS-7841.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_CAS_6941(cls): build 12-Sep-2018 15:30:25 + test_base.vis = 'CAS-6941.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def setUp_CAS_7259(self): build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_CAS_6951(cls): build 12-Sep-2018 15:30:25 + test_base.vis = 'CAS-6951.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - self.vis = 'n0337d03-CAS-7259.ms' build 12-Sep-2018 15:30:25 - if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_CAS_7841(cls): build 12-Sep-2018 15:30:25 + test_base.vis = 'CAS-7841.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 - default(mstransform) build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_CAS_7259(cls): build 12-Sep-2018 15:30:25 + test_base.vis = 'n0337d03-CAS-7259.ms' build 12-Sep-2018 15:30:25 + cls._setup_std_reusing_input_vis(cls.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def setUp_flags(self): build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUp_flags(cls): build 12-Sep-2018 15:30:25 asdmname = 'test_uid___A002_X997a62_X8c-short' # Flag.xml is modified build 12-Sep-2018 15:30:25 - self.vis = asdmname+'.ms' build 12-Sep-2018 15:30:25 - self.flagfile = asdmname+'_cmd.txt' build 12-Sep-2018 15:30:25 + test_base.vis = asdmname+'.ms' build 12-Sep-2018 15:30:25 + cls.flagfile = asdmname+'_cmd.txt' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 asdmpath=os.environ.get('CASAPATH').split()[0]+'/data/regression/unittest/importasdm/' build 12-Sep-2018 15:30:25 os.system('ln -sf '+asdmpath+asdmname) build 12-Sep-2018 15:30:25 @@ -284,11 +208,38 @@ class test_base(unittest.TestCase): build 12-Sep-2018 15:30:25 print "................. Creating test MMS .................." build 12-Sep-2018 15:30:25 mstransform(vis=msfile, outputvis=self.testmms, datacolumn='data', build 12-Sep-2018 15:30:25 createmms=True,separationaxis=axis, scan=scans, spw=spws) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def cleanup(self): build 12-Sep-2018 15:30:25 + @staticmethod build 12-Sep-2018 15:30:25 + def copyfile(filename): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + if os.path.exists(filename): build 12-Sep-2018 15:30:25 + os.system('rm -rf '+ filename) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + os.system('cp -RL '+datapath + filename +' '+ filename) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @staticmethod build 12-Sep-2018 15:30:25 + def removeInputMS(self): build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + @staticmethod build 12-Sep-2018 15:30:25 + def _setup_std_reusing_input_vis(vis, datapath_sp=None): build 12-Sep-2018 15:30:25 + test_base._copy_input_ms_if_needed(vis, datapath_sp=datapath_sp) build 12-Sep-2018 15:30:25 + default(mstransform) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @staticmethod build 12-Sep-2018 15:30:25 + def _copy_input_ms_if_needed(vis, reuse_input=True, datapath_sp=None): build 12-Sep-2018 15:30:25 + # special datapath build 12-Sep-2018 15:30:25 + if datapath_sp: build 12-Sep-2018 15:30:25 + copy_path = datapath_sp build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + copy_path = datapath # global build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + found = os.path.exists(vis) build 12-Sep-2018 15:30:25 + if found and not reuse_input: build 12-Sep-2018 15:30:25 + test_base.system('rm -rf {0}'.format(vis)) build 12-Sep-2018 15:30:25 + if not found or not reuse_input: build 12-Sep-2018 15:30:25 + os.system('cp -RL ' + os.path.join(copy_path, vis) + ' ' + vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class test_base_compare(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -563,59 +514,57 @@ class test_combinespws_diff_channels(test_base): build 12-Sep-2018 15:30:25 self.assertTrue(os.path.exists(self.outputms)) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -class test_Regridms1(test_base): build 12-Sep-2018 15:30:25 +class test_regridms_four_ants(test_base): build 12-Sep-2018 15:30:25 '''Tests for regridms parameter using Four_ants_3C286.ms''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 self.setUp_4ants() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - pass build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.outputms) build 12-Sep-2018 15:30:25 + os.system('rm -rf '+ self.outputvis) build 12-Sep-2018 15:30:25 os.system('rm -rf testmms*ms list.obs') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def test_regrid1_1(self): build 12-Sep-2018 15:30:25 + def test_regrid1_defaults(self): build 12-Sep-2018 15:30:25 '''mstransform: Default of regridms parameters''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - self.outputms = "reg11.ms" build 12-Sep-2018 15:30:25 - mstransform(vis=self.vis, outputvis=self.outputms, regridms=True) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.outputms)) build 12-Sep-2018 15:30:25 + self.outputvis = "reg11.ms" build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis, outputvis=self.outputvis, regridms=True) build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.outputvis)) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # The regriding should be the same as the input build 12-Sep-2018 15:30:25 for i in range(16): build 12-Sep-2018 15:30:25 - ret = th.verifyMS(self.outputms, 16, 64, i) build 12-Sep-2018 15:30:25 + ret = th.verifyMS(self.outputvis, 16, 64, i) build 12-Sep-2018 15:30:25 self.assertTrue(ret[0],ret[1]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - listobs(self.outputms) build 12-Sep-2018 15:30:25 - listobs(self.outputms, listfile='list.obs') build 12-Sep-2018 15:30:25 + listobs(self.outputvis) build 12-Sep-2018 15:30:25 + listobs(self.outputvis, listfile='list.obs') build 12-Sep-2018 15:30:25 self.assertTrue(os.path.exists('list.obs'), 'Probable error in sub-table re-indexing') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Check the shape of WEIGHT and SIGMA build 12-Sep-2018 15:30:25 inp_ws = th.getColShape(self.vis,'WEIGHT') build 12-Sep-2018 15:30:25 inp_ss = th.getColShape(self.vis,'SIGMA') build 12-Sep-2018 15:30:25 - out_ws = th.getColShape(self.outputms,'WEIGHT') build 12-Sep-2018 15:30:25 - out_ss = th.getColShape(self.outputms,'SIGMA') build 12-Sep-2018 15:30:25 + out_ws = th.getColShape(self.outputvis,'WEIGHT') build 12-Sep-2018 15:30:25 + out_ss = th.getColShape(self.outputvis,'SIGMA') build 12-Sep-2018 15:30:25 self.assertListEqual(inp_ws, out_ws, 'WEIGHT shape differ in input and output') build 12-Sep-2018 15:30:25 self.assertListEqual(inp_ss, out_ss, 'SIGMA shape differ in input and output') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_regrid1_2(self): build 12-Sep-2018 15:30:25 + def test_regrid1_defaults_spw_sel(self): build 12-Sep-2018 15:30:25 '''mstransform: Default regridms with spw selection''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - self.outputms = "reg12.ms" build 12-Sep-2018 15:30:25 - mstransform(vis=self.vis, outputvis=self.outputms, regridms=True, spw='1,3,5,7') build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.outputms)) build 12-Sep-2018 15:30:25 + self.outputvis = "reg12.ms" build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis, outputvis=self.outputvis, regridms=True, spw='1,3,5,7') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.outputvis)) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # The output should be the same as the input build 12-Sep-2018 15:30:25 for i in range(4): build 12-Sep-2018 15:30:25 - ret = th.verifyMS(self.outputms, 4, 64, i) build 12-Sep-2018 15:30:25 + ret = th.verifyMS(self.outputvis, 4, 64, i) build 12-Sep-2018 15:30:25 self.assertTrue(ret[0],ret[1]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - listobs(self.outputms) build 12-Sep-2018 15:30:25 + listobs(self.outputvis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Verify that some sub-tables are properly re-indexed. build 12-Sep-2018 15:30:25 - spw_col = th.getVarCol(self.outputms+'/DATA_DESCRIPTION', 'SPECTRAL_WINDOW_ID') build 12-Sep-2018 15:30:25 + spw_col = th.getVarCol(self.outputvis+'/DATA_DESCRIPTION', 'SPECTRAL_WINDOW_ID') build 12-Sep-2018 15:30:25 self.assertEqual(spw_col.keys().__len__(), 4, 'Wrong number of rows in DD table') build 12-Sep-2018 15:30:25 self.assertEqual(spw_col['r1'][0], 0,'Error re-indexing DATA_DESCRIPTION table') build 12-Sep-2018 15:30:25 self.assertEqual(spw_col['r2'][0], 1,'Error re-indexing DATA_DESCRIPTION table') build 12-Sep-2018 15:30:25 @@ -623,7 +572,7 @@ class test_Regridms1(test_base): build 12-Sep-2018 15:30:25 self.assertEqual(spw_col['r4'][0], 3,'Error re-indexing DATA_DESCRIPTION table') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -class test_Regridms3(test_base): build 12-Sep-2018 15:30:25 +class test_regridms_jupiter(test_base): build 12-Sep-2018 15:30:25 '''Tests for regridms parameter using Jupiter MS''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 @@ -631,24 +580,24 @@ class test_Regridms3(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.outputms) build 12-Sep-2018 15:30:25 + os.system('rm -rf '+ self.outputvis) build 12-Sep-2018 15:30:25 os.system('rm -rf cvel31*.*ms') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_regrid3_1(self): build 12-Sep-2018 15:30:25 '''mstransform 12: Check that output columns are the same when using mstransform''' build 12-Sep-2018 15:30:25 - self.outputms = 'reg31.ms' build 12-Sep-2018 15:30:25 + self.outputvis = 'reg31.ms' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - mstransform(vis=self.vis, outputvis=self.outputms, field='6', build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis, outputvis=self.outputvis, field='6', build 12-Sep-2018 15:30:25 combinespws=True, regridms=True, datacolumn='data', build 12-Sep-2018 15:30:25 mode='frequency', nchan=2, start='4.8101 GHz', width='50 MHz', build 12-Sep-2018 15:30:25 outframe='') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - ret = th.verifyMS(self.outputms, 1, 2, 0) build 12-Sep-2018 15:30:25 + ret = th.verifyMS(self.outputvis, 1, 2, 0) build 12-Sep-2018 15:30:25 self.assertTrue(ret[0],ret[1]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Now run with cvel to compare the columns, CAS-4866 build 12-Sep-2018 15:30:25 - outputms = 'cvel31.ms' build 12-Sep-2018 15:30:25 - cvel(vis=self.vis, outputvis=outputms, field='6', build 12-Sep-2018 15:30:25 + outputvis = 'cvel31.ms' build 12-Sep-2018 15:30:25 + cvel(vis=self.vis, outputvis=outputvis, field='6', build 12-Sep-2018 15:30:25 passall=False,mode='frequency',nchan=2,start='4.8101 GHz', build 12-Sep-2018 15:30:25 width='50 MHz',outframe='') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -677,19 +626,19 @@ class test_Regridms3(test_base): build 12-Sep-2018 15:30:25 self.assertTrue(th.compTables('cvel31-sorted.ms/STATE','reg31-sorted.ms/STATE', [],0.000001,"absolute")) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Verify that some sub-tables are properly re-indexed. build 12-Sep-2018 15:30:25 - spw_col = th.getVarCol(self.outputms+'/DATA_DESCRIPTION', 'SPECTRAL_WINDOW_ID') build 12-Sep-2018 15:30:25 + spw_col = th.getVarCol(self.outputvis+'/DATA_DESCRIPTION', 'SPECTRAL_WINDOW_ID') build 12-Sep-2018 15:30:25 self.assertEqual(spw_col.keys().__len__(), 1, 'Wrong number of rows in DD table') build 12-Sep-2018 15:30:25 self.assertEqual(spw_col['r1'][0], 0,'Error re-indexing DATA_DESCRIPTION table') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_regrid3_2(self): build 12-Sep-2018 15:30:25 '''mstransform: Combine spw and regrid MS with two spws, select one field and 2 spws''' build 12-Sep-2018 15:30:25 # cvel: test8 build 12-Sep-2018 15:30:25 - self.outputms = "reg32a.ms" build 12-Sep-2018 15:30:25 - mstransform(vis=self.vis, outputvis=self.outputms, combinespws=True, regridms=True, build 12-Sep-2018 15:30:25 + self.outputvis = "reg32a.ms" build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis, outputvis=self.outputvis, combinespws=True, regridms=True, build 12-Sep-2018 15:30:25 spw='0,1',field = '11',nchan=1, width=2, datacolumn='DATA') build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.outputms)) build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.outputvis)) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - ret = th.verifyMS(self.outputms, 1, 1, 0) build 12-Sep-2018 15:30:25 + ret = th.verifyMS(self.outputvis, 1, 1, 0) build 12-Sep-2018 15:30:25 self.assertTrue(ret[0],ret[1]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Now, do only the regridding and do not combine spws build 12-Sep-2018 15:30:25 @@ -704,19 +653,352 @@ class test_Regridms3(test_base): build 12-Sep-2018 15:30:25 self.assertTrue(ret[0],ret[1]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -class test_Hanning(test_base): build 12-Sep-2018 15:30:25 - '''Test for hanning transformation''' build 12-Sep-2018 15:30:25 +class test_regridms_negative_width(test_base): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + Test regridding when the parameter width takes a negative value, in different build 12-Sep-2018 15:30:25 + regridding modes. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + I was tempted to put these test cases inside test_regridms_jupiter build 12-Sep-2018 15:30:25 + and/or test_regridms_four_ants, but these two operate on MSs that are unnecessarily build 12-Sep-2018 15:30:25 + big and have columns (model, corrected) that are not needed for this type of test. build 12-Sep-2018 15:30:25 + The dataset used here has only one data row, which I hope removes the need for ordering build 12-Sep-2018 15:30:25 + before comparing. Still, I think we should find or make a suitable but smaller MS. build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + # 1 spw, 1 data row, 3840 channels build 12-Sep-2018 15:30:25 + cls.setUp_titan() build 12-Sep-2018 15:30:25 + default(mstransform) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - self.setUp_ngc5921() build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - pass build 12-Sep-2018 15:30:25 + # all test cases are expected to generate the output MS from mstransform in outputvis build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + self.outputvis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def _check_chan_freqs_widths(self, freqs, widths, exp_nchan, exp_first_freq, build 12-Sep-2018 15:30:25 + exp_last_freq, exp_width): build 12-Sep-2018 15:30:25 + import numpy as np build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertEqual(len(freqs), exp_nchan) build 12-Sep-2018 15:30:25 + self.assertEqual(len(widths), exp_nchan) build 12-Sep-2018 15:30:25 + self.assertEqual(freqs[0], exp_first_freq) build 12-Sep-2018 15:30:25 + self.assertEqual(freqs[-1], exp_last_freq) build 12-Sep-2018 15:30:25 + self.assertTrue(np.allclose(np.ediff1d(freqs), exp_width, rtol=1e-2)) build 12-Sep-2018 15:30:25 + self.assertTrue(np.allclose(widths, exp_width, rtol=1e-3)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_regrid_channel_neg_width(self): build 12-Sep-2018 15:30:25 + '''mstransform: regridding in channel mode with negative width''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.outputvis = 'regrid_chan_neg_width.ms' build 12-Sep-2018 15:30:25 + nchan = 10 build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis, outputvis=self.outputvis, datacolumn='data', build 12-Sep-2018 15:30:25 + regridms=True, outframe='BARY', build 12-Sep-2018 15:30:25 + mode='channel', nchan=nchan, start=100, width=-10) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + chan_freqs, chan_widths = th.get_channel_freqs_widths(self.outputvis, 0) build 12-Sep-2018 15:30:25 + self._check_chan_freqs_widths(chan_freqs, chan_widths, nchan, build 12-Sep-2018 15:30:25 + 3.543540545236911e+11, 3.5435954715143951e+11, build 12-Sep-2018 15:30:25 + 610291.972) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_regrid_channel_b_neg_width(self): build 12-Sep-2018 15:30:25 + '''mstransform: regridding in channel_b mode with negative width''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.outputvis = 'regrid_chan_b_neg_width.ms' build 12-Sep-2018 15:30:25 + nchan = 8 build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis, outputvis=self.outputvis, datacolumn='data', build 12-Sep-2018 15:30:25 + regridms=True, outframe='BARY', build 12-Sep-2018 15:30:25 + mode='channel_b', nchan=nchan, start=100, width=-10) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + chan_freqs, chan_widths = th.get_channel_freqs_widths(self.outputvis, 0) build 12-Sep-2018 15:30:25 + self._check_chan_freqs_widths(chan_freqs, chan_widths, nchan, build 12-Sep-2018 15:30:25 + 3.5435521407843884e+11, 3.5435948612224243e+11, build 12-Sep-2018 15:30:25 + 610291.9720) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_regrid_velocity_neg_width(self): build 12-Sep-2018 15:30:25 + '''mstransform: regridding in velocity mode with negative width''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.outputvis = 'regrid_vel_neg_width.ms' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + vis_freqs, _vis_widths = th.get_channel_freqs_widths(self.vis, 0) build 12-Sep-2018 15:30:25 + restf = vis_freqs[0] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + nchan = 10 build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis, outputvis=self.outputvis, datacolumn='data', build 12-Sep-2018 15:30:25 + regridms=True, outframe='BARY', build 12-Sep-2018 15:30:25 + mode='velocity', veltype='radio', restfreq='{0}Hz'.format(restf), build 12-Sep-2018 15:30:25 + nchan=nchan, start='25km/s', width='-1km/s') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + chan_freqs, chan_widths = th.get_channel_freqs_widths(self.outputvis, 0) build 12-Sep-2018 15:30:25 + self._check_chan_freqs_widths(chan_freqs, chan_widths, nchan, build 12-Sep-2018 15:30:25 + 3.5435876611326282e+11, 3.543694051229682e+11, build 12-Sep-2018 15:30:25 + 1.182112189e+06) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_regrid_frequency_neg_width(self): build 12-Sep-2018 15:30:25 + '''mstransform: regridding in frequency mode with negative width''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.outputvis = 'regrid_freq_neg_width.ms' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + nchan = 12 build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis, outputvis=self.outputvis, datacolumn='data', build 12-Sep-2018 15:30:25 + regridms=True, outframe='LSRK', build 12-Sep-2018 15:30:25 + mode='frequency', nchan=nchan, start='354.42GHz', width='-0.3GHz') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + chan_freqs, chan_widths = th.get_channel_freqs_widths(self.outputvis, 0) build 12-Sep-2018 15:30:25 + self._check_chan_freqs_widths(chan_freqs, chan_widths, nchan, build 12-Sep-2018 15:30:25 + 3.5112e+11, 3.5442e+11, 3e+8) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class test_regridms_interpolation_only(test_base): build 12-Sep-2018 15:30:25 + '''Look into the DATA and WEIGHT produced by regridding, using the different build 12-Sep-2018 15:30:25 + interpolation methods available, when not combining them with channel average build 12-Sep-2018 15:30:25 + or any other transformations.''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + default(mstransform) build 12-Sep-2018 15:30:25 + # Small MS with two data rows (two SPWs, one row per SPW). build 12-Sep-2018 15:30:25 + cls.vis = 'combine-1-timestamp-2-SPW-with-WEIGHT_SPECTRUM-Same-Exposure.ms' build 12-Sep-2018 15:30:25 + cls.out_nchan = 10 build 12-Sep-2018 15:30:25 + cls.copyfile(cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + # all test cases are expected to generate the output MS from mstransform in outvis build 12-Sep-2018 15:30:25 + os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def check_output_values(self, vis, eq_pattern, nchan=10, eq_epsilon=1e-5): build 12-Sep-2018 15:30:25 + ''' Checks DATA, WEIGHT, and WEIGHT_SPECTRUM ''' build 12-Sep-2018 15:30:25 + ttb = tbtool() build 12-Sep-2018 15:30:25 + ttb.open(vis) build 12-Sep-2018 15:30:25 + weight_spectrum = ttb.getcol('WEIGHT_SPECTRUM') build 12-Sep-2018 15:30:25 + data = ttb.getcol('DATA') build 12-Sep-2018 15:30:25 + weights = ttb.getcol('WEIGHT') build 12-Sep-2018 15:30:25 + ttb.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # for 'combine-1-timestamp-2-SPW-with-WEIGHT_SPECTRUM-Same-Exposure.ms' build 12-Sep-2018 15:30:25 + # shape is (1, 10, 2) - 1 pol x 10 channels x 2 rows build 12-Sep-2018 15:30:25 + out_nchan = data.shape[1] build 12-Sep-2018 15:30:25 + check_eq(out_nchan, nchan) build 12-Sep-2018 15:30:25 + eq_epsilon = 1e-5 build 12-Sep-2018 15:30:25 + check_eq(weights[:,0], 59.026817, eq_epsilon) build 12-Sep-2018 15:30:25 + check_eq(weights[:,1], 31.586397, eq_epsilon) build 12-Sep-2018 15:30:25 + check_eq(weight_spectrum[:,:,0], weights[0,0], eq_epsilon) build 12-Sep-2018 15:30:25 + check_eq(weight_spectrum[:,:,1], weights[0,1], eq_epsilon) build 12-Sep-2018 15:30:25 + for pat in eq_pattern: build 12-Sep-2018 15:30:25 + row = pat[0] build 12-Sep-2018 15:30:25 + chan = pat[1] build 12-Sep-2018 15:30:25 + real = pat[2] build 12-Sep-2018 15:30:25 + imag = pat[3] build 12-Sep-2018 15:30:25 + check_eq(data[0][chan][row].real, real, eq_epsilon) build 12-Sep-2018 15:30:25 + check_eq(data[0][chan][row].imag, imag, eq_epsilon) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def run_mstransform_simply_regrid(self, vis, outvis, interpolation, nchan=10): build 12-Sep-2018 15:30:25 + mstransform(vis=vis, outputvis=outvis, datacolumn="DATA", build 12-Sep-2018 15:30:25 + regridms=True, mode="frequency", nchan=nchan, build 12-Sep-2018 15:30:25 + start="2.20804+10Hz", width="2.5e+05Hz", build 12-Sep-2018 15:30:25 + phasecenter="J2000 12h01m53.13s -18d53m09.8s", build 12-Sep-2018 15:30:25 + interpolation=interpolation) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_simple_regrid_nearest(self): build 12-Sep-2018 15:30:25 + ''' mstransform: regrid, nothing else. interpolation nearest, check output values''' build 12-Sep-2018 15:30:25 + self.outvis = 'test_simple_regrid_nearest.ms' build 12-Sep-2018 15:30:25 + self.run_mstransform_simply_regrid(self.vis, self.outvis, 'nearest') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + eq_pattern = [[0, 0, .0, .0], build 12-Sep-2018 15:30:25 + [0, 1, 0.18098925, 0.35214117], build 12-Sep-2018 15:30:25 + [1, 5, 0.42104605, 0.26617193], build 12-Sep-2018 15:30:25 + [1, self.out_nchan-1, 0.02630020, 0.19990821]] build 12-Sep-2018 15:30:25 + self.check_output_values(self.outvis, eq_pattern, self.out_nchan) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_simple_regrid_linear(self): build 12-Sep-2018 15:30:25 + ''' mstransform: regrid, nothing else. interpolation linear, check output values''' build 12-Sep-2018 15:30:25 + self.outvis = 'test_simple_regrid_linear.ms' build 12-Sep-2018 15:30:25 + self.run_mstransform_simply_regrid(self.vis, self.outvis, 'linear') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + eq_pattern = [[0, 0, 0.02533850, 0.04929977], build 12-Sep-2018 15:30:25 + [0, 1, 0.14533380, 0.47466096], build 12-Sep-2018 15:30:25 + [1, 5, 0.36502194, 0.45022112], build 12-Sep-2018 15:30:25 + [1, self.out_nchan-1, 0.12325509, 0.05476397]] build 12-Sep-2018 15:30:25 + self.check_output_values(self.outvis, eq_pattern, self.out_nchan) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_simple_regrid_cubic(self): build 12-Sep-2018 15:30:25 + ''' mstransform: regrid, nothing else. interpolation cubic, check output values''' build 12-Sep-2018 15:30:25 + self.outvis = 'test_simple_regrid_cubic.ms' build 12-Sep-2018 15:30:25 + self.run_mstransform_simply_regrid(self.vis, self.outvis, interpolation='cubic') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + eq_pattern = [[0, 0, 0.05564772, 0.03979797], build 12-Sep-2018 15:30:25 + [0, 1, 0.15562536, 0.50231683], build 12-Sep-2018 15:30:25 + [1, 5, 0.39988747, 0.53319526 ], build 12-Sep-2018 15:30:25 + [1, self.out_nchan-1, 0.15120457, 0.07539418]] build 12-Sep-2018 15:30:25 + self.check_output_values(self.outvis, eq_pattern, self.out_nchan) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_simple_regrid_spline(self): build 12-Sep-2018 15:30:25 + ''' mstransform: regrid, nothing else. interpolation cubic, check output values''' build 12-Sep-2018 15:30:25 + self.outvis = 'test_simple_regrid_spline.ms' build 12-Sep-2018 15:30:25 + self.run_mstransform_simply_regrid(self.vis, self.outvis, interpolation='spline') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + eq_pattern = [[0, 0, 0.03446201, 0.05137327], build 12-Sep-2018 15:30:25 + [0, 1, 0.15356585, 0.52084935], build 12-Sep-2018 15:30:25 + [1, 5, 0.40553212, 0.55733341 ], build 12-Sep-2018 15:30:25 + [1, self.out_nchan-1, 0.17665164, 0.05236539]] build 12-Sep-2018 15:30:25 + self.check_output_values(self.outvis, eq_pattern, self.out_nchan) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_simple_regrid_fftshift(self): build 12-Sep-2018 15:30:25 + ''' mstransform: regrid, nothing else. interpolation fftshift, check output values''' build 12-Sep-2018 15:30:25 + self.outvis = 'test_simple_regrid_fftshift.ms' build 12-Sep-2018 15:30:25 + self.run_mstransform_simply_regrid(self.vis, self.outvis, interpolation='fftshift') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + eq_pattern = [[0, 0, 0.02533850, 0.04929977], build 12-Sep-2018 15:30:25 + [0, 1, 0.14533380, 0.47466096], build 12-Sep-2018 15:30:25 + [1, 5, 0.36502194, 0.45022112], build 12-Sep-2018 15:30:25 + [1, self.out_nchan-1, 0.12325509, 0.05476397]] build 12-Sep-2018 15:30:25 + self.check_output_values(self.outvis, eq_pattern, self.out_nchan) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class test_regridms_single_spw(test_base_compare): build 12-Sep-2018 15:30:25 + '''Tests for regridms w/o combining SPWS''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + super(test_regridms_single_spw,self).setUp() build 12-Sep-2018 15:30:25 + self.setUp_CAS_5013() build 12-Sep-2018 15:30:25 + self.outvis = 'test_regridms_single_spw_mst.ms' build 12-Sep-2018 15:30:25 + self.refvis = 'test_regridms_single_spw_cvel.ms' build 12-Sep-2018 15:30:25 + self.outvis_sorted = 'test_regridms_single_spw_mst_sorted.ms' build 12-Sep-2018 15:30:25 + self.refvis_sorted = 'test_regridms_single_spw_cvel_sorted.ms' build 12-Sep-2018 15:30:25 + os.system('rm -rf test_regridms_single_sp*') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + super(test_regridms_single_spw,self).tearDown() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_regrid_only_LSRK(self): build 12-Sep-2018 15:30:25 + '''mstransform: Change ref. frame to LSRK''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis,outputvis=self.outvis,regridms=True,datacolumn='ALL', build 12-Sep-2018 15:30:25 + field='Vy_CMa',spw='3',mode='frequency',nchan=3830,start='310427.353MHz',width='-244.149kHz',outframe='lsrk') build 12-Sep-2018 15:30:25 + cvel(vis=self.vis,outputvis=self.refvis, build 12-Sep-2018 15:30:25 + field='Vy_CMa',spw='3',mode='frequency',nchan=3830,start='310427.353MHz',width='-244.149kHz',outframe='lsrk') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.generate_tolerance_map() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.mode['WEIGHT'] = "absolute" build 12-Sep-2018 15:30:25 + self.tolerance['WEIGHT'] = 1E-3 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.post_process() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class test_regridms_multiple_spws(test_base_compare): build 12-Sep-2018 15:30:25 + '''Tests for regridms combining SPWS''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + super(test_regridms_multiple_spws,self).setUp() build 12-Sep-2018 15:30:25 + self.setUp_CAS_5172() build 12-Sep-2018 15:30:25 + self.outvis = 'test_regridms_multiple_spw_mst.ms' build 12-Sep-2018 15:30:25 + self.refvis = 'test_regridms_multiple_spw_cvel.ms' build 12-Sep-2018 15:30:25 + self.outvis_sorted = 'test_regridms_multiple_spw_mst_sorted.ms' build 12-Sep-2018 15:30:25 + self.refvis_sorted = 'test_regridms_multiple_spw_cvel_sorted.ms' build 12-Sep-2018 15:30:25 + os.system('rm -rf test_regridms_multiple_spw*') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + super(test_regridms_multiple_spws,self).tearDown() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @unittest.skip('Skip, cvel produces an exception since release 4.7.2 as per CAS-9798') build 12-Sep-2018 15:30:25 + def test_combine_regrid_fftshift(self): build 12-Sep-2018 15:30:25 + '''mstransform: Combine 2 SPWs and change ref. frame to LSRK using fftshift''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + cvel(vis = self.vis, outputvis = self.refvis ,mode = 'velocity',nchan = 10,start = '-50km/s',width = '5km/s', build 12-Sep-2018 15:30:25 + interpolation = 'fftshift',restfreq = '36.39232GHz',outframe = 'LSRK',veltype = 'radio', phasecenter="2") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + mstransform(vis = self.vis, outputvis = self.outvis, datacolumn='all',combinespws = True, regridms = True, build 12-Sep-2018 15:30:25 + mode = 'velocity', nchan = 10, start = '-50km/s', width = '5km/s', interpolation = 'fftshift', build 12-Sep-2018 15:30:25 + restfreq = '36.39232GHz', outframe = 'LSRK', veltype = 'radio') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.generate_tolerance_map() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.mode['WEIGHT'] = "absolute" build 12-Sep-2018 15:30:25 + self.tolerance['WEIGHT'] = 50 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # Exlude FEED from the list of sub-tables to compare because cvel does not remove duplicates build 12-Sep-2018 15:30:25 + self.subtables=['/ANTENNA','/DATA_DESCRIPTION','/FIELD','/FLAG_CMD', build 12-Sep-2018 15:30:25 + '/POINTING','/POLARIZATION','/PROCESSOR','/STATE'] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.post_process() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_combine_noregrid_fftshift(self): build 12-Sep-2018 15:30:25 + '''mstransform: Combine 2 SPWs and change ref. frame to LSRK using fftshift''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis, outputvis=self.outvis, datacolumn='all', build 12-Sep-2018 15:30:25 + combinespws=True, regridms=True, mode='velocity', nchan=10, build 12-Sep-2018 15:30:25 + start='-50km/s', width='5km/s', interpolation='fftshift', build 12-Sep-2018 15:30:25 + restfreq='36.39232GHz', outframe='LSRK', veltype='radio') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.isdir(self.outvis)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class test_regridms_spw_with_different_number_of_channels(test_base): build 12-Sep-2018 15:30:25 + '''Tests for regridms w/o combining SPWS''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_CAS_4983() build 12-Sep-2018 15:30:25 + cls.outvis = 'test_regridms_spw_with_different_number_of_channels.ms' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(self): build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_regridms_spw_with_different_number_of_channels_separately(self): build 12-Sep-2018 15:30:25 + '''mstransform: Regrid SPWs separately, applying pre-channel averaging to only some of them''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + mstransform(vis=self.vis,outputvis=self.outvis,datacolumn='data',field='J0102-7546',regridms=True, build 12-Sep-2018 15:30:25 + mode='frequency',width='29297.28kHz',outframe='lsrk',veltype='radio') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # DDI subtable should have 4 rows with the proper indices build 12-Sep-2018 15:30:25 + mytb = tbtool() build 12-Sep-2018 15:30:25 + mytb.open(self.outvis + '/SPECTRAL_WINDOW') build 12-Sep-2018 15:30:25 + numChan = mytb.getcol('NUM_CHAN') build 12-Sep-2018 15:30:25 + mytb.close() build 12-Sep-2018 15:30:25 + check_eq(numChan[0], 32) build 12-Sep-2018 15:30:25 + check_eq(numChan[1], 2) build 12-Sep-2018 15:30:25 + check_eq(numChan[2], 68) build 12-Sep-2018 15:30:25 + check_eq(numChan[3], 2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class test_Hanning_with_g19(test_base): build 12-Sep-2018 15:30:25 + '''Test for hanning transformation - tests that use dataset g19''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_g19() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + self.outputms = '' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + # all test cases are expected to generate the output MS from mstransform in outputms build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outputms) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_hanning1(self): build 12-Sep-2018 15:30:25 '''mstransform: Apply Hanning smoothing in MS with 24 spws. Do not combine spws.''' build 12-Sep-2018 15:30:25 - self.setUp_g19() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 self.outputms = "hann1.ms" build 12-Sep-2018 15:30:25 mstransform(vis=self.vis, outputvis=self.outputms, combinespws=False, hanning=True, build 12-Sep-2018 15:30:25 datacolumn='data') build 12-Sep-2018 15:30:25 @@ -735,7 +1017,7 @@ class test_Hanning(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_hanning2(self): build 12-Sep-2018 15:30:25 '''mstransform: Apply Hanning smoothing and combine spw=1,2,3.''' build 12-Sep-2018 15:30:25 - self.setUp_g19() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 self.outputms = "hann2.ms" build 12-Sep-2018 15:30:25 mstransform(vis=self.vis, outputvis=self.outputms, combinespws=True, hanning=True, build 12-Sep-2018 15:30:25 spw='1,2,3', datacolumn='data') build 12-Sep-2018 15:30:25 @@ -749,6 +1031,26 @@ class test_Hanning(test_base): build 12-Sep-2018 15:30:25 self.assertEqual(spw_col.keys().__len__(), 1, 'Wrong number of rows in DD table') build 12-Sep-2018 15:30:25 self.assertEqual(spw_col['r1'][0], 0,'Error re-indexing DATA_DESCRIPTION table') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class test_Hanning_with_ngc5921(test_base): build 12-Sep-2018 15:30:25 + '''Test for hanning transformation - tests that use dataset ngc5921''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_ngc5921() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + self.outputms = '' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + # all test cases are expected to generate the output MS from mstransform in outputms build 12-Sep-2018 15:30:25 + os.system('rm -rf '+ self.outputms) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def test_hanning3(self): build 12-Sep-2018 15:30:25 '''mstransform: Hanning theoretical and calculated values should be the same''' build 12-Sep-2018 15:30:25 # hanning: test4 build 12-Sep-2018 15:30:25 @@ -824,11 +1126,21 @@ class test_Hanning(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class test_FreqAvg(test_base): build 12-Sep-2018 15:30:25 '''Tests for frequency averaging''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_g19() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - self.setUp_g19() build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 + # all test cases are expected to generate the output MS from mstransform in outputvis build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outputms) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_freqavg1(self): build 12-Sep-2018 15:30:25 @@ -914,11 +1226,21 @@ class test_FreqAvg(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class test_Shape(test_base): build 12-Sep-2018 15:30:25 '''Test the tileshape parameter''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 + # all test cases are expected to generate the output MS from mstransform in outputvis build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outputms) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_shape1(self): build 12-Sep-2018 15:30:25 @@ -1060,12 +1382,20 @@ class test_Columns(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class test_SeparateSPWs(test_base): build 12-Sep-2018 15:30:25 '''Test the nspw parameter to separate spws''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 self.tmpms = "" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.tmpms) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outputms) build 12-Sep-2018 15:30:25 os.system('rm -rf list.obs') build 12-Sep-2018 15:30:25 @@ -1206,13 +1536,23 @@ class test_SeparateSPWs(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class test_state(test_base): build 12-Sep-2018 15:30:25 '''Test operation with state id''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_CAS_5076() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - self.setUp_CAS_5076() build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 + # all test cases are expected to generate the output MS from mstransform in outputms build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outputms) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def test_select_by_scan_intent_and_reindex_state_accordingly(self): build 12-Sep-2018 15:30:25 '''mstransform: select a scan intent and re-index state sub-table''' build 12-Sep-2018 15:30:25 self.outputms = "test_select_by_scan_intent_and_reindex_state_accordingly.ms" build 12-Sep-2018 15:30:25 @@ -1247,7 +1587,6 @@ class test_state(test_base): build 12-Sep-2018 15:30:25 # listobs checks that re-indexing is consistent build 12-Sep-2018 15:30:25 listobs(self.outputms) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 class test_WeightSpectrum(test_base): build 12-Sep-2018 15:30:25 '''Test usage of WEIGHT_SPECTRUM to channel average and combine SPWs with different exposure''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1368,6 +1707,7 @@ class test_WeightSpectrum(test_base): build 12-Sep-2018 15:30:25 check_eq(data[0][0][0].real, 0.0893, 0.0001) build 12-Sep-2018 15:30:25 check_eq(data[0][nchan-1][0].imag, -0.2390, 0.0001) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 class test_channelAverageByDefault(test_base_compare): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 @@ -1468,7 +1808,7 @@ class test_timeaverage(test_base_compare): build 12-Sep-2018 15:30:25 aflocal.init() build 12-Sep-2018 15:30:25 aflocal.run(writeflags=True) build 12-Sep-2018 15:30:25 aflocal.done() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def flag_ms(self): build 12-Sep-2018 15:30:25 aflocal.open(self.vis) build 12-Sep-2018 15:30:25 aflocal.selectdata() build 12-Sep-2018 15:30:25 @@ -1555,12 +1895,20 @@ class test_timeaverage(test_base_compare): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class test_timeaverage_limits(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_CAS_4850() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - self.setUp_CAS_4850() build 12-Sep-2018 15:30:25 self.outvis = 'test_timeaverage_limits.ms' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 + # all test cases are expected to generate the output MS from mstransform in outvis build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_CAS_4850(self): build 12-Sep-2018 15:30:25 @@ -1574,7 +1922,6 @@ class test_timeaverage_limits(test_base): build 12-Sep-2018 15:30:25 mytb.close() build 12-Sep-2018 15:30:25 check_eq(interval[0] >= 40.0,True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 class test_multiple_transformations(test_base_compare): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 @@ -1776,119 +2123,24 @@ class test_multiple_transformations(test_base_compare): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 th.compTables(self.vis+'/FEED', self.outvis+'/FEED', ['FOCUS_LENGTH']) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -class test_regridms_single_spw(test_base_compare): build 12-Sep-2018 15:30:25 - '''Tests for regridms w/o combining SPWS''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp(self): build 12-Sep-2018 15:30:25 - super(test_regridms_single_spw,self).setUp() build 12-Sep-2018 15:30:25 - self.setUp_CAS_5013() build 12-Sep-2018 15:30:25 - self.outvis = 'test_regridms_single_spw_mst.ms' build 12-Sep-2018 15:30:25 - self.refvis = 'test_regridms_single_spw_cvel.ms' build 12-Sep-2018 15:30:25 - self.outvis_sorted = 'test_regridms_single_spw_mst_sorted.ms' build 12-Sep-2018 15:30:25 - self.refvis_sorted = 'test_regridms_single_spw_cvel_sorted.ms' build 12-Sep-2018 15:30:25 - os.system('rm -rf test_regridms_single_sp*') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def tearDown(self): build 12-Sep-2018 15:30:25 - super(test_regridms_single_spw,self).tearDown() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_regrid_only_LSRK(self): build 12-Sep-2018 15:30:25 - '''mstransform: Change ref. frame to LSRK''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mstransform(vis=self.vis,outputvis=self.outvis,regridms=True,datacolumn='ALL', build 12-Sep-2018 15:30:25 - field='Vy_CMa',spw='3',mode='frequency',nchan=3830,start='310427.353MHz',width='-244.149kHz',outframe='lsrk') build 12-Sep-2018 15:30:25 - cvel(vis=self.vis,outputvis=self.refvis, build 12-Sep-2018 15:30:25 - field='Vy_CMa',spw='3',mode='frequency',nchan=3830,start='310427.353MHz',width='-244.149kHz',outframe='lsrk') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.generate_tolerance_map() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.mode['WEIGHT'] = "absolute" build 12-Sep-2018 15:30:25 - self.tolerance['WEIGHT'] = 1E-3 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.post_process() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -class test_regridms_multiple_spws(test_base_compare): build 12-Sep-2018 15:30:25 - '''Tests for regridms combining SPWS''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp(self): build 12-Sep-2018 15:30:25 - super(test_regridms_multiple_spws,self).setUp() build 12-Sep-2018 15:30:25 - self.setUp_CAS_5172() build 12-Sep-2018 15:30:25 - self.outvis = 'test_regridms_multiple_spw_mst.ms' build 12-Sep-2018 15:30:25 - self.refvis = 'test_regridms_multiple_spw_cvel.ms' build 12-Sep-2018 15:30:25 - self.outvis_sorted = 'test_regridms_multiple_spw_mst_sorted.ms' build 12-Sep-2018 15:30:25 - self.refvis_sorted = 'test_regridms_multiple_spw_cvel_sorted.ms' build 12-Sep-2018 15:30:25 - os.system('rm -rf test_regridms_multiple_spw*') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def tearDown(self): build 12-Sep-2018 15:30:25 - super(test_regridms_multiple_spws,self).tearDown() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - @unittest.skip('Skip, cvel produces an exception since release 4.7.2 as per CAS-9798') build 12-Sep-2018 15:30:25 - def test_combine_regrid_fftshift(self): build 12-Sep-2018 15:30:25 - '''mstransform: Combine 2 SPWs and change ref. frame to LSRK using fftshift''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - cvel(vis = self.vis, outputvis = self.refvis ,mode = 'velocity',nchan = 10,start = '-50km/s',width = '5km/s', build 12-Sep-2018 15:30:25 - interpolation = 'fftshift',restfreq = '36.39232GHz',outframe = 'LSRK',veltype = 'radio', phasecenter="2") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mstransform(vis = self.vis, outputvis = self.outvis, datacolumn='all',combinespws = True, regridms = True, build 12-Sep-2018 15:30:25 - mode = 'velocity', nchan = 10, start = '-50km/s', width = '5km/s', interpolation = 'fftshift', build 12-Sep-2018 15:30:25 - restfreq = '36.39232GHz', outframe = 'LSRK', veltype = 'radio') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.generate_tolerance_map() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.mode['WEIGHT'] = "absolute" build 12-Sep-2018 15:30:25 - self.tolerance['WEIGHT'] = 50 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Exlude FEED from the list of sub-tables to compare because cvel does not remove duplicates build 12-Sep-2018 15:30:25 - self.subtables=['/ANTENNA','/DATA_DESCRIPTION','/FIELD','/FLAG_CMD', build 12-Sep-2018 15:30:25 - '/POINTING','/POLARIZATION','/PROCESSOR','/STATE'] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.post_process() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_combine_noregrid_fftshift(self): build 12-Sep-2018 15:30:25 - '''mstransform: Combine 2 SPWs and change ref. frame to LSRK using fftshift''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mstransform(vis=self.vis, outputvis=self.outvis, datacolumn='all', build 12-Sep-2018 15:30:25 - combinespws=True, regridms=True, mode='velocity', nchan=10, build 12-Sep-2018 15:30:25 - start='-50km/s', width='5km/s', interpolation='fftshift', build 12-Sep-2018 15:30:25 - restfreq='36.39232GHz', outframe='LSRK', veltype='radio') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.isdir(self.outvis)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -class test_regridms_spw_with_different_number_of_channels(test_base): build 12-Sep-2018 15:30:25 - '''Tests for regridms w/o combining SPWS''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp(self): build 12-Sep-2018 15:30:25 - self.setUp_CAS_4983() build 12-Sep-2018 15:30:25 - self.outvis = 'test_regridms_spw_with_different_number_of_channels.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_regridms_spw_with_different_number_of_channels_separately(self): build 12-Sep-2018 15:30:25 - '''mstransform: Regrid SPWs separately, applying pre-channel averaging to only some of them''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mstransform(vis=self.vis,outputvis=self.outvis,datacolumn='data',field='J0102-7546',regridms=True, build 12-Sep-2018 15:30:25 - mode='frequency',width='29297.28kHz',outframe='lsrk',veltype='radio') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # DDI subtable should have 4 rows with the proper indices build 12-Sep-2018 15:30:25 - mytb = tbtool() build 12-Sep-2018 15:30:25 - mytb.open(self.outvis + '/SPECTRAL_WINDOW') build 12-Sep-2018 15:30:25 - numChan = mytb.getcol('NUM_CHAN') build 12-Sep-2018 15:30:25 - mytb.close() build 12-Sep-2018 15:30:25 - check_eq(numChan[0], 32) build 12-Sep-2018 15:30:25 - check_eq(numChan[1], 2) build 12-Sep-2018 15:30:25 - check_eq(numChan[2], 68) build 12-Sep-2018 15:30:25 - check_eq(numChan[3], 2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class test_spw_poln(test_base): build 12-Sep-2018 15:30:25 '''tests for spw with different correlation shapes''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_3c84() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - self.setUp_3c84() build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 + # all test cases are expected to generate the output MS from mstransform in outputms build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outputms) build 12-Sep-2018 15:30:25 os.system('rm -rf list.obs') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2149,16 +2401,21 @@ class testFlags(test_base): build 12-Sep-2018 15:30:25 class test_subtables_evla(test_base): build 12-Sep-2018 15:30:25 '''Test effect of SPW combination/separation on EVLA sub-tables''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_sub_tables_evla() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = '' build 12-Sep-2018 15:30:25 self.tmpms = '' build 12-Sep-2018 15:30:25 self.outputms = '' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.setUp_sub_tables_evla() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 + # all test cases expected to generate the output MSs in tmpsms / outputms build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.tmpms) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outputms) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2256,11 +2513,21 @@ class test_subtables_evla(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class test_weight_spectrum_creation(test_base): build 12-Sep-2018 15:30:25 '''Test when WEIGHT/SIGMA_SPECTRUM columns are created or not (with usewtspectrum)''' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 + # all test cases are expected to generate the output MS from mstransform in outputms build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outputms) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_usewtspectrum_on(self): build 12-Sep-2018 15:30:25 @@ -2311,19 +2578,24 @@ class test_weight_spectrum_creation(test_base): build 12-Sep-2018 15:30:25 class test_subtables_alma(test_base): build 12-Sep-2018 15:30:25 '''Test effect of SPW combination/separation on ALMA sub-tables''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_sub_tables_alma() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = '' build 12-Sep-2018 15:30:25 self.tmpms = '' build 12-Sep-2018 15:30:25 self.outputms = '' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.setUp_sub_tables_alma() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 + # all test cases are expected to generate the output MSs in tmpms / outputms build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.tmpms) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outputms) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def test_remove_duplicates_after_combine_alma(self): build 12-Sep-2018 15:30:25 '''mstransform: Check that sub-tables have no duplicates after SPW combination''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2420,8 +2692,8 @@ class test_subtables_alma(test_base): build 12-Sep-2018 15:30:25 self.assertTrue((w > 0).all()) build 12-Sep-2018 15:30:25 self.assertTrue((mytb.getcol('TOTAL_BANDWIDTH') > 0).all()) build 12-Sep-2018 15:30:25 mytb.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 class test_radial_velocity_correction(test_base_compare): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 @@ -2463,7 +2735,7 @@ class test_radial_velocity_correction_largetimerange(test_base_compare): build 12-Sep-2018 15:30:25 super(test_radial_velocity_correction_largetimerange, self).setUp() build 12-Sep-2018 15:30:25 self.vis = 'CAS-7382.ms' build 12-Sep-2018 15:30:25 if os.path.exists(self.vis): build 12-Sep-2018 15:30:25 - self.cleanup() build 12-Sep-2018 15:30:25 + self.removeInputMS() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 os.system('cp -RL '+datapath + self.vis +' '+ self.vis) build 12-Sep-2018 15:30:25 default(mstransform) build 12-Sep-2018 15:30:25 @@ -2612,12 +2884,20 @@ class test_polarization_reindex(test_base): build 12-Sep-2018 15:30:25 class test_antenna_reindexing(test_base): build 12-Sep-2018 15:30:25 '''Test to check proper reindex of subtables''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_CAS_7259() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - self.setUp_CAS_7259() build 12-Sep-2018 15:30:25 self.outvis = 'test_reindex_antenna_subtable.ms' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 + # all test cases are expected to generate the output MS from mstransform in outvis build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 os.system('rm -rf list.obs') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2709,19 +2989,20 @@ class test_alma_autocorr_selection_with_wvr(test_base): build 12-Sep-2018 15:30:25 class test_spectrum_transformations_mean(test_base): build 12-Sep-2018 15:30:25 '''Check that WEIGHT/SIGMA are equivalent to the mean of the unflagged WEIGHT_SPECTRUM samples''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = '' build 12-Sep-2018 15:30:25 self.outvis = '' build 12-Sep-2018 15:30:25 - self.auxvix = '' build 12-Sep-2018 15:30:25 - self.refvis = '' build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.auxvix) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.refvis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_chanavg_mean_corrected(self): build 12-Sep-2018 15:30:25 '''mstransform: Check that after chan avg WEIGHT/SIGMA is equivalent to the mean of the unflagged WEIGHT_SPECTRUM samples''' build 12-Sep-2018 15:30:25 @@ -3068,19 +3349,20 @@ class test_spectrum_transformations_mean(test_base): build 12-Sep-2018 15:30:25 class test_spectrum_transformations_median(test_base): build 12-Sep-2018 15:30:25 '''Check that WEIGHT/SIGMA are equivalent to the median of WEIGHT_SPECTRUM/SIGMA_SPECTRUM''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = '' build 12-Sep-2018 15:30:25 self.outvis = '' build 12-Sep-2018 15:30:25 - self.auxvix = '' build 12-Sep-2018 15:30:25 - self.refvis = '' build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.auxvix) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.refvis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_chanavg_median_corrected(self): build 12-Sep-2018 15:30:25 '''mstransform: Check that after chan avg WEIGHT/SIGMA is equivalent to the median of WEIGHT_SPECTRUM/SIGMA_SPECTRUM''' build 12-Sep-2018 15:30:25 @@ -3607,20 +3889,21 @@ class test_spectrum_transformations_median(test_base): build 12-Sep-2018 15:30:25 class test_spectrum_transformations_sigma_from_weight(test_base): build 12-Sep-2018 15:30:25 '''Check that WEIGHT/SIGMA and WEIGHT_SPECTRUM/SIGMA_SPECTRUM follow the relation sigma = 1 sqrt(weight) ''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = '' build 12-Sep-2018 15:30:25 self.outvis = '' build 12-Sep-2018 15:30:25 - self.auxvix = '' build 12-Sep-2018 15:30:25 - self.refvis = '' build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.auxvix) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.refvis) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def test_chanavg_sigma_from_weight_corrected(self): build 12-Sep-2018 15:30:25 '''mstransform: Check that after chan avg CORRECTED SIGMA=1/sqrt(WEIGHT)''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -3871,18 +4154,23 @@ class test_spectrum_transformations_sigma_from_weight(test_base): build 12-Sep-2018 15:30:25 class test_spectrum_transformations_2_steps_vs_1_step(test_base): build 12-Sep-2018 15:30:25 '''Check that the result of chan/time average applied in 1 step is the same as applied in 2 steps''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = '' build 12-Sep-2018 15:30:25 self.outvis = '' build 12-Sep-2018 15:30:25 - self.auxvix = '' build 12-Sep-2018 15:30:25 + self.auxvis = '' build 12-Sep-2018 15:30:25 self.refvis = '' build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.auxvix) build 12-Sep-2018 15:30:25 + os.system('rm -rf '+ self.auxvis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.refvis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_timeavg_chanavg_2_steps_vs_1_step_corrected(self): build 12-Sep-2018 15:30:25 @@ -4195,19 +4483,22 @@ class test_spectrum_transformations_2_steps_vs_1_step(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class test_spectrum_transformations_chanavg_useWeightSpectrum_false_vs_true(test_base): build 12-Sep-2018 15:30:25 '''Check that WEIGHT/SIGMA and WEIGHT_SPECTRUM/SIGMA_SPECTRUM follow the relation sigma = 1 sqrt(weight) ''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = '' build 12-Sep-2018 15:30:25 self.outvis = '' build 12-Sep-2018 15:30:25 - self.auxvix = '' build 12-Sep-2018 15:30:25 self.refvis = '' build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.auxvix) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.refvis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_chanavg_useWeightSpectrum_false_vs_true_corrected(self): build 12-Sep-2018 15:30:25 @@ -4322,18 +4613,23 @@ class test_spectrum_transformations_chanavg_useWeightSpectrum_false_vs_true(test build 12-Sep-2018 15:30:25 class test_spectrum_transformations_multiple_col(test_base): build 12-Sep-2018 15:30:25 '''Check the result of multiple column operation vs single column operation''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = '' build 12-Sep-2018 15:30:25 self.outvis = '' build 12-Sep-2018 15:30:25 - self.auxvix = '' build 12-Sep-2018 15:30:25 + self.auxvis = '' build 12-Sep-2018 15:30:25 self.refvis = '' build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.auxvix) build 12-Sep-2018 15:30:25 + os.system('rm -rf '+ self.auxvis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.refvis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_chanavg_all_vs_data_and_corrected(self): build 12-Sep-2018 15:30:25 @@ -4465,18 +4761,21 @@ class test_spectrum_transformations_multiple_col(test_base): build 12-Sep-2018 15:30:25 class test_spectrum_transformations_weight_zero_flag_set(test_base): build 12-Sep-2018 15:30:25 '''mstransform: Check that flags are set when the resulting weight is zero''' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = '' build 12-Sep-2018 15:30:25 self.outvis = '' build 12-Sep-2018 15:30:25 - self.auxvix = '' build 12-Sep-2018 15:30:25 self.refvis = '' build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.auxvix) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.refvis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_timeavg_weight_zero_flag_set_corrected(self): build 12-Sep-2018 15:30:25 @@ -4549,22 +4848,25 @@ class test_spectrum_transformations_weight_zero_flag_set(test_base): build 12-Sep-2018 15:30:25 indexFlagSet = flag == True build 12-Sep-2018 15:30:25 self.assertTrue((indexZeroSpectrum == indexFlagSet).all(), 'WEIGHT_SPECTRUM not consistent with FLAG cube') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 class test_spectrum_transformations_weight_constant(test_base): build 12-Sep-2018 15:30:25 '''mstransform: Check that the result of avg CORRECTED with constant WEIGHT''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = '' build 12-Sep-2018 15:30:25 self.outvis = '' build 12-Sep-2018 15:30:25 - self.auxvix = '' build 12-Sep-2018 15:30:25 self.refvis = '' build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.auxvix) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.refvis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_timeavg_corrected_vs_model_with_weight_constant(self): build 12-Sep-2018 15:30:25 @@ -4648,19 +4950,22 @@ class test_spectrum_transformations_weight_constant(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class test_spectrum_transformations_sigma_unit(test_base): build 12-Sep-2018 15:30:25 '''stransform: Check that the result of avg with sigma 1''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = '' build 12-Sep-2018 15:30:25 self.outvis = '' build 12-Sep-2018 15:30:25 - self.auxvix = '' build 12-Sep-2018 15:30:25 self.refvis = '' build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.auxvix) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.refvis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_timeavg_data_vs_model_with_sigma_unit(self): build 12-Sep-2018 15:30:25 @@ -4800,23 +5105,26 @@ class test_spectrum_transformations_sigma_unit(test_base): build 12-Sep-2018 15:30:25 weightSpectrumRef[3,:,:] = inputWeight[3,0]*weightSpectrumRef[3,:,:] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 self.assertTrue((numpy.abs(weightSpectrum-weightSpectrumRef) < 1E-4).all(), 'Weight Spectrum improperly generated') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 class test_spectrum_transformations_useWeightSpectrum_false_vs_true(test_base): build 12-Sep-2018 15:30:25 '''Check that WEIGHT/SIGMA are generated in the same way regardless of the useWeightSpectrum parameter ''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = '' build 12-Sep-2018 15:30:25 self.outvis = '' build 12-Sep-2018 15:30:25 - self.auxvix = '' build 12-Sep-2018 15:30:25 self.refvis = '' build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.auxvix) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.refvis) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_chanavg_useWeightSpectrum_false_vs_true_corrected (self): build 12-Sep-2018 15:30:25 @@ -5191,21 +5499,23 @@ class test_spectrum_transformations_useWeightSpectrum_false_vs_true(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 class test_spectrum_transformations_flagged_average(test_base): build 12-Sep-2018 15:30:25 '''Check that when all the samples are flagged the avg. and spectrum correspond to the avg./spectrum of all the flagged samples ''' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def setUpClass(cls): build 12-Sep-2018 15:30:25 + cls.setUp_4ants() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @classmethod build 12-Sep-2018 15:30:25 + def tearDownClass(cls): build 12-Sep-2018 15:30:25 + # Reuse self.vis for all tests in this class. It's input only build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + cls.vis) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.vis = '' build 12-Sep-2018 15:30:25 - self.outvis = '' build 12-Sep-2018 15:30:25 - self.auxvix = '' build 12-Sep-2018 15:30:25 self.refvis = '' build 12-Sep-2018 15:30:25 - self.setUp_4ants() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.vis) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.outvis) build 12-Sep-2018 15:30:25 - os.system('rm -rf '+ self.auxvix) build 12-Sep-2018 15:30:25 os.system('rm -rf '+ self.refvis) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 def test_chanavg_spectrum_transformations_flagged_average_corrected (self): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # Flag the entire MS build 12-Sep-2018 15:30:25 @@ -5710,7 +6020,6 @@ class test_no_reindexing_ephemeris_copy(test_base): build 12-Sep-2018 15:30:25 class test_splitUpdateFlagCmd(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - self.datapath = '.' build 12-Sep-2018 15:30:25 self.setUp_flags() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 @@ -5738,16 +6047,22 @@ class Cleanup(test_base): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_runTest(self): build 12-Sep-2018 15:30:25 '''mstransform: Cleanup''' build 12-Sep-2018 15:30:25 - pass build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def suite(): build 12-Sep-2018 15:30:25 return [ build 12-Sep-2018 15:30:25 test_Combspw1, build 12-Sep-2018 15:30:25 test_combinespws_diff_channels, build 12-Sep-2018 15:30:25 - test_Regridms1, build 12-Sep-2018 15:30:25 - test_Regridms3, build 12-Sep-2018 15:30:25 - test_Hanning, build 12-Sep-2018 15:30:25 + test_regridms_four_ants, build 12-Sep-2018 15:30:25 + test_regridms_jupiter, build 12-Sep-2018 15:30:25 + test_regridms_negative_width, build 12-Sep-2018 15:30:25 + test_regridms_interpolation_only, build 12-Sep-2018 15:30:25 + test_regridms_single_spw, build 12-Sep-2018 15:30:25 + test_regridms_multiple_spws, build 12-Sep-2018 15:30:25 + test_regridms_spw_with_different_number_of_channels, build 12-Sep-2018 15:30:25 + test_Hanning_with_g19, build 12-Sep-2018 15:30:25 + test_Hanning_with_ngc5921, build 12-Sep-2018 15:30:25 test_FreqAvg, build 12-Sep-2018 15:30:25 test_Shape, build 12-Sep-2018 15:30:25 test_Columns, build 12-Sep-2018 15:30:25 @@ -5758,11 +6073,8 @@ def suite(): build 12-Sep-2018 15:30:25 test_timeaverage, build 12-Sep-2018 15:30:25 test_timeaverage_limits, build 12-Sep-2018 15:30:25 test_multiple_transformations, build 12-Sep-2018 15:30:25 - test_regridms_single_spw, build 12-Sep-2018 15:30:25 - test_regridms_multiple_spws, build 12-Sep-2018 15:30:25 test_float_column, build 12-Sep-2018 15:30:25 test_spw_poln, build 12-Sep-2018 15:30:25 - test_regridms_spw_with_different_number_of_channels, build 12-Sep-2018 15:30:25 testFlags, build 12-Sep-2018 15:30:25 test_weight_spectrum_creation, build 12-Sep-2018 15:30:25 test_subtables_evla, build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_oldstatwt.py b/gcwrap/python/scripts/tests/test_oldstatwt.py build 12-Sep-2018 15:30:25 new file mode 100644 build 12-Sep-2018 15:30:25 index 0000000..434a442 build 12-Sep-2018 15:30:25 --- /dev/null build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_oldstatwt.py build 12-Sep-2018 15:30:25 @@ -0,0 +1,120 @@ build 12-Sep-2018 15:30:25 +import os build 12-Sep-2018 15:30:25 +import sys build 12-Sep-2018 15:30:25 +import shutil build 12-Sep-2018 15:30:25 +import commands build 12-Sep-2018 15:30:25 +import numpy build 12-Sep-2018 15:30:25 +import numpy.ma as ma build 12-Sep-2018 15:30:25 +import random build 12-Sep-2018 15:30:25 +from __main__ import default build 12-Sep-2018 15:30:25 +from tasks import * build 12-Sep-2018 15:30:25 +from taskinit import * build 12-Sep-2018 15:30:25 +from cleanhelper import * build 12-Sep-2018 15:30:25 +import unittest build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +''' build 12-Sep-2018 15:30:25 +Unit tests for oldstatwt build 12-Sep-2018 15:30:25 +''' build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# ToDo: build 12-Sep-2018 15:30:25 +# add more tests build 12-Sep-2018 15:30:25 +# once more independent tests (e.g. comparison build 12-Sep-2018 15:30:25 +# the AIPS REWAY results) add reference mses build 12-Sep-2018 15:30:25 +# and do tests against them build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +class oldstatwt_test(unittest.TestCase): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # Input and output names build 12-Sep-2018 15:30:25 + msfile = 'ngc5921.ms' build 12-Sep-2018 15:30:25 + res = False build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + if (os.path.exists(self.msfile)): build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + self.msfile) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + datapath=os.environ.get('CASAPATH').split()[0]+'/data/regression/unittest/visstat/' build 12-Sep-2018 15:30:25 + shutil.copytree(datapath+self.msfile, self.msfile) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + if (os.path.exists(self.msfile)): build 12-Sep-2018 15:30:25 + # os.system('rm -rf ' + self.msfile) build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def calcVariance(self,specData): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + calculate variance of a single row of complex vis data build 12-Sep-2018 15:30:25 + input: specData - numpy masked array build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + dev2 = 0.0 build 12-Sep-2018 15:30:25 + validSpecData=specData[~specData.mask] build 12-Sep-2018 15:30:25 + dmean = validSpecData.mean() build 12-Sep-2018 15:30:25 + nchan=len(validSpecData) build 12-Sep-2018 15:30:25 + for n in xrange(nchan): build 12-Sep-2018 15:30:25 + dev = validSpecData[n] - dmean build 12-Sep-2018 15:30:25 + # combine real and imag build 12-Sep-2018 15:30:25 + dev2 += (dev.real*dev.real + dev.imag*dev.imag) build 12-Sep-2018 15:30:25 + # use 2*nchan here because we used real and imag build 12-Sep-2018 15:30:25 + var = (1./(2*nchan-1))*dev2 build 12-Sep-2018 15:30:25 + return var.real build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def calcwt(self,selrow,selcorr,datcol,flagcol): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + calc weight,sigma from the data build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + dsel = datcol[selcorr] build 12-Sep-2018 15:30:25 + fsel = flagcol[selcorr] build 12-Sep-2018 15:30:25 + dsel = dsel.transpose() build 12-Sep-2018 15:30:25 + fsel = fsel.transpose() build 12-Sep-2018 15:30:25 + dspec = dsel[selrow] build 12-Sep-2018 15:30:25 + flagc = fsel[selrow] build 12-Sep-2018 15:30:25 + mdspec = ma.masked_array(dspec,flagc) build 12-Sep-2018 15:30:25 + dmean = mdspec.mean() build 12-Sep-2018 15:30:25 + var = self.calcVariance(mdspec) build 12-Sep-2018 15:30:25 + sig = numpy.sqrt(var) build 12-Sep-2018 15:30:25 + rms = numpy.sqrt(dmean*dmean.conjugate()+var) build 12-Sep-2018 15:30:25 + return (var,sig,rms) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_default(self): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + test default case build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + tol = 1.e-5 build 12-Sep-2018 15:30:25 + self.res=oldstatwt(vis=self.msfile) build 12-Sep-2018 15:30:25 + # need to have better checking.... build 12-Sep-2018 15:30:25 + self.assertTrue(self.res) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + tb.open(self.msfile) build 12-Sep-2018 15:30:25 + datc=tb.getcol('DATA') build 12-Sep-2018 15:30:25 + wt = tb.getcol('WEIGHT') build 12-Sep-2018 15:30:25 + sg = tb.getcol('SIGMA') build 12-Sep-2018 15:30:25 + fg = tb.getcol('FLAG') build 12-Sep-2018 15:30:25 + nr = tb.nrows() build 12-Sep-2018 15:30:25 + tb.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # Compare 10 randomly selected rows of weight and build 12-Sep-2018 15:30:25 + # sigma columns with calculated statistics from the data build 12-Sep-2018 15:30:25 + #random.seed() build 12-Sep-2018 15:30:25 + #randomRowList=random.sample(xrange(nr),10) build 12-Sep-2018 15:30:25 + #for i in random.sample(xrange(nr),10): build 12-Sep-2018 15:30:25 + # icorr = random.randint(0,1) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # do it for all rows! build 12-Sep-2018 15:30:25 + for i in xrange(nr): build 12-Sep-2018 15:30:25 + icorr = 0 build 12-Sep-2018 15:30:25 + (v,s,r) = self.calcwt(i,icorr,datc,fg) build 12-Sep-2018 15:30:25 + if v!=0: build 12-Sep-2018 15:30:25 + diffwt = 1/v - wt[icorr][i] build 12-Sep-2018 15:30:25 + diffsg = s - sg[icorr][i] build 12-Sep-2018 15:30:25 + #print "w=",1/v, " wt[",icorr,"][",i,"]=",wt[icorr][i] build 12-Sep-2018 15:30:25 + #print "diffwt=",diffwt," diffwt/w=",abs(diffwt)*1/v build 12-Sep-2018 15:30:25 + self.assertTrue(abs(diffwt)/(1/v) < tol) build 12-Sep-2018 15:30:25 + self.assertTrue(abs(diffsg)/s < tol) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +def suite(): build 12-Sep-2018 15:30:25 + return [oldstatwt_test] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +if __name__ == '__main__': build 12-Sep-2018 15:30:25 + testSuite = [] build 12-Sep-2018 15:30:25 + for testClass in suite(): build 12-Sep-2018 15:30:25 + testSuite.append(unittest.makeSuite(testClass,'test')) build 12-Sep-2018 15:30:25 + allTests = unittest.TestSuite(testSuite) build 12-Sep-2018 15:30:25 + unittest.TextTestRunner(verbosity=2).run(allTests) build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_refimager.py b/gcwrap/python/scripts/tests/test_refimager.py build 12-Sep-2018 15:30:25 index b76a8cf..0c0ca52 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_refimager.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_refimager.py build 12-Sep-2018 15:30:25 @@ -1,2487 +1,2684 @@ build 12-Sep-2018 15:30:25 -########################################################################## build 12-Sep-2018 15:30:25 -########################################################################## build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# Test programs for the refactored imager : test_refimager build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# Each of the following categories (classes) has a set of tests within it. build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# test_onefield # basic tests, deconvolution algorithms build 12-Sep-2018 15:30:25 -# test_iterbot # iteration control options for mfs and cube build 12-Sep-2018 15:30:25 -# test_multifield # multiple fields of same type and with different shapes/deconvolvers/gridders build 12-Sep-2018 15:30:25 -# test_stokes # multiple stokes planes, imaging with flagged correlations.. build 12-Sep-2018 15:30:25 -# test_cube # all things cube. Spectral frame setup, handling empty channels, etc build 12-Sep-2018 15:30:25 -# test_widefield # facets, wprojection, imagemosaic, mosaicft, awproject build 12-Sep-2018 15:30:25 -# test_mask # input mask options : regridding, mask file, automasking, etc build 12-Sep-2018 15:30:25 -# test_modelvis # saving models (column/otf), using starting models, predict-only (setjy) build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# To run from within casapy : build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# runUnitTest.main(['test_refimager']) # Run all tests build 12-Sep-2018 15:30:25 -# runUnitTest.main(['test_refimager[test_onefield]']) # Run tests from test_onefield build 12-Sep-2018 15:30:25 -# runUnitTest.main(['test_refimager[test_onefield_mtmfs]']) # Run one specific test build 12-Sep-2018 15:30:25 -# runUnitTest.main(['test_refimager[test_onefield_mtmfs,test_onefield_hogbom]']) # Multiple specific tests build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# To see the full list of tests : grep "\"\"\" \[" test_refimager.py build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# These tests need data stored in data/regression/unittest/clean/refimager build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# For a developer build, to get the datasets locally build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# --- Get the basic data repo : svn co https://svn.cv.nrao.edu/svn/casa-data/distro data build 12-Sep-2018 15:30:25 -# --- Make directories : mkdir -p data/regression/unittest/clean; cd data/regression/unittest/clean build 12-Sep-2018 15:30:25 -# --- Get test datasets : svn co https://svn.cv.nrao.edu/svn/casa-data/trunk/regression/unittest/clean/refimager build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -########################################################################## build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# Datasets build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# refim_twochan.ms : 2 channels, one 1Jy point source with spectral index of -1.0 build 12-Sep-2018 15:30:25 -# refim_twopoints_twochan.ms : Two point sources, 1Jy and 5Jy, both with spectral index -1.0. For multifield tests. build 12-Sep-2018 15:30:25 -# refim_point.ms : 1-2 GHz, 20 channels, 1 spw, one 1Jy point source with spectral index -1.0. build 12-Sep-2018 15:30:25 -# refim_point_withline.ms : refim_point with a 'line' added into 3 channels (just topo) build 12-Sep-2018 15:30:25 -# refim_mawproject.ms : Two pointing wideband mosaic with 1 point source in between the two pointings build 12-Sep-2018 15:30:25 -# refim_mawproject_offcenter.ms : Two pointing wideband mosaic with 1 point source at center of one pointing build 12-Sep-2018 15:30:25 -# refim_point_stokes.ms : RR=1.0, LL=0.8, RL and LR are zero. Stokes I=0.9, V=0.1, U,Q=0.0 build 12-Sep-2018 15:30:25 -# refim_point_linRL.ms : I=1, Q=2, U=3, V=4 in circular pol basis. build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -########################################################################## build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -import sys build 12-Sep-2018 15:30:25 -import shutil build 12-Sep-2018 15:30:25 -import commands build 12-Sep-2018 15:30:25 -import numpy build 12-Sep-2018 15:30:25 -from __main__ import default build 12-Sep-2018 15:30:25 -from tasks import * build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 -import unittest build 12-Sep-2018 15:30:25 -import inspect build 12-Sep-2018 15:30:25 -import numpy as np build 12-Sep-2018 15:30:25 -from parallel.parallel_task_helper import ParallelTaskHelper build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -_ia = iatool( ) build 12-Sep-2018 15:30:25 -_vp = vptool( ) build 12-Sep-2018 15:30:25 -_cb = cbtool( ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -from imagerhelpers.test_imager_helper import TestHelpers build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -## List to be run build 12-Sep-2018 15:30:25 -def suite(): build 12-Sep-2018 15:30:25 - return [test_onefield, test_iterbot, test_multifield,test_stokes, test_modelvis, test_cube, test_mask, test_startmodel,test_widefield,test_pbcor] build 12-Sep-2018 15:30:25 -# return [test_onefield, test_iterbot, test_multifield,test_stokes,test_cube, test_widefield,test_mask, test_modelvis,test_startmodel,test_widefield_failing] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -refdatapath = os.environ.get('CASAPATH').split()[0] + '/data/regression/unittest/clean/refimager/' build 12-Sep-2018 15:30:25 -#refdatapath = "/export/home/riya/rurvashi/Work/ImagerRefactor/Runs/UnitData/" build 12-Sep-2018 15:30:25 -#refdatapath = "/home/vega/rurvashi/TestCASA/ImagerRefactor/Runs/WFtests/" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -## Base Test class with Utility functions build 12-Sep-2018 15:30:25 -class testref_base(unittest.TestCase): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp(self): build 12-Sep-2018 15:30:25 - self.epsilon = 0.05 build 12-Sep-2018 15:30:25 - self.msfile = "" build 12-Sep-2018 15:30:25 - self.img = "tst" build 12-Sep-2018 15:30:25 - # To use subdir in the output image names in some tests (CAS-10937) build 12-Sep-2018 15:30:25 - self.img_subdir = 'refimager_tst_subdir' build 12-Sep-2018 15:30:25 - self.parallel = False build 12-Sep-2018 15:30:25 - if ParallelTaskHelper.isMPIEnabled(): build 12-Sep-2018 15:30:25 - self.parallel = True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.th = TestHelpers() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def tearDown(self): build 12-Sep-2018 15:30:25 - """ don't delete it all """ build 12-Sep-2018 15:30:25 -# self.delData() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Separate functions here, for special-case tests that need their own MS. build 12-Sep-2018 15:30:25 - def prepData(self,msname=""): build 12-Sep-2018 15:30:25 - os.system('rm -rf ' + self.img_subdir) build 12-Sep-2018 15:30:25 - os.system('rm -rf ' + self.img+'*') build 12-Sep-2018 15:30:25 - if msname != "": build 12-Sep-2018 15:30:25 - self.msfile=msname build 12-Sep-2018 15:30:25 - if (os.path.exists(self.msfile)): build 12-Sep-2018 15:30:25 - os.system('rm -rf ' + self.msfile) build 12-Sep-2018 15:30:25 - shutil.copytree(refdatapath+self.msfile, self.msfile) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def delData(self,msname=""): build 12-Sep-2018 15:30:25 - if msname != "": build 12-Sep-2018 15:30:25 - self.msfile=msname build 12-Sep-2018 15:30:25 - if (os.path.exists(self.msfile)): build 12-Sep-2018 15:30:25 - os.system('rm -rf ' + self.msfile) build 12-Sep-2018 15:30:25 - os.system('rm -rf ' + self.img_subdir) build 12-Sep-2018 15:30:25 - os.system('rm -rf ' + self.img+'*') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def checkfinal(self,pstr=""): build 12-Sep-2018 15:30:25 - #pstr += "["+inspect.stack()[1][3]+"] : To re-run this test : casa -c `echo $CASAPATH | awk '{print $1}'`/gcwrap/python/scripts/regressions/admin/runUnitTest.py test_refimager["+ inspect.stack()[1][3] +"]" build 12-Sep-2018 15:30:25 - pstr += "["+inspect.stack()[1][3]+"] : To re-run this test : runUnitTest.main(['test_refimager["+ inspect.stack()[1][3] +"]'])" build 12-Sep-2018 15:30:25 - casalog.post(pstr,'INFO') build 12-Sep-2018 15:30:25 - if( pstr.count("(Fail") > 0 ): build 12-Sep-2018 15:30:25 - self.fail("\n"+pstr) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -##Task level tests : one field, 2chan. build 12-Sep-2018 15:30:25 -class test_onefield(testref_base): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_defaults(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Onefield_defaults : Defaults """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image'], imval=[(self.img+'.psf', 1.0, [50,50,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_clark(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Onefield_clark : mfs with clark minor cycle """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='clark',interactive=0,parallel=self.parallel) #,phasecenter='J2000 19h59m57.5s +40d49m00.077s') # default is clark build 12-Sep-2018 15:30:25 - #off center#ret = tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='8.0arcsec',niter=1000,interactive=0,phasecenter='J2000 19h59m57.5s +40d49m00.077s') # default is clark build 12-Sep-2018 15:30:25 - #compare with clean#clean(vis=self.msfile,imagename=self.img+'.old',imsize=200,cell='8.0arcsec',niter=1000,psfmode='clark',phasecenter='J2000 19h59m57.5s +40d49m00.077s') # default is clark build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=0.392, modflux=0.732, iterdone=10, imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image',self.img+'.model'], imval=[(self.img+'.psf',1.0,[50,50,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_hogbom(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Onefield_hogbom : mfs with hogbom minor cycle """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,parallel=self.parallel)#,phasecenter='J2000 19h59m57.5s +40d49m00.077s') build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=0.35, modflux=0.77, iterdone=10, imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image',self.img+'.model'], imval=[(self.img+'.psf',1.0,[50,50,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_mem(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Onefield_mem : mfs with mem minor cycle """ build 12-Sep-2018 15:30:25 - self.prepData('refim_eptwochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='8.0arcsec',niter=10,deconvolver='mem',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=12.7, modflux=6.98, iterdone=10, imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image',self.img+'.model'], imval=[(self.img+'.psf',1.0,[100,100,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_multiscale(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Onefield_multiscale : mfs with multiscale minor cycle """ build 12-Sep-2018 15:30:25 - self.prepData('refim_eptwochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='8.0arcsec',niter=10,deconvolver='multiscale',scales=[0,20,40,100],interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=1.28, modflux=2.87, iterdone=10, imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image',self.img+'.model'], imval=[(self.img+'.psf',1.0,[100,100,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_mtmfs(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Onefield_mtmfs : mt-mfs with minor cycle iterations """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=0.392, modflux=0.732, iterdone=10, imexist=[self.img+'.psf.tt0', self.img+'.residual.tt0', self.img+'.image.tt0', self.img+'.model.tt0',self.img+'.model.tt1',self.img+'.alpha'], imval=[(self.img+'.psf.tt0',1.0,[50,50,0,0]),(self.img+'.psf.tt1',1.039e-05,[50,50,0,0])]) build 12-Sep-2018 15:30:25 - ## iterdone=11 only because of the return (iterdone_p+1) in MultiTermMatrixCleaner::mtclean() ! build 12-Sep-2018 15:30:25 - self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_autonames(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Onefield_autonames : Test auto increment of image names """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',restart=False,parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',restart=False,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.psf',self.img+'_2.psf',self.img+'_3.psf'] ) build 12-Sep-2018 15:30:25 - self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_twoMS(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Onefield_twoMS : One field, two input MSs """ build 12-Sep-2018 15:30:25 - ms1 = 'refim_point_onespw0.ms' build 12-Sep-2018 15:30:25 - ms2 = 'refim_point_onespw1.ms' build 12-Sep-2018 15:30:25 - self.prepData(ms1) build 12-Sep-2018 15:30:25 - self.prepData(ms2) build 12-Sep-2018 15:30:25 -# try: build 12-Sep-2018 15:30:25 -# ## This run should fail with an exception build 12-Sep-2018 15:30:25 -# ret = tclean(vis=[ms1,ms2],field='0',spw=['0','0'], imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='hogbom',niter=10) build 12-Sep-2018 15:30:25 -# correct=False build 12-Sep-2018 15:30:25 -# except Exception as e: build 12-Sep-2018 15:30:25 -# correct=True build 12-Sep-2018 15:30:25 -# self.assertTrue(correct) build 12-Sep-2018 15:30:25 - ## This run should go smoothly. build 12-Sep-2018 15:30:25 - ret = tclean(vis=[ms1,ms2],field='0',spw=['0','0'], imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='hogbom',niter=10,datacolumn='data',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.psf',self.img+'.residual']) build 12-Sep-2018 15:30:25 - self.delData(ms1) build 12-Sep-2018 15:30:25 - self.delData(ms2) build 12-Sep-2018 15:30:25 - self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_twoMS_diffcolumns(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Onefield_twoMS_diffcolumns : One field, two input MSs, one with data and one with data and corrected """ build 12-Sep-2018 15:30:25 - ms1 = 'refim_point_onespw0.ms' build 12-Sep-2018 15:30:25 - ms2 = 'refim_point_onespw1.ms' build 12-Sep-2018 15:30:25 - self.prepData(ms1) build 12-Sep-2018 15:30:25 - self.prepData(ms2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Make corrected_data column for one of them build 12-Sep-2018 15:30:25 - _cb.open(ms2) build 12-Sep-2018 15:30:25 - _cb.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ret = tclean(vis=[ms1,ms2],field='0',spw=['0','0'], imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='hogbom',niter=10,datacolumn='corrected',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.psf',self.img+'.residual']) build 12-Sep-2018 15:30:25 - self.delData(ms1) build 12-Sep-2018 15:30:25 - self.delData(ms2) build 12-Sep-2018 15:30:25 - self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_restart_mfs(self): build 12-Sep-2018 15:30:25 - """ [onefield] : test_onefield_restart_mfs : Check calcpsf,calcres and ability to restart and continue""" build 12-Sep-2018 15:30:25 - ## TODO : Need to add and use info in the return record, when only a major cycle is done. Then check nmajorcycle. build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Only psf build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,calcpsf=True,calcres=False,deconvolver='clark',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.psf'], imexistnot=[self.img+'.residual', self.img+'.image'],nmajordone=1) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Only residual build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,calcpsf=False,calcres=True,deconvolver='clark',restoration=False,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report1=self.th.checkall(imexist=[self.img+'.psf', self.img+'.residual'], imexistnot=[self.img+'.image'],nmajordone=1) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Start directly with minor cycle and do only the last major cycle. build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,interactive=0,calcpsf=False,calcres=False,deconvolver='clark',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report2=self.th.checkall(ret=ret, peakres=0.392, modflux=0.732, imexist=[self.img+'.psf',self.img+'.residual', self.img+'.image'],nmajordone=1) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Re-start from existing model image and continue on... build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,interactive=0,calcpsf=False,calcres=False,deconvolver='clark',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report3=self.th.checkall(ret=ret, peakres=0.161, modflux=0.991, imexist=[self.img+'.psf',self.img+'.residual', self.img+'.image'],nmajordone=1) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(pstr=report+report1+report2+report3) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_restart_mtmfs(self): build 12-Sep-2018 15:30:25 - """ [onefield] : test_onefield_restart_mtmfs : Check calcpsf,calcres and ability to restart and continue""" build 12-Sep-2018 15:30:25 - ## TODO : Need to add and use info in the return record, when only a major cycle is done. Then check nmajorcycle. build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Only psf build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,calcpsf=True,calcres=False,deconvolver='mtmfs',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.psf.tt0', self.img+'.psf.tt1'], imexistnot=[self.img+'.residual.tt0', self.img+'.image.tt0'],nmajordone=1) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Only residual build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,calcpsf=False,calcres=True,deconvolver='mtmfs',restoration=False,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report1=self.th.checkall(imexist=[self.img+'.psf.tt0',self.img+'.psf.tt1', self.img+'.residual.tt0', self.img+'.residual.tt1'], imexistnot=[self.img+'.image.tt0'],nmajordone=1) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Start directly with minor cycle and do only the last major cycle. build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,interactive=0,calcpsf=False,calcres=False,deconvolver='mtmfs',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report2=self.th.checkall(ret=ret, peakres=0.392, modflux=0.732, imexist=[self.img+'.psf.tt1',self.img+'.residual.tt1', self.img+'.image.tt1', self.img+'.alpha'],nmajordone=1,imval=[(self.img+'.alpha',-1.0,[50,50,0,0])]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Re-start from existing model image and continue on... build 12-Sep-2018 15:30:25 - ## ( If restart from modified residuals... the alpha is -1.25xx which is wrong. build 12-Sep-2018 15:30:25 - ## In this case, need to do calcres=True which will do extra first major cycle (nmajor=2) ) build 12-Sep-2018 15:30:25 - ## But... current code (as of r33373) makes appropriate restored image but does not mess up residuals. build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,interactive=0,calcpsf=False,calcres=False,deconvolver='mtmfs',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report3=self.th.checkall(ret=ret, peakres=0.136, modflux=0.988, imexist=[self.img+'.psf.tt1',self.img+'.residual.tt1', self.img+'.image.tt1', self.img+'.alpha'],nmajordone=1,imval=[(self.img+'.alpha',-1.0,[50,50,0,0])]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ### Calcres=True and restart (to test CAS-10337) build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,interactive=0,calcpsf=False,calcres=True,deconvolver='mtmfs',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report4=self.th.checkall(ret=ret, peakres=0.0477, modflux=1.077, imexist=[self.img+'.psf.tt1',self.img+'.residual.tt1', self.img+'.image.tt1', self.img+'.alpha'],nmajordone=2,imval=[(self.img+'.alpha',-1.0,[50,50,0,0])]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(pstr=report+report1+report2+report3+report4) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_all_outputs_mfs(self): build 12-Sep-2018 15:30:25 - """ [onefield] : test_onefield_all_outputs_mfs : Make all output images even when not needed """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Make only partial outputs build 12-Sep-2018 15:30:25 -# ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='hogbom') build 12-Sep-2018 15:30:25 -# report1=self.th.checkall(imexist=[self.img+'.psf', self.img+'.residual'],imexistnot=[self.img+'.image',self.img+'.model'],nmajordone=1) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Make all outputs build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='hogbom',restoration=True,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report2=self.th.checkall(imexist=[self.img+'2.psf', self.img+'2.residual',self.img+'2.image',self.img+'2.model'],nmajordone=1) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(pstr = report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_all_outputs_mtmfs(self): build 12-Sep-2018 15:30:25 - """ [onefield] : test_onefield_all_outputs_mtmfs : Make all output images even when not needed """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Make only partial outputs build 12-Sep-2018 15:30:25 -# ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='mtmfs') build 12-Sep-2018 15:30:25 -# report1=self.th.checkall(imexist=[self.img+'.psf.tt0', self.img+'.psf.tt1'],imexistnot=[self.img+'.image.tt0',self.img+'.model.tt0', self.img+'.alpha'],nmajordone=1) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Make all outputs build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='mtmfs',restoration=True,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report2=self.th.checkall(imexist=[self.img+'2.psf.tt0', self.img+'2.psf.tt1',self.img+'2.image.tt0',self.img+'2.model.tt0', self.img+'2.alpha'],nmajordone=1) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(pstr=report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_restore_mtmfs_niter0(self): build 12-Sep-2018 15:30:25 - """ [onefield] : test_onefield_restore_mtmfs_niter0 : Niter=0 run followed by restoration without a model""" build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## This test also checks the principal solution calculation on the dirty images. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## niter=0 run build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='mtmfs',restoration=False,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report1=self.th.checkall(imexist=[self.img+'.psf.tt0', self.img+'.psf.tt1'], imexistnot=[self.img+'.model.tt0', self.img+'.model.tt0'],nmajordone=1) build 12-Sep-2018 15:30:25 - ## restore only build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='mtmfs',calcres=False,calcpsf=False,restoration=True,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report2=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.alpha'],nmajordone=0, build 12-Sep-2018 15:30:25 - imval=[(self.img+'.alpha',-1.0,[50,50,0,0])]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## niter=0 and restore ( in one step ) build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='mtmfs',restoration=True,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report3=self.th.checkall(imexist=[self.img+'2.image.tt0', self.img+'2.alpha'],nmajordone=1, build 12-Sep-2018 15:30:25 - imval=[(self.img+'.alpha',-1.0,[50,50,0,0])] ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(pstr=report1+report2+report3) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_rectangular_pixels(self): build 12-Sep-2018 15:30:25 - """ [onefield] : test_onefield_rectangular_pixels : Test restoration with rectangular pixels (cas-7171)""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell=['10.0arcsec','30.0arcsec'],niter=10,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'], imval=[(self.img+'.image',0.482,[50,49,0,0])] ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_onefield_mtmfs_2spws_2MSs(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_onefield_mtmfs_2spws_2MSs : MT-MFS on multi-spws in separate MSs, to test default reffreq and coordinate system generation (CAS-9518) """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ms1 = 'refim_point_onespw0.ms' build 12-Sep-2018 15:30:25 - ms2 = 'refim_point_onespw1.ms' build 12-Sep-2018 15:30:25 - self.prepData(ms1) build 12-Sep-2018 15:30:25 - self.prepData(ms2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ret = tclean(vis=[ms1,ms2],imagename=self.img,imsize=100,cell='8.0arcsec', build 12-Sep-2018 15:30:25 - interactive=0,niter=10,deconvolver='mtmfs',parallel=self.parallel) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - checkims = [self.img+'.psf.tt0', self.img+'.residual.tt0', self.img+'.image.tt0',self.img+'.model.tt0'] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## For parallel run, check sub workdirectory images also. build 12-Sep-2018 15:30:25 - if self.parallel==True: build 12-Sep-2018 15:30:25 - checkims = checkims + self.th.getNParts( imprefix=self.img, build 12-Sep-2018 15:30:25 - imexts=['residual.tt0','residual.tt1', build 12-Sep-2018 15:30:25 - 'psf.tt0','psf.tt1', build 12-Sep-2018 15:30:25 - 'model.tt0','model.tt1']) build 12-Sep-2018 15:30:25 - report = self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 - peakres=0.409, modflux=0.764, iterdone=10, nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=checkims, build 12-Sep-2018 15:30:25 - imval=[(self.img+'.alpha',-2.0,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.sumwt.tt0', 94050.05,[0,0,0,0]) , build 12-Sep-2018 15:30:25 - (self.img+'.sumwt.tt1', 0.006198,[0,0,0,0]) ], build 12-Sep-2018 15:30:25 - reffreq= [(self.img+'.image.tt0',1489984775.68)] ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -##Task level tests : iteration controls build 12-Sep-2018 15:30:25 -class test_iterbot(testref_base): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_mfs_1(self): build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_Mfs_1 : Zero Iterations """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=0,interactive=0,restoration=False,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.psf', self.img+'.residual'], imexistnot=[self.img+'.image']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_mfs_2(self): build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_Mfs_2 : Iterations with low gain """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=10,gain=0.1,interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=0.392, modflux=0.732, iterdone=10,nmajordone=2,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_mfs_3(self): build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_Mfs_3 : Cycleniter test """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=10,cycleniter=3,interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=0.392, modflux=0.732, iterdone=10, nmajordone=5,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_mfs_4(self): build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_Mfs_4 : Iterations with high gain """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=10, gain=0.5,interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=0.024, modflux=1.274, iterdone=10, nmajordone=3,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_mfs_5(self): build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_Mfs_5 : Threshold test """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=10,threshold='0.1Jy',gain=0.5,interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=0.0924, modflux=1.129, iterdone=5, nmajordone=3,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_mfs_6(self): build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_Mfs_6 : Cycleniter and threshold """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=10, cycleniter=3, threshold='0.1Jy',gain=0.5,interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=0.0924, modflux=1.129, iterdone=5, nmajordone=3,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_mfs_7(self): build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_Mfs_7 : Threshold + cyclefactor to trigger major cycles earlier """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=10,threshold='0.01Jy', gain=0.5,cyclefactor=10.0,interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=0.024, modflux=1.274, iterdone=10, nmajordone=9,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_mfs_8(self): build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_Mfs_8 : minpsffraction to trigger major cycles earlier. """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=20,threshold='0.01Jy', minpsffraction = 0.5,interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=0.16127, modflux=0.9919, iterdone=20, nmajordone=4,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_mfs_9(self): build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_Mfs_9 : maxpsffraction """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=20,threshold='0.01Jy', minpsffraction=0.8,maxpsffraction=0.5,interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=0.16127, modflux=0.9919, iterdone=20, nmajordone=4,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_cube_1(self): build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_cube_1 : iteration counting across channels (>niter) """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',deconvolver='clark',niter=10,threshold='0.75Jy',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, iterdone=90,nmajordone=2,imexist=[self.img+'.psf', self.img+'.residual']) build 12-Sep-2018 15:30:25 - ## Only chans 6 and 7 reach cycleniter, others reach threshold in fewer than 10 iters per chan. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_cube_2(self): build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_cube_2 : High threshold, iterate only on line channels. """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',deconvolver='clark',niter=10,threshold='1.75Jy',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, peakres=1.73, modflux=0.407,iterdone=12,nmajordone=2,imexist=[self.img+'.psf', self.img+'.residual']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_cube_3(self): # test for returned summary/plot for no iteration case build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_cube_3 : Very high threshold, no iteration (verification of CAS-8576 fix) """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',deconvolver='clark',niter=10,threshold='3.5Jy',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret,iterdone=0,nmajordone=1,imexist=[self.img+'.psf', self.img+'.residual']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_cube_4(self): build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_cube_4 : Large niter, and low threshold - catch if diverges (verification of CAS-8584 fix) """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',deconvolver='hogbom',niter=1000000,threshold='0.0000001Jy',gain=0.5,interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret,iterdone=1749,nmajordone=8,imexist=[self.img+'.psf', self.img+'.residual']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_divergence(self): build 12-Sep-2018 15:30:25 - """ [iterbot] Test_Iterbot_divergence : Use negative loop gain to make it diverge (verification of CAS-9244 fix) """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec', niter=50,cycleniter=5, gain=-0.2,interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret,iterdone=10,nmajordone=3,imexist=[self.img+'.psf', self.img+'.image']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_iterbot_mfs_deconvolvers(self): build 12-Sep-2018 15:30:25 - """ [iterbot] : test_iterbot_deconvolvers : Do all minor cycle algorithms respond in the same way to iteration controls ? No ! """ build 12-Sep-2018 15:30:25 - # clark and hogbom reach niter first, but multiscale gets to cyclethreshold first. Check peakres and iterdone. build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,threshold='0.1Jy', interactive=0,deconvolver='clark',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report1=self.th.checkall(ret=ret1, peakres=0.3922, modflux=0.732, iterdone=10, nmajordone=2,imexist=[self.img+'1.psf', self.img+'1.residual', self.img+'1.image']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,threshold='0.1Jy', interactive=0,deconvolver='hogbom',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report2=self.th.checkall(ret=ret2, peakres=0.3530, modflux=0.7719, iterdone=10, nmajordone=2,imexist=[self.img+'2.psf', self.img+'2.residual', self.img+'2.image']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ret3 = tclean(vis=self.msfile,imagename=self.img+'3',imsize=100,cell='8.0arcsec',niter=10,threshold='0.1Jy', interactive=0,deconvolver='multiscale',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report3=self.th.checkall(ret=ret3, peakres=0.3922, modflux=0.7327, iterdone=10, nmajordone=2,imexist=[self.img+'3.psf', self.img+'3.residual', self.img+'3.image']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report1+report2+report3) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -##Task level tests : multi-field, 2chan. build 12-Sep-2018 15:30:25 -### For some of these tests, do the same with uvsub and compare ? build 12-Sep-2018 15:30:25 -class test_multifield(testref_base): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_multifield_both_mfs(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_Multifield_both_mfs : Two fields, both mfs """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nnchan=1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nusemask=user\nmask=circle[[40pix,40pix],10pix]') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 - iterdone=13, build 12-Sep-2018 15:30:25 - nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+'.image',1.075,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.image',5.590,[40,40,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.residual',0.04,[30,18,0,0])]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_multifield_both_mtmfs(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_Multifield_both_mtmfs : Two fields, both mt-mfs """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\n\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nusemask=user\nmask=circle[[40pix,40pix],10pix]') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='mtmfs',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 - iterdone=12, build 12-Sep-2018 15:30:25 - nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.image.tt0', self.img+'1.image.tt0',self.img+'.image.tt1', self.img+'1.image.tt1', self.img+'.alpha', self.img+'1.alpha'], build 12-Sep-2018 15:30:25 - imval=[(self.img+'.image.tt0',1.094,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.image.tt0',5.577,[40,40,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.alpha',-0.90,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.alpha',-1.0,[40,40,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_multifield_both_cube(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_Multifield_both_cube : Two fields, both cube""" build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - #self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\n') build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nimagename='+self.img+'2\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:48.895 +40.55.58.543\n') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0,specmode='cube',nchan=2,interpolation='nearest',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 - iterdone=42, build 12-Sep-2018 15:30:25 - nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+'.image',1.434,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.image',7.44,[40,40,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'2.image',7.42,[51,40,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.image',0.758,[50,50,0,1]), build 12-Sep-2018 15:30:25 - (self.img+'1.image',3.715,[40,40,0,1]), build 12-Sep-2018 15:30:25 - (self.img+'2.image',3.675,[51,40,0,1]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_multifield_both_cube_diffshape(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_Multifield_both_cube : Two fields, both cube but different nchans""" build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nnchan=3\n') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0,specmode='cube',nchan=2,interpolation='nearest',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 - iterdone=22, build 12-Sep-2018 15:30:25 - nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+'.image',1.434,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.image',7.44,[40,40,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.image',0.762,[50,50,0,1]), build 12-Sep-2018 15:30:25 - (self.img+'1.image',3.70,[40,40,0,1]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_multifield_cube_mfs(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_Multifield_cube_mfs : Two fields, one cube and one mfs""" build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nspecmode=mfs\n') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0,specmode='cube',nchan=2,interpolation='nearest',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 - iterdone=15, build 12-Sep-2018 15:30:25 - nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+'.image',1.4,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.image',5.6,[40,40,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.image',0.75,[50,50,0,1])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_multifield_mfs_mtmfs(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_Multifield_mfs_mtmfs : Two fields, one mt-mfs and one mfs (i.e. different deconvolvers)""" build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nreffreq=1.5GHz\ndeconvolver=mtmfs\n') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 - iterdone=13, build 12-Sep-2018 15:30:25 - nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.image', self.img+'1.image.tt0',self.img+'1.alpha'], build 12-Sep-2018 15:30:25 - imval=[(self.img+'.image',1.094,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.image.tt0',5.57,[40,40,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.alpha', -1.0, [40,40,0,0]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_multifield_cube_mtmfs(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_Multifield_cube_mtmfs : Two fields, one cube and one mtmfs""" build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nreffreq=1.5GHz\ndeconvolver=mtmfs\nspecmode=mfs\n') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0,specmode='cube',nchan=2,interpolation='nearest',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 - iterdone=15, # two chans in one field, and one chan in the other build 12-Sep-2018 15:30:25 - nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.image', self.img+'1.image.tt0',self.img+'1.alpha'], build 12-Sep-2018 15:30:25 - imval=[(self.img+'.image',1.427,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.image.tt0',5.575,[40,40,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.image',0.762,[50,50,0,1]) , build 12-Sep-2018 15:30:25 - (self.img+'1.alpha', -1.0, [40,40,0,0]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_multifield_diff_gridders(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_Multifield_diff_gridders : Two fields, both mfs, gridft and wproject """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 -# ##Outlier uses gridft build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nusemask=user\nmask=circle[[40pix,40pix],10pix]\ngridder=gridft') build 12-Sep-2018 15:30:25 -# ## Outlier uses wproject but with different number of planes as the main field build 12-Sep-2018 15:30:25 -# self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nmask=circle[[40pix,40pix],10pix]\ngridder=wproject\nwprojplanes=6') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',gridder='wproject',wprojplanes=4,interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 - iterdone=13, build 12-Sep-2018 15:30:25 - nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+'.image',1.075,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.image',5.58,[40,40,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_multifield_autonames(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_Multifield_4 : Test auto increment of image names """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nnchan=1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nusemask=user\nmask=circle[[40pix,40pix],10pix]') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',outlierfile=self.img+'.out.txt',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',outlierfile=self.img+'.out.txt',restart=False,parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',restart=False) # no outlier... build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',outlierfile=self.img+'.out.txt',restart=False,parallel=self.parallel) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.psf',self.img+'1.psf',self.img+'_2.psf',self.img+'1_2.psf',self.img+'_3.psf',self.img+'_4.psf',self.img+'1_4.psf'], imexistnot=[self.img+'1_3.psf'] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -### TODO : Either put a check so that if any fields overlap, an error is thrown. Or, do sensible model choosing for some modes but detect and complain for other modes where it's harder to pick which model image to use. build 12-Sep-2018 15:30:25 - def test_multifield_overlap_mfs(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_Multifield_overlap_mfs : Two overlapping image fields, both mfs """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[200,200]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:59:02.426 +40.51.14.559') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:58:39.580 +40.55.55.931",outlierfile=self.img+'.out.txt',niter=20,deconvolver='hogbom',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 - iterdone=40, ## both images see the brightest source. build 12-Sep-2018 15:30:25 - nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+'.image',5.575,[48,51,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.image',5.574,[130,136,0,0])]) ## both images have correct flux (not twice or zero !) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_multifield_overlap_mtmfs(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_Multifield_overlap_mtmfs : Two overlapping image fields, both mt-mfs """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[200,200]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:59:02.426 +40.51.14.559\n') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:58:39.580 +40.55.55.931",outlierfile=self.img+'.out.txt',niter=20,deconvolver='mtmfs',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 - iterdone=39, ## both images see the brightest source. build 12-Sep-2018 15:30:25 - nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.image.tt0', self.img+'1.image.tt0'], build 12-Sep-2018 15:30:25 - imval=[(self.img+'.image.tt0',5.52,[48,51,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.image.tt0',5.53,[130,136,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.alpha',-0.965,[48,51,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.alpha',-0.965,[130,136,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_multifield_facets_mfs(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_Multifield_mfs_facets : Facetted imaging (mfs) """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='8.0arcsec',phasecenter="J2000 19:59:00.2 +40.50.15.50",facets=2,deconvolver='hogbom',niter=30,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf'],imval=[(self.img+'.psf',1.0,[100,100,0,0]),(self.img+'.image',5.56,[127,143,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_multifield_facets_mtmfs(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_facets_mtmfs : Facetted imaging (mt-mfs) """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='8.0arcsec',phasecenter="J2000 19:59:00.2 +40.50.15.50",facets=2,deconvolver='mtmfs',niter=30,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.psf.tt0', self.img+'.alpha'],imval=[(self.img+'.psf.tt0',1.0,[100,100,0,0]),(self.img+'.image.tt0',5.56,[127,143,0,0]),(self.img+'.alpha',-1.0,[127,143,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# def test_multifield_cube_chunks(self): build 12-Sep-2018 15:30:25 -# """ [multifield] Test_Multifield_cube_chunks : Two fields, two sections of the same cube""" build 12-Sep-2018 15:30:25 -# self.prepData("refim_point.ms") build 12-Sep-2018 15:30:25 -# self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nnchan=5\nstart=5') build 12-Sep-2018 15:30:25 -# ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='10.0arcsec',specmode='cube',nchan=5,start=0,outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0,interpolation='nearest') build 12-Sep-2018 15:30:25 -# report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 -# iterdone=38, build 12-Sep-2018 15:30:25 -# nmajordone=2, build 12-Sep-2018 15:30:25 -# imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 -# imval=[(self.img+'.image',1.434,[50,50,0,0]), build 12-Sep-2018 15:30:25 -# (self.img+'1.image',7.452,[40,40,0,0]), build 12-Sep-2018 15:30:25 -# (self.img+'.image',0.762,[50,50,0,1]), build 12-Sep-2018 15:30:25 -# (self.img+'1.image',3.702,[40,40,0,1]) ]) build 12-Sep-2018 15:30:25 -# self.checkfinal(report) build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -##Task level tests : Stokes imaging options build 12-Sep-2018 15:30:25 -class test_stokes(testref_base): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_mfs_I(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_I_mfs mfs with stokes I""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='I',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_mfs_IV(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_mfs_IV : mfs with stokes IV""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IV',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,0]),(self.img+'.image',4.0,[50,50,1,0]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_mfs_QU(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_mfs_QU : mfs with stokes QU""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='QU',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',2.0,[50,50,0,0]),(self.img+'.image',3.0,[50,50,1,0]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_mfs_Q(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_mfs_Q : mfs with stokes Q""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='Q',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',2.0,[50,50,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_mfs_U(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_mfs_U : mfs with stokes U""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='U',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',3.0,[50,50,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_mfs_V(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_mfs_V : mfs with stokes V""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='V',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',4.0,[50,50,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_cube_I(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_cube_I : cube with stokes I""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='I',interactive=0,specmode='cube',interpolation='nearest',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,0]),(self.img+'.image',1.0,[50,50,0,1]),(self.img+'.image',1.0,[50,50,0,2]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_cube_IV(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_stokes_IV : cube with stokes V""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IV',interactive=0,specmode='cube',interpolation='nearest',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,0]),(self.img+'.image',1.0,[50,50,0,1]),(self.img+'.image',1.0,[50,50,0,2]), (self.img+'.image',4.0,[50,50,1,0]),(self.img+'.image',4.0,[50,50,1,1]),(self.img+'.image',4.0,[50,50,1,2])] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_cube_QU(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_stokes_QU : cube with stokes QU""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='QU',interactive=0,specmode='cube',interpolation='nearest',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',2.0,[50,50,0,0]),(self.img+'.image',2.0,[50,50,0,1]),(self.img+'.image',2.0,[50,50,0,2]), (self.img+'.image',3.0,[50,50,1,0]),(self.img+'.image',3.0,[50,50,1,1]),(self.img+'.image',3.0,[50,50,1,2])] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_cube_Q(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_cube_Q : cube with stokes Q""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='Q',interactive=0,specmode='cube',interpolation='nearest',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',2.0,[50,50,0,0]),(self.img+'.image',2.0,[50,50,0,1]) ,(self.img+'.image',2.0,[50,50,0,2]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_cube_U(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_cube_U : cube with stokes U""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='U',interactive=0,specmode='cube',interpolation='nearest',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',3.0,[50,50,0,0]),(self.img+'.image',3.0,[50,50,0,1]) ,(self.img+'.image',3.0,[50,50,0,2]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_cube_V(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_cube_V : cube with stokes V""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='V',interactive=0,specmode='cube',interpolation='nearest',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',4.0,[50,50,0,0]),(self.img+'.image',4.0,[50,50,0,1]) ,(self.img+'.image',4.0,[50,50,0,2]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_cube_IQUV_fromRL(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_cube_IQUV_fromRL : cube with stokes IQUV""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IQUV',interactive=0,specmode='cube',interpolation='nearest',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,1]),(self.img+'.image',2.0,[50,50,1,1]), (self.img+'.image',3.0,[50,50,2,1]),(self.img+'.image',4.0,[50,50,3,1]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_cube_IQUV_fromXY(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_cube_IQUV_fromXY : cube with stokes IQUV""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linXY.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IQUV',interactive=0,specmode='cube',interpolation='nearest',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,1]),(self.img+'.image',2.0,[50,50,1,1]), (self.img+'.image',3.0,[50,50,2,1]),(self.img+'.image',4.0,[50,50,3,1]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_mtmfs_Q(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_mtmfs_Q : mtmfs with stokes Q""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='Q',deconvolver='mtmfs',nterms=2,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image.tt0'], imexistnot=[self.img+'.image.alpha'], imval=[(self.img+'.image.tt0',2.0,[50,50,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_stokes_mtmfs_IQUV(self): build 12-Sep-2018 15:30:25 - """ [onefield] Test_Stokes_mtmfs_IQUV : mtmfs with stokes IQUV""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IQUV',deconvolver='mtmfs',nterms=2,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image.tt0'],imexistnot=[self.img+'.image.alpha'], imval=[(self.img+'.image.tt0',1.0,[50,50,0,0]),(self.img+'.image.tt0',2.0,[50,50,1,0]), (self.img+'.image.tt0',3.0,[50,50,2,0]),(self.img+'.image.tt0',4.0,[50,50,3,0]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# def test_stokes_cube_I_flags(self): build 12-Sep-2018 15:30:25 -# """ [onefield] Test_Stokes_cube_I_flags : cube with stokes I and only XY or YX flagged""" build 12-Sep-2018 15:30:25 -# self.prepData('refim_point_linXY.ms') build 12-Sep-2018 15:30:25 -# ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IQUV',interactive=0,specmode='cube') build 12-Sep-2018 15:30:25 -# report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,1]),(self.img+'.image',2.0,[50,50,1,1]), (self.img+'.image',3.0,[50,50,2,1]),(self.img+'.image',4.0,[50,50,4,1]) ]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# def test_stokes_cube_pseudo_I_flags(self): build 12-Sep-2018 15:30:25 -# """ [onefield] Test_Stokes_cube_pseudo_I_flags : cube with stokes I and one of XX or YY flagged""" build 12-Sep-2018 15:30:25 -# self.prepData('refim_point_linXY.ms') build 12-Sep-2018 15:30:25 -# ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IQUV',interactive=0,specmode='cube') build 12-Sep-2018 15:30:25 -# report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,1]),(self.img+'.image',2.0,[50,50,1,1]), (self.img+'.image',3.0,[50,50,2,1]),(self.img+'.image',4.0,[50,50,4,1]) ]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -##Task level tests : cube. build 12-Sep-2018 15:30:25 -class test_cube(testref_base): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# def __init__(self,methodName='runTest'): build 12-Sep-2018 15:30:25 -# testref_base.__init__(self,methodName) build 12-Sep-2018 15:30:25 -# self.test_cube_0.__func__.__doc__ %="aaaa" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp(self): build 12-Sep-2018 15:30:25 - super(test_cube, self).setUp() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Setup some variables to use in all the tests build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## chan 4 (TOPO) build 12-Sep-2018 15:30:25 - qfstart=qa.quantity("1.2GHz") build 12-Sep-2018 15:30:25 - #qvstart=qa.quantity("-59958.5km/s") build 12-Sep-2018 15:30:25 - # for restf=1.25GHz build 12-Sep-2018 15:30:25 - qvstart=qa.quantity("11991.7km/s") build 12-Sep-2018 15:30:25 - # ch10 build 12-Sep-2018 15:30:25 - #qvstart=qa.quantity("16788.4km/s") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #mfstart=me.frequency('LSRK',qa.quantity("1.09999GHz")) build 12-Sep-2018 15:30:25 - # ch4 (for rest 1.25GHz) build 12-Sep-2018 15:30:25 - mfstart=me.frequency('LSRK',qa.quantity("1.199989GHz")) build 12-Sep-2018 15:30:25 - mvstart=me.radialvelocity('BARY',qa.quantity("11977.6km/s")) build 12-Sep-2018 15:30:25 - #dop = me.todoppler('radio',mfstart,qa.quantity('1.0GHz')) build 12-Sep-2018 15:30:25 - mfstart10=me.frequency('LSRK',qa.quantity(" 1.17999GHz")) build 12-Sep-2018 15:30:25 - # doppler with ch4 freq build 12-Sep-2018 15:30:25 - dop = me.todoppler('radio',mfstart,qa.quantity('1.25GHz')) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #1chan width build 12-Sep-2018 15:30:25 - #qvwidth = qa.quantity("11991.700km/s") build 12-Sep-2018 15:30:25 - #qvwidth = qa.quantity("4796.7km/s") build 12-Sep-2018 15:30:25 - qvwidth = qa.quantity("11991.7km/s") build 12-Sep-2018 15:30:25 - mvwidth = me.radialvelocity('TOPO',qvwidth) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # restf = 1.25GHz build 12-Sep-2018 15:30:25 - # vel range: 59961.1 - -31174.7 km/s (lsrk/radio) build 12-Sep-2018 15:30:25 - # 74952.3 - -28238.3 km/s (lsrk/optical) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.testList = { build 12-Sep-2018 15:30:25 - 0:{'imagename':'Cubetest_chandefstdefwidth','spw':'0','start':0,'width':1,'outframe':'LSRK','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'channel, default start and width, LSRK'}, build 12-Sep-2018 15:30:25 - 1:{'imagename':'Cubetest_chandefstdefwidthtopo','spw':'0','start':0,'width':1, 'outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'channel, default start and width, TOPO'}, build 12-Sep-2018 15:30:25 - 2:{'imagename':'Cubetest_chandefstwidth2','spw':'0','start':0,'width':2, 'outframe':'LSRK','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'channel, default start, width=2, LSRK'}, build 12-Sep-2018 15:30:25 - 3:{'imagename':'Cubetest_chanst5wd1','spw':'0','start':5,'width':1, 'outframe':'LSRK','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'channel, start=5, default width, LSRK'}, build 12-Sep-2018 15:30:25 - # this will result in blank channnel images (calcChanFreqs requires start and width in channel build 12-Sep-2018 15:30:25 - # mode to be given in chan index build 12-Sep-2018 15:30:25 - 4:{'imagename':'Cubetest_chandefstwd1spwsel','spw':'0:5~19','start':0,'width':1, 'outframe':'LSRK','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'channel, spw=0:5~19, LSRK'}, build 12-Sep-2018 15:30:25 - #5:{'imagename':'Cubetest_freqdefstwd2','spw':'0','start':'','width':'40MHz','outframe':'TOPO', build 12-Sep-2018 15:30:25 - # 'desc':'frequency, default start, width=\'40MHz\', TOPO'}, build 12-Sep-2018 15:30:25 - # data set changed! build 12-Sep-2018 15:30:25 - 5:{'imagename':'Cubetest_freqdefstwd2','spw':'0','start':'','width':'100MHz','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'frequency, default start, width=\'100MHz\'(2 x chanwidth), TOPO'}, build 12-Sep-2018 15:30:25 - 6:{'imagename':'Cubetest_freqst2defwd','spw':'0','start':'1.1GHz','width':'','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'frequency, start=\'1.1GHz\', default width, TOPO'}, build 12-Sep-2018 15:30:25 - 7:{'imagename':'Cubetest_freqst2defwdspwsel','spw':'0:4~19','start':'1.1GHz','width':'','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'frequency, start=\'1.1GHz\', default width, spw=0:4~19, TOPO'}, build 12-Sep-2018 15:30:25 - 8:{'imagename':'Cubetest_freqst10wdm','spw':'0','start':'1.5GHz','width':'-50MHz','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'frequency, start=\'1.5GHz\', width=\'-50MHz\', TOPO'}, build 12-Sep-2018 15:30:25 - 9:{'imagename':'Cubetest_veldefstwd2','spw':'0','start':'','width':'23983.4km/s','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'frequency, default start, width=\'23983.4km/s\', TOPO'}, build 12-Sep-2018 15:30:25 - 10:{'imagename':'Cubetest_veldefstwd2m','spw':'0','start':'','width':'-23983.4km/s','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'velocity, default start, width=\'-23983.4m/s\', TOPO'}, build 12-Sep-2018 15:30:25 - 11:{'imagename':'Cubetest_velst4defwd','spw':'0','start':'11991.7km/s','width':'','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'velocity, start=\'11991.7km/s\', default width, TOPO'}, build 12-Sep-2018 15:30:25 - 12:{'imagename':'Cubetest_velst4defwdbary','spw':'0','start':'11977.6km/s','width':'','outframe':'BARY','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'velocity, start=\'11977.6km/s\', default width, BARY'}, build 12-Sep-2018 15:30:25 - # currently 13 is not quite properly working, investigating - 2014.08.27 TT build 12-Sep-2018 15:30:25 - # for refim_point.ms ch9=-41347.8km/s (opt) build 12-Sep-2018 15:30:25 - #13:{'imagename':'Cubetest_optvelst10wdeflsrk','spw':'0','start':'-49962.6km/s','width':'', build 12-Sep-2018 15:30:25 - 13:{'imagename':'Cubetest_optvelst19wdlsrk','spw':'0','start':'-41347.8km/s','width':'20000km/s', build 12-Sep-2018 15:30:25 - 'veltype':'optical','outframe':'LSRK', build 12-Sep-2018 15:30:25 - ## 'desc':'velocity, start=\'74952.3km/s\', default width, veltype=optical LSRK'}, build 12-Sep-2018 15:30:25 - # 'desc':'velocity, start=\'-49962.6km/s\', default width, veltype=optical LSRK'}, build 12-Sep-2018 15:30:25 - 'desc':'velocity, start=\'-41347.5km/s\', default width , veltype=optical LSRK'}, build 12-Sep-2018 15:30:25 - 14:{'imagename':'Cubetest_stqfreqdefwd','spw':'0','start':qfstart,'width':'', 'veltype':'radio','outframe':'', build 12-Sep-2018 15:30:25 - 'desc':'frequency, start(quanity)=%s, default width, veltype=radio LSRK' % qfstart}, build 12-Sep-2018 15:30:25 - 15:{'imagename':'Cubetest_stmfreqdefwd','spw':'0','start':mfstart,'width':'', 'veltype':'radio','outframe':'', build 12-Sep-2018 15:30:25 - 'desc':'frequency, start=%s, default width, veltype=radio LSRK' % mfstart}, build 12-Sep-2018 15:30:25 - 16:{'imagename':'Cubetest_stqveldefwd','spw':'0','start':qvstart,'width':'','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'velocity(quantity), start=%s, default width, TOPO ' % qvstart}, build 12-Sep-2018 15:30:25 - 17:{'imagename':'Cubetest_stmveldefwd','spw':'0','start':mvstart,'width':'','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'velocity(measure), start=%s, default width(outframe=TOPO will be overridden)' % mvstart}, build 12-Sep-2018 15:30:25 - 18:{'imagename':'Cubetest_veldefstqvwidth','spw':'0','start':'','width':qvwidth,'outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'velocity, default start, width(quantity)=%s' % qvwidth}, build 12-Sep-2018 15:30:25 - 19:{'imagename':'Cubetest_veldefstmvwidth','spw':'0','start':'','width':mvwidth,'outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'velocity, default start, width(measure)=%s, TOPO' % mvwidth}, build 12-Sep-2018 15:30:25 - 20:{'imagename':'Cubetest_stdopdefwd','spw':'0','start':dop,'width':'','outframe':'LSRK','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'doppler, start=%s, default width, LSRK' % dop}, build 12-Sep-2018 15:30:25 - # with a gap in spw channel sel build 12-Sep-2018 15:30:25 - 21:{'imagename':'Cubetest_st4gap','spw':'0:4~9;12~14','start':4,'width':'','outframe':'LSRK','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'channel, start=%s, default width, channel gap (10-11) LSRK' % 4}, build 12-Sep-2018 15:30:25 - # stride > 1 build 12-Sep-2018 15:30:25 - 22:{'imagename':'Cubetest_st4stride2','spw':'0:0~10^2','start':0,'width':'','outframe':'LSRK','veltype':'radio', 'interpolation':'nearest', build 12-Sep-2018 15:30:25 - 'desc':'channel, start=%s, default width, step=2 LSRK nearest' % 0}, build 12-Sep-2018 15:30:25 - 23:{'imagename':'Cubetest_defstspwchansel4','spw':'0:4~13','start':'','width':'','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 - 'desc':'spw with channel selection( 0:4~13 ), default start, LSRK nearest'} build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# self.test_cube_0.__func__.__doc__ %=self.testList[0]['desc'] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def run_cubetclean(self, testid): build 12-Sep-2018 15:30:25 - """ core function to execute a cube tclean """ build 12-Sep-2018 15:30:25 - if self.testList[testid].has_key('interpolation'): build 12-Sep-2018 15:30:25 - interpolation = self.testList[testid]['interpolation'] build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - interpolation = 'linear' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw=self.testList[testid]['spw'],\ build 12-Sep-2018 15:30:25 - imagename=self.img+self.testList[testid]['imagename'],\ build 12-Sep-2018 15:30:25 - start=self.testList[testid]['start'],\ build 12-Sep-2018 15:30:25 - width=self.testList[testid]['width'],\ build 12-Sep-2018 15:30:25 - veltype=self.testList[testid]['veltype'],\ build 12-Sep-2018 15:30:25 - outframe=self.testList[testid]['outframe'], \ build 12-Sep-2018 15:30:25 - interpolation=interpolation,parallel=self.parallel) build 12-Sep-2018 15:30:25 - return ret build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_0(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_0 new """ build 12-Sep-2018 15:30:25 - testid=0 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50002, build 12-Sep-2018 15:30:25 - [50,50,0,0])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',999988750) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_1(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_1 """ build 12-Sep-2018 15:30:25 - testid=1 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50002, build 12-Sep-2018 15:30:25 - [50,50,0,0])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO', 9.9999999e8) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_2(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_2 """ build 12-Sep-2018 15:30:25 - testid=2 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.4643, build 12-Sep-2018 15:30:25 - [50,50,0,0])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.02498846e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_3(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_3 """ build 12-Sep-2018 15:30:25 - # start = 5 (1.25GHZ IN TOPO) build 12-Sep-2018 15:30:25 - testid=3 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.2000, build 12-Sep-2018 15:30:25 - [50,50,0,0])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.249985937e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_4(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_4 """ build 12-Sep-2018 15:30:25 - testid=4 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - # NEED CHECK!!! build 12-Sep-2018 15:30:25 - #report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - #imval=[(self.img+self.testList[testid]['imagename']+'.image',1.5000, build 12-Sep-2018 15:30:25 - #[50,50,0,0])]) build 12-Sep-2018 15:30:25 - #report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.23998593e9) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_5(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_5 """ build 12-Sep-2018 15:30:25 - # width by freq (2x chanw) result should be the same as #2 build 12-Sep-2018 15:30:25 - testid=5 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.4643, build 12-Sep-2018 15:30:25 - [50,50,0,0])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.025e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_6(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_6 """ build 12-Sep-2018 15:30:25 - # start in freq=1.1GHz (=chan5) build 12-Sep-2018 15:30:25 - testid=6 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.36365354, build 12-Sep-2018 15:30:25 - [50,50,0,0])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.1e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_7(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_7 """ build 12-Sep-2018 15:30:25 - # start 1.1GHz(TOPO)=chan5 spw=4~19 build 12-Sep-2018 15:30:25 - ##as of 03/23/2017 it is not.... chan2 = 1.1e9 (in refim_point.ms) build 12-Sep-2018 15:30:25 - testid=7 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',0.0, build 12-Sep-2018 15:30:25 - [50,50,0,0]),(self.img+self.testList[testid]['imagename']+'.image',1.2000, build 12-Sep-2018 15:30:25 - [50,50,0,3])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.1e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_8(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_8 """ build 12-Sep-2018 15:30:25 - # start =1.5GHz(chan10) width=-50MHz TOPO (descending freq) build 12-Sep-2018 15:30:25 - testid=8 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.42858946, build 12-Sep-2018 15:30:25 - [50,50,0,9])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.5e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_9(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_9 """ build 12-Sep-2018 15:30:25 - # width in vel (=23983.4km/s=2xChanW) def start (=cube will be ascending order in vel) build 12-Sep-2018 15:30:25 - testid=9 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.46184647, build 12-Sep-2018 15:30:25 - [50,50,0,9])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.925e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_10(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_10 """ build 12-Sep-2018 15:30:25 - # width in vel = -23983.4m/s def start (cube will be in descending order in vel) build 12-Sep-2018 15:30:25 - testid=10 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.46184647, build 12-Sep-2018 15:30:25 - [50,50,0,0])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.025e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_11(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_11 """ build 12-Sep-2018 15:30:25 - # start 11991.7km/s (chan4) build 12-Sep-2018 15:30:25 - testid=11 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001776, build 12-Sep-2018 15:30:25 - [50,50,0,4])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.2e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_12(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_12 """ build 12-Sep-2018 15:30:25 - # start 11977.6km/s (BARY) = chan4 build 12-Sep-2018 15:30:25 - testid=12 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001931, build 12-Sep-2018 15:30:25 - [50,50,0,4])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','BARY',1.200058783e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_13(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_13 """ build 12-Sep-2018 15:30:25 - # build 12-Sep-2018 15:30:25 - testid=13 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - # use own tclean command as nchan need to modify build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,specmode='cube',nchan=8,restfreq=['1.25GHz'], build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',spw=self.testList[testid]['spw'], build 12-Sep-2018 15:30:25 - imagename=self.img+self.testList[testid]['imagename'],start=self.testList[testid]['start'], build 12-Sep-2018 15:30:25 - width=self.testList[testid]['width'],veltype=self.testList[testid]['veltype'], build 12-Sep-2018 15:30:25 - outframe=self.testList[testid]['outframe'],parallel=self.parallel) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - #report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - #imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001931, build 12-Sep-2018 15:30:25 - #[50,50,0,4])]) build 12-Sep-2018 15:30:25 - #report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.2000e9) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_14(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_14 """ build 12-Sep-2018 15:30:25 - # start = quantity ('1.2GHz') frame default(LSRK) build 12-Sep-2018 15:30:25 - testid=14 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.25000215, build 12-Sep-2018 15:30:25 - [50,50,0,0])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.2e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_15(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_15 """ build 12-Sep-2018 15:30:25 - # measure freq in LSRK ch4 build 12-Sep-2018 15:30:25 - testid=15 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image', 1.25001216, build 12-Sep-2018 15:30:25 - [50,50,0,0])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.199989e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_16(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_16 """ build 12-Sep-2018 15:30:25 - # start quantity vel=11991.7km/s outframe=topo (ascending vel order) build 12-Sep-2018 15:30:25 - testid=16 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001776, build 12-Sep-2018 15:30:25 - [50,50,0,4])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.2000e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_17(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_17 """ build 12-Sep-2018 15:30:25 - # start measure vel=11977.6km/s BARY, outframe=TOPO will be overridedden (ascending vel order) build 12-Sep-2018 15:30:25 - testid=17 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001931, build 12-Sep-2018 15:30:25 - [50,50,0,4])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','BARY',1.200058783e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_18(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_18 """ build 12-Sep-2018 15:30:25 - # defaut start, width in vel (quantity) +11991.7km/s (TOPO, radio)=datachan width, will be build 12-Sep-2018 15:30:25 - # ascending order in vel so highet DATA channel will be chan 0 in the image (image chan0=1.45GHz) build 12-Sep-2018 15:30:25 - testid=18 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001764, build 12-Sep-2018 15:30:25 - [50,50,0,9])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.45e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_19(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_19 """ build 12-Sep-2018 15:30:25 - # default start, width in vel (measure) +11991.7km/s (TOPO, radio) build 12-Sep-2018 15:30:25 - testid=19 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001764, build 12-Sep-2018 15:30:25 - [50,50,0,9])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.45e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_20(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_20 """ build 12-Sep-2018 15:30:25 - # doppler (with ch4 LSRK freq, rest freq=1.25GHz) build 12-Sep-2018 15:30:25 - testid=20 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.5000546, build 12-Sep-2018 15:30:25 - [50,50,0,4])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.199989152e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_21(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_21 """ build 12-Sep-2018 15:30:25 - # data sel with channel gap (10,11 excluded) 4~9, 12~14 build 12-Sep-2018 15:30:25 - testid=21 build 12-Sep-2018 15:30:25 - self.testList[testid]['interpolation']='nearest' build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.250001562, [50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+self.testList[testid]['imagename']+'.image',0.0, [50,50,0,6]), build 12-Sep-2018 15:30:25 - (self.img+self.testList[testid]['imagename']+'.image',0.0, [50,50,0,7])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.199986500e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_22(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_22 """ build 12-Sep-2018 15:30:25 - # stride (step=2) use nearest interpolation (other interpotion methods build 12-Sep-2018 15:30:25 - # may not work well...) build 12-Sep-2018 15:30:25 - testid=22 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.5000546, build 12-Sep-2018 15:30:25 - [50,50,0,0])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',0.999988750387e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_23(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_23 """ build 12-Sep-2018 15:30:25 - testid=23 build 12-Sep-2018 15:30:25 - print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+self.testList[testid]['imagename']+'.image',1.2500156, build 12-Sep-2018 15:30:25 - [50,50,0,0])]) build 12-Sep-2018 15:30:25 - report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.20e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # following tests for cube image spectral channel order for the data with decreasing channel frequecies build 12-Sep-2018 15:30:25 - def test_cube_descendF1(self): build 12-Sep-2018 15:30:25 - # default start and width build 12-Sep-2018 15:30:25 - # first image channel = first data channel, image channel frequecy descreases with increasing channel number build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF1: specmode cube with descending frequency data, default start and width """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image','LSRK',1.949978e9, -0.049999438e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_descendF2(self): build 12-Sep-2018 15:30:25 - # first image channel = data channel 5, image channel frequecy descreases with increasing channel number build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF2: specmode cube with descending frequency data, start in channel no. with default width """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', start=5, width='', imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image','LSRK',1.699981e9,-0.049999438e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_descendF3(self): build 12-Sep-2018 15:30:25 - # cube image should be identical with test_cube_descendF2 build 12-Sep-2018 15:30:25 - # first image channel = data channel 5, width=1, ->image channel frequecy descreases with increasing channel number build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF3: specmode cube with descending frequency data, start in channel no. with width=1 """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', start=5, width=1, imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image','LSRK',1.699981e9,-0.049999438e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_descendF4(self): build 12-Sep-2018 15:30:25 - # start in channel no., width=-1 build 12-Sep-2018 15:30:25 - # first image channel = data channel 9, -> channel frequecy increases with increasing image channel number build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF4: specmode cube with descending frequency data, start in freuquency with default width """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', start=9, width=-1, imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image','LSRK', 1.499983125e9,0.049999438e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_descendF5(self): build 12-Sep-2018 15:30:25 - # start in frequency, default width build 12-Sep-2018 15:30:25 - # first image channel = data channel 9, -> channel frequecy increases with increasing channel number build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF5: specmode cube with descending frequency data, start in freuquency with default width """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', start='1.499983125GHz', width='', imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image','LSRK',1.499983125e9,0.049999438e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_descendF6(self): build 12-Sep-2018 15:30:25 - # start in frequency, positive width build 12-Sep-2018 15:30:25 - # first image channel = data channel 9, -> channel frequecy increases with increasing channel number build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF6: specmode cube with descending frequency data, start in freuquency with a positive width """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', start='1.499983125GHz', width='0.049999438GHz', imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image','LSRK',1.499983125e9,0.049999438e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_descendF7(self): build 12-Sep-2018 15:30:25 - # start in frequency, negative width build 12-Sep-2018 15:30:25 - # first image channel = data channel 5, -> channel frequecy decreases with increasing channel number build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF7: specmode cube with descending frequency data, start in freuquency with a negative width """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', start='1.699981GHz', width='-0.049999438GHz', imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image','LSRK',1.699981e9,-0.049999438e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_descendF8(self): build 12-Sep-2018 15:30:25 - # start='', a positive frequency width build 12-Sep-2018 15:30:25 - # the data channel 0 - 9 will be selected, but since width >0 for the ms, image channel order will be reversed w.r.t data channel order build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF8: specmode cube with descending frequency data, width in a positive freuquency with default start """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', start='', width='0.049999438GHz', imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image', 'LSRK', 0.999989e9, 0.049999438e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_descendF9(self): build 12-Sep-2018 15:30:25 - # start='', a netative frequency width build 12-Sep-2018 15:30:25 - # the data channel 0 - 9 will be selected, but since width <0 for the ms, image channel order will be the same order as data channel build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF9: specmode cube with descending frequency data, width in a positive freuquency with default start """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', start='', width='-0.049999438GHz', imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image', 'LSRK', 1.44998369263e9, -0.049999438e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_descendF10(self): build 12-Sep-2018 15:30:25 - # start in velocity , width='' build 12-Sep-2018 15:30:25 - # first image channel = data channel 5, -> channel velocity increases with increasing channel number build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF10: specmode cube with descendign frequency data, start in velocity with defualt width """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', start='-107920.698km/s', width='', imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image', 'LSRK', 1.699980875e9, -0.049999438e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_descendF11(self): build 12-Sep-2018 15:30:25 - # start in velocity , a positive vel width build 12-Sep-2018 15:30:25 - # first image channel = data channel 5, -> channel velocity increases with increasing channel number build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF11: specmode cube with descendign frequency data, start in velocity with defualt width """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', start='-107920.698km/s', width='1.1991563418e4km/s', imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image', 'LSRK', 1.699980875e9, -0.049999438e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_descendF12(self): build 12-Sep-2018 15:30:25 - # start in velocity , a negative vel width build 12-Sep-2018 15:30:25 - # first image channel = data channel 9, -> channel velocity decreases with increasing channel number build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF12: specmode cube with descendign frequency data, start in velocity with defualt width """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', start='-59954.444km/s', width='-1.1991563418e4km/s', imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image', 'LSRK', 1.49998312558e9, 0.049999438e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_descendF13(self): build 12-Sep-2018 15:30:25 - # width in a positive velocity, default start build 12-Sep-2018 15:30:25 - # the data channel 10-19 (lower side in vel) will be selected, since vel width >0, image channel order will be reversed order w.r.t data channel order build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF13: specmode cube with descendign frequency data, start in velocity with defualt width """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', start='', width='1.1991563418e4km/s', imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image', 'LSRK', 1.449983688e9, -0.0499994375194e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_descendF14(self): build 12-Sep-2018 15:30:25 - # width in a negative velocity, default start build 12-Sep-2018 15:30:25 - # the data channel 10-19 (lower side in vel) will be selected, since vel width <0, image channel order will the same order w.r.t data channel order build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_DescendF14: specmode cube with descendign frequency data, start in velocity with defualt width """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 - specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 - phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 - spw='0', start='', width='-1.1991563418e4km/s', imagename=self.img,veltype='radio',outframe='LSRK',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report = self.th.checkspecframe(self.img+'.image', 'LSRK', 0.999988750387e9, 0.049999438e9) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_D1(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_D1 : specmode cubedata - No runtime doppler corrections """ build 12-Sep-2018 15:30:25 - self.prepData('refim_Cband.G37line.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='1',spw='0:105~135',specmode='cubedata',nchan=30,start=105,width=1,veltype='radio', build 12-Sep-2018 15:30:25 - imagename=self.img,imsize=256,cell='0.01arcmin',phasecenter=1,deconvolver='hogbom',niter=10,parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',86.254,[128,128,0,18])]) build 12-Sep-2018 15:30:25 - ## line is smoother build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_D2(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_D2 : specmode cube - WITH doppler corrections """ build 12-Sep-2018 15:30:25 - self.prepData('refim_Cband.G37line.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='1',spw='0:105~135',specmode='cube',nchan=30,start=105,width=1,veltype='radio', build 12-Sep-2018 15:30:25 - imagename=self.img,imsize=256,cell='0.01arcmin',phasecenter=1,deconvolver='hogbom',niter=10,parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.residual') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',92.1789,[128,128,0,20])]) build 12-Sep-2018 15:30:25 - ## line is tighter build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# def test_cube_D3(self): build 12-Sep-2018 15:30:25 -# """ EMPTY : [cube] Test_Cube_D3 : specmode cubesrc - Doppler correct to a SOURCE ephemeris""" build 12-Sep-2018 15:30:25 -# ret = tclean(vis=self.msfile,field='1',spw='0:105~135',specmode='cubesrc',nchan=30,start=105,width=1,veltype='radio',imagename=self.img,imsize=256,cell='0.01arcmin',phasecenter=1,deconvolver='hogbom',niter=10) build 12-Sep-2018 15:30:25 -# self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.residual') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_continuum_subtract_uvsub(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_Cube_continuum_subtract : Using uvsub """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='reset0') build 12-Sep-2018 15:30:25 - plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='data',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.step0data.png',title="original data") build 12-Sep-2018 15:30:25 - plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='model',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.step0model.png',title="empty model") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Let's include a subdir in the output image name. This could cause failures, at build 12-Sep-2018 15:30:25 - # least in parallel mode (CAS-10937). build 12-Sep-2018 15:30:25 - imagename = os.path.join(self.img_subdir, self.img) build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=imagename,imsize=100,cell='8.0arcsec', spw='0:12~19',niter=50,gain=0.2,savemodel='modelcolumn', build 12-Sep-2018 15:30:25 - deconvolver='mtmfs',parallel=self.parallel) build 12-Sep-2018 15:30:25 -# self.assertTrue(self.th.exists(self.img+'.model') ) build 12-Sep-2018 15:30:25 -# self.assertTrue( self.th.checkmodelchan(self.msfile,10) == 0.0 and self.th.checkmodelchan(self.msfile,3) > 0.0 ) build 12-Sep-2018 15:30:25 - plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='model',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.step1.png',title="model after partial mtmfs on some channels") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='reset0') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',startmodel=[self.img+'.model.tt0',self.img+'.model.tt1'], build 12-Sep-2018 15:30:25 - spw='0',niter=0,savemodel='modelcolumn',deconvolver='mtmfs',parallel=self.parallel) build 12-Sep-2018 15:30:25 -# self.assertTrue( self.th.checkmodelchan(self.msfile,10) > 0.0 and self.th.checkmodelchan(self.msfile,3) > 0.0 build 12-Sep-2018 15:30:25 - plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='model',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.step2.png',title="model after mtmfs predict on full spw" ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='data-model',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.step3data.png',title="data-model") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# def test_cube_continuum_subtract_otf(self): build 12-Sep-2018 15:30:25 -# """ EMPTY : [cube] Test_Cube_continuum_subtract : On-The-Fly using multifield """ build 12-Sep-2018 15:30:25 -# self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_badchannel_restoringbeam(self): build 12-Sep-2018 15:30:25 - """ [cube] Test auto restoring beam with a bad edge channel """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,specmode='cube',imsize=100,cell='10.0arcsec',niter=10,deconvolver='hogbom',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 - report1=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',0.889,[54,50,0,0]) , (self.img+'.image',0.0602,[54,50,0,19]) , (self.img+'.residual',0.033942,[54,50,0,19]) ]) build 12-Sep-2018 15:30:25 - # first channel's psf is 'bad' and wider along one axis. This offcenter location is higher in value build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'1',specmode='cube',imsize=100,cell='10.0arcsec',niter=10,deconvolver='hogbom', build 12-Sep-2018 15:30:25 - restoringbeam='common',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'1.psf') and os.path.exists(self.img+'1.image') ) build 12-Sep-2018 15:30:25 - report2=self.th.checkall(imexist=[self.img+'1.image'],imval=[(self.img+'1.image',0.8906,[54,50,0,0]), (self.img+'1.image',0.35945,[54,50,0,19]) , (self.img+'1.residual',0.033942,[54,50,0,19]) ]) build 12-Sep-2018 15:30:25 - # OLD - first channel has been restored by a 'common' beam picked from channel 2 build 12-Sep-2018 15:30:25 - self.checkfinal(report1+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# def test_cube_explicit_restoringbeam(self): build 12-Sep-2018 15:30:25 -# """ [cube] Test explicit restoring beams : Test peak flux and off source value for smoothed residuals""" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_common_restoringbeam(self): build 12-Sep-2018 15:30:25 - """ [cube] Test_cube_restoringbeam (cas10849/10946) : Test parallel and serial run on same refconcat images """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Imaging run - no restoration (serial or parallel) build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img, build 12-Sep-2018 15:30:25 - imsize=100,cell='10.0arcsec', build 12-Sep-2018 15:30:25 - interactive=0,niter=10,specmode='cube', build 12-Sep-2018 15:30:25 - restoration=False, parallel=self.parallel) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Serial restart for restoration only (serial only) build 12-Sep-2018 15:30:25 - retpar = tclean(vis=self.msfile,imagename=self.img, build 12-Sep-2018 15:30:25 - imsize=100,cell='10.0arcsec', build 12-Sep-2018 15:30:25 - interactive=0,niter=0,specmode='cube', build 12-Sep-2018 15:30:25 - restoration=True, restoringbeam='common',parallel=False, #### always False. build 12-Sep-2018 15:30:25 - calcres=False, calcpsf=False) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - header = imhead(self.img+'.image',verbose=False) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - estr = "["+inspect.stack()[1][3]+"] Has single restoring beam ? : " + self.th.verdict( header.has_key('restoringbeam')) + "\n" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report2 = self.th.checkall(imexist=[self.img+'.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+'.image',0.770445,[54,50,0,1]), build 12-Sep-2018 15:30:25 - (self.img+'.image',0.408929,[54,50,0,15]) ]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Pass or Fail (and why) ? build 12-Sep-2018 15:30:25 - self.checkfinal(estr+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_chanchunks(self): build 12-Sep-2018 15:30:25 - """ [cube] Test channel chunking for large cubes """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 -# ret = tclean(vis=self.msfile,imagename=self.img,specmode='cube',imsize=100,cell='10.0arcsec',niter=10,deconvolver='hogbom', savemodel='modelcolumn') build 12-Sep-2018 15:30:25 -# self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 -# report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.5002,[50,50,0,0]) , (self.img+'.image',0.769,[50,50,0,19]) ]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'cc',specmode='cube',imsize=100,cell='10.0arcsec',niter=10,deconvolver='hogbom',chanchunks=7,parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'cc.psf') and os.path.exists(self.img+'cc.image') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'cc.image'],imval=[(self.img+'cc.image',1.5002,[50,50,0,0]) , (self.img+'cc.image',0.769,[50,50,0,19]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_chanchunks_auto(self): build 12-Sep-2018 15:30:25 - """ [cube] Test channel chunking for large cubes : automatic calc of nchanchunks """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'cc',specmode='cube',imsize=100,cell='10.0arcsec',niter=10,deconvolver='hogbom',chanchunks=-1,parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'cc.psf') and os.path.exists(self.img+'cc.image') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'cc.image'],imval=[(self.img+'cc.image',1.5002,[50,50,0,0]) , (self.img+'cc.image',0.769,[50,50,0,19]) ]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_cube_chanchunks_savemodel(self): build 12-Sep-2018 15:30:25 - """ [cube] Test channel chunking for large cubes and save model """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'cc',specmode='cube',imsize=100,cell='10.0arcsec',niter=10,deconvolver='hogbom', build 12-Sep-2018 15:30:25 - chanchunks=2,savemodel='modelcolumn',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'cc.psf') and os.path.exists(self.img+'cc.image') ) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'cc.image'],imval=[(self.img+'cc.image',1.5002,[50,50,0,0]) , (self.img+'cc.image',0.769,[50,50,0,19]) ]) build 12-Sep-2018 15:30:25 - self.assertTrue( self.th.checkmodelchan(self.msfile,5) > 0.0 and self.th.checkmodelchan(self.msfile,18) > 0.0 ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -##Task level tests : masks and clean boxes. build 12-Sep-2018 15:30:25 -class test_mask(testref_base): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_1(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask_1 : Input mask as file and string : mfs """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - mstr = 'circle[[50pix,80pix],10pix]' build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.mask.txt', '#CRTFv0 CASA Region Text Format version 0\n'+mstr+'\n') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='user', build 12-Sep-2018 15:30:25 - mask=self.img+'.mask.txt',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='user',mask=mstr,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'1.mask', self.img+'2.mask'], imval=[(self.img+'1.mask',0.0,[50,50,0,0]),(self.img+'1.mask',1.0,[50,80,0,0]),(self.img+'2.mask',0.0,[50,50,0,0]),(self.img+'2.mask',1.0,[50,80,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_2(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask_2 : Input mask as file and string : cube (few channels) """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - mstr = 'circle[[50pix,50pix],10pix],range=[1.1GHz,1.5GHz]' build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.mask.txt', '#CRTFv0 CASA Region Text Format version 0\n'+mstr+'\n') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',specmode='cube', build 12-Sep-2018 15:30:25 - interactive=0,usemask='user',mask=self.img+'.mask.txt',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',specmode='cube', build 12-Sep-2018 15:30:25 - interactive=0,usemask='user',mask=mstr,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'1.mask', self.img+'2.mask'], imval=[(self.img+'1.mask',0.0,[50,50,0,1]),(self.img+'1.mask',1.0,[50,50,0,2]),(self.img+'1.mask',1.0,[50,50,0,10]),(self.img+'1.mask',0.0,[50,50,0,11]),(self.img+'2.mask',0.0,[50,50,0,1]),(self.img+'2.mask',1.0,[50,50,0,2]),(self.img+'2.mask',1.0,[50,50,0,10]),(self.img+'2.mask',0.0,[50,50,0,11])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_3(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask_3 : Input mask as image-to-be-regridded (ra/dec) : mfs """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - mstr = 'circle[[50pix,50pix],10pix]' build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.mask.txt', '#CRTFv0 CASA Region Text Format version 0\n'+mstr+'\n') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0, build 12-Sep-2018 15:30:25 - usemask='user',mask=self.img+'.mask.txt',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0, build 12-Sep-2018 15:30:25 - usemask='user',mask=self.img+'1.mask',phasecenter='J2000 19h59m57.5s +40d49m00.077s',parallel=self.parallel) # shift phasecenter build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'1.mask', self.img+'2.mask'], imval=[(self.img+'1.mask',1.0,[50,50,0,0]),(self.img+'2.mask',1.0,[91,13,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_4(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask_4 : Input mask as image-to-be-regridded(ra/dec/specframe) : cube """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - mstr = 'circle[[50pix,50pix],10pix],range=[1.1GHz,1.5GHz]' build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.mask.txt', '#CRTFv0 CASA Region Text Format version 0\n'+mstr+'\n') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',specmode='cube', build 12-Sep-2018 15:30:25 - interactive=0,usemask='user',mask=self.img+'.mask.txt',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',specmode='cube', build 12-Sep-2018 15:30:25 - start='1.3GHz',interactive=0,usemask='user',mask=self.img+'1.mask',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'1.mask', self.img+'2.mask'], imval=[(self.img+'1.mask',0.0,[50,50,0,1]),(self.img+'1.mask',1.0,[50,50,0,2]),(self.img+'1.mask',1.0,[50,50,0,10]),(self.img+'1.mask',0.0,[50,50,0,11]),(self.img+'2.mask',1.0,[50,50,0,0]),(self.img+'2.mask',1.0,[50,50,0,4]),(self.img+'2.mask',0.0,[50,50,0,10])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_5(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask_5 : Input cube mask that has different chan build 12-Sep-2018 15:30:25 - ranges (use mask from the 1st tclean with a different channel range in the 2nd tclean run)""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - mstr = 'circle[[50pix,50pix],10pix]' build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.mask.txt', '#CRTFv0 CASA Region Text Format version 0\n'+mstr+'\n') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=1,deconvolver='hogbom',specmode='cube', build 12-Sep-2018 15:30:25 - start=0,nchan=10,interactive=0,usemask='user',mask=self.img+'.mask.txt',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=1,deconvolver='hogbom',specmode='cube', build 12-Sep-2018 15:30:25 - start=5,nchan=10,interactive=0,usemask='user',mask=self.img+'1.mask',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'1.mask', self.img+'2.mask'], imval=[(self.img+'1.mask',1.0,[50,50,0,1]),(self.img+'1.mask',1.0,[50,50,0,2]),(self.img+'1.mask',1.0,[50,50,0,9]),(self.img+'2.mask',1.0,[50,50,0,0]),(self.img+'2.mask',1.0,[50,50,0,4]),(self.img+'2.mask',0.0,[50,50,0,5])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_autobox(self): build 12-Sep-2018 15:30:25 - # changed to use threshold based automasking build 12-Sep-2018 15:30:25 - """ [mask] test_mask_autobox : Autobox """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0, build 12-Sep-2018 15:30:25 - usemask='auto-thresh',parallel=self.parallel) build 12-Sep-2018 15:30:25 - # temporarily change value test to make it pass until extra masking in final minor cycle is resolved.... build 12-Sep-2018 15:30:25 - #report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,80,0,0])]) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,85,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_autobox_redraw(self): build 12-Sep-2018 15:30:25 - # changed to use threshold based automasking build 12-Sep-2018 15:30:25 - """ [mask] test_mask_autobox_redraw : Autoboxing with a redraw after each major cycle """ build 12-Sep-2018 15:30:25 - self.prepData('refim_eptwochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0, build 12-Sep-2018 15:30:25 - usemask='auto-thresh',maskthreshold=0.5,parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=20,cycleniter=10,deconvolver='hogbom', build 12-Sep-2018 15:30:25 - interactive=0,usemask='auto-thresh',maskthreshold=0.5,parallel=self.parallel) build 12-Sep-2018 15:30:25 - # tweak in automask threshold in the code changed masking extent 2016-03-21 build 12-Sep-2018 15:30:25 - #report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[60,30,0,0]),(self.img+'2.mask',1.0,[60,30,0,0])]) build 12-Sep-2018 15:30:25 - # temporarily change the value test for unmasked region to make it pass (replace with the above when the extra masking issue is resolved...) build 12-Sep-2018 15:30:25 - #report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[60,85,0,0]),(self.img+'2.mask',1.0,[60,30,0,0])]) build 12-Sep-2018 15:30:25 - #change in behavior due to automask code modification on July 1st,2016 build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[60,85,0,0]),(self.img+'2.mask',0.0,[60,30,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_autobox_nmask(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask_autobox_nmask : Autoboxing with nmask """ build 12-Sep-2018 15:30:25 - # this won't be triggering actual pruning but just to check going into write places build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom', build 12-Sep-2018 15:30:25 - interactive=0,usemask='auto-thresh',nmask=3,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,85,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_autobox2_nmask(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask_autobox2_nmask : Autoboxing (no binning) with nmask""" build 12-Sep-2018 15:30:25 - # this won't be triggering actual pruning but just to check going into write places build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom', build 12-Sep-2018 15:30:25 - interactive=0,usemask='auto-thresh2',nmask=3,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,85,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_autobox_pbmask(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask_autobox_nmask : Autoboxing with pbmask""" build 12-Sep-2018 15:30:25 - # this won't be triggering actual pruning but just to check going into write places build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - # change imsize to see the pbmask boundary build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=500,cell='8.0arcsec',niter=10,deconvolver='hogbom', build 12-Sep-2018 15:30:25 - interactive=0,usemask='auto-thresh', pbmask=0.2,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[250,250,0,0]),(self.img+'.mask',0.0,[250,285,0,0]),(self.img+'.mask',0.0,[360,360])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# This test deprecated. removed autoadjust param. build 12-Sep-2018 15:30:25 -# def test_mask_autobox_autoadjust(self): build 12-Sep-2018 15:30:25 -# """ [mask] test_mask_autobox_autoadjust : Autoboxing with autoadjust=T """ build 12-Sep-2018 15:30:25 -# self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 -# ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom', build 12-Sep-2018 15:30:25 -# interactive=0,usemask='auto-thresh',autoadjust=True) build 12-Sep-2018 15:30:25 -# report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,85,0,0])]) build 12-Sep-2018 15:30:25 -# self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# def test_mask_pbmask(self): build 12-Sep-2018 15:30:25 -# """ [mask] test_mask_pbmask : pb mask """ build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# def test_mask_combined_1(self): build 12-Sep-2018 15:30:25 -# """ [mask] test_mask_combined_1 : string + pbmask """ build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# def test_mask_combined_2(self): build 12-Sep-2018 15:30:25 -# """ [mask] test_mask_combined_2 : Autobox + pbmask """ build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# def test_mask_outlier(self): build 12-Sep-2018 15:30:25 -# """ [mask] test_mask_outlier : With outlier fields """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_restart(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask_restart : Test that mask reloads upon restart """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='auto-thresh',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - #report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,80,0,0])]) build 12-Sep-2018 15:30:25 - # temporarily change the value test for unmasked region to make it pass (replace with the above when the extra masking issue is resolved...) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,85,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_autobox_multithresh(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask__autobox_multithresh : multi-threshold Autobox (default)""" build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='auto-multithresh',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,85,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_autobox_multithresh_with_prune(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask__autobox_multithresh_with_prune : multi-threshold Autobox (minbeamfrac=0.3)""" build 12-Sep-2018 15:30:25 - # also test for a bug fix to the new pruneRegions (only caused the failure when image size large build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=1000,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='auto-multithresh', build 12-Sep-2018 15:30:25 - minbeamfrac=0.3,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[500,500,0,0]),(self.img+'.mask',0.0,[500,510,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_autobox_multithresh_with_stopmask(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask__autobox_multithresh_with_stopmask : multi-threshold Autobox (minbeamfrac=0.3) with stop mask on """ build 12-Sep-2018 15:30:25 - # will trigger stop mask condition for the last cycle (Cycle 4) - does not change output mask but can be checked on the log build 12-Sep-2018 15:30:25 - # build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=100,deconvolver='hogbom',interactive=0, build 12-Sep-2018 15:30:25 - usemask='auto-multithresh', minbeamfrac=0.3, minpercentchange=0.2,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[63,50,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_autobox_multithresh_with_absorption(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask__autobox_multithresh_on_absorption : multi-threshold Autobox (minbeamfrac=0.3) on the data with both emission and absorption """ build 12-Sep-2018 15:30:25 - # data with a emission pt and absorption pt. build 12-Sep-2018 15:30:25 - self.prepData('refim_point_pos_neg.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=100,deconvolver='hogbom',interactive=0, build 12-Sep-2018 15:30:25 - usemask='auto-multithresh', negativethreshold=5.0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',1.0,[60,40,0,0]),(self.img+'.mask',0.0,[65,50,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# def test_mask_outregion(self): build 12-Sep-2018 15:30:25 -# """ [mask] test_mask_outregion : Input mask has region that goes outside the image """ build 12-Sep-2018 15:30:25 -# self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 -# mstr = 'circle[[50pix,110pix],20pix]' build 12-Sep-2018 15:30:25 -# ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='user',mask=mstr) build 12-Sep-2018 15:30:25 -# report=self.th.checkall(imexist=[self.img+'2.mask'], imval=[(self.img+'2.mask',0.0,[50,50,0,0]),(self.img+'2.mask',1.0,[50,95,0,0])]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_zerostart(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask_zerostart : Test that a zero starting mask is caught """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='10.0arcsec',niter=0,interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - os.system('cp -r ' + self.img + '.residual '+ self.img+'2.inpmask') build 12-Sep-2018 15:30:25 - _ia.open(self.img+'2.inpmask') build 12-Sep-2018 15:30:25 - pix =_ia.getchunk() build 12-Sep-2018 15:30:25 - pix.fill(0.0) build 12-Sep-2018 15:30:25 - _ia.putchunk(pix) build 12-Sep-2018 15:30:25 - _ia.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='10.0arcsec',niter=10,interactive=0,mask=self.img+'2.inpmask') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, imexist=[self.img+'2.mask'], imval=[(self.img+'2.model',0.0,[50,50,0,0]),(self.img+'2.mask',0.0,[50,50,0,0])], stopcode=7) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_mask_zeroauto(self): build 12-Sep-2018 15:30:25 - """ [mask] test_mask_zeroauto : Test that an automask-generated zero mask is caught """ build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile, imagename=self.img,niter=0,interactive=0,usemask='auto-thresh',maskthreshold='40.0Jy',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile, imagename=self.img,niter=10,interactive=0,usemask='auto-thresh',maskthreshold='40.0Jy',parallel=self.parallel) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, imexist=[self.img+'.mask'], imval=[(self.img+'.model',0.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,50,0,0])], stopcode=7) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -##Task level tests : awproject and mosaics build 12-Sep-2018 15:30:25 -class test_widefield(testref_base): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_widefield_wproj_mfs(self): build 12-Sep-2018 15:30:25 - """ [widefield] Test_Widefield_wproj : W-Projection """ build 12-Sep-2018 15:30:25 - ### Need better test dataset for this..... build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='8.0arcsec',phasecenter="J2000 19:59:00.2 +40.50.15.50",niter=30, build 12-Sep-2018 15:30:25 - gridder='widefield',wprojplanes=4,deconvolver='hogbom',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.psf',1.0,[100,100,0,0]),(self.img+'.image',5.56,[127,143,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_widefield_aproj_mfs(self): build 12-Sep-2018 15:30:25 - """ [widefield] Test_Widefield_aproj : MFS with narrowband AWProjection (wbawp=F, 1spw) stokes I """ build 12-Sep-2018 15:30:25 - # casalog.post("EMPTY TEST") build 12-Sep-2018 15:30:25 - # return build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,spw='1',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=30,gridder='awproject',cfcache=self.img+'.cfcache',wbawp=False,conjbeams=True,psterm=False,computepastep=360.0, build 12-Sep-2018 15:30:25 - rotatepastep=360.0,deconvolver='hogbom',savemodel='modelcolumn',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ## ret = tclean(vis=self.msfile,spw='2',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=30,gridder='awproject',wbawp=False,conjbeams=True,psterm=False,computepastep=360.0,rotatepastep=360.0,deconvolver='hogbom') build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',1.0,[256,256,0,0]),(self.img+'.weight',0.493,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 - ## weight is pbsq which is 0.7^2 = 0.49 (approx). build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #do stokes V too..... build 12-Sep-2018 15:30:25 - def test_widefield_aproj_cube(self): build 12-Sep-2018 15:30:25 - """ [widefield] Test_Widefield_aproj_cube_aproj : Cube with AW-Projection and rotation off """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - casalog.post("EMPTY TEST") build 12-Sep-2018 15:30:25 - return build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - specmode='cube',niter=1,gain=1.0,gridder='awproject',cfcache=self.img+'.cfcache',wbawp=True, build 12-Sep-2018 15:30:25 - conjbeams=False,psterm=False,computepastep=360.0,rotatepastep=360.0,deconvolver='hogbom',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',0.11,[256,256,0,0]),(self.img+'.weight',0.34,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.residual') ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Test normtype too somewhere.. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_widefield_wbaproj_mfs(self): build 12-Sep-2018 15:30:25 - """ [widefield] Test_Widefield_wbaproj_mfs : MFS with wideband AWProjection (wbawp=T, allspw) and nt=1 stokes I """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # casalog.post("EMPTY TEST") build 12-Sep-2018 15:30:25 - # return build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=30,gridder='awproject',cfcache=self.img+'.cfcache',wbawp=True,conjbeams=True,psterm=False,computepastep=360.0, build 12-Sep-2018 15:30:25 - rotatepastep=360.0,deconvolver='hogbom',pblimit=0.3,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',1.0,[256,256,0,0]),(self.img+'.weight',0.493,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #do stokes V too.. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_widefield_aproj_mtmfs(self): build 12-Sep-2018 15:30:25 - """ [widefield] Test_Widefield_aproj_mtmfs : MFS with AWProjection (wbawp=T,conjbeams=F, allspw) and nt=2 stokes I """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # casalog.post("EMPTY TEST") build 12-Sep-2018 15:30:25 - # return build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,spw='*',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=0,gridder='awproject',cfcache=self.img+'.cfcache',wbawp=True,conjbeams=False,psterm=False,computepastep=360.0, build 12-Sep-2018 15:30:25 - rotatepastep=360.0,deconvolver='mtmfs',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.psf.tt0', self.img+'.weight.tt0'],imval=[(self.img+'.image.tt0',0.96,[256,256,0,0]),(self.img+'.weight.tt0',0.48,[256,256,0,0]),(self.img+'.alpha',0.04,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - ## alpha should represent that of the mosaic PB (twice).. -0.1 doesn't look right. Sigh.... well.. it should converge to zero. build 12-Sep-2018 15:30:25 - ## alpha keeps increasing in magnitude with niter.... not right. build 12-Sep-2018 15:30:25 - ## restricting this check to niter=0 only. Alpha should represent that of the PB. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_widefield_wbaproj_mtmfs(self): build 12-Sep-2018 15:30:25 - """ [widefield] Test_Widefield_wbaproj_mtmfs : MFS with wideband AWProjection (wbawp=T,conjbeams=T, allspw) and nt=2 stokes I """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # casalog.post("EMPTY TEST") build 12-Sep-2018 15:30:25 - # return build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=30,gridder='awproject',cfcache=self.img+'.cfcache',wbawp=True,conjbeams=True,psterm=False, build 12-Sep-2018 15:30:25 - computepastep=360.0,rotatepastep=360.0,deconvolver='mtmfs',pblimit=0.1,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.psf.tt0', self.img+'.weight.tt0'],imval=[(self.img+'.image.tt0',0.96,[256,256,0,0]),(self.img+'.weight.tt0',0.486,[256,256,0,0]),(self.img+'.alpha',0.0,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 - ## alpha should be ZERO as the pb spectrum has been taken out. build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# def test_widefield_wbaproj_subsets(self): build 12-Sep-2018 15:30:25 -# """ [widefield] Test_Widefield_wbaproj_subsets : MFS with the AWProjection gridder and A,W turned off """ build 12-Sep-2018 15:30:25 -# self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 -# ## PS only build 12-Sep-2018 15:30:25 -# ret = tclean(vis=self.msfile,spw='*',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=30,gridder='awproject',psterm=True,aterm=False,wprojplanes=1,computepastep=360.0,rotatepastep=360.0,deconvolver='hogbom',pblimit=0.3) build 12-Sep-2018 15:30:25 -# #report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',1.0,[256,256,0,0]),(self.img+'.weight',0.493,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# ## W and PS only build 12-Sep-2018 15:30:25 -# ret = tclean(vis=self.msfile,spw='*',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=30,gridder='awproject',psterm=True,aterm=False,wprojplanes=16,computepastep=360.0,rotatepastep=360.0,deconvolver='hogbom',pblimit=0.3) build 12-Sep-2018 15:30:25 -# #report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',1.0,[256,256,0,0]),(self.img+'.weight',0.493,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# def test_widefield_multispws(self): build 12-Sep-2018 15:30:25 -# """ [widefield] Test_Widefield_multispws : Test cube imaging with mosaicft and awproj """ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## CHECK NORMALIZATION OF WEIGHTIMAGE = normed to peak=1 build 12-Sep-2018 15:30:25 - ## TODO : make vpman recognize EVLA in addition to VLA. build 12-Sep-2018 15:30:25 - def test_widefield_mosaicft_mfs(self): build 12-Sep-2018 15:30:25 - """ [widefield] Test_Widefield_mosaic : MFS with mosaicft stokes I """ build 12-Sep-2018 15:30:25 - self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,spw='1',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=30,gridder='mosaicft',deconvolver='hogbom',pblimit=0.3,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',0.961231,[256,256,0,0]),(self.img+'.weight',0.50576,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 - #ret = clean(vis=self.msfile,spw='1',field='*',imagename=self.img+'.old',imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=30,imagermode='mosaic',psfmode='hogbom') build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #do stokes V too.. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_widefield_mosaicft_mtmfs(self): build 12-Sep-2018 15:30:25 - """ [widefield] Test_Widefield_mosaicft_mtmfs : MT-MFS with mosaicft stokes I, alpha """ build 12-Sep-2018 15:30:25 - self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,spw='*',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=60,gridder='mosaicft',deconvolver='mtmfs', conjbeams=False,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.psf.tt0', self.img+'.weight.tt0'],imval=[(self.img+'.image.tt0',0.9413,[256,256,0,0]),(self.img+'.weight.tt0',0.50546,[256,256,0,0]),(self.img+'.alpha', 0.078076,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 - ## alpha should represent that of the mosaic PB (twice)... and should then converge to zero build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_widefield_mosaicft_mtmfs_conj(self): build 12-Sep-2018 15:30:25 - """ [widefield] Test_Widefield_mosaicft_mtmfs : MT-MFS with mosaicft stokes I, alpha """ build 12-Sep-2018 15:30:25 - self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,spw='*',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=60,gridder='mosaicft',deconvolver='mtmfs', conjbeams=True,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.psf.tt0', self.img+'.weight.tt0'],imval=[(self.img+'.image.tt0',0.9638,[256,256,0,0]),(self.img+'.weight.tt0',0.49804,[256,256,0,0]),(self.img+'.alpha',-0.03692,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 - ## alpha should represent that of the mosaic PB (twice)... and should then converge to zero build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_widefield_mosaicft_mtmfs_pbsquare(self): build 12-Sep-2018 15:30:25 - """ [widefield] Test_Widefield_mosaicft_mtmfs : MT-MFS with mosaicft stokes I, alpha """ build 12-Sep-2018 15:30:25 - self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,spw='*',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=60,gridder='mosaic',deconvolver='mtmfs', conjbeams=False, normtype='pbsquare',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.psf.tt0', self.img+'.weight.tt0'],imval=[(self.img+'.image.tt0',0.9194,[256,256,0,0]),(self.img+'.weight.tt0',0.5059,[256,256,0,0]),(self.img+'.alpha',0.021195,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 - ## alpha should represent that of the mosaic PB (twice)... and should then converge to zero build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_widefield_mosaicft_cube(self): build 12-Sep-2018 15:30:25 - """ [widefield] Test_Widefield_mosaicft_cube : MFS with mosaicft stokes I """ build 12-Sep-2018 15:30:25 - self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 -# _vp.setpbpoly(telescope='EVLA', coeff=[1.0, -1.529e-3, 8.69e-7, -1.88e-10]) build 12-Sep-2018 15:30:25 -# _vp.saveastable('evlavp.tab') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,spw='*',field='0',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - specmode='cube',niter=10,gridder='mosaicft',deconvolver='hogbom',gain=0.1,stokes='I',parallel=self.parallel) #,vptable='evlavp.tab') build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',0.7987,[256,256,0,0]),(self.img+'.weight',0.6528,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - #do stokes V too.. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -class test_widefield_failing(testref_base): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_widefield_imagemosaic(self): build 12-Sep-2018 15:30:25 - """ [widefield] Test_Widefield_imagemosaic : Image domain mosaic for single-term mfs (or narrowband) """ build 12-Sep-2018 15:30:25 - self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,spw='1',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=30,gridder='imagemosaic',deconvolver='hogbom',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',1.0,[256,256,0,0]),(self.img+'.weight',0.493,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_widefield_mosaic_outlier(self): build 12-Sep-2018 15:30:25 - """ [multifield] Test_widefield_mosaic_outlier : Mosaic with an outlier field """ build 12-Sep-2018 15:30:25 - #### Need another dataset for this. build 12-Sep-2018 15:30:25 - self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 - ## Outlier uses gridft build 12-Sep-2018 15:30:25 - self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:42.0 +40.55.58.543\nmask=circle[[40pix,40pix],10pix]\ngridder=gridft') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',gridder='mosaicft',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 - iterdone=10, # outlier field has nothing in it :). build 12-Sep-2018 15:30:25 - nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 - imval=[(self.img+'.image',0.933,[256,256,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.image',0.0,[40,40,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - #### NOT WORKING as the model is being picked from tst1, so residual after 0.6 model and one major cycle is same as dirty and the output image is 1.6 instead of 0.93. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 -############################################## build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -##Task level tests : model prediction. build 12-Sep-2018 15:30:25 -class test_modelvis(testref_base): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_modelvis_1(self): build 12-Sep-2018 15:30:25 - """ [modelpredict] Test_modelvis_1 : mfs with no save model """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twochan.ms") build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,savemodel='none',parallel=self.parallel) build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==False and hasvirmod==False ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_modelvis_2(self): build 12-Sep-2018 15:30:25 - """ [modelpredict] Test_modelvis_2 : mfs with save model column """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twochan.ms") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Save model after deconvolution build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,savemodel='modelcolumn',parallel=self.parallel) build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==True and modsum>0.0 and hasvirmod==False ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ##Predict from input model image (startmodel) build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model', niter=0, build 12-Sep-2018 15:30:25 - savemodel='modelcolumn',parallel=self.parallel) build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==True and modsum>0.0 and hasvirmod==False ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_modelvis_3(self): build 12-Sep-2018 15:30:25 - """ [modelpredict] Test_modelvis_3 : mfs with save virtual model """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twochan.ms") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Save model after deconvolution build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,savemodel='virtual',parallel=self.parallel) build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==False and hasvirmod==True ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ##Predict from input model image (startmodel) build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model', niter=0, build 12-Sep-2018 15:30:25 - savemodel='virtual',parallel=self.parallel) build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==False and hasvirmod==True ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_modelvis_4(self): build 12-Sep-2018 15:30:25 - """ [modelpredict] Test_modelvis_4 : mt-mfs with no save model """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twochan.ms") build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',savemodel='none',parallel=self.parallel) build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==False and hasvirmod==False ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_modelvis_5(self): build 12-Sep-2018 15:30:25 - """ [modelpredict] Test_modelvis_5 : mt-mfs with save model column """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twochan.ms") build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs', build 12-Sep-2018 15:30:25 - savemodel='modelcolumn',parallel=self.parallel) build 12-Sep-2018 15:30:25 - plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='data',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.data.png',title="original data") build 12-Sep-2018 15:30:25 - plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='model',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.model.png',title="empty model") build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==True and modsum>0.0 and hasvirmod==False ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=[self.img+'.model.tt0',self.img+'.model.tt1'], build 12-Sep-2018 15:30:25 - niter=0,deconvolver='mtmfs',savemodel='modelcolumn',parallel=self.parallel) build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==True and modsum>0.0 and hasvirmod==False ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_modelvis_6(self): build 12-Sep-2018 15:30:25 - """ [modelpredict] Test_modelvis_6 : mt-mfs with save virtual model """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twochan.ms") build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',savemodel='virtual',parallel=self.parallel) build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==False and hasvirmod==True ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=[self.img+'.model.tt0',self.img+'.model.tt1'], build 12-Sep-2018 15:30:25 - niter=0,deconvolver='mtmfs',savemodel='virtual',parallel=self.parallel) build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==False and hasvirmod==True ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_modelvis_7(self): build 12-Sep-2018 15:30:25 - """ [modelpredict] Test_modelvis_7 : cube with chan selection and save model column """ build 12-Sep-2018 15:30:25 - ## check explicit channels ... build 12-Sep-2018 15:30:25 - self.prepData("refim_point.ms") build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,spw='0:5~12',imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',niter=10,savemodel='modelcolumn', build 12-Sep-2018 15:30:25 - start=5,nchan=8,interpolation='nearest',parallel=self.parallel) build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==True and modsum>0.0 and hasvirmod==False ) build 12-Sep-2018 15:30:25 - reportcv=self.th.checkchanvals(self.msfile, [(10,">",0.0),(3,"==",1.0)]) build 12-Sep-2018 15:30:25 - self.checkfinal(reportcv) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,spw='0',imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model',specmode='cube', build 12-Sep-2018 15:30:25 - niter=0,savemodel='modelcolumn',parallel=self.parallel) build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==True and modsum>0.0 and hasvirmod==False ) build 12-Sep-2018 15:30:25 - reportcv=self.th.checkchanvals(self.msfile,[(10,">",0.0),(3,"==",self.th.checkmodelchan(self.msfile,1))]) build 12-Sep-2018 15:30:25 - self.checkfinal(reportcv) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_modelvis_8(self): build 12-Sep-2018 15:30:25 - """ [modelpredict] Test_modelvis_8 : cube with chan selection and save virtual model """ build 12-Sep-2018 15:30:25 - ## check explicit channels ... build 12-Sep-2018 15:30:25 - self.prepData("refim_point.ms") build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,spw='0:5~12',imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',niter=10, build 12-Sep-2018 15:30:25 - savemodel='virtual',parallel=self.parallel) build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==False and hasvirmod==True ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,spw='0',imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model',specmode='cube', build 12-Sep-2018 15:30:25 - niter=0,savemodel='virtual',parallel=self.parallel) build 12-Sep-2018 15:30:25 - hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 - self.assertTrue( hasmodcol==False and hasvirmod==True ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_modelvis_9(self): build 12-Sep-2018 15:30:25 - """ [modelpredict] Test_modelvis_9 : Don't de-grid channels with zero model. Also test limited-freq mask """ build 12-Sep-2018 15:30:25 - self.prepData("refim_point.ms") build 12-Sep-2018 15:30:25 - masklist='' # choose only a few channels here. build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,mask=masklist,parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(self.th.exists(self.img+'.model') ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model',niter=0, build 12-Sep-2018 15:30:25 - savemodel='modelcolumn',parallel=self.parallel) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model',niter=0, build 12-Sep-2018 15:30:25 - savemodel='virtual',parallel=self.parallel) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_modelvis_10(self): build 12-Sep-2018 15:30:25 - """ [modelpredict] Test_modelvis_10 : Use input model of different (narrower) freq range than data """ build 12-Sep-2018 15:30:25 - self.prepData("refim_point.ms") build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec', spw='0:5~12',niter=10,savemodel='modelcolumn',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(self.th.exists(self.img+'.model') ) build 12-Sep-2018 15:30:25 -# self.assertTrue( self.th.checkmodelchan(self.msfile,10) > 0.0 and self.th.checkmodelchan(self.msfile,3) == 1.0 ) build 12-Sep-2018 15:30:25 - reportcv=self.th.checkchanvals(self.msfile,[(10,">",0.0),(3,"==",1.0)]) build 12-Sep-2018 15:30:25 - self.checkfinal(reportcv) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## add model expansion parameter build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model', spw='0',niter=0, build 12-Sep-2018 15:30:25 - savemodel='modelcolumn',parallel=self.parallel) build 12-Sep-2018 15:30:25 -# self.assertTrue( self.th.checkmodelchan(self.msfile,10) > 0.0 and self.th.checkmodelchan(self.msfile,3) > 0.0 ) build 12-Sep-2018 15:30:25 - reportcv=self.th.checkchanvals(self.msfile,[(10,">",0.0),(3,">",0.0)]) build 12-Sep-2018 15:30:25 - self.checkfinal(reportcv) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model', spw='0',niter=0, build 12-Sep-2018 15:30:25 - savemodel='virtual',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ## cannot check anything here.... just that it runs without error build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_modelvis_11(self): build 12-Sep-2018 15:30:25 - """ [modelpredict] Test_modelvis_11 : Predict model image over channel gaps not included in imaging """ build 12-Sep-2018 15:30:25 - self.prepData("refim_point.ms") build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec', spw='0:0~8;12~19',niter=10,savemodel='modelcolumn',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue(self.th.exists(self.img+'.model') ) build 12-Sep-2018 15:30:25 - ###vi2 leave unselected channel as is so it will be 1.0 build 12-Sep-2018 15:30:25 - self.assertTrue( (self.th.checkmodelchan(self.msfile,10) == 0.0) or (np.abs(self.th.checkmodelchan(self.msfile,10)-1) < 1.0e-12) and self.th.checkmodelchan(self.msfile,3) > 0.0 ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model', spw='0',niter=0, build 12-Sep-2018 15:30:25 - savemodel='modelcolumn',parallel=self.parallel) build 12-Sep-2018 15:30:25 - self.assertTrue( self.th.checkmodelchan(self.msfile,10) > 0.0 and self.th.checkmodelchan(self.msfile,3) > 0.0 ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 - ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model', spw='0',niter=0, build 12-Sep-2018 15:30:25 - savemodel='virtual',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ## cannot check anything here.... just that it runs without error build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -class test_startmodel(testref_base): build 12-Sep-2018 15:30:25 - def test_startmodel_regrid_mfs(self): build 12-Sep-2018 15:30:25 - """ [modelpredict] Test_startmodel_regrid_mfs : Regrid input model onto new image grid : mfs (ra/dec) """ build 12-Sep-2018 15:30:25 - self.prepData('refim_twopoints_twochan.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=50,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0, build 12-Sep-2018 15:30:25 - phasecenter='J2000 19h58m40.801s +40d55m59.863s',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=200,cell='8.0arcsec',niter=0,deconvolver='hogbom',interactive=0, build 12-Sep-2018 15:30:25 - startmodel=self.img+'1.model',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'1.residual', self.img+'2.residual'], imval=[(self.img+'1.residual',1.7963,[25,25,0,0]),(self.img+'2.residual',1.910,[168,190,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_startmodel_regrid_cube(self): build 12-Sep-2018 15:30:25 - """ [modelpredict] Test_startmodel_regrid_cube : Regrid input model onto new image grid : cube (ra/dec/specframe)""" build 12-Sep-2018 15:30:25 - self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=50,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,specmode='cube', build 12-Sep-2018 15:30:25 - start='1.05GHz',width='50MHz',nchan=20,parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=0,deconvolver='hogbom',interactive=0, build 12-Sep-2018 15:30:25 - startmodel=self.img+'1.model',specmode='cube',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'1.residual', self.img+'2.residual'], imval=[(self.img+'1.residual',0.362,[25,25,0,5]),(self.img+'2.residual',0.362,[50,50,0,6])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# def test_startmodel_14(self): build 12-Sep-2018 15:30:25 -# """ [modelpredict] Test_startmodel_14 : Regrid input model onto new image grid : mtmfs (ra/dec/terms)""" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# def test_startmodel_15(self): build 12-Sep-2018 15:30:25 -# """ [modelpredict] Test_startmodel_15 : Regrid input model onto new image grid : mfs (imsize/cell)""" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_startmodel_mfs_continue(self): build 12-Sep-2018 15:30:25 - """ [startmodel] test_startmodel_mfs_continue : Restart a run with no parameter changes""" build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'1.residual'], imval=[(self.img+'1.residual',0.35304,[50,50,0,0])]) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'1.residual'], imval=[(self.img+'1.residual',0.1259,[50,50,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_startmodel_mfs_restart(self): build 12-Sep-2018 15:30:25 - """ [startmodel] test_startmodel_mfs_restart : Restart a run using 'startmodel' and changed imagename""" build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0, build 12-Sep-2018 15:30:25 - startmodel=self.img+'1.model',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'1.residual', self.img+'2.residual'], imval=[(self.img+'1.residual',0.35304,[50,50,0,0]),(self.img+'2.residual',0.1259,[50,50,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_startmodel_mfs_changeshape_1(self): build 12-Sep-2018 15:30:25 - """ [startmodel] test_startmodel_mfs_changeshape_1 : Restart a run but change shape only (cas-6937)""" build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'1.residual'], imval=[(self.img+'1.residual',0.35304,[50,50,0,0])]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - try: build 12-Sep-2018 15:30:25 - ## This run should fail with an exception (if __rethrow_exceptions = True ) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=120,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - correct=False build 12-Sep-2018 15:30:25 - except Exception as e: build 12-Sep-2018 15:30:25 - correct=True build 12-Sep-2018 15:30:25 - #self.assertTrue(correct) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ## Check that there is no change in output value.... build 12-Sep-2018 15:30:25 - ## i.e. the second run should have failed. build 12-Sep-2018 15:30:25 - report=self.th.checkall(imval=[(self.img+'1.residual',0.35304,[50,50,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_startmodel_mfs_changeshape_2(self): build 12-Sep-2018 15:30:25 - """ [startmodel] test_startmodel_mfs_changeshape_2 : Restart a run using 'startmodel' and change shape and imagename""" build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=120,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0, build 12-Sep-2018 15:30:25 - startmodel=self.img+'1.model',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'1.residual', self.img+'2.residual'], imval=[(self.img+'1.residual',0.35304,[50,50,0,0]),(self.img+'2.residual',0.1259,[60,60,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_startmodel_mtmfs_restart(self): build 12-Sep-2018 15:30:25 - """ [startmodel] test_startmodel_mtmfs_restart : Restart a multi-term run using 'startmodel' and changed imagename""" build 12-Sep-2018 15:30:25 - self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',interactive=0,parallel=self.parallel) build 12-Sep-2018 15:30:25 - # start with full model build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',interactive=0, build 12-Sep-2018 15:30:25 - startmodel=[self.img+'1.model.tt0',self.img+'1.model.tt1'],parallel=self.parallel) build 12-Sep-2018 15:30:25 - # start with model only for tt0 build 12-Sep-2018 15:30:25 - ret3 = tclean(vis=self.msfile,imagename=self.img+'3',imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',interactive=0, build 12-Sep-2018 15:30:25 - startmodel=self.img+'1.model.tt0',parallel=self.parallel) build 12-Sep-2018 15:30:25 - # start with model only for tt1 build 12-Sep-2018 15:30:25 - ret3 = tclean(vis=self.msfile,imagename=self.img+'4',imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',interactive=0, build 12-Sep-2018 15:30:25 - startmodel=['',self.img+'1.model.tt1'],parallel=self.parallel) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'1.residual.tt0', self.img+'2.residual.tt0', self.img+'3.residual.tt0', self.img+'4.residual.tt0', self.img+'1.residual.tt1', self.img+'2.residual.tt1', self.img+'3.residual.tt1', self.img+'4.residual.tt1'], imval=[ (self.img+'1.residual.tt0',0.39226,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'2.residual.tt0',0.13677,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'3.residual.tt0',0.13677,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'4.residual.tt0',0.39226,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'1.residual.tt1',-0.04358,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'2.residual.tt1',-0.01519,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'3.residual.tt1',-0.04358,[50,50,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'4.residual.tt1',-0.01519,[50,50,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_startmodel_with_mask_mfs(self): build 12-Sep-2018 15:30:25 - """ [startmodel] test_startmodel_with_mask_mfs : Mask out some regions in the startmodel, before prediction """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - ## image both sources build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,spw='0:0',imagename=self.img,imsize=200,cell='10.0arcsec',niter=100,parallel=self.parallel) build 12-Sep-2018 15:30:25 - ## mask out all but the brightest outlier source build 12-Sep-2018 15:30:25 - _ia.open(self.img+'.model') build 12-Sep-2018 15:30:25 - _ia.calcmask(mask='"'+self.img+'.model">2.0') # keep only high values. i.e. the far out bright source. build 12-Sep-2018 15:30:25 - _ia.close() build 12-Sep-2018 15:30:25 - ## predict only that outlier source build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,spw='0:0',imagename=self.img+'.2',niter=0,savemodel='modelcolumn',imsize=200,cell='10.0arcsec', build 12-Sep-2018 15:30:25 - startmodel=self.img+'.model',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ## subtract it out build 12-Sep-2018 15:30:25 - uvsub(vis=self.msfile) build 12-Sep-2018 15:30:25 - ## image the rest of the field. build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,spw='0:0',imagename=self.img+'.3',imsize=200,cell='10.0arcsec',niter=100,parallel=self.parallel) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.model',self.img+'.2.model',self.img+'.3.model'], build 12-Sep-2018 15:30:25 - imval=[ (self.img+'.model',1.497,[100,100,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.model',7.474,[154,172,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.3.model',1.497,[100,100,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.3.model',0.024,[154,172,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_startmodel_with_mask_mtmfs(self): build 12-Sep-2018 15:30:25 - """ [startmodel] test_startmodel_with_mask_mtmfs : Mask out some regions in the startmodel, before prediction """ build 12-Sep-2018 15:30:25 - self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 - ## image both sources build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='10.0arcsec',niter=100,deconvolver='mtmfs',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ## mask out all but the brightest outlier source build 12-Sep-2018 15:30:25 - _ia.open(self.img+'.model.tt0') build 12-Sep-2018 15:30:25 - _ia.calcmask(mask='"'+self.img+'.model.tt0">2.0') # keep only high values. i.e. the far out bright source. build 12-Sep-2018 15:30:25 - _ia.close() build 12-Sep-2018 15:30:25 - _ia.open(self.img+'.model.tt1') build 12-Sep-2018 15:30:25 - _ia.calcmask(mask='"'+self.img+'.model.tt0">2.0') # keep only high values. i.e. the far out bright source. build 12-Sep-2018 15:30:25 - _ia.close() build 12-Sep-2018 15:30:25 - ## predict only that outlier source build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,imagename=self.img+'.2',niter=0,savemodel='modelcolumn',imsize=200,cell='10.0arcsec', build 12-Sep-2018 15:30:25 - startmodel=[self.img+'.model.tt0',self.img+'.model.tt1'],deconvolver='mtmfs',parallel=self.parallel) build 12-Sep-2018 15:30:25 - ## subtract it out build 12-Sep-2018 15:30:25 - uvsub(vis=self.msfile) build 12-Sep-2018 15:30:25 - ## image the rest of the field. build 12-Sep-2018 15:30:25 - tclean(vis=self.msfile,imagename=self.img+'.3',imsize=200,cell='10.0arcsec',niter=100,deconvolver='mtmfs',parallel=self.parallel) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.model.tt0',self.img+'.2.model.tt0',self.img+'.3.model.tt0'], build 12-Sep-2018 15:30:25 - imval=[ build 12-Sep-2018 15:30:25 - (self.img+'.model.tt0',1.11,[100,100,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.model.tt0',5.56,[154,172,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.3.model.tt0',1.12,[100,100,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.3.model.tt0',0.013,[154,172,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.model.tt1',-1.1027,[100,100,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.model.tt1',-5.602,[154,172,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.3.model.tt1',-1.124,[100,100,0,0]), build 12-Sep-2018 15:30:25 - (self.img+'.3.model.tt1',-0.021,[154,172,0,0]) ] ) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ############################################## build 12-Sep-2018 15:30:25 -class test_pbcor(testref_base): build 12-Sep-2018 15:30:25 - def setUp(self): build 12-Sep-2018 15:30:25 - super(test_pbcor, self).setUp() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - _vp.setpbpoly(telescope='EVLA', coeff=[1.0, -1.529e-3, 8.69e-7, -1.88e-10]) build 12-Sep-2018 15:30:25 - _vp.saveastable('evlavp.tab') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_pbcor_mfs(self): build 12-Sep-2018 15:30:25 - """ [pbcor] Test pbcor with mfs""" build 12-Sep-2018 15:30:25 - self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=10, specmode='mfs', vptable='evlavp.tab', pbcor=True,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb', self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.7,[256,256,0,0]),(self.img+'.image.pbcor',1.0,[256,256,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_pbcor_mtmfs(self): build 12-Sep-2018 15:30:25 - """ [pbcor] Test pbcor with mtmfs""" build 12-Sep-2018 15:30:25 - self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=10, specmode='mfs', vptable='evlavp.tab', pbcor=True, deconvolver='mtmfs',parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.pb.tt0'], imexistnot=[self.img+'.image.tt0.pbcor', self.img+'.alpha.pbcor'], imval=[(self.img+'.pb.tt0',0.7,[256,256,0,0])]) build 12-Sep-2018 15:30:25 - #report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.pb.tt0', self.img+'.image.tt0.pbcor', self.img+'.alpha.pbcor'], imval=[(self.img+'.pb.tt0',0.7,[256,256,0,0]),(self.img+'.image.tt0.pbcor',1.0,[256,256,0,0]),(self.img+'.alpha',-0.7,[256,256,0,0]), (self.img+'.alpha.pbcor',-0.7,[256,256,0,0]) ]) build 12-Sep-2018 15:30:25 - # uncorrected alpha, for now. build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_pbcor_cube_basic(self): build 12-Sep-2018 15:30:25 - """ [pbcor] Test pbcor with cube""" build 12-Sep-2018 15:30:25 - self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=10, specmode='cube', vptable='evlavp.tab', pbcor=True,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb', self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.79,[256,256,0,0]),(self.img+'.image.pbcor',1.0,[256,256,0,0]), (self.img+'.pb',0.59,[256,256,0,2]),(self.img+'.image.pbcor',1.0,[256,256,0,2])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_pbcor_cube_twosteps(self): build 12-Sep-2018 15:30:25 - """ [pbcor] Test pbcor with cube with imaging and pbcor separately""" build 12-Sep-2018 15:30:25 - self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=10, specmode='cube',vptable='evlavp.tab', pbcor=False,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report1=self.th.checkall(imexist=[self.img+'.image',self.img+'.pb'],imexistnot=[self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.79,[256,256,0,0]), (self.img+'.pb',0.59,[256,256,0,2])]) build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=0,calcres=False,calcpsf=False, specmode='cube', vptable='evlavp.tab', pbcor=True,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report2=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb', self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.79,[256,256,0,0]),(self.img+'.image.pbcor',1.0,[256,256,0,0]), (self.img+'.pb',0.59,[256,256,0,2]),(self.img+'.image.pbcor',1.0,[256,256,0,2])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report1+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_pbcor_cube_mosaicft(self): build 12-Sep-2018 15:30:25 - """ [pbcor] Test pbcor with cube with mosaicft""" build 12-Sep-2018 15:30:25 - self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=10, specmode='cube', vptable='evlavp.tab',pbcor=True, gridder='mosaic',parallel=self.parallel) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - report=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb', self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.79,[256,256,0,0]),(self.img+'.image.pbcor',1.0,[256,256,0,0]), (self.img+'.pb',0.59,[256,256,0,2]),(self.img+'.image.pbcor',1.0,[256,256,0,2])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_pbcor_mfs_restart(self): build 12-Sep-2018 15:30:25 - """ [pbcor] Test pbcor with mfs and a restart""" build 12-Sep-2018 15:30:25 - self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=0, specmode='mfs', vptable='evlavp.tab', pbcor=False,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report1=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb'], imexistnot=[self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.7,[256,256,0,0])]) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=10, specmode='mfs', vptable='evlavp.tab', pbcor=True,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report2=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb', self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.7,[256,256,0,0]),(self.img+'.image.pbcor',1.0,[256,256,0,0])]) build 12-Sep-2018 15:30:25 - self.checkfinal(report1+report2) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_pbcor_turn_off_pbmask(self): build 12-Sep-2018 15:30:25 - """ [pbcor] Test pbcor with mfs where the internal T/F mask is turned off""" build 12-Sep-2018 15:30:25 - self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 - ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=0, specmode='mfs', vptable='evlavp.tab', pbcor=True,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report1=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb'], imval=[(self.img+'.pb',0.7,[256,256,0,0])], immask=[(self.img+'.pb',False,[10,10,0,0]), (self.img+'.image',False,[10,10,0,0])] ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ret2 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", build 12-Sep-2018 15:30:25 - niter=10, specmode='mfs', vptable='evlavp.tab', pbcor=True, calcpsf=False, calcres=False, pblimit=-0.2,parallel=self.parallel) build 12-Sep-2018 15:30:25 - report2=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb'], imval=[(self.img+'.pb',0.7,[256,256,0,0])] , immask=[(self.img+'.pb',False,[10,10,0,0]), (self.img+'.image',True,[10,10,0,0])] ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.checkfinal(report1+report2) build 12-Sep-2018 15:30:25 +########################################################################## build 12-Sep-2018 15:30:25 +########################################################################## build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# Test programs for the refactored imager : test_refimager build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# Each of the following categories (classes) has a set of tests within it. build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# test_onefield # basic tests, deconvolution algorithms build 12-Sep-2018 15:30:25 +# test_iterbot # iteration control options for mfs and cube build 12-Sep-2018 15:30:25 +# test_multifield # multiple fields of same type and with different shapes/deconvolvers/gridders build 12-Sep-2018 15:30:25 +# test_stokes # multiple stokes planes, imaging with flagged correlations.. build 12-Sep-2018 15:30:25 +# test_cube # all things cube. Spectral frame setup, handling empty channels, etc build 12-Sep-2018 15:30:25 +# test_widefield # facets, wprojection, imagemosaic, mosaicft, awproject build 12-Sep-2018 15:30:25 +# test_mask # input mask options : regridding, mask file, automasking, etc build 12-Sep-2018 15:30:25 +# test_modelvis # saving models (column/otf), using starting models, predict-only (setjy) build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# To run from within casapy : build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# runUnitTest.main(['test_refimager']) # Run all tests build 12-Sep-2018 15:30:25 +# runUnitTest.main(['test_refimager[test_onefield]']) # Run tests from test_onefield build 12-Sep-2018 15:30:25 +# runUnitTest.main(['test_refimager[test_onefield_mtmfs]']) # Run one specific test build 12-Sep-2018 15:30:25 +# runUnitTest.main(['test_refimager[test_onefield_mtmfs,test_onefield_hogbom]']) # Multiple specific tests build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# To see the full list of tests : grep "\"\"\" \[" test_refimager.py build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# These tests need data stored in data/regression/unittest/clean/refimager build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# For a developer build, to get the datasets locally build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# --- Get the basic data repo : svn co https://svn.cv.nrao.edu/svn/casa-data/distro data build 12-Sep-2018 15:30:25 +# --- Make directories : mkdir -p data/regression/unittest/clean; cd data/regression/unittest/clean build 12-Sep-2018 15:30:25 +# --- Get test datasets : svn co https://svn.cv.nrao.edu/svn/casa-data/trunk/regression/unittest/clean/refimager build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +########################################################################## build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# Datasets build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +# refim_twochan.ms : 2 channels, one 1Jy point source with spectral index of -1.0 build 12-Sep-2018 15:30:25 +# refim_twopoints_twochan.ms : Two point sources, 1Jy and 5Jy, both with spectral index -1.0. For multifield tests. build 12-Sep-2018 15:30:25 +# refim_point.ms : 1-2 GHz, 20 channels, 1 spw, one 1Jy point source with spectral index -1.0. build 12-Sep-2018 15:30:25 +# refim_point_withline.ms : refim_point with a 'line' added into 3 channels (just topo) build 12-Sep-2018 15:30:25 +# refim_mawproject.ms : Two pointing wideband mosaic with 1 point source in between the two pointings build 12-Sep-2018 15:30:25 +# refim_mawproject_offcenter.ms : Two pointing wideband mosaic with 1 point source at center of one pointing build 12-Sep-2018 15:30:25 +# refim_point_stokes.ms : RR=1.0, LL=0.8, RL and LR are zero. Stokes I=0.9, V=0.1, U,Q=0.0 build 12-Sep-2018 15:30:25 +# refim_point_linRL.ms : I=1, Q=2, U=3, V=4 in circular pol basis. build 12-Sep-2018 15:30:25 +# build 12-Sep-2018 15:30:25 +########################################################################## build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +import os build 12-Sep-2018 15:30:25 +import sys build 12-Sep-2018 15:30:25 +import shutil build 12-Sep-2018 15:30:25 +import commands build 12-Sep-2018 15:30:25 +import numpy build 12-Sep-2018 15:30:25 +from __main__ import default build 12-Sep-2018 15:30:25 +from tasks import * build 12-Sep-2018 15:30:25 +from taskinit import * build 12-Sep-2018 15:30:25 +import unittest build 12-Sep-2018 15:30:25 +import inspect build 12-Sep-2018 15:30:25 +import numpy as np build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +_ia = iatool( ) build 12-Sep-2018 15:30:25 +_vp = vptool( ) build 12-Sep-2018 15:30:25 +_cb = cbtool( ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +from imagerhelpers.test_imager_helper import TestHelpers build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +## List to be run build 12-Sep-2018 15:30:25 +def suite(): build 12-Sep-2018 15:30:25 + return [test_onefield, test_iterbot, test_multifield,test_stokes, test_modelvis, test_cube, test_mask, test_startmodel,test_widefield,test_pbcor] build 12-Sep-2018 15:30:25 +# return [test_onefield, test_iterbot, test_multifield,test_stokes,test_cube, test_widefield,test_mask, test_modelvis,test_startmodel,test_widefield_failing] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +refdatapath = os.environ.get('CASAPATH').split()[0] + '/data/regression/unittest/clean/refimager/' build 12-Sep-2018 15:30:25 +#refdatapath = "/export/home/riya/rurvashi/Work/ImagerRefactor/Runs/UnitData/" build 12-Sep-2018 15:30:25 +#refdatapath = "/home/vega/rurvashi/TestCASA/ImagerRefactor/Runs/WFtests/" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +## Base Test class with Utility functions build 12-Sep-2018 15:30:25 +class testref_base(unittest.TestCase): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + self.epsilon = 0.05 build 12-Sep-2018 15:30:25 + self.msfile = "" build 12-Sep-2018 15:30:25 + self.img = "tst" build 12-Sep-2018 15:30:25 + # To use subdir in the output image names in some tests (CAS-10937) build 12-Sep-2018 15:30:25 + self.img_subdir = 'refimager_tst_subdir' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.th = TestHelpers() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + """ don't delete it all """ build 12-Sep-2018 15:30:25 +# self.delData() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # Separate functions here, for special-case tests that need their own MS. build 12-Sep-2018 15:30:25 + def prepData(self,msname=""): build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + self.img_subdir) build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + self.img+'*') build 12-Sep-2018 15:30:25 + if msname != "": build 12-Sep-2018 15:30:25 + self.msfile=msname build 12-Sep-2018 15:30:25 + if (os.path.exists(self.msfile)): build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + self.msfile) build 12-Sep-2018 15:30:25 + shutil.copytree(refdatapath+self.msfile, self.msfile) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def delData(self,msname=""): build 12-Sep-2018 15:30:25 + if msname != "": build 12-Sep-2018 15:30:25 + self.msfile=msname build 12-Sep-2018 15:30:25 + if (os.path.exists(self.msfile)): build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + self.msfile) build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + self.img_subdir) build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + self.img+'*') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def prepInputmask(self,maskname=""): build 12-Sep-2018 15:30:25 + if maskname!="": build 12-Sep-2018 15:30:25 + self.maskname=maskname build 12-Sep-2018 15:30:25 + if (os.path.exists(self.maskname)): build 12-Sep-2018 15:30:25 + os.system('rm -rf ' + self.maskname) build 12-Sep-2018 15:30:25 + shutil.copytree(refdatapath+self.maskname, self.maskname) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def checkfinal(self,pstr=""): build 12-Sep-2018 15:30:25 + #pstr += "["+inspect.stack()[1][3]+"] : To re-run this test : casa -c `echo $CASAPATH | awk '{print $1}'`/gcwrap/python/scripts/regressions/admin/runUnitTest.py test_refimager["+ inspect.stack()[1][3] +"]" build 12-Sep-2018 15:30:25 + pstr += "["+inspect.stack()[1][3]+"] : To re-run this test : runUnitTest.main(['test_refimager["+ inspect.stack()[1][3] +"]'])" build 12-Sep-2018 15:30:25 + casalog.post(pstr,'INFO') build 12-Sep-2018 15:30:25 + if( pstr.count("(Fail") > 0 ): build 12-Sep-2018 15:30:25 + self.fail("\n"+pstr) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +##Task level tests : one field, 2chan. build 12-Sep-2018 15:30:25 +class test_onefield(testref_base): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_defaults(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Onefield_defaults : Defaults """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image'], imval=[(self.img+'.psf', 1.0, [50,50,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_clark(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Onefield_clark : mfs with clark minor cycle """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='clark',interactive=0) #,phasecenter='J2000 19h59m57.5s +40d49m00.077s') # default is clark build 12-Sep-2018 15:30:25 + #off center#ret = tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='8.0arcsec',niter=1000,interactive=0,phasecenter='J2000 19h59m57.5s +40d49m00.077s') # default is clark build 12-Sep-2018 15:30:25 + #compare with clean#clean(vis=self.msfile,imagename=self.img+'.old',imsize=200,cell='8.0arcsec',niter=1000,psfmode='clark',phasecenter='J2000 19h59m57.5s +40d49m00.077s') # default is clark build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=0.392, modflux=0.732, iterdone=10, imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image',self.img+'.model'], imval=[(self.img+'.psf',1.0,[50,50,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_hogbom(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Onefield_hogbom : mfs with hogbom minor cycle """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0)#,phasecenter='J2000 19h59m57.5s +40d49m00.077s') build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=0.35, modflux=0.77, iterdone=10, imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image',self.img+'.model'], imval=[(self.img+'.psf',1.0,[50,50,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_mem(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Onefield_mem : mfs with mem minor cycle """ build 12-Sep-2018 15:30:25 + self.prepData('refim_eptwochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='8.0arcsec',niter=10,deconvolver='mem',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=12.7, modflux=6.98, iterdone=10, imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image',self.img+'.model'], imval=[(self.img+'.psf',1.0,[100,100,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_multiscale(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Onefield_multiscale : mfs with multiscale minor cycle """ build 12-Sep-2018 15:30:25 + self.prepData('refim_eptwochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='8.0arcsec',niter=10,deconvolver='multiscale',scales=[0,20,40,100],interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=1.28, modflux=2.87, iterdone=10, imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image',self.img+'.model'], imval=[(self.img+'.psf',1.0,[100,100,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_mtmfs(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Onefield_mtmfs : mt-mfs with minor cycle iterations """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=0.392, modflux=0.732, iterdone=10, imexist=[self.img+'.psf.tt0', self.img+'.residual.tt0', self.img+'.image.tt0', self.img+'.model.tt0',self.img+'.model.tt1',self.img+'.alpha'], imval=[(self.img+'.psf.tt0',1.0,[50,50,0,0]),(self.img+'.psf.tt1',1.039e-05,[50,50,0,0])]) build 12-Sep-2018 15:30:25 + ## iterdone=11 only because of the return (iterdone_p+1) in MultiTermMatrixCleaner::mtclean() ! build 12-Sep-2018 15:30:25 + self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_autonames(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Onefield_autonames : Test auto increment of image names """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',restart=False) build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',restart=False) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.psf',self.img+'_2.psf',self.img+'_3.psf'] ) build 12-Sep-2018 15:30:25 + self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_twoMS(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Onefield_twoMS : One field, two input MSs """ build 12-Sep-2018 15:30:25 + ms1 = 'refim_point_onespw0.ms' build 12-Sep-2018 15:30:25 + ms2 = 'refim_point_onespw1.ms' build 12-Sep-2018 15:30:25 + self.prepData(ms1) build 12-Sep-2018 15:30:25 + self.prepData(ms2) build 12-Sep-2018 15:30:25 +# try: build 12-Sep-2018 15:30:25 +# ## This run should fail with an exception build 12-Sep-2018 15:30:25 +# ret = tclean(vis=[ms1,ms2],field='0',spw=['0','0'], imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='hogbom',niter=10) build 12-Sep-2018 15:30:25 +# correct=False build 12-Sep-2018 15:30:25 +# except Exception as e: build 12-Sep-2018 15:30:25 +# correct=True build 12-Sep-2018 15:30:25 +# self.assertTrue(correct) build 12-Sep-2018 15:30:25 + ## This run should go smoothly. build 12-Sep-2018 15:30:25 + ret = tclean(vis=[ms1,ms2],field='0',spw=['0','0'], imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='hogbom',niter=10,datacolumn='data') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.psf',self.img+'.residual']) build 12-Sep-2018 15:30:25 + self.delData(ms1) build 12-Sep-2018 15:30:25 + self.delData(ms2) build 12-Sep-2018 15:30:25 + self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_twoMS_diffcolumns(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Onefield_twoMS_diffcolumns : One field, two input MSs, one with data and one with data and corrected """ build 12-Sep-2018 15:30:25 + ms1 = 'refim_point_onespw0.ms' build 12-Sep-2018 15:30:25 + ms2 = 'refim_point_onespw1.ms' build 12-Sep-2018 15:30:25 + self.prepData(ms1) build 12-Sep-2018 15:30:25 + self.prepData(ms2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Make corrected_data column for one of them build 12-Sep-2018 15:30:25 + _cb.open(ms2) build 12-Sep-2018 15:30:25 + _cb.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ret = tclean(vis=[ms1,ms2],field='0',spw=['0','0'], imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='hogbom',niter=10,datacolumn='corrected') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.psf',self.img+'.residual']) build 12-Sep-2018 15:30:25 + self.delData(ms1) build 12-Sep-2018 15:30:25 + self.delData(ms2) build 12-Sep-2018 15:30:25 + self.checkfinal(pstr=report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_restart_mfs(self): build 12-Sep-2018 15:30:25 + """ [onefield] : test_onefield_restart_mfs : Check calcpsf,calcres and ability to restart and continue""" build 12-Sep-2018 15:30:25 + ## TODO : Need to add and use info in the return record, when only a major cycle is done. Then check nmajorcycle. build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Only psf build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,calcpsf=True,calcres=False,deconvolver='clark') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.psf'], imexistnot=[self.img+'.residual', self.img+'.image'],nmajordone=1) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Only residual build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,calcpsf=False,calcres=True,deconvolver='clark',restoration=False) build 12-Sep-2018 15:30:25 + report1=self.th.checkall(imexist=[self.img+'.psf', self.img+'.residual'], imexistnot=[self.img+'.image'],nmajordone=1) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Start directly with minor cycle and do only the last major cycle. build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,interactive=0,calcpsf=False,calcres=False,deconvolver='clark') build 12-Sep-2018 15:30:25 + report2=self.th.checkall(ret=ret, peakres=0.392, modflux=0.732, imexist=[self.img+'.psf',self.img+'.residual', self.img+'.image'],nmajordone=1) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Re-start from existing model image and continue on... build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,interactive=0,calcpsf=False,calcres=False,deconvolver='clark') build 12-Sep-2018 15:30:25 + report3=self.th.checkall(ret=ret, peakres=0.161, modflux=0.991, imexist=[self.img+'.psf',self.img+'.residual', self.img+'.image'],nmajordone=1) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(pstr=report+report1+report2+report3) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_restart_mtmfs(self): build 12-Sep-2018 15:30:25 + """ [onefield] : test_onefield_restart_mtmfs : Check calcpsf,calcres and ability to restart and continue""" build 12-Sep-2018 15:30:25 + ## TODO : Need to add and use info in the return record, when only a major cycle is done. Then check nmajorcycle. build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Only psf build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,calcpsf=True,calcres=False,deconvolver='mtmfs') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.psf.tt0', self.img+'.psf.tt1'], imexistnot=[self.img+'.residual.tt0', self.img+'.image.tt0'],nmajordone=1) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Only residual build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,calcpsf=False,calcres=True,deconvolver='mtmfs',restoration=False) build 12-Sep-2018 15:30:25 + report1=self.th.checkall(imexist=[self.img+'.psf.tt0',self.img+'.psf.tt1', self.img+'.residual.tt0', self.img+'.residual.tt1'], imexistnot=[self.img+'.image.tt0'],nmajordone=1) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Start directly with minor cycle and do only the last major cycle. build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,interactive=0,calcpsf=False,calcres=False,deconvolver='mtmfs') build 12-Sep-2018 15:30:25 + report2=self.th.checkall(ret=ret, peakres=0.392, modflux=0.732, imexist=[self.img+'.psf.tt1',self.img+'.residual.tt1', self.img+'.image.tt1', self.img+'.alpha'],nmajordone=1,imval=[(self.img+'.alpha',-1.0,[50,50,0,0])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Re-start from existing model image and continue on... build 12-Sep-2018 15:30:25 + ## ( If restart from modified residuals... the alpha is -1.25xx which is wrong. build 12-Sep-2018 15:30:25 + ## In this case, need to do calcres=True which will do extra first major cycle (nmajor=2) ) build 12-Sep-2018 15:30:25 + ## But... current code (as of r33373) makes appropriate restored image but does not mess up residuals. build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,interactive=0,calcpsf=False,calcres=False,deconvolver='mtmfs') build 12-Sep-2018 15:30:25 + report3=self.th.checkall(ret=ret, peakres=0.136, modflux=0.988, imexist=[self.img+'.psf.tt1',self.img+'.residual.tt1', self.img+'.image.tt1', self.img+'.alpha'],nmajordone=1,imval=[(self.img+'.alpha',-1.0,[50,50,0,0])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(pstr=report+report1+report2+report3) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_all_outputs_mfs(self): build 12-Sep-2018 15:30:25 + """ [onefield] : test_onefield_all_outputs_mfs : Make all output images even when not needed """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Make only partial outputs build 12-Sep-2018 15:30:25 +# ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='hogbom') build 12-Sep-2018 15:30:25 +# report1=self.th.checkall(imexist=[self.img+'.psf', self.img+'.residual'],imexistnot=[self.img+'.image',self.img+'.model'],nmajordone=1) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Make all outputs build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='hogbom',restoration=True) build 12-Sep-2018 15:30:25 + report2=self.th.checkall(imexist=[self.img+'2.psf', self.img+'2.residual',self.img+'2.image',self.img+'2.model'],nmajordone=1) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(pstr = report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_all_outputs_mtmfs(self): build 12-Sep-2018 15:30:25 + """ [onefield] : test_onefield_all_outputs_mtmfs : Make all output images even when not needed """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Make only partial outputs build 12-Sep-2018 15:30:25 +# ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='mtmfs') build 12-Sep-2018 15:30:25 +# report1=self.th.checkall(imexist=[self.img+'.psf.tt0', self.img+'.psf.tt1'],imexistnot=[self.img+'.image.tt0',self.img+'.model.tt0', self.img+'.alpha'],nmajordone=1) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Make all outputs build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='mtmfs',restoration=True) build 12-Sep-2018 15:30:25 + report2=self.th.checkall(imexist=[self.img+'2.psf.tt0', self.img+'2.psf.tt1',self.img+'2.image.tt0',self.img+'2.model.tt0', self.img+'2.alpha'],nmajordone=1) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(pstr=report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_restore_mtmfs_niter0(self): build 12-Sep-2018 15:30:25 + """ [onefield] : test_onefield_restore_mtmfs_niter0 : Niter=0 run followed by restoration without a model""" build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## This test also checks the principal solution calculation on the dirty images. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## niter=0 run build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='mtmfs',restoration=False) build 12-Sep-2018 15:30:25 + report1=self.th.checkall(imexist=[self.img+'.psf.tt0', self.img+'.psf.tt1'], imexistnot=[self.img+'.model.tt0', self.img+'.model.tt0'],nmajordone=1) build 12-Sep-2018 15:30:25 + ## restore only build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='mtmfs',calcres=False,calcpsf=False,restoration=True) build 12-Sep-2018 15:30:25 + report2=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.alpha'],nmajordone=0, build 12-Sep-2018 15:30:25 + imval=[(self.img+'.alpha',-1.0,[50,50,0,0])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## niter=0 and restore ( in one step ) build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=0,interactive=0,deconvolver='mtmfs',restoration=True) build 12-Sep-2018 15:30:25 + report3=self.th.checkall(imexist=[self.img+'2.image.tt0', self.img+'2.alpha'],nmajordone=1, build 12-Sep-2018 15:30:25 + imval=[(self.img+'.alpha',-1.0,[50,50,0,0])] ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(pstr=report1+report2+report3) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_onefield_rectangular_pixels(self): build 12-Sep-2018 15:30:25 + """ [onefield] : test_onefield_rectangular_pixels : Test restoration with rectangular pixels (cas-7171)""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell=['10.0arcsec','30.0arcsec'],niter=10) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'], imval=[(self.img+'.image',0.482,[50,49,0,0])] ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +##Task level tests : iteration controls build 12-Sep-2018 15:30:25 +class test_iterbot(testref_base): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_mfs_1(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_Mfs_1 : Zero Iterations """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=0,interactive=0,restoration=False) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.psf', self.img+'.residual'], imexistnot=[self.img+'.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_mfs_2(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_Mfs_2 : Iterations with low gain """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=10,gain=0.1,interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=0.392, modflux=0.732, iterdone=10,nmajordone=2,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_mfs_3(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_Mfs_3 : Cycleniter test """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=10,cycleniter=3,interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=0.392, modflux=0.732, iterdone=10, nmajordone=5,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_mfs_4(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_Mfs_4 : Iterations with high gain """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=10, gain=0.5,interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=0.024, modflux=1.274, iterdone=10, nmajordone=3,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_mfs_5(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_Mfs_5 : Threshold test """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=10,threshold='0.1Jy',gain=0.5,interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=0.0924, modflux=1.129, iterdone=5, nmajordone=3,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_mfs_6(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_Mfs_6 : Cycleniter and threshold """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=10, cycleniter=3, threshold='0.1Jy',gain=0.5,interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=0.0924, modflux=1.129, iterdone=5, nmajordone=3,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_mfs_7(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_Mfs_7 : Threshold + cyclefactor to trigger major cycles earlier """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=10,threshold='0.01Jy', gain=0.5,cyclefactor=10.0,interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=0.024, modflux=1.274, iterdone=10, nmajordone=9,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_mfs_8(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_Mfs_8 : minpsffraction to trigger major cycles earlier. """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=20,threshold='0.01Jy', minpsffraction = 0.5,interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=0.16127, modflux=0.9919, iterdone=20, nmajordone=4,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_mfs_9(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_Mfs_9 : maxpsffraction """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=20,threshold='0.01Jy', minpsffraction=0.8,maxpsffraction=0.5,interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=0.16127, modflux=0.9919, iterdone=20, nmajordone=4,imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_mfs_nsigma(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_Mfs_nsigma : n-sigma threshold """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',deconvolver='clark',niter=1000,threshold='0.001Jy', nsigma=3.0, interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=0.0820, modflux=1.2873, iterdone=169, nmajordone=11, stopcode=8, imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_cube_1(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_cube_1 : iteration counting across channels (>niter) """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',deconvolver='clark',niter=10,threshold='0.75Jy',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, iterdone=90,nmajordone=2,imexist=[self.img+'.psf', self.img+'.residual']) build 12-Sep-2018 15:30:25 + ## Only chans 6 and 7 reach cycleniter, others reach threshold in fewer than 10 iters per chan. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_cube_2(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_cube_2 : High threshold, iterate only on line channels. """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',deconvolver='clark',niter=10,threshold='1.75Jy',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, peakres=1.73, modflux=0.407,iterdone=12,nmajordone=2,imexist=[self.img+'.psf', self.img+'.residual']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_cube_3(self): # test for returned summary/plot for no iteration case build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_cube_3 : Very high threshold, no iteration (verification of CAS-8576 fix) """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',deconvolver='clark',niter=10,threshold='3.5Jy',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret,iterdone=0,nmajordone=1,imexist=[self.img+'.psf', self.img+'.residual']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_cube_4(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_cube_4 : Large niter, and low threshold - catch if diverges (verification of CAS-8584 fix) """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',deconvolver='hogbom',niter=1000000,threshold='0.0000001Jy',gain=0.5,interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret,iterdone=1749,nmajordone=8,imexist=[self.img+'.psf', self.img+'.residual']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_divergence(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_divergence : Use negative loop gain to make it diverge (verification of CAS-9244 fix) """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec', niter=50,cycleniter=5, gain=-0.2,interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret,iterdone=10,nmajordone=3,imexist=[self.img+'.psf', self.img+'.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_mfs_deconvolvers(self): build 12-Sep-2018 15:30:25 + """ [iterbot] : test_iterbot_deconvolvers : Do all minor cycle algorithms respond in the same way to iteration controls ? No ! """ build 12-Sep-2018 15:30:25 + # clark and hogbom reach niter first, but multiscale gets to cyclethreshold first. Check peakres and iterdone. build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,threshold='0.1Jy', interactive=0,deconvolver='clark') build 12-Sep-2018 15:30:25 + report1=self.th.checkall(ret=ret1, peakres=0.3922, modflux=0.732, iterdone=10, nmajordone=2,imexist=[self.img+'1.psf', self.img+'1.residual', self.img+'1.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,threshold='0.1Jy', interactive=0,deconvolver='hogbom') build 12-Sep-2018 15:30:25 + report2=self.th.checkall(ret=ret2, peakres=0.3530, modflux=0.7719, iterdone=10, nmajordone=2,imexist=[self.img+'2.psf', self.img+'2.residual', self.img+'2.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ret3 = tclean(vis=self.msfile,imagename=self.img+'3',imsize=100,cell='8.0arcsec',niter=10,threshold='0.1Jy', interactive=0,deconvolver='multiscale') build 12-Sep-2018 15:30:25 + report3=self.th.checkall(ret=ret3, peakres=0.3922, modflux=0.7327, iterdone=10, nmajordone=2,imexist=[self.img+'3.psf', self.img+'3.residual', self.img+'3.image']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report1+report2+report3) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_cube_tol(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_cube_tol :threshold test to allow a tolerance (1/100) (verification of CAS-11278 fix) """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',deconvolver='hogbom',niter=1000000,threshold='0.50001Jy',gain=0.1,cycleniter=5,interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret,iterdone=158,nmajordone=4,imexist=[self.img+'.psf', self.img+'.residual']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_iterbot_cube_nsigma(self): build 12-Sep-2018 15:30:25 + """ [iterbot] Test_Iterbot_cube_nsigma : nsigma threshold for cube""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',deconvolver='hogbom',niter=1000000,threshold='0.000001Jy', nsigma=10.0, gain=0.5,interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret,iterdone=407,nmajordone=11,stopcode=8,imexist=[self.img+'.psf', self.img+'.residual']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +##Task level tests : multi-field, 2chan. build 12-Sep-2018 15:30:25 +### For some of these tests, do the same with uvsub and compare ? build 12-Sep-2018 15:30:25 +class test_multifield(testref_base): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_multifield_both_mfs(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_Multifield_both_mfs : Two fields, both mfs """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nnchan=1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nusemask=user\nmask=circle[[40pix,40pix],10pix]') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 + iterdone=13, build 12-Sep-2018 15:30:25 + nmajordone=2, build 12-Sep-2018 15:30:25 + imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image',1.075,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.image',5.590,[40,40,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.residual',0.04,[30,18,0,0])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_multifield_both_mtmfs(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_Multifield_both_mtmfs : Two fields, both mt-mfs """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\n\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nusemask=user\nmask=circle[[40pix,40pix],10pix]') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='mtmfs',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 + iterdone=12, build 12-Sep-2018 15:30:25 + nmajordone=2, build 12-Sep-2018 15:30:25 + imexist=[self.img+'.image.tt0', self.img+'1.image.tt0',self.img+'.image.tt1', self.img+'1.image.tt1', self.img+'.alpha', self.img+'1.alpha'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image.tt0',1.094,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.image.tt0',5.577,[40,40,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.alpha',-0.90,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.alpha',-1.0,[40,40,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_multifield_both_cube(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_Multifield_both_cube : Two fields, both cube""" build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + #self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\n') build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nimagename='+self.img+'2\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:48.895 +40.55.58.543\n') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0,specmode='cube',nchan=2,interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 + iterdone=42, build 12-Sep-2018 15:30:25 + nmajordone=2, build 12-Sep-2018 15:30:25 + imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image',1.434,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.image',7.44,[40,40,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'2.image',7.42,[51,40,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.image',0.758,[50,50,0,1]), build 12-Sep-2018 15:30:25 + (self.img+'1.image',3.715,[40,40,0,1]), build 12-Sep-2018 15:30:25 + (self.img+'2.image',3.675,[51,40,0,1]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_multifield_both_cube_diffshape(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_Multifield_both_cube : Two fields, both cube but different nchans""" build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nnchan=3\n') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0,specmode='cube',nchan=2,interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 + iterdone=22, build 12-Sep-2018 15:30:25 + nmajordone=2, build 12-Sep-2018 15:30:25 + imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image',1.434,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.image',7.44,[40,40,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.image',0.762,[50,50,0,1]), build 12-Sep-2018 15:30:25 + (self.img+'1.image',3.70,[40,40,0,1]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_multifield_cube_mfs(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_Multifield_cube_mfs : Two fields, one cube and one mfs""" build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nspecmode=mfs\n') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0,specmode='cube',nchan=2,interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 + iterdone=15, build 12-Sep-2018 15:30:25 + nmajordone=2, build 12-Sep-2018 15:30:25 + imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image',1.4,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.image',5.6,[40,40,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.image',0.75,[50,50,0,1])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_multifield_mfs_mtmfs(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_Multifield_mfs_mtmfs : Two fields, one mt-mfs and one mfs (i.e. different deconvolvers)""" build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nreffreq=1.5GHz\ndeconvolver=mtmfs\n') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 + iterdone=13, build 12-Sep-2018 15:30:25 + nmajordone=2, build 12-Sep-2018 15:30:25 + imexist=[self.img+'.image', self.img+'1.image.tt0',self.img+'1.alpha'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image',1.094,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.image.tt0',5.57,[40,40,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.alpha', -1.0, [40,40,0,0]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_multifield_cube_mtmfs(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_Multifield_cube_mtmfs : Two fields, one cube and one mtmfs""" build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nreffreq=1.5GHz\ndeconvolver=mtmfs\nspecmode=mfs\n') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0,specmode='cube',nchan=2,interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 + iterdone=15, # two chans in one field, and one chan in the other build 12-Sep-2018 15:30:25 + nmajordone=2, build 12-Sep-2018 15:30:25 + imexist=[self.img+'.image', self.img+'1.image.tt0',self.img+'1.alpha'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image',1.427,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.image.tt0',5.575,[40,40,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.image',0.762,[50,50,0,1]) , build 12-Sep-2018 15:30:25 + (self.img+'1.alpha', -1.0, [40,40,0,0]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_multifield_diff_gridders(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_Multifield_diff_gridders : Two fields, both mfs, gridft and wproject """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 +# ##Outlier uses gridft build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nusemask=user\nmask=circle[[40pix,40pix],10pix]\ngridder=gridft') build 12-Sep-2018 15:30:25 +# ## Outlier uses wproject but with different number of planes as the main field build 12-Sep-2018 15:30:25 +# self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nmask=circle[[40pix,40pix],10pix]\ngridder=wproject\nwprojplanes=6') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',gridder='wproject',wprojplanes=4,interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 + iterdone=13, build 12-Sep-2018 15:30:25 + nmajordone=2, build 12-Sep-2018 15:30:25 + imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image',1.075,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.image',5.58,[40,40,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_multifield_autonames(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_Multifield_4 : Test auto increment of image names """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nnchan=1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:40.895 +40.55.58.543\nusemask=user\nmask=circle[[40pix,40pix],10pix]') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',outlierfile=self.img+'.out.txt') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',outlierfile=self.img+'.out.txt',restart=False) build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',restart=False) # no outlier... build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',outlierfile=self.img+'.out.txt',restart=False) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.psf',self.img+'1.psf',self.img+'_2.psf',self.img+'1_2.psf',self.img+'_3.psf',self.img+'_4.psf',self.img+'1_4.psf'], imexistnot=[self.img+'1_3.psf'] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +### TODO : Either put a check so that if any fields overlap, an error is thrown. Or, do sensible model choosing for some modes but detect and complain for other modes where it's harder to pick which model image to use. build 12-Sep-2018 15:30:25 + def test_multifield_overlap_mfs(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_Multifield_overlap_mfs : Two overlapping image fields, both mfs """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[200,200]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:59:02.426 +40.51.14.559') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:58:39.580 +40.55.55.931",outlierfile=self.img+'.out.txt',niter=20,deconvolver='hogbom',interactive=0) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 + iterdone=40, ## both images see the brightest source. build 12-Sep-2018 15:30:25 + nmajordone=2, build 12-Sep-2018 15:30:25 + imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image',5.575,[48,51,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.image',5.574,[130,136,0,0])]) ## both images have correct flux (not twice or zero !) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_multifield_overlap_mtmfs(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_Multifield_overlap_mtmfs : Two overlapping image fields, both mt-mfs """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[200,200]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:59:02.426 +40.51.14.559\n') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',phasecenter="J2000 19:58:39.580 +40.55.55.931",outlierfile=self.img+'.out.txt',niter=20,deconvolver='mtmfs',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 + iterdone=39, ## both images see the brightest source. build 12-Sep-2018 15:30:25 + nmajordone=2, build 12-Sep-2018 15:30:25 + imexist=[self.img+'.image.tt0', self.img+'1.image.tt0'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image.tt0',5.52,[48,51,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.image.tt0',5.53,[130,136,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.alpha',-0.965,[48,51,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.alpha',-0.965,[130,136,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_multifield_facets_mfs(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_Multifield_facets_mfs : Facetted imaging (mfs) """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='8.0arcsec',phasecenter="J2000 19:59:00.2 +40.50.15.50",facets=2,deconvolver='hogbom',niter=30) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + imexist = [self.img + ext for ext in ['.image', '.mask', '.model', '.pb', '.psf', build 12-Sep-2018 15:30:25 + '.residual', '.sumwt']] build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=imexist, build 12-Sep-2018 15:30:25 + imval=[(self.img+'.psf',1.0,[100,100,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.image',5.56,[127,143,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_multifield_facets_mtmfs(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_multifield_facets_mtmfs : Facetted imaging (mt-mfs) """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='8.0arcsec',phasecenter="J2000 19:59:00.2 +40.50.15.50",facets=2,deconvolver='mtmfs',niter=30) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + imexist = [self.img + ext for ext in ['.image.tt0', '.psf.tt0', '.model.tt0', build 12-Sep-2018 15:30:25 + '.pb.tt0', '.residual.tt0', '.sumwt.tt0', build 12-Sep-2018 15:30:25 + '.mask', '.alpha', '.alpha.error']] build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=imexist, build 12-Sep-2018 15:30:25 + imval=[(self.img+'.psf.tt0',1.0,[100,100,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.image.tt0',5.56,[127,143,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.alpha',-1.0,[127,143,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @unittest.skip('Skip test.') build 12-Sep-2018 15:30:25 + def test_multifield_cube_chunks(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_Multifield_cube_chunks : Two fields, two sections of the same cube""" build 12-Sep-2018 15:30:25 + self.prepData("refim_point.ms") build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nnchan=5\nstart=5') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='10.0arcsec',specmode='cube',nchan=5,start=0,outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',interactive=0,interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 + iterdone=38, build 12-Sep-2018 15:30:25 + nmajordone=2, build 12-Sep-2018 15:30:25 + imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image',1.434,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.image',7.452,[40,40,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.image',0.762,[50,50,0,1]), build 12-Sep-2018 15:30:25 + (self.img+'1.image',3.702,[40,40,0,1]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +##Task level tests : Stokes imaging options build 12-Sep-2018 15:30:25 +class test_stokes(testref_base): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_mfs_I(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_I_mfs mfs with stokes I""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='I') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_mfs_IV(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_mfs_IV : mfs with stokes IV""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IV') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,0]),(self.img+'.image',4.0,[50,50,1,0]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_mfs_QU(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_mfs_QU : mfs with stokes QU""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='QU') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',2.0,[50,50,0,0]),(self.img+'.image',3.0,[50,50,1,0]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_mfs_Q(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_mfs_Q : mfs with stokes Q""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='Q') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',2.0,[50,50,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_mfs_U(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_mfs_U : mfs with stokes U""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='U') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',3.0,[50,50,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_mfs_V(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_mfs_V : mfs with stokes V""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='V') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',4.0,[50,50,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_cube_I(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_cube_I : cube with stokes I""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='I',interactive=0,specmode='cube',interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,0]),(self.img+'.image',1.0,[50,50,0,1]),(self.img+'.image',1.0,[50,50,0,2]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_cube_IV(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_stokes_IV : cube with stokes V""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IV',interactive=0,specmode='cube',interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,0]),(self.img+'.image',1.0,[50,50,0,1]),(self.img+'.image',1.0,[50,50,0,2]), (self.img+'.image',4.0,[50,50,1,0]),(self.img+'.image',4.0,[50,50,1,1]),(self.img+'.image',4.0,[50,50,1,2])] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_cube_QU(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_stokes_QU : cube with stokes QU""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='QU',interactive=0,specmode='cube',interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',2.0,[50,50,0,0]),(self.img+'.image',2.0,[50,50,0,1]),(self.img+'.image',2.0,[50,50,0,2]), (self.img+'.image',3.0,[50,50,1,0]),(self.img+'.image',3.0,[50,50,1,1]),(self.img+'.image',3.0,[50,50,1,2])] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_cube_Q(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_cube_Q : cube with stokes Q""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='Q',interactive=0,specmode='cube',interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',2.0,[50,50,0,0]),(self.img+'.image',2.0,[50,50,0,1]) ,(self.img+'.image',2.0,[50,50,0,2]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_cube_U(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_cube_U : cube with stokes U""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='U',interactive=0,specmode='cube',interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',3.0,[50,50,0,0]),(self.img+'.image',3.0,[50,50,0,1]) ,(self.img+'.image',3.0,[50,50,0,2]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_cube_V(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_cube_V : cube with stokes V""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='V',interactive=0,specmode='cube',interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',4.0,[50,50,0,0]),(self.img+'.image',4.0,[50,50,0,1]) ,(self.img+'.image',4.0,[50,50,0,2]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_cube_IQUV_fromRL(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_cube_IQUV_fromRL : cube with stokes IQUV""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IQUV',interactive=0,specmode='cube',interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,1]),(self.img+'.image',2.0,[50,50,1,1]), (self.img+'.image',3.0,[50,50,2,1]),(self.img+'.image',4.0,[50,50,3,1]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_cube_IQUV_fromXY(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_cube_IQUV_fromXY : cube with stokes IQUV""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linXY.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IQUV',interactive=0,specmode='cube',interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,1]),(self.img+'.image',2.0,[50,50,1,1]), (self.img+'.image',3.0,[50,50,2,1]),(self.img+'.image',4.0,[50,50,3,1]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_mtmfs_Q(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_mtmfs_Q : mtmfs with stokes Q""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='Q',deconvolver='mtmfs',nterms=2) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+append for append in build 12-Sep-2018 15:30:25 + ['.image.tt0', '.mask', '.model.tt0', build 12-Sep-2018 15:30:25 + '.pb.tt0', '.psf.tt0', '.residual.tt0', build 12-Sep-2018 15:30:25 + '.sumwt.tt0']], build 12-Sep-2018 15:30:25 + imexistnot=[self.img+'.image.alpha', build 12-Sep-2018 15:30:25 + self.img+'.alpha_error'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image.tt0',2.0,[50,50,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_mtmfs_IQUV(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_mtmfs_IQUV : mtmfs with stokes IQUV""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IQUV',deconvolver='mtmfs',nterms=2) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+append for append in build 12-Sep-2018 15:30:25 + ['.image.tt0', '.mask', '.model.tt0', build 12-Sep-2018 15:30:25 + '.pb.tt0', '.psf.tt0', '.residual.tt0', build 12-Sep-2018 15:30:25 + '.sumwt.tt0']], build 12-Sep-2018 15:30:25 + imexistnot=[self.img+'.image.alpha', build 12-Sep-2018 15:30:25 + self.img+'.alpha_error'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image.tt0',1.0,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.image.tt0',2.0,[50,50,1,0]), build 12-Sep-2018 15:30:25 + (self.img+'.image.tt0',3.0,[50,50,2,0]), build 12-Sep-2018 15:30:25 + (self.img+'.image.tt0',4.0,[50,50,3,0]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @unittest.skip('Skip func test') build 12-Sep-2018 15:30:25 + def test_stokes_cube_I_flags(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_cube_I_flags : cube with stokes I and only XY or YX flagged""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linXY.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IQUV',interactive=0,specmode='cube') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,1]),(self.img+'.image',2.0,[50,50,1,1]), (self.img+'.image',3.0,[50,50,2,1]),(self.img+'.image',4.0,[50,50,4,1]) ]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @unittest.skip('Skip func test') build 12-Sep-2018 15:30:25 + def test_stokes_cube_pseudo_I_flags(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_cube_pseudo_I_flags : cube with stokes I and one of XX or YY flagged""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linXY.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='IQUV',interactive=0,specmode='cube') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.0,[50,50,0,1]),(self.img+'.image',2.0,[50,50,1,1]), (self.img+'.image',3.0,[50,50,2,1]),(self.img+'.image',4.0,[50,50,4,1]) ]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_pseudoI_1(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_pseudoI : MFS on one channel stokes I, LL partially flagged""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ### A debug run to check total sum of weights, without any flagging. Need not turn on for actual test. build 12-Sep-2018 15:30:25 + #ret = tclean(vis=self.msfile,imagename=self.img+'_1',imsize=100,spw='0:5',cell='8.0arcsec',niter=10, stokes='pseudoI',interactive=0,specmode='mfs',weighting='natural') build 12-Sep-2018 15:30:25 + #report=self.th.checkall(imexist=[self.img+'_1.image',self.img+'_1.sumwt'],imval=[(self.img+'_1.image',1.2,[50,50,0,0]),(self.img+'_1.sumwt',1719543.62,[0,0,0,0])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ### Modify flags in the MS. build 12-Sep-2018 15:30:25 + tb.open('refim_point.ms',nomodify=False) build 12-Sep-2018 15:30:25 + flgs = tb.getcol('FLAG') build 12-Sep-2018 15:30:25 + flgs[1,:,50:84240]=True ## Flag half of LL. build 12-Sep-2018 15:30:25 + tb.putcol('FLAG',flgs) build 12-Sep-2018 15:30:25 + tb.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ### Run with pseudo-I. Sum of weight should be 3/4 of full. build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,spw='0:5',cell='8.0arcsec',niter=10, stokes='pseudoI',interactive=0,specmode='mfs',weighting='natural') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image',self.img+'.sumwt'],imval=[(self.img+'.image',1.2,[50,50,0,0]),(self.img+'.sumwt',1288281.75,[0,0,0,0])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ### Run with I. Sum of weight should be 1/2 of full build 12-Sep-2018 15:30:25 + ret_2 = tclean(vis=self.msfile,imagename=self.img+'_2',imsize=100,spw='0:5',cell='8.0arcsec',niter=10, stokes='I',interactive=0,specmode='mfs',weighting='natural') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'_2.image',self.img+'_2.sumwt'],imval=[(self.img+'_2.image',1.2,[50,50,0,0]),(self.img+'_2.sumwt',857020.0,[0,0,0,0])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_stokes_pseudoI_2(self): build 12-Sep-2018 15:30:25 + """ [onefield] Test_Stokes_pseudoI_2 : cube with stokes I and only XY or YX flagged""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linXY.ms') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ### Reference : Stokes I value should be 1.0 in the middle channel build 12-Sep-2018 15:30:25 + #ret = tclean(vis=self.msfile,imagename=self.img+'_1',imsize=100,cell='8.0arcsec',niter=10, stokes='I',interactive=0,specmode='cube',interpolation='nearest') build 12-Sep-2018 15:30:25 + #report=self.th.checkall(imexist=[self.img+'_1.image'],imval=[(self.img+'_1.image',1.0,[50,50,0,1]) ]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ### Modify flags in the MS. build 12-Sep-2018 15:30:25 + tb.open('refim_point_linXY.ms',nomodify=False) build 12-Sep-2018 15:30:25 + flgs = tb.getcol('FLAG') build 12-Sep-2018 15:30:25 + flgs[1:2,1,:]=True ## Flag all of XY and YX for channel 2 ( Keep XX,YY unflagged ) build 12-Sep-2018 15:30:25 + tb.putcol('FLAG',flgs) build 12-Sep-2018 15:30:25 + tb.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ### With strict stokes I, the middle channel will have zero build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10, stokes='I',interactive=0,specmode='cube',interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',0.0,[50,50,0,1]) ]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ### With pseudo-I, the middle channel will have 1.0 build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'_2',imsize=100,cell='8.0arcsec',niter=10, stokes='pseudoI',interactive=0,specmode='cube',interpolation='nearest') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'_2.image'],imval=[(self.img+'_2.image',1.0,[50,50,0,1]) ]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +##Task level tests : cube. build 12-Sep-2018 15:30:25 +class test_cube(testref_base): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +# def __init__(self,methodName='runTest'): build 12-Sep-2018 15:30:25 +# testref_base.__init__(self,methodName) build 12-Sep-2018 15:30:25 +# self.test_cube_0.__func__.__doc__ %="aaaa" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + super(test_cube, self).setUp() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Setup some variables to use in all the tests build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## chan 4 (TOPO) build 12-Sep-2018 15:30:25 + qfstart=qa.quantity("1.2GHz") build 12-Sep-2018 15:30:25 + #qvstart=qa.quantity("-59958.5km/s") build 12-Sep-2018 15:30:25 + # for restf=1.25GHz build 12-Sep-2018 15:30:25 + qvstart=qa.quantity("11991.7km/s") build 12-Sep-2018 15:30:25 + # ch10 build 12-Sep-2018 15:30:25 + #qvstart=qa.quantity("16788.4km/s") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + #mfstart=me.frequency('LSRK',qa.quantity("1.09999GHz")) build 12-Sep-2018 15:30:25 + # ch4 (for rest 1.25GHz) build 12-Sep-2018 15:30:25 + mfstart=me.frequency('LSRK',qa.quantity("1.199989GHz")) build 12-Sep-2018 15:30:25 + mvstart=me.radialvelocity('BARY',qa.quantity("11977.6km/s")) build 12-Sep-2018 15:30:25 + #dop = me.todoppler('radio',mfstart,qa.quantity('1.0GHz')) build 12-Sep-2018 15:30:25 + mfstart10=me.frequency('LSRK',qa.quantity(" 1.17999GHz")) build 12-Sep-2018 15:30:25 + # doppler with ch4 freq build 12-Sep-2018 15:30:25 + dop = me.todoppler('radio',mfstart,qa.quantity('1.25GHz')) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + #1chan width build 12-Sep-2018 15:30:25 + #qvwidth = qa.quantity("11991.700km/s") build 12-Sep-2018 15:30:25 + #qvwidth = qa.quantity("4796.7km/s") build 12-Sep-2018 15:30:25 + qvwidth = qa.quantity("11991.7km/s") build 12-Sep-2018 15:30:25 + mvwidth = me.radialvelocity('TOPO',qvwidth) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # restf = 1.25GHz build 12-Sep-2018 15:30:25 + # vel range: 59961.1 - -31174.7 km/s (lsrk/radio) build 12-Sep-2018 15:30:25 + # 74952.3 - -28238.3 km/s (lsrk/optical) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.testList = { build 12-Sep-2018 15:30:25 + 0:{'imagename':'Cubetest_chandefstdefwidth','spw':'0','start':0,'width':1,'outframe':'LSRK','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'channel, default start and width, LSRK'}, build 12-Sep-2018 15:30:25 + 1:{'imagename':'Cubetest_chandefstdefwidthtopo','spw':'0','start':0,'width':1, 'outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'channel, default start and width, TOPO'}, build 12-Sep-2018 15:30:25 + 2:{'imagename':'Cubetest_chandefstwidth2','spw':'0','start':0,'width':2, 'outframe':'LSRK','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'channel, default start, width=2, LSRK'}, build 12-Sep-2018 15:30:25 + 3:{'imagename':'Cubetest_chanst5wd1','spw':'0','start':5,'width':1, 'outframe':'LSRK','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'channel, start=5, default width, LSRK'}, build 12-Sep-2018 15:30:25 + # this will result in blank channnel images (calcChanFreqs requires start and width in channel build 12-Sep-2018 15:30:25 + # mode to be given in chan index build 12-Sep-2018 15:30:25 + 4:{'imagename':'Cubetest_chandefstwd1spwsel','spw':'0:5~19','start':0,'width':1, 'outframe':'LSRK','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'channel, spw=0:5~19, LSRK'}, build 12-Sep-2018 15:30:25 + #5:{'imagename':'Cubetest_freqdefstwd2','spw':'0','start':'','width':'40MHz','outframe':'TOPO', build 12-Sep-2018 15:30:25 + # 'desc':'frequency, default start, width=\'40MHz\', TOPO'}, build 12-Sep-2018 15:30:25 + # data set changed! build 12-Sep-2018 15:30:25 + 5:{'imagename':'Cubetest_freqdefstwd2','spw':'0','start':'','width':'100MHz','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'frequency, default start, width=\'100MHz\'(2 x chanwidth), TOPO'}, build 12-Sep-2018 15:30:25 + 6:{'imagename':'Cubetest_freqst2defwd','spw':'0','start':'1.1GHz','width':'','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'frequency, start=\'1.1GHz\', default width, TOPO'}, build 12-Sep-2018 15:30:25 + 7:{'imagename':'Cubetest_freqst2defwdspwsel','spw':'0:4~19','start':'1.1GHz','width':'','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'frequency, start=\'1.1GHz\', default width, spw=0:4~19, TOPO'}, build 12-Sep-2018 15:30:25 + 8:{'imagename':'Cubetest_freqst10wdm','spw':'0','start':'1.5GHz','width':'-50MHz','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'frequency, start=\'1.5GHz\', width=\'-50MHz\', TOPO'}, build 12-Sep-2018 15:30:25 + 9:{'imagename':'Cubetest_veldefstwd2','spw':'0','start':'','width':'23983.4km/s','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'frequency, default start, width=\'23983.4km/s\', TOPO'}, build 12-Sep-2018 15:30:25 + 10:{'imagename':'Cubetest_veldefstwd2m','spw':'0','start':'','width':'-23983.4km/s','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'velocity, default start, width=\'-23983.4m/s\', TOPO'}, build 12-Sep-2018 15:30:25 + 11:{'imagename':'Cubetest_velst4defwd','spw':'0','start':'11991.7km/s','width':'','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'velocity, start=\'11991.7km/s\', default width, TOPO'}, build 12-Sep-2018 15:30:25 + 12:{'imagename':'Cubetest_velst4defwdbary','spw':'0','start':'11977.6km/s','width':'','outframe':'BARY','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'velocity, start=\'11977.6km/s\', default width, BARY'}, build 12-Sep-2018 15:30:25 + # currently 13 is not quite properly working, investigating - 2014.08.27 TT build 12-Sep-2018 15:30:25 + # for refim_point.ms ch9=-41347.8km/s (opt) build 12-Sep-2018 15:30:25 + #13:{'imagename':'Cubetest_optvelst10wdeflsrk','spw':'0','start':'-49962.6km/s','width':'', build 12-Sep-2018 15:30:25 + 13:{'imagename':'Cubetest_optvelst19wdlsrk','spw':'0','start':'-41347.8km/s','width':'20000km/s', build 12-Sep-2018 15:30:25 + 'veltype':'optical','outframe':'LSRK', build 12-Sep-2018 15:30:25 + ## 'desc':'velocity, start=\'74952.3km/s\', default width, veltype=optical LSRK'}, build 12-Sep-2018 15:30:25 + # 'desc':'velocity, start=\'-49962.6km/s\', default width, veltype=optical LSRK'}, build 12-Sep-2018 15:30:25 + 'desc':'velocity, start=\'-41347.5km/s\', default width , veltype=optical LSRK'}, build 12-Sep-2018 15:30:25 + 14:{'imagename':'Cubetest_stqfreqdefwd','spw':'0','start':qfstart,'width':'', 'veltype':'radio','outframe':'', build 12-Sep-2018 15:30:25 + 'desc':'frequency, start(quanity)=%s, default width, veltype=radio LSRK' % qfstart}, build 12-Sep-2018 15:30:25 + 15:{'imagename':'Cubetest_stmfreqdefwd','spw':'0','start':mfstart,'width':'', 'veltype':'radio','outframe':'', build 12-Sep-2018 15:30:25 + 'desc':'frequency, start=%s, default width, veltype=radio LSRK' % mfstart}, build 12-Sep-2018 15:30:25 + 16:{'imagename':'Cubetest_stqveldefwd','spw':'0','start':qvstart,'width':'','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'velocity(quantity), start=%s, default width, TOPO ' % qvstart}, build 12-Sep-2018 15:30:25 + 17:{'imagename':'Cubetest_stmveldefwd','spw':'0','start':mvstart,'width':'','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'velocity(measure), start=%s, default width(outframe=TOPO will be overridden)' % mvstart}, build 12-Sep-2018 15:30:25 + 18:{'imagename':'Cubetest_veldefstqvwidth','spw':'0','start':'','width':qvwidth,'outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'velocity, default start, width(quantity)=%s' % qvwidth}, build 12-Sep-2018 15:30:25 + 19:{'imagename':'Cubetest_veldefstmvwidth','spw':'0','start':'','width':mvwidth,'outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'velocity, default start, width(measure)=%s, TOPO' % mvwidth}, build 12-Sep-2018 15:30:25 + 20:{'imagename':'Cubetest_stdopdefwd','spw':'0','start':dop,'width':'','outframe':'LSRK','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'doppler, start=%s, default width, LSRK' % dop}, build 12-Sep-2018 15:30:25 + # with a gap in spw channel sel build 12-Sep-2018 15:30:25 + 21:{'imagename':'Cubetest_st4gap','spw':'0:4~9;12~14','start':4,'width':'','outframe':'LSRK','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'channel, start=%s, default width, channel gap (10-11) LSRK' % 4}, build 12-Sep-2018 15:30:25 + # stride > 1 build 12-Sep-2018 15:30:25 + 22:{'imagename':'Cubetest_st4stride2','spw':'0:0~10^2','start':0,'width':'','outframe':'LSRK','veltype':'radio', 'interpolation':'nearest', build 12-Sep-2018 15:30:25 + 'desc':'channel, start=%s, default width, step=2 LSRK nearest' % 0}, build 12-Sep-2018 15:30:25 + 23:{'imagename':'Cubetest_defstspwchansel4','spw':'0:4~13','start':'','width':'','outframe':'TOPO','veltype':'radio', build 12-Sep-2018 15:30:25 + 'desc':'spw with channel selection( 0:4~13 ), default start, LSRK nearest'} build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +# self.test_cube_0.__func__.__doc__ %=self.testList[0]['desc'] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def run_cubetclean(self, testid): build 12-Sep-2018 15:30:25 + """ core function to execute a cube tclean """ build 12-Sep-2018 15:30:25 + if self.testList[testid].has_key('interpolation'): build 12-Sep-2018 15:30:25 + interpolation = self.testList[testid]['interpolation'] build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + interpolation = 'linear' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw=self.testList[testid]['spw'],\ build 12-Sep-2018 15:30:25 + imagename=self.img+self.testList[testid]['imagename'],\ build 12-Sep-2018 15:30:25 + start=self.testList[testid]['start'],\ build 12-Sep-2018 15:30:25 + width=self.testList[testid]['width'],\ build 12-Sep-2018 15:30:25 + veltype=self.testList[testid]['veltype'],\ build 12-Sep-2018 15:30:25 + outframe=self.testList[testid]['outframe'], \ build 12-Sep-2018 15:30:25 + interpolation=interpolation) build 12-Sep-2018 15:30:25 + return ret build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_0(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_0 new """ build 12-Sep-2018 15:30:25 + testid=0 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50002, build 12-Sep-2018 15:30:25 + [50,50,0,0])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',999988750) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_1(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_1 """ build 12-Sep-2018 15:30:25 + testid=1 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50002, build 12-Sep-2018 15:30:25 + [50,50,0,0])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO', 9.9999999e8) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_2(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_2 """ build 12-Sep-2018 15:30:25 + testid=2 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.4643, build 12-Sep-2018 15:30:25 + [50,50,0,0])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.02498846e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_3(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_3 """ build 12-Sep-2018 15:30:25 + # start = 5 (1.25GHZ IN TOPO) build 12-Sep-2018 15:30:25 + testid=3 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.2000, build 12-Sep-2018 15:30:25 + [50,50,0,0])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.249985937e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_4(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_4 """ build 12-Sep-2018 15:30:25 + testid=4 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + # NEED CHECK!!! build 12-Sep-2018 15:30:25 + #report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + #imval=[(self.img+self.testList[testid]['imagename']+'.image',1.5000, build 12-Sep-2018 15:30:25 + #[50,50,0,0])]) build 12-Sep-2018 15:30:25 + #report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.23998593e9) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_5(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_5 """ build 12-Sep-2018 15:30:25 + # width by freq (2x chanw) result should be the same as #2 build 12-Sep-2018 15:30:25 + testid=5 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.4643, build 12-Sep-2018 15:30:25 + [50,50,0,0])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.025e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_6(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_6 """ build 12-Sep-2018 15:30:25 + # start in freq=1.1GHz (=chan5) build 12-Sep-2018 15:30:25 + testid=6 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.36365354, build 12-Sep-2018 15:30:25 + [50,50,0,0])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.1e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_7(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_7 """ build 12-Sep-2018 15:30:25 + # start 1.1GHz(TOPO)=chan5 spw=4~19 build 12-Sep-2018 15:30:25 + ##as of 03/23/2017 it is not.... chan2 = 1.1e9 (in refim_point.ms) build 12-Sep-2018 15:30:25 + testid=7 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',0.0, build 12-Sep-2018 15:30:25 + [50,50,0,0]),(self.img+self.testList[testid]['imagename']+'.image',1.2000, build 12-Sep-2018 15:30:25 + [50,50,0,3])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.1e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_8(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_8 """ build 12-Sep-2018 15:30:25 + # start =1.5GHz(chan10) width=-50MHz TOPO (descending freq) build 12-Sep-2018 15:30:25 + testid=8 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.42858946, build 12-Sep-2018 15:30:25 + [50,50,0,9])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.5e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_9(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_9 """ build 12-Sep-2018 15:30:25 + # width in vel (=23983.4km/s=2xChanW) def start (=cube will be ascending order in vel) build 12-Sep-2018 15:30:25 + testid=9 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.46184647, build 12-Sep-2018 15:30:25 + [50,50,0,9])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.925e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_10(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_10 """ build 12-Sep-2018 15:30:25 + # width in vel = -23983.4m/s def start (cube will be in descending order in vel) build 12-Sep-2018 15:30:25 + testid=10 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.46184647, build 12-Sep-2018 15:30:25 + [50,50,0,0])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.025e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_11(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_11 """ build 12-Sep-2018 15:30:25 + # start 11991.7km/s (chan4) build 12-Sep-2018 15:30:25 + testid=11 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001776, build 12-Sep-2018 15:30:25 + [50,50,0,4])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.2e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_12(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_12 """ build 12-Sep-2018 15:30:25 + # start 11977.6km/s (BARY) = chan4 build 12-Sep-2018 15:30:25 + testid=12 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001931, build 12-Sep-2018 15:30:25 + [50,50,0,4])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','BARY',1.200058783e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_13(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_13 """ build 12-Sep-2018 15:30:25 + # build 12-Sep-2018 15:30:25 + testid=13 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + # use own tclean command as nchan need to modify build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,specmode='cube',nchan=8,restfreq=['1.25GHz'],phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',spw=self.testList[testid]['spw'],imagename=self.img+self.testList[testid]['imagename'],start=self.testList[testid]['start'], width=self.testList[testid]['width'],veltype=self.testList[testid]['veltype'],outframe=self.testList[testid]['outframe']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + #report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + #imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001931, build 12-Sep-2018 15:30:25 + #[50,50,0,4])]) build 12-Sep-2018 15:30:25 + #report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.2000e9) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_14(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_14 """ build 12-Sep-2018 15:30:25 + # start = quantity ('1.2GHz') frame default(LSRK) build 12-Sep-2018 15:30:25 + testid=14 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.25000215, build 12-Sep-2018 15:30:25 + [50,50,0,0])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.2e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_15(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_15 """ build 12-Sep-2018 15:30:25 + # measure freq in LSRK ch4 build 12-Sep-2018 15:30:25 + testid=15 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image', 1.25001216, build 12-Sep-2018 15:30:25 + [50,50,0,0])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.199989e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_16(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_16 """ build 12-Sep-2018 15:30:25 + # start quantity vel=11991.7km/s outframe=topo (ascending vel order) build 12-Sep-2018 15:30:25 + testid=16 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001776, build 12-Sep-2018 15:30:25 + [50,50,0,4])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.2000e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_17(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_17 """ build 12-Sep-2018 15:30:25 + # start measure vel=11977.6km/s BARY, outframe=TOPO will be overridedden (ascending vel order) build 12-Sep-2018 15:30:25 + testid=17 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001931, build 12-Sep-2018 15:30:25 + [50,50,0,4])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','BARY',1.200058783e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_18(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_18 """ build 12-Sep-2018 15:30:25 + # defaut start, width in vel (quantity) +11991.7km/s (TOPO, radio)=datachan width, will be build 12-Sep-2018 15:30:25 + # ascending order in vel so highet DATA channel will be chan 0 in the image (image chan0=1.45GHz) build 12-Sep-2018 15:30:25 + testid=18 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001764, build 12-Sep-2018 15:30:25 + [50,50,0,9])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.45e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_19(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_19 """ build 12-Sep-2018 15:30:25 + # default start, width in vel (measure) +11991.7km/s (TOPO, radio) build 12-Sep-2018 15:30:25 + testid=19 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.50001764, build 12-Sep-2018 15:30:25 + [50,50,0,9])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.45e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_20(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_20 """ build 12-Sep-2018 15:30:25 + # doppler (with ch4 LSRK freq, rest freq=1.25GHz) build 12-Sep-2018 15:30:25 + testid=20 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.5000546, build 12-Sep-2018 15:30:25 + [50,50,0,4])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.199989152e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_21(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_21 """ build 12-Sep-2018 15:30:25 + # data sel with channel gap (10,11 excluded) 4~9, 12~14 build 12-Sep-2018 15:30:25 + testid=21 build 12-Sep-2018 15:30:25 + self.testList[testid]['interpolation']='nearest' build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.250001562, [50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+self.testList[testid]['imagename']+'.image',0.0, [50,50,0,6]), build 12-Sep-2018 15:30:25 + (self.img+self.testList[testid]['imagename']+'.image',0.0, [50,50,0,7])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',1.199986500e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_22(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_22 """ build 12-Sep-2018 15:30:25 + # stride (step=2) use nearest interpolation (other interpotion methods build 12-Sep-2018 15:30:25 + # may not work well...) build 12-Sep-2018 15:30:25 + testid=22 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.5000546, build 12-Sep-2018 15:30:25 + [50,50,0,0])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','LSRK',0.999988750387e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_23(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_23 """ build 12-Sep-2018 15:30:25 + testid=23 build 12-Sep-2018 15:30:25 + print " : " , self.testList[testid]['desc'] build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = self.run_cubetclean(testid) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+self.testList[testid]['imagename']+'.psf') and os.path.exists(self.img+self.testList[testid]['imagename']+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+self.testList[testid]['imagename']+'.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+self.testList[testid]['imagename']+'.image',1.2500156, build 12-Sep-2018 15:30:25 + [50,50,0,0])]) build 12-Sep-2018 15:30:25 + report2 = self.th.checkspecframe(self.img+self.testList[testid]['imagename']+'.image','TOPO',1.20e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # following tests for cube image spectral channel order for the data with decreasing channel frequecies build 12-Sep-2018 15:30:25 + def test_cube_descendF1(self): build 12-Sep-2018 15:30:25 + # default start and width build 12-Sep-2018 15:30:25 + # first image channel = first data channel, image channel frequecy descreases with increasing channel number build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF1: specmode cube with descending frequency data, default start and width """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image','LSRK',1.949978e9, -0.049999438e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_descendF2(self): build 12-Sep-2018 15:30:25 + # first image channel = data channel 5, image channel frequecy descreases with increasing channel number build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF2: specmode cube with descending frequency data, start in channel no. with default width """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', start=5, width='', imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image','LSRK',1.699981e9,-0.049999438e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_descendF3(self): build 12-Sep-2018 15:30:25 + # cube image should be identical with test_cube_descendF2 build 12-Sep-2018 15:30:25 + # first image channel = data channel 5, width=1, ->image channel frequecy descreases with increasing channel number build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF3: specmode cube with descending frequency data, start in channel no. with width=1 """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', start=5, width=1, imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image','LSRK',1.699981e9,-0.049999438e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_descendF4(self): build 12-Sep-2018 15:30:25 + # start in channel no., width=-1 build 12-Sep-2018 15:30:25 + # first image channel = data channel 9, -> channel frequecy increases with increasing image channel number build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF4: specmode cube with descending frequency data, start in freuquency with default width """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', start=9, width=-1, imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image','LSRK', 1.499983125e9,0.049999438e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_descendF5(self): build 12-Sep-2018 15:30:25 + # start in frequency, default width build 12-Sep-2018 15:30:25 + # first image channel = data channel 9, -> channel frequecy increases with increasing channel number build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF5: specmode cube with descending frequency data, start in freuquency with default width """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', start='1.499983125GHz', width='', imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image','LSRK',1.499983125e9,0.049999438e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_descendF6(self): build 12-Sep-2018 15:30:25 + # start in frequency, positive width build 12-Sep-2018 15:30:25 + # first image channel = data channel 9, -> channel frequecy increases with increasing channel number build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF6: specmode cube with descending frequency data, start in freuquency with a positive width """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', start='1.499983125GHz', width='0.049999438GHz', imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image','LSRK',1.499983125e9,0.049999438e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_descendF7(self): build 12-Sep-2018 15:30:25 + # start in frequency, negative width build 12-Sep-2018 15:30:25 + # first image channel = data channel 5, -> channel frequecy decreases with increasing channel number build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF7: specmode cube with descending frequency data, start in freuquency with a negative width """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', start='1.699981GHz', width='-0.049999438GHz', imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image','LSRK',1.699981e9,-0.049999438e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_descendF8(self): build 12-Sep-2018 15:30:25 + # start='', a positive frequency width build 12-Sep-2018 15:30:25 + # the data channel 0 - 9 will be selected, but since width >0 for the ms, image channel order will be reversed w.r.t data channel order build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF8: specmode cube with descending frequency data, width in a positive freuquency with default start """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', start='', width='0.049999438GHz', imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image', 'LSRK', 0.999989e9, 0.049999438e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_descendF9(self): build 12-Sep-2018 15:30:25 + # start='', a netative frequency width build 12-Sep-2018 15:30:25 + # the data channel 0 - 9 will be selected, but since width <0 for the ms, image channel order will be the same order as data channel build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF9: specmode cube with descending frequency data, width in a positive freuquency with default start """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', start='', width='-0.049999438GHz', imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image', 'LSRK', 1.44998369263e9, -0.049999438e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_descendF10(self): build 12-Sep-2018 15:30:25 + # start in velocity , width='' build 12-Sep-2018 15:30:25 + # first image channel = data channel 5, -> channel velocity increases with increasing channel number build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF10: specmode cube with descendign frequency data, start in velocity with defualt width """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', start='-107920.698km/s', width='', imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image', 'LSRK', 1.699980875e9, -0.049999438e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_descendF11(self): build 12-Sep-2018 15:30:25 + # start in velocity , a positive vel width build 12-Sep-2018 15:30:25 + # first image channel = data channel 5, -> channel velocity increases with increasing channel number build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF11: specmode cube with descendign frequency data, start in velocity with defualt width """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', start='-107920.698km/s', width='1.1991563418e4km/s', imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image', 'LSRK', 1.699980875e9, -0.049999438e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_descendF12(self): build 12-Sep-2018 15:30:25 + # start in velocity , a negative vel width build 12-Sep-2018 15:30:25 + # first image channel = data channel 9, -> channel velocity decreases with increasing channel number build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF12: specmode cube with descendign frequency data, start in velocity with defualt width """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', start='-59954.444km/s', width='-1.1991563418e4km/s', imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image', 'LSRK', 1.49998312558e9, 0.049999438e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_descendF13(self): build 12-Sep-2018 15:30:25 + # width in a positive velocity, default start build 12-Sep-2018 15:30:25 + # the data channel 10-19 (lower side in vel) will be selected, since vel width >0, image channel order will be reversed order w.r.t data channel order build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF13: specmode cube with descendign frequency data, start in velocity with defualt width """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', start='', width='1.1991563418e4km/s', imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image', 'LSRK', 1.449983688e9, -0.0499994375194e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_descendF14(self): build 12-Sep-2018 15:30:25 + # width in a negative velocity, default start build 12-Sep-2018 15:30:25 + # the data channel 10-19 (lower side in vel) will be selected, since vel width <0, image channel order will the same order w.r.t data channel order build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_DescendF14: specmode cube with descendign frequency data, start in velocity with defualt width """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_descendingfreqs.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='0',imsize=100,cell='8.0arcsec',niter=10,\ build 12-Sep-2018 15:30:25 + specmode='cube',nchan=10,restfreq=['1.25GHz'],\ build 12-Sep-2018 15:30:25 + phasecenter="J2000 19:59:28.500 +40.44.01.50",deconvolver='hogbom',\ build 12-Sep-2018 15:30:25 + spw='0', start='', width='-1.1991563418e4km/s', imagename=self.img,veltype='radio',outframe='LSRK') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report = self.th.checkspecframe(self.img+'.image', 'LSRK', 0.999988750387e9, 0.049999438e9) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_D1(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_D1 : specmode cubedata - No runtime doppler corrections """ build 12-Sep-2018 15:30:25 + self.prepData('refim_Cband.G37line.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='1',spw='0:105~135',specmode='cubedata',nchan=30,start=105,width=1,veltype='radio',imagename=self.img,imsize=256,cell='0.01arcmin',phasecenter=1,deconvolver='hogbom',niter=10) build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',86.254,[128,128,0,18])]) build 12-Sep-2018 15:30:25 + ## line is smoother build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_D2(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_D2 : specmode cube - WITH doppler corrections """ build 12-Sep-2018 15:30:25 + self.prepData('refim_Cband.G37line.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='1',spw='0:105~135',specmode='cube',nchan=30,start=105,width=1,veltype='radio',imagename=self.img,imsize=256,cell='0.01arcmin',phasecenter=1,deconvolver='hogbom',niter=10) build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.residual') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',92.1789,[128,128,0,20])]) build 12-Sep-2018 15:30:25 + ## line is tighter build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @unittest.skip('Skip test.') build 12-Sep-2018 15:30:25 + def test_cube_D3(self): build 12-Sep-2018 15:30:25 + """ EMPTY : [cube] Test_Cube_D3 : specmode cubesrc - Doppler correct to a SOURCE ephemeris""" build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='1',spw='0:105~135',specmode='cubesrc',nchan=30,start=105,width=1,veltype='radio',imagename=self.img,imsize=256,cell='0.01arcmin',phasecenter=1,deconvolver='hogbom',niter=10) build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.residual') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_continuum_subtract_uvsub(self): build 12-Sep-2018 15:30:25 + """ [cube] Test_Cube_continuum_subtract : Using uvsub """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='reset0') build 12-Sep-2018 15:30:25 + plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='data',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.step0data.png',title="original data") build 12-Sep-2018 15:30:25 + plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='model',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.step0model.png',title="empty model") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # Let's include a subdir in the output image name. This could cause failures, at build 12-Sep-2018 15:30:25 + # least in parallel mode (CAS-10937). build 12-Sep-2018 15:30:25 + imagename = os.path.join(self.img_subdir, self.img) build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=imagename,imsize=100,cell='8.0arcsec', spw='0:12~19',niter=50,gain=0.2,savemodel='modelcolumn',deconvolver='mtmfs') build 12-Sep-2018 15:30:25 +# self.assertTrue(self.th.exists(self.img+'.model') ) build 12-Sep-2018 15:30:25 +# self.assertTrue( self.th.checkmodelchan(self.msfile,10) == 0.0 and self.th.checkmodelchan(self.msfile,3) > 0.0 ) build 12-Sep-2018 15:30:25 + plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='model',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.step1.png',title="model after partial mtmfs on some channels") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='reset0') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',startmodel=[self.img+'.model.tt0',self.img+'.model.tt1'], spw='0',niter=0,savemodel='modelcolumn',deconvolver='mtmfs') build 12-Sep-2018 15:30:25 +# self.assertTrue( self.th.checkmodelchan(self.msfile,10) > 0.0 and self.th.checkmodelchan(self.msfile,3) > 0.0 build 12-Sep-2018 15:30:25 + plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='model',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.step2.png',title="model after mtmfs predict on full spw" ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='data-model',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.step3data.png',title="data-model") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +# def test_cube_continuum_subtract_otf(self): build 12-Sep-2018 15:30:25 +# """ EMPTY : [cube] Test_Cube_continuum_subtract : On-The-Fly using multifield """ build 12-Sep-2018 15:30:25 +# self.prepData('refim_point_withline.ms') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_badchannel_restoringbeam(self): build 12-Sep-2018 15:30:25 + """ [cube] Test auto restoring beam with a bad edge channel """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,specmode='cube',imsize=100,cell='10.0arcsec',niter=10,deconvolver='hogbom') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 + report1=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',0.889,[54,50,0,0]) , (self.img+'.image',0.0602,[54,50,0,19]) , (self.img+'.residual',0.033942,[54,50,0,19]) ]) build 12-Sep-2018 15:30:25 + # first channel's psf is 'bad' and wider along one axis. This offcenter location is higher in value build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'1',specmode='cube',imsize=100,cell='10.0arcsec',niter=10,deconvolver='hogbom',restoringbeam='common') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'1.psf') and os.path.exists(self.img+'1.image') ) build 12-Sep-2018 15:30:25 + report2=self.th.checkall(imexist=[self.img+'1.image'],imval=[(self.img+'1.image',0.8906,[54,50,0,0]), (self.img+'1.image',0.35945,[54,50,0,19]) , (self.img+'1.residual',0.033942,[54,50,0,19]) ]) build 12-Sep-2018 15:30:25 + # OLD - first channel has been restored by a 'common' beam picked from channel 2 build 12-Sep-2018 15:30:25 + self.checkfinal(report1+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +# def test_cube_explicit_restoringbeam(self): build 12-Sep-2018 15:30:25 +# """ [cube] Test explicit restoring beams : Test peak flux and off source value for smoothed residuals""" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_chanchunks(self): build 12-Sep-2018 15:30:25 + """ [cube] Test channel chunking for large cubes """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 +# ret = tclean(vis=self.msfile,imagename=self.img,specmode='cube',imsize=100,cell='10.0arcsec',niter=10,deconvolver='hogbom', savemodel='modelcolumn') build 12-Sep-2018 15:30:25 +# self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.image') ) build 12-Sep-2018 15:30:25 +# report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.image',1.5002,[50,50,0,0]) , (self.img+'.image',0.769,[50,50,0,19]) ]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'cc',specmode='cube',imsize=100,cell='10.0arcsec',niter=10,deconvolver='hogbom',chanchunks=7) build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'cc.psf') and os.path.exists(self.img+'cc.image') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'cc.image'],imval=[(self.img+'cc.image',1.5002,[50,50,0,0]) , (self.img+'cc.image',0.769,[50,50,0,19]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_chanchunks_auto(self): build 12-Sep-2018 15:30:25 + """ [cube] Test channel chunking for large cubes : automatic calc of nchanchunks """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'cc',specmode='cube',imsize=100,cell='10.0arcsec',niter=10,deconvolver='hogbom',chanchunks=-1) build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'cc.psf') and os.path.exists(self.img+'cc.image') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'cc.image'],imval=[(self.img+'cc.image',1.5002,[50,50,0,0]) , (self.img+'cc.image',0.769,[50,50,0,19]) ]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_cube_chanchunks_savemodel(self): build 12-Sep-2018 15:30:25 + """ [cube] Test channel chunking for large cubes and save model """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'cc',specmode='cube',imsize=100,cell='10.0arcsec',niter=10,deconvolver='hogbom',chanchunks=2,savemodel='modelcolumn') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'cc.psf') and os.path.exists(self.img+'cc.image') ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'cc.image'],imval=[(self.img+'cc.image',1.5002,[50,50,0,0]) , (self.img+'cc.image',0.769,[50,50,0,19]) ]) build 12-Sep-2018 15:30:25 + self.assertTrue( self.th.checkmodelchan(self.msfile,5) > 0.0 and self.th.checkmodelchan(self.msfile,18) > 0.0 ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +##Task level tests : masks and clean boxes. build 12-Sep-2018 15:30:25 +class test_mask(testref_base): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_1(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_1 : Input mask as file and string : mfs """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + mstr = 'circle[[50pix,80pix],10pix]' build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.mask.txt', '#CRTFv0 CASA Region Text Format version 0\n'+mstr+'\n') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='user',mask=self.img+'.mask.txt') build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='user',mask=mstr) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'1.mask', self.img+'2.mask'], imval=[(self.img+'1.mask',0.0,[50,50,0,0]),(self.img+'1.mask',1.0,[50,80,0,0]),(self.img+'2.mask',0.0,[50,50,0,0]),(self.img+'2.mask',1.0,[50,80,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_2(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_2 : Input mask as file and string : cube (few channels) """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + mstr = 'circle[[50pix,50pix],10pix],range=[1.1GHz,1.5GHz]' build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.mask.txt', '#CRTFv0 CASA Region Text Format version 0\n'+mstr+'\n') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',specmode='cube',interactive=0,usemask='user',mask=self.img+'.mask.txt') build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',specmode='cube',interactive=0,usemask='user',mask=mstr) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'1.mask', self.img+'2.mask'], imval=[(self.img+'1.mask',0.0,[50,50,0,1]),(self.img+'1.mask',1.0,[50,50,0,2]),(self.img+'1.mask',1.0,[50,50,0,10]),(self.img+'1.mask',0.0,[50,50,0,11]),(self.img+'2.mask',0.0,[50,50,0,1]),(self.img+'2.mask',1.0,[50,50,0,2]),(self.img+'2.mask',1.0,[50,50,0,10]),(self.img+'2.mask',0.0,[50,50,0,11])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_3(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_3 : Input mask as image-to-be-regridded (ra/dec) : mfs """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + mstr = 'circle[[50pix,50pix],10pix]' build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.mask.txt', '#CRTFv0 CASA Region Text Format version 0\n'+mstr+'\n') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='user',mask=self.img+'.mask.txt') build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='user',mask=self.img+'1.mask',phasecenter='J2000 19h59m57.5s +40d49m00.077s') # shift phasecenter build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'1.mask', self.img+'2.mask'], imval=[(self.img+'1.mask',1.0,[50,50,0,0]),(self.img+'2.mask',1.0,[91,13,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_4(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_4 : Input mask as image-to-be-regridded(ra/dec/specframe) : cube """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + mstr = 'circle[[50pix,50pix],10pix],range=[1.1GHz,1.5GHz]' build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.mask.txt', '#CRTFv0 CASA Region Text Format version 0\n'+mstr+'\n') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',specmode='cube',interactive=0,usemask='user',mask=self.img+'.mask.txt') build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',specmode='cube',start='1.3GHz',interactive=0,usemask='user',mask=self.img+'1.mask') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'1.mask', self.img+'2.mask'], imval=[(self.img+'1.mask',0.0,[50,50,0,1]),(self.img+'1.mask',1.0,[50,50,0,2]),(self.img+'1.mask',1.0,[50,50,0,10]),(self.img+'1.mask',0.0,[50,50,0,11]),(self.img+'2.mask',1.0,[50,50,0,0]),(self.img+'2.mask',1.0,[50,50,0,4]),(self.img+'2.mask',0.0,[50,50,0,10])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_5(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_5 : Input cube mask that has different chan build 12-Sep-2018 15:30:25 + ranges (use mask from the 1st tclean with a different channel range in the 2nd tclean run)""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + mstr = 'circle[[50pix,50pix],10pix]' build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.mask.txt', '#CRTFv0 CASA Region Text Format version 0\n'+mstr+'\n') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=1,deconvolver='hogbom',specmode='cube',start=0,nchan=10,interactive=0,usemask='user',mask=self.img+'.mask.txt') build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=1,deconvolver='hogbom',specmode='cube',start=5,nchan=10,interactive=0,usemask='user',mask=self.img+'1.mask') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'1.mask', self.img+'2.mask'], imval=[(self.img+'1.mask',1.0,[50,50,0,1]),(self.img+'1.mask',1.0,[50,50,0,2]),(self.img+'1.mask',1.0,[50,50,0,9]),(self.img+'2.mask',1.0,[50,50,0,0]),(self.img+'2.mask',1.0,[50,50,0,4]),(self.img+'2.mask',0.0,[50,50,0,5])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_autobox(self): build 12-Sep-2018 15:30:25 + # changed to use threshold based automasking build 12-Sep-2018 15:30:25 + """ [mask] test_mask_autobox : Autobox """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='auto-thresh') build 12-Sep-2018 15:30:25 + # temporarily change value test to make it pass until extra masking in final minor cycle is resolved.... build 12-Sep-2018 15:30:25 + #report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,80,0,0])]) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,85,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_autobox_redraw(self): build 12-Sep-2018 15:30:25 + # changed to use threshold based automasking build 12-Sep-2018 15:30:25 + """ [mask] test_mask_autobox_redraw : Autoboxing with a redraw after each major cycle """ build 12-Sep-2018 15:30:25 + self.prepData('refim_eptwochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='auto-thresh',maskthreshold=0.5) build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=20,cycleniter=10,deconvolver='hogbom',interactive=0,usemask='auto-thresh',maskthreshold=0.5) build 12-Sep-2018 15:30:25 + # tweak in automask threshold in the code changed masking extent 2016-03-21 build 12-Sep-2018 15:30:25 + #report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[60,30,0,0]),(self.img+'2.mask',1.0,[60,30,0,0])]) build 12-Sep-2018 15:30:25 + # temporarily change the value test for unmasked region to make it pass (replace with the above when the extra masking issue is resolved...) build 12-Sep-2018 15:30:25 + #report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[60,85,0,0]),(self.img+'2.mask',1.0,[60,30,0,0])]) build 12-Sep-2018 15:30:25 + #change in behavior due to automask code modification on July 1st,2016 build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[60,85,0,0]),(self.img+'2.mask',0.0,[60,30,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_autobox_nmask(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_autobox_nmask : Autoboxing with nmask """ build 12-Sep-2018 15:30:25 + # this won't be triggering actual pruning but just to check going into write places build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom', build 12-Sep-2018 15:30:25 + interactive=0,usemask='auto-thresh',nmask=3) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,85,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_autobox2_nmask(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_autobox2_nmask : Autoboxing (no binning) with nmask""" build 12-Sep-2018 15:30:25 + # this won't be triggering actual pruning but just to check going into write places build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom', build 12-Sep-2018 15:30:25 + interactive=0,usemask='auto-thresh2',nmask=3) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,85,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_autobox_pbmask(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_autobox_nmask : Autoboxing with pbmask""" build 12-Sep-2018 15:30:25 + # this won't be triggering actual pruning but just to check going into write places build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + # change imsize to see the pbmask boundary build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=500,cell='8.0arcsec',niter=10,deconvolver='hogbom', build 12-Sep-2018 15:30:25 + interactive=0,usemask='auto-thresh', pbmask=0.2) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[250,250,0,0]),(self.img+'.mask',0.0,[250,285,0,0]),(self.img+'.mask',0.0,[360,360])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @unittest.skip('Skip. This test deprecated. removed autoadjust param.') build 12-Sep-2018 15:30:25 + def test_mask_autobox_autoadjust(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_autobox_autoadjust : Autoboxing with autoadjust=T """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom', build 12-Sep-2018 15:30:25 + interactive=0,usemask='auto-thresh',autoadjust=True) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,85,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @unittest.skip('Skip test.') build 12-Sep-2018 15:30:25 + def test_mask_pbmask(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_pbmask : pb mask """ build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @unittest.skip('Skip test.') build 12-Sep-2018 15:30:25 + def test_mask_combined_1(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_combined_1 : string + pbmask """ build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @unittest.skip('Skip test.') build 12-Sep-2018 15:30:25 + def test_mask_combined_2(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_combined_2 : Autobox + pbmask """ build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @unittest.skip('Skip test.') build 12-Sep-2018 15:30:25 + def test_mask_outlier(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_outlier : With outlier fields """ build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_restart(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_restart : Test that mask reloads upon restart """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='auto-thresh') build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0) build 12-Sep-2018 15:30:25 + #report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,80,0,0])]) build 12-Sep-2018 15:30:25 + # temporarily change the value test for unmasked region to make it pass (replace with the above when the extra masking issue is resolved...) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,85,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_autobox_multithresh(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask__autobox_multithresh : multi-threshold Autobox (default)""" build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='auto-multithresh') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,85,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_autobox_multithresh_with_prune(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask__autobox_multithresh_with_prune : multi-threshold Autobox (minbeamfrac=0.3)""" build 12-Sep-2018 15:30:25 + # also test for a bug fix to the new pruneRegions (only caused the failure when image size large build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=1000,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='auto-multithresh', build 12-Sep-2018 15:30:25 + minbeamfrac=0.3) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[500,500,0,0]),(self.img+'.mask',0.0,[500,510,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_autobox_multithresh_with_stopmask(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask__autobox_multithresh_with_stopmask : multi-threshold Autobox (minbeamfrac=0.3) with stop mask on """ build 12-Sep-2018 15:30:25 + # will trigger stop mask condition for the last cycle (Cycle 4) - does not change output mask but can be checked on the log build 12-Sep-2018 15:30:25 + # build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=100,deconvolver='hogbom',interactive=0, build 12-Sep-2018 15:30:25 + usemask='auto-multithresh', minbeamfrac=0.3, minpercentchange=0.2) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',0.0,[63,50,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_autobox_multithresh_with_absorption(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask__autobox_multithresh_on_absorption : multi-threshold Autobox (minbeamfrac=0.3) on the data with both emission and absorption """ build 12-Sep-2018 15:30:25 + # data with a emission pt and absorption pt. build 12-Sep-2018 15:30:25 + self.prepData('refim_point_pos_neg.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=100,deconvolver='hogbom',interactive=0,usemask='auto-multithresh', negativethreshold=5.0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.mask'], imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',1.0,[60,40,0,0]),(self.img+'.mask',0.0,[65,50,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @unittest.skip('Skip func. test') build 12-Sep-2018 15:30:25 + def test_mask_outregion(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_outregion : Input mask has region that goes outside the image """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + mstr = 'circle[[50pix,110pix],20pix]' build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,usemask='user',mask=mstr) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'2.mask'], imval=[(self.img+'2.mask',0.0,[50,50,0,0]),(self.img+'2.mask',1.0,[50,95,0,0])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_zerostart(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_zerostart : Test that a zero starting mask is caught """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='10.0arcsec',niter=0,interactive=0) build 12-Sep-2018 15:30:25 + os.system('cp -r ' + self.img + '.residual '+ self.img+'2.inpmask') build 12-Sep-2018 15:30:25 + _ia.open(self.img+'2.inpmask') build 12-Sep-2018 15:30:25 + pix =_ia.getchunk() build 12-Sep-2018 15:30:25 + pix.fill(0.0) build 12-Sep-2018 15:30:25 + _ia.putchunk(pix) build 12-Sep-2018 15:30:25 + _ia.close() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='10.0arcsec',niter=10,interactive=0,mask=self.img+'2.inpmask') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, imexist=[self.img+'2.mask'], imval=[(self.img+'2.model',0.0,[50,50,0,0]),(self.img+'2.mask',0.0,[50,50,0,0])], stopcode=7) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_zeroauto(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_zeroauto : Test that an automask-generated zero mask is caught """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile, imagename=self.img,niter=0,interactive=0,usemask='auto-thresh',maskthreshold='40.0Jy') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile, imagename=self.img,niter=10,interactive=0,usemask='auto-thresh',maskthreshold='40.0Jy') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, imexist=[self.img+'.mask'], imval=[(self.img+'.model',0.0,[50,50,0,0]),(self.img+'.mask',0.0,[50,50,0,0])], stopcode=7) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_expand_contstokesImask_to_cube(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_expand_contstokesImask_to_cube : Test for build 12-Sep-2018 15:30:25 + expanding input continuum Stokes I mask to cube imaging """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + self.prepInputmask('refim_cont_stokesI_input.mask') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile, build 12-Sep-2018 15:30:25 + imagename=self.img, specmode="cube", imsize=100, cell='8.0arcsec', niter=10,interactive=0,interpolation='nearest', usemask='user', mask=self.maskname) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, imexist=[self.img+'.mask'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',1.0,[50,50,0,1]),(self.img+'.mask',1.0,[50,50,0,2]), (self.img+'.mask',0.0,[65,65,0,1])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_expand_contstokesImask_nodegen_to_cube(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_expand_contstokesImask_nodegen_to_cube : Test for build 12-Sep-2018 15:30:25 + expanding input continuum Stokes I mask with its degenerate axes removed to cube imaging """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + self.prepInputmask('refim_cont_stokesI_input.mask') build 12-Sep-2018 15:30:25 + imsubimage(imagename=self.maskname, outfile=self.maskname+"_dropdeg",dropdeg=True) build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile, build 12-Sep-2018 15:30:25 + imagename=self.img, specmode="cube", imsize=100, cell='8.0arcsec', build 12-Sep-2018 15:30:25 + niter=10,interactive=0,interpolation='nearest', usemask='user', build 12-Sep-2018 15:30:25 + mask=self.maskname+"_dropdeg") build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, imexist=[self.img+'.mask'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',1.0,[50,50,0,1]),(self.img+'.mask',1.0,[50,50,0,2]), (self.img+'.mask',0.0,[65,65,0,1])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_expand_contstokesImask_to_IQUV(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_expand_contstokesImask_to_IQUV : Test for expanding build 12-Sep-2018 15:30:25 + input continuum Stokes I mask to continuum multi-stokes imaging """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + self.prepInputmask('refim_cont_stokesI_input.mask') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile, build 12-Sep-2018 15:30:25 + imagename=self.img, specmode="mfs", imsize=100, cell='8.0arcsec', build 12-Sep-2018 15:30:25 + niter=10,interactive=0, stokes='IQUV', usemask='user', mask=self.maskname) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, imexist=[self.img+'.mask'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',1.0,[50,50,1,0]),(self.img+'.mask',1.0,[50,50,2,0]),(self.img+'.mask',1.0,[50,50,3,0]), (self.img+'.mask',0.0,[65,65,2,0])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_expand_contstokesImask_nodegen_to_IQUV(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_expand_contstokesImask_nodegen_to_IQUV : Test for expanding build 12-Sep-2018 15:30:25 + input continuum Stokes I mask with its degenerate axes removed to continuum multi-stokes imaging """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + self.prepInputmask('refim_cont_stokesI_input.mask') build 12-Sep-2018 15:30:25 + imsubimage(imagename=self.maskname, outfile=self.maskname+"_dropdeg", dropdeg=True) build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile, build 12-Sep-2018 15:30:25 + imagename=self.img, specmode="mfs", imsize=100, cell='8.0arcsec', build 12-Sep-2018 15:30:25 + niter=10,interactive=0, stokes='IQUV', usemask='user', build 12-Sep-2018 15:30:25 + mask=self.maskname+"_dropdeg") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, imexist=[self.img+'.mask'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.mask',1.0,[50,50,0,0]),(self.img+'.mask',1.0,[50,50,1,0]),(self.img+'.mask',1.0,[50,50,2,0]),(self.img+'.mask',1.0,[50,50,3,0]), (self.img+'.mask',0.0,[65,65,2,0])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_expand_contstokesImask_to_cube_IQUV(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_extend_contstokesImask_to_cube_IQUV : Test for extending build 12-Sep-2018 15:30:25 + input continuum Stokes I mask to cube multi-stokes imaging """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + self.prepInputmask('refim_cont_stokesI_input.mask') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile, build 12-Sep-2018 15:30:25 + imagename=self.img, specmode="cube", imsize=100, cell='8.0arcsec', build 12-Sep-2018 15:30:25 + niter=10,interactive=0,interpolation='nearest', stokes='IQUV', usemask='user', mask=self.maskname) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, imexist=[self.img+'.mask'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.mask',1.0,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,2,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,3,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,0,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,2,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,3,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[65,65,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[65,65,2,1]), build 12-Sep-2018 15:30:25 + ]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_expand_contstokesImask_nodegen_to_cube_IQUV(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_extend_contstokesImask_nodegen_to_cube_IQUV : Test for extending build 12-Sep-2018 15:30:25 + input continuum Stokes I mask with its denenerate axes removed to cube multi-stokes imaging """ build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + self.prepInputmask('refim_cont_stokesI_input.mask') build 12-Sep-2018 15:30:25 + imsubimage(imagename=self.maskname, outfile=self.maskname+"_dropdeg",dropdeg=True) build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile, build 12-Sep-2018 15:30:25 + imagename=self.img, specmode="cube", imsize=100, cell='8.0arcsec', build 12-Sep-2018 15:30:25 + niter=10,interactive=0,interpolation='nearest', stokes='IQUV', build 12-Sep-2018 15:30:25 + usemask='user', mask=self.maskname+"_dropdeg") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, imexist=[self.img+'.mask'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.mask',1.0,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,2,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,3,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,0,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,2,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,3,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[65,65,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[65,65,2,1]), build 12-Sep-2018 15:30:25 + ]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_expand_contstokesIQUVmask_to_cube_IQUV(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_expand_contstokesIQUVmask_to_cube_IQUV : Test for expanding build 12-Sep-2018 15:30:25 + input continuum Stokes IQUV mask to cube IQUV imaging """ build 12-Sep-2018 15:30:25 + # extending to all channels and preserving mask of each stokes build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + # input mask will different for different stokes plane build 12-Sep-2018 15:30:25 + self.prepInputmask('refim_cont_stokesIQUV_input.mask') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile, build 12-Sep-2018 15:30:25 + imagename=self.img, specmode="cube", imsize=100, cell='8.0arcsec', build 12-Sep-2018 15:30:25 + niter=10,interactive=0,interpolation='nearest', stokes='IQUV', usemask='user', mask=self.maskname) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, imexist=[self.img+'.mask'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.mask',1.0,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,0,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,2,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,2,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[43,31,3,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[43,31,3,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[61,51,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[50,63,1,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[37,65,2,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[34,70,0,1]), build 12-Sep-2018 15:30:25 + ]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_expand_contstokesIQUVmask_nodegen_to_cube_IQUV(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_expand_contstokesIQUVmask_nodegen_to_cube_IQUV : Test for expanding build 12-Sep-2018 15:30:25 + input continuum Stokes IQUV mask with its degenerate axes removed to cube IQUV imaging """ build 12-Sep-2018 15:30:25 + # extending to all channels and preserving mask of each stokes build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + # input mask will different for different stokes plane build 12-Sep-2018 15:30:25 + self.prepInputmask('refim_cont_stokesIQUV_input.mask') build 12-Sep-2018 15:30:25 + imsubimage(self.maskname, outfile=self.maskname+"_dropdeg",dropdeg=True); build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile, build 12-Sep-2018 15:30:25 + imagename=self.img, specmode="cube", imsize=100, cell='8.0arcsec', build 12-Sep-2018 15:30:25 + niter=10,interactive=0,interpolation='nearest', stokes='IQUV', build 12-Sep-2018 15:30:25 + usemask='user', mask=self.maskname+"_dropdeg") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, imexist=[self.img+'.mask'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.mask',1.0,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,0,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,2,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,2,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[43,31,3,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[43,31,3,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[61,51,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[50,63,1,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[37,65,2,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[34,70,0,1]), build 12-Sep-2018 15:30:25 + ]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_expand_cubestokesImask_to_cube_IQUV(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_expand_contstokesIQUVmask_to_cube_IQUV : Test for expanding build 12-Sep-2018 15:30:25 + input cube Stokes I mask to cube (of the same spectral coordinates) IQUV imaging """ build 12-Sep-2018 15:30:25 + # extending to all channels and preserving mask of each stokes build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + # input mask will different for different stokes plane build 12-Sep-2018 15:30:25 + self.prepInputmask('refim_cube_StokesI_input.mask') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile, build 12-Sep-2018 15:30:25 + imagename=self.img, specmode="cube", imsize=100, cell='8.0arcsec', build 12-Sep-2018 15:30:25 + niter=10,interactive=0,interpolation='nearest', stokes='IQUV', build 12-Sep-2018 15:30:25 + usemask='user', mask=self.maskname) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, imexist=[self.img+'.mask'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.mask',1.0,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,0,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,2,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,2,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[37,63,3,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[46,49,3,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[63,51,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[50,63,1,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[43,59,2,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[43,57,2,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[43,70,0,1]), build 12-Sep-2018 15:30:25 + ]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_mask_expand_cubestokesImask_nodegen_to_cube_IQUV(self): build 12-Sep-2018 15:30:25 + """ [mask] test_mask_expand_contstokesIQUVmask_nodegen_to_cube_IQUV : Test for expanding build 12-Sep-2018 15:30:25 + input cube Stokes I mask with its degenerate axes removed to cube (of the same spectral coordinates) IQUV imaging """ build 12-Sep-2018 15:30:25 + # extending to all channels and preserving mask of each stokes build 12-Sep-2018 15:30:25 + self.prepData('refim_point_linRL.ms') build 12-Sep-2018 15:30:25 + # input mask will different for different stokes plane build 12-Sep-2018 15:30:25 + self.prepInputmask('refim_cube_StokesI_input.mask') build 12-Sep-2018 15:30:25 + imsubimage(self.maskname, outfile=self.maskname+"_dropdeg",dropdeg=True); build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile, build 12-Sep-2018 15:30:25 + imagename=self.img, specmode="cube", imsize=100, cell='8.0arcsec', build 12-Sep-2018 15:30:25 + niter=10,interactive=0,interpolation='nearest', stokes='IQUV', build 12-Sep-2018 15:30:25 + usemask='user', mask=self.maskname+'_dropdeg') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, imexist=[self.img+'.mask'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.mask',1.0,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,0,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,1,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,2,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[50,50,2,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[37,63,3,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[46,49,3,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[63,51,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[50,63,1,1]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[43,59,2,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',1.0,[43,57,2,2]), build 12-Sep-2018 15:30:25 + (self.img+'.mask',0.0,[43,70,0,1]), build 12-Sep-2018 15:30:25 + ]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +##Task level tests : awproject and mosaics build 12-Sep-2018 15:30:25 +class test_widefield(testref_base): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_widefield_wproj_mfs(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_wproj : W-Projection """ build 12-Sep-2018 15:30:25 + ### Need better test dataset for this..... build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='8.0arcsec',phasecenter="J2000 19:59:00.2 +40.50.15.50",niter=30,gridder='widefield',wprojplanes=4,deconvolver='hogbom') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image'],imval=[(self.img+'.psf',1.0,[100,100,0,0]),(self.img+'.image',5.56,[127,143,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_widefield_aproj_mfs(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_aproj : MFS with narrowband AWProjection (wbawp=F, 1spw) stokes I """ build 12-Sep-2018 15:30:25 + # casalog.post("EMPTY TEST") build 12-Sep-2018 15:30:25 + # return build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='1',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=30,gridder='awproject',cfcache=self.img+'.cfcache',wbawp=False,conjbeams=True,psterm=False,computepastep=360.0,rotatepastep=360.0,deconvolver='hogbom',savemodel='modelcolumn') build 12-Sep-2018 15:30:25 + ## ret = tclean(vis=self.msfile,spw='2',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=30,gridder='awproject',wbawp=False,conjbeams=True,psterm=False,computepastep=360.0,rotatepastep=360.0,deconvolver='hogbom') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',1.0,[256,256,0,0]),(self.img+'.weight',0.493,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 + ## weight is pbsq which is 0.7^2 = 0.49 (approx). build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + #do stokes V too..... build 12-Sep-2018 15:30:25 + def test_widefield_aproj_cube(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_aproj_cube_aproj : Cube with AW-Projection and rotation off """ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + casalog.post("EMPTY TEST") build 12-Sep-2018 15:30:25 + return build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",specmode='cube',niter=1,gain=1.0,gridder='awproject',cfcache=self.img+'.cfcache',wbawp=True,conjbeams=False,psterm=False,computepastep=360.0,rotatepastep=360.0,deconvolver='hogbom') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',0.11,[256,256,0,0]),(self.img+'.weight',0.34,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(self.img+'.psf') and os.path.exists(self.img+'.residual') ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Test normtype too somewhere.. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_widefield_wbaproj_mfs(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_wbaproj_mfs : MFS with wideband AWProjection (wbawp=T, allspw) and nt=1 stokes I """ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # casalog.post("EMPTY TEST") build 12-Sep-2018 15:30:25 + # return build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=30,gridder='awproject',cfcache=self.img+'.cfcache',wbawp=True,conjbeams=True,psterm=False,computepastep=360.0,rotatepastep=360.0,deconvolver='hogbom',pblimit=0.3) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',1.0,[256,256,0,0]),(self.img+'.weight',0.493,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + #do stokes V too.. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_widefield_aproj_mtmfs(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_aproj_mtmfs : MFS with AWProjection (wbawp=T,conjbeams=F, allspw) and nt=2 stokes I """ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # casalog.post("EMPTY TEST") build 12-Sep-2018 15:30:25 + # return build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='*',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=0,gridder='awproject',cfcache=self.img+'.cfcache',wbawp=True,conjbeams=False,psterm=False,computepastep=360.0,rotatepastep=360.0,deconvolver='mtmfs') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.psf.tt0', self.img+'.weight.tt0'],imval=[(self.img+'.image.tt0',0.96,[256,256,0,0]),(self.img+'.weight.tt0',0.48,[256,256,0,0]),(self.img+'.alpha',0.04,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + ## alpha should represent that of the mosaic PB (twice).. -0.1 doesn't look right. Sigh.... well.. it should converge to zero. build 12-Sep-2018 15:30:25 + ## alpha keeps increasing in magnitude with niter.... not right. build 12-Sep-2018 15:30:25 + ## restricting this check to niter=0 only. Alpha should represent that of the PB. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_widefield_wbaproj_mtmfs(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_wbaproj_mtmfs : MFS with wideband AWProjection (wbawp=T,conjbeams=T, allspw) and nt=2 stokes I """ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # casalog.post("EMPTY TEST") build 12-Sep-2018 15:30:25 + # return build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=30,gridder='awproject',cfcache=self.img+'.cfcache',wbawp=True,conjbeams=True,psterm=False,computepastep=360.0,rotatepastep=360.0,deconvolver='mtmfs',pblimit=0.1) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.psf.tt0', self.img+'.weight.tt0'],imval=[(self.img+'.image.tt0',0.96,[256,256,0,0]),(self.img+'.weight.tt0',0.486,[256,256,0,0]),(self.img+'.alpha',0.0,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 + ## alpha should be ZERO as the pb spectrum has been taken out. build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @unittest.skip('Skip func. test') build 12-Sep-2018 15:30:25 + def test_widefield_wbaproj_subsets(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_wbaproj_subsets : MFS with the AWProjection gridder and A,W turned off """ build 12-Sep-2018 15:30:25 + self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 + ## PS only build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='*',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=30,gridder='awproject',psterm=True,aterm=False,wprojplanes=1,computepastep=360.0,rotatepastep=360.0,deconvolver='hogbom',pblimit=0.3) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',1.0,[256,256,0,0]),(self.img+'.weight',0.493,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## W and PS only build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='*',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=30,gridder='awproject',psterm=True,aterm=False,wprojplanes=16,computepastep=360.0,rotatepastep=360.0,deconvolver='hogbom',pblimit=0.3) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',1.0,[256,256,0,0]),(self.img+'.weight',0.493,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + @unittest.skip('Skip func. test') build 12-Sep-2018 15:30:25 + def test_widefield_multispws(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_multispws : Test cube imaging with mosaicft and awproj """ build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## CHECK NORMALIZATION OF WEIGHTIMAGE = normed to peak=1 build 12-Sep-2018 15:30:25 + ## TODO : make vpman recognize EVLA in addition to VLA. build 12-Sep-2018 15:30:25 + def test_widefield_mosaicft_mfs(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_mosaic : MFS with mosaicft stokes I """ build 12-Sep-2018 15:30:25 + self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='1',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=30,gridder='mosaicft',deconvolver='hogbom',pblimit=0.3) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',0.961231,[256,256,0,0]),(self.img+'.weight',0.50576,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 + #ret = clean(vis=self.msfile,spw='1',field='*',imagename=self.img+'.old',imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=30,imagermode='mosaic',psfmode='hogbom') build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + #do stokes V too.. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_widefield_mosaicft_mtmfs(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_mosaicft_mtmfs : MT-MFS with mosaicft stokes I, alpha """ build 12-Sep-2018 15:30:25 + self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='*',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=60,gridder='mosaicft',deconvolver='mtmfs', conjbeams=False) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.psf.tt0', self.img+'.weight.tt0'],imval=[(self.img+'.image.tt0',0.9413,[256,256,0,0]),(self.img+'.weight.tt0',0.50546,[256,256,0,0]),(self.img+'.alpha', 0.078076,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 + ## alpha should represent that of the mosaic PB (twice)... and should then converge to zero build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_widefield_mosaicft_mtmfs_conj(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_mosaicft_mtmfs : MT-MFS with mosaicft stokes I, alpha """ build 12-Sep-2018 15:30:25 + self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='*',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=60,gridder='mosaicft',deconvolver='mtmfs', conjbeams=True) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.psf.tt0', self.img+'.weight.tt0'],imval=[(self.img+'.image.tt0',0.9638,[256,256,0,0]),(self.img+'.weight.tt0',0.49804,[256,256,0,0]),(self.img+'.alpha',-0.03692,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 + ## alpha should represent that of the mosaic PB (twice)... and should then converge to zero build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_widefield_mosaicft_mtmfs_pbsquare(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_mosaicft_mtmfs : MT-MFS with mosaicft stokes I, alpha """ build 12-Sep-2018 15:30:25 + self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='*',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=60,gridder='mosaic',deconvolver='mtmfs', conjbeams=False, normtype='pbsquare' ) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.psf.tt0', self.img+'.weight.tt0'],imval=[(self.img+'.image.tt0',0.9194,[256,256,0,0]),(self.img+'.weight.tt0',0.5059,[256,256,0,0]),(self.img+'.alpha',0.021195,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 + ## alpha should represent that of the mosaic PB (twice)... and should then converge to zero build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_widefield_mosaicft_cube(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_mosaicft_cube : MFS with mosaicft stokes I """ build 12-Sep-2018 15:30:25 + self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 +# _vp.setpbpoly(telescope='EVLA', coeff=[1.0, -1.529e-3, 8.69e-7, -1.88e-10]) build 12-Sep-2018 15:30:25 +# _vp.saveastable('evlavp.tab') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='*',field='0',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",specmode='cube',niter=10,gridder='mosaicft',deconvolver='hogbom',gain=0.1,stokes='I') #,vptable='evlavp.tab') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',0.7987,[256,256,0,0]),(self.img+'.weight',0.6528,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + #do stokes V too.. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class test_widefield_failing(testref_base): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_widefield_imagemosaic(self): build 12-Sep-2018 15:30:25 + """ [widefield] Test_Widefield_imagemosaic : Image domain mosaic for single-term mfs (or narrowband) """ build 12-Sep-2018 15:30:25 + self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='1',field='*',imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",niter=30,gridder='imagemosaic',deconvolver='hogbom') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image', self.img+'.psf', self.img+'.weight'],imval=[(self.img+'.image',1.0,[256,256,0,0]),(self.img+'.weight',0.493,[256,256,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_widefield_mosaic_outlier(self): build 12-Sep-2018 15:30:25 + """ [multifield] Test_widefield_mosaic_outlier : Mosaic with an outlier field """ build 12-Sep-2018 15:30:25 + #### Need another dataset for this. build 12-Sep-2018 15:30:25 + self.prepData("refim_mawproject.ms") build 12-Sep-2018 15:30:25 + ## Outlier uses gridft build 12-Sep-2018 15:30:25 + self.th.write_file(self.img+'.out.txt', 'imagename='+self.img+'1\nimsize=[80,80]\ncell=[8.0arcsec,8.0arcsec]\nphasecenter=J2000 19:58:42.0 +40.55.58.543\nmask=circle[[40pix,40pix],10pix]\ngridder=gridft') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=512,cell='10.0arcsec',phasecenter="J2000 19:59:28.500 +40.44.01.50",outlierfile=self.img+'.out.txt',niter=10,deconvolver='hogbom',gridder='mosaicft',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 + iterdone=10, # outlier field has nothing in it :). build 12-Sep-2018 15:30:25 + nmajordone=2, build 12-Sep-2018 15:30:25 + imexist=[self.img+'.image', self.img+'1.image'], build 12-Sep-2018 15:30:25 + imval=[(self.img+'.image',0.933,[256,256,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.image',0.0,[40,40,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + #### NOT WORKING as the model is being picked from tst1, so residual after 0.6 model and one major cycle is same as dirty and the output image is 1.6 instead of 0.93. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 +############################################## build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +##Task level tests : model prediction. build 12-Sep-2018 15:30:25 +class test_modelvis(testref_base): build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_modelvis_1(self): build 12-Sep-2018 15:30:25 + """ [modelpredict] Test_modelvis_1 : mfs with no save model """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twochan.ms") build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,savemodel='none') build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==False and hasvirmod==False ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_modelvis_2(self): build 12-Sep-2018 15:30:25 + """ [modelpredict] Test_modelvis_2 : mfs with save model column """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twochan.ms") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Save model after deconvolution build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,savemodel='modelcolumn') build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==True and modsum>0.0 and hasvirmod==False ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ##Predict from input model image (startmodel) build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model', niter=0,savemodel='modelcolumn') build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==True and modsum>0.0 and hasvirmod==False ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_modelvis_3(self): build 12-Sep-2018 15:30:25 + """ [modelpredict] Test_modelvis_3 : mfs with save virtual model """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twochan.ms") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Save model after deconvolution build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,savemodel='virtual') build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==False and hasvirmod==True ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ##Predict from input model image (startmodel) build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model', niter=0,savemodel='virtual') build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==False and hasvirmod==True ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_modelvis_4(self): build 12-Sep-2018 15:30:25 + """ [modelpredict] Test_modelvis_4 : mt-mfs with no save model """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twochan.ms") build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',savemodel='none') build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==False and hasvirmod==False ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_modelvis_5(self): build 12-Sep-2018 15:30:25 + """ [modelpredict] Test_modelvis_5 : mt-mfs with save model column """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twochan.ms") build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',savemodel='modelcolumn') build 12-Sep-2018 15:30:25 + plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='data',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.data.png',title="original data") build 12-Sep-2018 15:30:25 + plotms(vis=self.msfile,xaxis='frequency',yaxis='amp',ydatacolumn='model',customsymbol=True,symbolshape='circle',symbolsize=5,showgui=False,plotfile=self.img+'.plot.model.png',title="empty model") build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==True and modsum>0.0 and hasvirmod==False ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=[self.img+'.model.tt0',self.img+'.model.tt1'],niter=0,deconvolver='mtmfs',savemodel='modelcolumn') build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==True and modsum>0.0 and hasvirmod==False ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_modelvis_6(self): build 12-Sep-2018 15:30:25 + """ [modelpredict] Test_modelvis_6 : mt-mfs with save virtual model """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twochan.ms") build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',savemodel='virtual') build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==False and hasvirmod==True ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=[self.img+'.model.tt0',self.img+'.model.tt1'],niter=0,deconvolver='mtmfs',savemodel='virtual') build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==False and hasvirmod==True ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_modelvis_7(self): build 12-Sep-2018 15:30:25 + """ [modelpredict] Test_modelvis_7 : cube with chan selection and save model column """ build 12-Sep-2018 15:30:25 + ## check explicit channels ... build 12-Sep-2018 15:30:25 + self.prepData("refim_point.ms") build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='0:5~12',imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',niter=10,savemodel='modelcolumn',start=5,nchan=8,interpolation='nearest') build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==True and modsum>0.0 and hasvirmod==False ) build 12-Sep-2018 15:30:25 + reportcv=self.th.checkchanvals(self.msfile, [(10,">",0.0),(3,"==",1.0)]) build 12-Sep-2018 15:30:25 + self.checkfinal(reportcv) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='0',imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model',specmode='cube',niter=0,savemodel='modelcolumn') build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==True and modsum>0.0 and hasvirmod==False ) build 12-Sep-2018 15:30:25 + reportcv=self.th.checkchanvals(self.msfile,[(10,">",0.0),(3,"==",self.th.checkmodelchan(self.msfile,1))]) build 12-Sep-2018 15:30:25 + self.checkfinal(reportcv) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_modelvis_8(self): build 12-Sep-2018 15:30:25 + """ [modelpredict] Test_modelvis_8 : cube with chan selection and save virtual model """ build 12-Sep-2018 15:30:25 + ## check explicit channels ... build 12-Sep-2018 15:30:25 + self.prepData("refim_point.ms") build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='0:5~12',imagename=self.img,imsize=100,cell='8.0arcsec',specmode='cube',niter=10,savemodel='virtual') build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==False and hasvirmod==True ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,spw='0',imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model',specmode='cube',niter=0,savemodel='virtual') build 12-Sep-2018 15:30:25 + hasmodcol, modsum, hasvirmod = self.th.checkmodel(self.msfile) build 12-Sep-2018 15:30:25 + self.assertTrue( hasmodcol==False and hasvirmod==True ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_modelvis_9(self): build 12-Sep-2018 15:30:25 + """ [modelpredict] Test_modelvis_9 : Don't de-grid channels with zero model. Also test limited-freq mask """ build 12-Sep-2018 15:30:25 + self.prepData("refim_point.ms") build 12-Sep-2018 15:30:25 + masklist='' # choose only a few channels here. build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec',niter=10,mask=masklist) build 12-Sep-2018 15:30:25 + self.assertTrue(self.th.exists(self.img+'.model') ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model',niter=0,savemodel='modelcolumn') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model',niter=0,savemodel='virtual') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_modelvis_10(self): build 12-Sep-2018 15:30:25 + """ [modelpredict] Test_modelvis_10 : Use input model of different (narrower) freq range than data """ build 12-Sep-2018 15:30:25 + self.prepData("refim_point.ms") build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec', spw='0:5~12',niter=10,savemodel='modelcolumn') build 12-Sep-2018 15:30:25 + self.assertTrue(self.th.exists(self.img+'.model') ) build 12-Sep-2018 15:30:25 +# self.assertTrue( self.th.checkmodelchan(self.msfile,10) > 0.0 and self.th.checkmodelchan(self.msfile,3) == 1.0 ) build 12-Sep-2018 15:30:25 + reportcv=self.th.checkchanvals(self.msfile,[(10,">",0.0),(3,"==",1.0)]) build 12-Sep-2018 15:30:25 + self.checkfinal(reportcv) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## add model expansion parameter build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model', spw='0',niter=0,savemodel='modelcolumn') build 12-Sep-2018 15:30:25 +# self.assertTrue( self.th.checkmodelchan(self.msfile,10) > 0.0 and self.th.checkmodelchan(self.msfile,3) > 0.0 ) build 12-Sep-2018 15:30:25 + reportcv=self.th.checkchanvals(self.msfile,[(10,">",0.0),(3,">",0.0)]) build 12-Sep-2018 15:30:25 + self.checkfinal(reportcv) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model', spw='0',niter=0,savemodel='virtual') build 12-Sep-2018 15:30:25 + ## cannot check anything here.... just that it runs without error build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_modelvis_11(self): build 12-Sep-2018 15:30:25 + """ [modelpredict] Test_modelvis_11 : Predict model image over channel gaps not included in imaging """ build 12-Sep-2018 15:30:25 + self.prepData("refim_point.ms") build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec', spw='0:0~8;12~19',niter=10,savemodel='modelcolumn') build 12-Sep-2018 15:30:25 + self.assertTrue(self.th.exists(self.img+'.model') ) build 12-Sep-2018 15:30:25 + ###vi2 leave unselected channel as is so it will be 1.0 build 12-Sep-2018 15:30:25 + self.assertTrue( (self.th.checkmodelchan(self.msfile,10) == 0.0) or (np.abs(self.th.checkmodelchan(self.msfile,10)-1) < 1.0e-12) and self.th.checkmodelchan(self.msfile,3) > 0.0 ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model', spw='0',niter=0,savemodel='modelcolumn') build 12-Sep-2018 15:30:25 + self.assertTrue( self.th.checkmodelchan(self.msfile,10) > 0.0 and self.th.checkmodelchan(self.msfile,3) > 0.0 ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + delmod(self.msfile);self.th.delmodels(msname=self.msfile,modcol='delete') build 12-Sep-2018 15:30:25 + ret = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',startmodel=self.img+'.model', spw='0',niter=0,savemodel='virtual') build 12-Sep-2018 15:30:25 + ## cannot check anything here.... just that it runs without error build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class test_startmodel(testref_base): build 12-Sep-2018 15:30:25 + def test_startmodel_regrid_mfs(self): build 12-Sep-2018 15:30:25 + """ [modelpredict] Test_startmodel_regrid_mfs : Regrid input model onto new image grid : mfs (ra/dec) """ build 12-Sep-2018 15:30:25 + self.prepData('refim_twopoints_twochan.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=50,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,phasecenter='J2000 19h58m40.801s +40d55m59.863s') build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=200,cell='8.0arcsec',niter=0,deconvolver='hogbom',interactive=0,startmodel=self.img+'1.model') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'1.residual', self.img+'2.residual'], imval=[(self.img+'1.residual',1.7963,[25,25,0,0]),(self.img+'2.residual',1.910,[168,190,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_startmodel_regrid_cube(self): build 12-Sep-2018 15:30:25 + """ [modelpredict] Test_startmodel_regrid_cube : Regrid input model onto new image grid : cube (ra/dec/specframe)""" build 12-Sep-2018 15:30:25 + self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=50,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,specmode='cube',start='1.05GHz',width='50MHz',nchan=20) build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=0,deconvolver='hogbom',interactive=0,startmodel=self.img+'1.model',specmode='cube') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'1.residual', self.img+'2.residual'], imval=[(self.img+'1.residual',0.362,[25,25,0,5]),(self.img+'2.residual',0.362,[50,50,0,6])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +# def test_startmodel_14(self): build 12-Sep-2018 15:30:25 +# """ [modelpredict] Test_startmodel_14 : Regrid input model onto new image grid : mtmfs (ra/dec/terms)""" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +# def test_startmodel_15(self): build 12-Sep-2018 15:30:25 +# """ [modelpredict] Test_startmodel_15 : Regrid input model onto new image grid : mfs (imsize/cell)""" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_startmodel_mfs_continue(self): build 12-Sep-2018 15:30:25 + """ [startmodel] test_startmodel_mfs_continue : Restart a run with no parameter changes""" build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'1.residual'], imval=[(self.img+'1.residual',0.35304,[50,50,0,0])]) build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'1.residual'], imval=[(self.img+'1.residual',0.1259,[50,50,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_startmodel_mfs_restart(self): build 12-Sep-2018 15:30:25 + """ [startmodel] test_startmodel_mfs_restart : Restart a run using 'startmodel' and changed imagename""" build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0) build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,startmodel=self.img+'1.model') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'1.residual', self.img+'2.residual'], imval=[(self.img+'1.residual',0.35304,[50,50,0,0]),(self.img+'2.residual',0.1259,[50,50,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_startmodel_mfs_changeshape_1(self): build 12-Sep-2018 15:30:25 + """ [startmodel] test_startmodel_mfs_changeshape_1 : Restart a run but change shape only (cas-6937)""" build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'1.residual'], imval=[(self.img+'1.residual',0.35304,[50,50,0,0])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + ## This run should fail with an exception (if __rethrow_exceptions = True ) build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=120,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0) build 12-Sep-2018 15:30:25 + correct=False build 12-Sep-2018 15:30:25 + except Exception as e: build 12-Sep-2018 15:30:25 + correct=True build 12-Sep-2018 15:30:25 + #self.assertTrue(correct) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ## Check that there is no change in output value.... build 12-Sep-2018 15:30:25 + ## i.e. the second run should have failed. build 12-Sep-2018 15:30:25 + report=self.th.checkall(imval=[(self.img+'1.residual',0.35304,[50,50,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_startmodel_mfs_changeshape_2(self): build 12-Sep-2018 15:30:25 + """ [startmodel] test_startmodel_mfs_changeshape_2 : Restart a run using 'startmodel' and change shape and imagename""" build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0) build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=120,cell='8.0arcsec',niter=10,deconvolver='hogbom',interactive=0,startmodel=self.img+'1.model') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'1.residual', self.img+'2.residual'], imval=[(self.img+'1.residual',0.35304,[50,50,0,0]),(self.img+'2.residual',0.1259,[60,60,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_startmodel_mtmfs_restart(self): build 12-Sep-2018 15:30:25 + """ [startmodel] test_startmodel_mtmfs_restart : Restart a multi-term run using 'startmodel' and changed imagename""" build 12-Sep-2018 15:30:25 + self.prepData('refim_twochan.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile,imagename=self.img+'1',imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',interactive=0) build 12-Sep-2018 15:30:25 + # start with full model build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile,imagename=self.img+'2',imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',interactive=0,startmodel=[self.img+'1.model.tt0',self.img+'1.model.tt1']) build 12-Sep-2018 15:30:25 + # start with model only for tt0 build 12-Sep-2018 15:30:25 + ret3 = tclean(vis=self.msfile,imagename=self.img+'3',imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',interactive=0,startmodel=self.img+'1.model.tt0') build 12-Sep-2018 15:30:25 + # start with model only for tt1 build 12-Sep-2018 15:30:25 + ret3 = tclean(vis=self.msfile,imagename=self.img+'4',imsize=100,cell='8.0arcsec',niter=10,deconvolver='mtmfs',interactive=0,startmodel=['',self.img+'1.model.tt1']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'1.residual.tt0', self.img+'2.residual.tt0', self.img+'3.residual.tt0', self.img+'4.residual.tt0', self.img+'1.residual.tt1', self.img+'2.residual.tt1', self.img+'3.residual.tt1', self.img+'4.residual.tt1'], imval=[ (self.img+'1.residual.tt0',0.39226,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'2.residual.tt0',0.13677,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'3.residual.tt0',0.13677,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'4.residual.tt0',0.39226,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'1.residual.tt1',-0.04358,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'2.residual.tt1',-0.01519,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'3.residual.tt1',-0.04358,[50,50,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'4.residual.tt1',-0.01519,[50,50,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_startmodel_with_mask_mfs(self): build 12-Sep-2018 15:30:25 + """ [startmodel] test_startmodel_with_mask_mfs : Mask out some regions in the startmodel, before prediction """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + ## image both sources build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,spw='0:0',imagename=self.img,imsize=200,cell='10.0arcsec',niter=100) build 12-Sep-2018 15:30:25 + ## mask out all but the brightest outlier source build 12-Sep-2018 15:30:25 + _ia.open(self.img+'.model') build 12-Sep-2018 15:30:25 + _ia.calcmask(mask='"'+self.img+'.model">2.0') # keep only high values. i.e. the far out bright source. build 12-Sep-2018 15:30:25 + _ia.close() build 12-Sep-2018 15:30:25 + ## predict only that outlier source build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,spw='0:0',imagename=self.img+'.2',niter=0,savemodel='modelcolumn',imsize=200,cell='10.0arcsec',startmodel=self.img+'.model') build 12-Sep-2018 15:30:25 + ## subtract it out build 12-Sep-2018 15:30:25 + uvsub(vis=self.msfile) build 12-Sep-2018 15:30:25 + ## image the rest of the field. build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,spw='0:0',imagename=self.img+'.3',imsize=200,cell='10.0arcsec',niter=100) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.model',self.img+'.2.model',self.img+'.3.model'], build 12-Sep-2018 15:30:25 + imval=[ (self.img+'.model',1.497,[100,100,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.model',7.474,[154,172,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.3.model',1.497,[100,100,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.3.model',0.024,[154,172,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_startmodel_with_mask_mtmfs(self): build 12-Sep-2018 15:30:25 + """ [startmodel] test_startmodel_with_mask_mtmfs : Mask out some regions in the startmodel, before prediction """ build 12-Sep-2018 15:30:25 + self.prepData("refim_twopoints_twochan.ms") build 12-Sep-2018 15:30:25 + ## image both sources build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,imagename=self.img,imsize=200,cell='10.0arcsec',niter=100,deconvolver='mtmfs') build 12-Sep-2018 15:30:25 + ## mask out all but the brightest outlier source build 12-Sep-2018 15:30:25 + _ia.open(self.img+'.model.tt0') build 12-Sep-2018 15:30:25 + _ia.calcmask(mask='"'+self.img+'.model.tt0">2.0') # keep only high values. i.e. the far out bright source. build 12-Sep-2018 15:30:25 + _ia.close() build 12-Sep-2018 15:30:25 + _ia.open(self.img+'.model.tt1') build 12-Sep-2018 15:30:25 + _ia.calcmask(mask='"'+self.img+'.model.tt0">2.0') # keep only high values. i.e. the far out bright source. build 12-Sep-2018 15:30:25 + _ia.close() build 12-Sep-2018 15:30:25 + ## predict only that outlier source build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,imagename=self.img+'.2',niter=0,savemodel='modelcolumn',imsize=200,cell='10.0arcsec',startmodel=[self.img+'.model.tt0',self.img+'.model.tt1'],deconvolver='mtmfs') build 12-Sep-2018 15:30:25 + ## subtract it out build 12-Sep-2018 15:30:25 + uvsub(vis=self.msfile) build 12-Sep-2018 15:30:25 + ## image the rest of the field. build 12-Sep-2018 15:30:25 + tclean(vis=self.msfile,imagename=self.img+'.3',imsize=200,cell='10.0arcsec',niter=100,deconvolver='mtmfs') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.model.tt0',self.img+'.2.model.tt0',self.img+'.3.model.tt0'], build 12-Sep-2018 15:30:25 + imval=[ build 12-Sep-2018 15:30:25 + (self.img+'.model.tt0',1.11,[100,100,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.model.tt0',5.56,[154,172,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.3.model.tt0',1.12,[100,100,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.3.model.tt0',0.013,[154,172,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.model.tt1',-1.1027,[100,100,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.model.tt1',-5.602,[154,172,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.3.model.tt1',-1.124,[100,100,0,0]), build 12-Sep-2018 15:30:25 + (self.img+'.3.model.tt1',-0.021,[154,172,0,0]) ] ) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ############################################## build 12-Sep-2018 15:30:25 +class test_pbcor(testref_base): build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + super(test_pbcor, self).setUp() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + _vp.setpbpoly(telescope='EVLA', coeff=[1.0, -1.529e-3, 8.69e-7, -1.88e-10]) build 12-Sep-2018 15:30:25 + _vp.saveastable('evlavp.tab') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_pbcor_mfs(self): build 12-Sep-2018 15:30:25 + """ [pbcor] Test pbcor with mfs""" build 12-Sep-2018 15:30:25 + self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", niter=10, specmode='mfs', vptable='evlavp.tab', pbcor=True) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb', self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.7,[256,256,0,0]),(self.img+'.image.pbcor',1.0,[256,256,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_pbcor_mtmfs(self): build 12-Sep-2018 15:30:25 + """ [pbcor] Test pbcor with mtmfs""" build 12-Sep-2018 15:30:25 + self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", niter=10, specmode='mfs', vptable='evlavp.tab', pbcor=True, deconvolver='mtmfs') build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.pb.tt0'], imexistnot=[self.img+'.image.tt0.pbcor', self.img+'.alpha.pbcor'], imval=[(self.img+'.pb.tt0',0.7,[256,256,0,0])]) build 12-Sep-2018 15:30:25 + #report=self.th.checkall(imexist=[self.img+'.image.tt0', self.img+'.pb.tt0', self.img+'.image.tt0.pbcor', self.img+'.alpha.pbcor'], imval=[(self.img+'.pb.tt0',0.7,[256,256,0,0]),(self.img+'.image.tt0.pbcor',1.0,[256,256,0,0]),(self.img+'.alpha',-0.7,[256,256,0,0]), (self.img+'.alpha.pbcor',-0.7,[256,256,0,0]) ]) build 12-Sep-2018 15:30:25 + # uncorrected alpha, for now. build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_pbcor_cube_basic(self): build 12-Sep-2018 15:30:25 + """ [pbcor] Test pbcor with cube""" build 12-Sep-2018 15:30:25 + self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", niter=10, specmode='cube', vptable='evlavp.tab', pbcor=True) build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb', self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.79,[256,256,0,0]),(self.img+'.image.pbcor',1.0,[256,256,0,0]), (self.img+'.pb',0.59,[256,256,0,2]),(self.img+'.image.pbcor',1.0,[256,256,0,2])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_pbcor_cube_twosteps(self): build 12-Sep-2018 15:30:25 + """ [pbcor] Test pbcor with cube with imaging and pbcor separately""" build 12-Sep-2018 15:30:25 + self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", niter=10, specmode='cube',vptable='evlavp.tab', pbcor=False) build 12-Sep-2018 15:30:25 + report1=self.th.checkall(imexist=[self.img+'.image',self.img+'.pb'],imexistnot=[self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.79,[256,256,0,0]), (self.img+'.pb',0.59,[256,256,0,2])]) build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", niter=0,calcres=False,calcpsf=False, specmode='cube', vptable='evlavp.tab', pbcor=True) build 12-Sep-2018 15:30:25 + report2=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb', self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.79,[256,256,0,0]),(self.img+'.image.pbcor',1.0,[256,256,0,0]), (self.img+'.pb',0.59,[256,256,0,2]),(self.img+'.image.pbcor',1.0,[256,256,0,2])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report1+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_pbcor_cube_mosaicft(self): build 12-Sep-2018 15:30:25 + """ [pbcor] Test pbcor with cube with mosaicft""" build 12-Sep-2018 15:30:25 + self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", niter=10, specmode='cube', vptable='evlavp.tab',pbcor=True, gridder='mosaic') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + report=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb', self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.79,[256,256,0,0]),(self.img+'.image.pbcor',1.0,[256,256,0,0]), (self.img+'.pb',0.59,[256,256,0,2]),(self.img+'.image.pbcor',1.0,[256,256,0,2])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_pbcor_mfs_restart(self): build 12-Sep-2018 15:30:25 + """ [pbcor] Test pbcor with mfs and a restart""" build 12-Sep-2018 15:30:25 + self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", niter=0, specmode='mfs', vptable='evlavp.tab', pbcor=False) build 12-Sep-2018 15:30:25 + report1=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb'], imexistnot=[self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.7,[256,256,0,0])]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", niter=10, specmode='mfs', vptable='evlavp.tab', pbcor=True) build 12-Sep-2018 15:30:25 + report2=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb', self.img+'.image.pbcor'], imval=[(self.img+'.pb',0.7,[256,256,0,0]),(self.img+'.image.pbcor',1.0,[256,256,0,0])]) build 12-Sep-2018 15:30:25 + self.checkfinal(report1+report2) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_pbcor_turn_off_pbmask(self): build 12-Sep-2018 15:30:25 + """ [pbcor] Test pbcor with mfs where the internal T/F mask is turned off""" build 12-Sep-2018 15:30:25 + self.prepData('refim_mawproject.ms') build 12-Sep-2018 15:30:25 + ret1 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", niter=0, specmode='mfs', vptable='evlavp.tab', pbcor=True) build 12-Sep-2018 15:30:25 + report1=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb'], imval=[(self.img+'.pb',0.7,[256,256,0,0])], immask=[(self.img+'.pb',False,[10,10,0,0]), (self.img+'.image',False,[10,10,0,0])] ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ret2 = tclean(vis=self.msfile, imagename=self.img, field='0', imsize=512, cell='10.0arcsec', phasecenter="J2000 19:59:28.500 +40.44.01.50", niter=10, specmode='mfs', vptable='evlavp.tab', pbcor=True, calcpsf=False, calcres=False, pblimit=-0.2) build 12-Sep-2018 15:30:25 + report2=self.th.checkall(imexist=[self.img+'.image', self.img+'.pb'], imval=[(self.img+'.pb',0.7,[256,256,0,0])] , immask=[(self.img+'.pb',False,[10,10,0,0]), (self.img+'.image',True,[10,10,0,0])] ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.checkfinal(report1+report2) build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_refimager_parallel.py b/gcwrap/python/scripts/tests/test_refimager_parallel.py build 12-Sep-2018 15:30:25 index 929f79c..893ff5e 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_refimager_parallel.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_refimager_parallel.py build 12-Sep-2018 15:30:25 @@ -91,13 +91,15 @@ class test_cont(testref_base_parallel): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + imexts = ['psf', 'residual', 'image', 'model', 'sumwt', 'pb'] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 ## Non-parallel run build 12-Sep-2018 15:30:25 ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec', build 12-Sep-2018 15:30:25 interactive=0,niter=10,parallel=False) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 self.th.checkall(ret=ret, peakres=0.332, build 12-Sep-2018 15:30:25 modflux=0.726, iterdone=10, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.psf', self.img+'.residual', self.img+'.image',self.img+'.model'], build 12-Sep-2018 15:30:25 + imexist=[self.img + '.' + ext for ext in imexts], build 12-Sep-2018 15:30:25 imval=[(self.img+'.sumwt', 34390852.0,[0,0,0,0])]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ## Parallel run build 12-Sep-2018 15:30:25 @@ -105,13 +107,15 @@ class test_cont(testref_base_parallel): build 12-Sep-2018 15:30:25 retpar = tclean(vis=self.msfile,imagename=imgpar,imsize=100,cell='8.0arcsec', build 12-Sep-2018 15:30:25 interactive=0,niter=10,parallel=True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - checkims = [imgpar+'.psf', imgpar+'.residual', imgpar+'.image',imgpar+'.model'] build 12-Sep-2018 15:30:25 - checkims = checkims + self.th.getNParts( imprefix=imgpar, imexts=['residual','psf','model'] ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + checkims = [imgpar + '.' + ext for ext in imexts] build 12-Sep-2018 15:30:25 + imexts.remove('image') build 12-Sep-2018 15:30:25 + imexts.remove('pb') build 12-Sep-2018 15:30:25 + checkims += self.th.getNParts(imprefix=imgpar, imexts=imexts) build 12-Sep-2018 15:30:25 + checkims += [os.path.join(imgpar + '.workdirectory', imgpar + '.n1.pb')] build 12-Sep-2018 15:30:25 report = self.th.checkall(ret=retpar, peakres=0.332, build 12-Sep-2018 15:30:25 modflux=0.726, iterdone=10, build 12-Sep-2018 15:30:25 imexist=checkims, build 12-Sep-2018 15:30:25 - imval=[(imgpar+'.sumwt' ,34390852.0,[0,0,0,0])]) build 12-Sep-2018 15:30:25 + imval=[(imgpar+'.sumwt', 34390852.0,[0,0,0,0])]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ## Pass or Fail (and why) ? build 12-Sep-2018 15:30:25 self.checkfinal(report) build 12-Sep-2018 15:30:25 @@ -144,10 +148,15 @@ class test_cont(testref_base_parallel): build 12-Sep-2018 15:30:25 imgpar = self.img+'.par' build 12-Sep-2018 15:30:25 retpar = tclean(vis=self.msfile,imagename=imgpar,imsize=100,cell='8.0arcsec', build 12-Sep-2018 15:30:25 interactive=0,niter=10,deconvolver='mtmfs',parallel=True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - checkims = [imgpar+'.psf.tt0', imgpar+'.residual.tt0', imgpar+'.image.tt0',imgpar+'.model.tt0'] build 12-Sep-2018 15:30:25 - checkims = checkims + self.th.getNParts( imprefix=imgpar, build 12-Sep-2018 15:30:25 - imexts=['residual.tt0','residual.tt1','psf.tt0','psf.tt1','model.tt0','model.tt1']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + imexts = ['psf.tt0', 'psf.tt1', 'psf.tt2', 'residual.tt0', 'residual.tt1', build 12-Sep-2018 15:30:25 + 'model.tt0', 'model.tt1', 'sumwt.tt0'] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + checkims = [imgpar + '.' + ext for ext in imexts] build 12-Sep-2018 15:30:25 + checkims += self.th.getNParts(imprefix=imgpar, imexts=imexts) build 12-Sep-2018 15:30:25 + checkims += [imgpar + '.' + ext for ext in build 12-Sep-2018 15:30:25 + ['image.tt0', 'image.tt1', 'pb.tt0', 'mask', 'alpha', build 12-Sep-2018 15:30:25 + 'alpha.error']] build 12-Sep-2018 15:30:25 report2 = self.th.checkall(ret=retpar, build 12-Sep-2018 15:30:25 peakres=0.369, modflux=0.689, iterdone=10, nmajordone=2, build 12-Sep-2018 15:30:25 imexist=checkims, build 12-Sep-2018 15:30:25 @@ -191,10 +200,15 @@ class test_cont(testref_base_parallel): build 12-Sep-2018 15:30:25 imgpar = os.path.join(self.img_subdir, self.img + '.par') build 12-Sep-2018 15:30:25 retpar = tclean(vis=[ms1,ms2],imagename=imgpar,imsize=100,cell='8.0arcsec', build 12-Sep-2018 15:30:25 interactive=0,niter=10,deconvolver='mtmfs',parallel=True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - checkims = [imgpar+'.psf.tt0', imgpar+'.residual.tt0', imgpar+'.image.tt0',imgpar+'.model.tt0'] build 12-Sep-2018 15:30:25 - checkims = checkims + self.th.getNParts( imprefix=imgpar, build 12-Sep-2018 15:30:25 - imexts=['residual.tt0','residual.tt1','psf.tt0','psf.tt1','model.tt0','model.tt1']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + imexts = ['.psf.tt0', '.psf.tt1', '.residual.tt0', '.residual.tt1', build 12-Sep-2018 15:30:25 + '.image.tt0', '.image.tt1', '.model.tt0', '.model.tt1', build 12-Sep-2018 15:30:25 + '.mask', '.pb.tt0', '.sumwt.tt0', '.sumwt.tt1', '.alpha', build 12-Sep-2018 15:30:25 + '.alpha.error'] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + checkims = [imgpar + ext for ext in imexts] build 12-Sep-2018 15:30:25 + checkims += self.th.getNParts(imprefix=imgpar, build 12-Sep-2018 15:30:25 + imexts=['residual.tt0','residual.tt1','psf.tt0','psf.tt1','model.tt0','model.tt1']) build 12-Sep-2018 15:30:25 report2 = self.th.checkall(ret=retpar, build 12-Sep-2018 15:30:25 peakres=0.409, modflux=0.764, iterdone=10, nmajordone=2, build 12-Sep-2018 15:30:25 imexist=checkims, build 12-Sep-2018 15:30:25 @@ -269,7 +283,7 @@ class test_cont(testref_base_parallel): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ################################################### build 12-Sep-2018 15:30:25 -#### Test parallel continuum imaging build 12-Sep-2018 15:30:25 +#### Test parallel cube imaging build 12-Sep-2018 15:30:25 ################################################### build 12-Sep-2018 15:30:25 class test_cube(testref_base_parallel): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -280,6 +294,8 @@ class test_cube(testref_base_parallel): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + imexts = ['psf', 'residual', 'image', 'model', 'pb', 'image.pbcor'] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 # Non-parallel run build 12-Sep-2018 15:30:25 ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec', build 12-Sep-2018 15:30:25 interactive=0,niter=10,deconvolver='hogbom',specmode='cube', build 12-Sep-2018 15:30:25 @@ -287,9 +303,8 @@ class test_cube(testref_base_parallel): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 report1 = self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 peakres=0.241, modflux=0.527, iterdone=200, nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.psf', self.img+'.residual', build 12-Sep-2018 15:30:25 - self.img+'.image',self.img+'.model', build 12-Sep-2018 15:30:25 - self.img+'.pb', self.img+'.image.pbcor' ], build 12-Sep-2018 15:30:25 + imexist=[self.img + '.' + ext for ext in build 12-Sep-2018 15:30:25 + imexts], build 12-Sep-2018 15:30:25 imval=[(self.img+'.image',1.2,[50,50,0,5]), build 12-Sep-2018 15:30:25 (self.img+'.sumwt',2949.775,[0,0,0,0]) ]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -299,14 +314,13 @@ class test_cube(testref_base_parallel): build 12-Sep-2018 15:30:25 interactive=0,niter=10,deconvolver='hogbom',specmode='cube', build 12-Sep-2018 15:30:25 pbcor=True,parallel=True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - checkims =self.th.getNParts( imprefix=imgpar, imexts=['residual','psf','model']) build 12-Sep-2018 15:30:25 + checkims = [imgpar + '.' + ext for ext in imexts] build 12-Sep-2018 15:30:25 + checkims += self.th.getNParts( imprefix=imgpar, imexts=imexts) build 12-Sep-2018 15:30:25 report2 = self.th.checkall(ret=retpar['node1'][1], build 12-Sep-2018 15:30:25 # peakres=0.241, modflux=0.527, iterdone=200, nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img+'.psf', self.img+'.residual', build 12-Sep-2018 15:30:25 - self.img+'.image',self.img+'.model', build 12-Sep-2018 15:30:25 - self.img+'.pb', self.img+'.image.pbcor' ], build 12-Sep-2018 15:30:25 - imval=[(self.img+'.image',1.2,[50,50,0,5]), build 12-Sep-2018 15:30:25 - (self.img+'.sumwt',2949.775,[0,0,0,0]) ]) build 12-Sep-2018 15:30:25 + imexist=[imgpar + '.' + ext for ext in imexts], build 12-Sep-2018 15:30:25 + imval=[(imgpar+'.image',1.2,[50,50,0,5]), build 12-Sep-2018 15:30:25 + (imgpar+'.sumwt',2949.775,[0,0,0,0]) ]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ## Pass or Fail (and why) ? build 12-Sep-2018 15:30:25 self.checkfinal(report1+report2) build 12-Sep-2018 15:30:25 @@ -322,18 +336,18 @@ class test_cube(testref_base_parallel): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 self.prepData('refim_point.ms') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + imexts = ['psf', 'residual', 'image', 'model', 'pb', 'image.pbcor' ] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 # Non-parallel run build 12-Sep-2018 15:30:25 ret = tclean(vis=self.msfile,imagename=self.img,imsize=100,cell='8.0arcsec', build 12-Sep-2018 15:30:25 interactive=0,niter=500,threshold='1.3Jy', build 12-Sep-2018 15:30:25 deconvolver='hogbom',specmode='cube', build 12-Sep-2018 15:30:25 pbcor=True, parallel=False) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - imexist_exts = ['.psf', '.residual', '.image', '.model', '.pb', build 12-Sep-2018 15:30:25 - '.image.pbcor' ] build 12-Sep-2018 15:30:25 report1 = self.th.checkall(ret=ret, build 12-Sep-2018 15:30:25 peakres=1.173, modflux=0.134, iterdone=5, nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[self.img + ext for ext in imexist_exts] build 12-Sep-2018 15:30:25 -, build 12-Sep-2018 15:30:25 + imexist=[self.img + '.' + ext for ext in build 12-Sep-2018 15:30:25 + imexts], build 12-Sep-2018 15:30:25 imval=[(self.img+'.image',1.2,[50,50,0,5]), build 12-Sep-2018 15:30:25 (self.img+'.sumwt',2949.775,[0,0,0,0]) ]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -343,11 +357,12 @@ class test_cube(testref_base_parallel): build 12-Sep-2018 15:30:25 interactive=0,niter=500, threshold='1.3Jy', build 12-Sep-2018 15:30:25 deconvolver='hogbom',specmode='cube', build 12-Sep-2018 15:30:25 pbcor=True,parallel=True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - checkims =self.th.getNParts( imprefix=imgpar, imexts=['residual','psf','model']) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + checkims = [imgpar + '.' + ext for ext in imexts] build 12-Sep-2018 15:30:25 + checkims += self.th.getNParts(imprefix=imgpar, imexts=imexts) build 12-Sep-2018 15:30:25 report2 = self.th.checkall(ret=retpar['node1'][1], build 12-Sep-2018 15:30:25 # peakres=0.241, modflux=0.527, iterdone=200, nmajordone=2, build 12-Sep-2018 15:30:25 - imexist=[imgpar + ext for ext in imexist_exts], build 12-Sep-2018 15:30:25 + imexist=checkims, build 12-Sep-2018 15:30:25 imval=[(imgpar + '.image', 1.2, [50, 50, 0, 5]), build 12-Sep-2018 15:30:25 (imgpar + '.sumwt', 2949.775, [0, 0, 0, 0])]) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_sdimaging.py b/gcwrap/python/scripts/tests/test_sdimaging.py build 12-Sep-2018 15:30:25 index 90a680b..640c52f 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_sdimaging.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_sdimaging.py build 12-Sep-2018 15:30:25 @@ -11,6 +11,7 @@ import numpy build 12-Sep-2018 15:30:25 import math build 12-Sep-2018 15:30:25 import re build 12-Sep-2018 15:30:25 import string build 12-Sep-2018 15:30:25 +import copy build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 _ia = iatool( ) build 12-Sep-2018 15:30:25 _rg = rgtool( ) build 12-Sep-2018 15:30:25 @@ -2646,26 +2647,33 @@ class sdimaging_test_mapextent(unittest.TestCase): build 12-Sep-2018 15:30:25 ### build 12-Sep-2018 15:30:25 class sdimaging_test_interp(unittest.TestCase): build 12-Sep-2018 15:30:25 """ build 12-Sep-2018 15:30:25 - The test data 'pointing6.ms' contains 1000 rows for TP data, while only 10 rows given build 12-Sep-2018 15:30:25 - for POINTING data. The pointing data is given as corner points of a hexagon centered at build 12-Sep-2018 15:30:25 - (RA, Dec) = (0h00m00s, 0d00m00s) and with side of 0.001 radian. build 12-Sep-2018 15:30:25 + tests: build 12-Sep-2018 15:30:25 + test_spline_interp_single_infiles: check if spline interpolation works for single MS build 12-Sep-2018 15:30:25 + test_spline_interp_multiple_infiles: check if spline interpolation works for multiple MSs build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + data: build 12-Sep-2018 15:30:25 + Both 'pointing6.ms' and 'pointing6-2.ms' contain 1000 rows for TP data, while only 10 build 12-Sep-2018 15:30:25 + rows given for POINTING data. build 12-Sep-2018 15:30:25 + The pointing data is given as corner points of a hexagon centered at (RA, Dec) = build 12-Sep-2018 15:30:25 + (0h00m00s, 0d00m00s) and with side of 0.001 radian and 0.0008 radian for 'pointing6.ms' build 12-Sep-2018 15:30:25 + and 'pointing6-2.ms', respectively. build 12-Sep-2018 15:30:25 The resulting pattern of weight image should be nearly circular if spline interpolation build 12-Sep-2018 15:30:25 does work, while it should be hexagonal if linear interpolation, the old algorithm, is build 12-Sep-2018 15:30:25 applied. build 12-Sep-2018 15:30:25 + Also, 'pointing6-2.ms' has 5 hours lag behind 'pointing6.ms'. build 12-Sep-2018 15:30:25 """ build 12-Sep-2018 15:30:25 datapath = os.environ.get('CASAPATH').split()[0] + '/data/regression/unittest/sdimaging/' build 12-Sep-2018 15:30:25 - params = dict(infiles = ['pointing6.ms'], build 12-Sep-2018 15:30:25 - outfile = "pointing6.out", build 12-Sep-2018 15:30:25 - antenna = "0", build 12-Sep-2018 15:30:25 + params = dict(antenna = "0", build 12-Sep-2018 15:30:25 intent = "*ON_SOURCE*", build 12-Sep-2018 15:30:25 gridfunction = "SF", build 12-Sep-2018 15:30:25 convsupport = 6, build 12-Sep-2018 15:30:25 imsize = [512, 512], build 12-Sep-2018 15:30:25 cell = "2arcsec", build 12-Sep-2018 15:30:25 phasecenter = "J2000 0:00:00.0 00.00.00.0", build 12-Sep-2018 15:30:25 - ephemsrcname = "Venus", build 12-Sep-2018 15:30:25 + ephemsrcname = '', build 12-Sep-2018 15:30:25 pointingcolumn = "direction") build 12-Sep-2018 15:30:25 - outfile = params['outfile'] build 12-Sep-2018 15:30:25 + infiles = [] build 12-Sep-2018 15:30:25 + outfiles = [] # have a list of outfiles as multiple task execution may occur in a test build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def __remove_table(self, f): build 12-Sep-2018 15:30:25 if os.path.exists(f): build 12-Sep-2018 15:30:25 @@ -2676,34 +2684,44 @@ class sdimaging_test_interp(unittest.TestCase): build 12-Sep-2018 15:30:25 testutils.copytree_ignore_subversion(self.datapath, f) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 - for infile in self.params['infiles']: build 12-Sep-2018 15:30:25 - self.__copy_table(infile) build 12-Sep-2018 15:30:25 + self.infiles = [] build 12-Sep-2018 15:30:25 + self.outfiles = [] build 12-Sep-2018 15:30:25 default(sdimaging) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 - for infile in self.params['infiles']: build 12-Sep-2018 15:30:25 + for infile in self.infiles: build 12-Sep-2018 15:30:25 self.__remove_table(infile) build 12-Sep-2018 15:30:25 - os.system('rm -rf %s*'%(self.outfile)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + for outfile in self.outfiles: build 12-Sep-2018 15:30:25 + os.system('rm -rf %s*'%(outfile)) build 12-Sep-2018 15:30:25 self.assertEqual(len(get_table_cache()), 0) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def run_test(self, **kwargs): build 12-Sep-2018 15:30:25 + def run_task(self, infiles, outfile, **kwargs): build 12-Sep-2018 15:30:25 + if isinstance(infiles, str): build 12-Sep-2018 15:30:25 + infiles = [ infiles ] build 12-Sep-2018 15:30:25 + for i in range(len(infiles)): build 12-Sep-2018 15:30:25 + self.infiles.append(infiles[i]) build 12-Sep-2018 15:30:25 + self.outfiles.append(outfile) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + for infile in infiles: build 12-Sep-2018 15:30:25 + self.__copy_table(infile) build 12-Sep-2018 15:30:25 self.params.update(**kwargs) build 12-Sep-2018 15:30:25 - status = sdimaging(**self.params) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + status = sdimaging(infiles=infiles, outfile=outfile, **self.params) build 12-Sep-2018 15:30:25 self.assertIsNone(status, msg = 'sdimaging failed to execute') build 12-Sep-2018 15:30:25 - self.assertTrue(os.path.exists(self.outfile), msg='output image is not created.') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(outfile), msg='output image is not created.') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def test_spline_interp(self): build 12-Sep-2018 15:30:25 - """test_spline_interp: Check if spline interpolation works for fast scan data.""" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.run_test() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - weightfile = self.outfile + '.weight' build 12-Sep-2018 15:30:25 + def check_spline_works(self, outfile, multiple_ms=False): build 12-Sep-2018 15:30:25 + weightfile = outfile + '.weight' build 12-Sep-2018 15:30:25 with tbmanager(weightfile) as tb: build 12-Sep-2018 15:30:25 mapdata = tb.getcell('map', 0) build 12-Sep-2018 15:30:25 # for pixels with strong weight value(>14), collect their distance from the image build 12-Sep-2018 15:30:25 # center and then compute the mean and sigma of their distribution. build 12-Sep-2018 15:30:25 - dist_list = [] build 12-Sep-2018 15:30:25 + dist_answer = [0.0, 0.0] build 12-Sep-2018 15:30:25 + dist_answer[0] = 0.001*180.0/numpy.pi*3600.0/float(self.params['cell'][0]) build 12-Sep-2018 15:30:25 + dist_answer[1] = dist_answer[0]*0.8 build 12-Sep-2018 15:30:25 + dist_sep = (dist_answer[0] + dist_answer[1])/2.0 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + dist_list = [[], []] build 12-Sep-2018 15:30:25 for i in range(self.params['imsize'][0]): build 12-Sep-2018 15:30:25 for j in range(self.params['imsize'][1]): build 12-Sep-2018 15:30:25 if mapdata[i][j][0][0] > 14.0: build 12-Sep-2018 15:30:25 @@ -2711,31 +2729,76 @@ class sdimaging_test_interp(unittest.TestCase): build 12-Sep-2018 15:30:25 ceny = float(self.params['imsize'][1])/2.0 build 12-Sep-2018 15:30:25 dx = float(i) - cenx build 12-Sep-2018 15:30:25 dy = float(j) - ceny build 12-Sep-2018 15:30:25 - dist_list.append(numpy.sqrt(dx*dx + dy*dy)) build 12-Sep-2018 15:30:25 - dist_mean = 0.0 build 12-Sep-2018 15:30:25 - dist_mean2 = 0.0 build 12-Sep-2018 15:30:25 - for i in range(len(dist_list)): build 12-Sep-2018 15:30:25 - dist_mean += dist_list[i] build 12-Sep-2018 15:30:25 - dist_mean2 += dist_list[i] * dist_list[i] build 12-Sep-2018 15:30:25 - dist_mean = dist_mean / float(len(dist_list)) build 12-Sep-2018 15:30:25 - dist_mean2 = dist_mean2 / float(len(dist_list)) build 12-Sep-2018 15:30:25 - dist_sigma = numpy.sqrt(dist_mean2 - dist_mean * dist_mean) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - dist_llim = dist_mean - dist_sigma build 12-Sep-2018 15:30:25 - dist_ulim = dist_mean + dist_sigma build 12-Sep-2018 15:30:25 - dist_answer = 0.001*180.0/numpy.pi*3600.0/float(self.params['cell'][0]) build 12-Sep-2018 15:30:25 + dr = numpy.sqrt(dx*dx + dy*dy) build 12-Sep-2018 15:30:25 + idx = 0 if (dist_sep < dr) else 1 build 12-Sep-2018 15:30:25 + dist_list[idx].append(dr) build 12-Sep-2018 15:30:25 + dist_mean1 = [0.0, 0.0] build 12-Sep-2018 15:30:25 + dist_mean2 = [0.0, 0.0] build 12-Sep-2018 15:30:25 + dist_sigma = [0.0, 0.0] build 12-Sep-2018 15:30:25 + dist_llim = [0.0, 0.0] build 12-Sep-2018 15:30:25 + dist_ulim = [0.0, 0.0] build 12-Sep-2018 15:30:25 + idx2 = 2 if multiple_ms else 1 build 12-Sep-2018 15:30:25 + for i in range(idx2): build 12-Sep-2018 15:30:25 + for j in range(len(dist_list[i])): build 12-Sep-2018 15:30:25 + dist_mean1[i] += dist_list[i][j] build 12-Sep-2018 15:30:25 + dist_mean2[i] += dist_list[i][j] * dist_list[i][j] build 12-Sep-2018 15:30:25 + dist_mean1[i] = dist_mean1[i] / float(len(dist_list[i])) build 12-Sep-2018 15:30:25 + dist_mean2[i] = dist_mean2[i] / float(len(dist_list[i])) build 12-Sep-2018 15:30:25 + dist_sigma[i] = numpy.sqrt(dist_mean2[i] - dist_mean1[i] * dist_mean1[i]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + dist_llim[i] = dist_mean1[i] - dist_sigma[i] build 12-Sep-2018 15:30:25 + dist_ulim[i] = dist_mean1[i] + dist_sigma[i] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + if spline interpolation is done, the range [dist_llim[0], dist_ulim[0]] build 12-Sep-2018 15:30:25 + will be a narrow range (102.683 ~ 103.318) and encloses the answer build 12-Sep-2018 15:30:25 + value (103.132), while linear interpolation will result in a wider build 12-Sep-2018 15:30:25 + range (94.240 +- 4.281) and depart from the answer value at 2-sigma build 12-Sep-2018 15:30:25 + level. build 12-Sep-2018 15:30:25 + FYI, [dist_llim[1], dist_ulim[1]] and dist_answer[1] will be build 12-Sep-2018 15:30:25 + (81.609 - 83.151) and (82.506), respectively. build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + self.assertTrue(((dist_llim[i] < dist_answer[i]) and (dist_answer[i] < dist_ulim[i])), build 12-Sep-2018 15:30:25 + msg = 'spline interpolation seems not working.') build 12-Sep-2018 15:30:25 + #print '['+str(i)+'] --- ' + str(dist_llim[i]) + ' - ' + str(dist_ulim[i]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def check_images_identical(self, image1, image2, weight_image=False): build 12-Sep-2018 15:30:25 + img1 = image1 build 12-Sep-2018 15:30:25 + img2 = image2 build 12-Sep-2018 15:30:25 + if weight_image: build 12-Sep-2018 15:30:25 + img1 += '.weight' build 12-Sep-2018 15:30:25 + img2 += '.weight' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + with tbmanager(img1) as tb: build 12-Sep-2018 15:30:25 + mapdata1 = tb.getcell('map', 0) build 12-Sep-2018 15:30:25 + with tbmanager(img2) as tb: build 12-Sep-2018 15:30:25 + mapdata2 = tb.getcell('map', 0) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.allclose(mapdata1, mapdata2, rtol=1.0e-5, atol=1.0e-5), build 12-Sep-2018 15:30:25 + msg="%s and %s are not identical" % (img1, img2)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_spline_interp_single_infiles(self): build 12-Sep-2018 15:30:25 + """test_spline_interp_single_infiles: Check if spline interpolation works for single fast-scan data.""" build 12-Sep-2018 15:30:25 + outfile = 'pointing6.out' build 12-Sep-2018 15:30:25 + self.run_task(infiles=['pointing6.ms'], outfile=outfile) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.check_spline_works(outfile) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_spline_interp_multiple_infiles(self): build 12-Sep-2018 15:30:25 + """test_spline_interp_multiple_infiles: Check if spline interpolation works for multiple fast-scan data.""" build 12-Sep-2018 15:30:25 + outfile12 = "1and2.out" build 12-Sep-2018 15:30:25 + self.run_task(infiles=['pointing6.ms', 'pointing6-2.ms'], outfile=outfile12) build 12-Sep-2018 15:30:25 + outfile21 = "2and1.out" build 12-Sep-2018 15:30:25 + self.run_task(infiles=['pointing6-2.ms', 'pointing6.ms'], outfile=outfile21) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + #check if spline interpolation works build 12-Sep-2018 15:30:25 + self.check_spline_works(outfile12, True) build 12-Sep-2018 15:30:25 + #check if the results (both image and weight) don't change when infiles has inversed order build 12-Sep-2018 15:30:25 + self.check_images_identical(outfile12, outfile21) build 12-Sep-2018 15:30:25 + self.check_images_identical(outfile12, outfile21, True) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - if spline interpolation is done, the range [dist_llim, dist_ulim] build 12-Sep-2018 15:30:25 - will be a narrow range (102.683 ~ 103.318) and encloses the answer build 12-Sep-2018 15:30:25 - value (103.132), while linear interpolation will result in a wider build 12-Sep-2018 15:30:25 - range (94.240 +- 4.281) and depart from the answer value at 2-sigma build 12-Sep-2018 15:30:25 - level. build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - self.assertTrue(((dist_llim < dist_answer) and (dist_answer < dist_ulim)), build 12-Sep-2018 15:30:25 - msg = 'spline interpolation seems not working.') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 class sdimaging_test_clipping(sdimaging_unittest_base): build 12-Sep-2018 15:30:25 """ build 12-Sep-2018 15:30:25 test_1row: check if clipping is not activated (1 spectrum) build 12-Sep-2018 15:30:25 @@ -3237,5 +3300,7 @@ def suite(): build 12-Sep-2018 15:30:25 sdimaging_test_mslist, build 12-Sep-2018 15:30:25 sdimaging_test_restfreq, build 12-Sep-2018 15:30:25 sdimaging_test_mapextent, build 12-Sep-2018 15:30:25 - sdimaging_test_interp,sdimaging_test_clipping, build 12-Sep-2018 15:30:25 - sdimaging_test_projection] build 12-Sep-2018 15:30:25 + sdimaging_test_interp, build 12-Sep-2018 15:30:25 + sdimaging_test_clipping, build 12-Sep-2018 15:30:25 + sdimaging_test_projection build 12-Sep-2018 15:30:25 + ] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_sdsidebandsplit.py b/gcwrap/python/scripts/tests/test_sdsidebandsplit.py build 12-Sep-2018 15:30:25 index e79ce38..8eec36d 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_sdsidebandsplit.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_sdsidebandsplit.py build 12-Sep-2018 15:30:25 @@ -46,7 +46,7 @@ class sdsidebandsplitTestBase(unittest.TestCase): build 12-Sep-2018 15:30:25 signalshift = [0.0, -102, +8, +62, +88, +100], build 12-Sep-2018 15:30:25 imageshift = [0.0, 102, -8, -62, -88, -100], build 12-Sep-2018 15:30:25 getbothside = False, build 12-Sep-2018 15:30:25 - refpix = 0.0, build 12-Sep-2018 15:30:25 + refchan = 0.0, build 12-Sep-2018 15:30:25 refval = '805GHz', build 12-Sep-2018 15:30:25 otherside = False, build 12-Sep-2018 15:30:25 threshold = 0.2 build 12-Sep-2018 15:30:25 @@ -83,6 +83,11 @@ class sdsidebandsplitTestBase(unittest.TestCase): build 12-Sep-2018 15:30:25 shutil.rmtree(prefix+suffix) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def tearDown(self): build 12-Sep-2018 15:30:25 + # remove input images build 12-Sep-2018 15:30:25 + for name in self.standard_param['imagename']: build 12-Sep-2018 15:30:25 + if os.path.exists(name): build 12-Sep-2018 15:30:25 + shutil.rmtree(name) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 # remove output files build 12-Sep-2018 15:30:25 prefix = self.standard_param['outfile'] build 12-Sep-2018 15:30:25 for suffix in ['.signalband', '.imageband']: build 12-Sep-2018 15:30:25 @@ -123,7 +128,7 @@ class sdsidebandsplitTestBase(unittest.TestCase): build 12-Sep-2018 15:30:25 'Internal Error: No valid reference value for image sideband') build 12-Sep-2018 15:30:25 # modify refcsys for image sideband build 12-Sep-2018 15:30:25 spid = refcsys.findaxisbyname('spectral') build 12-Sep-2018 15:30:25 - refcsys.setreferencepixel(task_param['refpix'], 'spectral') build 12-Sep-2018 15:30:25 + refcsys.setreferencepixel(task_param['refchan'], 'spectral') build 12-Sep-2018 15:30:25 myqa = qatool() build 12-Sep-2018 15:30:25 refcsys.setreferencevalue(myqa.convert(task_param['refval'], build 12-Sep-2018 15:30:25 refcsys.units()[spid])['value'], build 12-Sep-2018 15:30:25 @@ -335,6 +340,13 @@ class standardTestCase(sdsidebandsplitTestBase): build 12-Sep-2018 15:30:25 SpectralInfo(1700, 2700, 6.05933, 1.02671, 4.92205, 2297.6872, 19.75842, 1.14450)), build 12-Sep-2018 15:30:25 image=(SpectralInfo(1000, 2000, 8.07553, 1.05448, 6.94301, 1600.1052, 19.95953, 1.13069), build 12-Sep-2018 15:30:25 SpectralInfo(2500, 3500, 3.06859, 1.00263, 1.99147, 2999.9953, 9.92538, 1.07988))) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def assertAlmostEqual2(self, first, second, eps=1.0e-7, msg=None): build 12-Sep-2018 15:30:25 + if second == 0: build 12-Sep-2018 15:30:25 + self.assertLessEqual(abs(first), eps, msg) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + reldiff = abs((first - second) / second) build 12-Sep-2018 15:30:25 + self.assertLessEqual(reldiff, eps, msg) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def compare_image_data(self, data, reference): build 12-Sep-2018 15:30:25 """ build 12-Sep-2018 15:30:25 @@ -350,14 +362,20 @@ class standardTestCase(sdsidebandsplitTestBase): build 12-Sep-2018 15:30:25 for seg in reference: build 12-Sep-2018 15:30:25 sp = data[0,0,0,seg.start:seg.end] build 12-Sep-2018 15:30:25 x = range(seg.start, seg.end) build 12-Sep-2018 15:30:25 - self.assertAlmostEqual(sp.max(), seg.max, 3, 'Max comparison failed') build 12-Sep-2018 15:30:25 - self.assertAlmostEqual(sp.min(), seg.min, 3, 'Min comparison failed') build 12-Sep-2018 15:30:25 + #print('Max: ref {0} val {1}'.format(seg.max, sp.max())) build 12-Sep-2018 15:30:25 + #print('Min: ref {0} val {1}'.format(seg.min, sp.min())) build 12-Sep-2018 15:30:25 + self.assertAlmostEqual2(sp.max(), seg.max, 1e-3, 'Max comparison failed') build 12-Sep-2018 15:30:25 + self.assertAlmostEqual2(sp.min(), seg.min, 0.01, 'Min comparison failed') build 12-Sep-2018 15:30:25 # compare gaussian fit build 12-Sep-2018 15:30:25 fitp, _dummy = gauss_fit(x, sp) build 12-Sep-2018 15:30:25 - self.assertAlmostEqual(fitp[0], seg.peak, 3, 'Peak comparison failed') build 12-Sep-2018 15:30:25 - self.assertAlmostEqual(fitp[1], seg.center, 2, 'Peak position comparison failed') build 12-Sep-2018 15:30:25 - self.assertAlmostEqual(numpy.abs(fitp[2]), numpy.abs(seg.width), 3, 'Width comparison failed') build 12-Sep-2018 15:30:25 - self.assertAlmostEqual(fitp[3], seg.offset, 3, 'Offset comparison failed') build 12-Sep-2018 15:30:25 + #print('Peak: ref {0} val {1}'.format(seg.peak, fitp[0])) build 12-Sep-2018 15:30:25 + #print('Peak Pos: ref {0} val {1}'.format(seg.center, fitp[1])) build 12-Sep-2018 15:30:25 + #print('Width: ref {0} val {1}'.format(seg.width, fitp[2])) build 12-Sep-2018 15:30:25 + #print('Offset: ref {0} val {1}'.format(seg.offset, fitp[3])) build 12-Sep-2018 15:30:25 + self.assertAlmostEqual2(fitp[0], seg.peak, 1e-3, 'Peak comparison failed') build 12-Sep-2018 15:30:25 + self.assertAlmostEqual2(fitp[1], seg.center, 1e-3, 'Peak position comparison failed') build 12-Sep-2018 15:30:25 + self.assertAlmostEqual2(numpy.abs(fitp[2]), numpy.abs(seg.width), 1e-3, 'Width comparison failed') build 12-Sep-2018 15:30:25 + self.assertAlmostEqual2(fitp[3], seg.offset, 1e-3, 'Offset comparison failed') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # T-002 build 12-Sep-2018 15:30:25 def test_imagename_2images(self): build 12-Sep-2018 15:30:25 @@ -408,14 +426,14 @@ class standardTestCase(sdsidebandsplitTestBase): build 12-Sep-2018 15:30:25 self.run_test(self.standard_reference, getbothside=True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # T-020 build 12-Sep-2018 15:30:25 - def test_refpix_negative(self): build 12-Sep-2018 15:30:25 - """refpix = -1.0""" build 12-Sep-2018 15:30:25 - self.run_test(self.standard_reference, getbothside=True, refpix=-1.0) build 12-Sep-2018 15:30:25 + def test_refchan_negative(self): build 12-Sep-2018 15:30:25 + """refchan = -1.0""" build 12-Sep-2018 15:30:25 + self.run_test(self.standard_reference, getbothside=True, refchan=-1.0) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # T-021 build 12-Sep-2018 15:30:25 - def test_refpix_large(self): build 12-Sep-2018 15:30:25 - """refpix > nchan""" build 12-Sep-2018 15:30:25 - self.run_test(self.standard_reference, getbothside=True, refpix=5000.0) build 12-Sep-2018 15:30:25 + def test_refchan_large(self): build 12-Sep-2018 15:30:25 + """refchan > nchan""" build 12-Sep-2018 15:30:25 + self.run_test(self.standard_reference, getbothside=True, refchan=5000.0) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 # T-025 build 12-Sep-2018 15:30:25 def test_otherside(self): build 12-Sep-2018 15:30:25 @@ -455,7 +473,7 @@ class MultiPixTestCase(sdsidebandsplitTestBase): build 12-Sep-2018 15:30:25 signalshift = [0.0, -102, +8, +62, +88, +100], build 12-Sep-2018 15:30:25 imageshift = [0.0, 102, -8, -62, -88, -100], build 12-Sep-2018 15:30:25 getbothside = False, build 12-Sep-2018 15:30:25 - refpix = 0.0, build 12-Sep-2018 15:30:25 + refchan = 0.0, build 12-Sep-2018 15:30:25 refval = '805GHz', build 12-Sep-2018 15:30:25 otherside = False, build 12-Sep-2018 15:30:25 threshold = 0.2 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_setjy.py b/gcwrap/python/scripts/tests/test_setjy.py build 12-Sep-2018 15:30:25 index c77eabd..9d19429 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_setjy.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_setjy.py build 12-Sep-2018 15:30:25 @@ -1115,6 +1115,278 @@ class test_ModImage(SetjyUnitTestBase): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 return record build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 +class test_newStandards(SetjyUnitTestBase): build 12-Sep-2018 15:30:25 + """Test simple Stnadard Scaling""" build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + prefix = 'n1333_1' build 12-Sep-2018 15:30:25 + msname=prefix+'.ms' build 12-Sep-2018 15:30:25 + self.setUpMS(msname) build 12-Sep-2018 15:30:25 + self.field='0542+498_1' #3C147 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + #self.resetMS() build 12-Sep-2018 15:30:25 + pass build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_PB2013(self): build 12-Sep-2018 15:30:25 + self.modelim = "" build 12-Sep-2018 15:30:25 + sjran = setjy(vis=self.inpms, build 12-Sep-2018 15:30:25 + field=self.field, build 12-Sep-2018 15:30:25 + modimage=self.modelim, build 12-Sep-2018 15:30:25 + standard='Perley-Butler 2013', build 12-Sep-2018 15:30:25 + usescratch=True build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + ret = True build 12-Sep-2018 15:30:25 + if type(sjran)!=dict: build 12-Sep-2018 15:30:25 + ret = False build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + outfldid = "" build 12-Sep-2018 15:30:25 + for ky in sjran.keys(): build 12-Sep-2018 15:30:25 + if sjran[ky].has_key('fieldName') and sjran[ky]['fieldName']==self.field: build 12-Sep-2018 15:30:25 + outfldid = ky build 12-Sep-2018 15:30:25 + break build 12-Sep-2018 15:30:25 + ret = len(outfldid) build 12-Sep-2018 15:30:25 + if not ret: build 12-Sep-2018 15:30:25 + print "FAIL: missing field = %s in the returned dictionary" % self.field build 12-Sep-2018 15:30:25 + self.check_eq(sjran['12']['0']['fluxd'][0],0.99137,0.0001) build 12-Sep-2018 15:30:25 + self.check_eq(sjran['12']['1']['fluxd'][0],0.99132,0.0001) build 12-Sep-2018 15:30:25 + self.assertTrue(ret) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_PB2017(self): build 12-Sep-2018 15:30:25 + self.modelim = "" build 12-Sep-2018 15:30:25 + sjran = setjy(vis=self.inpms, build 12-Sep-2018 15:30:25 + field=self.field, build 12-Sep-2018 15:30:25 + modimage=self.modelim, build 12-Sep-2018 15:30:25 + standard='Perley-Butler 2017', build 12-Sep-2018 15:30:25 + usescratch=True build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + ret = True build 12-Sep-2018 15:30:25 + if type(sjran)!=dict: build 12-Sep-2018 15:30:25 + ret = False build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + outfldid = "" build 12-Sep-2018 15:30:25 + for ky in sjran.keys(): build 12-Sep-2018 15:30:25 + if sjran[ky].has_key('fieldName') and sjran[ky]['fieldName']==self.field: build 12-Sep-2018 15:30:25 + outfldid = ky build 12-Sep-2018 15:30:25 + break build 12-Sep-2018 15:30:25 + ret = len(outfldid) build 12-Sep-2018 15:30:25 + if not ret: build 12-Sep-2018 15:30:25 + print "FAIL: missing field = %s in the returned dictionary" % self.field build 12-Sep-2018 15:30:25 + #self.check_eq(sjran['12']['0']['fluxd'][0],1.15116881972,0.0001) build 12-Sep-2018 15:30:25 + #self.check_eq(sjran['12']['1']['fluxd'][0],1.15111995508,0.0001) build 12-Sep-2018 15:30:25 + self.check_eq(sjran['12']['0']['fluxd'][0],0.99137,0.0001) build 12-Sep-2018 15:30:25 + self.check_eq(sjran['12']['1']['fluxd'][0],0.99132,0.0001) build 12-Sep-2018 15:30:25 + self.assertTrue(ret) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class test_inputs(SetjyUnitTestBase): build 12-Sep-2018 15:30:25 + """Test input parameter checking""" build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + #self.setUpMS("unittest/setjy/2528.ms") # Uranus build 12-Sep-2018 15:30:25 + #self.setUpMS("2528.ms") # Uranus build 12-Sep-2018 15:30:25 + self.setUpMS("multiobs.ms") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + self.resetMS() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_vischeck(self): build 12-Sep-2018 15:30:25 + """ Test input vis check""" build 12-Sep-2018 15:30:25 + self.inpms='wrong.ms' build 12-Sep-2018 15:30:25 + if os.path.exists(self.inpms): build 12-Sep-2018 15:30:25 + shutil.rmtree(self.inpms) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # test by temporarily setting __rethrow_casa_exceptions build 12-Sep-2018 15:30:25 + sjran=None build 12-Sep-2018 15:30:25 + try: build 12-Sep-2018 15:30:25 + myf = stack_frame_find( ) build 12-Sep-2018 15:30:25 + original_rethrow_setting=myf.get('__rethrow_casa_exceptions',False) build 12-Sep-2018 15:30:25 + myf['__rethrow_casa_exceptions']=True build 12-Sep-2018 15:30:25 + print "\nRunning setjy with a non-existant vis" build 12-Sep-2018 15:30:25 + sjran = setjy(vis=self.inpms,listmodels=False) build 12-Sep-2018 15:30:25 + except Exception, setjyUTerr: build 12-Sep-2018 15:30:25 + msg = setjyUTerr.message build 12-Sep-2018 15:30:25 + self.assertNotEqual(msg.find("%s does not exist" % self.inpms), -1, build 12-Sep-2018 15:30:25 + 'wrong type of exception is thrown') build 12-Sep-2018 15:30:25 + finally: build 12-Sep-2018 15:30:25 + # put back original rethrow setting build 12-Sep-2018 15:30:25 + myf['__rethrow_casa_exceptions']=original_rethrow_setting build 12-Sep-2018 15:30:25 + self.assertEqual(sjran,None,"Failed to raise exception.") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_listmodels(self): build 12-Sep-2018 15:30:25 + """ Test listmodels mode """ build 12-Sep-2018 15:30:25 + self.inpms='' build 12-Sep-2018 15:30:25 + print "\nRunning setjy in listmodels mode ...." build 12-Sep-2018 15:30:25 + sjran = setjy(vis=self.inpms,listmodels=True) build 12-Sep-2018 15:30:25 + self.assertTrue(sjran) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class test_conesearch(SetjyUnitTestBase): build 12-Sep-2018 15:30:25 + """Test search for field match by position (standard='Perley-Butler 2013')""" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + prefix = 'n1333_nonstdcalname' build 12-Sep-2018 15:30:25 + msname=prefix+'.ms' build 12-Sep-2018 15:30:25 + #self.setUpMS('unittest/setjy/n1333_nonstdcalname.ms') build 12-Sep-2018 15:30:25 + self.setUpMS(msname) build 12-Sep-2018 15:30:25 + self.field = 'myfcalsrc' build 12-Sep-2018 15:30:25 + self.modelim = '3C147_U.im' build 12-Sep-2018 15:30:25 + self.result = {} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + self.resetMS() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_searchByPosition(self): build 12-Sep-2018 15:30:25 + sjran = setjy(vis=self.inpms, build 12-Sep-2018 15:30:25 + field=self.field, build 12-Sep-2018 15:30:25 + modimage=self.modelim, build 12-Sep-2018 15:30:25 + scalebychan=False, build 12-Sep-2018 15:30:25 + #standard='Perley-Taylor 99', build 12-Sep-2018 15:30:25 + standard='Perley-Butler 2013', build 12-Sep-2018 15:30:25 + usescratch=True build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + ret = True build 12-Sep-2018 15:30:25 + if type(sjran)!=dict: build 12-Sep-2018 15:30:25 + ret = False build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + outfldid = "" build 12-Sep-2018 15:30:25 + for ky in sjran.keys(): build 12-Sep-2018 15:30:25 + if sjran[ky].has_key('fieldName') and sjran[ky]['fieldName']==self.field: build 12-Sep-2018 15:30:25 + outfldid = ky build 12-Sep-2018 15:30:25 + break build 12-Sep-2018 15:30:25 + ret = len(outfldid) build 12-Sep-2018 15:30:25 + if not ret: build 12-Sep-2018 15:30:25 + print "FAIL: missing field = %s in the returned dictionary" % self.field build 12-Sep-2018 15:30:25 + self.check_eq(sjran['12']['1']['fluxd'][0],0.99125797,0.0001) build 12-Sep-2018 15:30:25 + self.assertTrue(ret) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class test_fluxscaleStandard(SetjyUnitTestBase): build 12-Sep-2018 15:30:25 + """Test standard="fluxscale" mode""" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + prefix = 'ngc5921' build 12-Sep-2018 15:30:25 + msname=prefix+'.ms' build 12-Sep-2018 15:30:25 + self.setUpMS(msname) build 12-Sep-2018 15:30:25 + self.field = 'myfcalsrc' build 12-Sep-2018 15:30:25 + self.modelim = '3C147_U.im' build 12-Sep-2018 15:30:25 + self.result = {} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + self.resetMS() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_fluxscaleStandard1(self): build 12-Sep-2018 15:30:25 + """ Test for accepting input fluxscale dictionary """ build 12-Sep-2018 15:30:25 + import numpy as np build 12-Sep-2018 15:30:25 + fluxscaledict=\ build 12-Sep-2018 15:30:25 + {'1': {'0': {'fluxd': np.array([ 2.48362403, 0. , 0. , 0. ]), build 12-Sep-2018 15:30:25 + 'fluxdErr': np.array([ 0.00215907, 0. , 0. , 0. ]), build 12-Sep-2018 15:30:25 + 'numSol': np.array([ 54., 0., 0., 0.])}, build 12-Sep-2018 15:30:25 + 'fieldName': '1445+09900002_0', build 12-Sep-2018 15:30:25 + 'fitFluxd': 0.0, build 12-Sep-2018 15:30:25 + 'fitFluxdErr': 0.0, build 12-Sep-2018 15:30:25 + 'fitRefFreq': 0.0, build 12-Sep-2018 15:30:25 + 'spidx': np.array([ 0., 0., 0.]), build 12-Sep-2018 15:30:25 + 'spidxerr': np.array([ 0., 0., 0.])}, build 12-Sep-2018 15:30:25 + 'freq':np. array([ 1.41266507e+09]), build 12-Sep-2018 15:30:25 + 'spwID': np.array([0], dtype=np.int32), build 12-Sep-2018 15:30:25 + 'spwName': np.array(['none'], dtype='|S5')} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + sjran = setjy(vis=self.inpms, build 12-Sep-2018 15:30:25 + standard='fluxscale', build 12-Sep-2018 15:30:25 + fluxdict=fluxscaledict, build 12-Sep-2018 15:30:25 + usescratch=False build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + ret = True build 12-Sep-2018 15:30:25 + if type(sjran)!=dict: build 12-Sep-2018 15:30:25 + ret = False build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + outfldid = "" build 12-Sep-2018 15:30:25 + for ky in sjran.keys(): build 12-Sep-2018 15:30:25 + if sjran[ky].has_key('fieldName') and sjran[ky]['fieldName']==fluxscaledict['1']['fieldName']: build 12-Sep-2018 15:30:25 + outfldid = ky build 12-Sep-2018 15:30:25 + break build 12-Sep-2018 15:30:25 + ret = len(outfldid) build 12-Sep-2018 15:30:25 + if not ret: build 12-Sep-2018 15:30:25 + print "FAIL: missing field = %s in the returned dictionary" % self.field build 12-Sep-2018 15:30:25 + self.check_eq(sjran['1']['0']['fluxd'][0],2.48362403,0.0001) build 12-Sep-2018 15:30:25 + self.assertTrue(ret) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class test_setpol(SetjyUnitTestBase): build 12-Sep-2018 15:30:25 + """Test multi-term spix and polarization parameter setting""" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + prefix = '3c391calonly' build 12-Sep-2018 15:30:25 + msfile = prefix + '.ms' build 12-Sep-2018 15:30:25 + #self.setUpMS('unittest/setjy/3c391calonly.ms') build 12-Sep-2018 15:30:25 + self.setUpMS(msfile) build 12-Sep-2018 15:30:25 + self.result = {} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + self.resetMS() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_setpol1(self): build 12-Sep-2018 15:30:25 + """ Test for multi-term spix (alpha and beta) """ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + sjran = setjy(vis=self.inpms, build 12-Sep-2018 15:30:25 + standard='manual', build 12-Sep-2018 15:30:25 + field = 'J1331+3030', build 12-Sep-2018 15:30:25 + fluxdensity = [7.81694, 0.355789, 0.79909, 0], build 12-Sep-2018 15:30:25 + spix = [-0.62,-0.1], build 12-Sep-2018 15:30:25 + reffreq='4536.0MHz', build 12-Sep-2018 15:30:25 + usescratch=True) build 12-Sep-2018 15:30:25 + ret = True build 12-Sep-2018 15:30:25 + if type(sjran)!=dict: build 12-Sep-2018 15:30:25 + ret = False build 12-Sep-2018 15:30:25 + #else: build 12-Sep-2018 15:30:25 + # print sjran build 12-Sep-2018 15:30:25 + #print "fluxdic=",sjran build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.check_eq(sjran['0']['0']['fluxd'][0],7.81694, 0.0001) build 12-Sep-2018 15:30:25 + self.assertTrue(ret) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # expected flux build 12-Sep-2018 15:30:25 + #fref = 4.536e9 build 12-Sep-2018 15:30:25 + #logflx = log10(7.81694) + (-0.62)*log10(f/fref) + (-0.1)*log10(f/fref) build 12-Sep-2018 15:30:25 + # fmin at last chan (Freq=4662000000.0Hz) build 12-Sep-2018 15:30:25 + fexpmin = 7.68502 build 12-Sep-2018 15:30:25 + ms.open(self.inpms) build 12-Sep-2018 15:30:25 + retrec = ms.statistics(field='0', baseline='1&2', correlation='rr', column='model', complex_value='amp', reportingaxes='field') build 12-Sep-2018 15:30:25 + ms.close() build 12-Sep-2018 15:30:25 + self.check_eq(retrec['FIELD_ID=0']['min'],fexpmin,0.0001) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_setpol2(self): build 12-Sep-2018 15:30:25 + """ Test for constant polindex and polangle with I flux density """ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + sjran = setjy(vis=self.inpms, build 12-Sep-2018 15:30:25 + standard='manual', build 12-Sep-2018 15:30:25 + field = 'J1331+3030', build 12-Sep-2018 15:30:25 + fluxdensity = [7.81694, 0, 0, 0], build 12-Sep-2018 15:30:25 + spix = [-0.62], build 12-Sep-2018 15:30:25 + reffreq='4536.0MHz', build 12-Sep-2018 15:30:25 + usescratch=True) build 12-Sep-2018 15:30:25 + ret = True build 12-Sep-2018 15:30:25 + if type(sjran)!=dict: build 12-Sep-2018 15:30:25 + ret = False build 12-Sep-2018 15:30:25 + #else: build 12-Sep-2018 15:30:25 + # print sjran build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.check_eq(sjran['0']['0']['fluxd'][0],7.81694, 0.0001) build 12-Sep-2018 15:30:25 + self.assertTrue(ret) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # expected flux build 12-Sep-2018 15:30:25 + #fref = 4.536e9 build 12-Sep-2018 15:30:25 + #logflx = log10(7.81694) + (-0.62)*log10(f/fref) + (-0.1)*log10(f/fref) build 12-Sep-2018 15:30:25 + # fmin at last chan (Freq=4662000000.0Hz) build 12-Sep-2018 15:30:25 + fexpmin = 7.68527 build 12-Sep-2018 15:30:25 + ms.open(self.inpms) build 12-Sep-2018 15:30:25 + retrec = ms.statistics(field='0', baseline='1&2', correlation='rr', column='model', complex_value='amp', reportingaxes='field') build 12-Sep-2018 15:30:25 + #retrec2 = ms.statistics(field='0', baseline='1&2', correlation='rl', column='model', complex_value='phase') build 12-Sep-2018 15:30:25 + ms.close() build 12-Sep-2018 15:30:25 + self.check_eq(retrec['FIELD_ID=0']['min'],fexpmin,0.0001) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_setpol3(self): build 12-Sep-2018 15:30:25 + """ Test for frequency-dependent polindex (2 terms) """ build 12-Sep-2018 15:30:25 + # the constant terms (polindex[0] and polangle[0] is ignored.. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 class test_inputs(SetjyUnitTestBase): build 12-Sep-2018 15:30:25 """Test input parameter checking""" build 12-Sep-2018 15:30:25 def setUp(self): build 12-Sep-2018 15:30:25 @@ -1688,4 +1960,4 @@ class test_NullSelection(SetjyUnitTestBase): build 12-Sep-2018 15:30:25 def suite(): build 12-Sep-2018 15:30:25 return [test_SingleObservation,test_MultipleObservations,test_ModImage, test_inputs, build 12-Sep-2018 15:30:25 test_conesearch, test_fluxscaleStandard, test_setpol, test_ephemtbl, build 12-Sep-2018 15:30:25 - test_tpmAsteroid,test_NullSelection] build 12-Sep-2018 15:30:25 + test_tpmAsteroid,test_NullSelection, test_newStandards] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_statwt.py b/gcwrap/python/scripts/tests/test_statwt.py build 12-Sep-2018 15:30:25 index c1999df..c659383 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_statwt.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_statwt.py build 12-Sep-2018 15:30:25 @@ -1,120 +1,773 @@ build 12-Sep-2018 15:30:25 import os build 12-Sep-2018 15:30:25 import sys build 12-Sep-2018 15:30:25 import shutil build 12-Sep-2018 15:30:25 -import commands build 12-Sep-2018 15:30:25 -import numpy build 12-Sep-2018 15:30:25 -import numpy.ma as ma build 12-Sep-2018 15:30:25 -import random build 12-Sep-2018 15:30:25 from __main__ import default build 12-Sep-2018 15:30:25 from tasks import * build 12-Sep-2018 15:30:25 from taskinit import * build 12-Sep-2018 15:30:25 -from cleanhelper import * build 12-Sep-2018 15:30:25 import unittest build 12-Sep-2018 15:30:25 +import math build 12-Sep-2018 15:30:25 +import numpy build 12-Sep-2018 15:30:25 +import numbers build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +datadir = os.environ.get('CASAPATH').split()[0] + '/data/regression/unittest/statwt/' build 12-Sep-2018 15:30:25 +src = datadir + 'ngc5921.split_2.ms' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +def _get_dst_cols(dst, other="", dodata=True): build 12-Sep-2018 15:30:25 + mytb = tbtool() build 12-Sep-2018 15:30:25 + mytb.open(dst) build 12-Sep-2018 15:30:25 + wt = mytb.getcol("WEIGHT") build 12-Sep-2018 15:30:25 + wtsp = mytb.getcol("WEIGHT_SPECTRUM") build 12-Sep-2018 15:30:25 + flag = mytb.getcol("FLAG") build 12-Sep-2018 15:30:25 + frow = mytb.getcol("FLAG_ROW") build 12-Sep-2018 15:30:25 + if dodata: build 12-Sep-2018 15:30:25 + data = mytb.getcol("CORRECTED_DATA") build 12-Sep-2018 15:30:25 + if len(other) > 0: build 12-Sep-2018 15:30:25 + if type(other) == type([]): build 12-Sep-2018 15:30:25 + othercol = [] build 12-Sep-2018 15:30:25 + for x in other: build 12-Sep-2018 15:30:25 + othercol.append(mytb.getcol(x)) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + othercol = mytb.getcol(other) build 12-Sep-2018 15:30:25 + mytb.close() build 12-Sep-2018 15:30:25 + cols = [wt, wtsp, flag, frow] build 12-Sep-2018 15:30:25 + if dodata: build 12-Sep-2018 15:30:25 + cols.append(data) build 12-Sep-2018 15:30:25 + if len(other) > 0: build 12-Sep-2018 15:30:25 + if type(other) == type([]): build 12-Sep-2018 15:30:25 + for x in othercol: build 12-Sep-2018 15:30:25 + cols.append(x) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + cols.append(othercol) build 12-Sep-2018 15:30:25 + return cols build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +def _get_table_cols(mytb): build 12-Sep-2018 15:30:25 + times = mytb.getcol("TIME") build 12-Sep-2018 15:30:25 + wt = mytb.getcol("WEIGHT") build 12-Sep-2018 15:30:25 + wtsp = mytb.getcol("WEIGHT_SPECTRUM") build 12-Sep-2018 15:30:25 + flag = mytb.getcol("FLAG") build 12-Sep-2018 15:30:25 + frow = mytb.getcol("FLAG_ROW") build 12-Sep-2018 15:30:25 + data = mytb.getcol("CORRECTED_DATA") build 12-Sep-2018 15:30:25 + return [times, wt, wtsp, flag, frow, data] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +# combine correlations build 12-Sep-2018 15:30:25 +def _variance(dr, di, flag, row): build 12-Sep-2018 15:30:25 + fr = numpy.extract(numpy.logical_not(flag[:,:,row]), dr[:,:,row]) build 12-Sep-2018 15:30:25 + fi = numpy.extract(numpy.logical_not(flag[:,:,row]), di[:,:,row]) build 12-Sep-2018 15:30:25 + if len(fr) <= 1: build 12-Sep-2018 15:30:25 + return 0 build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + vr = numpy.var(fr, ddof=1) build 12-Sep-2018 15:30:25 + vi = numpy.var(fi, ddof=1) build 12-Sep-2018 15:30:25 + return 2/(vr + vi) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +# per correlation build 12-Sep-2018 15:30:25 +def _variance2(dr, di, flag, corr, row): build 12-Sep-2018 15:30:25 + fr = numpy.extract(numpy.logical_not(flag[corr,:,row]), dr[corr,:,row]) build 12-Sep-2018 15:30:25 + fi = numpy.extract(numpy.logical_not(flag[corr,:,row]), di[corr,:,row]) build 12-Sep-2018 15:30:25 + if len(fr) <= 1: build 12-Sep-2018 15:30:25 + return 0 build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + vr = numpy.var(fr, ddof=1) build 12-Sep-2018 15:30:25 + vi = numpy.var(fi, ddof=1) build 12-Sep-2018 15:30:25 + return 2/(vr + vi) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -''' build 12-Sep-2018 15:30:25 -Unit tests for statwt build 12-Sep-2018 15:30:25 -''' build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 -# ToDo: build 12-Sep-2018 15:30:25 -# add more tests build 12-Sep-2018 15:30:25 -# once more independent tests (e.g. comparison build 12-Sep-2018 15:30:25 -# the AIPS REWAY results) add reference mses build 12-Sep-2018 15:30:25 -# and do tests against them build 12-Sep-2018 15:30:25 -# build 12-Sep-2018 15:30:25 class statwt_test(unittest.TestCase): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # Input and output names build 12-Sep-2018 15:30:25 - msfile = 'ngc5921.ms' build 12-Sep-2018 15:30:25 - res = False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp(self): build 12-Sep-2018 15:30:25 - if (os.path.exists(self.msfile)): build 12-Sep-2018 15:30:25 - os.system('rm -rf ' + self.msfile) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - datapath=os.environ.get('CASAPATH').split()[0]+'/data/regression/unittest/visstat/' build 12-Sep-2018 15:30:25 - shutil.copytree(datapath+self.msfile, self.msfile) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def tearDown(self): build 12-Sep-2018 15:30:25 - if (os.path.exists(self.msfile)): build 12-Sep-2018 15:30:25 - # os.system('rm -rf ' + self.msfile) build 12-Sep-2018 15:30:25 - pass build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def calcVariance(self,specData): build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - calculate variance of a single row of complex vis data build 12-Sep-2018 15:30:25 - input: specData - numpy masked array build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - dev2 = 0.0 build 12-Sep-2018 15:30:25 - validSpecData=specData[~specData.mask] build 12-Sep-2018 15:30:25 - dmean = validSpecData.mean() build 12-Sep-2018 15:30:25 - nchan=len(validSpecData) build 12-Sep-2018 15:30:25 - for n in xrange(nchan): build 12-Sep-2018 15:30:25 - dev = validSpecData[n] - dmean build 12-Sep-2018 15:30:25 - # combine real and imag build 12-Sep-2018 15:30:25 - dev2 += (dev.real*dev.real + dev.imag*dev.imag) build 12-Sep-2018 15:30:25 - # use 2*nchan here because we used real and imag build 12-Sep-2018 15:30:25 - var = (1./(2*nchan-1))*dev2 build 12-Sep-2018 15:30:25 - return var.real build 12-Sep-2018 15:30:25 + def test_algorithm(self): build 12-Sep-2018 15:30:25 + """ Test the algorithm, includes excludechans tests""" build 12-Sep-2018 15:30:25 + mytb = tbtool() build 12-Sep-2018 15:30:25 + mytb.open(src) build 12-Sep-2018 15:30:25 + expflag = mytb.getcol("FLAG") build 12-Sep-2018 15:30:25 + expfrow = mytb.getcol("FLAG_ROW") build 12-Sep-2018 15:30:25 + mytb.done() build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.ms" build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + for combine in ["", "corr"]: build 12-Sep-2018 15:30:25 + for excludechans in ["0:10~20", ""]: build 12-Sep-2018 15:30:25 + for i in [0,1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(combine=combine, excludechans=excludechans) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt(dst, combine=combine, excludechans=excludechans) build 12-Sep-2018 15:30:25 + [wt, wtsp, flag, frow, data] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 + actflag = flag.copy() build 12-Sep-2018 15:30:25 + if excludechans != "": build 12-Sep-2018 15:30:25 + actflag[:, 10:21, :] = True build 12-Sep-2018 15:30:25 + dr = numpy.real(data) build 12-Sep-2018 15:30:25 + di = numpy.imag(data) build 12-Sep-2018 15:30:25 + myshape = wtsp.shape build 12-Sep-2018 15:30:25 + ncorr = myshape[0] build 12-Sep-2018 15:30:25 + nrow = myshape[2] build 12-Sep-2018 15:30:25 + if (combine == "corr"): build 12-Sep-2018 15:30:25 + for row in range(nrow): build 12-Sep-2018 15:30:25 + expec = _variance(dr, di, actflag, row) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(wt[:, row], expec, rtol=rtol)), build 12-Sep-2018 15:30:25 + "WEIGHT fail at row" + str(row) + ". got: " + str(wt[:, row]) build 12-Sep-2018 15:30:25 + + " expec " + str(expec) build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + len(numpy.unique(wtsp[:,:,row])) == 1, build 12-Sep-2018 15:30:25 + "Weight values are not the same" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(wtsp[:,:,row], expec, rtol)), build 12-Sep-2018 15:30:25 + "Incorrect weights" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + if expec == 0: build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(flag[:,:,row]), "Not all flags are true") build 12-Sep-2018 15:30:25 + self.assertTrue(frow[row], "FLAG_ROW is not true") build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(flag[:,:,row] == expflag[:,:,row]), build 12-Sep-2018 15:30:25 + "FLAGs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + frow[row] == expfrow[row], "FLAG_ROW doesn't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + for row in range(nrow): build 12-Sep-2018 15:30:25 + for corr in range(ncorr): build 12-Sep-2018 15:30:25 + expec = _variance2(dr, di, actflag, corr, row) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.isclose(wt[corr, row], expec, rtol=rtol), build 12-Sep-2018 15:30:25 + "WEIGHT fail at row" + str(row) + ". got: " + str(wt[corr, row]) build 12-Sep-2018 15:30:25 + + " expec " + str(expec) build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + len(numpy.unique(wtsp[corr,:,row])) == 1, build 12-Sep-2018 15:30:25 + "Weight values are not the same" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all( build 12-Sep-2018 15:30:25 + numpy.isclose(wtsp[corr,:,row], expec, rtol)), "Incorrect weights" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + if expec == 0: build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(flag[corr,:,row]), "Not all flags are true") build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(flag[corr,:,row] == expflag[corr,:,row]), build 12-Sep-2018 15:30:25 + "FLAGs don't match at row " + str(row) + ".\n" build 12-Sep-2018 15:30:25 + "Expected: " + str(expflag[corr,:,row]) + "\n" build 12-Sep-2018 15:30:25 + "Got : " + str(flag[corr,:,row]) build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + if (numpy.all(flag[:,:,row])): build 12-Sep-2018 15:30:25 + self.assertTrue(frow[row], "FLAG_ROW is not true") build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + self.assertFalse(frow[row], "FLAG_ROW is not false") build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_timebin(self): build 12-Sep-2018 15:30:25 + """ Test time binning""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.timebin.ms" build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.timebin300s_2.ms.ref" build 12-Sep-2018 15:30:25 + [refwt, refwtsp, refflag, reffrow, refdata] = _get_dst_cols(ref) build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + combine = "corr" build 12-Sep-2018 15:30:25 + for timebin in ["300s", 10]: build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt(dst, timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 + [tstwt, tstwtsp, tstflag, tstfrow, tstdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(numpy.isclose(tstwt, refwt, rtol)), "WEIGHTs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), "WEIGHT_SPECTRUMs don't match") build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_chanbin(self): build 12-Sep-2018 15:30:25 + """Test channel binning""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.chanbin_0.ms" build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + for combine in ["", "corr"]: build 12-Sep-2018 15:30:25 + if combine == "": build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.chanbin_sepcorr_2.ms.ref" build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.chanbin_combcorr_2.ms.ref" build 12-Sep-2018 15:30:25 + [refwt, refwtsp, refflag, reffrow, refdata] = _get_dst_cols(ref) build 12-Sep-2018 15:30:25 + for i in [0, 1, 2]: build 12-Sep-2018 15:30:25 + for chanbin in ["195.312kHz", 8]: build 12-Sep-2018 15:30:25 + if i == 2 and (combine == "corr" or chanbin == 8): build 12-Sep-2018 15:30:25 + continue build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(chanbin=chanbin, combine=combine) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + elif i == 1: build 12-Sep-2018 15:30:25 + statwt(dst, chanbin=chanbin, combine=combine) build 12-Sep-2018 15:30:25 + elif i == 2: build 12-Sep-2018 15:30:25 + # check WEIGHT_SPECTRUM is created, only check once, build 12-Sep-2018 15:30:25 + # this test is long as it is build 12-Sep-2018 15:30:25 + # shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + mytb = tbtool() build 12-Sep-2018 15:30:25 + mytb.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + x = mytb.ncols() build 12-Sep-2018 15:30:25 + self.assertTrue(mytb.removecols("WEIGHT_SPECTRUM"), "column not removed") build 12-Sep-2018 15:30:25 + y = mytb.ncols() build 12-Sep-2018 15:30:25 + self.assertTrue(y == x-1, "wrong number of columns") build 12-Sep-2018 15:30:25 + mytb.done() build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(chanbin=chanbin, combine=combine) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + [tstwt, tstwtsp, tstflag, tstfrow, tstdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(numpy.isclose(tstwt, refwt, rtol)), "WEIGHTs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), "WEIGHT_SPECTRUMs don't match") build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_minsamp(self): build 12-Sep-2018 15:30:25 + """Test minimum number of points""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.minsamp.ms" build 12-Sep-2018 15:30:25 + combine = "corr" build 12-Sep-2018 15:30:25 + trow = 12 build 12-Sep-2018 15:30:25 + for i in [0,1]: build 12-Sep-2018 15:30:25 + for minsamp in [60, 80]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(minsamp=minsamp, combine=combine) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt(dst, minsamp=minsamp, combine=combine) build 12-Sep-2018 15:30:25 + [wt, wtsp, flag, frow, data] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 + if minsamp == 60: build 12-Sep-2018 15:30:25 + self.assertTrue((wt[:, trow] > 0).all(), "Incorrect weight row " + str(trow)) build 12-Sep-2018 15:30:25 + self.assertTrue((wtsp[:, :, trow] > 0).all(), "Incorrect weight spectrum row " + str(trow)) build 12-Sep-2018 15:30:25 + self.assertFalse(flag[:,:,trow].all(), "Incorrect flag row " + str(trow)) build 12-Sep-2018 15:30:25 + self.assertFalse(frow[trow], "Incorrect flagrow row " + str(trow)) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + self.assertTrue((wt[:, trow] == 0).all(), "Incorrect weight row " + str(trow)) build 12-Sep-2018 15:30:25 + self.assertTrue((wtsp[:, :, trow] == 0).all(), "Incorrect weight spectrum row " + str(trow)) build 12-Sep-2018 15:30:25 + self.assertTrue(flag[:,:,trow].all(), "Incorrect flag row " + str(trow)) build 12-Sep-2018 15:30:25 + self.assertTrue(frow[trow], "Incorrect flagrow row " + str(trow)) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_fieldsel(self): build 12-Sep-2018 15:30:25 + """Test field selection""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.fieldsel.ms" build 12-Sep-2018 15:30:25 + combine = "corr" build 12-Sep-2018 15:30:25 + [origwt, origwtsp, origflag, origfrow, origdata] = _get_dst_cols(src) build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + for field in ["2", "N5921_2"]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + statwt(dst, field=field, combine=combine) build 12-Sep-2018 15:30:25 + [wt, wtsp, flag, frow, data, field_id] = _get_dst_cols(dst, "FIELD_ID") build 12-Sep-2018 15:30:25 + nrow = len(frow) build 12-Sep-2018 15:30:25 + dr = numpy.real(data) build 12-Sep-2018 15:30:25 + di = numpy.imag(data) build 12-Sep-2018 15:30:25 + for row in range(nrow): build 12-Sep-2018 15:30:25 + if field_id[row] == 2: build 12-Sep-2018 15:30:25 + expec = _variance(dr, di, flag, row) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(wt[:, row], expec, rtol=rtol)), build 12-Sep-2018 15:30:25 + "WEIGHT fail at row" + str(row) + ". got: " build 12-Sep-2018 15:30:25 + + str(wt[:, row]) + " expec " + str(expec) build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(wtsp[:,:,row], expec, rtol)), build 12-Sep-2018 15:30:25 + "Incorrect weight spectrum" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(wt[:, row], origwt[:, row], rtol=rtol)), build 12-Sep-2018 15:30:25 + "WEIGHT fail at row" + str(row) + ". got: " + str(wt[:, row]) build 12-Sep-2018 15:30:25 + + " expec " + str(origwt[:, row]) build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(wtsp[:,:,row], origwtsp[:,:,row], rtol)), build 12-Sep-2018 15:30:25 + "Incorrect weight spectrum" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_spwsel(self): build 12-Sep-2018 15:30:25 + """Test spw selection""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.spwsel.ms" build 12-Sep-2018 15:30:25 + combine = "corr" build 12-Sep-2018 15:30:25 + [origwt, origwtsp, origflag, origfrow, origdata] = _get_dst_cols(src) build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + spw="0" build 12-Sep-2018 15:30:25 + # data set only has one spw build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + statwt(dst, spw=spw, combine=combine) build 12-Sep-2018 15:30:25 + [wt, wtsp, flag, frow, data] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 + nrow = len(frow) build 12-Sep-2018 15:30:25 + dr = numpy.real(data) build 12-Sep-2018 15:30:25 + di = numpy.imag(data) build 12-Sep-2018 15:30:25 + for row in range(nrow): build 12-Sep-2018 15:30:25 + expec = _variance(dr, di, flag, row) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(wt[:, row], expec, rtol=rtol)), build 12-Sep-2018 15:30:25 + "WEIGHT fail at row" + str(row) + ". got: " build 12-Sep-2018 15:30:25 + + str(wt[:, row]) + " expec " + str(expec) build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(wtsp[:,:,row], expec, rtol)), build 12-Sep-2018 15:30:25 + "Incorrect weight spectrum" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - def calcwt(self,selrow,selcorr,datcol,flagcol): build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - calc weight,sigma from the data build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - dsel = datcol[selcorr] build 12-Sep-2018 15:30:25 - fsel = flagcol[selcorr] build 12-Sep-2018 15:30:25 - dsel = dsel.transpose() build 12-Sep-2018 15:30:25 - fsel = fsel.transpose() build 12-Sep-2018 15:30:25 - dspec = dsel[selrow] build 12-Sep-2018 15:30:25 - flagc = fsel[selrow] build 12-Sep-2018 15:30:25 - mdspec = ma.masked_array(dspec,flagc) build 12-Sep-2018 15:30:25 - dmean = mdspec.mean() build 12-Sep-2018 15:30:25 - var = self.calcVariance(mdspec) build 12-Sep-2018 15:30:25 - sig = numpy.sqrt(var) build 12-Sep-2018 15:30:25 - rms = numpy.sqrt(dmean*dmean.conjugate()+var) build 12-Sep-2018 15:30:25 - return (var,sig,rms) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_default(self): build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - test default case build 12-Sep-2018 15:30:25 - """ build 12-Sep-2018 15:30:25 - tol = 1.e-5 build 12-Sep-2018 15:30:25 - self.res=statwt(vis=self.msfile) build 12-Sep-2018 15:30:25 - # need to have better checking.... build 12-Sep-2018 15:30:25 - self.assertTrue(self.res) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - tb.open(self.msfile) build 12-Sep-2018 15:30:25 - datc=tb.getcol('DATA') build 12-Sep-2018 15:30:25 - wt = tb.getcol('WEIGHT') build 12-Sep-2018 15:30:25 - sg = tb.getcol('SIGMA') build 12-Sep-2018 15:30:25 - fg = tb.getcol('FLAG') build 12-Sep-2018 15:30:25 - nr = tb.nrows() build 12-Sep-2018 15:30:25 - tb.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Compare 10 randomly selected rows of weight and build 12-Sep-2018 15:30:25 - # sigma columns with calculated statistics from the data build 12-Sep-2018 15:30:25 - #random.seed() build 12-Sep-2018 15:30:25 - #randomRowList=random.sample(xrange(nr),10) build 12-Sep-2018 15:30:25 - #for i in random.sample(xrange(nr),10): build 12-Sep-2018 15:30:25 - # icorr = random.randint(0,1) build 12-Sep-2018 15:30:25 + def test_default_boundaries(self): build 12-Sep-2018 15:30:25 + """Test default scan, field, etc boundaries""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.normalbounds.ms" build 12-Sep-2018 15:30:25 + timebin = "6000s" build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.normal_bounds_2.ms.ref" build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + [expwt, expwtsp, expflag, expfrow, expdata] = _get_dst_cols(ref) build 12-Sep-2018 15:30:25 + # there are three field_ids, and there is a change in field_id when build 12-Sep-2018 15:30:25 + # there is a change in scan number, so specifying combine="field" in the build 12-Sep-2018 15:30:25 + # absence of "scan" will give the same result as combine="" build 12-Sep-2018 15:30:25 + for combine in ["corr", "corr,field"]: build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt(dst, timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 + [gotwt, gotwtsp, gotflag, gotfrow, gotdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(numpy.isclose(gotwt, expwt, rtol))) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(numpy.isclose(gotwtsp, expwtsp, rtol))) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(gotflag == expflag)) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(gotfrow == expfrow)) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - # do it for all rows! build 12-Sep-2018 15:30:25 - for i in xrange(nr): build 12-Sep-2018 15:30:25 - icorr = 0 build 12-Sep-2018 15:30:25 - (v,s,r) = self.calcwt(i,icorr,datc,fg) build 12-Sep-2018 15:30:25 - if v!=0: build 12-Sep-2018 15:30:25 - diffwt = 1/v - wt[icorr][i] build 12-Sep-2018 15:30:25 - diffsg = s - sg[icorr][i] build 12-Sep-2018 15:30:25 - #print "w=",1/v, " wt[",icorr,"][",i,"]=",wt[icorr][i] build 12-Sep-2018 15:30:25 - #print "diffwt=",diffwt," diffwt/w=",abs(diffwt)*1/v build 12-Sep-2018 15:30:25 - self.assertTrue(abs(diffwt)/(1/v) < tol) build 12-Sep-2018 15:30:25 - self.assertTrue(abs(diffsg)/s < tol) build 12-Sep-2018 15:30:25 + def test_no_scan_boundaries(self): build 12-Sep-2018 15:30:25 + """Test no scan boundaries""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.no_scan_bounds.ms" build 12-Sep-2018 15:30:25 + timebin = "6000s" build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.no_scan_bounds_2.ms.ref" build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + [expwt, expwtsp, expflag, expfrow, expdata] = _get_dst_cols(ref) build 12-Sep-2018 15:30:25 + combine = "corr, scan" build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt(dst, timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 + [gotwt, gotwtsp, gotflag, gotfrow, gotdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(numpy.isclose(gotwt, expwt, rtol))) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(numpy.isclose(gotwtsp, expwtsp, rtol))) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(gotflag == expflag)) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(gotfrow == expfrow)) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_no_scan_nor_field_boundaries(self): build 12-Sep-2018 15:30:25 + """Test no scan nor field boundaries""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.no_scan_nor_field_bounds.ms" build 12-Sep-2018 15:30:25 + timebin = "6000s" build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.no_scan_nor_field_bounds_2.ms.ref" build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + [expwt, expwtsp, expflag, expfrow, expdata] = _get_dst_cols(ref) build 12-Sep-2018 15:30:25 + for combine in ["corr,scan,field", "corr,field,scan"]: build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt(dst, timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 + [gotwt, gotwtsp, gotflag, gotfrow, gotdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(numpy.isclose(gotwt, expwt, rtol))) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(numpy.isclose(gotwtsp, expwtsp, rtol))) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(gotflag == expflag)) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(gotfrow == expfrow)) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_statalg(self): build 12-Sep-2018 15:30:25 + """Test statalg""" build 12-Sep-2018 15:30:25 + # just testing inputs build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.statalg.ms" build 12-Sep-2018 15:30:25 + for statalg in ["cl", "ch", "h", "f", "bogus"]: build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + if statalg == "cl": build 12-Sep-2018 15:30:25 + self.assertTrue(myms.statwt(statalg=statalg)) build 12-Sep-2018 15:30:25 + elif statalg == "ch": build 12-Sep-2018 15:30:25 + self.assertTrue(myms.statwt(statalg=statalg, zscore=5, maxiter=3)) build 12-Sep-2018 15:30:25 + elif statalg == "h": build 12-Sep-2018 15:30:25 + self.assertTrue(myms.statwt(statalg=statalg, fence=0.2)) build 12-Sep-2018 15:30:25 + elif statalg == "f": build 12-Sep-2018 15:30:25 + self.assertTrue(myms.statwt(statalg=statalg, center="median", lside=False)) build 12-Sep-2018 15:30:25 + elif statalg == "bogus": build 12-Sep-2018 15:30:25 + self.assertRaises(Exception, myms.statwt, statalg=statalg) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + if statalg == "cl": build 12-Sep-2018 15:30:25 + statwt(vis=dst, statalg=statalg) build 12-Sep-2018 15:30:25 + elif statalg == "ch": build 12-Sep-2018 15:30:25 + self.assertTrue(statwt(vis=dst, statalg=statalg, zscore=5, maxiter=3)) build 12-Sep-2018 15:30:25 + elif statalg == "h": build 12-Sep-2018 15:30:25 + self.assertTrue(statwt(vis=dst, statalg=statalg, fence=0.2)) build 12-Sep-2018 15:30:25 + elif statalg == "f": build 12-Sep-2018 15:30:25 + self.assertTrue(statwt(vis=dst, statalg=statalg, center="median", lside=False)) build 12-Sep-2018 15:30:25 + elif statalg == "bogus": build 12-Sep-2018 15:30:25 + self.assertFalse(statwt(vis=dst, statalg=statalg)) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_wtrange(self): build 12-Sep-2018 15:30:25 + """ Test weight range""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.timebin.ms" build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.timebin300s_2.ms.ref" build 12-Sep-2018 15:30:25 + [refwt, refwtsp, refflag, reffrow, refdata] = _get_dst_cols(ref) build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + combine = "corr" build 12-Sep-2018 15:30:25 + timebin = "300s" build 12-Sep-2018 15:30:25 + wtrange = [1, 2] build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(timebin=timebin, combine=combine, wtrange=wtrange) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt(dst, timebin=timebin, combine=combine, wtrange=wtrange) build 12-Sep-2018 15:30:25 + [tstwt, tstwtsp, tstflag, tstfrow, tstdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all( build 12-Sep-2018 15:30:25 + tstflag == numpy.logical_or( build 12-Sep-2018 15:30:25 + refflag, numpy.logical_not( build 12-Sep-2018 15:30:25 + numpy.logical_and(tstwtsp >= 1, tstwtsp <= 2) build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + ), build 12-Sep-2018 15:30:25 + "FLAGs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.all(tstflag, axis=(0,1)) == tstfrow), build 12-Sep-2018 15:30:25 + "FLAG_ROWs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + nrows = tstwtsp.shape[2] build 12-Sep-2018 15:30:25 + for row in range(nrows): build 12-Sep-2018 15:30:25 + rowwtsp = tstwtsp[:,:,row][numpy.logical_not(tstflag[:,:,row])] build 12-Sep-2018 15:30:25 + if (len(rowwtsp) == 0): build 12-Sep-2018 15:30:25 + expec = 0 build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + expec = rowwtsp[0] build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwt[:, row], expec, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHTs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_preview(self): build 12-Sep-2018 15:30:25 + """ Test preview mode""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.preview.ms" build 12-Sep-2018 15:30:25 + [refwt, refwtsp, refflag, reffrow, refdata] = _get_dst_cols(src) build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + combine = "corr" build 12-Sep-2018 15:30:25 + timebin = "300s" build 12-Sep-2018 15:30:25 + wtrange = [1, 2] build 12-Sep-2018 15:30:25 + preview = True build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt( build 12-Sep-2018 15:30:25 + timebin=timebin, combine=combine, wtrange=wtrange, preview=preview build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt( build 12-Sep-2018 15:30:25 + dst, timebin=timebin, combine=combine, wtrange=wtrange, preview=preview build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + [tstwt, tstwtsp, tstflag, tstfrow, tstdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwt, refwt, rtol)), "WEIGHTs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_data(self): build 12-Sep-2018 15:30:25 + """ Test using data column""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.data.ms" build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.data_col.ms.ref" build 12-Sep-2018 15:30:25 + [refwt, refwtsp, refflag, reffrow, refsig, refsigsp] = _get_dst_cols( build 12-Sep-2018 15:30:25 + ref, ["SIGMA", "SIGMA_SPECTRUM"], dodata=False build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + combine = "corr" build 12-Sep-2018 15:30:25 + timebin = 10 build 12-Sep-2018 15:30:25 + data = "data" build 12-Sep-2018 15:30:25 + mytb = tbtool() build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + self.assertTrue(mytb.open(dst, nomodify=False)) build 12-Sep-2018 15:30:25 + self.assertTrue(mytb.removecols("DATA")) build 12-Sep-2018 15:30:25 + self.assertTrue(mytb.renamecol("CORRECTED_DATA", "DATA")) build 12-Sep-2018 15:30:25 + mytb.done() build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(timebin=timebin, combine=combine, datacolumn=data) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt(dst, timebin=timebin, combine=combine, datacolumn=data) build 12-Sep-2018 15:30:25 + [tstwt, tstwtsp, tstflag, tstfrow, tstsig, tstsigsp] = _get_dst_cols( build 12-Sep-2018 15:30:25 + dst, ["SIGMA", "SIGMA_SPECTRUM"], False build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwt, refwt, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHTs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstsig, refsig)), build 12-Sep-2018 15:30:25 + "SIGMA is incorrect" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstsigsp, refsigsp)), build 12-Sep-2018 15:30:25 + "SIGMA_SPECTRUM is incorrect" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_slding_time_window(self): build 12-Sep-2018 15:30:25 + """ Test sliding time window""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.sliding_time_window.ms" build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.slidingtimebin300s_2.ms.ref" build 12-Sep-2018 15:30:25 + [refwt, refwtsp, refflag, reffrow] = _get_dst_cols(ref, "", dodata=False) build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + timebin = "300s" build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(timebin=timebin, slidetimebin=True) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt(dst, timebin=timebin, slidetimebin=True) build 12-Sep-2018 15:30:25 + [tstwt, tstwtsp, tstflag, tstfrow] = _get_dst_cols(dst, "", False) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwt, refwt, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHTs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_residual(self): build 12-Sep-2018 15:30:25 + """ Test using corrected_data - model_data column""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.residualwmodel.ms" build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.resid_with_model.ms.ref" build 12-Sep-2018 15:30:25 + [refwt, refwtsp, refflag, reffrow] = _get_dst_cols(ref, "", dodata=False) build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + data = "residual" build 12-Sep-2018 15:30:25 + mytb = tbtool() build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(datacolumn=data) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt(dst, datacolumn=data) build 12-Sep-2018 15:30:25 + [tstwt, tstwtsp, tstflag, tstfrow] = _get_dst_cols(dst, "", False) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwt, refwt, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHTs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_residual_no_model(self): build 12-Sep-2018 15:30:25 + """ Test using corrected_data - model_data column""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.residualwoutmodel.ms" build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.resid_without_model.ms.ref" build 12-Sep-2018 15:30:25 + [refwt, refwtsp, refflag, reffrow] = _get_dst_cols(ref, "", dodata=False) build 12-Sep-2018 15:30:25 + rtol = 1e-6 build 12-Sep-2018 15:30:25 + data = "residual" build 12-Sep-2018 15:30:25 + mytb = tbtool() build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + self.assertTrue(mytb.open(dst, nomodify=False)) build 12-Sep-2018 15:30:25 + self.assertTrue(mytb.removecols("MODEL_DATA")) build 12-Sep-2018 15:30:25 + mytb.done() build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(datacolumn=data) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt(dst, datacolumn=data) build 12-Sep-2018 15:30:25 + [tstwt, tstwtsp, tstflag, tstfrow] = _get_dst_cols(dst, "", False) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwt, refwt, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHTs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_residual_data(self): build 12-Sep-2018 15:30:25 + """ Test using _data - model_data column""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.residualdatawmodel.ms" build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.residdata_with_model_2.ms.ref" build 12-Sep-2018 15:30:25 + [refwt, refwtsp, refflag, reffrow, refsig, refsigsp] = _get_dst_cols( build 12-Sep-2018 15:30:25 + ref, ["SIGMA", "SIGMA_SPECTRUM"], dodata=False build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + data = "residual_data" build 12-Sep-2018 15:30:25 + mytb = tbtool() build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(datacolumn=data) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt(dst, datacolumn=data) build 12-Sep-2018 15:30:25 + [tstwt, tstwtsp, tstflag, tstfrow, tstsig, tstsigsp] = _get_dst_cols( build 12-Sep-2018 15:30:25 + dst, ["SIGMA", "SIGMA_SPECTRUM"], False build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwt, refwt, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHTs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstsig, refsig, rtol)), build 12-Sep-2018 15:30:25 + "SIGMAs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstsigsp, refsigsp, rtol)), build 12-Sep-2018 15:30:25 + "SIGMA_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_residual_data_no_model(self): build 12-Sep-2018 15:30:25 + """ Test using data - default model """ build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.residualdatawoutmodel.ms" build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.residdata_without_model_2.ms.ref" build 12-Sep-2018 15:30:25 + [refwt, refwtsp, refflag, reffrow, refsig, refsigsp] = _get_dst_cols( build 12-Sep-2018 15:30:25 + ref, ["SIGMA", "SIGMA_SPECTRUM"], dodata=False build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + data = "residual_data" build 12-Sep-2018 15:30:25 + mytb = tbtool() build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + self.assertTrue(mytb.open(dst, nomodify=False)) build 12-Sep-2018 15:30:25 + self.assertTrue(mytb.removecols("MODEL_DATA")) build 12-Sep-2018 15:30:25 + mytb.done() build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + myms.statwt(datacolumn=data) build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + statwt(dst, datacolumn=data) build 12-Sep-2018 15:30:25 + [tstwt, tstwtsp, tstflag, tstfrow, tstsigma, tstsigsp] = _get_dst_cols( build 12-Sep-2018 15:30:25 + dst, ["SIGMA", "SIGMA_SPECTRUM"], False build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 + refsigma = 1/numpy.sqrt(refwt); build 12-Sep-2018 15:30:25 + numpy.place(refsigma, refwt == 0, -1) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwt, refwt, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHTs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 + "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstsigma, refsig, rtol)), build 12-Sep-2018 15:30:25 + "SIGMAs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.all(numpy.isclose(tstsigsp, refsigsp, rtol)), build 12-Sep-2018 15:30:25 + "SIGMA_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_returned_stats(self): build 12-Sep-2018 15:30:25 + """ Test returned stats, CAS-10881""" build 12-Sep-2018 15:30:25 + dst = "ngc5921.split.statstest.ms" build 12-Sep-2018 15:30:25 + ref = datadir + "ngc5921.residdata_without_model_2.ms.ref" build 12-Sep-2018 15:30:25 + rtol = 1e-7 build 12-Sep-2018 15:30:25 + myms = mstool() build 12-Sep-2018 15:30:25 + for i in [0, 1]: build 12-Sep-2018 15:30:25 + shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 + if i == 0: build 12-Sep-2018 15:30:25 + myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 + res = myms.statwt() build 12-Sep-2018 15:30:25 + myms.done() build 12-Sep-2018 15:30:25 + else: build 12-Sep-2018 15:30:25 + res = statwt(dst) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.isclose(res['mean'], 3.6326332, rtol), build 12-Sep-2018 15:30:25 + "mean is incorrect" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + self.assertTrue( build 12-Sep-2018 15:30:25 + numpy.isclose(res['variance'], 6.6448922, rtol), build 12-Sep-2018 15:30:25 + "variance is incorrect" build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + shutil.rmtree(dst) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def suite(): build 12-Sep-2018 15:30:25 return [statwt_test] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -if __name__ == '__main__': build 12-Sep-2018 15:30:25 - testSuite = [] build 12-Sep-2018 15:30:25 - for testClass in suite(): build 12-Sep-2018 15:30:25 - testSuite.append(unittest.makeSuite(testClass,'test')) build 12-Sep-2018 15:30:25 - allTests = unittest.TestSuite(testSuite) build 12-Sep-2018 15:30:25 - unittest.TextTestRunner(verbosity=2).run(allTests) build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_statwt2.py b/gcwrap/python/scripts/tests/test_statwt2.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 545c428..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_statwt2.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,726 +0,0 @@ build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -import sys build 12-Sep-2018 15:30:25 -import shutil build 12-Sep-2018 15:30:25 -from __main__ import default build 12-Sep-2018 15:30:25 -from tasks import * build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 -import unittest build 12-Sep-2018 15:30:25 -import math build 12-Sep-2018 15:30:25 -import numpy build 12-Sep-2018 15:30:25 -import numbers build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -datadir = os.environ.get('CASAPATH').split()[0] + '/data/regression/unittest/statwt/' build 12-Sep-2018 15:30:25 -src = datadir + 'ngc5921.split_2.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def _get_dst_cols(dst, other="", dodata=True): build 12-Sep-2018 15:30:25 - mytb = tbtool() build 12-Sep-2018 15:30:25 - mytb.open(dst) build 12-Sep-2018 15:30:25 - wt = mytb.getcol("WEIGHT") build 12-Sep-2018 15:30:25 - wtsp = mytb.getcol("WEIGHT_SPECTRUM") build 12-Sep-2018 15:30:25 - flag = mytb.getcol("FLAG") build 12-Sep-2018 15:30:25 - frow = mytb.getcol("FLAG_ROW") build 12-Sep-2018 15:30:25 - if dodata: build 12-Sep-2018 15:30:25 - data = mytb.getcol("CORRECTED_DATA") build 12-Sep-2018 15:30:25 - if len(other) > 0: build 12-Sep-2018 15:30:25 - othercol = mytb.getcol(other) build 12-Sep-2018 15:30:25 - mytb.close() build 12-Sep-2018 15:30:25 - cols = [wt, wtsp, flag, frow] build 12-Sep-2018 15:30:25 - if dodata: build 12-Sep-2018 15:30:25 - cols.append(data) build 12-Sep-2018 15:30:25 - if len(other) > 0: build 12-Sep-2018 15:30:25 - cols.append(othercol) build 12-Sep-2018 15:30:25 - return cols build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def _get_table_cols(mytb): build 12-Sep-2018 15:30:25 - times = mytb.getcol("TIME") build 12-Sep-2018 15:30:25 - wt = mytb.getcol("WEIGHT") build 12-Sep-2018 15:30:25 - wtsp = mytb.getcol("WEIGHT_SPECTRUM") build 12-Sep-2018 15:30:25 - flag = mytb.getcol("FLAG") build 12-Sep-2018 15:30:25 - frow = mytb.getcol("FLAG_ROW") build 12-Sep-2018 15:30:25 - data = mytb.getcol("CORRECTED_DATA") build 12-Sep-2018 15:30:25 - return [times, wt, wtsp, flag, frow, data] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# combine correlations build 12-Sep-2018 15:30:25 -def _variance(dr, di, flag, row): build 12-Sep-2018 15:30:25 - fr = numpy.extract(numpy.logical_not(flag[:,:,row]), dr[:,:,row]) build 12-Sep-2018 15:30:25 - fi = numpy.extract(numpy.logical_not(flag[:,:,row]), di[:,:,row]) build 12-Sep-2018 15:30:25 - if len(fr) <= 1: build 12-Sep-2018 15:30:25 - return 0 build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - vr = numpy.var(fr, ddof=1) build 12-Sep-2018 15:30:25 - vi = numpy.var(fi, ddof=1) build 12-Sep-2018 15:30:25 - return 2/(vr + vi) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# per correlation build 12-Sep-2018 15:30:25 -def _variance2(dr, di, flag, corr, row): build 12-Sep-2018 15:30:25 - fr = numpy.extract(numpy.logical_not(flag[corr,:,row]), dr[corr,:,row]) build 12-Sep-2018 15:30:25 - fi = numpy.extract(numpy.logical_not(flag[corr,:,row]), di[corr,:,row]) build 12-Sep-2018 15:30:25 - if len(fr) <= 1: build 12-Sep-2018 15:30:25 - return 0 build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - vr = numpy.var(fr, ddof=1) build 12-Sep-2018 15:30:25 - vi = numpy.var(fi, ddof=1) build 12-Sep-2018 15:30:25 - return 2/(vr + vi) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -class statwt2_test(unittest.TestCase): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_algorithm(self): build 12-Sep-2018 15:30:25 - """ Test the algorithm, includes excludechans tests""" build 12-Sep-2018 15:30:25 - mytb = tbtool() build 12-Sep-2018 15:30:25 - mytb.open(src) build 12-Sep-2018 15:30:25 - expflag = mytb.getcol("FLAG") build 12-Sep-2018 15:30:25 - expfrow = mytb.getcol("FLAG_ROW") build 12-Sep-2018 15:30:25 - mytb.done() build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.ms" build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - for combine in ["", "corr"]: build 12-Sep-2018 15:30:25 - for excludechans in ["0:10~20", ""]: build 12-Sep-2018 15:30:25 - for i in [0,1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(combine=combine, excludechans=excludechans) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2(dst, combine=combine, excludechans=excludechans) build 12-Sep-2018 15:30:25 - [wt, wtsp, flag, frow, data] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 - actflag = flag.copy() build 12-Sep-2018 15:30:25 - if excludechans != "": build 12-Sep-2018 15:30:25 - actflag[:, 10:21, :] = True build 12-Sep-2018 15:30:25 - dr = numpy.real(data) build 12-Sep-2018 15:30:25 - di = numpy.imag(data) build 12-Sep-2018 15:30:25 - myshape = wtsp.shape build 12-Sep-2018 15:30:25 - ncorr = myshape[0] build 12-Sep-2018 15:30:25 - nrow = myshape[2] build 12-Sep-2018 15:30:25 - if (combine == "corr"): build 12-Sep-2018 15:30:25 - for row in range(nrow): build 12-Sep-2018 15:30:25 - expec = _variance(dr, di, actflag, row) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(wt[:, row], expec, rtol=rtol)), build 12-Sep-2018 15:30:25 - "WEIGHT fail at row" + str(row) + ". got: " + str(wt[:, row]) build 12-Sep-2018 15:30:25 - + " expec " + str(expec) build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - len(numpy.unique(wtsp[:,:,row])) == 1, build 12-Sep-2018 15:30:25 - "Weight values are not the same" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(wtsp[:,:,row], expec, rtol)), build 12-Sep-2018 15:30:25 - "Incorrect weights" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - if expec == 0: build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(flag[:,:,row]), "Not all flags are true") build 12-Sep-2018 15:30:25 - self.assertTrue(frow[row], "FLAG_ROW is not true") build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(flag[:,:,row] == expflag[:,:,row]), build 12-Sep-2018 15:30:25 - "FLAGs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - frow[row] == expfrow[row], "FLAG_ROW doesn't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - for row in range(nrow): build 12-Sep-2018 15:30:25 - for corr in range(ncorr): build 12-Sep-2018 15:30:25 - expec = _variance2(dr, di, actflag, corr, row) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.isclose(wt[corr, row], expec, rtol=rtol), build 12-Sep-2018 15:30:25 - "WEIGHT fail at row" + str(row) + ". got: " + str(wt[corr, row]) build 12-Sep-2018 15:30:25 - + " expec " + str(expec) build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - len(numpy.unique(wtsp[corr,:,row])) == 1, build 12-Sep-2018 15:30:25 - "Weight values are not the same" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all( build 12-Sep-2018 15:30:25 - numpy.isclose(wtsp[corr,:,row], expec, rtol)), "Incorrect weights" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - if expec == 0: build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(flag[corr,:,row]), "Not all flags are true") build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(flag[corr,:,row] == expflag[corr,:,row]), build 12-Sep-2018 15:30:25 - "FLAGs don't match at row " + str(row) + ".\n" build 12-Sep-2018 15:30:25 - "Expected: " + str(expflag[corr,:,row]) + "\n" build 12-Sep-2018 15:30:25 - "Got : " + str(flag[corr,:,row]) build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - if (numpy.all(flag[:,:,row])): build 12-Sep-2018 15:30:25 - self.assertTrue(frow[row], "FLAG_ROW is not true") build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - self.assertFalse(frow[row], "FLAG_ROW is not false") build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_timebin(self): build 12-Sep-2018 15:30:25 - """ Test time binning""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.timebin.ms" build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.timebin300s_2.ms.ref" build 12-Sep-2018 15:30:25 - [refwt, refwtsp, refflag, reffrow, refdata] = _get_dst_cols(ref) build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - combine = "corr" build 12-Sep-2018 15:30:25 - for timebin in ["300s", 10]: build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2(dst, timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 - [tstwt, tstwtsp, tstflag, tstfrow, tstdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(numpy.isclose(tstwt, refwt, rtol)), "WEIGHTs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), "WEIGHT_SPECTRUMs don't match") build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_chanbin(self): build 12-Sep-2018 15:30:25 - """Test channel binning""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.chanbin_0.ms" build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - for combine in ["", "corr"]: build 12-Sep-2018 15:30:25 - if combine == "": build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.chanbin_sepcorr_2.ms.ref" build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.chanbin_combcorr_2.ms.ref" build 12-Sep-2018 15:30:25 - [refwt, refwtsp, refflag, reffrow, refdata] = _get_dst_cols(ref) build 12-Sep-2018 15:30:25 - for i in [0, 1, 2]: build 12-Sep-2018 15:30:25 - for chanbin in ["195.312kHz", 8]: build 12-Sep-2018 15:30:25 - if i == 2 and (combine == "corr" or chanbin == 8): build 12-Sep-2018 15:30:25 - continue build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(chanbin=chanbin, combine=combine) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - elif i == 1: build 12-Sep-2018 15:30:25 - statwt2(dst, chanbin=chanbin, combine=combine) build 12-Sep-2018 15:30:25 - elif i == 2: build 12-Sep-2018 15:30:25 - # check WEIGHT_SPECTRUM is created, only check once, build 12-Sep-2018 15:30:25 - # this test is long as it is build 12-Sep-2018 15:30:25 - # shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - mytb = tbtool() build 12-Sep-2018 15:30:25 - mytb.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - x = mytb.ncols() build 12-Sep-2018 15:30:25 - self.assertTrue(mytb.removecols("WEIGHT_SPECTRUM"), "column not removed") build 12-Sep-2018 15:30:25 - y = mytb.ncols() build 12-Sep-2018 15:30:25 - self.assertTrue(y == x-1, "wrong number of columns") build 12-Sep-2018 15:30:25 - mytb.done() build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(chanbin=chanbin, combine=combine) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - [tstwt, tstwtsp, tstflag, tstfrow, tstdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(numpy.isclose(tstwt, refwt, rtol)), "WEIGHTs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), "WEIGHT_SPECTRUMs don't match") build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_minsamp(self): build 12-Sep-2018 15:30:25 - """Test minimum number of points""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.minsamp.ms" build 12-Sep-2018 15:30:25 - combine = "corr" build 12-Sep-2018 15:30:25 - trow = 12 build 12-Sep-2018 15:30:25 - for i in [0,1]: build 12-Sep-2018 15:30:25 - for minsamp in [60, 80]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(minsamp=minsamp, combine=combine) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2(dst, minsamp=minsamp, combine=combine) build 12-Sep-2018 15:30:25 - [wt, wtsp, flag, frow, data] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 - if minsamp == 60: build 12-Sep-2018 15:30:25 - self.assertTrue((wt[:, trow] > 0).all(), "Incorrect weight row " + str(trow)) build 12-Sep-2018 15:30:25 - self.assertTrue((wtsp[:, :, trow] > 0).all(), "Incorrect weight spectrum row " + str(trow)) build 12-Sep-2018 15:30:25 - self.assertFalse(flag[:,:,trow].all(), "Incorrect flag row " + str(trow)) build 12-Sep-2018 15:30:25 - self.assertFalse(frow[trow], "Incorrect flagrow row " + str(trow)) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - self.assertTrue((wt[:, trow] == 0).all(), "Incorrect weight row " + str(trow)) build 12-Sep-2018 15:30:25 - self.assertTrue((wtsp[:, :, trow] == 0).all(), "Incorrect weight spectrum row " + str(trow)) build 12-Sep-2018 15:30:25 - self.assertTrue(flag[:,:,trow].all(), "Incorrect flag row " + str(trow)) build 12-Sep-2018 15:30:25 - self.assertTrue(frow[trow], "Incorrect flagrow row " + str(trow)) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_fieldsel(self): build 12-Sep-2018 15:30:25 - """Test field selection""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.fieldsel.ms" build 12-Sep-2018 15:30:25 - combine = "corr" build 12-Sep-2018 15:30:25 - [origwt, origwtsp, origflag, origfrow, origdata] = _get_dst_cols(src) build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - for field in ["2", "N5921_2"]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - statwt2(dst, field=field, combine=combine) build 12-Sep-2018 15:30:25 - [wt, wtsp, flag, frow, data, field_id] = _get_dst_cols(dst, "FIELD_ID") build 12-Sep-2018 15:30:25 - nrow = len(frow) build 12-Sep-2018 15:30:25 - dr = numpy.real(data) build 12-Sep-2018 15:30:25 - di = numpy.imag(data) build 12-Sep-2018 15:30:25 - for row in range(nrow): build 12-Sep-2018 15:30:25 - if field_id[row] == 2: build 12-Sep-2018 15:30:25 - expec = _variance(dr, di, flag, row) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(wt[:, row], expec, rtol=rtol)), build 12-Sep-2018 15:30:25 - "WEIGHT fail at row" + str(row) + ". got: " build 12-Sep-2018 15:30:25 - + str(wt[:, row]) + " expec " + str(expec) build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(wtsp[:,:,row], expec, rtol)), build 12-Sep-2018 15:30:25 - "Incorrect weight spectrum" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(wt[:, row], origwt[:, row], rtol=rtol)), build 12-Sep-2018 15:30:25 - "WEIGHT fail at row" + str(row) + ". got: " + str(wt[:, row]) build 12-Sep-2018 15:30:25 - + " expec " + str(origwt[:, row]) build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(wtsp[:,:,row], origwtsp[:,:,row], rtol)), build 12-Sep-2018 15:30:25 - "Incorrect weight spectrum" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_spwsel(self): build 12-Sep-2018 15:30:25 - """Test spw selection""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.spwsel.ms" build 12-Sep-2018 15:30:25 - combine = "corr" build 12-Sep-2018 15:30:25 - [origwt, origwtsp, origflag, origfrow, origdata] = _get_dst_cols(src) build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - spw="0" build 12-Sep-2018 15:30:25 - # data set only has one spw build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - statwt2(dst, spw=spw, combine=combine) build 12-Sep-2018 15:30:25 - [wt, wtsp, flag, frow, data] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 - nrow = len(frow) build 12-Sep-2018 15:30:25 - dr = numpy.real(data) build 12-Sep-2018 15:30:25 - di = numpy.imag(data) build 12-Sep-2018 15:30:25 - for row in range(nrow): build 12-Sep-2018 15:30:25 - expec = _variance(dr, di, flag, row) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(wt[:, row], expec, rtol=rtol)), build 12-Sep-2018 15:30:25 - "WEIGHT fail at row" + str(row) + ". got: " build 12-Sep-2018 15:30:25 - + str(wt[:, row]) + " expec " + str(expec) build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(wtsp[:,:,row], expec, rtol)), build 12-Sep-2018 15:30:25 - "Incorrect weight spectrum" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_default_boundaries(self): build 12-Sep-2018 15:30:25 - """Test default scan, field, etc boundaries""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.normalbounds.ms" build 12-Sep-2018 15:30:25 - timebin = "6000s" build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.normal_bounds_2.ms.ref" build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - [expwt, expwtsp, expflag, expfrow, expdata] = _get_dst_cols(ref) build 12-Sep-2018 15:30:25 - # there are three field_ids, and there is a change in field_id when build 12-Sep-2018 15:30:25 - # there is a change in scan number, so specifying combine="field" in the build 12-Sep-2018 15:30:25 - # absence of "scan" will give the same result as combine="" build 12-Sep-2018 15:30:25 - for combine in ["corr", "corr,field"]: build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2(dst, timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 - [gotwt, gotwtsp, gotflag, gotfrow, gotdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(numpy.isclose(gotwt, expwt, rtol))) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(numpy.isclose(gotwtsp, expwtsp, rtol))) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(gotflag == expflag)) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(gotfrow == expfrow)) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_no_scan_boundaries(self): build 12-Sep-2018 15:30:25 - """Test no scan boundaries""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.no_scan_bounds.ms" build 12-Sep-2018 15:30:25 - timebin = "6000s" build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.no_scan_bounds_2.ms.ref" build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - [expwt, expwtsp, expflag, expfrow, expdata] = _get_dst_cols(ref) build 12-Sep-2018 15:30:25 - combine = "corr, scan" build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2(dst, timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 - [gotwt, gotwtsp, gotflag, gotfrow, gotdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(numpy.isclose(gotwt, expwt, rtol))) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(numpy.isclose(gotwtsp, expwtsp, rtol))) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(gotflag == expflag)) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(gotfrow == expfrow)) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_no_scan_nor_field_boundaries(self): build 12-Sep-2018 15:30:25 - """Test no scan nor field boundaries""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.no_scan_nor_field_bounds.ms" build 12-Sep-2018 15:30:25 - timebin = "6000s" build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.no_scan_nor_field_bounds_2.ms.ref" build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - [expwt, expwtsp, expflag, expfrow, expdata] = _get_dst_cols(ref) build 12-Sep-2018 15:30:25 - for combine in ["corr,scan,field", "corr,field,scan"]: build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2(dst, timebin=timebin, combine=combine) build 12-Sep-2018 15:30:25 - [gotwt, gotwtsp, gotflag, gotfrow, gotdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(numpy.isclose(gotwt, expwt, rtol))) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(numpy.isclose(gotwtsp, expwtsp, rtol))) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(gotflag == expflag)) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(gotfrow == expfrow)) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_statalg(self): build 12-Sep-2018 15:30:25 - """Test statalg""" build 12-Sep-2018 15:30:25 - # just testing inputs build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.statalg.ms" build 12-Sep-2018 15:30:25 - for statalg in ["cl", "ch", "h", "f", "bogus"]: build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - if statalg == "cl": build 12-Sep-2018 15:30:25 - self.assertTrue(myms.statwt2(statalg=statalg)) build 12-Sep-2018 15:30:25 - elif statalg == "ch": build 12-Sep-2018 15:30:25 - self.assertTrue(myms.statwt2(statalg=statalg, zscore=5, maxiter=3)) build 12-Sep-2018 15:30:25 - elif statalg == "h": build 12-Sep-2018 15:30:25 - self.assertTrue(myms.statwt2(statalg=statalg, fence=0.2)) build 12-Sep-2018 15:30:25 - elif statalg == "f": build 12-Sep-2018 15:30:25 - self.assertTrue(myms.statwt2(statalg=statalg, center="median", lside=False)) build 12-Sep-2018 15:30:25 - elif statalg == "bogus": build 12-Sep-2018 15:30:25 - self.assertRaises(Exception, myms.statwt2, statalg=statalg) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - if statalg == "cl": build 12-Sep-2018 15:30:25 - statwt2(vis=dst, statalg=statalg) build 12-Sep-2018 15:30:25 - elif statalg == "ch": build 12-Sep-2018 15:30:25 - self.assertTrue(statwt2(vis=dst, statalg=statalg, zscore=5, maxiter=3)) build 12-Sep-2018 15:30:25 - elif statalg == "h": build 12-Sep-2018 15:30:25 - self.assertTrue(statwt2(vis=dst, statalg=statalg, fence=0.2)) build 12-Sep-2018 15:30:25 - elif statalg == "f": build 12-Sep-2018 15:30:25 - self.assertTrue(statwt2(vis=dst, statalg=statalg, center="median", lside=False)) build 12-Sep-2018 15:30:25 - elif statalg == "bogus": build 12-Sep-2018 15:30:25 - self.assertFalse(statwt2(vis=dst, statalg=statalg)) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_wtrange(self): build 12-Sep-2018 15:30:25 - """ Test weight range""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.timebin.ms" build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.timebin300s_2.ms.ref" build 12-Sep-2018 15:30:25 - [refwt, refwtsp, refflag, reffrow, refdata] = _get_dst_cols(ref) build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - combine = "corr" build 12-Sep-2018 15:30:25 - timebin = "300s" build 12-Sep-2018 15:30:25 - wtrange = [1, 2] build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(timebin=timebin, combine=combine, wtrange=wtrange) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2(dst, timebin=timebin, combine=combine, wtrange=wtrange) build 12-Sep-2018 15:30:25 - [tstwt, tstwtsp, tstflag, tstfrow, tstdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all( build 12-Sep-2018 15:30:25 - tstflag == numpy.logical_or( build 12-Sep-2018 15:30:25 - refflag, numpy.logical_not( build 12-Sep-2018 15:30:25 - numpy.logical_and(tstwtsp >= 1, tstwtsp <= 2) build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - ), build 12-Sep-2018 15:30:25 - "FLAGs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.all(tstflag, axis=(0,1)) == tstfrow), build 12-Sep-2018 15:30:25 - "FLAG_ROWs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - nrows = tstwtsp.shape[2] build 12-Sep-2018 15:30:25 - for row in range(nrows): build 12-Sep-2018 15:30:25 - rowwtsp = tstwtsp[:,:,row][numpy.logical_not(tstflag[:,:,row])] build 12-Sep-2018 15:30:25 - if (len(rowwtsp) == 0): build 12-Sep-2018 15:30:25 - expec = 0 build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - expec = rowwtsp[0] build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwt[:, row], expec, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHTs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_preview(self): build 12-Sep-2018 15:30:25 - """ Test preview mode""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.preview.ms" build 12-Sep-2018 15:30:25 - [refwt, refwtsp, refflag, reffrow, refdata] = _get_dst_cols(src) build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - combine = "corr" build 12-Sep-2018 15:30:25 - timebin = "300s" build 12-Sep-2018 15:30:25 - wtrange = [1, 2] build 12-Sep-2018 15:30:25 - preview = True build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2( build 12-Sep-2018 15:30:25 - timebin=timebin, combine=combine, wtrange=wtrange, preview=preview build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2( build 12-Sep-2018 15:30:25 - dst, timebin=timebin, combine=combine, wtrange=wtrange, preview=preview build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - [tstwt, tstwtsp, tstflag, tstfrow, tstdata] = _get_dst_cols(dst) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwt, refwt, rtol)), "WEIGHTs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_data(self): build 12-Sep-2018 15:30:25 - """ Test using data column""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.data.ms" build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.timebin300s_2.ms.ref" build 12-Sep-2018 15:30:25 - [refwt, refwtsp, refflag, reffrow] = _get_dst_cols(ref, "", dodata=False) build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - combine = "corr" build 12-Sep-2018 15:30:25 - timebin = 10 build 12-Sep-2018 15:30:25 - data = "data" build 12-Sep-2018 15:30:25 - mytb = tbtool() build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - self.assertTrue(mytb.open(dst, nomodify=False)) build 12-Sep-2018 15:30:25 - self.assertTrue(mytb.removecols("DATA")) build 12-Sep-2018 15:30:25 - self.assertTrue(mytb.renamecol("CORRECTED_DATA", "DATA")) build 12-Sep-2018 15:30:25 - mytb.done() build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(timebin=timebin, combine=combine, datacolumn=data) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2(dst, timebin=timebin, combine=combine, datacolumn=data) build 12-Sep-2018 15:30:25 - [tstwt, tstwtsp, tstflag, tstfrow] = _get_dst_cols(dst, "", False) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwt, refwt, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHTs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_slding_time_window(self): build 12-Sep-2018 15:30:25 - """ Test sliding time window""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.sliding_time_window.ms" build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.slidingtimebin300s_2.ms.ref" build 12-Sep-2018 15:30:25 - [refwt, refwtsp, refflag, reffrow] = _get_dst_cols(ref, "", dodata=False) build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - timebin = "300s" build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(timebin=timebin, slidetimebin=True) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2(dst, timebin=timebin, slidetimebin=True) build 12-Sep-2018 15:30:25 - [tstwt, tstwtsp, tstflag, tstfrow] = _get_dst_cols(dst, "", False) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwt, refwt, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHTs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_residual(self): build 12-Sep-2018 15:30:25 - """ Test using corrected_data - model_data column""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.residualwmodel.ms" build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.resid_with_model.ms.ref" build 12-Sep-2018 15:30:25 - [refwt, refwtsp, refflag, reffrow] = _get_dst_cols(ref, "", dodata=False) build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - data = "residual" build 12-Sep-2018 15:30:25 - mytb = tbtool() build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(datacolumn=data) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2(dst, datacolumn=data) build 12-Sep-2018 15:30:25 - [tstwt, tstwtsp, tstflag, tstfrow] = _get_dst_cols(dst, "", False) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwt, refwt, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHTs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_residual_no_model(self): build 12-Sep-2018 15:30:25 - """ Test using corrected_data - model_data column""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.residualwoutmodel.ms" build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.resid_without_model.ms.ref" build 12-Sep-2018 15:30:25 - [refwt, refwtsp, refflag, reffrow] = _get_dst_cols(ref, "", dodata=False) build 12-Sep-2018 15:30:25 - rtol = 1e-6 build 12-Sep-2018 15:30:25 - data = "residual" build 12-Sep-2018 15:30:25 - mytb = tbtool() build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - self.assertTrue(mytb.open(dst, nomodify=False)) build 12-Sep-2018 15:30:25 - self.assertTrue(mytb.removecols("MODEL_DATA")) build 12-Sep-2018 15:30:25 - mytb.done() build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(datacolumn=data) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2(dst, datacolumn=data) build 12-Sep-2018 15:30:25 - [tstwt, tstwtsp, tstflag, tstfrow] = _get_dst_cols(dst, "", False) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwt, refwt, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHTs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_residual_data(self): build 12-Sep-2018 15:30:25 - """ Test using _data - model_data column""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.residualdatawmodel.ms" build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.residdata_with_model.ms.ref" build 12-Sep-2018 15:30:25 - [refwt, refwtsp, refflag, reffrow] = _get_dst_cols(ref, "", dodata=False) build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - data = "residual_data" build 12-Sep-2018 15:30:25 - mytb = tbtool() build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(datacolumn=data) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2(dst, datacolumn=data) build 12-Sep-2018 15:30:25 - [tstwt, tstwtsp, tstflag, tstfrow] = _get_dst_cols(dst, "", False) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwt, refwt, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHTs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_residual_data_no_model(self): build 12-Sep-2018 15:30:25 - """ Test using data - default model """ build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.residualdatawoutmodel.ms" build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.residdata_without_model.ms.ref" build 12-Sep-2018 15:30:25 - [refwt, refwtsp, refflag, reffrow] = _get_dst_cols(ref, "", dodata=False) build 12-Sep-2018 15:30:25 - rtol = 1e-6 build 12-Sep-2018 15:30:25 - data = "residual_data" build 12-Sep-2018 15:30:25 - mytb = tbtool() build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - self.assertTrue(mytb.open(dst, nomodify=False)) build 12-Sep-2018 15:30:25 - self.assertTrue(mytb.removecols("MODEL_DATA")) build 12-Sep-2018 15:30:25 - mytb.done() build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - myms.statwt2(datacolumn=data) build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - statwt2(dst, datacolumn=data) build 12-Sep-2018 15:30:25 - [tstwt, tstwtsp, tstflag, tstfrow] = _get_dst_cols(dst, "", False) build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstflag == refflag), "FLAGs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue(numpy.all(tstfrow == reffrow), "FLAG_ROWs don't match") build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwt, refwt, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHTs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.all(numpy.isclose(tstwtsp, refwtsp, rtol)), build 12-Sep-2018 15:30:25 - "WEIGHT_SPECTRUMs don't match" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test_returned_stats(self): build 12-Sep-2018 15:30:25 - """ Test returned stats, CAS-10881""" build 12-Sep-2018 15:30:25 - dst = "ngc5921.split.statstest.ms" build 12-Sep-2018 15:30:25 - ref = datadir + "ngc5921.residdata_without_model.ms.ref" build 12-Sep-2018 15:30:25 - rtol = 1e-7 build 12-Sep-2018 15:30:25 - myms = mstool() build 12-Sep-2018 15:30:25 - for i in [0, 1]: build 12-Sep-2018 15:30:25 - shutil.copytree(src, dst) build 12-Sep-2018 15:30:25 - if i == 0: build 12-Sep-2018 15:30:25 - myms.open(dst, nomodify=False) build 12-Sep-2018 15:30:25 - res = myms.statwt2() build 12-Sep-2018 15:30:25 - myms.done() build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - res = statwt2(dst) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.isclose(res['mean'], 3.6326332, rtol), build 12-Sep-2018 15:30:25 - "mean is incorrect" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - self.assertTrue( build 12-Sep-2018 15:30:25 - numpy.isclose(res['variance'], 6.6448922, rtol), build 12-Sep-2018 15:30:25 - "variance is incorrect" build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - shutil.rmtree(dst) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def suite(): build 12-Sep-2018 15:30:25 - return [statwt2_test] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_tsdimaging.py b/gcwrap/python/scripts/tests/test_tsdimaging.py build 12-Sep-2018 15:30:25 index aef7de3..c164b24 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_tsdimaging.py build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/test_tsdimaging.py build 12-Sep-2018 15:30:25 @@ -397,8 +397,9 @@ class sdimaging_test0(sdimaging_unittest_base): build 12-Sep-2018 15:30:25 def test005(self): build 12-Sep-2018 15:30:25 """Test005: Bad stokes parameter""" build 12-Sep-2018 15:30:25 self.task_param['stokes'] = 'BAD' build 12-Sep-2018 15:30:25 - msg = 'Stokes BAD is an unsupported option' build 12-Sep-2018 15:30:25 - self.run_exception_case(self.task_param, msg) build 12-Sep-2018 15:30:25 + # argument verification error build 12-Sep-2018 15:30:25 + res = sdimaging(**self.task_param) build 12-Sep-2018 15:30:25 + self.assertFalse(res) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test006(self): build 12-Sep-2018 15:30:25 """Test006: Bad gridfunction""" build 12-Sep-2018 15:30:25 @@ -2312,8 +2313,7 @@ class sdimaging_test_polflag(sdimaging_unittest_base): build 12-Sep-2018 15:30:25 # Tests build 12-Sep-2018 15:30:25 refstats = merge_dict(self.stat_common, construct_refstat_uniform(self.unif_flux, self.region_all['blc'], self.region_all['trc']) ) build 12-Sep-2018 15:30:25 out_shape = (self.imsize_auto[0],self.imsize_auto[1],1,1) build 12-Sep-2018 15:30:25 - #self.run_test(self.task_param, refstats, out_shape,atol=1.e-5) build 12-Sep-2018 15:30:25 - self.skipTest('Skip test_pseudo_i since pseudo-Stokes mode is not implemented yet') build 12-Sep-2018 15:30:25 + self.run_test(self.task_param, refstats, out_shape,atol=1.e-5) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 def test_xx(self): build 12-Sep-2018 15:30:25 @@ -2709,6 +2709,158 @@ class sdimaging_test_mapextent(unittest.TestCase): build 12-Sep-2018 15:30:25 ### build 12-Sep-2018 15:30:25 class sdimaging_test_interp(unittest.TestCase): build 12-Sep-2018 15:30:25 """ build 12-Sep-2018 15:30:25 + tests: build 12-Sep-2018 15:30:25 + test_spline_interp_single_infiles: check if spline interpolation works for single MS build 12-Sep-2018 15:30:25 + test_spline_interp_multiple_infiles: check if spline interpolation works for multiple MSs build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + data: build 12-Sep-2018 15:30:25 + Both 'pointing6.ms' and 'pointing6-2.ms' contain 1000 rows for TP data, while only 10 build 12-Sep-2018 15:30:25 + rows given for POINTING data. build 12-Sep-2018 15:30:25 + The pointing data is given as corner points of a hexagon centered at (RA, Dec) = build 12-Sep-2018 15:30:25 + (0h00m00s, 0d00m00s) and with side of 0.001 radian and 0.0008 radian for 'pointing6.ms' build 12-Sep-2018 15:30:25 + and 'pointing6-2.ms', respectively. build 12-Sep-2018 15:30:25 + The resulting pattern of weight image should be nearly circular if spline interpolation build 12-Sep-2018 15:30:25 + does work, while it should be hexagonal if linear interpolation, the old algorithm, is build 12-Sep-2018 15:30:25 + applied. build 12-Sep-2018 15:30:25 + Also, 'pointing6-2.ms' has 5 hours lag behind 'pointing6.ms'. build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + datapath = os.environ.get('CASAPATH').split()[0] + '/data/regression/unittest/sdimaging/' build 12-Sep-2018 15:30:25 + params = dict(antenna = "0", build 12-Sep-2018 15:30:25 + intent = "*ON_SOURCE*", build 12-Sep-2018 15:30:25 + gridfunction = "SF", build 12-Sep-2018 15:30:25 + convsupport = 6, build 12-Sep-2018 15:30:25 + imsize = [512, 512], build 12-Sep-2018 15:30:25 + cell = "2arcsec", build 12-Sep-2018 15:30:25 + phasecenter = "J2000 0:00:00.0 00.00.00.0", build 12-Sep-2018 15:30:25 + ephemsrcname = '', build 12-Sep-2018 15:30:25 + pointingcolumn = "direction", build 12-Sep-2018 15:30:25 + stokes = 'I') build 12-Sep-2018 15:30:25 + infiles = [] build 12-Sep-2018 15:30:25 + outfiles = [] # have a list of outfiles as multiple task execution may occur in a test build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def __remove_table(self, f): build 12-Sep-2018 15:30:25 + if os.path.exists(f): build 12-Sep-2018 15:30:25 + shutil.rmtree(f) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def __copy_table(self, f): build 12-Sep-2018 15:30:25 + self.__remove_table(f) build 12-Sep-2018 15:30:25 + testutils.copytree_ignore_subversion(self.datapath, f) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def setUp(self): build 12-Sep-2018 15:30:25 + self.infiles = [] build 12-Sep-2018 15:30:25 + self.outfiles = [] build 12-Sep-2018 15:30:25 + default(sdimaging) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def tearDown(self): build 12-Sep-2018 15:30:25 + for infile in self.infiles: build 12-Sep-2018 15:30:25 + self.__remove_table(infile) build 12-Sep-2018 15:30:25 + for outfile in self.outfiles: build 12-Sep-2018 15:30:25 + os.system('rm -rf %s*'%(outfile)) build 12-Sep-2018 15:30:25 + self.assertEqual(len(get_table_cache()), 0) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def run_task(self, infiles, outfile, **kwargs): build 12-Sep-2018 15:30:25 + if isinstance(infiles, str): build 12-Sep-2018 15:30:25 + infiles = [ infiles ] build 12-Sep-2018 15:30:25 + for i in range(len(infiles)): build 12-Sep-2018 15:30:25 + self.infiles.append(infiles[i]) build 12-Sep-2018 15:30:25 + self.outfiles.append(outfile) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + for infile in infiles: build 12-Sep-2018 15:30:25 + self.__copy_table(infile) build 12-Sep-2018 15:30:25 + self.params.update(**kwargs) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + status = sdimaging(infiles=infiles, outfile=outfile, **self.params) build 12-Sep-2018 15:30:25 + self.assertIsNone(status, msg = 'sdimaging failed to execute') build 12-Sep-2018 15:30:25 + self.assertTrue(os.path.exists(outfile+'.image'), msg='output image is not created.') build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def check_spline_works(self, outfile, multiple_ms=False): build 12-Sep-2018 15:30:25 + weightfile = outfile + '.weight' build 12-Sep-2018 15:30:25 + with tbmanager(weightfile) as tb: build 12-Sep-2018 15:30:25 + mapdata = tb.getcell('map', 0) build 12-Sep-2018 15:30:25 + # for pixels with strong weight value(>14), collect their distance from the image build 12-Sep-2018 15:30:25 + # center and then compute the mean and sigma of their distribution. build 12-Sep-2018 15:30:25 + dist_answer = [0.0, 0.0] build 12-Sep-2018 15:30:25 + dist_answer[0] = 0.001*180.0/numpy.pi*3600.0/float(self.params['cell'][0]) build 12-Sep-2018 15:30:25 + dist_answer[1] = dist_answer[0]*0.8 build 12-Sep-2018 15:30:25 + dist_sep = (dist_answer[0] + dist_answer[1])/2.0 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + dist_list = [[], []] build 12-Sep-2018 15:30:25 + for i in range(self.params['imsize'][0]): build 12-Sep-2018 15:30:25 + for j in range(self.params['imsize'][1]): build 12-Sep-2018 15:30:25 + if mapdata[i][j][0][0] > 14.0: build 12-Sep-2018 15:30:25 + cenx = float(self.params['imsize'][0])/2.0 build 12-Sep-2018 15:30:25 + ceny = float(self.params['imsize'][1])/2.0 build 12-Sep-2018 15:30:25 + dx = float(i) - cenx build 12-Sep-2018 15:30:25 + dy = float(j) - ceny build 12-Sep-2018 15:30:25 + dr = numpy.sqrt(dx*dx + dy*dy) build 12-Sep-2018 15:30:25 + idx = 0 if (dist_sep < dr) else 1 build 12-Sep-2018 15:30:25 + dist_list[idx].append(dr) build 12-Sep-2018 15:30:25 + dist_mean1 = [0.0, 0.0] build 12-Sep-2018 15:30:25 + dist_mean2 = [0.0, 0.0] build 12-Sep-2018 15:30:25 + dist_sigma = [0.0, 0.0] build 12-Sep-2018 15:30:25 + dist_llim = [0.0, 0.0] build 12-Sep-2018 15:30:25 + dist_ulim = [0.0, 0.0] build 12-Sep-2018 15:30:25 + idx2 = 2 if multiple_ms else 1 build 12-Sep-2018 15:30:25 + for i in range(idx2): build 12-Sep-2018 15:30:25 + for j in range(len(dist_list[i])): build 12-Sep-2018 15:30:25 + dist_mean1[i] += dist_list[i][j] build 12-Sep-2018 15:30:25 + dist_mean2[i] += dist_list[i][j] * dist_list[i][j] build 12-Sep-2018 15:30:25 + dist_mean1[i] = dist_mean1[i] / float(len(dist_list[i])) build 12-Sep-2018 15:30:25 + dist_mean2[i] = dist_mean2[i] / float(len(dist_list[i])) build 12-Sep-2018 15:30:25 + dist_sigma[i] = numpy.sqrt(dist_mean2[i] - dist_mean1[i] * dist_mean1[i]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + dist_llim[i] = dist_mean1[i] - dist_sigma[i] build 12-Sep-2018 15:30:25 + dist_ulim[i] = dist_mean1[i] + dist_sigma[i] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + if spline interpolation is done, the range [dist_llim[0], dist_ulim[0]] build 12-Sep-2018 15:30:25 + will be a narrow range (102.683 ~ 103.318) and encloses the answer build 12-Sep-2018 15:30:25 + value (103.132), while linear interpolation will result in a wider build 12-Sep-2018 15:30:25 + range (94.240 +- 4.281) and depart from the answer value at 2-sigma build 12-Sep-2018 15:30:25 + level. build 12-Sep-2018 15:30:25 + FYI, [dist_llim[1], dist_ulim[1]] and dist_answer[1] will be build 12-Sep-2018 15:30:25 + (81.609 - 83.151) and (82.506), respectively. build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 + self.assertTrue(((dist_llim[i] < dist_answer[i]) and (dist_answer[i] < dist_ulim[i])), build 12-Sep-2018 15:30:25 + msg = 'spline interpolation seems not working.') build 12-Sep-2018 15:30:25 + #print '['+str(i)+'] --- ' + str(dist_llim[i]) + ' - ' + str(dist_ulim[i]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def check_images_identical(self, image1, image2, weight_image=False): build 12-Sep-2018 15:30:25 + suffix = '.weight' if weight_image else '.image' build 12-Sep-2018 15:30:25 + img1 = image1 + suffix build 12-Sep-2018 15:30:25 + img2 = image2 + suffix build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + with tbmanager(img1) as tb: build 12-Sep-2018 15:30:25 + mapdata1 = tb.getcell('map', 0) build 12-Sep-2018 15:30:25 + with tbmanager(img2) as tb: build 12-Sep-2018 15:30:25 + mapdata2 = tb.getcell('map', 0) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + self.assertTrue(numpy.allclose(mapdata1, mapdata2, rtol=1.0e-5, atol=1.0e-5), build 12-Sep-2018 15:30:25 + msg="%s and %s are not identical" % (img1, img2)) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_spline_interp_single_infiles(self): build 12-Sep-2018 15:30:25 + """test_spline_interp_single_infiles: Check if spline interpolation works for single fast-scan data.""" build 12-Sep-2018 15:30:25 + outfile = 'pointing6.out' build 12-Sep-2018 15:30:25 + self.run_task(infiles=['pointing6.ms'], outfile=outfile) build 12-Sep-2018 15:30:25 + self.check_spline_works(outfile) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + def test_spline_interp_multiple_infiles(self): build 12-Sep-2018 15:30:25 + """test_spline_interp_multiple_infiles: Check if spline interpolation works for multiple fast-scan data.""" build 12-Sep-2018 15:30:25 + outfile12 = "1and2.out" build 12-Sep-2018 15:30:25 + self.run_task(infiles=['pointing6.ms', 'pointing6-2.ms'], outfile=outfile12) build 12-Sep-2018 15:30:25 + outfile21 = "2and1.out" build 12-Sep-2018 15:30:25 + self.run_task(infiles=['pointing6-2.ms', 'pointing6.ms'], outfile=outfile21) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + #check if spline interpolation works build 12-Sep-2018 15:30:25 + self.check_spline_works(outfile12, True) build 12-Sep-2018 15:30:25 + #check if the results (both image and weight) don't change when infiles has inversed order build 12-Sep-2018 15:30:25 + self.check_images_identical(outfile12, outfile21) build 12-Sep-2018 15:30:25 + self.check_images_identical(outfile12, outfile21, True) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +class sdimaging_test_interp_old(unittest.TestCase): build 12-Sep-2018 15:30:25 + """ build 12-Sep-2018 15:30:25 The test data 'pointing6.ms' contains 1000 rows for TP data, while only 10 rows given build 12-Sep-2018 15:30:25 for POINTING data. The pointing data is given as corner points of a hexagon centered at build 12-Sep-2018 15:30:25 (RA, Dec) = (0h00m00s, 0d00m00s) and with side of 0.001 radian. build 12-Sep-2018 15:30:25 @@ -3315,5 +3467,7 @@ def suite(): build 12-Sep-2018 15:30:25 sdimaging_test_mslist, build 12-Sep-2018 15:30:25 sdimaging_test_restfreq, build 12-Sep-2018 15:30:25 sdimaging_test_mapextent, build 12-Sep-2018 15:30:25 - sdimaging_test_interp,sdimaging_test_clipping, build 12-Sep-2018 15:30:25 - sdimaging_test_projection] build 12-Sep-2018 15:30:25 + sdimaging_test_interp, build 12-Sep-2018 15:30:25 + sdimaging_test_clipping, build 12-Sep-2018 15:30:25 + sdimaging_test_projection build 12-Sep-2018 15:30:25 + ] build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/test_visstatold.py b/gcwrap/python/scripts/tests/test_visstatold.py build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 7bfac69..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/test_visstatold.py build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,301 +0,0 @@ build 12-Sep-2018 15:30:25 -from tasks import * build 12-Sep-2018 15:30:25 -from taskinit import * build 12-Sep-2018 15:30:25 -from __main__ import inp build 12-Sep-2018 15:30:25 -from __main__ import default build 12-Sep-2018 15:30:25 -import os build 12-Sep-2018 15:30:25 -import shutil build 12-Sep-2018 15:30:25 -import unittest build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# Functional tests of visstatold build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -epsilon = 0.0001 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -#fits='ngc5921.fits' build 12-Sep-2018 15:30:25 -#msfile = 'ngc5921.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# Path for data build 12-Sep-2018 15:30:25 -datapath = os.environ.get('CASAPATH').split()[0] + "/data/regression/unittest/visstat/" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -# Pick up alternative data directory to run tests on MMSs build 12-Sep-2018 15:30:25 -testmms = False build 12-Sep-2018 15:30:25 -if os.environ.has_key('TEST_DATADIR'): build 12-Sep-2018 15:30:25 - DATADIR = str(os.environ.get('TEST_DATADIR'))+'/visstat/' build 12-Sep-2018 15:30:25 - if os.path.isdir(DATADIR): build 12-Sep-2018 15:30:25 - testmms = True build 12-Sep-2018 15:30:25 - datapath = DATADIR build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -print 'visstatold tests will use data from '+datapath build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -class visstatold_test(unittest.TestCase): build 12-Sep-2018 15:30:25 - def setUp(self): build 12-Sep-2018 15:30:25 - # MS in repository was flagged with the following command: build 12-Sep-2018 15:30:25 - # flagdata(vis=self.msfile, antenna='17', flagbackup=False) build 12-Sep-2018 15:30:25 - self.msfile = "ngc5921.ms" build 12-Sep-2018 15:30:25 - if(not os.path.exists(self.msfile)): build 12-Sep-2018 15:30:25 - shutil.copytree(datapath+self.msfile, self.msfile) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - default('visstatold') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def tearDown(self): build 12-Sep-2018 15:30:25 - shutil.rmtree(self.msfile) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test1(self): build 12-Sep-2018 15:30:25 - '''Visstatold 1: Default values''' build 12-Sep-2018 15:30:25 - retValue = {'success': True, 'msgs': "", 'error_msgs': '' } build 12-Sep-2018 15:30:25 - expected = {self.msfile: build 12-Sep-2018 15:30:25 - {'DATA': {'max': 73.75, build 12-Sep-2018 15:30:25 - 'mean': 4.8371031336376049, build 12-Sep-2018 15:30:25 - 'medabsdevmed': 0.045013353228569031, build 12-Sep-2018 15:30:25 - 'median': 0.053559452295303345, build 12-Sep-2018 15:30:25 - 'min': 2.2130521756480448e-05, build 12-Sep-2018 15:30:25 - 'npts': 2660994.0, build 12-Sep-2018 15:30:25 - 'quartile': 0.30496686697006226, build 12-Sep-2018 15:30:25 - 'rms': 17.081207275390625, build 12-Sep-2018 15:30:25 - 'stddev': 16.382008275102407, build 12-Sep-2018 15:30:25 - 'sum': 12871502.415990865, build 12-Sep-2018 15:30:25 - 'sumsq': 776391995.30866611, build 12-Sep-2018 15:30:25 - 'var': 268.37019512552371}}} build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - s = visstatold(vis=self.msfile, axis='amp', datacolumn='data') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if s.keys() != expected[self.msfile].keys(): build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Wrong dictionary keys. Expected %s, got %s" % \ build 12-Sep-2018 15:30:25 - (expected[self.msfile], s) build 12-Sep-2018 15:30:25 -# raise Exception("Wrong dictionary keys. Expected %s, got %s" % \ build 12-Sep-2018 15:30:25 -# (expected[self.msfile], s)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Detailed check of values, column=DATA build 12-Sep-2018 15:30:25 - print "Expected =", expected[self.msfile] build 12-Sep-2018 15:30:25 - print "Got =", s build 12-Sep-2018 15:30:25 - if not s.has_key('DATA'): build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Dictionary returned from visstatold does not have key DATA" build 12-Sep-2018 15:30:25 -# raise Exception("Dictionary returned from visstatold does not have key DATA") build 12-Sep-2018 15:30:25 - for e in expected[self.msfile]['DATA'].keys(): build 12-Sep-2018 15:30:25 - print "Checking %s: %s vs %s" % \ build 12-Sep-2018 15:30:25 - (e, expected[self.msfile]['DATA'][e], s['DATA'][e]) build 12-Sep-2018 15:30:25 - failed = False build 12-Sep-2018 15:30:25 - if expected[self.msfile]['DATA'][e] == 0: build 12-Sep-2018 15:30:25 - if s['DATA'][e] != 0: build 12-Sep-2018 15:30:25 - failed = True build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - if abs((expected[self.msfile]['DATA'][e] - s['DATA'][e])/expected[self.msfile]['DATA'][e]) > 0.0001: build 12-Sep-2018 15:30:25 - failed = True build 12-Sep-2018 15:30:25 - if failed: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Numbers differ, expected %s, got %s" % \ build 12-Sep-2018 15:30:25 - (str(expected[self.msfile]['DATA'][e]), str(s['DATA'][e])) build 12-Sep-2018 15:30:25 -# raise Exception("Numbers differ, expected %s, got %s" % \ build 12-Sep-2018 15:30:25 -# (str(expected[self.msfile]['DATA'][e]), str(s['DATA'][e]))) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(retValue['success'],retValue['error_msgs']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test2(self): build 12-Sep-2018 15:30:25 - '''Visstatold 2: Check channel selections''' build 12-Sep-2018 15:30:25 - retValue = {'success': True, 'msgs': "", 'error_msgs': '' } build 12-Sep-2018 15:30:25 - for ch in [1, 2, 4, 7, 13, 62]: build 12-Sep-2018 15:30:25 - for corr in ['ll', 'rr', 'll,rr']: build 12-Sep-2018 15:30:25 - print "Call with spw='0:1~"+str(ch)+"', correlation="+corr build 12-Sep-2018 15:30:25 - s = visstatold(vis=self.msfile, axis='amp', datacolumn='data', spw='0:1~'+str(ch), correlation=corr) build 12-Sep-2018 15:30:25 - print s build 12-Sep-2018 15:30:25 - n_expected = 2660994/63 * ch build 12-Sep-2018 15:30:25 - if corr in ['ll', 'rr']: build 12-Sep-2018 15:30:25 - n_expected /= 2 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - n = int(s['DATA']['npts']) build 12-Sep-2018 15:30:25 - print "Checking npts: %s vs %s" % (n, n_expected) build 12-Sep-2018 15:30:25 - if n != n_expected: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError:"+str(n_expected) + " points expected, but npts = " + str(n) build 12-Sep-2018 15:30:25 -# raise Exception(str(n_expected) + " points expected, but npts = " + str(n)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(retValue['success'],retValue['error_msgs']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test3(self): build 12-Sep-2018 15:30:25 - '''Visstatold 3: Test on different columns and axis''' build 12-Sep-2018 15:30:25 - retValue = {'success': True, 'msgs': "", 'error_msgs': '' } build 12-Sep-2018 15:30:25 - print "Create scratch columns." build 12-Sep-2018 15:30:25 - if testmms: build 12-Sep-2018 15:30:25 - clearcal(self.msfile) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - cblocal = cbtool() build 12-Sep-2018 15:30:25 - cblocal.open(self.msfile) build 12-Sep-2018 15:30:25 - cblocal.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - tblocal = tbtool() build 12-Sep-2018 15:30:25 - tblocal.open(self.msfile) build 12-Sep-2018 15:30:25 - cols = tblocal.colnames() build 12-Sep-2018 15:30:25 - tblocal.close() build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - cplx = ['amp', 'amplitude', 'phase', 'imag', 'imaginary', 'real'] build 12-Sep-2018 15:30:25 - for x in cplx: build 12-Sep-2018 15:30:25 - cols.append(x) build 12-Sep-2018 15:30:25 - print cols build 12-Sep-2018 15:30:25 - cols.remove('DATA') build 12-Sep-2018 15:30:25 - have_corr = False build 12-Sep-2018 15:30:25 - if('CORRECTED_DATA' in cols): build 12-Sep-2018 15:30:25 - cols.remove('CORRECTED_DATA') build 12-Sep-2018 15:30:25 - have_corr = True build 12-Sep-2018 15:30:25 - have_model = False build 12-Sep-2018 15:30:25 - if('MODEL_DATA' in cols): build 12-Sep-2018 15:30:25 - cols.remove('MODEL_DATA') build 12-Sep-2018 15:30:25 - have_model = True build 12-Sep-2018 15:30:25 - cols.append('UVRANGE') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - cols = [x.lower() for x in cols] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - print "Trying these column names", cols build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - for col in cols: build 12-Sep-2018 15:30:25 - data_cols = [''] build 12-Sep-2018 15:30:25 - print 'col ',col build 12-Sep-2018 15:30:25 - print 'cplx ',cplx build 12-Sep-2018 15:30:25 - if col in cplx: build 12-Sep-2018 15:30:25 - data_cols = ['data'] # not supported: 'residual' build 12-Sep-2018 15:30:25 - if have_corr: build 12-Sep-2018 15:30:25 - data_cols.append('corrected') build 12-Sep-2018 15:30:25 - if have_model: build 12-Sep-2018 15:30:25 - data_cols.append('model') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - print data_cols build 12-Sep-2018 15:30:25 - for dc in data_cols: build 12-Sep-2018 15:30:25 - print "Call with axis =", col, "; datacolumn =", dc build 12-Sep-2018 15:30:25 - if dc != '': build 12-Sep-2018 15:30:25 - s = visstatold(vis=self.msfile, axis=col, datacolumn=dc) build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - s = visstatold(vis=self.msfile, axis=col) build 12-Sep-2018 15:30:25 - print "Result was", s build 12-Sep-2018 15:30:25 - if col.upper() in ["FLAG_CATEGORY", "EXPOSURE", "OBSERVATION_ID", "PROCESSOR_ID", "STATE_ID", "TIME_CENTROID"]: build 12-Sep-2018 15:30:25 - # no support for FLAG_CATEGORY, EXPOSURE, OBSERVATION_ID, ... build 12-Sep-2018 15:30:25 - # so expect failure build 12-Sep-2018 15:30:25 - if s != None: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: "+str(s) build 12-Sep-2018 15:30:25 -# raise Exception("Error! " + str(s)) build 12-Sep-2018 15:30:25 - elif not type(s) is dict: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Return value " + str(s) + " is not a dictionary" build 12-Sep-2018 15:30:25 -# raise Exception("Error! Return value " + str(s) + " is not a dictionary") build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - if dc == '' and \ build 12-Sep-2018 15:30:25 - not col.upper() in s.keys() and \ build 12-Sep-2018 15:30:25 - not col.upper()+'_0' in s.keys(): build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Missing key " + col.upper() + " in result" build 12-Sep-2018 15:30:25 -# raise Exception("Missing key " + col.upper() + " in result") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - if dc != '' and not dc.upper() in s.keys(): build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Missing key " + dc.upper() + " in result" build 12-Sep-2018 15:30:25 -# raise Exception("Missing key " + dc.upper() + " in result") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - print 'retValue[\'success\'] ', retValue['success'] build 12-Sep-2018 15:30:25 - print 'retValue[\'error_msgs\'] ', retValue['error_msgs'] build 12-Sep-2018 15:30:25 - self.assertTrue(retValue['success'],retValue['error_msgs']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test4(self): build 12-Sep-2018 15:30:25 - '''Visstatold 4: Test of special cases''' build 12-Sep-2018 15:30:25 - retValue = {'success': True, 'msgs': "", 'error_msgs': '' } build 12-Sep-2018 15:30:25 - for a in range(1, 5): build 12-Sep-2018 15:30:25 - s = visstatold(vis=self.msfile, axis='ANTENNA1', antenna=str(a)+'&26') build 12-Sep-2018 15:30:25 - print "antenna =", a, "; mean = ", s['ANTENNA1']['mean'] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # Note there's a counting from 0 or 1 issue here build 12-Sep-2018 15:30:25 - # with the antenna numbering build 12-Sep-2018 15:30:25 - if self.msfile == self.msfile: build 12-Sep-2018 15:30:25 - offset = 1 build 12-Sep-2018 15:30:25 - else: build 12-Sep-2018 15:30:25 - offset = 0 build 12-Sep-2018 15:30:25 - if abs((s['ANTENNA1']['mean']+offset) - a) > epsilon: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Failed when antenna= "+str(a)+'&26' build 12-Sep-2018 15:30:25 -# raise Exception("Error!") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - for scan in range(1, 8): build 12-Sep-2018 15:30:25 - s = visstatold(vis=self.msfile, axis='SCAN_NUMBER', scan=str(scan)) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - print "scan =", scan, "; mean = ", s['SCAN_NUMBER']['mean'] build 12-Sep-2018 15:30:25 - if abs(s['SCAN_NUMBER']['mean'] - scan) > epsilon: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Failed for scan = "+str(scan) build 12-Sep-2018 15:30:25 -# raise Exception("Error!") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(retValue['success'],retValue['error_msgs']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test5(self): build 12-Sep-2018 15:30:25 - '''Visstatold 5: Test that flagging impact statistics''' build 12-Sep-2018 15:30:25 - retValue = {'success': True, 'msgs': "", 'error_msgs': '' } build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - s = visstatold(vis=self.msfile, axis='scan_number', scan='>=1') build 12-Sep-2018 15:30:25 - print "min = ", s['SCAN_NUMBER']['min'] build 12-Sep-2018 15:30:25 - if abs(s['SCAN_NUMBER']['min'] - 1) > epsilon: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Failed with visstatold(vis=self.msfile, axis='scan_number', scan='>=1') " build 12-Sep-2018 15:30:25 -# raise Exception("Error") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - flagdata(vis=self.msfile, scan="1", flagbackup=False) build 12-Sep-2018 15:30:25 - s = visstatold(vis=self.msfile, axis='scan_number', scan='>=1') build 12-Sep-2018 15:30:25 - print "min = ", s['SCAN_NUMBER']['min'] build 12-Sep-2018 15:30:25 - if abs(s['SCAN_NUMBER']['min'] - 2) > epsilon: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Failed with visstatold(vis=msfile, axis='scan_number', scan='>=1') "\ build 12-Sep-2018 15:30:25 - +"when data is flagged as flagdata(vis=msfile, scan='1')" build 12-Sep-2018 15:30:25 -# raise Exception("Error") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - flagdata(vis=self.msfile, scan="2", flagbackup=False) build 12-Sep-2018 15:30:25 - s = visstatold(vis=self.msfile, axis='scan_number', scan='>=1') build 12-Sep-2018 15:30:25 - print "min = ", s['SCAN_NUMBER']['min'] build 12-Sep-2018 15:30:25 - if abs(s['SCAN_NUMBER']['min'] - 3) > epsilon: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Failed with visstatold(vis=msfile, axis='scan_number', scan='>=1') "\ build 12-Sep-2018 15:30:25 - +"when data is flagged as flagdata(vis=msfile, scan='2')" build 12-Sep-2018 15:30:25 -# raise Exception("Error") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - s = visstatold(vis=self.msfile, axis='scan_number', useflags=False, scan='>=1') build 12-Sep-2018 15:30:25 - print "min = ", s['SCAN_NUMBER']['min'] build 12-Sep-2018 15:30:25 - if abs(s['SCAN_NUMBER']['min'] - 1) > epsilon: build 12-Sep-2018 15:30:25 - retValue['success']=False build 12-Sep-2018 15:30:25 - retValue['error_msgs']=retValue['error_msgs']\ build 12-Sep-2018 15:30:25 - +"\nError: Failed with visstatold(vis=msfile, axis='scan_number', useflags=False, scan='>=1')" build 12-Sep-2018 15:30:25 -# raise Exception("Error") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - self.assertTrue(retValue['success'],retValue['error_msgs']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test6(self): build 12-Sep-2018 15:30:25 - '''Visstatold 6: Test when all selected rows are flagged''' build 12-Sep-2018 15:30:25 - flagdata(vis=self.msfile,mode='manual',antenna='1;1&&1', flagbackup=False) build 12-Sep-2018 15:30:25 - res = visstatold(vis=self.msfile,antenna='1',useflags=True) build 12-Sep-2018 15:30:25 - self.assertFalse(res, 'All data are flagged. An exception should have been raised') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -class visstatold_cleanup(unittest.TestCase): build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def setUp(self): build 12-Sep-2018 15:30:25 - pass build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def tearDown(self): build 12-Sep-2018 15:30:25 - # It will ignore errors in case the files don't exist build 12-Sep-2018 15:30:25 - shutil.rmtree(self.msfile,ignore_errors=True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - def test1a(self): build 12-Sep-2018 15:30:25 - '''Visstatold: Cleanup''' build 12-Sep-2018 15:30:25 - pass build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -def suite(): build 12-Sep-2018 15:30:25 - return [visstatold_test] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/python/scripts/tests/uTest_list.json b/gcwrap/python/scripts/tests/uTest_list.json build 12-Sep-2018 15:30:25 index 0cd8425..7a18c30 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/python/scripts/tests/uTest_list.json build 12-Sep-2018 15:30:25 +++ b/gcwrap/python/scripts/tests/uTest_list.json build 12-Sep-2018 15:30:25 @@ -302,8 +302,8 @@ build 12-Sep-2018 15:30:25 }, build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 "testNumber":"3170", build 12-Sep-2018 15:30:25 - "testName":"Statwt", build 12-Sep-2018 15:30:25 - "testScript":"test_statwt", build 12-Sep-2018 15:30:25 + "testName":"Oldtatwt", build 12-Sep-2018 15:30:25 + "testScript":"test_oldstatwt", build 12-Sep-2018 15:30:25 "testType":"functionalTest", build 12-Sep-2018 15:30:25 "testLevel":"critical", build 12-Sep-2018 15:30:25 "Maintainer":"Takahiro Tsutsumi", build 12-Sep-2018 15:30:25 @@ -315,8 +315,8 @@ build 12-Sep-2018 15:30:25 }, build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 "testNumber":"3171", build 12-Sep-2018 15:30:25 - "testName":"Statwt2", build 12-Sep-2018 15:30:25 - "testScript":"test_statwt2", build 12-Sep-2018 15:30:25 + "testName":"Statwt", build 12-Sep-2018 15:30:25 + "testScript":"test_statwt", build 12-Sep-2018 15:30:25 "testType":"functionalTest", build 12-Sep-2018 15:30:25 "testLevel":"critical", build 12-Sep-2018 15:30:25 "Maintainer":"David Mehringer", build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/CMakeLists.txt b/gcwrap/tasks/CMakeLists.txt build 12-Sep-2018 15:30:25 index 0056b2d..6c29a18 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/CMakeLists.txt build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/CMakeLists.txt build 12-Sep-2018 15:30:25 @@ -3,20 +3,16 @@ accor.xml build 12-Sep-2018 15:30:25 accum.xml build 12-Sep-2018 15:30:25 applycal.xml build 12-Sep-2018 15:30:25 asdmsummary.xml build 12-Sep-2018 15:30:25 -autoclean.xml build 12-Sep-2018 15:30:25 bandpass.xml build 12-Sep-2018 15:30:25 blcal.xml build 12-Sep-2018 15:30:25 -boxit.xml build 12-Sep-2018 15:30:25 browsetable.xml build 12-Sep-2018 15:30:25 calstat.xml build 12-Sep-2018 15:30:25 caltabconvert.xml build 12-Sep-2018 15:30:25 clean.xml build 12-Sep-2018 15:30:25 clearcal.xml build 12-Sep-2018 15:30:25 -clearplot.xml build 12-Sep-2018 15:30:25 clearstat.xml build 12-Sep-2018 15:30:25 concat.xml build 12-Sep-2018 15:30:25 conjugatevis.xml build 12-Sep-2018 15:30:25 -csvclean.xml build 12-Sep-2018 15:30:25 cvel.xml build 12-Sep-2018 15:30:25 cvel2.xml build 12-Sep-2018 15:30:25 deconvolve.xml build 12-Sep-2018 15:30:25 @@ -49,7 +45,6 @@ impbcor.xml build 12-Sep-2018 15:30:25 importatca.xml build 12-Sep-2018 15:30:25 importasap.xml build 12-Sep-2018 15:30:25 importasdm.xml build 12-Sep-2018 15:30:25 -importevla.xml build 12-Sep-2018 15:30:25 importfits.xml build 12-Sep-2018 15:30:25 importfitsidi.xml build 12-Sep-2018 15:30:25 importgmrt.xml build 12-Sep-2018 15:30:25 @@ -75,21 +70,16 @@ listpartition.xml build 12-Sep-2018 15:30:25 listsdm.xml build 12-Sep-2018 15:30:25 listvis.xml build 12-Sep-2018 15:30:25 makemask.xml build 12-Sep-2018 15:30:25 -mosaic.xml build 12-Sep-2018 15:30:25 msview.xml build 12-Sep-2018 15:30:25 mstransform.xml build 12-Sep-2018 15:30:25 msuvbin.xml build 12-Sep-2018 15:30:25 -oldhanningsmooth.xml build 12-Sep-2018 15:30:25 -oldplotants.xml build 12-Sep-2018 15:30:25 oldsplit.xml build 12-Sep-2018 15:30:25 plotants.xml build 12-Sep-2018 15:30:25 plotbandpass.xml build 12-Sep-2018 15:30:25 plotcal.xml build 12-Sep-2018 15:30:25 plotms.xml build 12-Sep-2018 15:30:25 -plotuv.xml build 12-Sep-2018 15:30:25 plotweather.xml build 12-Sep-2018 15:30:25 plotprofilemap.xml build 12-Sep-2018 15:30:25 -#plotxy.xml build 12-Sep-2018 15:30:25 partition.xml build 12-Sep-2018 15:30:25 polcal.xml build 12-Sep-2018 15:30:25 predictcomp.xml build 12-Sep-2018 15:30:25 @@ -107,7 +97,6 @@ tsdimaging.xml build 12-Sep-2018 15:30:25 sdsidebandsplit.xml build 12-Sep-2018 15:30:25 sdsmooth.xml build 12-Sep-2018 15:30:25 setjy.xml build 12-Sep-2018 15:30:25 -ssoflux.xml build 12-Sep-2018 15:30:25 simalma.xml build 12-Sep-2018 15:30:25 simobserve.xml build 12-Sep-2018 15:30:25 simanalyze.xml build 12-Sep-2018 15:30:25 @@ -120,8 +109,8 @@ splattotable.xml build 12-Sep-2018 15:30:25 split.xml build 12-Sep-2018 15:30:25 #split2.xml build 12-Sep-2018 15:30:25 spxfit.xml build 12-Sep-2018 15:30:25 +oldstatwt.xml build 12-Sep-2018 15:30:25 statwt.xml build 12-Sep-2018 15:30:25 -statwt2.xml build 12-Sep-2018 15:30:25 tclean.xml build 12-Sep-2018 15:30:25 tclean2.xml build 12-Sep-2018 15:30:25 testconcat.xml build 12-Sep-2018 15:30:25 @@ -133,8 +122,5 @@ viewer.xml build 12-Sep-2018 15:30:25 wvrgcal.xml build 12-Sep-2018 15:30:25 virtualconcat.xml build 12-Sep-2018 15:30:25 vishead.xml build 12-Sep-2018 15:30:25 -visstatold.xml build 12-Sep-2018 15:30:25 visstat.xml build 12-Sep-2018 15:30:25 -visstat2.xml build 12-Sep-2018 15:30:25 -widebandpbcor.xml build 12-Sep-2018 15:30:25 -widefield.xml ) build 12-Sep-2018 15:30:25 +widebandpbcor.xml) build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/accor.xml b/gcwrap/tasks/accor.xml build 12-Sep-2018 15:30:25 index 3aa1244..e4d1077 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/accor.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/accor.xml build 12-Sep-2018 15:30:25 @@ -5,7 +5,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" build 12-Sep-2018 15:30:25 xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd build 12-Sep-2018 15:30:25 file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Normalize visibilities based on auto-correlations build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Determines the amplitude corrections neede due to errors in sampler build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/asdmsummary.xml b/gcwrap/tasks/asdmsummary.xml build 12-Sep-2018 15:30:25 index e463c5b..61df0c6 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/asdmsummary.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/asdmsummary.xml build 12-Sep-2018 15:30:25 @@ -7,7 +7,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Summarized description of an ASDM dataset. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -27,7 +27,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The asdmsummary task prints to the CASA log a description of the content of an SDM dataset. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Example: build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 asdmsummary(asdm='10C-119_sb3070258_1.55628.42186299768') build 12-Sep-2018 15:30:25 @@ -36,9 +36,9 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Keyword argument: build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - asdm -- Name of input ASDM directory. build 12-Sep-2018 15:30:25 + asdm -- Name of input ASDM directory. build 12-Sep-2018 15:30:25 example: asdm='10C-119_sb3070258_1.55628.42186299768' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/autoclean.xml b/gcwrap/tasks/autoclean.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 362e2db..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/autoclean.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,795 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - CLEAN an image with automatically-chosen clean regions. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Form images from visibilities. Handles continuum and spectral build 12-Sep-2018 15:30:25 - line cubes. Automatically choose size/shape/position of clean regions. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of input visibility file build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Pre-name of output images build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Field Name or id build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Spectral windows:channels e.g. \'0~3:3~100\', \'\' is all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Other data selection parameters build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Range of time to select from data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data within uvrange build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data based on antenna/baseline build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Scan number range build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Spectral gridding type (mfs, channel, velocity, frequency) build 12-Sep-2018 15:30:25 - mfs build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mfs build 12-Sep-2018 15:30:25 - channel build 12-Sep-2018 15:30:25 - velocity build 12-Sep-2018 15:30:25 - frequency build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Number of channels (planes) in output image build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - First channel in input to use build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Number of input channels to average build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Spectral interpolation(nearest, linear, cubic) build 12-Sep-2018 15:30:25 - linear build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - nearest build 12-Sep-2018 15:30:25 - linear build 12-Sep-2018 15:30:25 - cubic build 12-Sep-2018 15:30:25 - spline build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Concatenate multiple channels into single final image build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Method of PSF calculation to use during minor cycles build 12-Sep-2018 15:30:25 - clark build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - clark build 12-Sep-2018 15:30:25 - clarkstokes build 12-Sep-2018 15:30:25 - hogbom build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Options: \'csclean\' or \'mosaic\', \' \', uses psfmode build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - csclean build 12-Sep-2018 15:30:25 - mosaic build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - change depth in between of csclean cycle build 12-Sep-2018 15:30:25 - 1.5 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Cycle threshold doubles in this number of iteration build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - x and y image size in pixels. Single value: same for both build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 256256 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - x and y cell size(s). Default unit arcsec. build 12-Sep-2018 15:30:25 - 1.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Image center: direction or field index build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Rest frequency to assign to image (see help) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Stokes params to image (eg I,IV, QU,IQUV); Current autoclean implementation requires Stokes="I". build 12-Sep-2018 15:30:25 - I build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - I build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Weighting of uv (natural, uniform, briggs, ...) build 12-Sep-2018 15:30:25 - natural build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - natural build 12-Sep-2018 15:30:25 - uniform build 12-Sep-2018 15:30:25 - briggs build 12-Sep-2018 15:30:25 - briggsabs build 12-Sep-2018 15:30:25 - radial build 12-Sep-2018 15:30:25 - superuniform build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Briggs robustness parameter build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - -2.0 build 12-Sep-2018 15:30:25 - 2.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - noise parameter for briggs abs mode weighting build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1.0Jy build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - number of pixels for superuniform or briggs weighting build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - use interactive clean (with GUI viewer) build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Initial cleanbox(es), mask image(s), and/or region(s) used in cleaning build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of model image(s) to initialize cleaning build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Apply additional uv tapering of visibilities build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - uv-taper on outer baselines in uv-plane build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - uv-taper in center of uv-plane (not implemented) build 12-Sep-2018 15:30:25 - 1.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Max number of total clean cycles per channel build 12-Sep-2018 15:30:25 - 500 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Clean iterations before adding new clean boxes build 12-Sep-2018 15:30:25 - 100 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Increase npercycle by this factor if no new regions found. build 12-Sep-2018 15:30:25 - 1.5 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Loop gain for cleaning build 12-Sep-2018 15:30:25 - 0.1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Output primary beam-corrected image build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Minimum PB level to use build 12-Sep-2018 15:30:25 - 0.1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Flux level to stop cleaning. Must include units. build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Threshold to stop cleaning: current rms * Nrms build 12-Sep-2018 15:30:25 - 6 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Stop cleaning if max abs(residual) changes by less than this factor build 12-Sep-2018 15:30:25 - 0.01 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - If True, use absolute value of residual to test for clean convergence. build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Stop cleaning if max abs(residual) increases this many times (set to -1 to ignore) build 12-Sep-2018 15:30:25 - 3 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Threshold for islands when finding clean regions: current rms * island_rms build 12-Sep-2018 15:30:25 - 4 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Count diagonal connection as same island? build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Threshold to add new clean box: peak in island must be at least current rms * peak_rms build 12-Sep-2018 15:30:25 - 6 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Threshold to add new clean box: peak in island must be at least current max residual * gain_threshold build 12-Sep-2018 15:30:25 - 0.1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Max number of new clean regions to add in each iteration. build 12-Sep-2018 15:30:25 - 3 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Shape of clean regions: 0 for circles, 1 for boxes, 2 for both. build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - 3 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Increase clean region size by this many pixels beyond island size. build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - 6 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - For regions this large (in pixels), use irregular clean region. build 12-Sep-2018 15:30:25 - 100 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - First channel to use (0=first channel specified in spw) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - linear build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - 0.0km/s build 12-Sep-2018 15:30:25 - Velocity of first image channel: e.g \'0.0km/s\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1km/s build 12-Sep-2018 15:30:25 - image channel width in velocity units: e.g \'1.0km/s\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - linear build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - 1.4GHz build 12-Sep-2018 15:30:25 - Frequency of first image channel: e.q. \'1.4GHz\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 10kHz build 12-Sep-2018 15:30:25 - Image channel width in frequency units: e.g \'1.0kHz\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - linear build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - number of pixels to determine uv-cell size 0=> field of view build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - 1.0Jy build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - number of pixels to determine uv-cell size 0=> field of view build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - number of pixels to determine uv-cell size 0=> +/-3pixels build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1.5 build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - This is a wrapper for clean which includes automatic clean boxing. build 12-Sep-2018 15:30:25 - Current capabilities include: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1) Multi-frequency-continuum images or spectral channel imaging build 12-Sep-2018 15:30:25 - 2) Stokes I imaging only build 12-Sep-2018 15:30:25 - 3) Use starting mask build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file build 12-Sep-2018 15:30:25 - default: none; example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - imagename -- Pre-name of output images: build 12-Sep-2018 15:30:25 - default: none; example: imagename='m2' build 12-Sep-2018 15:30:25 - output images are: build 12-Sep-2018 15:30:25 - m2.image; cleaned and restored image build 12-Sep-2018 15:30:25 - With or without primary beam correction build 12-Sep-2018 15:30:25 - m2.psf; point-spread function (dirty beam) build 12-Sep-2018 15:30:25 - m2.flux; relative sky sensitivity over field build 12-Sep-2018 15:30:25 - m2.mask; total clean regions build 12-Sep-2018 15:30:25 - m2.model; image of clean components build 12-Sep-2018 15:30:25 - m2.residual; image of residuals build 12-Sep-2018 15:30:25 - field -- Select fields in mosaic. Use field id(s) or field name(s). build 12-Sep-2018 15:30:25 - ['go listobs' to obtain the list id's or names] build 12-Sep-2018 15:30:25 - default: ''= all fields build 12-Sep-2018 15:30:25 - If field string is a non-negative integer, it is assumed to build 12-Sep-2018 15:30:25 - be a field index otherwise, it is assumed to be a build 12-Sep-2018 15:30:25 - field name build 12-Sep-2018 15:30:25 - field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 - field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 - field='3C286,3C295'; field named 3C286 and 3C295 build 12-Sep-2018 15:30:25 - field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 - spw -- Select spectral window/channels build 12-Sep-2018 15:30:25 - NOTE: This selects the data passed as the INPUT to mode build 12-Sep-2018 15:30:25 - default: ''=all spectral windows and channels build 12-Sep-2018 15:30:25 - spw='0~2,4'; spectral windows 0,1,2,4 (all channels) build 12-Sep-2018 15:30:25 - spw='0:5~61'; spw 0, channels 5 to 61 build 12-Sep-2018 15:30:25 - spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 - spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, build 12-Sep-2018 15:30:25 - channels 3 to 45. build 12-Sep-2018 15:30:25 - spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. build 12-Sep-2018 15:30:25 - spw='0:0~10;15~60'; spectral window 0 with channels build 12-Sep-2018 15:30:25 - 0-10,15-60 build 12-Sep-2018 15:30:25 - spw='0:0~10,1:20~30,2:1;2;3'; spw 0, channels 0-10, build 12-Sep-2018 15:30:25 - spw 1, channels 20-30, and spw 2, channels, 1,2 and 3 build 12-Sep-2018 15:30:25 - selectdata -- Other data selection parameters build 12-Sep-2018 15:30:25 - default: True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - >>> selectdata=True expandable parameters build 12-Sep-2018 15:30:25 - See help par.selectdata for more on these build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - timerange -- Select data based on time range: build 12-Sep-2018 15:30:25 - default: '' (all); examples, build 12-Sep-2018 15:30:25 - timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss' build 12-Sep-2018 15:30:25 - Note: if YYYY/MM/DD is missing date defaults to first build 12-Sep-2018 15:30:25 - day in data set build 12-Sep-2018 15:30:25 - timerange='09:14:0~09:54:0' picks 40 min on first day build 12-Sep-2018 15:30:25 - timerange='25:00:00~27:30:00' picks 1 hr to 3 hr build 12-Sep-2018 15:30:25 - 30min on NEXT day build 12-Sep-2018 15:30:25 - timerange='09:44:00' pick data within one integration build 12-Sep-2018 15:30:25 - of time build 12-Sep-2018 15:30:25 - timerange='>10:24:00' data after this time build 12-Sep-2018 15:30:25 - uvrange -- Select data within uvrange (default units meters) build 12-Sep-2018 15:30:25 - default: '' (all); example: build 12-Sep-2018 15:30:25 - uvrange='0~1000klambda'; uvrange from 0-1000 kilo-lambda build 12-Sep-2018 15:30:25 - uvrange='>4klambda';uvranges greater than 4 kilo lambda build 12-Sep-2018 15:30:25 - antenna -- Select data based on antenna/baseline build 12-Sep-2018 15:30:25 - default: '' (all) build 12-Sep-2018 15:30:25 - If antenna string is a non-negative integer, it is build 12-Sep-2018 15:30:25 - assumed to be an antenna index, otherwise, it is build 12-Sep-2018 15:30:25 - considered an antenna name. build 12-Sep-2018 15:30:25 - antenna='5&6'; baseline between antenna index 5 and build 12-Sep-2018 15:30:25 - index 6. build 12-Sep-2018 15:30:25 - antenna='VA05&VA06'; baseline between VLA antenna 5 build 12-Sep-2018 15:30:25 - and 6. build 12-Sep-2018 15:30:25 - antenna='5&6;7&8'; baselines 5-6 and 7-8 build 12-Sep-2018 15:30:25 - antenna='5'; all baselines with antenna index 5 build 12-Sep-2018 15:30:25 - antenna='05'; all baselines with antenna number 05 build 12-Sep-2018 15:30:25 - (VLA old name) build 12-Sep-2018 15:30:25 - antenna='5,6,9'; all baselines with antennas 5,6,9 build 12-Sep-2018 15:30:25 - index numbers build 12-Sep-2018 15:30:25 - scan -- Scan number range. build 12-Sep-2018 15:30:25 - default: '' (all) build 12-Sep-2018 15:30:25 - example: scan='1~5' build 12-Sep-2018 15:30:25 - Check 'go listobs' to insure the scan numbers are in build 12-Sep-2018 15:30:25 - order. build 12-Sep-2018 15:30:25 - mode -- Frequency Specification: build 12-Sep-2018 15:30:25 - NOTE: Channels deselected with spw parameter will contain all build 12-Sep-2018 15:30:25 - zeros. build 12-Sep-2018 15:30:25 - See examples below. build 12-Sep-2018 15:30:25 - default: 'mfs' build 12-Sep-2018 15:30:25 - mode = 'mfs' means produce one image from all build 12-Sep-2018 15:30:25 - specified data. build 12-Sep-2018 15:30:25 - mode = 'channel'; Use with nchan, start, width to specify build 12-Sep-2018 15:30:25 - output image cube. See examples below build 12-Sep-2018 15:30:25 - mode = 'velocity', means channels are specified in build 12-Sep-2018 15:30:25 - velocity. build 12-Sep-2018 15:30:25 - mode = 'frequency', means channels are specified in build 12-Sep-2018 15:30:25 - frequency. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - >>> mode expandable parameters (for modes other than 'mfs') build 12-Sep-2018 15:30:25 - Start, width are given in units of channels, frequency build 12-Sep-2018 15:30:25 - or velocity as indicated by mode (note: only nearest neighbour build 12-Sep-2018 15:30:25 - interpolation is available at this time). build 12-Sep-2018 15:30:25 - nchan -- Number of channels (planes) in output image build 12-Sep-2018 15:30:25 - default: 1; example: nchan=3 build 12-Sep-2018 15:30:25 - start -- Start input channel (relative-0) build 12-Sep-2018 15:30:25 - default=0; example: start=5 build 12-Sep-2018 15:30:25 - width -- Output channel width in units of the input build 12-Sep-2018 15:30:25 - channel width (>1 indicates channel averaging) build 12-Sep-2018 15:30:25 - default=1; example: width=4 build 12-Sep-2018 15:30:25 - interpolation -- Interpolation type of spectral data when gridded on build 12-Sep-2018 15:30:25 - the uv-plane build 12-Sep-2018 15:30:25 - default = 'linear' build 12-Sep-2018 15:30:25 - doconcat -- Tells autoclean to concatenate multiple channel images into build 12-Sep-2018 15:30:25 - single image at the end of its run. (Autoclean makes an image build 12-Sep-2018 15:30:25 - for each channel, and cleans/boxes them one at a time.) build 12-Sep-2018 15:30:25 - default = 'True' build 12-Sep-2018 15:30:25 - examples: build 12-Sep-2018 15:30:25 - spw = '0,1'; mode = 'mfs' build 12-Sep-2018 15:30:25 - will produce one image made from all channels in spw build 12-Sep-2018 15:30:25 - 0 and 1 build 12-Sep-2018 15:30:25 - spw='0:5~28^2'; mode = 'mfs' build 12-Sep-2018 15:30:25 - will produce one image made with channels build 12-Sep-2018 15:30:25 - (5,7,9,...,25,27) build 12-Sep-2018 15:30:25 - spw = '0'; mode = 'channel': nchan=3; start=5; width=4 build 12-Sep-2018 15:30:25 - will produce an image with 3 output planes build 12-Sep-2018 15:30:25 - plane 1 contains data from channels (5+6+7+8) build 12-Sep-2018 15:30:25 - plane 2 contains data from channels (9+10+11+12) build 12-Sep-2018 15:30:25 - plane 3 contains data from channels (13+14+15+16) build 12-Sep-2018 15:30:25 - spw = '0:0~63^3'; mode='channel'; nchan=21; start = 0; build 12-Sep-2018 15:30:25 - width = 1 build 12-Sep-2018 15:30:25 - will produce an image with 20 output planes build 12-Sep-2018 15:30:25 - Plane 1 contains data from channel 0 build 12-Sep-2018 15:30:25 - Plane 2 contains date from channel 2 build 12-Sep-2018 15:30:25 - Plane 21 contains data from channel 61 build 12-Sep-2018 15:30:25 - spw = '0:0~40^2'; mode = 'channel'; nchan = 3; start = build 12-Sep-2018 15:30:25 - 5; width = 4 build 12-Sep-2018 15:30:25 - will produce an image with three output planes build 12-Sep-2018 15:30:25 - plane 1 contains channels (5,7) build 12-Sep-2018 15:30:25 - plane 2 contains channels (13,15) build 12-Sep-2018 15:30:25 - plane 3 contains channels (21,23) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - psfmode -- method of PSF calculation to use during minor cycles: build 12-Sep-2018 15:30:25 - default: 'clark': Options: 'clark','clarkstokes', 'hogbom' build 12-Sep-2018 15:30:25 - 'clark' use smaller beam (faster, usually good enough); build 12-Sep-2018 15:30:25 - for stokes images clean components peaks are searched in the I^2+Q^2+U^2+V^2 domain build 12-Sep-2018 15:30:25 - 'clarkstokes' locate clean components independently in each stokes image build 12-Sep-2018 15:30:25 - 'hogbom' full-width of image (slower, better for poor build 12-Sep-2018 15:30:25 - uv-coverage) build 12-Sep-2018 15:30:25 - Note: psfmode will be used to clean is imagermode = '' build 12-Sep-2018 15:30:25 - imagermode -- Advanced imaging e.g mosaic or Cotton-Schwab clean build 12-Sep-2018 15:30:25 - default: imagermode='': Options: '', 'csclean' build 12-Sep-2018 15:30:25 - default '' => psfmode cleaning algorithm used build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - >>> imagermode='csclean' expandable parameter(s): build 12-Sep-2018 15:30:25 - Image using the Cotton-Schwab algorithm in between major cycles build 12-Sep-2018 15:30:25 - cyclefactor -- Change the threshold at which build 12-Sep-2018 15:30:25 - the deconvolution cycle will stop, degrid build 12-Sep-2018 15:30:25 - and subtract from the visibilities. For build 12-Sep-2018 15:30:25 - poor PSFs, reconcile often (cyclefactor=4 or build 12-Sep-2018 15:30:25 - 5); For good PSFs, use cyclefactor 1.5 to build 12-Sep-2018 15:30:25 - 2.0. Note: threshold = cyclefactor * max build 12-Sep-2018 15:30:25 - sidelobe * max residual. build 12-Sep-2018 15:30:25 - default: 1.5; example: cyclefactor=4 build 12-Sep-2018 15:30:25 - cyclespeedup -- Cycle threshold doubles in this build 12-Sep-2018 15:30:25 - number of iterations default: -1; build 12-Sep-2018 15:30:25 - example: cyclespeedup=3 build 12-Sep-2018 15:30:25 - try cyclespeedup = 50 to speed up cleaning build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imsize -- Image pixel size (x,y). DOES NOT HAVE TO BE A POWER OF 2 build 12-Sep-2018 15:30:25 - default = [256,256]; example: imsize=[350,350] build 12-Sep-2018 15:30:25 - imsize = 500 is equivalent to [500,500] build 12-Sep-2018 15:30:25 - Avoid odd-numbered imsize. build 12-Sep-2018 15:30:25 - cell -- Cell size (x,y) build 12-Sep-2018 15:30:25 - default= '1.0arcsec'; build 12-Sep-2018 15:30:25 - example: cell=['0.5arcsec,'0.5arcsec'] or build 12-Sep-2018 15:30:25 - cell=['1arcmin', '1arcmin'] build 12-Sep-2018 15:30:25 - cell = '1arcsec' is equivalent to ['1arcsec','1arcsec'] build 12-Sep-2018 15:30:25 - NOTE:cell = 2.0 => ['2arcsec', '2arcsec'] build 12-Sep-2018 15:30:25 - phasecenter -- direction measure or fieldid for the mosaic center build 12-Sep-2018 15:30:25 - default: '' => first field selected ; example: phasecenter=6 build 12-Sep-2018 15:30:25 - or phasecenter='J2000 19h30m00 -40d00m00' build 12-Sep-2018 15:30:25 - restfreq -- Specify rest frequency to use for output image build 12-Sep-2018 15:30:25 - default='' Occasionally it is necessary to set this (for build 12-Sep-2018 15:30:25 - example some VLA spectral line data). For example for build 12-Sep-2018 15:30:25 - NH_3 (1,1) put restfreq='23.694496GHz' build 12-Sep-2018 15:30:25 - stokes -- Stokes parameters to image build 12-Sep-2018 15:30:25 - default='I'; example: stokes='IQUV'; build 12-Sep-2018 15:30:25 - Options: 'I','IV''QU','IQUV','RR','LL','XX','YY','RRLL','XXYY' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - weighting -- Weighting to apply to visibilities: build 12-Sep-2018 15:30:25 - default='natural'; example: weighting='uniform'; build 12-Sep-2018 15:30:25 - Options: 'natural','uniform','briggs', build 12-Sep-2018 15:30:25 - 'superuniform','briggsabs','radial' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - >>> Weighting expandable parameters build 12-Sep-2018 15:30:25 - For weighting='briggs' and 'briggsabs' build 12-Sep-2018 15:30:25 - robust -- Brigg's robustness parameter build 12-Sep-2018 15:30:25 - default=0.0; example: robust=0.5; build 12-Sep-2018 15:30:25 - Options: -2.0 to 2.0; -2 (uniform)/+2 (natural) build 12-Sep-2018 15:30:25 - For weighting='briggsabs' build 12-Sep-2018 15:30:25 - noise -- noise parameter to use for Briggs "abs" build 12-Sep-2018 15:30:25 - weighting build 12-Sep-2018 15:30:25 - example noise='1.0mJy' build 12-Sep-2018 15:30:25 - npixels -- uv-cell area used for weight calculation build 12-Sep-2018 15:30:25 - example npixels=1 build 12-Sep-2018 15:30:25 - Default = 0 build 12-Sep-2018 15:30:25 - superuniform: 0 Means 3x3 cells for weighting build 12-Sep-2018 15:30:25 - the cell weight is proportional to the weight of build 12-Sep-2018 15:30:25 - the 3x3 cells centered on it. build 12-Sep-2018 15:30:25 - superuniform = F means 1x1 cell for averaging weights. build 12-Sep-2018 15:30:25 - briggs/briggsabs: 0 is similar to 1x1 cell weight. build 12-Sep-2018 15:30:25 - 1 may? be similar to 3X3 cells. build 12-Sep-2018 15:30:25 - Only npixels 0 or 1 recommended build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mask -- Initial specification of cleanbox(es), mask image(s), and/or build 12-Sep-2018 15:30:25 - region(s) to be used for CLEANing. For channel data (image cubes), build 12-Sep-2018 15:30:25 - any initial mask will be applied to every channel. mask default: build 12-Sep-2018 15:30:25 - [] (no masking); Possible specification types: (a) Explicit build 12-Sep-2018 15:30:25 - cleanbox pixel ranges example: mask=[110,110,150,145] clean build 12-Sep-2018 15:30:25 - region with blc=110,100; trc=150,145 (pixel values) (b) build 12-Sep-2018 15:30:25 - Filename with cleanbox pixel values with ascii format: build 12-Sep-2018 15:30:25 - example: mask='mycleanbox.txt' <fieldid blc-x blc-y build 12-Sep-2018 15:30:25 - trc-x trc-y> on each line build 12-Sep-2018 15:30:25 - 1 45 66 123 124 build 12-Sep-2018 15:30:25 - 2 23 100 300 340 build 12-Sep-2018 15:30:25 - (c) Filename for image mask example: mask='myimage.mask' build 12-Sep-2018 15:30:25 - (d) Filename for region specification (e.g. from viewer) build 12-Sep-2018 15:30:25 - example: mask='myregion.rgn' (e) Combinations of any of the build 12-Sep-2018 15:30:25 - above example: mask=[[110,110,150,145],'mycleanbox.txt', build 12-Sep-2018 15:30:25 - 'myimage.mask','myregion.rgn'] build 12-Sep-2018 15:30:25 - If include outlier fields, then mask need to be spefied in build 12-Sep-2018 15:30:25 - nested lists: e.g. mask=[[[110,110,150,145],'myimage.mask'],[],[20,20,40,40]] build 12-Sep-2018 15:30:25 - (A clean box with [110,110,150,145] and a image mask for main field, build 12-Sep-2018 15:30:25 - no mask for 1st outlier field, 1 clean box for second outlier field.) build 12-Sep-2018 15:30:25 - modelimage -- Name of model image(s) to initialize cleaning. If build 12-Sep-2018 15:30:25 - multiple images, then these will be added together to build 12-Sep-2018 15:30:25 - form initial starting model NOTE: these are in addition build 12-Sep-2018 15:30:25 - to any initial model in the <imagename>.model image file build 12-Sep-2018 15:30:25 - default: '' (none); example: modelimage='orion.model' build 12-Sep-2018 15:30:25 - modelimage=['orion.model','sdorion.image'] Note: if the build 12-Sep-2018 15:30:25 - units in the image are Jy/beam as in a single-dish build 12-Sep-2018 15:30:25 - image, then it will be converted to Jy/pixel as in a build 12-Sep-2018 15:30:25 - model image, using the restoring beam in the image build 12-Sep-2018 15:30:25 - header build 12-Sep-2018 15:30:25 - >>> uvtaper=True expandable parameters build 12-Sep-2018 15:30:25 - outertaper -- uv-taper on outer baselines in uv-plane build 12-Sep-2018 15:30:25 - [bmaj, bmin, bpa] taper Gaussian scale in uv or build 12-Sep-2018 15:30:25 - angular units. NOTE: uv taper in (klambda) is roughly on-sky build 12-Sep-2018 15:30:25 - FWHM(arcsec/200) build 12-Sep-2018 15:30:25 - default: outertaper=[]; no outer taper applied build 12-Sep-2018 15:30:25 - example: outertaper=['5klambda'] circular taper build 12-Sep-2018 15:30:25 - FWHM=5 kilo-lambda build 12-Sep-2018 15:30:25 - outertaper=['5klambda','3klambda','45.0deg'] build 12-Sep-2018 15:30:25 - outertaper=['10arcsec'] on-sky FWHM 10" build 12-Sep-2018 15:30:25 - outertaper=['300.0'] default units are meters build 12-Sep-2018 15:30:25 - in aperture plane build 12-Sep-2018 15:30:25 - innertaper -- uv-taper in center of uv-plane build 12-Sep-2018 15:30:25 - [bmaj,bmin,bpa] Gaussian scale at which taper falls to build 12-Sep-2018 15:30:25 - zero at uv=0 build 12-Sep-2018 15:30:25 - default: innertaper=[]; no inner taper applied build 12-Sep-2018 15:30:25 - NOT YET IMPLEMENTED build 12-Sep-2018 15:30:25 - niter -- Maximum number iterations over all clean iterations. build 12-Sep-2018 15:30:25 - default: 500; example: niter=5000 build 12-Sep-2018 15:30:25 - npercycle -- Number of clean minor cycles before making new clean region build 12-Sep-2018 15:30:25 - selection. build 12-Sep-2018 15:30:25 - default: 100; example: npercycle = 100 build 12-Sep-2018 15:30:25 - npercycle_speedup: If no new clean regions found during an iteration of build 12-Sep-2018 15:30:25 - clean region selections, increase npercycle by this factor. build 12-Sep-2018 15:30:25 - (Npercycle returns to initial value if new clean regions are later build 12-Sep-2018 15:30:25 - found.) build 12-Sep-2018 15:30:25 - default: 1.5; example: npercycle_speedup = 2 build 12-Sep-2018 15:30:25 - gain -- Loop gain for CLEANing build 12-Sep-2018 15:30:25 - default: 0.1; example: gain=0.5 build 12-Sep-2018 15:30:25 - pbcor -- Output primary beam-corrected image build 12-Sep-2018 15:30:25 - default: pbcor=False; output un-corrected image build 12-Sep-2018 15:30:25 - example: pbcor=True; output pb-corrected image (masked outside build 12-Sep-2018 15:30:25 - minpb) Note: if you set pbcor=False, you can later build 12-Sep-2018 15:30:25 - recover the pbcor image by dividing by the .flux image build 12-Sep-2018 15:30:25 - (e.g. using immath) build 12-Sep-2018 15:30:25 - minpb -- Minimum PB level to use default=0.1; build 12-Sep-2018 15:30:25 - The flux image is used to determine this build 12-Sep-2018 15:30:25 - except for the case of mosaic with ft='mosaic' build 12-Sep-2018 15:30:25 - where the flux.pbcoverage image is used. build 12-Sep-2018 15:30:25 - example: build 12-Sep-2018 15:30:25 - minpb=0.01 Note: this minpb is always in effect build 12-Sep-2018 15:30:25 - (regardless of pbcor=True/False) build 12-Sep-2018 15:30:25 - clean_threshold -- Flux level at which to stop CLEANing build 12-Sep-2018 15:30:25 - default: '0.0mJy'; build 12-Sep-2018 15:30:25 - example: threshold='2.3mJy' (always include units) build 12-Sep-2018 15:30:25 - threshold = '0.0023Jy' build 12-Sep-2018 15:30:25 - threshold = '0.0023Jy/beam' (okay also) build 12-Sep-2018 15:30:25 - Nrms -- Stop cleaning when maximum residual is below this value times build 12-Sep-2018 15:30:25 - the current rms (outside the current clean regions). build 12-Sep-2018 15:30:25 - default: 6 build 12-Sep-2018 15:30:25 - example: Nrms=4 build 12-Sep-2018 15:30:25 - eps_maxres -- Convergence parameter to stop cleaning: stop if maximum build 12-Sep-2018 15:30:25 - residual has changed by less than a factor of eps_maxres. build 12-Sep-2018 15:30:25 - default: 0.01 (one per cent change) build 12-Sep-2018 15:30:25 - example: eps_maxres = 0.05 build 12-Sep-2018 15:30:25 - allow_maxres_inc -- Parameter to stop cleaning: stop if maximum residual build 12-Sep-2018 15:30:25 - has increased between clean iterations this number of times. build 12-Sep-2018 15:30:25 - default: 3 build 12-Sep-2018 15:30:25 - example: allow_maxres_inc = 2 build 12-Sep-2018 15:30:25 - island_rms: threshold (this value times current rms) at which to box the build 12-Sep-2018 15:30:25 - residual image when searching for new clean regions build 12-Sep-2018 15:30:25 - default: 4 build 12-Sep-2018 15:30:25 - example: island_rms = 3 build 12-Sep-2018 15:30:25 - diag: T/F switch to declare if pixels connected on the diagonal belong build 12-Sep-2018 15:30:25 - to the same island, when selecting pixels for clean boxing build 12-Sep-2018 15:30:25 - default: False build 12-Sep-2018 15:30:25 - example: diag = True build 12-Sep-2018 15:30:25 - peak_rms: threshold (this value times current rms) for peak pixel flux build 12-Sep-2018 15:30:25 - to qualify an island for clean boxing build 12-Sep-2018 15:30:25 - default: 6 build 12-Sep-2018 15:30:25 - example: peak_rms = 5 build 12-Sep-2018 15:30:25 - gain_threshold: threshold (this value times current maximum residual) of build 12-Sep-2018 15:30:25 - peak pixel in island to qualify island for clean boxing. build 12-Sep-2018 15:30:25 - default: 0.1 build 12-Sep-2018 15:30:25 - example: gain_threshold = 0.5 build 12-Sep-2018 15:30:25 - Npeak: maximum number of new clean regions to add each iteration build 12-Sep-2018 15:30:25 - default: 3 build 12-Sep-2018 15:30:25 - example: Npeak = 5 build 12-Sep-2018 15:30:25 - shape: parameter to determine shape of clean regions. build 12-Sep-2018 15:30:25 - 0: all circles build 12-Sep-2018 15:30:25 - 1: all boxes build 12-Sep-2018 15:30:25 - 2: choose according to island shape (circles if island has similar build 12-Sep-2018 15:30:25 - dimension in x and y direction, box otherwise) build 12-Sep-2018 15:30:25 - default: 1 build 12-Sep-2018 15:30:25 - example: shape=2 build 12-Sep-2018 15:30:25 - boxstretch: number of pixels to increase outward size of clean region, build 12-Sep-2018 15:30:25 - can range from -1 to 5. build 12-Sep-2018 15:30:25 - default: 1 build 12-Sep-2018 15:30:25 - example: boxstretch = 3 build 12-Sep-2018 15:30:25 - irregsize: for islands this large (dimension in pixels) or larger, fill build 12-Sep-2018 15:30:25 - in mask with island's actual shape rather than using a box or build 12-Sep-2018 15:30:25 - circle. Set to 0 to ignore this parameter. build 12-Sep-2018 15:30:25 - default: 100 build 12-Sep-2018 15:30:25 - example: irregsize = 50 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/boxit.xml b/gcwrap/tasks/boxit.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index d8a3dfe..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/boxit.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,121 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Box regions in image above given threshold value. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Returns a list of boxes, one for each contiguous set of pixels build 12-Sep-2018 15:30:25 - above the threshold value. If given "regionfile", outputs boxes in build 12-Sep-2018 15:30:25 - regionfile+'.rgn' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of image to threshold build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Output region file build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Threshold value. Must include units. build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Output mask name (optional). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Range of channel ids build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Range of polarization ids build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Minimum number of pixels for a boxable island build 12-Sep-2018 15:30:25 - 2 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Count diagonal connections? build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Increase box sizes by this many pixels beyond thresholded pixels. build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - 6 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Overwrite existing region file? build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - This tool finds all 2-dimensional (RA/dec) regions in the given build 12-Sep-2018 15:30:25 - 4D (only!) image which are contiguous sets of pixels (islands) above the given ] build 12-Sep-2018 15:30:25 - threshold. It creates a box for each island, a rectangular "cutout". build 12-Sep-2018 15:30:25 - The boxes are stored as regions in the output regionfile. Works on build 12-Sep-2018 15:30:25 - multi-plane images, but only boxes 2-D regions in each plane. build 12-Sep-2018 15:30:25 - (Doesn't create cubes/3D boxes.) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - NOTE: THIS TASK WILL NOT WORK ON IMAGES THAT DO NOT HAVE 4 DIMENSIONS WHICH INCLUDE build 12-Sep-2018 15:30:25 - A DIRECTION COORDINATE, A SPECTRAL COORDINATE, AND A STOKES COORDINATE. If your image build 12-Sep-2018 15:30:25 - has, eg just a direction coordinate, you can add the required axes using ia.adddegaxes() build 12-Sep-2018 15:30:25 - and remove them post-run with imsubimage with dropdeg=T. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imagename -- Name of input images: build 12-Sep-2018 15:30:25 - default: none; example: imagename='myimage.image' build 12-Sep-2018 15:30:25 - regionfile -- Name of output region file (adds extension .rgn). build 12-Sep-2018 15:30:25 - default: none; if not given uses imagename+'.rgn' build 12-Sep-2018 15:30:25 - threshold -- value (with units) to use for island threshold. build 12-Sep-2018 15:30:25 - default: 0.0. build 12-Sep-2018 15:30:25 - maskname -- Optional output mask name. build 12-Sep-2018 15:30:25 - default: '' (do not write mask image) build 12-Sep-2018 15:30:25 - chanrange -- Range of channel ids build 12-Sep-2018 15:30:25 - default: '' (find boxes for all channels) build 12-Sep-2018 15:30:25 - example: '5~7' (find boxes for channel 5,6,7 build 12-Sep-2018 15:30:25 - polrange -- Range of polarization ids build 12-Sep-2018 15:30:25 - default: '' (find boxes for all polarizations) build 12-Sep-2018 15:30:25 - example: '0~1' (find boxes for polarization 0,1 build 12-Sep-2018 15:30:25 - minsize -- minimum size of island to get a box (in number of pixels) build 12-Sep-2018 15:30:25 - default: 2 build 12-Sep-2018 15:30:25 - diag -- count diagonal connections as same island or not build 12-Sep-2018 15:30:25 - default: False build 12-Sep-2018 15:30:25 - boxstretch -- number of pixels to increase outward size of each box; can build 12-Sep-2018 15:30:25 - range from -1 to 5. build 12-Sep-2018 15:30:25 - default: 1 build 12-Sep-2018 15:30:25 - overwrite -- Overwrite existing region file and/or mask? build 12-Sep-2018 15:30:25 - default: False. If False, gives warning if file exists. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/clearplot.xml b/gcwrap/tasks/clearplot.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index ace6c48..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/clearplot.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,31 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Clear the matplotlib plotter and all layers build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -Run the task clearplot when you want to clear completely the matplotlib, but keep build 12-Sep-2018 15:30:25 -it available for additional plotting. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -Typing 'go clearplot()' will not change the current task being scrutinized build 12-Sep-2018 15:30:25 -Typing 'clearplot() will change the current task assignment to clearplot build 12-Sep-2018 15:30:25 - which is generally not what is desired. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/csvclean.xml b/gcwrap/tasks/csvclean.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 74df933..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/csvclean.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,246 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - This task does an invert of the visibilities and deconvolve in the image plane. build 12-Sep-2018 15:30:25 - This task does an invert of the visibilities and deconvolve in the build 12-Sep-2018 15:30:25 - image plane. It does not do a uvdata subtraction (aka Cotton-Schwab build 12-Sep-2018 15:30:25 - major cycle) of model visibility as in clean. - For ALMA Commissioning build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of input visibility file build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of image build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select field using field id(s) or field name(s) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select spectral window/channels build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Boolean to determine if advice on image cell is requested build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - define the mode to operate csvclean: option continuum, cube build 12-Sep-2018 15:30:25 - continuum build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - continuum build 12-Sep-2018 15:30:25 - cube build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Number of channels (planes) in output image; -1 = all build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - width of output spectral channels build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Image size in pixels (nx,ny), symmetric for single value build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 256256 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The image cell size in arcseconds [x,y]. build 12-Sep-2018 15:30:25 - 1.01.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Image center: direction or field index build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Maximum number of iterations build 12-Sep-2018 15:30:25 - 500 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Type of weighting build 12-Sep-2018 15:30:25 - natural build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - natural build 12-Sep-2018 15:30:25 - uniform build 12-Sep-2018 15:30:25 - briggs build 12-Sep-2018 15:30:25 - briggsabs build 12-Sep-2018 15:30:25 - radial build 12-Sep-2018 15:30:25 - superuniform build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Output Gaussian restoring beam for CLEAN image build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Create a mask interactively or not. build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 256256 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1.01.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 500 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - natural build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - This task does not do a uvdata subtraction (aka Cotton-Schwab major cycle) build 12-Sep-2018 15:30:25 - of model visibility as in clean. - For ALMA Commissioning build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file build 12-Sep-2018 15:30:25 - default: none; example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imagename -- Name of output CASA image. (only the prefix) build 12-Sep-2018 15:30:25 - default: none; example: imagename='m2' build 12-Sep-2018 15:30:25 - output images are: build 12-Sep-2018 15:30:25 - m2.image; cleaned and restored image build 12-Sep-2018 15:30:25 - With or without primary beam correction build 12-Sep-2018 15:30:25 - m2dirty.image; dirty image build 12-Sep-2018 15:30:25 - m2psf.image; point-spread function (dirty beam) build 12-Sep-2018 15:30:25 - m2.model; image of clean components build 12-Sep-2018 15:30:25 - m2.mask; image containing clean regions, when interative=True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - field -- Select fields in mosaic. Use field id(s) or field name(s). build 12-Sep-2018 15:30:25 - ['go listobs' to obtain the list id's or names] build 12-Sep-2018 15:30:25 - default: ''= all fields build 12-Sep-2018 15:30:25 - If field string is a non-negative integer, it is assumed to build 12-Sep-2018 15:30:25 - be a field index otherwise, it is assumed to be a build 12-Sep-2018 15:30:25 - field name build 12-Sep-2018 15:30:25 - field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 - field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 - field='3C286,3C295'; field named 3C286 and 3C295 build 12-Sep-2018 15:30:25 - field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - spw -- Select spectral window/channels build 12-Sep-2018 15:30:25 - NOTE: This selects the data passed as the INPUT to mode build 12-Sep-2018 15:30:25 - default: ''= all spectral windows and channels build 12-Sep-2018 15:30:25 - spw='0~2,4'; spectral windows 0,1,2,4 (all channels) build 12-Sep-2018 15:30:25 - spw='0:5~61'; spw 0, channels 5 to 61 build 12-Sep-2018 15:30:25 - spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 - spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, build 12-Sep-2018 15:30:25 - channels 3 to 45. build 12-Sep-2018 15:30:25 - spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. build 12-Sep-2018 15:30:25 - spw='0:0~10;15~60'; spectral window 0 with channels build 12-Sep-2018 15:30:25 - 0-10,15-60 build 12-Sep-2018 15:30:25 - spw='0:0~10,1:20~30,2:1;2;3'; spw 0, channels 0-10, build 12-Sep-2018 15:30:25 - spw 1, channels 20-30, and spw 2, channels, 1,2 and 3 build 12-Sep-2018 15:30:25 - advise -- This determines whether advice for imsize and cell is build 12-Sep-2018 15:30:25 - requested. If set to True. It won't run clean but return build 12-Sep-2018 15:30:25 - values for imszise and cell estimated for the longest build 12-Sep-2018 15:30:25 - baseline in the data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imsize -- Image pixel size (x,y). DOES NOT HAVE TO BE A POWER OF 2 build 12-Sep-2018 15:30:25 - default = [256,256]; example: imsize=[350,350] build 12-Sep-2018 15:30:25 - imsize = 500 is equivalent to [500,500]. build 12-Sep-2018 15:30:25 - Avoid odd-numbered imsize. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - cell -- Cell size (x,y) build 12-Sep-2018 15:30:25 - default= '1.0arcsec'; build 12-Sep-2018 15:30:25 - example: cell=['0.5arcsec,'0.5arcsec'] or build 12-Sep-2018 15:30:25 - cell=['1arcmin', '1arcmin'] build 12-Sep-2018 15:30:25 - cell = '1arcsec' is equivalent to ['1arcsec','1arcsec'] build 12-Sep-2018 15:30:25 - NOTE:cell = 2.0 => ['2arcsec', '2arcsec'] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - phasecenter -- direction measure or fieldid for the mosaic center build 12-Sep-2018 15:30:25 - default: '' => first field selected ; example: phasecenter=6 build 12-Sep-2018 15:30:25 - or phasecenter='J2000 19h30m00 -40d00m00' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mode -- this determines what kind of image to make build 12-Sep-2018 15:30:25 - continuum or cube. In continuum all the selected data build 12-Sep-2018 15:30:25 - channels are combined in a 1 channel image using build 12-Sep-2018 15:30:25 - multifrequency synthesis. build 12-Sep-2018 15:30:25 - options are 'cube' and 'continuum' build 12-Sep-2018 15:30:25 - default: 'continuum' build 12-Sep-2018 15:30:25 - >>> mode='cube' expandable parameters build 12-Sep-2018 15:30:25 - nchan -- sets the number of channel in the output build 12-Sep-2018 15:30:25 - image. e.g nchan=10 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - width -- image channel width in terms of the number of build 12-Sep-2018 15:30:25 - channel of the first spw of the data selected build 12-Sep-2018 15:30:25 - e.g width=2 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - niter -- Maximum number of iterations, build 12-Sep-2018 15:30:25 - if niter=0, then no CLEANing is done ("invert" only) build 12-Sep-2018 15:30:25 - default: 500; example: niter=5000 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - weighting -- Weighting to apply to visibilities: build 12-Sep-2018 15:30:25 - default='natural'; example: weighting='uniform'; build 12-Sep-2018 15:30:25 - Options: 'natural','uniform','briggs', build 12-Sep-2018 15:30:25 - 'superuniform','briggsabs','radial' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - restoringbeam -- Output Gaussian restoring beam for CLEAN image build 12-Sep-2018 15:30:25 - [bmaj, bmin, bpa] elliptical Gaussian restoring beam. build 12-Sep-2018 15:30:25 - Default units are in arc-seconds for bmaj and bmin, and in degrees build 12-Sep-2018 15:30:25 - for bpa. Default: restoringbeam=[]; Use PSF calculated build 12-Sep-2018 15:30:25 - from dirty beam. build 12-Sep-2018 15:30:25 - example: restoringbeam=['10arcsec'] or restorinbeam='10arcsec', circular Gaussian. build 12-Sep-2018 15:30:25 - FWHM 10 arcseconds example: build 12-Sep-2018 15:30:25 - restoringbeam=['10.0','5.0','45.0deg'] 10"x5" build 12-Sep-2018 15:30:25 - at 45 degrees build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - interactive -- Create a mask interactively or not. build 12-Sep-2018 15:30:25 - default=False; example: interactive=True build 12-Sep-2018 15:30:25 - The viewer will open with the image displayed. Select the build 12-Sep-2018 15:30:25 - region for the mask and double click in the middle of it. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/fixvis.xml b/gcwrap/tasks/fixvis.xml build 12-Sep-2018 15:30:25 index 539f25c..9aca687 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/fixvis.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/fixvis.xml build 12-Sep-2018 15:30:25 @@ -24,7 +24,7 @@ Recalculates (u, v, w) and/or changes Phase Center build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Name of the output visibility set. (Can be the same as vis.) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - vis='ngc5921\_fixedvis.ms' build 12-Sep-2018 15:30:25 + vis='ngc5921fixedvis.ms' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Fields to operate on. '' = all. build 12-Sep-2018 15:30:25 @@ -62,34 +62,34 @@ Recalculates (u, v, w) and/or changes Phase Center build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -If the phase center is changed, the corresponding modifications are applied to the build 12-Sep-2018 15:30:25 -visibility columns given by the parameter "datacolumn" which is by default set build 12-Sep-2018 15:30:25 +If the phase center is changed, the corresponding modifications are applied to the build 12-Sep-2018 15:30:25 +visibility columns given by the parameter "datacolumn" which is by default set build 12-Sep-2018 15:30:25 to "all" (DATA, CORRECTED, and MODEL). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Input Parameters build 12-Sep-2018 15:30:25 vis -- Name of the input visibility set build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 outputvis -- Name of the output visibility set, default: same as vis build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 field -- field selection string build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - refcode -- Reference frame to convert to, default: the refcode of PHASE_DIR in the build 12-Sep-2018 15:30:25 + refcode -- Reference frame to convert to, default: the refcode of PHASE_DIR in the build 12-Sep-2018 15:30:25 FIELD table build 12-Sep-2018 15:30:25 example: 'B1950' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 reuse -- base recalculation on existing UVW coordinates? default=True build 12-Sep-2018 15:30:25 ignored if parameter 'phasecenter' is set build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - phasecenter -- if set to a valid direction: change the phase center for the given build 12-Sep-2018 15:30:25 + phasecenter -- if set to a valid direction: change the phase center for the given build 12-Sep-2018 15:30:25 field to this value build 12-Sep-2018 15:30:25 example: 'J2000 9h25m00s -05d12m00s' build 12-Sep-2018 15:30:25 If given without the equinox, e.g. '0h01m00s +00d12m00s', the parameter build 12-Sep-2018 15:30:25 - is interpreted as a pair of offsets in RA and DEC to the present build 12-Sep-2018 15:30:25 - phasecenter. build 12-Sep-2018 15:30:25 - NOTE: The RA offset can be given in units of time or angle. If given build 12-Sep-2018 15:30:25 + is interpreted as a pair of offsets in RA and DEC to the present build 12-Sep-2018 15:30:25 + phasecenter. build 12-Sep-2018 15:30:25 + NOTE: The RA offset can be given in units of time or angle. If given build 12-Sep-2018 15:30:25 as a time (i.e. as a single number with a time unit as in, e.g., 12s build 12-Sep-2018 15:30:25 - or in the XXhXXmXXs or XX:XX:XX.XXX formats), it is applied as is. build 12-Sep-2018 15:30:25 - If given as an angle (e.g., 0.01deg), it is divided by the cos(DEC) build 12-Sep-2018 15:30:25 + or in the XXhXXmXXs or XX:XX:XX.XXX formats), it is applied as is. build 12-Sep-2018 15:30:25 + If given as an angle (e.g., 0.01deg), it is divided by the cos(DEC) build 12-Sep-2018 15:30:25 before it is applied. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 distances -- (experimental) List of the distances (as quanta) of the fields selected by field build 12-Sep-2018 15:30:25 @@ -100,11 +100,11 @@ to "all" (DATA, CORRECTED, and MODEL). build 12-Sep-2018 15:30:25 default: [] build 12-Sep-2018 15:30:25 examples: ['2E6km', '3E6km'] '15au' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - datacolumn -- when applying a phase center shift, modify visibilities only in build 12-Sep-2018 15:30:25 + datacolumn -- when applying a phase center shift, modify visibilities only in build 12-Sep-2018 15:30:25 this/these column(s) build 12-Sep-2018 15:30:25 default: 'all' (DATA, CORRECTED, and MODEL) build 12-Sep-2018 15:30:25 example: 'DATA,CORRECTED' (will not modify MODEL) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Examples: build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 fixvis('NGC3256.ms','NGC3256-fixed.ms') build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/fringefit.xml b/gcwrap/tasks/fringefit.xml build 12-Sep-2018 15:30:25 index f9b7e48..436004c 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/fringefit.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/fringefit.xml build 12-Sep-2018 15:30:25 @@ -5,7 +5,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" build 12-Sep-2018 15:30:25 xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd build 12-Sep-2018 15:30:25 file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Fringe fit delay and rates build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Phase offsets, groups delays and delay rates are calculated with build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/imcollapse.xml b/gcwrap/tasks/imcollapse.xml build 12-Sep-2018 15:30:25 index be24296..53eb112 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/imcollapse.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/imcollapse.xml build 12-Sep-2018 15:30:25 @@ -42,7 +42,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 box="100,100,200,200" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Region selection. Default is to use the full image. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 region="my.rgn" build 12-Sep-2018 15:30:25 @@ -78,13 +78,6 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - "" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/importasap.xml b/gcwrap/tasks/importasap.xml build 12-Sep-2018 15:30:25 index d915eb2..0c22e5e 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/importasap.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/importasap.xml build 12-Sep-2018 15:30:25 @@ -6,7 +6,7 @@ xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd build 12-Sep-2018 15:30:25 file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Convert ASAP Scantable data into a CASA visibility file (MS) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -41,7 +41,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Keyword arguments: build 12-Sep-2018 15:30:25 asdm -- Name of input ASAP Scantable data build 12-Sep-2018 15:30:25 default: none; example: asdm='mydata.asap' build 12-Sep-2018 15:30:25 @@ -49,12 +49,12 @@ asdm -- Name of input ASAP Scantable data build 12-Sep-2018 15:30:25 outputvis -- Root ms name. Note that a prefix (.ms) is NOT appended to this name. build 12-Sep-2018 15:30:25 default: none; example outputvis='myms.ms' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -flagbackup -- Backup original flags in >ms<.flagversions build 12-Sep-2018 15:30:25 +flagbackup -- Backup original flags in >ms<.flagversions build 12-Sep-2018 15:30:25 default: True build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 overwrite -- overwrite an existing MS build 12-Sep-2018 15:30:25 default: False (do not overwrite) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 parallel -- Turn on parallel execution build 12-Sep-2018 15:30:25 default: False (serial execution) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/importevla.xml b/gcwrap/tasks/importevla.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 6c2af08..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/importevla.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,342 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Convert an Science Data Model observation into a CASA Measurement Set build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of input asdm directory (on disk) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Root name of the ms to be created. Note the .ms is NOT added build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Fill correlation mode AUTO_ONLY (ao), CROSS_ONLY (co) or CROSS_AND_AUTO (ca) build 12-Sep-2018 15:30:25 - co build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - co build 12-Sep-2018 15:30:25 - ao build 12-Sep-2018 15:30:25 - ca build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Flag for turning on data compression build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Create verbatim copies of these SDM tables in the MS. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - List of scans to fill (default is all scans). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Output lots of information while the filler is working build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Over write an existing MS build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Create online flags build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Time padding buffer (in seconds) build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Create flag commands for zero points build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Create flag commands for cross-hand correlations build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Create flag commands for shadowed data build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Amount of shadow allowed (in meters) build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - File name or dictionary with additional antenna names, positions and diameters build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Apply flag commands to MS build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Save flag commands to an ASCII file build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of ASCII file to save flag commands build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Back up flag column before applying flags build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Timestep (days) for the tabulation of polynomial ephemerides. A value <= 0 disables tabulation. build 12-Sep-2018 15:30:25 - 0.001 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -Convert a Science Data Model (SDM) dataset into a CASA Measurement Set (MS). build 12-Sep-2018 15:30:25 -Will place online flags and specified clip/shadow flags into FLAG_CMD table build 12-Sep-2018 15:30:25 -and optionally apply to MS. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -Warning: This version is under development and is geared to handling EVLA build 12-Sep-2018 15:30:25 -specific flag and system files, and is otherwise identical to importasdm. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - HISTORY: Task created v1.0 S.T. Myers 2010-03-11 (3.0.1) build 12-Sep-2018 15:30:25 - Last updated v9.0 S.M. Castro 2012-03-13 (3.4) code+doc build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -Keyword arguments: build 12-Sep-2018 15:30:25 -asdm -- Name of input SDM file (directory) build 12-Sep-2018 15:30:25 - default: none; build 12-Sep-2018 15:30:25 - Example: asdm='ExecBlock3' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -vis -- Root ms or scantable name, note a .ms is NOT appended to name build 12-Sep-2018 15:30:25 - default: none build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -ocorr_mode -- output data for correlation mode AUTO_ONLY build 12-Sep-2018 15:30:25 - (ao) or CROSS_ONLY (co) or CROSS_AND_AUTO (ca) build 12-Sep-2018 15:30:25 - default: co (for EVLA) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -compression -- produces comrpressed columns in the resulting measurement set. build 12-Sep-2018 15:30:25 - default: False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -asis -- creates verbatim copies of the ASDM tables in build 12-Sep-2018 15:30:25 - the output measurement set. The value given to build 12-Sep-2018 15:30:25 - this option must be a list of table names separated build 12-Sep-2018 15:30:25 - by space characters; the wildcard character '*' is build 12-Sep-2018 15:30:25 - allowed in table names. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -scans -- processes the scans requested in this parameter (default is build 12-Sep-2018 15:30:25 - all scans). For simplest use provide a comma-separated list of build 12-Sep-2018 15:30:25 - scan ranges, e.g. scans='1~3,5,10~20'. build 12-Sep-2018 15:30:25 - default: '' = all scans build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - NOTE: A scan specification tecnically consists of an ExecBlock build 12-Sep-2018 15:30:25 - index followed by the character ':' followed by a comma build 12-Sep-2018 15:30:25 - separated list of scan indexes or scan index ranges. The EVLA build 12-Sep-2018 15:30:25 - does not currently include more than one ExecBlock in a SDM build 12-Sep-2018 15:30:25 - so this specification prefix is not needed. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - By default all the scans are considered. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -overwrite -- Over write an existing MS build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -verbose -- produce log output as asdm2MS is being run build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -polyephem_tabtimestep -- Timestep (days) for the tabulation of polynomial ephemerides. build 12-Sep-2018 15:30:25 - A value <= 0 disables tabulation. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -EVLA-specific parameters: build 12-Sep-2018 15:30:25 -------------------------- build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -online -- create flagging commands for online flags. The commands will be saved to the FLAG_CMD build 12-Sep-2018 15:30:25 - sub-table of the MS. Optionally, it can also be saved to an ASCII file when savecmds is set build 12-Sep-2018 15:30:25 - to True. build 12-Sep-2018 15:30:25 - default: True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - >>> online expandable parameters build 12-Sep-2018 15:30:25 - tbuff -- (float) time padding buffer (in seconds) build 12-Sep-2018 15:30:25 - default: 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - NOTE: this time is in seconds. You should currently build 12-Sep-2018 15:30:25 - set the value of tbuff to be 1.5x the correlator build 12-Sep-2018 15:30:25 - integration time if greater than 1 second. For build 12-Sep-2018 15:30:25 - example, if the SDM has integrations of 3 seconds, build 12-Sep-2018 15:30:25 - set tbuff=4.5. Likewise, set tbuff=15.0 for 10-sec build 12-Sep-2018 15:30:25 - integrations. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -flagzero -- create flags to clip out visibilities with zero values. The command will be saved to the FLAG_CMD build 12-Sep-2018 15:30:25 - sub-table of the MS. Optionally, it can also be saved to an ASCII file when savecmds is set build 12-Sep-2018 15:30:25 - to True. build 12-Sep-2018 15:30:25 - default: True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - >>> flagzero expandable parameter(s) build 12-Sep-2018 15:30:25 - flagpol -- (boolean) also zero-clip on cross-hands (default=False) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -shadow -- create flags for antennas that are shadowed. The command will be saved to the FLAG_CMD build 12-Sep-2018 15:30:25 - sub-table of the MS. Optionally, it can also be saved to an ASCII file when savecmds is set build 12-Sep-2018 15:30:25 - to True. build 12-Sep-2018 15:30:25 - default: True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - >>> shadow expandable parameter build 12-Sep-2018 15:30:25 - tolerance -- Amount of shadowing allowed in meters. build 12-Sep-2018 15:30:25 - default: 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - addantenna -- It can be either a file name with additional antenna names, positions build 12-Sep-2018 15:30:25 - and diameters, or a Python dictionary with the same information. build 12-Sep-2018 15:30:25 - You can use the flaghelper functions to create the dictionary from a file. build 12-Sep-2018 15:30:25 - default: '' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - To create a dictionary inside casapy. build 12-Sep-2018 15:30:25 - > import flaghelper as fh build 12-Sep-2018 15:30:25 - > antdic = fh.readAntennaList(antfile) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Where antfile is a text file in disk that contains information such as: build 12-Sep-2018 15:30:25 - name=VLA01 build 12-Sep-2018 15:30:25 - diameter=25.0 build 12-Sep-2018 15:30:25 - position=[-1601144.96146691, -5041998.01971858, 3554864.76811967] build 12-Sep-2018 15:30:25 - name=VLA02 build 12-Sep-2018 15:30:25 - diameter=25.0 build 12-Sep-2018 15:30:25 - position=[-1601105.7664601889, -5042022.3917835914, 3554847.245159178] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -applyflags -- apply the online and specified flags to the MS build 12-Sep-2018 15:30:25 - default: False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -savecmds -- Save the flag commands to an ASCII file given by the parameter outfile. It will save the build 12-Sep-2018 15:30:25 - flag commands from online, flagzero and/or shadow if they are set to True. build 12-Sep-2018 15:30:25 - default: False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - >>> savecmds expandable parameter build 12-Sep-2018 15:30:25 - outfile -- Filename where to save the flag commands. build 12-Sep-2018 15:30:25 - default: ' ' --> by default it will save on a filename composed from the MS name. build 12-Sep-2018 15:30:25 - Example: vis='evla.ms', the outfile will be 'evla_cmd.txt'. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - NOTE: The file is open to save in append mode. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -flagbackup -- Backup original flags in >ms<.flagversions build 12-Sep-2018 15:30:25 - default: True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Examples: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1) Produces MS CLowTest_000.ms with autocorrelations. build 12-Sep-2018 15:30:25 - You will find the online, zero, and shadow flags in the FLAG_CMD table build 12-Sep-2018 15:30:25 - for later application. Does not apply any flags. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - importevla(asdm='CLowTest_000',ocorr_mode='ca') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 2) Produces MS CLowTest_000.ms without autocorrelations. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - importevla(asdm='CLowTest_000') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 3) Will apply online flags and uses a more conservative 2sec buffer build 12-Sep-2018 15:30:25 - before the start and after the end timeranges. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - importevla(asdm='CLowTest_000',online=True,tbuff=2.0,applyflags=True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 4) This will create the FLAG_CMD sub-table using online flags only, build 12-Sep-2018 15:30:25 - but will not apply them to the MS. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - importevla(asdm='CLowTest_000',online=True,flagzero=False,shadow=False) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 5) This will write the online flags to the FLAG_CMD table. It will also save commands build 12-Sep-2018 15:30:25 - to clip zeros and to flag shadowed antennas to the table. The commands will be further build 12-Sep-2018 15:30:25 - applied to the data and the APPLIED column of the FLAG_CMD will be updated to True. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - importevla(asdm='CLowTest_000',online=True,flagzero=True,shadow=True,applyflags=True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 6) Import only scans 1, 2, 3, 5, 7, 9, save the online, shadow and clip commands to an ASCII file and build 12-Sep-2018 15:30:25 - do not apply the flags. The commands will be saved to CLowTest_000_cmd.txt. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - importevla(asdm='CLowTest_000',scans='1~3,5,7,9',online=True,flagzero=True,shadow=True, build 12-Sep-2018 15:30:25 - applyflags=False, savecmds=True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - You can use either flagdata or flagcmd to apply the flags later with the following commands: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Apply all the flags in the file using flagdata build 12-Sep-2018 15:30:25 - flagdata('CLowTest_000.ms', mode='list', inpfile='CLowTest_000_cmd.txt') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select by reason on the file build 12-Sep-2018 15:30:25 - flagdata('CLowTest_000.ms',mode='list', inpfile='CLowTest_000_cmd.txt', build 12-Sep-2018 15:30:25 - reason=['ANTENNA_NOT_POINTING','CORRELATOR_DATA_INVALID']) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Apply all the flags in the file using flagcmd build 12-Sep-2018 15:30:25 - flagcmd('CLowTest_000.ms',inpmode='list',inpfile='CLTest_000_cmd.txt',action='apply') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -HISTORY: Task last updated v9.0 S.M. Castro 2012-03-8 (3.4.0) build 12-Sep-2018 15:30:25 - Docs last updated v9.0 S.M. Castro 2012-03-13 (3.4.0) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/importnro.xml b/gcwrap/tasks/importnro.xml build 12-Sep-2018 15:30:25 index 215c153..43a1f9a 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/importnro.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/importnro.xml build 12-Sep-2018 15:30:25 @@ -6,7 +6,7 @@ xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd build 12-Sep-2018 15:30:25 file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Convert NOSTAR data into a CASA visibility file (MS) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -36,7 +36,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Keyword arguments: build 12-Sep-2018 15:30:25 asdm -- Name of input NOSTAR data build 12-Sep-2018 15:30:25 default: none; example: asdm='mydata.Y' build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/imstat.xml b/gcwrap/tasks/imstat.xml build 12-Sep-2018 15:30:25 index 98463c8..e137795 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/imstat.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/imstat.xml build 12-Sep-2018 15:30:25 @@ -26,7 +26,10 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Region selection. Default is to use the full image. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + path build 12-Sep-2018 15:30:25 + string build 12-Sep-2018 15:30:25 + record build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Rectangular region(s) to select in direction plane. Default is to use the entire direction plane. build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/initweights.xml b/gcwrap/tasks/initweights.xml build 12-Sep-2018 15:30:25 index 38d75e5..d77c884 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/initweights.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/initweights.xml build 12-Sep-2018 15:30:25 @@ -38,17 +38,17 @@ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Interpolation type in time[,freq]. default==linear,linear build 12-Sep-2018 15:30:25 + Interpolation type in time[,freq]. default==\'linear,linear\' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Spectral windows combinations to form for gaintables(s) build 12-Sep-2018 15:30:25 + Spectral windows combinations to form for gaintable(s) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Initialize the WEIGHT_SPECTRUM column. build 12-Sep-2018 15:30:25 + Initialize the WEIGHT_SPECTRUM column build 12-Sep-2018 15:30:25 False build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/listsdm.xml b/gcwrap/tasks/listsdm.xml build 12-Sep-2018 15:30:25 index 4a226fb..fa1ad4d 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/listsdm.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/listsdm.xml build 12-Sep-2018 15:30:25 @@ -7,7 +7,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Lists observation information present in an SDM directory. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -44,7 +44,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 'spws' list of spectral windows build 12-Sep-2018 15:30:25 'start' observation start time (UTC) build 12-Sep-2018 15:30:25 'timerange' start time - end time range (UTC) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Example: build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 myscans = listsdm(sdm='AS1039_sb1382796_2_000.55368.51883247685') build 12-Sep-2018 15:30:25 @@ -54,9 +54,9 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Keyword argument: build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - sdm -- Name of input SDM directory. build 12-Sep-2018 15:30:25 + sdm -- Name of input SDM directory. build 12-Sep-2018 15:30:25 example: sdm='AG836_sb1377811_1.55345.300883159725' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/makemask.xml b/gcwrap/tasks/makemask.xml build 12-Sep-2018 15:30:25 index 2bc407b..9253ed1 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/makemask.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/makemask.xml build 12-Sep-2018 15:30:25 @@ -7,7 +7,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Makes and manipulates image masks build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -21,15 +21,15 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 Mask method (list, copy,expand,delete,setdefaultmask) build 12-Sep-2018 15:30:25 list build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - list build 12-Sep-2018 15:30:25 + list build 12-Sep-2018 15:30:25 copy build 12-Sep-2018 15:30:25 expand build 12-Sep-2018 15:30:25 delete build 12-Sep-2018 15:30:25 setdefaultmask build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -48,15 +48,15 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 mask(s) to be processed: image masks,T/F internal masks(Need to include parent image names),regions(for copy mode) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Name of output mask (imagename or imagename:internal_maskname) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 overwrite output if exists? build 12-Sep-2018 15:30:25 False build 12-Sep-2018 15:30:25 @@ -79,8 +79,8 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 template image name build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 --> build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -100,12 +100,12 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 If this mask name exists, replace it. Otherwise, complain. build 12-Sep-2018 15:30:25 True build 12-Sep-2018 15:30:25 --> build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -138,7 +138,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -150,16 +150,16 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -Modes : build 12-Sep-2018 15:30:25 +Modes : build 12-Sep-2018 15:30:25 ------------- build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 list : list internal masks in inpimage to the log build 12-Sep-2018 15:30:25 copy : Copy/merge masks and regrid if necessary to a new or existing mask build 12-Sep-2018 15:30:25 expand : Expand a mask from one range of freqs to another range build 12-Sep-2018 15:30:25 delete : delete an internal mask from an image (if the deleted mask was a default mask, build 12-Sep-2018 15:30:25 - the task chooses the first one in the remaining internal mask list (as appears build 12-Sep-2018 15:30:25 - in the log when do listing with mode='list') build 12-Sep-2018 15:30:25 -setdefaultmask : set a specified internal mask as a default internal mask build 12-Sep-2018 15:30:25 + the task chooses the first one in the remaining internal mask list (as appears build 12-Sep-2018 15:30:25 + in the log when do listing with mode='list') build 12-Sep-2018 15:30:25 +setdefaultmask : set a specified internal mask as a default internal mask build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -169,12 +169,12 @@ in succession.--> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 In all cases (for output mask is expected), if the output image has a different coordinate system from the build 12-Sep-2018 15:30:25 result of input and processing, the mask will be re-gridded to the output build 12-Sep-2018 15:30:25 -coordinate system. build 12-Sep-2018 15:30:25 +coordinate system. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Parameter Descriptions and rules: build 12-Sep-2018 15:30:25 ------------------------------ build 12-Sep-2018 15:30:25 -inpimage : Name of input image to use as a reference for the output coordinates (if output does not exist). build 12-Sep-2018 15:30:25 +inpimage : Name of input image to use as a reference for the output coordinates (if output does not exist). build 12-Sep-2018 15:30:25 Also used as a reference image when regions are specified in inpmask for copy mode build 12-Sep-2018 15:30:25 If output is a new image specified with an internal T/F mask, the pixel values in the input image build 12-Sep-2018 15:30:25 are copied to the output image and the regions specified in inpmask are merged (if mutliple regions build 12-Sep-2018 15:30:25 @@ -188,95 +188,95 @@ inpmask : Name(s) of input mask(s) build 12-Sep-2018 15:30:25 To specify an internal (T/F) mask, you must give a parent image name and the internal mask name build 12-Sep-2018 15:30:25 separated by a colon. (e.g. myimage1.im:mask0). The internal mask names can be found by running build 12-Sep-2018 15:30:25 the makemask task in mode='list'. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 (expand mode) build 12-Sep-2018 15:30:25 - 'myimage:mask0' : use(true/false) internal mask build 12-Sep-2018 15:30:25 + 'myimage:mask0' : use(true/false) internal mask build 12-Sep-2018 15:30:25 'myimage' : use the inpimage values to make a mask (zero/non-zero). build 12-Sep-2018 15:30:25 Non-zero values are normalized to one in the process. build 12-Sep-2018 15:30:25 (copy mode) build 12-Sep-2018 15:30:25 Specify the image mask(s), T/F mask(s), and region(s) to be merged in a list of strings. build 12-Sep-2018 15:30:25 The regions can be specified directly in the CASA region format or in the text file(s) contains build 12-Sep-2018 15:30:25 - the regions. build 12-Sep-2018 15:30:25 + the regions. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 (delete and setdefaultmask mode) build 12-Sep-2018 15:30:25 Specify the internal mask with the format, image:mask build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -output : Name of output image. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +output : Name of output image. build 12-Sep-2018 15:30:25 default: none build 12-Sep-2018 15:30:25 *The resultant mask is written as an image (zero/one) mask if the output is a plain image name build 12-Sep-2018 15:30:25 *The resultant mask is written as an internal (T/F) mask if the output name is the form of 'imagename:maskname' build 12-Sep-2018 15:30:25 The created mask is set as a default internal mask. build 12-Sep-2018 15:30:25 - *To re-grid a mask to a different coordinate system, build 12-Sep-2018 15:30:25 + *To re-grid a mask to a different coordinate system, build 12-Sep-2018 15:30:25 give an image with the target coordinate system in inpimage. Or make a copy an image build 12-Sep-2018 15:30:25 - with the target coordinate system and specified the name of the copy in output. build 12-Sep-2018 15:30:25 + with the target coordinate system and specified the name of the copy in output. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - - If output is specified as a plain image, if it exists, it will regrid the mask to build 12-Sep-2018 15:30:25 + - If output is specified as a plain image, if it exists, it will regrid the mask to build 12-Sep-2018 15:30:25 the new coordinate system and modify output (if overwrite=True). build 12-Sep-2018 15:30:25 - If output is specified as an image with an internal mask, if the internal mask exists, build 12-Sep-2018 15:30:25 it will regrid the mask to the new coordinate system and modify the internal mask only (if overwrite=True). build 12-Sep-2018 15:30:25 - If output does not exist, it will only copy inpimage. build 12-Sep-2018 15:30:25 - If output == inpimage, do not regrid. Only modify in-place. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - *** Please note that the term 'mask' is used in the image analysis and clean tasks in opposite build 12-Sep-2018 15:30:25 - sense. In the image analysis, the masked region in general a region to be excluded while build 12-Sep-2018 15:30:25 - clean's input mask defines the region to be used as a clean box/region. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + *** Please note that the term 'mask' is used in the image analysis and clean tasks in opposite build 12-Sep-2018 15:30:25 + sense. In the image analysis, the masked region in general a region to be excluded while build 12-Sep-2018 15:30:25 + clean's input mask defines the region to be used as a clean box/region. build 12-Sep-2018 15:30:25 In the makemask task, since the most common use case of output image mask is to use as build 12-Sep-2018 15:30:25 an input mask in clean, when it converts an internal mask to the image mask, build 12-Sep-2018 15:30:25 - the 'masked' region (where the pixels are masked and have the Boolean values 'False') build 12-Sep-2018 15:30:25 - of the internal mask is translated to the pixels with value of 0 in output image mask. build 12-Sep-2018 15:30:25 + the 'masked' region (where the pixels are masked and have the Boolean values 'False') build 12-Sep-2018 15:30:25 + of the internal mask is translated to the pixels with value of 0 in output image mask. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 overwrite : overwrite the mask specified in output? (see also the output rules above) build 12-Sep-2018 15:30:25 default: False build 12-Sep-2018 15:30:25 - * Note that for a cube mask, overwrite=True generally overwrites in the specified channel planes only and build 12-Sep-2018 15:30:25 + * Note that for a cube mask, overwrite=True generally overwrites in the specified channel planes only and build 12-Sep-2018 15:30:25 so any pre-existed masks in other channels will be remain untouched. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Additional expandable parameters for mode='expand': build 12-Sep-2018 15:30:25 - inpfreqs : input channel/frequency/velocity range build 12-Sep-2018 15:30:25 - Specify channels in a list of integers. for frequency/velocity, build 12-Sep-2018 15:30:25 - a range is specified in a string with '~', e.g. '1.5MHz~1.6MHz', '-8km/s~-14km/s' build 12-Sep-2018 15:30:25 + inpfreqs : input channel/frequency/velocity range build 12-Sep-2018 15:30:25 + Specify channels in a list of integers. for frequency/velocity, build 12-Sep-2018 15:30:25 + a range is specified in a string with '~', e.g. '1.5MHz~1.6MHz', '-8km/s~-14km/s' build 12-Sep-2018 15:30:25 (for the cube with ascending frequencies) build 12-Sep-2018 15:30:25 default: [] - all channels build 12-Sep-2018 15:30:25 - * Note that the range in frequency or velocity needs to be specified as the same order build 12-Sep-2018 15:30:25 - as in the template cube specified in inpimage. E.g., if a template cube has descending build 12-Sep-2018 15:30:25 + * Note that the range in frequency or velocity needs to be specified as the same order build 12-Sep-2018 15:30:25 + as in the template cube specified in inpimage. E.g., if a template cube has descending build 12-Sep-2018 15:30:25 frequencies, then the range will be, for example,'1.6MHz~1.5MHz' or '-14km/s~-8km/s' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - outfreqs : output channel/frequency/velocity range build 12-Sep-2018 15:30:25 + outfreqs : output channel/frequency/velocity range build 12-Sep-2018 15:30:25 Specify same way as inpfreqs build 12-Sep-2018 15:30:25 default: [] - all channels build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -Usage examples : build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +Usage examples : build 12-Sep-2018 15:30:25 --------------------------- build 12-Sep-2018 15:30:25 (1) (list mode): build 12-Sep-2018 15:30:25 makemask(mode='list', inpimage='mymask.im') build 12-Sep-2018 15:30:25 - it prints out a list of the internal mask(s) exist in mymask.im to the log build 12-Sep-2018 15:30:25 + it prints out a list of the internal mask(s) exist in mymask.im to the log build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 (2) (copy mode): build 12-Sep-2018 15:30:25 - Regrid a Boolean mask from one coordinate system to another and save as Boolean mask build 12-Sep-2018 15:30:25 - in the output image. build 12-Sep-2018 15:30:25 + Regrid a Boolean mask from one coordinate system to another and save as Boolean mask build 12-Sep-2018 15:30:25 + in the output image. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 makemask(mode='copy', inpimage='oldmask.im', inpmask='oldmask.im:mask0', output='newmask.im:mask0') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 (3) (copy mode): build 12-Sep-2018 15:30:25 Same as (1), but save as integer mask in the output image. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 makemask(mode='copy', inpimage='oldmask.im', inpmask='oldmask.im:mask0', output='newmask.im') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - * mask0 is translated so that pixels in oldmask.im that appears as 'masked' in the viewer or build 12-Sep-2018 15:30:25 - has the pixel mask value = 'False' when extracted in imval, are to have pixel value of 1 in build 12-Sep-2018 15:30:25 + * mask0 is translated so that pixels in oldmask.im that appears as 'masked' in the viewer or build 12-Sep-2018 15:30:25 + has the pixel mask value = 'False' when extracted in imval, are to have pixel value of 1 in build 12-Sep-2018 15:30:25 the output image, newmask.im. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 (4) (copy mode): build 12-Sep-2018 15:30:25 Convert a Boolean(true/false) mask to an integer(one/zero) mask in the same image build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 makemask(mode='copy', inpimage='oldmask.im', inpmask='oldmask.im:mask0', output='', overwrite=True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 (5) (copy mode): build 12-Sep-2018 15:30:25 Convert an integer(one/zero) mask to a Boolean(true/false) mask in the same image build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 makemask(mode='copy', inpimage='oldmask.im', inpmask='oldmask.im', output='oldmask.im:mask0') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 (6) (copy mode): build 12-Sep-2018 15:30:25 @@ -294,21 +294,21 @@ Usage examples : build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The region is copied as a T/F mask (mask0) inside the image, image1.im. The region outside myregion.crtf build 12-Sep-2018 15:30:25 will be masked. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 (8) (copy mode): build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + and saving in a new output file. Remember, if outimage has a different build 12-Sep-2018 15:30:25 + coordinate system from inpimage, the mask will be regridded to it. --> build 12-Sep-2018 15:30:25 Merge a (one/zero) mask and T/F masks, using the input coordinate-sys of inpimage and build 12-Sep-2018 15:30:25 - saving in a new output file. Remember, if the image specified in output already exist and build 12-Sep-2018 15:30:25 + saving in a new output file. Remember, if the image specified in output already exist and build 12-Sep-2018 15:30:25 has a different coordinate system from inpimage, the mask will be regridded to it. build 12-Sep-2018 15:30:25 All masks to be merged are specified in a list in inpmask. build 12-Sep-2018 15:30:25 - The name of internal masks must be given in the format, 'parent_image_name:internal_mask_name', build 12-Sep-2018 15:30:25 + The name of internal masks must be given in the format, 'parent_image_name:internal_mask_name', build 12-Sep-2018 15:30:25 as shown the example below. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 In the example below, image1.im (the 1/0 mask), the internal masks, mask0 from image1.im build 12-Sep-2018 15:30:25 - and mask1 from image2.im, and a region (on image1.im as defined in inpimage) are combined. build 12-Sep-2018 15:30:25 + and mask1 from image2.im, and a region (on image1.im as defined in inpimage) are combined. build 12-Sep-2018 15:30:25 The output, newmask.im is a new mask name which has not build 12-Sep-2018 15:30:25 yet exist so image specified in inpimage, image1.im's coordinates are used as a target build 12-Sep-2018 15:30:25 image coordinates. If image1.im and image2.im has different coordinates, image2.im:mask1 is build 12-Sep-2018 15:30:25 @@ -322,14 +322,14 @@ Usage examples : build 12-Sep-2018 15:30:25 (9) (expand mode): build 12-Sep-2018 15:30:25 Expand a (one/zero) mask from continuum imaging to use as an input mask image for build 12-Sep-2018 15:30:25 spectral line imaging. Use an existing spectral line clean image as a template by build 12-Sep-2018 15:30:25 - specified in inpimage. build 12-Sep-2018 15:30:25 + specified in inpimage. build 12-Sep-2018 15:30:25 The inpfreqs is left out as it uses a default (=[], means all channels). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - makemask(mode='expand', inpimage='spec.clean.image', inpmask='cont.clean.mask' build 12-Sep-2018 15:30:25 + makemask(mode='expand', inpimage='spec.clean.image', inpmask='cont.clean.mask' build 12-Sep-2018 15:30:25 outfreqs=[4,5,6,7], output='spec.clean.mask') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 (10) (expand mode): build 12-Sep-2018 15:30:25 - Expand a Boolean mask from one range of channels to another range build 12-Sep-2018 15:30:25 + Expand a Boolean mask from one range of channels to another range build 12-Sep-2018 15:30:25 in the same image. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 makemask(mode='expand', inpimage='oldmask.im', inpmask='oldmask.im:mask0', inpfreqs=[5,6], outfreqs=[4,5,6,7], build 12-Sep-2018 15:30:25 @@ -339,20 +339,20 @@ Usage examples : build 12-Sep-2018 15:30:25 (11) (expand mode): build 12-Sep-2018 15:30:25 Expand a Boolean mask from a range of channels in the input image to another range build 12-Sep-2018 15:30:25 of channels in a different image with a different spectral-coordinate system. build 12-Sep-2018 15:30:25 - Save the mask as ones/zeros so that it can be used as an input mask in the clean task. build 12-Sep-2018 15:30:25 + Save the mask as ones/zeros so that it can be used as an input mask in the clean task. build 12-Sep-2018 15:30:25 As the inpimage is used as a template for the CoordinateSystem of the output cube, it is build 12-Sep-2018 15:30:25 - a prerequisite to have the cube image (a dirty image, etc). In this particular example, build 12-Sep-2018 15:30:25 - it is assumed that bigmask.im is a working copy made from the cube image of a previous clean build 12-Sep-2018 15:30:25 + a prerequisite to have the cube image (a dirty image, etc). In this particular example, build 12-Sep-2018 15:30:25 + it is assumed that bigmask.im is a working copy made from the cube image of a previous clean build 12-Sep-2018 15:30:25 execution. It is used as an input template and the resultant mask is overwritten to the same image. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Specify the infreqs and outfreqs in frequency (assuming here bigmask.im has frequencies in ascending order) build 12-Sep-2018 15:30:25 - makemask(mode='expand', inpimage='bigmask.im', inpmask='smallmask.im:mask0', build 12-Sep-2018 15:30:25 + makemask(mode='expand', inpimage='bigmask.im', inpmask='smallmask.im:mask0', build 12-Sep-2018 15:30:25 inpfreqs='1.5MHz~1.6MHz', outfreqs='1.2MHz~1.8MHz', output='bigmask.im', overwrite=True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - or to specify the ranges in velocities, build 12-Sep-2018 15:30:25 - makemask(mode='expand', inpimage='bigmask.im', inpmask='smallmask.im:mask0', build 12-Sep-2018 15:30:25 + or to specify the ranges in velocities, build 12-Sep-2018 15:30:25 + makemask(mode='expand', inpimage='bigmask.im', inpmask='smallmask.im:mask0', build 12-Sep-2018 15:30:25 inpfreqs=4.0km/s~0.5km/s', outfreqs='6.5km/s~-2.4km/s', output='bigmask.im', overwrite=True) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 (12) (delete mode) build 12-Sep-2018 15:30:25 Delete an internal mask from an image. build 12-Sep-2018 15:30:25 @@ -361,7 +361,7 @@ Usage examples : build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 (13) (setdefaultmask mode) build 12-Sep-2018 15:30:25 Set an internal mask as a default internal mask. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 makemask(mode='setdefaultmask', inpmask='newmask.im:mask1') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Create a multi-field deconvolved image with selected algorithm build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Form images from visibilities. Handles continuum and spectral line cubes. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - name of input visibility file build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Pre-name of output images build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Type of selection (mfs, channel, velocity, frequency) build 12-Sep-2018 15:30:25 - mfs build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mfs build 12-Sep-2018 15:30:25 - channel build 12-Sep-2018 15:30:25 - velocity build 12-Sep-2018 15:30:25 - frequency build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Algorithm to use (clark, hogbom, multiscale) build 12-Sep-2018 15:30:25 - clark build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - clark build 12-Sep-2018 15:30:25 - hogbom build 12-Sep-2018 15:30:25 - multiscale build 12-Sep-2018 15:30:25 - entropy build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Image size in pixels (nx,ny), symmetric for single value build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 256256 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The image cell size in arcseconds [x,y]. build 12-Sep-2018 15:30:25 - 1.01.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Field Identififier or direction of the image phase center build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Stokes params to image (I,IV,QU,IQUV,RR,LL,XX,YY,RRLL,XXYY) build 12-Sep-2018 15:30:25 - I build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - I build 12-Sep-2018 15:30:25 - IV build 12-Sep-2018 15:30:25 - QU build 12-Sep-2018 15:30:25 - IQUV build 12-Sep-2018 15:30:25 - RR build 12-Sep-2018 15:30:25 - LL build 12-Sep-2018 15:30:25 - RRLL build 12-Sep-2018 15:30:25 - XX build 12-Sep-2018 15:30:25 - YY build 12-Sep-2018 15:30:25 - XXYY build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Maximum number of iterations build 12-Sep-2018 15:30:25 - 500 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Loop gain for cleaning build 12-Sep-2018 15:30:25 - 0.1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Flux level to stop cleaning (unit mJy assumed) build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Set of mask images used in cleaning build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - clean box regions or file name or \'interactive\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Number of channels in output image build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Start channel build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Channel width (value > 1 indicates channel averaging) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Field Name build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Spectral windows:channels: \'\' is all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Range of time to select from data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - rest frequency to use in image build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Input single dish image to use for model build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of output(/input) model image build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Weighting to apply to visibilities build 12-Sep-2018 15:30:25 - natural build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - natural build 12-Sep-2018 15:30:25 - uniform build 12-Sep-2018 15:30:25 - briggs build 12-Sep-2018 15:30:25 - radial build 12-Sep-2018 15:30:25 - superuniform build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Individually weight the fields of the mosaic build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Robustness mode (for Briggs weightting) build 12-Sep-2018 15:30:25 - norm build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - none build 12-Sep-2018 15:30:25 - norm build 12-Sep-2018 15:30:25 - abs build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Briggs robustness parameter build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - -2.0 build 12-Sep-2018 15:30:25 - 2.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Gridding method for the image build 12-Sep-2018 15:30:25 - mosaic build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ft build 12-Sep-2018 15:30:25 - sd build 12-Sep-2018 15:30:25 - both build 12-Sep-2018 15:30:25 - mosaic build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Threshold for minor/major cycles (see pdoc) build 12-Sep-2018 15:30:25 - 1.5 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Cycle threshold doubles in this number of iterations build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Controls scaling of pixels in the image plane build 12-Sep-2018 15:30:25 - SAULT build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - PBCOR build 12-Sep-2018 15:30:25 - SAULT build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Minimum PB level to use build 12-Sep-2018 15:30:25 - 0.1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Target image sigma build 12-Sep-2018 15:30:25 - 0.001 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Target flux for final image build 12-Sep-2018 15:30:25 - 1.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Constrain image to match target flux build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of MEM prior images build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Stop the component search when the largest scale has found this number of negative components build 12-Sep-2018 15:30:25 - 2 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - resolutions in pixel units build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0310 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Number of iterations before interactive masking prompt build 12-Sep-2018 15:30:25 - 100 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - number of pixels to determine cell size for superuniform or briggs weighting build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - noise parameter for briggs weighting when rmode=\'abs\' build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - first channel in image relative to data channels build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - 0.0km/s build 12-Sep-2018 15:30:25 - Velocity of first image channel: e.g \'0.0km/s\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1km/s build 12-Sep-2018 15:30:25 - image channel width in velocity units: e.g \'-1.0km/s\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - 1.4GHz build 12-Sep-2018 15:30:25 - Frequency of first image channel: e.q. \'1.4GHz\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 10kHz build 12-Sep-2018 15:30:25 - Image channel width in frequency units: e.g \'1.0kHz\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - 310 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 2 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0.01 build 12-Sep-2018 15:30:25 - 1.0 build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - '' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - none build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - number of pixels to determine uv-cell size 0=> field of view build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - number of pixels to determine uv-cell size 0=> +/-3pixels build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 100 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Two types of point-source deconvolution, as well as multi-scale build 12-Sep-2018 15:30:25 - deconvolution, are available. A continuum image (mfs) is produced build 12-Sep-2018 15:30:25 - by gridding together all spectral data. Individual channels or build 12-Sep-2018 15:30:25 - groups of channels can also be images and then placed in an output build 12-Sep-2018 15:30:25 - image cube. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The cleaning regions can be specified by an input mask image, from a build 12-Sep-2018 15:30:25 - file containing rectangular regions, or interactively as the build 12-Sep-2018 15:30:25 - deconvolution progresses. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The mosaic task only uses the "corrected" datacolumn which is made build 12-Sep-2018 15:30:25 - from the "data" data column using applycal with the appropriate build 12-Sep-2018 15:30:25 - calibration tables. Many Stokes combinations are available. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file build 12-Sep-2018 15:30:25 - default: none; example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - imagename -- Pre-name of output images: build 12-Sep-2018 15:30:25 - default: none; example: imagename='m2' build 12-Sep-2018 15:30:25 - output images are: build 12-Sep-2018 15:30:25 - m2.image; cleaned and restored image build 12-Sep-2018 15:30:25 - m2.flux; relative sky sensitivity over field build 12-Sep-2018 15:30:25 - m2.model; image of clean components build 12-Sep-2018 15:30:25 - m2.residual; image of residuals build 12-Sep-2018 15:30:25 - m2.interactive.mask; image containing clean regions build 12-Sep-2018 15:30:25 - mode -- Frequency Specification: build 12-Sep-2018 15:30:25 - NOTE: See examples below: build 12-Sep-2018 15:30:25 - default: 'mfs' build 12-Sep-2018 15:30:25 - mode = 'mfs' means produce one image from all specified data. build 12-Sep-2018 15:30:25 - mode = 'channel'; Use with nchan, start, width to specify build 12-Sep-2018 15:30:25 - output image cube. See examples below build 12-Sep-2018 15:30:25 - mode = 'velocity', means channels are specified in velocity. build 12-Sep-2018 15:30:25 - mode = 'frequency', means channels are specified in frequency. build 12-Sep-2018 15:30:25 - >>> mode expandable parameters (for modes other than 'mfs') build 12-Sep-2018 15:30:25 - Start, width are given in units of channels, frequency or velocity build 12-Sep-2018 15:30:25 - as indicated by mode, but only channel is complete. build 12-Sep-2018 15:30:25 - nchan -- Number of channels (planes) in output image build 12-Sep-2018 15:30:25 - default: 1; example: nchan=3 build 12-Sep-2018 15:30:25 - start -- Start input channel (relative-0) build 12-Sep-2018 15:30:25 - default=0; example: start=5 build 12-Sep-2018 15:30:25 - width -- Output channel width (>1 indicates channel averaging) build 12-Sep-2018 15:30:25 - default=1; example: width=4 build 12-Sep-2018 15:30:25 - examples: build 12-Sep-2018 15:30:25 - spw = '0,1'; mode = 'mfs' build 12-Sep-2018 15:30:25 - will produce one image made from all channels in spw 0 and 1 build 12-Sep-2018 15:30:25 - spw='0:5~28^2'; mode = 'mfs' build 12-Sep-2018 15:30:25 - will produce one image made with channels (5,7,9,...,25,27) build 12-Sep-2018 15:30:25 - spw = '0'; mode = 'channel': nchan=3; start=5; width=4 build 12-Sep-2018 15:30:25 - will produce an image with 3 output planes build 12-Sep-2018 15:30:25 - plane 1 contains data from channels (5+6+7+8) build 12-Sep-2018 15:30:25 - plane 2 contains data from channels (9+10+11+12) build 12-Sep-2018 15:30:25 - plane 3 contains data from channels (13+14+15+16) build 12-Sep-2018 15:30:25 - spw = '0:0~63^3'; mode=chann; nchan=21; start = 0; width = 1 build 12-Sep-2018 15:30:25 - will produce an image with 20 output planes build 12-Sep-2018 15:30:25 - Plane 1 contains data from channel 0 build 12-Sep-2018 15:30:25 - Plane 2 contains date from channel 2 build 12-Sep-2018 15:30:25 - Plane 21 contains data from channel 61 build 12-Sep-2018 15:30:25 - spw = '0:0~40^2'; mode = 'channel'; nchan = 3; start = 5; width = 4 build 12-Sep-2018 15:30:25 - will produce an image with three output planes build 12-Sep-2018 15:30:25 - plane 1 contains channels (5,7) build 12-Sep-2018 15:30:25 - plane 2 contains channels (13,15) build 12-Sep-2018 15:30:25 - plane 3 contains channels (21,23) build 12-Sep-2018 15:30:25 - alg -- Algorithm to use (expandable): build 12-Sep-2018 15:30:25 - default: 'clark': Options: 'clark','hogbom','multiscale','entropy' build 12-Sep-2018 15:30:25 - 'hogbom' Cleans from the images only. Only inner quarter build 12-Sep-2018 15:30:25 - of image is cleaned build 12-Sep-2018 15:30:25 - 'clark' Cleans from gridded us data. Only inner quarter of build 12-Sep-2018 15:30:25 - image is cleaned build 12-Sep-2018 15:30:25 - 'multiscale' cleans with several resolutions using hobgom clean build 12-Sep-2018 15:30:25 - Currently much slower than single resolution. For extended build 12-Sep-2018 15:30:25 - sources, try single resolution with interactive and build 12-Sep-2018 15:30:25 - 'entropy' Maximum entropy algorithm is still experimental build 12-Sep-2018 15:30:25 - and not recommended for general use build 12-Sep-2018 15:30:25 - >>> multiscale expandable parameter build 12-Sep-2018 15:30:25 - scales -- in pixel numbers; the size of component to deconvolve build 12-Sep-2018 15:30:25 - default = [0,3,10] build 12-Sep-2018 15:30:25 - recommended sizes are 0 (point), 3 (points per clean beam), and build 12-Sep-2018 15:30:25 - 10 (about a factor of three lower resolution) build 12-Sep-2018 15:30:25 - negcomponent' -- Stop component search when the largest build 12-Sep-2018 15:30:25 - scale has found this number of negative components; -1 means build 12-Sep-2018 15:30:25 - continue component search even if the largest component is build 12-Sep-2018 15:30:25 - negative. build 12-Sep-2018 15:30:25 - default: 2; example: negcomponent=-1 build 12-Sep-2018 15:30:25 - >>> entropy (MEM) expandable parameters (experimental) build 12-Sep-2018 15:30:25 - sigma -- Target image sigma build 12-Sep-2018 15:30:25 - default: '0.001Jy'; example: sigma='0.1Jy' build 12-Sep-2018 15:30:25 - targetflux -- Target flux for final image build 12-Sep-2018 15:30:25 - default: '1.0Jy'; example: targetflux='200Jy' build 12-Sep-2018 15:30:25 - constrainflux -- Constrain image to match target flux; build 12-Sep-2018 15:30:25 - otherwise, targetflux is used to initialize model only. build 12-Sep-2018 15:30:25 - default: False; example: constrainflux=True build 12-Sep-2018 15:30:25 - prior -- Name of MEM prior images build 12-Sep-2018 15:30:25 - default: ['']; example: prior='source_mem.image' build 12-Sep-2018 15:30:25 - imsize -- Image pixel size (x,y) build 12-Sep-2018 15:30:25 - default = [256,256]; example: imsize=[350,350] build 12-Sep-2018 15:30:25 - imsize = 500 is equivalent to [500,500] build 12-Sep-2018 15:30:25 - cell -- Cell size (x,y) build 12-Sep-2018 15:30:25 - default= none; build 12-Sep-2018 15:30:25 - example: cell=['0.5arcsec,'0.5arcsec'] or build 12-Sep-2018 15:30:25 - cell=['1arcmin', '1arcmin'] build 12-Sep-2018 15:30:25 - cell = '1arcsec' is equivalent to ['1arcsec','1arcsec'] build 12-Sep-2018 15:30:25 - NOTE:cell = '2' makes default cell size of 2 radians! build 12-Sep-2018 15:30:25 - phasecenter -- direction measure or fieldid for the mosaic center build 12-Sep-2018 15:30:25 - default: 0 (imply field=0 as center); example: phasecenter=6 build 12-Sep-2018 15:30:25 - or phasecenter='J2000 19h30m00 -40d00m00' build 12-Sep-2018 15:30:25 - stokes -- Stokes parameters to image build 12-Sep-2018 15:30:25 - default='I'; example: stokes='IQUV'; build 12-Sep-2018 15:30:25 - Options: 'I','IV''QU','IQUV','RR','LL','XX','YY','RRLL','XXYY' build 12-Sep-2018 15:30:25 - niter -- Maximum number iterations, set to zero for no CLEANing build 12-Sep-2018 15:30:25 - default: 500; example: niter=500 build 12-Sep-2018 15:30:25 - gain -- Loop gain for CLEANing build 12-Sep-2018 15:30:25 - default: 0.1; example: gain=0.5 build 12-Sep-2018 15:30:25 - threshold -- Flux level at which to stop CLEANing (units=mJy) build 12-Sep-2018 15:30:25 - default: 0.0; example: threshold=0.0 build 12-Sep-2018 15:30:25 - mask -- Name of mask image used for CLEANing build 12-Sep-2018 15:30:25 - default '' means no mask; build 12-Sep-2018 15:30:25 - example: mask='orion.mask'. build 12-Sep-2018 15:30:25 - It is useful to use a mask from a previous interactive mosaic build 12-Sep-2018 15:30:25 - session for a new execution. The mask image shape build 12-Sep-2018 15:30:25 - must be the same as the new mosaic. build 12-Sep-2018 15:30:25 - cleanbox -- Cleaning region: build 12-Sep-2018 15:30:25 - default: [] defaults to inner quarter of image build 12-Sep-2018 15:30:25 - Three specification types: build 12-Sep-2018 15:30:25 - (a) 'interactive' allows the user to build the cleaning build 12-Sep-2018 15:30:25 - mask interactively using the viewer. The viewer will build 12-Sep-2018 15:30:25 - appear every npercycle interation, but modify as needed build 12-Sep-2018 15:30:25 - The final interactive maks is saved in the file build 12-Sep-2018 15:30:25 - imagename_interactive.mask. build 12-Sep-2018 15:30:25 - (b) Explicit pixel ranges build 12-Sep-2018 15:30:25 - example: cleanbox=[110,110,150,145] build 12-Sep-2018 15:30:25 - clean region with blc=110,100; trc=150,145 (pixel values) build 12-Sep-2018 15:30:25 - Only one clean region can be given this way. build 12-Sep-2018 15:30:25 - (c) Filename with pixel values with ascii format: build 12-Sep-2018 15:30:25 - <fieldindex blc-x blc-y trc-x trc-y> on each line build 12-Sep-2018 15:30:25 - 1 45 66 123 124 build 12-Sep-2018 15:30:25 - 2 23 100 300 340 build 12-Sep-2018 15:30:25 - >>> 'interactive' expandable parameter build 12-Sep-2018 15:30:25 - npercycle -- this is the number of iterations between each clean build 12-Sep-2018 15:30:25 - to update mask interactively. Set to about niter/5, can also build 12-Sep-2018 15:30:25 - be changed interactively. build 12-Sep-2018 15:30:25 - field -- Select fields in mosaic. Use field id(s) or field name(s). build 12-Sep-2018 15:30:25 - ['go listobs' to obtain the list id's or names] build 12-Sep-2018 15:30:25 - default: ''=all fields build 12-Sep-2018 15:30:25 - If field string is a non-negative integer, it is assumed to build 12-Sep-2018 15:30:25 - be a field index otherwise, it is assumed to be a field name build 12-Sep-2018 15:30:25 - field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 - field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 - field='3C286,3C295'; field named 3C286 and 3C295 build 12-Sep-2018 15:30:25 - field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 - spw -- Select spectral window/channels build 12-Sep-2018 15:30:25 - NOTE: This selects the data passed as the INPUT to mode build 12-Sep-2018 15:30:25 - default: ''=all spectral windows and channels build 12-Sep-2018 15:30:25 - spw='0~2,4'; spectral windows 0,1,2,4 (all channels) build 12-Sep-2018 15:30:25 - spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 - spw='0:5~61'; spw 0, channels 5 to 61 build 12-Sep-2018 15:30:25 - spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, channels 3 to 45. build 12-Sep-2018 15:30:25 - spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. build 12-Sep-2018 15:30:25 - spw='0:0~10;15~60'; spectral window 0 with channels 0-10,15-60 build 12-Sep-2018 15:30:25 - spw='0:0~10,1:20~30,2:1;2;3'; spw 0, channels 0-10, build 12-Sep-2018 15:30:25 - spw 1, channels 20-30, and spw 2, channels, 1,2 and 3 build 12-Sep-2018 15:30:25 - timerange -- Time range: build 12-Sep-2018 15:30:25 - default = '' (all); examples, build 12-Sep-2018 15:30:25 - selectime = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss' build 12-Sep-2018 15:30:25 - Note: if YYYY/MM/DD is missing date defaults to first day build 12-Sep-2018 15:30:25 - in data set build 12-Sep-2018 15:30:25 - timerange='09:14:0~09:54:0' picks 40 min on first day build 12-Sep-2018 15:30:25 - timerange= '25:00:00~27:30:00' picks 1 hr to 3 hr 30min on next day build 12-Sep-2018 15:30:25 - timerange='09:44:00' data within one integration of time build 12-Sep-2018 15:30:25 - timerange='>10:24:00' data after this time build 12-Sep-2018 15:30:25 - restfreq -- Specify rest frequency to use for image build 12-Sep-2018 15:30:25 - default='' build 12-Sep-2018 15:30:25 - Occasionally it is necessary to set this (for example some VLA build 12-Sep-2018 15:30:25 - spectral line data). For example for build 12-Sep-2018 15:30:25 - NH_3 (1,1) put restfreq='23.694496GHz' build 12-Sep-2018 15:30:25 - sdimage -- Input Single Dish image to use for model build 12-Sep-2018 15:30:25 - default='' (no image); example: sdimage='n4826_12mchan.im' build 12-Sep-2018 15:30:25 - modelimage -- Name of output(/input) model image build 12-Sep-2018 15:30:25 - default='' (none=imagename.model); modelimage='orion.model' build 12-Sep-2018 15:30:25 - Note: This specifies the output model if a single dish build 12-Sep-2018 15:30:25 - image is input or the output model name from the imaging build 12-Sep-2018 15:30:25 - weighting -- Weighting to apply to visibilities: build 12-Sep-2018 15:30:25 - default='natural'; example: weighting='uniform'; build 12-Sep-2018 15:30:25 - Options: 'natural','uniform','briggs','radial', 'superuniform' build 12-Sep-2018 15:30:25 - >>> Weighting expandable parameters build 12-Sep-2018 15:30:25 - For weighting='briggs' build 12-Sep-2018 15:30:25 - rmode -- Robustness mode (see help mosaic) build 12-Sep-2018 15:30:25 - default='norm'; example='abs'; build 12-Sep-2018 15:30:25 - Options: 'norm','abs','none' build 12-Sep-2018 15:30:25 - robust -- Brigg's robustness parameter build 12-Sep-2018 15:30:25 - default=0.0; example: robust=0.5; build 12-Sep-2018 15:30:25 - Options: -2.0 to 2.0; -2 (uniform)/+2 (natural) build 12-Sep-2018 15:30:25 - noise -- noise parameter to use for rmode='abs' in build 12-Sep-2018 15:30:25 - briggs weighting build 12-Sep-2018 15:30:25 - example noise='1.0mJy' build 12-Sep-2018 15:30:25 - For superuniform/briggs weighting build 12-Sep-2018 15:30:25 - npixels -- number of pixels to determine uv-cell size build 12-Sep-2018 15:30:25 - for weight calculation build 12-Sep-2018 15:30:25 - example npixels=7 build 12-Sep-2018 15:30:25 - mosweight -- Individually weight the fields of the mosaic build 12-Sep-2018 15:30:25 - default: False; example: mosweight=True build 12-Sep-2018 15:30:25 - This can be useful if some of your fields are more build 12-Sep-2018 15:30:25 - sensitive than others (i.e. due to time spent on-source); build 12-Sep-2018 15:30:25 - this parameter will give more weight to higher sensitivity build 12-Sep-2018 15:30:25 - fields in the overlap regions. build 12-Sep-2018 15:30:25 - ftmachine -- Gridding method for the image; build 12-Sep-2018 15:30:25 - Options: ft (standard interferometric gridding), sd build 12-Sep-2018 15:30:25 - (standard single dish) both (ft and sd as appropriate), build 12-Sep-2018 15:30:25 - mosaic (gridding use PB as convolution function) build 12-Sep-2018 15:30:25 - default: 'mosaic'; example: ftmachine='ft' build 12-Sep-2018 15:30:25 - cyclefactor -- Change the threshold at which the deconvolution cycle will build 12-Sep-2018 15:30:25 - stop, degrid and subtract from the visibilities. For poor PSFs, build 12-Sep-2018 15:30:25 - reconcile often (cyclefactor=4 or 5); For good PSFs, use build 12-Sep-2018 15:30:25 - cyclefactor 1.5 to 2.0. build 12-Sep-2018 15:30:25 - default: 1.5; example: cyclefactor=4 build 12-Sep-2018 15:30:25 - cycle threshold = cyclefactor * max sidelobe * max residual build 12-Sep-2018 15:30:25 - cyclespeedup -- Cycle threshold doubles in this number of iterations build 12-Sep-2018 15:30:25 - default: -1; example: cyclespeedup=500 build 12-Sep-2018 15:30:25 - scaletype -- Controls scaling of pixels in the image plane. build 12-Sep-2018 15:30:25 - default='SAULT'; example: scaletype='PBCOR' build 12-Sep-2018 15:30:25 - Options: 'PBCOR','SAULT' build 12-Sep-2018 15:30:25 - 'SAULT' scale makes an output image where the noise is constant build 12-Sep-2018 15:30:25 - across the whole mosaic. However, the image is NOT build 12-Sep-2018 15:30:25 - corrected for the PB pattern, and therefore is not "flux build 12-Sep-2018 15:30:25 - correct". Division of the SAULT image_name.image image build 12-Sep-2018 15:30:25 - by the image_name.flux image will produce a "flux correct image". build 12-Sep-2018 15:30:25 - The 'PBCOR' option uses the SAULT scaling scheme for build 12-Sep-2018 15:30:25 - deconvolution, but when interactively cleaning shows the build 12-Sep-2018 15:30:25 - primary beam corrected image; the final PBCOR image is "flux build 12-Sep-2018 15:30:25 - correct" build 12-Sep-2018 15:30:25 - minpb -- Minimum PB level to use build 12-Sep-2018 15:30:25 - default=0.1; example: minpb=0.01 build 12-Sep-2018 15:30:25 - async -- Run asynchronously build 12-Sep-2018 15:30:25 - default = False; do not run asychronously build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/msuvbin.xml b/gcwrap/tasks/msuvbin.xml build 12-Sep-2018 15:30:25 index 2451242..83e1f3f 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/msuvbin.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/msuvbin.xml build 12-Sep-2018 15:30:25 @@ -5,7 +5,7 @@ build 12-Sep-2018 15:30:25 xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd build 12-Sep-2018 15:30:25 file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 grid the visibility data onto a defined uniform grid (in the form of an ms); multiple MS\'s can be done onto the same grid build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 msuvbin is a uv gridding task. The use is for large volumes build 12-Sep-2018 15:30:25 @@ -14,7 +14,7 @@ build 12-Sep-2018 15:30:25 average them after wards. Rather than doing this averaging build 12-Sep-2018 15:30:25 the visibilities on a common uv grid has several convenience build 12-Sep-2018 15:30:25 advantages like easily doing the proper weighted averaging and imaging. build 12-Sep-2018 15:30:25 - If an output grid already exists and a second ms is gridded on the grid build 12-Sep-2018 15:30:25 + If an output grid already exists and a second ms is gridded on the grid build 12-Sep-2018 15:30:25 then the output grid parameters is ignored but the existant grid is used. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -83,7 +83,7 @@ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Do wprojection correction while gridding build 12-Sep-2018 15:30:25 False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Limit how much of memory to use build 12-Sep-2018 15:30:25 0.5 build 12-Sep-2018 15:30:25 @@ -93,15 +93,15 @@ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Keyword arguments: build 12-Sep-2018 15:30:25 vis -- Name of input visibility file build 12-Sep-2018 15:30:25 @@ -116,10 +116,10 @@ build 12-Sep-2018 15:30:25 taql --TaQl expression for data selection (see http://www.astron.nl/casacore/trunk/casacore/doc/notes/199.html) build 12-Sep-2018 15:30:25 default taql='' build 12-Sep-2018 15:30:25 Example select all data where U > 1 m in the ms build 12-Sep-2018 15:30:25 - taql='UVW[0] > 1' build 12-Sep-2018 15:30:25 + taql='UVW[0] > 1' build 12-Sep-2018 15:30:25 outvis -- name of output grid build 12-Sep-2018 15:30:25 default: '' The user has to give something here build 12-Sep-2018 15:30:25 - phasecenter -- phasecenter of the grid build 12-Sep-2018 15:30:25 + phasecenter -- phasecenter of the grid build 12-Sep-2018 15:30:25 default= '' build 12-Sep-2018 15:30:25 phasecenter='J2000 18h03m04 -20d00m45.1' build 12-Sep-2018 15:30:25 nx -- number of pixels along the x axis of the grid build 12-Sep-2018 15:30:25 @@ -146,8 +146,8 @@ build 12-Sep-2018 15:30:25 wproject=True build 12-Sep-2018 15:30:25 memfrac -- control how much of computer's memory is available for gridding build 12-Sep-2018 15:30:25 default=0.5 build 12-Sep-2018 15:30:25 - memfrac=0.9 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + memfrac=0.9 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/oldhanningsmooth.xml b/gcwrap/tasks/oldhanningsmooth.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index c6ec7c2..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/oldhanningsmooth.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,74 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Hanning smooth frequency channel data to remove Gibbs ringing build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - T H I S T A S K I S D E P R E C A T E D build 12-Sep-2018 15:30:25 - I T W I L L B E R E M O V E D S O O N build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - This function Hanning smoothes the frequency channels with build 12-Sep-2018 15:30:25 - a weighted running average. The weights are 0.5 for the central build 12-Sep-2018 15:30:25 - channel and 0.25 for each of the two adjacent channels. The first build 12-Sep-2018 15:30:25 - and last channels are flagged. build 12-Sep-2018 15:30:25 - Inclusion of a flagged value in an average causes that data value build 12-Sep-2018 15:30:25 - to be flagged. build 12-Sep-2018 15:30:25 - If an 'outputvis' filename is given, the task will copy the input file to the build 12-Sep-2018 15:30:25 - output file name first, including all columns that are present in the input MS. build 12-Sep-2018 15:30:25 - After that step it will smooth the column(s) as requested in the 'datacolumn' parameter. build 12-Sep-2018 15:30:25 - Alternatively, if no 'outputvis' is specified, oldhanningsmooth will work directly on the build 12-Sep-2018 15:30:25 - input visibility file. build 12-Sep-2018 15:30:25 - If the 'CORRECTED' data column is requested for an MS that does not contain this column, build 12-Sep-2018 15:30:25 - it will be filled from the 'DATA' column and then smoothed. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - WARNING: by default, all visibility columns will be smoothed. This will build 12-Sep-2018 15:30:25 - modify the DATA column of the output MS in order to make sure that build 12-Sep-2018 15:30:25 - later gaincal will work on the smoothed data, e.g. as part of self-cal. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of input visibility file (MS) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - the name of the MS column into which to write the smoothed data build 12-Sep-2018 15:30:25 - all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - corrected build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - name of the output visibility file (MS) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - outputvis='ngc5921-hs.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file (MS) build 12-Sep-2018 15:30:25 - default: none; example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - datacolumn -- the name of the MS column to be Hanning smoothed build 12-Sep-2018 15:30:25 - default='all'; example: datacolumn='corrected' build 12-Sep-2018 15:30:25 - options: 'corrected', 'data', 'all' build 12-Sep-2018 15:30:25 - outputvis -- name of the output visibility file (MS) build 12-Sep-2018 15:30:25 - default=none (write to the input MS); example: outputvis='ngc5921_src.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - oldhanningsmooth(vis='ngc4852.ms', datacolumn='data', outputvis='ngc4852-hs.ms') build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 \ No newline at end of file build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/oldpartition.xml b/gcwrap/tasks/oldpartition.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 4b7a023..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/oldpartition.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,349 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Experimental task to produce multi-MSs using parallelism build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Partition is a task to create a multi-MS out of an MS. General selection build 12-Sep-2018 15:30:25 - parameters are included, and one or all of the various data columns build 12-Sep-2018 15:30:25 - (DATA, LAG_DATA and/or FLOAT_DATA, and possibly MODEL_DATA and/or build 12-Sep-2018 15:30:25 - CORRECTED_DATA) can be selected. It can also be used to create a normal build 12-Sep-2018 15:30:25 - MS, split based on the given data selection parameters. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of input measurement set build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of output measurement set build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Should this create a multi-MS output build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Axis to do parallelization across(scan,spw,both) build 12-Sep-2018 15:30:25 - scan build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - scan build 12-Sep-2018 15:30:25 - spw build 12-Sep-2018 15:30:25 - both build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The number of SubMSs to create build 12-Sep-2018 15:30:25 - 64 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Which data column(s) to split out build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - corrected build 12-Sep-2018 15:30:25 - model build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data,model,corrected build 12-Sep-2018 15:30:25 - float_data build 12-Sep-2018 15:30:25 - lag_data build 12-Sep-2018 15:30:25 - float_data,data build 12-Sep-2018 15:30:25 - lag_data,data build 12-Sep-2018 15:30:25 - all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Cal Data Selection (\'none\', \'auto\', \'manual\') build 12-Sep-2018 15:30:25 - none build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - none build 12-Sep-2018 15:30:25 - auto build 12-Sep-2018 15:30:25 - manual build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of output measurement set build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Field Selection for calibration ms build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - > build 12-Sep-2018 15:30:25 - Select data by scan numbers build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - > build 12-Sep-2018 15:30:25 - Select data by scan intent build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select field using ID(s) or name(s) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select spectral window/channels build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data based on antenna/baseline build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Bin width for time averaging build 12-Sep-2018 15:30:25 - 0s build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Let time bins span changes in scan and/or state build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data by time range build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data by scan numbers build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data by scan intent build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select (sub)array(s) by array ID number build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data by baseline length build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select by observation ID(s) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - scan build 12-Sep-2018 15:30:25 - 64 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Experimental version for use with parallelization framework. build 12-Sep-2018 15:30:25 - Do not use this for standard analysis... yet. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Partition is a task to create a multi-MS out of an MS. General selection build 12-Sep-2018 15:30:25 - parameters are included, and one or all of the various data columns build 12-Sep-2018 15:30:25 - (DATA, LAG_DATA and/or FLOAT_DATA, and possibly MODEL_DATA and/or build 12-Sep-2018 15:30:25 - CORRECTED_DATA) can be selected. It can also be used to create a normal build 12-Sep-2018 15:30:25 - MS, split based on the given data selection parameters. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - A multi-MS is structured to have a reference MS on the top directory and a build 12-Sep-2018 15:30:25 - sub-directory called SUBMSS, which contain each partitioned sub-MS. The build 12-Sep-2018 15:30:25 - reference MS contains links to the sub-tables of the first sub-MS. The other build 12-Sep-2018 15:30:25 - sub-MSs contain a copy of the sub-tables each. A multi-MS looks like this in disk. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ls ngc5921.mms build 12-Sep-2018 15:30:25 - ANTENNA FLAG_CMD POLARIZATION SPECTRAL_WINDOW table.dat build 12-Sep-2018 15:30:25 - DATA_DESCRIPTION HISTORY PROCESSOR STATE table.info build 12-Sep-2018 15:30:25 - FEED OBSERVATION SORTED_TABLE SUBMSS WEATHER build 12-Sep-2018 15:30:25 - FIELD POINTING SOURCE SYSCAL build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ls ngc5921.mms/SUBMSS/ build 12-Sep-2018 15:30:25 - ngc5921.0000.ms/ ngc5921t.0002.ms/ ngc5921.0004.ms/ ngc5921.0006.ms/ build 12-Sep-2018 15:30:25 - ngc5921.0001.ms/ ngc5921.0003.ms/ ngc5921.0005.ms/ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Inside casapy, one can use the task listpartition to list the information build 12-Sep-2018 15:30:25 - from a multi-MS. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file build 12-Sep-2018 15:30:25 - default: none; example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - outputvis -- Name of output visibility file build 12-Sep-2018 15:30:25 - default: none; example: outputvis='ngc5921.mms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - createmms -- Create a multi-MS as the output. build 12-Sep-2018 15:30:25 - default: True build 12-Sep-2018 15:30:25 - If False, it will work like the split task and create a build 12-Sep-2018 15:30:25 - normal MS, split according to the given data selection parameters. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - separationaxis -- Axis to do parallelization across. build 12-Sep-2018 15:30:25 - default: 'scan' build 12-Sep-2018 15:30:25 - Options: 'scan', 'spw', 'both' build 12-Sep-2018 15:30:25 - The 'both' option will try to partition in both scan and spw axes. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - numsubms -- The number of sub-MSs to create. build 12-Sep-2018 15:30:25 - default: 64 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - datacolumn -- Which data column to use when partitioning. build 12-Sep-2018 15:30:25 - default='data'; example: datacolumn='data' build 12-Sep-2018 15:30:25 - Options: 'data', 'model', 'corrected', 'all', build 12-Sep-2018 15:30:25 - 'float_data', 'lag_data', 'float_data,data', and build 12-Sep-2018 15:30:25 - 'lag_data,data'. build 12-Sep-2018 15:30:25 - N.B.: 'all' = whichever of the above that are present. build 12-Sep-2018 15:30:25 - Otherwise the selected column will go to DATA (or build 12-Sep-2018 15:30:25 - FLOAT_DATA) in the output. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - calmsselection -- Method by which the calibration scans will be identified build 12-Sep-2018 15:30:25 - when creating a separate calibration MS. build 12-Sep-2018 15:30:25 - default:'none' build 12-Sep-2018 15:30:25 - Options: 'none', 'auto', 'manual'. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 'auto' -- build 12-Sep-2018 15:30:25 - calmsname -- Name of output measurement set. build 12-Sep-2018 15:30:25 - default = ' ' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 'manual' build 12-Sep-2018 15:30:25 - calmsname -- Name of output measurement set. build 12-Sep-2018 15:30:25 - default: '' build 12-Sep-2018 15:30:25 - calfield -- Field selection for calibration MS. build 12-Sep-2018 15:30:25 - default: '' build 12-Sep-2018 15:30:25 - calscans -- Scan selection for calibration MS. build 12-Sep-2018 15:30:25 - default: '' build 12-Sep-2018 15:30:25 - calintent -- Scan intent selection for calibration MS. build 12-Sep-2018 15:30:25 - default: '' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 ---- Data selection parameters (see help par.selectdata for more detailed build 12-Sep-2018 15:30:25 - information) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - field -- Select field using field id(s) or field name(s). build 12-Sep-2018 15:30:25 - [run listobs to obtain the list iof d's or names] build 12-Sep-2018 15:30:25 - default: ''=all fields If field string is a non-negative build 12-Sep-2018 15:30:25 - integer, it is assumed to be a field index build 12-Sep-2018 15:30:25 - otherwise, it is assumed to be a field name build 12-Sep-2018 15:30:25 - field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 - field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 - field='3C286,3C295'; fields named 3C286 and 3C295 build 12-Sep-2018 15:30:25 - field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - spw -- Select spectral window/channels build 12-Sep-2018 15:30:25 - default: ''=all spectral windows and channels build 12-Sep-2018 15:30:25 - spw='0~2,4'; spectral windows 0,1,2,4 (all channels) build 12-Sep-2018 15:30:25 - spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 - spw='0:5~61'; spw 0, channels 5 to 61 build 12-Sep-2018 15:30:25 - spw='0,10,3:3~45'; spw 0,10 all channels, spw 3 - chans 3 to 45. build 12-Sep-2018 15:30:25 - spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. build 12-Sep-2018 15:30:25 - spw = '*:3~64' channels 3 through 64 for all sp id's build 12-Sep-2018 15:30:25 - spw = ' :3~64' will NOT work. build 12-Sep-2018 15:30:25 - spw = '*:0;60~63' channel 0 and channels 60 to 63 for all IFs build 12-Sep-2018 15:30:25 - ';' needed to separate different channel ranges in one spw build 12-Sep-2018 15:30:25 - spw='0:0~10;15~60'; spectral window 0 with channels 0-10,15-60 build 12-Sep-2018 15:30:25 - spw='0:0~10,1:20~30,2:1;2;4'; spw 0, channels 0-10, build 12-Sep-2018 15:30:25 - spw 1, channels 20-30, and spw 2, channels, 1, 2 and 4 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - antenna -- Select data based on antenna/baseline build 12-Sep-2018 15:30:25 - default: '' (all) build 12-Sep-2018 15:30:25 - Non-negative integers are assumed to be antenna indices, and build 12-Sep-2018 15:30:25 - anything else is taken as an antenna name. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Examples: build 12-Sep-2018 15:30:25 - antenna='5&6': baseline between antenna index 5 and index 6. build 12-Sep-2018 15:30:25 - antenna='VA05&VA06': baseline between VLA antenna 5 and 6. build 12-Sep-2018 15:30:25 - antenna='5&6;7&8': baselines 5-6 and 7-8 build 12-Sep-2018 15:30:25 - antenna='5': all baselines with antenna 5 build 12-Sep-2018 15:30:25 - antenna='5,6,10': all baselines including antennas 5, 6, or 10 build 12-Sep-2018 15:30:25 - antenna='5,6,10&': all baselines with *only* antennas 5, 6, or build 12-Sep-2018 15:30:25 - 10. (cross-correlations only. Use && build 12-Sep-2018 15:30:25 - to include autocorrelations, and &&& build 12-Sep-2018 15:30:25 - to get only autocorrelations.) build 12-Sep-2018 15:30:25 - antenna='!ea03,ea12,ea17': all baselines except those that build 12-Sep-2018 15:30:25 - include EVLA antennas ea03, ea12, or build 12-Sep-2018 15:30:25 - ea17. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - timebin -- Interval width for time averaging. build 12-Sep-2018 15:30:25 - default: '0s' or '-1s' (no averaging) build 12-Sep-2018 15:30:25 - Example: timebin='30s' build 12-Sep-2018 15:30:25 - '10' means '10s' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - combine -- Let time bins span changes in scan and/or state. build 12-Sep-2018 15:30:25 - default = '' (separate time bins by both of the above) build 12-Sep-2018 15:30:25 - combine = 'scan': Can be useful when the scan number build 12-Sep-2018 15:30:25 - goes up with each integration, build 12-Sep-2018 15:30:25 - as in many WSRT MSes. build 12-Sep-2018 15:30:25 - combine = ['scan', 'state']: disregard scan and state build 12-Sep-2018 15:30:25 - numbers when time averaging. build 12-Sep-2018 15:30:25 - combine = 'state,scan': Same as above. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - timerange -- Select data based on time range: build 12-Sep-2018 15:30:25 - default = '' (all); examples, build 12-Sep-2018 15:30:25 - timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss' build 12-Sep-2018 15:30:25 - Note: if YYYY/MM/DD is missing date, timerange defaults to the build 12-Sep-2018 15:30:25 - first day in the dataset build 12-Sep-2018 15:30:25 - timerange='09:14:0~09:54:0' picks 40 min on first day build 12-Sep-2018 15:30:25 - timerange='25:00:00~27:30:00' picks 1 hr to 3 hr 30min build 12-Sep-2018 15:30:25 - on next day build 12-Sep-2018 15:30:25 - timerange='09:44:00' data within one integration of time build 12-Sep-2018 15:30:25 - timerange='>10:24:00' data after this time build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - array -- (Sub)array number range build 12-Sep-2018 15:30:25 - default: ''=all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - uvrange -- Select data within uvrange (default units meters) build 12-Sep-2018 15:30:25 - default: ''=all; example: build 12-Sep-2018 15:30:25 - uvrange='0~1000klambda'; uvrange from 0-1000 kilo-lambda build 12-Sep-2018 15:30:25 - uvrange='>4klambda';uvranges greater than 4 kilo-lambda build 12-Sep-2018 15:30:25 - uvrange='0~1000km'; uvrange in kilometers build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - scan -- Scan number range build 12-Sep-2018 15:30:25 - default: ''=all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - observation -- Select by observation ID(s) build 12-Sep-2018 15:30:25 - default: ''=all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/oldplotants.xml b/gcwrap/tasks/oldplotants.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 80c2048..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/oldplotants.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,59 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Plot the antenna distribution in the local reference frame: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - TO BE DEPRECATED to remove dependence on msplot. Please use build 12-Sep-2018 15:30:25 - the updated plotants. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The location of the antennas in the MS will be plotted with build 12-Sep-2018 15:30:25 - X-toward local east; Y-toward local north. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of input visibility file (MS) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Save the plotted figure to this file build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Plot the antenna distribution in the local reference frame: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The location of the antennas in the MS will be plotted with build 12-Sep-2018 15:30:25 - X-toward local east; Y-toward local north. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file. build 12-Sep-2018 15:30:25 - default: none. example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - figfile -- Save the plotted figure in this file. build 12-Sep-2018 15:30:25 - default: ''. example: figfile='myFigure.png' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The name of each antenna (egs. vla=antenna number) is build 12-Sep-2018 15:30:25 - shown next to its respective location. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - DO NOT use the buttons on the Mark Region line. These are build 12-Sep-2018 15:30:25 - not implemented yet and might abort CASA. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - You can zoom in by pressing the magnifier button (bottom, build 12-Sep-2018 15:30:25 - third from left) and making a rectangular region with build 12-Sep-2018 15:30:25 - the mouse. Press the home button (left most button) to build 12-Sep-2018 15:30:25 - remove zoom. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - A hard-copy of this plot can be obtained by pressing the build 12-Sep-2018 15:30:25 - button on the right at the bottom of the display. This build 12-Sep-2018 15:30:25 - produces a png format file. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/oldsplit.xml b/gcwrap/tasks/oldsplit.xml build 12-Sep-2018 15:30:25 index 083b2b2..0779b80 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/oldsplit.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/oldsplit.xml build 12-Sep-2018 15:30:25 @@ -5,7 +5,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" build 12-Sep-2018 15:30:25 xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd build 12-Sep-2018 15:30:25 file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Create a visibility subset from an existing visibility set build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -81,7 +81,7 @@ average over frequency (channels) and time (integrations). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Bin width for time averaging build 12-Sep-2018 15:30:25 + Bin width for time averaging build 12-Sep-2018 15:30:25 0s build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -259,7 +259,7 @@ average over frequency (channels) and time (integrations). build 12-Sep-2018 15:30:25 parameter, flagged data is never included in averaging build 12-Sep-2018 15:30:25 calculations. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - The only time keepflags matters is if build 12-Sep-2018 15:30:25 + The only time keepflags matters is if build 12-Sep-2018 15:30:25 1. the input MS has some completely flagged rows build 12-Sep-2018 15:30:25 and build 12-Sep-2018 15:30:25 2. time averaging is not being done. build 12-Sep-2018 15:30:25 @@ -269,10 +269,10 @@ average over frequency (channels) and time (integrations). build 12-Sep-2018 15:30:25 be included (subject to the selection parameters). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 keepmms -- If true and the input is a multi-MS, make the output one, too. build 12-Sep-2018 15:30:25 - Otherwise, the output will be a normal MS without partitioning. build 12-Sep-2018 15:30:25 + Otherwise, the output will be a normal MS without partitioning. build 12-Sep-2018 15:30:25 (experimental) build 12-Sep-2018 15:30:25 Default: False build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/oldstatwt.xml b/gcwrap/tasks/oldstatwt.xml build 12-Sep-2018 15:30:25 new file mode 100644 build 12-Sep-2018 15:30:25 index 0000000..42638f8 build 12-Sep-2018 15:30:25 --- /dev/null build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/oldstatwt.xml build 12-Sep-2018 15:30:25 @@ -0,0 +1,296 @@ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Reweight visibilities according to their scatter (Experimental) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Name of measurement set build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Use rms instead of stddev? build 12-Sep-2018 15:30:25 + False build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Estimate the noise per antenna -not implemented (vs. per baseline) build 12-Sep-2018 15:30:25 + False build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + If solving by antenna, treat autocorrs separately (not implemented) build 12-Sep-2018 15:30:25 + True build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The signal-free spectral window:channels to estimate the scatter from build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The signal-free correlation(s) to estimate the scatter from (not implemented) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Let estimates span changes in spw, corr, scan and/or state build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Bin length for estimates (not implemented) build 12-Sep-2018 15:30:25 + 0s build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Minimum number of unflagged visibilities for estimating the scatter build 12-Sep-2018 15:30:25 + 2 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Select field using ID(s) or name(s) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Select spectral window/channels build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Select data based on antenna/baseline build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Select data by time range build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Select data by scan numbers build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Select data by scan intents build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Select (sub)array(s) by array ID number build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Select correlations to reweight (DEPRECATED in CASA v4.5) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Select by observation ID(s) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Which data column to calculate the scatter from build 12-Sep-2018 15:30:25 + corrected build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + data build 12-Sep-2018 15:30:25 + corrected build 12-Sep-2018 15:30:25 + float_data build 12-Sep-2018 15:30:25 + model build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + True build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The WEIGHT and SIGMA columns of measurement sets are often set to arbitrary build 12-Sep-2018 15:30:25 + values (e.g. 1), or theoretically estimated from poorly known antenna and build 12-Sep-2018 15:30:25 + receiver properties. Many tasks (e.g. clean) are insensitive to an overall build 12-Sep-2018 15:30:25 + scale error in WEIGHT, but are affected by errors in the relative weights build 12-Sep-2018 15:30:25 + between visibilities. Other tasks, such as uvmodelfit, or anything which build 12-Sep-2018 15:30:25 + depends on theoretical estimates of the noise, require (reasonably) correct build 12-Sep-2018 15:30:25 + weights and sigmas. oldstatwt empirically measures the visibility scatter build 12-Sep-2018 15:30:25 + (typically as a function of time, antenna, and/or baseline) and uses that build 12-Sep-2018 15:30:25 + to set WEIGHT and SIGMA. It is important that all necessary calibrations build 12-Sep-2018 15:30:25 + are applied to the data prior to running this task for correct determination of build 12-Sep-2018 15:30:25 + weights and sigmas. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Note: Some of the parameters (byantenna, sepacs, fitcorr, and timebin) build 12-Sep-2018 15:30:25 + are not fully implemented for CASA 3.4. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Keyword arguments: build 12-Sep-2018 15:30:25 + vis -- Name of the measurement set. build 12-Sep-2018 15:30:25 + default: none; example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + dorms -- Estimate the scatter using rms instead of the standard build 12-Sep-2018 15:30:25 + deviation? build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Ideally the visibilities used to estimate the scatter, as build 12-Sep-2018 15:30:25 + selected by fitspw and fitcorr, should be pure noise. If you build 12-Sep-2018 15:30:25 + know for certain that they are, then setting dorms to True build 12-Sep-2018 15:30:25 + will give the best result. Otherwise, use False (standard build 12-Sep-2018 15:30:25 + sample standard deviation). More robust scatter estimates build 12-Sep-2018 15:30:25 + like the interquartile range or median absolute deviation from build 12-Sep-2018 15:30:25 + the median are not offered because they require sorting by build 12-Sep-2018 15:30:25 + value, which is not possible for complex numbers. build 12-Sep-2018 15:30:25 + default: False build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + byantenna -- Assume that the noise is factorable by antenna (feed). build 12-Sep-2018 15:30:25 + If false, treat it separately for each baseline build 12-Sep-2018 15:30:25 + (recommended if there is strong signal). build 12-Sep-2018 15:30:25 + default: False (*** byantenna=True is not yet implemented) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + sepacs -- If solving by antenna, treat autocorrelations separately. build 12-Sep-2018 15:30:25 + (Acknowledge that what autocorrelations "see" is very build 12-Sep-2018 15:30:25 + different from what crosscorrelations see.) build 12-Sep-2018 15:30:25 + default: True (*** not yet implemented) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + --- Data Selection (see help par.selectdata for more detailed build 12-Sep-2018 15:30:25 + information) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + fitspw -- The (ideally) signal-free spectral window:channels to build 12-Sep-2018 15:30:25 + estimate the scatter from. build 12-Sep-2018 15:30:25 + default: '' (All) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + fitcorr -- The (ideally) signal-free correlations to build 12-Sep-2018 15:30:25 + estimate the scatter from. build 12-Sep-2018 15:30:25 + default: '' (All) build 12-Sep-2018 15:30:25 + *** not yet implemented build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + combine -- Let samples span multiple spws, corrs, scans, and/or states. build 12-Sep-2018 15:30:25 + combine = 'spw': Recommended when a line spans an entire spw build 12-Sep-2018 15:30:25 + - set fitspw to the neighboring spws and build 12-Sep-2018 15:30:25 + apply their weight to the line spw(s). build 12-Sep-2018 15:30:25 + However, the effect of the line signal per build 12-Sep-2018 15:30:25 + visibility may be relatively harmless build 12-Sep-2018 15:30:25 + compared to the noise difference between build 12-Sep-2018 15:30:25 + spws. build 12-Sep-2018 15:30:25 + combine = 'scan': Can be useful when the scan number build 12-Sep-2018 15:30:25 + goes up with each integration, build 12-Sep-2018 15:30:25 + as in many WSRT MSes. build 12-Sep-2018 15:30:25 + combine = ['scan', 'spw']: disregard scan and spw build 12-Sep-2018 15:30:25 + numbers when gathering samples. build 12-Sep-2018 15:30:25 + combine = 'spw,scan': Same as above. build 12-Sep-2018 15:30:25 + default: '' (None) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + timebin -- Sample interval. build 12-Sep-2018 15:30:25 + default: '0s' or '-1s' (1 integration at a time) build 12-Sep-2018 15:30:25 + example: timebin='30s' build 12-Sep-2018 15:30:25 + '10' means '10s' build 12-Sep-2018 15:30:25 + *** not yet implemented build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + minsamp -- Minimum number of unflagged visibilities for estimating the build 12-Sep-2018 15:30:25 + scatter. Selected visibilities for which the weight cannot build 12-Sep-2018 15:30:25 + be estimated will be flagged. Note that minsamp is build 12-Sep-2018 15:30:25 + effectively at least 2 if dorms is False, and 1 if it is build 12-Sep-2018 15:30:25 + True. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + field -- Select field using field id(s) or field name(s). build 12-Sep-2018 15:30:25 + [run listobs to obtain the list id's or names] build 12-Sep-2018 15:30:25 + default: ''=all fields If field string is a non-negative build 12-Sep-2018 15:30:25 + integer, it is assumed to be a field index build 12-Sep-2018 15:30:25 + otherwise, it is assumed to be a field name build 12-Sep-2018 15:30:25 + field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 + field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 + field='3C286,3C295'; fields named 3C286 and 3C295 build 12-Sep-2018 15:30:25 + field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + spw -- Select spectral window/channels for changing WEIGHT and SIGMA. build 12-Sep-2018 15:30:25 + default: ''=all spectral windows and channels build 12-Sep-2018 15:30:25 + spw='0~2,4'; spectral windows 0,1,2,4 (all channels) build 12-Sep-2018 15:30:25 + spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 + spw='0:5~61'; spw 0, channels 5 to 61 build 12-Sep-2018 15:30:25 + spw='0,10,3:3~45'; spw 0,10 all channels, spw 3 - chans 3 to 45. build 12-Sep-2018 15:30:25 + spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. build 12-Sep-2018 15:30:25 + spw = '*:3~64' channels 3 through 64 for all sp id's build 12-Sep-2018 15:30:25 + spw = ' :3~64' will NOT work. build 12-Sep-2018 15:30:25 + oldstatwt does not support multiple channel ranges per spectral build 12-Sep-2018 15:30:25 + window (';') because it is not clear whether to keep the ranges build 12-Sep-2018 15:30:25 + in the original spectral window or make a new spectral window build 12-Sep-2018 15:30:25 + for each additional range. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + antenna -- Select antennas/baselines for changing WEIGHT and SIGMA. build 12-Sep-2018 15:30:25 + default: '' (all) build 12-Sep-2018 15:30:25 + Non-negative integers are assumed to be antenna indices, and build 12-Sep-2018 15:30:25 + anything else is taken as an antenna name. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Examples: build 12-Sep-2018 15:30:25 + antenna='5&6': baseline between antenna index 5 and index 6. build 12-Sep-2018 15:30:25 + antenna='VA05&VA06': baseline between VLA antenna 5 and 6. build 12-Sep-2018 15:30:25 + antenna='5&6;7&8': baselines 5-6 and 7-8 build 12-Sep-2018 15:30:25 + antenna='5': all baselines with antenna 5 build 12-Sep-2018 15:30:25 + antenna='5,6,10': all baselines including antennas 5, 6, or 10 build 12-Sep-2018 15:30:25 + antenna='5,6,10&': all baselines with *only* antennas 5, 6, or build 12-Sep-2018 15:30:25 + 10. (cross-correlations only. Use && build 12-Sep-2018 15:30:25 + to include autocorrelations, and &&& build 12-Sep-2018 15:30:25 + to get only autocorrelations.) build 12-Sep-2018 15:30:25 + antenna='!ea03,ea12,ea17': all baselines except those that build 12-Sep-2018 15:30:25 + include EVLA antennas ea03, ea12, or build 12-Sep-2018 15:30:25 + ea17. build 12-Sep-2018 15:30:25 + timerange -- Select data based on time range: build 12-Sep-2018 15:30:25 + default = '' (all); examples, build 12-Sep-2018 15:30:25 + timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss' build 12-Sep-2018 15:30:25 + Note: if YYYY/MM/DD is missing date, timerange defaults to the build 12-Sep-2018 15:30:25 + first day in the dataset build 12-Sep-2018 15:30:25 + timerange='09:14:0~09:54:0' picks 40 min on first day build 12-Sep-2018 15:30:25 + timerange='25:00:00~27:30:00' picks 1 hr to 3 hr 30min build 12-Sep-2018 15:30:25 + on next day build 12-Sep-2018 15:30:25 + timerange='09:44:00' data within one integration of time build 12-Sep-2018 15:30:25 + timerange='>10:24:00' data after this time build 12-Sep-2018 15:30:25 + scan -- Scan number range build 12-Sep-2018 15:30:25 + default: ''=all build 12-Sep-2018 15:30:25 + intent -- Select by scan intent (state). Case sensitive. build 12-Sep-2018 15:30:25 + default: '' = all build 12-Sep-2018 15:30:25 + Examples: build 12-Sep-2018 15:30:25 + intent = 'CALIBRATE_ATMOSPHERE_REFERENCE' build 12-Sep-2018 15:30:25 + intent = 'calibrate_atmosphere_reference'.upper() # same as above build 12-Sep-2018 15:30:25 + # Select states that include one or both of CALIBRATE_WVR.REFERENCE build 12-Sep-2018 15:30:25 + # or OBSERVE_TARGET_ON_SOURCE. build 12-Sep-2018 15:30:25 + intent = 'CALIBRATE_WVR.REFERENCE, OBSERVE_TARGET_ON_SOURCE' build 12-Sep-2018 15:30:25 + array -- (Sub)array number range build 12-Sep-2018 15:30:25 + default: ''=all build 12-Sep-2018 15:30:25 + correlation -- Select correlations, e.g. 'rr, ll' or ['XY', 'YX']. build 12-Sep-2018 15:30:25 + default '' (all). build 12-Sep-2018 15:30:25 + NB: In CASA v4.5, non-trivial correlation selection has build 12-Sep-2018 15:30:25 + been disabled since it was not working correctly, and build 12-Sep-2018 15:30:25 + it is likely undesirable to set the weights in a build 12-Sep-2018 15:30:25 + correlation-dependent way. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + observation -- Select by observation ID(s). build 12-Sep-2018 15:30:25 + default: '' = all build 12-Sep-2018 15:30:25 + datacolumn -- Which data column to calculate the scatter from build 12-Sep-2018 15:30:25 + default='corrected'; example: datacolumn='data' build 12-Sep-2018 15:30:25 + Options: 'data', 'corrected', 'model', 'float_data' build 12-Sep-2018 15:30:25 + note: 'corrected' will fall back to DATA if CORRECTED_DATA build 12-Sep-2018 15:30:25 + is absent. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/plotms.xml b/gcwrap/tasks/plotms.xml build 12-Sep-2018 15:30:25 index 1548448..ab5f4dd 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/plotms.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/plotms.xml build 12-Sep-2018 15:30:25 @@ -56,12 +56,12 @@ MS Parameters build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Number of subplot rows build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 + 1 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Number of subplot columns build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 + 1 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -74,10 +74,10 @@ MS Parameters build 12-Sep-2018 15:30:25 0 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Index to address a subplot (0-based) build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Index to address a subplot (0-based) build 12-Sep-2018 15:30:25 + 0 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -236,7 +236,7 @@ MS Parameters build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Data column to use for x-axis (blank for default/current). Note that residuals are complex (vector) differences or ratios. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -411,7 +411,7 @@ MS Parameters build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Data column to use for y-axis (blank for default/current). Note that residuals are complex (vector) differences or ratios. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -709,22 +709,22 @@ Iteration Parameters build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Iterated plots share a common x-axis label per column build 12-Sep-2018 15:30:25 + When True, iterated plots have a common x-axis range (scale). build 12-Sep-2018 15:30:25 False build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Iterated plots share a common y-axis label per row build 12-Sep-2018 15:30:25 + When True, iterated plots have a common y-axis range (scale). build 12-Sep-2018 15:30:25 False build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Iterated plots share a common x-axis. Must also set xselfscale=True. build 12-Sep-2018 15:30:25 + Iterated plots on a grid share a common external x-axis per column. Must also set xselfscale=True and gridrows>1. build 12-Sep-2018 15:30:25 False build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Iterated plots share a common y-axis. Must also set yselfscale=True. build 12-Sep-2018 15:30:25 + Iterated plots on a grid share a common external y-axis per row. Must also set yselfscale=True and gridcols>1. build 12-Sep-2018 15:30:25 False build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -992,7 +992,7 @@ Canvas Parameters build 12-Sep-2018 15:30:25 Legend position. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 upperRight build 12-Sep-2018 15:30:25 upperLeft build 12-Sep-2018 15:30:25 lowerRight build 12-Sep-2018 15:30:25 @@ -1063,17 +1063,17 @@ Export plot as image Parameters build 12-Sep-2018 15:30:25 ############################################################################### build 12-Sep-2018 15:30:25 --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Show GUI build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 + Show GUI build 12-Sep-2018 15:30:25 + True build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Remove any existing plots so new ones can replace them. build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 + Remove any existing plots so new ones can replace them. build 12-Sep-2018 15:30:25 + True build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Calibration library string or filename for on-the-fly calibration. build 12-Sep-2018 15:30:25 + Calibration library string or filename for on-the-fly calibration. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1426,7 +1426,7 @@ Constraints build 12-Sep-2018 15:30:25 False build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 @@ -1485,9 +1485,9 @@ Constraints build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + True build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 True build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1568,15 +1568,15 @@ Constraints build 12-Sep-2018 15:30:25 vis -- input MS or CalTable build 12-Sep-2018 15:30:25 default: '' (will merely launch the gui) build 12-Sep-2018 15:30:25 gridrows -- Number of subplot rows build 12-Sep-2018 15:30:25 - default: 1 build 12-Sep-2018 15:30:25 + default: 1 build 12-Sep-2018 15:30:25 gridcols -- Number of subplot columns build 12-Sep-2018 15:30:25 - default: 1 build 12-Sep-2018 15:30:25 + default: 1 build 12-Sep-2018 15:30:25 rowindex -- Row location of the subplot (0-based). build 12-Sep-2018 15:30:25 default: 0 build 12-Sep-2018 15:30:25 colindex -- Column location of the subplot (0-based). build 12-Sep-2018 15:30:25 default: 0 build 12-Sep-2018 15:30:25 plotindex -- Index to address a subplot (0-based). build 12-Sep-2018 15:30:25 - default: 0 build 12-Sep-2018 15:30:25 + default: 0 build 12-Sep-2018 15:30:25 xaxis, yaxis -- what to plot on the two axes build 12-Sep-2018 15:30:25 default: '' (defaults are xaxis='time', build 12-Sep-2018 15:30:25 yaxis='amp' on first execution; build 12-Sep-2018 15:30:25 @@ -1802,13 +1802,13 @@ Constraints build 12-Sep-2018 15:30:25 default: '' (no iteration) build 12-Sep-2018 15:30:25 options: 'scan','field','spw','baseline','antenna','time','corr','' build 12-Sep-2018 15:30:25 >>> iteraxis expandable parameters build 12-Sep-2018 15:30:25 - xselfscale -- If true, iterated plots should share a common x-axis label per column. build 12-Sep-2018 15:30:25 - yselfscale -- If true, iterated plots should share a common y-axis label per row. build 12-Sep-2018 15:30:25 - default: false, which will scale all plots globally build 12-Sep-2018 15:30:25 - xsharedaxis -- If true, iterated plots should share a common x-axis (must also set xselfscale=True) build 12-Sep-2018 15:30:25 - default: false, each plot will have its own x-axis. build 12-Sep-2018 15:30:25 - ysharedaxis -- If true, iterated plots should share a common y-axis (must also set yselfscale=True) build 12-Sep-2018 15:30:25 - default: false, each plot will have its own y-axis. build 12-Sep-2018 15:30:25 + xselfscale -- When True, iterated plots have a common x-axis range (scale). build 12-Sep-2018 15:30:25 + yselfscale -- When True, iterated plots have a common y-axis range (scale). build 12-Sep-2018 15:30:25 + default: false, which will scale all plots individually build 12-Sep-2018 15:30:25 + xsharedaxis -- Iterated plots on a grid share a common external x-axis per column (must also set xselfscale=True and gridcols>1) build 12-Sep-2018 15:30:25 + default: false, each plot will have its own x-axis. build 12-Sep-2018 15:30:25 + ysharedaxis -- Iterated plots on a grid share a common external y-axis per row (must also set yselfscale=True and gridrows>1) build 12-Sep-2018 15:30:25 + default: false, each plot will have its own y-axis. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 customsymbol -- If true, use a custom symbol for drawing unflagged points build 12-Sep-2018 15:30:25 default: False build 12-Sep-2018 15:30:25 @@ -1890,8 +1890,8 @@ Constraints build 12-Sep-2018 15:30:25 default: '' (plotfile extension will be used) build 12-Sep-2018 15:30:25 options: 'jpg', 'png', 'ps', 'pdf', 'txt' build 12-Sep-2018 15:30:25 exprange -- pages to export for iteration plots build 12-Sep-2018 15:30:25 - default: '' build 12-Sep-2018 15:30:25 - options: 'current', 'all' build 12-Sep-2018 15:30:25 + default: '' build 12-Sep-2018 15:30:25 + options: 'current', 'all' build 12-Sep-2018 15:30:25 highres -- use high resolution in exported plot build 12-Sep-2018 15:30:25 default: False (use screen resolution) build 12-Sep-2018 15:30:25 dpi -- DPI of exported plot build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/plotuv.xml b/gcwrap/tasks/plotuv.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 9da7faa..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/plotuv.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,135 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Plot the baseline distribution build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Plots the selected baselines of vis one field at a time, in kilowavelengths. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of input visibility file (MS) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select field using ID(s) or name(s) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data based on antenna/baseline build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select spectral window/channels build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select by observation ID(s) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select (sub)array(s) by array ID number build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Maximum number of points per plot. build 12-Sep-2018 15:30:25 - 100000 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - a list of matplotlib color codes build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - r build 12-Sep-2018 15:30:25 - y build 12-Sep-2018 15:30:25 - g build 12-Sep-2018 15:30:25 - b build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - A matplotlib plot symbol code build 12-Sep-2018 15:30:25 - , build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - How many times to cycle through colors per plot. build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Save the plotted figure(s) using this name build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Plots the uv coverage of vis in klambda. ncycles of colors will be build 12-Sep-2018 15:30:25 - allocated to representative wavelengths. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file build 12-Sep-2018 15:30:25 - default: none; example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - --- Data Selection (see help par.selectdata for more detailed build 12-Sep-2018 15:30:25 - information) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - field -- Select field using field id(s) or field name(s). build 12-Sep-2018 15:30:25 - [run listobs to obtain the list IDs or names] build 12-Sep-2018 15:30:25 - default: ''=all fields. If field is a non-negative build 12-Sep-2018 15:30:25 - integer, it is assumed to be a field index. build 12-Sep-2018 15:30:25 - Otherwise, it is assumed to be a field name build 12-Sep-2018 15:30:25 - field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 - field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 - field='3C286,3C295'; fields named 3C286 and 3C295 build 12-Sep-2018 15:30:25 - field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 - antenna -- Select data based on antenna/baseline build 12-Sep-2018 15:30:25 - default: '' (all) build 12-Sep-2018 15:30:25 - Non-negative integers are assumed to be antenna indices, and build 12-Sep-2018 15:30:25 - anything else is taken as an antenna name. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Examples: build 12-Sep-2018 15:30:25 - antenna='5&6': baseline between antenna index 5 and index 6. build 12-Sep-2018 15:30:25 - antenna='VA05&VA06': baseline between VLA antenna 5 and 6. build 12-Sep-2018 15:30:25 - antenna='5&6;7&8': baselines 5-6 and 7-8 build 12-Sep-2018 15:30:25 - antenna='5': all baselines with antenna 5 build 12-Sep-2018 15:30:25 - antenna='5,6,10': all baselines including antennas 5, 6, or 10 build 12-Sep-2018 15:30:25 - antenna='5,6,10&': all baselines with *only* antennas 5, 6, or build 12-Sep-2018 15:30:25 - 10. (cross-correlations only. Use && build 12-Sep-2018 15:30:25 - to include autocorrelations, and &&& build 12-Sep-2018 15:30:25 - to get only autocorrelations.) build 12-Sep-2018 15:30:25 - antenna='!ea03,ea12,ea17': all baselines except those that build 12-Sep-2018 15:30:25 - include EVLA antennas ea03, ea12, or build 12-Sep-2018 15:30:25 - ea17. build 12-Sep-2018 15:30:25 - spw -- Select spectral windows. Channel selection is ignored for now. build 12-Sep-2018 15:30:25 - default: ''=all spectral windows build 12-Sep-2018 15:30:25 - spw='0~2,4'; spectral windows 0,1,2,4 build 12-Sep-2018 15:30:25 - spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 - spw='0'; spw 0 build 12-Sep-2018 15:30:25 - spw='0,10,3'; spws 0, 10, and 3 build 12-Sep-2018 15:30:25 - observation -- Select by observation ID(s). default: '' = all build 12-Sep-2018 15:30:25 - array -- (Sub)array number range. default: ''=all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - maxnpts -- Save memory and/or screen space by plotting a maximum of maxnpts build 12-Sep-2018 15:30:25 - (or all of them if maxnpts < 1). There is a very sharp build 12-Sep-2018 15:30:25 - slowdown if the plotter starts swapping. build 12-Sep-2018 15:30:25 - default: 100000 build 12-Sep-2018 15:30:25 - colors -- a list of matplotlib color codes, used in order of decreasing build 12-Sep-2018 15:30:25 - visibility wavelength. build 12-Sep-2018 15:30:25 - default: ['r', 'y', 'g', 'b'] (red, yellow, green, blue) build 12-Sep-2018 15:30:25 - symb -- One of matplotlib's codes for plot symbols: .:,o^v<>s+xDd234hH|_ build 12-Sep-2018 15:30:25 - default: ',': The smallest points I could find. build 12-Sep-2018 15:30:25 - ncycles -- The number of times colors will be cycled through per plot. build 12-Sep-2018 15:30:25 - default: 1 build 12-Sep-2018 15:30:25 - figfile -- If not '', save the plots using names based on figfile. build 12-Sep-2018 15:30:25 - Example: if figfile is 'test.png', and field is '1,2,4', the plots build 12-Sep-2018 15:30:25 - will be saved to test_fld1.png, test_fld2.png, build 12-Sep-2018 15:30:25 - and test_fld4.png. build 12-Sep-2018 15:30:25 - default: '' (Do not save) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/plotweather.xml b/gcwrap/tasks/plotweather.xml build 12-Sep-2018 15:30:25 index 736d98c..3a5f893 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/plotweather.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/plotweather.xml build 12-Sep-2018 15:30:25 @@ -6,7 +6,7 @@ xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd build 12-Sep-2018 15:30:25 file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Plot elements of the weather table; estimate opacity. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -36,7 +36,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -Generates opacity estimates from both the weather data and a seasonal model; intended for VLA use only. build 12-Sep-2018 15:30:25 +Generates opacity estimates from both the weather data and a seasonal model; intended for VLA use only. build 12-Sep-2018 15:30:25 By default the returned opacity is the mean of these predictions, but this can be adjusted with seasonal_weight. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 These methods and models are described in detail in EVLA Memo 143, VLA Test Memo 232, VLA Scientific Memo 176, and references therein. build 12-Sep-2018 15:30:25 @@ -46,9 +46,9 @@ Custom plot filenames must end in one of: .png, .pdf, .ps, .eps or .svg build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 If run as a function, will return the mean zenith opacity per spectral window. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -The wind direction is defined as the direction where the wind is coming from. build 12-Sep-2018 15:30:25 +The wind direction is defined as the direction where the wind is coming from. build 12-Sep-2018 15:30:25 The wind direction is thus in the opposite side of the arrow, with north at build 12-Sep-2018 15:30:25 -the top and counterclockwise through west, south, and east. build 12-Sep-2018 15:30:25 +the top and counterclockwise through west, south, and east. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Written by Josh Marvil, revised 02/06/12 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/plotxy.xml b/gcwrap/tasks/plotxy.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 79464e6..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/plotxy.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,785 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - An X-Y plotter/interactive flagger for visibility data. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Selected data can be flexibly plotted with a wide variety build 12-Sep-2018 15:30:25 - of axes and averaging options, including iteration over build 12-Sep-2018 15:30:25 - antennas and fields. Data may be listed, flagged or build 12-Sep-2018 15:30:25 - unflagged interactively. The plots can be zoomed and build 12-Sep-2018 15:30:25 - also saved to a file. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - It is advisable to run flagmanager before using plotxy to build 12-Sep-2018 15:30:25 - flag data in order to save the current flag state before build 12-Sep-2018 15:30:25 - altering: build 12-Sep-2018 15:30:25 - flagmanager(vis='vis_name',mode='save',versionname='before_plotxy', build 12-Sep-2018 15:30:25 - comment=versionname) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of input visibility dataset build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - X-axis: def = \'time\': see help for options build 12-Sep-2018 15:30:25 - time build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - azimuth build 12-Sep-2018 15:30:25 - elevation build 12-Sep-2018 15:30:25 - hourangle build 12-Sep-2018 15:30:25 - parallacticangle build 12-Sep-2018 15:30:25 - baseline build 12-Sep-2018 15:30:25 - chan build 12-Sep-2018 15:30:25 - channel build 12-Sep-2018 15:30:25 - corr build 12-Sep-2018 15:30:25 - correlation build 12-Sep-2018 15:30:25 - freq build 12-Sep-2018 15:30:25 - frequency build 12-Sep-2018 15:30:25 - time build 12-Sep-2018 15:30:25 - velocity build 12-Sep-2018 15:30:25 - vel build 12-Sep-2018 15:30:25 - velo build 12-Sep-2018 15:30:25 - u build 12-Sep-2018 15:30:25 - v build 12-Sep-2018 15:30:25 - w build 12-Sep-2018 15:30:25 - uvdist build 12-Sep-2018 15:30:25 - x build 12-Sep-2018 15:30:25 - amp build 12-Sep-2018 15:30:25 - phase build 12-Sep-2018 15:30:25 - real build 12-Sep-2018 15:30:25 - imag build 12-Sep-2018 15:30:25 - weight build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Y-axis: def = \'amp\': see help for options build 12-Sep-2018 15:30:25 - amp build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - azimuth build 12-Sep-2018 15:30:25 - elevation build 12-Sep-2018 15:30:25 - hourangle build 12-Sep-2018 15:30:25 - parallacticangle build 12-Sep-2018 15:30:25 - baseline build 12-Sep-2018 15:30:25 - corr build 12-Sep-2018 15:30:25 - correlation build 12-Sep-2018 15:30:25 - u build 12-Sep-2018 15:30:25 - v build 12-Sep-2018 15:30:25 - w build 12-Sep-2018 15:30:25 - uvdist build 12-Sep-2018 15:30:25 - amp build 12-Sep-2018 15:30:25 - phase build 12-Sep-2018 15:30:25 - real build 12-Sep-2018 15:30:25 - imag build 12-Sep-2018 15:30:25 - weight build 12-Sep-2018 15:30:25 - time build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data (raw), corrected, model, residual (corrected - model) build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - corrected build 12-Sep-2018 15:30:25 - model build 12-Sep-2018 15:30:25 - residual build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Plot separate panels by field, antenna, baseline, scan, feed build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - More data selection parameters (antenna, timerange etc) build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - antenna/baselines: \'\'==>all, antenna = \'3,VA04\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Spectral windows:channels: \'\'==>all, spw=\'2:5~57\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Field names or field index numbers: \'\'==>all, field=\'0~2,3C286\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - uv range: \'\'==>all; uvrange = \'0~100klambda\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - time range: \'\'==>all, timerange=\'09:14:0~09:54:0\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - correlations: \'\'==>all, correlations=\'RR LL\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - scan numbers: \'\'==>all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - multi-feed numbers: Not yet implemented build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - (sub)array numbers: \'\'==>all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select averaging type: \'vector\', \'scalar\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - vector build 12-Sep-2018 15:30:25 - scalar build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - number of channels to average, default: \'1\', Also: \'all\', \'allspw\' build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Averaging time in seconds, default=\'0\', also: \'all\' build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - have time averaging cross over scans? build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - have averaging cross over baselines? build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - have averaging cross over arrays? build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - stack multiple spw on top of each other? build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - a frequency quanta or transition name. see help for options build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - frequency frame for spectral axis. see help for options build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - LSRK build 12-Sep-2018 15:30:25 - REST build 12-Sep-2018 15:30:25 - TOPO build 12-Sep-2018 15:30:25 - LSRD build 12-Sep-2018 15:30:25 - BARY build 12-Sep-2018 15:30:25 - GEO build 12-Sep-2018 15:30:25 - GALACTO build 12-Sep-2018 15:30:25 - LGROUP build 12-Sep-2018 15:30:25 - CMB build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - doppler mode. see help for options build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - RADIO build 12-Sep-2018 15:30:25 - Z build 12-Sep-2018 15:30:25 - RATIO build 12-Sep-2018 15:30:25 - BETA build 12-Sep-2018 15:30:25 - GAMMA build 12-Sep-2018 15:30:25 - OPTICAL build 12-Sep-2018 15:30:25 - TRUE build 12-Sep-2018 15:30:25 - RELATIVISTIC build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - have flagging extend to other data points? build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - extend flags based on correlation: \'\'==> selectdata,\'half\', or \'all\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - all build 12-Sep-2018 15:30:25 - half build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - extend flags based on channel: \'\'==> selectdata or \'all\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - extend flags based on spw: \'\'==> selectdata or \'all\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - extend flags based on antenna: \'\'==> selectdata or \'all\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - extend flags based on time: \'\'==> selectdata or \'all\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - all build 12-Sep-2018 15:30:25 - scan build 12-Sep-2018 15:30:25 - field build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Multipanel display scheme (yxn) build 12-Sep-2018 15:30:25 - 111 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Options include . : , o ^ v > < s + x D d 2 3 4 h H | _ build 12-Sep-2018 15:30:25 - . build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Plot color build 12-Sep-2018 15:30:25 - darkcyn build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Size of plotted marks build 12-Sep-2018 15:30:25 - 5.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Width of plotted lines build 12-Sep-2018 15:30:25 - 1.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The range of data to be plotted (see help) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - -1-1-1-1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Plot in different colors: Options: none, both, chan, corr build 12-Sep-2018 15:30:25 - corr build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - corr build 12-Sep-2018 15:30:25 - correlation build 12-Sep-2018 15:30:25 - none build 12-Sep-2018 15:30:25 - both build 12-Sep-2018 15:30:25 - chan build 12-Sep-2018 15:30:25 - channel build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select additional plotting options (e.g, fontsize, title,etc) build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Overplot on current plot (if possible) build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Replace the last plot or not when overplotting build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Specify if old plots are cleared or not build 12-Sep-2018 15:30:25 - Auto build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Current build 12-Sep-2018 15:30:25 - None build 12-Sep-2018 15:30:25 - Auto build 12-Sep-2018 15:30:25 - All build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Plot every nth point build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Plot title (above plot) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Label for x-axis build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Label for y-axis build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Font size for labels build 12-Sep-2018 15:30:25 - 10.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Window size: not yet implemented build 12-Sep-2018 15:30:25 - 1.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Show flagged data? build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Show plot on gui? build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - \'\'= no plot hardcopy, otherwise supply name build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Quit plotting? build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - LSRK build 12-Sep-2018 15:30:25 - RADIO build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 5.0 build 12-Sep-2018 15:30:25 - 1.0 build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - Auto build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 10.0 build 12-Sep-2018 15:30:25 - 5.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - An X-Y plotter/interactive flagger for visibility data. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Selected data can be flexibly plotted with a wide variety build 12-Sep-2018 15:30:25 - of axes and averaging options, including iteration over build 12-Sep-2018 15:30:25 - antennas and fields. Data may be listed, flagged or build 12-Sep-2018 15:30:25 - unflagged interactively. The plots can be zoomed and build 12-Sep-2018 15:30:25 - also saved to a file. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - It is advisable to run flagmanager before using plotxy to build 12-Sep-2018 15:30:25 - flag data in order to save the current flag state before build 12-Sep-2018 15:30:25 - altering: build 12-Sep-2018 15:30:25 - flagmanager(vis='vis_name',mode='save',versionname='before_plotxy', build 12-Sep-2018 15:30:25 - comment=versionname) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - See hints on using plotxy at the end. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file build 12-Sep-2018 15:30:25 - default: none. example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - xaxis -- Visibility data to plot along the x-axis build 12-Sep-2018 15:30:25 - default: 'time' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Options for BOTH x-axis and y-axis build 12-Sep-2018 15:30:25 - 'time','uvdist','chan', 'corr','freq','velo', 'u','v','w', build 12-Sep-2018 15:30:25 - 'azimuth','elevation','baseline','hourangle','parallacticangle' build 12-Sep-2018 15:30:25 - 'amp','phase','real','imag','weight'. 'x' gives antenna array build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - yaxis -- Visibility data to plot along the y-axis build 12-Sep-2018 15:30:25 - default: 'amp' build 12-Sep-2018 15:30:25 - Options: same as on xaxis: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - >>> yaxis expandable parameter build 12-Sep-2018 15:30:25 - datacolumn -- Visibility file data column build 12-Sep-2018 15:30:25 - Note: this parameter is automatically shown whenever the build 12-Sep-2018 15:30:25 - chosen yaxis is a data quantity (i.e. amp) build 12-Sep-2018 15:30:25 - default: 'data'; example: datacolumn='model' build 12-Sep-2018 15:30:25 - Options: 'data' (raw),'corrected','model','residual'(corrected-model) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - --- Data Selection (see help par.selectdata for more detailed information) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - field -- Select field using field id(s) or field name(s). build 12-Sep-2018 15:30:25 - ['go listobs' to obtain the list id's or names] build 12-Sep-2018 15:30:25 - default: ''=all fields build 12-Sep-2018 15:30:25 - If field string is a non-negative integer, it is assumed to build 12-Sep-2018 15:30:25 - be a field index otherwise, it is assumed to be a field name build 12-Sep-2018 15:30:25 - field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 - field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 - field='3C286,3C295'; field named 3C286 and 3C295 build 12-Sep-2018 15:30:25 - field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 - spw -- Select spectral window/channels build 12-Sep-2018 15:30:25 - spw='0~2,4'; spectral windows 0,1,2,4 (all channels) build 12-Sep-2018 15:30:25 - spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 - spw='0:5~61'; spw 0, channels 5 to 61, INCLUSIVE build 12-Sep-2018 15:30:25 - spw='*:5~61'; all spw with channels 5 to 61 build 12-Sep-2018 15:30:25 - spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, channels 3 to 45. build 12-Sep-2018 15:30:25 - spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. build 12-Sep-2018 15:30:25 - spw='0:0~10;15~60'; spectral window 0 with channels 0-10,15-60 build 12-Sep-2018 15:30:25 - NOTE ';' to separate channel selections build 12-Sep-2018 15:30:25 - spw='0:0~10^2,1:20~30^5'; spw 0, channels 0,2,4,6,8,10, build 12-Sep-2018 15:30:25 - spw 1, channels 20,25,30 build 12-Sep-2018 15:30:25 - selectdata -- Other data selection parameters build 12-Sep-2018 15:30:25 - default: True build 12-Sep-2018 15:30:25 - >>> selectdata expandable parameters build 12-Sep-2018 15:30:25 - timerange -- Select data based on time range: build 12-Sep-2018 15:30:25 - default = '' (all); examples, build 12-Sep-2018 15:30:25 - timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss' build 12-Sep-2018 15:30:25 - Note: if YYYY/MM/DD is missing date defaults to first day in data set build 12-Sep-2018 15:30:25 - timerange='09:14:0~09:54:0' picks 40 min on first day build 12-Sep-2018 15:30:25 - timerange= '25:00:00~27:30:00' picks 1 hr to 3 hr 30min on next day build 12-Sep-2018 15:30:25 - timerange='09:44:00' data within one integration of time build 12-Sep-2018 15:30:25 - timerange='>10:24:00' data after this time build 12-Sep-2018 15:30:25 - antenna -- Select data based on antenna/baseline build 12-Sep-2018 15:30:25 - default: ''=all build 12-Sep-2018 15:30:25 - If antenna string is a non-negative integer, it is assumed build 12-Sep-2018 15:30:25 - to be an antenna index, otherwise it is assumed to be an build 12-Sep-2018 15:30:25 - antenna name build 12-Sep-2018 15:30:25 - antenna='5&6'; baseline between antenna index 5 and index 6. build 12-Sep-2018 15:30:25 - antenna='VA05&VA06'; baseline between VLA antenna 5 and 6. build 12-Sep-2018 15:30:25 - antenna='5&6;7&8'; baseline 5-6 and 7-8 build 12-Sep-2018 15:30:25 - antenna='5'; all baselines with antenna index 5 build 12-Sep-2018 15:30:25 - antenna= '05'; all baselines with antenna named 05 build 12-Sep-2018 15:30:25 - antenna='5,6,9'; all baselines with antennas indices 5,6 and 9 build 12-Sep-2018 15:30:25 - correlation -- Select correlations: build 12-Sep-2018 15:30:25 - default: '' = all correlations. Other options are any combination build 12-Sep-2018 15:30:25 - of values from one of the valid lists: build 12-Sep-2018 15:30:25 - 'RR','LL','RL','LR','RR LL','RL LR', build 12-Sep-2018 15:30:25 - 'XX','YY','XY','YX','XX YY','XY YX' build 12-Sep-2018 15:30:25 - uvrange -- Select data within uvrange (default units meters) build 12-Sep-2018 15:30:25 - default: ''=all; example: build 12-Sep-2018 15:30:25 - uvrange='0~1000klambda'; uvrange from 0-1000 kilo-lambda build 12-Sep-2018 15:30:25 - uvrange='>4klambda';uvranges greater than 4 kilo-lambda build 12-Sep-2018 15:30:25 - uvrange='0~1000km'; uvrange in kilometers build 12-Sep-2018 15:30:25 - scan -- Scan number range build 12-Sep-2018 15:30:25 - array -- (Sub)-array number range - under development build 12-Sep-2018 15:30:25 - feed -- Multi-feed number range - under development build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - averagemode -- Select average mode build 12-Sep-2018 15:30:25 - default: 'vector' build 12-Sep-2018 15:30:25 - Options: 'vector' = average over real and image part separately. build 12-Sep-2018 15:30:25 - 'scalar' = scalar average of amplitude, vector build 12-Sep-2018 15:30:25 - average of the phase. build 12-Sep-2018 15:30:25 - '' = no averaging build 12-Sep-2018 15:30:25 - >>> averagemode expandable parameters build 12-Sep-2018 15:30:25 - timebin -- length of time intervals to average build 12-Sep-2018 15:30:25 - default: '0'= no time averaging build 12-Sep-2018 15:30:25 - example: timebin='60' (average over 60 second interval). build 12-Sep-2018 15:30:25 - example: timebin='all' (all times obeying other selection build 12-Sep-2018 15:30:25 - parameters, i.e. timerange and crossscans) build 12-Sep-2018 15:30:25 - crossscans -- Have time averaging cross scan boundaries? build 12-Sep-2018 15:30:25 - default: False=time averaging does not cross scan boundaries build 12-Sep-2018 15:30:25 - crossbls -- Have averaging cross baseline boundaries? build 12-Sep-2018 15:30:25 - default: False= averaging does not cross baseline boundaries build 12-Sep-2018 15:30:25 - crossarrays -- Have averaging cross array boundaries? build 12-Sep-2018 15:30:25 - default: False=averaging does not cross array boundaries build 12-Sep-2018 15:30:25 - stackspw -- Stack multiple spw on top of each other? build 12-Sep-2018 15:30:25 - default: False= layout spws side-by-side for xaxis='channel' build 12-Sep-2018 15:30:25 - width -- number of channels to average build 12-Sep-2018 15:30:25 - default: '1'= no channel averaging build 12-Sep-2018 15:30:25 - example: width='32' (average 32 channels together). build 12-Sep-2018 15:30:25 - example: width='all' (all channels within each selected spw) build 12-Sep-2018 15:30:25 - example: width='allspw' (all channels and all spw averaged.) build 12-Sep-2018 15:30:25 - restfreq -- Set rest frequency or transition name build 12-Sep-2018 15:30:25 - options: (str) '' a frequency quanta or transition name build 12-Sep-2018 15:30:25 - default: currently set rest frequency and frame in MS build 12-Sep-2018 15:30:25 - see measures for known lines, e.g. build 12-Sep-2018 15:30:25 - me.linelist() to list lines build 12-Sep-2018 15:30:25 - me.me.spectralline to get frequency build 12-Sep-2018 15:30:25 - example: restfreq='1420405751.786Hz' 21cm HI frequency build 12-Sep-2018 15:30:25 - restfreq='HI' 21cm HI transition name build 12-Sep-2018 15:30:25 - restfreq='115.2712GHz' CO line build 12-Sep-2018 15:30:25 - >>> restfreq expandable parameters build 12-Sep-2018 15:30:25 - frame -- frequency frame for spectral axis build 12-Sep-2018 15:30:25 - options: (str) 'LSRK','REST','TOPO','LSRD','BARY', build 12-Sep-2018 15:30:25 - 'GEO','GALACTO','LGROUP','CMB' build 12-Sep-2018 15:30:25 - default: currently set frequency frame in MS build 12-Sep-2018 15:30:25 - see measures (me.frequency) for description build 12-Sep-2018 15:30:25 - doppler -- doppler mode build 12-Sep-2018 15:30:25 - options: (str) 'RADIO','Z','RATIO','BETA','GAMMA', build 12-Sep-2018 15:30:25 - 'OPTICAL','TRUE','RELATIVISTIC' build 12-Sep-2018 15:30:25 - default: currently set doppler system in MS build 12-Sep-2018 15:30:25 - see measures (me.doppler) for description build 12-Sep-2018 15:30:25 - extendflag -- flagging extension parameters build 12-Sep-2018 15:30:25 - default: False= no extension, only flag selected data; build 12-Sep-2018 15:30:25 - example: extendflag=True build 12-Sep-2018 15:30:25 - >>> extendflag expandable parameters build 12-Sep-2018 15:30:25 - extendcorr -- Extend flagging based on correlation: build 12-Sep-2018 15:30:25 - default: ''= no correlation based extension build 12-Sep-2018 15:30:25 - examples: build 12-Sep-2018 15:30:25 - extendcorr = 'all' build 12-Sep-2018 15:30:25 - extendcorr = 'half' flags RR and LL build 12-Sep-2018 15:30:25 - extendchan -- Extend flagging based on channel: build 12-Sep-2018 15:30:25 - default: ''= no channel based extension build 12-Sep-2018 15:30:25 - example: build 12-Sep-2018 15:30:25 - extendchan = 'all' build 12-Sep-2018 15:30:25 - extendspw -- Extend flagging based on spectral window: build 12-Sep-2018 15:30:25 - default: '' = no spectral window based extension build 12-Sep-2018 15:30:25 - example: build 12-Sep-2018 15:30:25 - extendspw = 'all' build 12-Sep-2018 15:30:25 - extendant -- Extend flagging based on antenna (baseline): build 12-Sep-2018 15:30:25 - default: ''= no antenna based extension build 12-Sep-2018 15:30:25 - example: build 12-Sep-2018 15:30:25 - extendant = 'all' build 12-Sep-2018 15:30:25 - extendtime -- Extend flagging based on time: build 12-Sep-2018 15:30:25 - default: ''= no time based extension build 12-Sep-2018 15:30:25 - example: build 12-Sep-2018 15:30:25 - extendant = 'all' build 12-Sep-2018 15:30:25 - subplot -- Panel number on the display screen build 12-Sep-2018 15:30:25 - default: 111 (full screen display); example: build 12-Sep-2018 15:30:25 - if iteration is non-blank, then build 12-Sep-2018 15:30:25 - subplot=yx1 window will produce y by x plots in the window. build 12-Sep-2018 15:30:25 - if iteration = '', then build 12-Sep-2018 15:30:25 - subplot=yxn; means the window will have y rows, and x columns build 12-Sep-2018 15:30:25 - with the present execution placing the plot in location n build 12-Sep-2018 15:30:25 - n = 1,..., xy, in order upper left to right, then down. An build 12-Sep-2018 15:30:25 - example is the plotting of four fields on one frame build 12-Sep-2018 15:30:25 - field='0'; subplot=221; plotxy() build 12-Sep-2018 15:30:25 - field='1'; subplot=222; plotxy() build 12-Sep-2018 15:30:25 - field='2'; subplot=223; plotxy() build 12-Sep-2018 15:30:25 - field='3'; subplot=224; plotxy() build 12-Sep-2018 15:30:25 - overplot -- Overplot on current plot (if possible) build 12-Sep-2018 15:30:25 - default: False; example: overplot= True build 12-Sep-2018 15:30:25 - showflags -- Show the flagged and unflagged data. build 12-Sep-2018 15:30:25 - default: False; example: showflags=True build 12-Sep-2018 15:30:25 - iteration -- Iterate plots: build 12-Sep-2018 15:30:25 - default: ''; no iteration build 12-Sep-2018 15:30:25 - Options: 'field', 'antenna', 'baseline'. build 12-Sep-2018 15:30:25 - Use the 'NEXT' button on gui to iterate through values. build 12-Sep-2018 15:30:25 - To abort an iteration, close the gui window. build 12-Sep-2018 15:30:25 - plotsymbol -- plot symbol. (Options include .:,o^v><s+xDd234hH|_ or build 12-Sep-2018 15:30:25 - optionally preceded by one of color code k, r, g, b, c, y) build 12-Sep-2018 15:30:25 - default: '.': points, medium-sized dots build 12-Sep-2018 15:30:25 - example: plotsymbol='bo' (blue points, large-sized dots build 12-Sep-2018 15:30:25 - r=red, b=blue, g=green, y=yellow build 12-Sep-2018 15:30:25 - ',' = small points build 12-Sep-2018 15:30:25 - '.' = medium points build 12-Sep-2018 15:30:25 - 'o' = large points build 12-Sep-2018 15:30:25 - plotcolor -- color. Overrides plotsymbol color settings. build 12-Sep-2018 15:30:25 - default: 'darkcyan' build 12-Sep-2018 15:30:25 - example: plotcolor='g' (green) build 12-Sep-2018 15:30:25 - plotcolor='slateblue' build 12-Sep-2018 15:30:25 - plotcolor='#7FFF34' (RGB tuple) build 12-Sep-2018 15:30:25 - multicolor -- Multi-color plotting of channels and correlations build 12-Sep-2018 15:30:25 - options: 'none','both','chan','corr' build 12-Sep-2018 15:30:25 - default: 'corr'; example: multicolor='chan' build 12-Sep-2018 15:30:25 - plotrange -- Specifies the size of the plot [xmin, xmax, ymin, ymax] build 12-Sep-2018 15:30:25 - default: [0,0,0,0]; Range is self-selected build 12-Sep-2018 15:30:25 - example: [0,0,0.00,0.20] only y axis is specified build 12-Sep-2018 15:30:25 - To use a time range (NOTE: somewhat different sytax from timerange build 12-Sep-2018 15:30:25 - ['22:23:24, 23:42:20', 0.02, 0.20] build 12-Sep-2018 15:30:25 - The day must be included if the visibility data span more than one day build 12-Sep-2018 15:30:25 - ['1997/05/09/22:02:00, 1997/05/09/23:00:00', 0.02, 0.20] build 12-Sep-2018 15:30:25 - selectplot -- Additional plot control parameters build 12-Sep-2018 15:30:25 - default: False; example: selectplot=true build 12-Sep-2018 15:30:25 - >>> selectplot expandable parameters build 12-Sep-2018 15:30:25 - markersize -- Size of the plotted marks build 12-Sep-2018 15:30:25 - default: 5.0; example: markersize=10.0 build 12-Sep-2018 15:30:25 - linewidth -- Width of plotted lines. build 12-Sep-2018 15:30:25 - default: 1; example: linewidth=2.0 build 12-Sep-2018 15:30:25 - skipnrows -- # of points to skip build 12-Sep-2018 15:30:25 - default: 0 build 12-Sep-2018 15:30:25 - example: skipnrows=100 (plots every 100th point) build 12-Sep-2018 15:30:25 - newplot -- When overplotting, replace the last plot only build 12-Sep-2018 15:30:25 - default: False; can be useful when doing subplots build 12-Sep-2018 15:30:25 - clearpanel -- Clear nothing on the plot window, automatically build 12-Sep-2018 15:30:25 - clear plotting area, clear the current plot area, or build 12-Sep-2018 15:30:25 - clear the whole plot panel. build 12-Sep-2018 15:30:25 - options: None, Auto, Current, All build 12-Sep-2018 15:30:25 - default: Auto build 12-Sep-2018 15:30:25 - example: clearpanel='Current' build 12-Sep-2018 15:30:25 - title -- Plot title (above plot) build 12-Sep-2018 15:30:25 - default: ''; example: title='This is my title' build 12-Sep-2018 15:30:25 - xlabels -- Label for x axis build 12-Sep-2018 15:30:25 - default: ''; example: xlabels='X Axis' build 12-Sep-2018 15:30:25 - ylabels -- Label for y axis build 12-Sep-2018 15:30:25 - default: ''; example: ylabels='Y Axis' build 12-Sep-2018 15:30:25 - fontsize -- Font size for labels build 12-Sep-2018 15:30:25 - default: 10; example: fontsize=2 build 12-Sep-2018 15:30:25 - windowsize -- Window size build 12-Sep-2018 15:30:25 - default: 1.0; not yet implemented build 12-Sep-2018 15:30:25 - interactive -- turn on/off on screen display build 12-Sep-2018 15:30:25 - options: True = interactively flag data build 12-Sep-2018 15:30:25 - False = direct output to a file without on screen display build 12-Sep-2018 15:30:25 - default: True; build 12-Sep-2018 15:30:25 - figfile -- File name to save the plotted figure to. build 12-Sep-2018 15:30:25 - default: '' = do not save figure; build 12-Sep-2018 15:30:25 - example: figfile='myPlot.png' save figure to png file build 12-Sep-2018 15:30:25 - figfile='myPlot.txt' append plotted xy to an ascii file build 12-Sep-2018 15:30:25 - end -- File name to save the plotted figure to. build 12-Sep-2018 15:30:25 - default: False = do not quit, keep plotting; build 12-Sep-2018 15:30:25 - example: end=True no more plotting to do build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Hints on using plotxy (see section 3.4 in cookbook) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Useful Buttons at bottom left: build 12-Sep-2018 15:30:25 - 5th--magnifying glass. Click on this, build 12-Sep-2018 15:30:25 - left mouse button rectangle drag will zoom build 12-Sep-2018 15:30:25 - right mose button rectangle drag will unzoom a certain amount build 12-Sep-2018 15:30:25 - 1st--restore original magnification build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Useful regions just above: build 12-Sep-2018 15:30:25 - Quit will terminate plotter build 12-Sep-2018 15:30:25 - Next will go to next plot as specified by iteration build 12-Sep-2018 15:30:25 - To flag, unflag, locate, you must click 'Mark Region' first build 12-Sep-2018 15:30:25 - then make appropriate region(s) build 12-Sep-2018 15:30:25 - then click flag, unflag, locate for the desired operation build 12-Sep-2018 15:30:25 - plot will then refrest build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/predictcomp.xml b/gcwrap/tasks/predictcomp.xml build 12-Sep-2018 15:30:25 index 4be27c9..7f9c4a7 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/predictcomp.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/predictcomp.xml build 12-Sep-2018 15:30:25 @@ -28,6 +28,8 @@ build 12-Sep-2018 15:30:25 Flux density standard build 12-Sep-2018 15:30:25 Butler-JPL-Horizons 2010 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + Perley-Butler 2017 build 12-Sep-2018 15:30:25 + Perley-Butler 2013 build 12-Sep-2018 15:30:25 Perley-Butler 2010 build 12-Sep-2018 15:30:25 Perley-Taylor 99 build 12-Sep-2018 15:30:25 Baars build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/sdgaincal.xml b/gcwrap/tasks/sdgaincal.xml build 12-Sep-2018 15:30:25 index 03a0b97..804c495 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/sdgaincal.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/sdgaincal.xml build 12-Sep-2018 15:30:25 @@ -8,7 +8,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 MS SD gain calibration task build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -62,7 +62,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 select data by scan numbers, e.g. "21~23" (""=all) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 select data by observation intent, e.g. "OBSERVE_TARGET#ON_SOURCE" (""=all) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -123,7 +123,7 @@ calmode -- Gain calibration mode. Currently, only 'doublecircle' is supported. build 12-Sep-2018 15:30:25 default: 'doublecircle' build 12-Sep-2018 15:30:25 >>> calmode expandable parameter build 12-Sep-2018 15:30:25 radius -- Radius of the central region for double circle calibration. build 12-Sep-2018 15:30:25 - Default ('') is a radius of the primary beam. If numeric value build 12-Sep-2018 15:30:25 + Default ('') is a radius of the primary beam. If numeric value build 12-Sep-2018 15:30:25 is given, it is interpreted as a value in arcsec. build 12-Sep-2018 15:30:25 default: '' build 12-Sep-2018 15:30:25 options: '20arcsec', 20.0 build 12-Sep-2018 15:30:25 @@ -161,10 +161,10 @@ applytable -- List of sky/Tsys calibration tables you want to pre-apply. build 12-Sep-2018 15:30:25 default: '' build 12-Sep-2018 15:30:25 >>> applytable expandable parameter build 12-Sep-2018 15:30:25 interp -- Interpolation type (in time[,freq]) to use for each gaintable. build 12-Sep-2018 15:30:25 - When frequency interpolation is relevant (bandpass solutions, build 12-Sep-2018 15:30:25 + When frequency interpolation is relevant (bandpass solutions, build 12-Sep-2018 15:30:25 frequency-dependent polcal solutions, ALMA Tsys) build 12-Sep-2018 15:30:25 separate time-dependent and freq-dependent interp build 12-Sep-2018 15:30:25 - types with a comma (freq _after_ the comma). build 12-Sep-2018 15:30:25 + types with a comma (freq _after_ the comma). build 12-Sep-2018 15:30:25 Specifications for frequency are ignored when the build 12-Sep-2018 15:30:25 calibration table has no channel-dependence. build 12-Sep-2018 15:30:25 Time-dependent interp options ending in 'PD' enable a build 12-Sep-2018 15:30:25 @@ -199,14 +199,14 @@ applytable -- List of sky/Tsys calibration tables you want to pre-apply. build 12-Sep-2018 15:30:25 Example: spwmap=[0,0,1,1] means apply the caltable solutions build 12-Sep-2018 15:30:25 from spw = 0 to the spw 0,1 and spw 1 to spw 2,3. build 12-Sep-2018 15:30:25 spwmap=[[0,0,1,1],[0,1,0,1]] (for multiple gaintables) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Complicated example: build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 gaintable=['tab1','tab2','tab3'] build 12-Sep-2018 15:30:25 gainfield='3C286' build 12-Sep-2018 15:30:25 interp=['linear','nearest'] build 12-Sep-2018 15:30:25 spwmap=[[],[0,0,2]] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 This means: apply 3 cal tables, selecting only solutions for 3C286 build 12-Sep-2018 15:30:25 from tab1 (but all fields from tab2 and tab3, indicated by build 12-Sep-2018 15:30:25 no gainfield entry for these files). Linear interpolation build 12-Sep-2018 15:30:25 @@ -214,36 +214,36 @@ applytable -- List of sky/Tsys calibration tables you want to pre-apply. build 12-Sep-2018 15:30:25 use nearest. For the 'tab2', the calibration spws map build 12-Sep-2018 15:30:25 will be mapped to the data spws according to 0->0, 0->1, 2->2. build 12-Sep-2018 15:30:25 (I.e., for data spw=0 and 2, the spw mapping is one to one, build 12-Sep-2018 15:30:25 - but data spw 1 will be calibrated by solutions from spw 0.) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + but data spw 1 will be calibrated by solutions from spw 0.) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 outfile -- Name of output caltable. build 12-Sep-2018 15:30:25 - default: '' (<infile>_<suffix> for calibration) build 12-Sep-2018 15:30:25 + default: '' (<infile>_<suffix> for calibration) build 12-Sep-2018 15:30:25 overwrite -- overwrite the output caltable if already exists build 12-Sep-2018 15:30:25 options: (bool) True,False build 12-Sep-2018 15:30:25 default: False build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 DESCRIPTION: build 12-Sep-2018 15:30:25 -sdgaincal computes and removes a time-dependent gain variation in single-dish build 12-Sep-2018 15:30:25 -data on a per-spectral-window and per-antenna basis. Presently the task build 12-Sep-2018 15:30:25 -operates only on data taken with the ALMA fast-mapped, double-circle build 12-Sep-2018 15:30:25 -observation modes [1]. This task exploits the fact that the double-circle mode build 12-Sep-2018 15:30:25 -observes the same position in the center of the mapped field, approximately build 12-Sep-2018 15:30:25 -circular every sub-cycle, and normalizes the gains throughout the entire build 12-Sep-2018 15:30:25 +sdgaincal computes and removes a time-dependent gain variation in single-dish build 12-Sep-2018 15:30:25 +data on a per-spectral-window and per-antenna basis. Presently the task build 12-Sep-2018 15:30:25 +operates only on data taken with the ALMA fast-mapped, double-circle build 12-Sep-2018 15:30:25 +observation modes [1]. This task exploits the fact that the double-circle mode build 12-Sep-2018 15:30:25 +observes the same position in the center of the mapped field, approximately build 12-Sep-2018 15:30:25 +circular every sub-cycle, and normalizes the gains throughout the entire build 12-Sep-2018 15:30:25 dataset, relative to the measured brightness at the center position. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -Note that this gain calibration task is done independently of the atmosphere build 12-Sep-2018 15:30:25 -(i.e. Tsys) and sky calibration steps. This can be applied through the sdcal build 12-Sep-2018 15:30:25 -task. Alternatively, you can pass those caltables to applytable parameter to build 12-Sep-2018 15:30:25 -apply them on-the-fly prior to gain calibration. build 12-Sep-2018 15:30:25 +Note that this gain calibration task is done independently of the atmosphere build 12-Sep-2018 15:30:25 +(i.e. Tsys) and sky calibration steps. This can be applied through the sdcal build 12-Sep-2018 15:30:25 +task. Alternatively, you can pass those caltables to applytable parameter to build 12-Sep-2018 15:30:25 +apply them on-the-fly prior to gain calibration. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Presently, this task has only one calibration mode: calmode='doublecircle'. build 12-Sep-2018 15:30:25 -In this mode, the size of the region that CASA regards as "the center" is build 12-Sep-2018 15:30:25 -user-configurable via the expandable 'radius' (in arcsec) parameter (under build 12-Sep-2018 15:30:25 -'calmode'). The default is to use the size of the primary beam. The data can build 12-Sep-2018 15:30:25 -also be smoothed in the time domain, prior to computation of the gain variation. build 12-Sep-2018 15:30:25 -Selection is by specral window/channels, field IDs, and antenna through the spw, build 12-Sep-2018 15:30:25 -field, and antenna selection parameters. The default is to use all data for the build 12-Sep-2018 15:30:25 +In this mode, the size of the region that CASA regards as "the center" is build 12-Sep-2018 15:30:25 +user-configurable via the expandable 'radius' (in arcsec) parameter (under build 12-Sep-2018 15:30:25 +'calmode'). The default is to use the size of the primary beam. The data can build 12-Sep-2018 15:30:25 +also be smoothed in the time domain, prior to computation of the gain variation. build 12-Sep-2018 15:30:25 +Selection is by specral window/channels, field IDs, and antenna through the spw, build 12-Sep-2018 15:30:25 +field, and antenna selection parameters. The default is to use all data for the build 12-Sep-2018 15:30:25 gain calibration. The caltable can be output with the 'outfile' parameter. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 REFERENCE: build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/sdsidebandsplit.xml b/gcwrap/tasks/sdsidebandsplit.xml build 12-Sep-2018 15:30:25 index a3e5244..1c616f2 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/sdsidebandsplit.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/sdsidebandsplit.xml build 12-Sep-2018 15:30:25 @@ -65,13 +65,13 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 False build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - reference pixel of spectral axis in image sideband build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + reference channel of spectral axis in image sideband build 12-Sep-2018 15:30:25 0.0 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - frequency at the reference pixel of spectral axis in image sideband (e.g., "100GHz") build 12-Sep-2018 15:30:25 + frequency at the reference channel of spectral axis in image sideband (e.g., "100GHz") build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -95,7 +95,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 + 0.0 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -118,7 +118,7 @@ Solve both signal and image sidebands (need to set frequency of image sideband e build 12-Sep-2018 15:30:25 sdsidebandsplit(imagename=['shift_0ch.image', 'shift_132ch.image', 'shift_neg81ch.image'], build 12-Sep-2018 15:30:25 outfile='separated.image', signalshift=[0.0, +132.0, -81.0], build 12-Sep-2018 15:30:25 imageshift=[0.0, -132.0, +81.0], build 12-Sep-2018 15:30:25 - getbothside=True, refpix=0.0, refval='805.8869GHz') build 12-Sep-2018 15:30:25 + getbothside=True, refchan=0.0, refval='805.8869GHz') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The output images are 'separated.image.signalband' and 'separated.image.imageband' build 12-Sep-2018 15:30:25 for signal and image sideband, respectively. build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/setjy.xml b/gcwrap/tasks/setjy.xml build 12-Sep-2018 15:30:25 index 59db061..046b2d0 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/setjy.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/setjy.xml build 12-Sep-2018 15:30:25 @@ -90,8 +90,9 @@ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Flux density standard build 12-Sep-2018 15:30:25 - Perley-Butler 2013 build 12-Sep-2018 15:30:25 + Perley-Butler 2017 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + Perley-Butler 2017 build 12-Sep-2018 15:30:25 Perley-Butler 2013 build 12-Sep-2018 15:30:25 Perley-Butler 2010 build 12-Sep-2018 15:30:25 Perley-Taylor 99 build 12-Sep-2018 15:30:25 @@ -207,6 +208,14 @@ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + False build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + nearest build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -405,13 +414,14 @@ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 standard -- Flux density standard, used if fluxdensity[0] < 0.0 build 12-Sep-2018 15:30:25 - default: 'Perley-Butler 2013'; example: standard='Baars' build 12-Sep-2018 15:30:25 + default: 'Perley-Butler 2017'; example: standard='Baars' build 12-Sep-2018 15:30:25 Options: 'Baars', build 12-Sep-2018 15:30:25 'Perley 90', build 12-Sep-2018 15:30:25 'Perley-Taylor 95', build 12-Sep-2018 15:30:25 'Perley-Taylor 99', build 12-Sep-2018 15:30:25 'Perley-Butler 2010', build 12-Sep-2018 15:30:25 'Perley-Butler 2013', build 12-Sep-2018 15:30:25 + 'Perley-Butler 2017', build 12-Sep-2018 15:30:25 'Scaife-Heald 2012', build 12-Sep-2018 15:30:25 'Stevens-Reynolds 2016', build 12-Sep-2018 15:30:25 'Butler-JPL-Horizons 2010', build 12-Sep-2018 15:30:25 @@ -431,25 +441,40 @@ build 12-Sep-2018 15:30:25 (also case insensitive) and it recognizes as long as the field name build 12-Sep-2018 15:30:25 contains the string listed below (e.g. 'PKS 1934-638' works). build 12-Sep-2018 15:30:25 For 3C Name, a space or an underscore between 3C and the number build 12-Sep-2018 15:30:25 - (e.g. '3C 286' and '3C_286') also works. If the matching by build 12-Sep-2018 15:30:25 + (e.g. '3C 286' and '3C_286') also works. For the sources containing build 12-Sep-2018 15:30:25 + the name of the constellation, common abberiviation also works build 12-Sep-2018 15:30:25 + (e.g 'Cas-A', 'Cas A', 'CasA' and 'Cas_A'). If the matching by build 12-Sep-2018 15:30:25 the field name fails, the task tries to match by its position to build 12-Sep-2018 15:30:25 the known calibrator list stored in the data directory build 12-Sep-2018 15:30:25 (~/data/nrao/VLA/standards/fluxscalibrator.data). build 12-Sep-2018 15:30:25 - ------------------------------------------------------------- build 12-Sep-2018 15:30:25 - 3C Name B1950 Name J2000 Name Alt. J2000 Name standards* build 12-Sep-2018 15:30:25 - 3C48 0134+329 0137+331 J0137+3309 1,2,3,4,5,6,7 build 12-Sep-2018 15:30:25 - 3C123 0433+295 0437+296 J0437+2940 2 build 12-Sep-2018 15:30:25 - 3C138 0518+165 0521+166 J0521+1638 1,2,3,4,5,6 build 12-Sep-2018 15:30:25 - 3C147 0538+498 0542+498 J0542+4951 1,2,3,4,5,6,7 build 12-Sep-2018 15:30:25 - 3C196 0809+483 0813+482 J0813+4813 1,2,7 build 12-Sep-2018 15:30:25 - 3C286 1328+307 1331+305 J1331+3030 1,2,3,4,5,6,7 build 12-Sep-2018 15:30:25 - 3C295 1409+524 1411+522 J1411+5212 1,2,3,4,5,6,7 build 12-Sep-2018 15:30:25 - - 1934-638 - J1939-6342 1,3,4,5,6,8 build 12-Sep-2018 15:30:25 - 3C380 1828+487 1829+487 J1829+4845 7 build 12-Sep-2018 15:30:25 - ------------------------------------------------------------- build 12-Sep-2018 15:30:25 + ----------------------------------------------------------------------- build 12-Sep-2018 15:30:25 + 3C/Common Name B1950 Name J2000 Name Alt. J2000 Name standards* build 12-Sep-2018 15:30:25 + - - - J0133-3629 9 build 12-Sep-2018 15:30:25 + 3C48 0134+329 0137+331 J0137+3309 1,2,3,4,5,6,7,9 build 12-Sep-2018 15:30:25 + FORNAX A - - J0322-3712 9 build 12-Sep-2018 15:30:25 + 3C123 0433+295 0437+296 J0437+2940 2,9 build 12-Sep-2018 15:30:25 + - - - J0444-2809 9 build 12-Sep-2018 15:30:25 + 3C138 0518+165 0521+166 J0521+1638 1,2,3,4,5,6,9 build 12-Sep-2018 15:30:25 + PICTOR A - - J0519-4546 9 build 12-Sep-2018 15:30:25 + 3C144(TAURUS A/CRAB) - - J0534+2200 9 build 12-Sep-2018 15:30:25 + 3C147 0538+498 0542+498 J0542+4951 1,2,3,4,5,6,7,9 build 12-Sep-2018 15:30:25 + 3C196 0809+483 0813+482 J0813+4813 1,2,7,9 build 12-Sep-2018 15:30:25 + 3C218(HYDRA A) - - J0918-1205 9 build 12-Sep-2018 15:30:25 + 3C274(VIRGO A) - - J1230+1223 9 build 12-Sep-2018 15:30:25 + 3C286 1328+307 1331+305 J1331+3030 1,2,3,4,5,6,7,9 build 12-Sep-2018 15:30:25 + 3C295 1409+524 1411+522 J1411+5212 1,2,3,4,5,6,7,9 build 12-Sep-2018 15:30:25 + 3C438(HERCULES A) - - J1651+0459 9 build 12-Sep-2018 15:30:25 + 3C353 - - J1720-0059 9 build 12-Sep-2018 15:30:25 + - 1934-638 - J1939-6342 1,3,4,5,6,8 build 12-Sep-2018 15:30:25 + 3C380 1828+487 1829+487 J1829+4845 7,9 build 12-Sep-2018 15:30:25 + 3C405(CYGNUS A) - - J1959+4044 9 build 12-Sep-2018 15:30:25 + 3C444 - - J2214-1701 9 build 12-Sep-2018 15:30:25 + 3C461(CASSIOPEIA A) - - J2323+5848 9 build 12-Sep-2018 15:30:25 + ----------------------------------------------------------------------- build 12-Sep-2018 15:30:25 * supported in: 1 - Perley-Butler 2010, 2 - Perley-Butler 2013 (ref. Perley and build 12-Sep-2018 15:30:25 Butler 2013, ApJS 204, 19), 3 - Perley-Taylor 99, 4 - Perley-Taylor 95, build 12-Sep-2018 15:30:25 5 - Perley 90, 6 - Baars, 7 - Scaife-Heald 2012, 8 - Stevens-Reynolds 2016 build 12-Sep-2018 15:30:25 + 9 - Perley-Butler 2017 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Solar system objects: build 12-Sep-2018 15:30:25 The 'Butler-JPL-Horizons 2012' standard is recommended over build 12-Sep-2018 15:30:25 @@ -523,7 +548,7 @@ build 12-Sep-2018 15:30:25 with descriptions of the models used by setjy (both build 12-Sep-2018 15:30:25 extragalactic and Solar System). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - >>> standard="Perley-Butler 2010" or "Perley-Butler 2013 expandable parameter build 12-Sep-2018 15:30:25 + >>> standard="Perley-Butler 2010", "Perley-Butler 2013", and "Perley-Butler 2017" expandable parameter build 12-Sep-2018 15:30:25 model -- Model image (I only) for setting the model visibilities. build 12-Sep-2018 15:30:25 ***************************************************************** build 12-Sep-2018 15:30:25 * Previously, this parameter is called 'modimage', now modimage * build 12-Sep-2018 15:30:25 @@ -574,7 +599,7 @@ build 12-Sep-2018 15:30:25 standard. For standard='Butler-JPL-Horizons 2010', the recognized build 12-Sep-2018 15:30:25 Solar System objects are listed. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - >>> standard="Perley-Butler 2013" expandable parameter build 12-Sep-2018 15:30:25 + >>> standard="Perley-Butler 2013" and "Perley-Butler 2017" expandable parameter build 12-Sep-2018 15:30:25 interpolation -- method for interpolation ('nearest', 'linear', 'cubic', build 12-Sep-2018 15:30:25 or 'spline') in time for the time variable sources (3C48,3C138,3C147). build 12-Sep-2018 15:30:25 This parameter is ignored for other non-variable sources in the standard. build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/simalma.xml b/gcwrap/tasks/simalma.xml build 12-Sep-2018 15:30:25 index a14a291..628cea2 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/simalma.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/simalma.xml build 12-Sep-2018 15:30:25 @@ -4,8 +4,8 @@ build 12-Sep-2018 15:30:25 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" build 12-Sep-2018 15:30:25 xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd build 12-Sep-2018 15:30:25 file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Simulation task for ALMA build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -15,68 +15,68 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 This task makes multiple calls to simobserve (to calculate visibilities build 12-Sep-2018 15:30:25 and total power spectra), followed by gridding of total power spectra build 12-Sep-2018 15:30:25 (if total power is requested), concatenation of the simulated build 12-Sep-2018 15:30:25 - visibilities, calls to the simanalyze task for visibility inversion and build 12-Sep-2018 15:30:25 - deconvolution and calculation of difference and fidelity images, build 12-Sep-2018 15:30:25 - and feathering of single dish and interferometric data. build 12-Sep-2018 15:30:25 + visibilities, calls to the simanalyze task for visibility inversion and build 12-Sep-2018 15:30:25 + deconvolution and calculation of difference and fidelity images, build 12-Sep-2018 15:30:25 + and feathering of single dish and interferometric data. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - These steps may not all be familiar to new users, so the simalma task build 12-Sep-2018 15:30:25 - runs by default in a "dryrun" mode, in which it assesses the user's build 12-Sep-2018 15:30:25 + These steps may not all be familiar to new users, so the simalma task build 12-Sep-2018 15:30:25 + runs by default in a "dryrun" mode, in which it assesses the user's build 12-Sep-2018 15:30:25 input parameters and sky model, and prints an informational report build 12-Sep-2018 15:30:25 - including the required calls to other CASA tasks, both to the screen build 12-Sep-2018 15:30:25 - and to a text file in the project directory (defined below). build 12-Sep-2018 15:30:25 + including the required calls to other CASA tasks, both to the screen build 12-Sep-2018 15:30:25 + and to a text file in the project directory (defined below). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - The user can modify their parameters based on the information, build 12-Sep-2018 15:30:25 - then either run with dryrun=False to actually call the other tasks build 12-Sep-2018 15:30:25 - to create the simulated data, or run the other tasks individually build 12-Sep-2018 15:30:25 - one at a time to better understand and control the process. build 12-Sep-2018 15:30:25 + The user can modify their parameters based on the information, build 12-Sep-2018 15:30:25 + then either run with dryrun=False to actually call the other tasks build 12-Sep-2018 15:30:25 + to create the simulated data, or run the other tasks individually build 12-Sep-2018 15:30:25 + one at a time to better understand and control the process. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - NOTE The ALMA project is refining the optimal method of combining the build 12-Sep-2018 15:30:25 - three types of data. If that best practice is changed after this build 12-Sep-2018 15:30:25 + NOTE The ALMA project is refining the optimal method of combining the build 12-Sep-2018 15:30:25 + three types of data. If that best practice is changed after this build 12-Sep-2018 15:30:25 release of CASA, the user can control the process by modifying the calls build 12-Sep-2018 15:30:25 to the other CASA tasks. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 ------------------------------- build 12-Sep-2018 15:30:25 Parameters: build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - project -- root filename for all output files. A subdirectory will be build 12-Sep-2018 15:30:25 + project -- root filename for all output files. A subdirectory will be build 12-Sep-2018 15:30:25 created, and all created files will be placed in that subdirectory build 12-Sep-2018 15:30:25 including the informational report. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ------------------------------- build 12-Sep-2018 15:30:25 skymodel -- input image (used as a model of the sky) build 12-Sep-2018 15:30:25 - * simalma requires a CASA or fits image. If you merely have a grid of build 12-Sep-2018 15:30:25 - numbers, you will need to write them out as fits or write a build 12-Sep-2018 15:30:25 - CASA script to read them in and use the ia tool to create an image build 12-Sep-2018 15:30:25 + * simalma requires a CASA or fits image. If you merely have a grid of build 12-Sep-2018 15:30:25 + numbers, you will need to write them out as fits or write a build 12-Sep-2018 15:30:25 + CASA script to read them in and use the ia tool to create an image build 12-Sep-2018 15:30:25 and insert the data. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 * simalma does NOT require a coordinate system in the header. If the build 12-Sep-2018 15:30:25 coordinate information is incomplete, missing, or you would like to build 12-Sep-2018 15:30:25 - override it, set the appropriate "in" parameters. NOTE that setting build 12-Sep-2018 15:30:25 + override it, set the appropriate "in" parameters. NOTE that setting build 12-Sep-2018 15:30:25 those parameters simply changes the header values, ignoring build 12-Sep-2018 15:30:25 any values already in the image. No regridding is performed. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 * If you have a proper Coordinate System, simalma will do its best to build 12-Sep-2018 15:30:25 generate visibilities from that, and then create a synthesis image build 12-Sep-2018 15:30:25 - according to the specified user parameters. build 12-Sep-2018 15:30:25 + according to the specified user parameters. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 * You can manipulate an image header manually with the "imhead" task. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - inbright -- peak brightness to scale the image to in Jy/pixel, build 12-Sep-2018 15:30:25 + inbright -- peak brightness to scale the image to in Jy/pixel, build 12-Sep-2018 15:30:25 or "" for unchanged build 12-Sep-2018 15:30:25 - * NOTE: "unchanged" will take the numerical values in your image build 12-Sep-2018 15:30:25 - and assume they are in Jy/pixel, even if it says some other unit build 12-Sep-2018 15:30:25 - in the header. build 12-Sep-2018 15:30:25 + * NOTE: "unchanged" will take the numerical values in your image build 12-Sep-2018 15:30:25 + and assume they are in Jy/pixel, even if it says some other unit build 12-Sep-2018 15:30:25 + in the header. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - indirection -- central direction to place the sky model image, build 12-Sep-2018 15:30:25 + indirection -- central direction to place the sky model image, build 12-Sep-2018 15:30:25 or "" to use whatever is in the image already build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - incell -- spatial pixel size to scale the skymodel image, build 12-Sep-2018 15:30:25 + incell -- spatial pixel size to scale the skymodel image, build 12-Sep-2018 15:30:25 or "" to use whatever is in the image already. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - incenter -- frequency to use for the center channel (or only channel, build 12-Sep-2018 15:30:25 - if the skymodel is 2D) e.g. "89GHz", build 12-Sep-2018 15:30:25 + incenter -- frequency to use for the center channel (or only channel, build 12-Sep-2018 15:30:25 + if the skymodel is 2D) e.g. "89GHz", build 12-Sep-2018 15:30:25 or "" to use what is in the header. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 inwidth -- width of channels to use, or "" to use what is in the image build 12-Sep-2018 15:30:25 @@ -90,33 +90,33 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 complist -- component list model of the sky, added to or instead of skymodel build 12-Sep-2018 15:30:25 see http://casaguides.nrao.edu/index.php?title=Simulation_Guide_Component_Lists_%28CASA_4.1%29 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - compwidth -- bandwidth of components; if simulating from components only, build 12-Sep-2018 15:30:25 + compwidth -- bandwidth of components; if simulating from components only, build 12-Sep-2018 15:30:25 this defines the bandwidth of the MS and output images build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ------------------------------- build 12-Sep-2018 15:30:25 setpointings -- if true, calculate a map of pointings and write ptgfile. build 12-Sep-2018 15:30:25 * if graphics are on, display the pointings shown on the model image build 12-Sep-2018 15:30:25 - * observations with the ALMA 12m and ACA 7m arrays will observe a build 12-Sep-2018 15:30:25 - region of size "mapsize" using the same hexagonal algorithm as build 12-Sep-2018 15:30:25 + * observations with the ALMA 12m and ACA 7m arrays will observe a build 12-Sep-2018 15:30:25 + region of size "mapsize" using the same hexagonal algorithm as build 12-Sep-2018 15:30:25 the ALMA OT, with Nyquist sampling. build 12-Sep-2018 15:30:25 - * The total power array maps a slightly (+1 primary beam) larger area build 12-Sep-2018 15:30:25 - than the 12m array does, to improve later image combination. build 12-Sep-2018 15:30:25 + * The total power array maps a slightly (+1 primary beam) larger area build 12-Sep-2018 15:30:25 + than the 12m array does, to improve later image combination. build 12-Sep-2018 15:30:25 It samples the region with lattice grids of spacing 0.33 lambda/D. build 12-Sep-2018 15:30:25 * if setpointings=false, read pointings from ptgfile. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - ptgfile -- a text file specifying directions in the same build 12-Sep-2018 15:30:25 + ptgfile -- a text file specifying directions in the same build 12-Sep-2018 15:30:25 format as the example, and optional integration times, e.g. build 12-Sep-2018 15:30:25 #Epoch RA DEC TIME(optional) build 12-Sep-2018 15:30:25 J2000 23h59m28.10 -019d52m12.35 10.0 build 12-Sep-2018 15:30:25 * if the time column is not present in the file, it will use build 12-Sep-2018 15:30:25 "integration" for all pointings. build 12-Sep-2018 15:30:25 * NOTE: at this time the file should contain only science pointings: build 12-Sep-2018 15:30:25 - simalma will observe these until totaltime is used up. build 12-Sep-2018 15:30:25 + simalma will observe these until totaltime is used up. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 integration --- Time interval for each integration e.g '10s' build 12-Sep-2018 15:30:25 - * NOTE: to simulate a "scan" longer than one integration, use build 12-Sep-2018 15:30:25 - setpointings to generate a pointing file, and then edit the build 12-Sep-2018 15:30:25 - file to increase the time at each point to be larger than build 12-Sep-2018 15:30:25 + * NOTE: to simulate a "scan" longer than one integration, use build 12-Sep-2018 15:30:25 + setpointings to generate a pointing file, and then edit the build 12-Sep-2018 15:30:25 + file to increase the time at each point to be larger than build 12-Sep-2018 15:30:25 the parameter integration time. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 direction -- mosaic center direction e.g 'J2000 19h00m00 -40d00m00' build 12-Sep-2018 15:30:25 @@ -128,12 +128,12 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 * set to "" to cover the model image build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ------------------------------- build 12-Sep-2018 15:30:25 - antennalist -- vector of ascii files containing antenna positions, build 12-Sep-2018 15:30:25 + antennalist -- vector of ascii files containing antenna positions, build 12-Sep-2018 15:30:25 one for each configuration of 7m or 12m dishes. build 12-Sep-2018 15:30:25 * NOTE: In this task, it should be an ALMA configuration. build 12-Sep-2018 15:30:25 - * standard arrays are found in your CASA data repository, build 12-Sep-2018 15:30:25 - os.getenv("CASAPATH").split()[0]+"/data/alma/simmos/" build 12-Sep-2018 15:30:25 - * a string of the form "alma;0.5arcsec" will be parsed into a build 12-Sep-2018 15:30:25 + * standard arrays are found in your CASA data repository, build 12-Sep-2018 15:30:25 + os.getenv("CASAPATH").split()[0]+"/data/alma/simmos/" build 12-Sep-2018 15:30:25 + * a string of the form "alma;0.5arcsec" will be parsed into a build 12-Sep-2018 15:30:25 12m ALMA configuration - see casaguides.nrao.edu build 12-Sep-2018 15:30:25 * examples: ['alma.cycle2.5.cfg','aca.cycle2.i.cfg'] build 12-Sep-2018 15:30:25 ['alma.cycle1;0.3arcsec','alma.cycle1.1.cfg','aca.i.cfg'] build 12-Sep-2018 15:30:25 @@ -142,22 +142,22 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 * note that if you don't add a unit, it will assume seconds. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 totaltime --- total time of observations. This should either be a scalar build 12-Sep-2018 15:30:25 - time quantity expressed as a string e.g. '1h', '3600sec', '10min', build 12-Sep-2018 15:30:25 - or a vector of such quantities, corresponding to the elements of build 12-Sep-2018 15:30:25 - the antennalist vector, e.g. ['5min','20min','3h']. If you build 12-Sep-2018 15:30:25 - specify a scalar, that will be used for the highest resolution build 12-Sep-2018 15:30:25 - 12m configuration in antennalist, and any lower resolution 12m build 12-Sep-2018 15:30:25 + time quantity expressed as a string e.g. '1h', '3600sec', '10min', build 12-Sep-2018 15:30:25 + or a vector of such quantities, corresponding to the elements of build 12-Sep-2018 15:30:25 + the antennalist vector, e.g. ['5min','20min','3h']. If you build 12-Sep-2018 15:30:25 + specify a scalar, that will be used for the highest resolution build 12-Sep-2018 15:30:25 + 12m configuration in antennalist, and any lower resolution 12m build 12-Sep-2018 15:30:25 configurations, any 7m configurations, and any TP configurations build 12-Sep-2018 15:30:25 - will have observing times relative to totaltime of 0.5, 2,and 4, build 12-Sep-2018 15:30:25 + will have observing times relative to totaltime of 0.5, 2,and 4, build 12-Sep-2018 15:30:25 respectively. build 12-Sep-2018 15:30:25 ------------------------------- build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 tpnant -- the number of total power antennas to use in simulation. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - tptime -- if tpnant>0, the user must specify the observing time for build 12-Sep-2018 15:30:25 - total power as a CASA quantity e.g. '4h'. build 12-Sep-2018 15:30:25 - * NOTE: this is not broken up among multiple days - build 12-Sep-2018 15:30:25 - a 20h track will include observations below the horizon, build 12-Sep-2018 15:30:25 + tptime -- if tpnant>0, the user must specify the observing time for build 12-Sep-2018 15:30:25 + total power as a CASA quantity e.g. '4h'. build 12-Sep-2018 15:30:25 + * NOTE: this is not broken up among multiple days - build 12-Sep-2018 15:30:25 + a 20h track will include observations below the horizon, build 12-Sep-2018 15:30:25 which is probably not what is desired. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ------------------------------- build 12-Sep-2018 15:30:25 @@ -166,7 +166,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 applied to the simulated data. build 12-Sep-2018 15:30:25 * J. Pardo's ATM library will be used to construct anatmospheric build 12-Sep-2018 15:30:25 profile for the ALMA site: build 12-Sep-2018 15:30:25 - altitude 5000m, ground pressure 650mbar, relhum=20%, build 12-Sep-2018 15:30:25 + altitude 5000m, ground pressure 650mbar, relhum=20%, build 12-Sep-2018 15:30:25 a water layer of pwv at altitude of 2km, build 12-Sep-2018 15:30:25 the sky brightness temperature returned by ATM, and internally build 12-Sep-2018 15:30:25 tabulated receiver temperatures. build 12-Sep-2018 15:30:25 @@ -183,7 +183,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 imsize -- image size in spatial pixels (x,y) build 12-Sep-2018 15:30:25 0 or -1 will use the model image size; example: imsize=[500,500] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - imdirection -- phase center for synthesized image. default is to build 12-Sep-2018 15:30:25 + imdirection -- phase center for synthesized image. default is to build 12-Sep-2018 15:30:25 center on the sky model. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 cell -- cell size e.g '10arcsec'. "" defaults to the skymodel cell build 12-Sep-2018 15:30:25 @@ -200,9 +200,9 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 Please see the documents of simobserve and simanalyze for build 12-Sep-2018 15:30:25 the list of outputs produced. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 root prefix for output file names build 12-Sep-2018 15:30:25 sim build 12-Sep-2018 15:30:25 @@ -212,7 +212,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 dryrun=True will only produce the informative report, not run simobserve/analyze build 12-Sep-2018 15:30:25 True build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -239,11 +239,11 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 set new cell/pixel size e.g. "0.1arcsec" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 set new frequency of center channel e.g. "89GHz" (required even for 2D model) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 set new channel width e.g. "10MHz" (required even for 2D model) build 12-Sep-2018 15:30:25 @@ -331,7 +331,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 hour angle of observation center e.g. -3:00:00, or "transit" build 12-Sep-2018 15:30:25 transit build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 total time of observation; vector corresponding to antennalist build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -376,7 +376,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 False build 12-Sep-2018 15:30:25 F build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Precipitable Water Vapor in mm build 12-Sep-2018 15:30:25 1. build 12-Sep-2018 15:30:25 @@ -391,7 +391,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 atmospheric temperature build 12-Sep-2018 15:30:25 260. build 12-Sep-2018 15:30:25 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 zenith opacity0.1 build 12-Sep-2018 15:30:25 0 build 12-Sep-2018 15:30:25 @@ -400,21 +400,21 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 random number seed11111 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 cross polarization (interferometer only) build 12-Sep-2018 15:30:25 0.0 build 12-Sep-2018 15:30:25 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 --> build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 image simulated data build 12-Sep-2018 15:30:25 True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 output image size in pixels (x,y) or 0 to match model build 12-Sep-2018 15:30:25 128128 build 12-Sep-2018 15:30:25 @@ -442,7 +442,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 cell size with units or "" to equal model build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 maximum number of iterations (0 for dirty image) build 12-Sep-2018 15:30:25 0 build 12-Sep-2018 15:30:25 @@ -460,7 +460,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 natural build 12-Sep-2018 15:30:25 uniform build 12-Sep-2018 15:30:25 - briggs build 12-Sep-2018 15:30:25 + briggs build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -526,10 +526,10 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -617,11 +617,11 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/slsearch.xml b/gcwrap/tasks/slsearch.xml build 12-Sep-2018 15:30:25 index 775cb98..94c92e6 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/slsearch.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/slsearch.xml build 12-Sep-2018 15:30:25 @@ -24,7 +24,10 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Frequency range in GHz. build 12-Sep-2018 15:30:25 - 84,90 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + 84 build 12-Sep-2018 15:30:25 + 90 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Species to search for. build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/specfit.xml b/gcwrap/tasks/specfit.xml build 12-Sep-2018 15:30:25 index 651135c..13d5c7d 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/specfit.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/specfit.xml build 12-Sep-2018 15:30:25 @@ -8,7 +8,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Fit 1-dimensional gaussians and/or polynomial models to an image or image region build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -28,6 +28,9 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Region selection. Default is to use the full image. build 12-Sep-2018 15:30:25 + path build 12-Sep-2018 15:30:25 + string build 12-Sep-2018 15:30:25 + record build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 region="myregion.rgn" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -46,8 +49,9 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 axis=3 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + stringstringVec build 12-Sep-2018 15:30:25 Mask to use. Default is none.. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Number of Gaussian elements. Default: 1. build 12-Sep-2018 15:30:25 @@ -62,6 +66,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Name of file containing initial estimates. Default: No initial estimates (""). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + path build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Minimum number of unmasked points necessary to attempt fit. build 12-Sep-2018 15:30:25 @@ -136,44 +141,52 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 True build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + doubledoubleVec build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Initial estimate of PCF profile (gaussian or lorentzian) amplitudes. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + doubledoubleVec build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Initial estimate PCF profile centers, in pixels. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + doubledoubleVec build 12-Sep-2018 15:30:25 Initial estimate PCF profile FWHMs, in pixels. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + doubledoubleVec build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 PCF profile parameters to fix during fit. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + intintVec build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Number of components in each gaussian multiplet to fit build 12-Sep-2018 15:30:25 0 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + doubledoubleVec build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The amplitude ratio constraints for non-reference components to reference component in gaussian multiplets. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + doubledoubleVec build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The center offset constraints (in pixels) for non-reference components to reference component in gaussian multiplets. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + doubledoubleVec build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The FWHM ratio constraints for non-reference components to reference component in gaussian multiplets. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Initial estimate of individual gaussian amplitudes in gaussian multiplets. build 12-Sep-2018 15:30:25 @@ -188,6 +201,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 0.0 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + stringstringVec build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Parameters of individual gaussians in gaussian multiplets to fix during fit. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -201,6 +215,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 True build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + stringstringVec build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 PCF singlet functions to fit. "gaussian" or "lorentzian" (minimal match supported). Unspecified means all gaussians. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -220,6 +235,11 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Standard deviation array or image name. build 12-Sep-2018 15:30:25 + string build 12-Sep-2018 15:30:25 + intVec build 12-Sep-2018 15:30:25 + intArray build 12-Sep-2018 15:30:25 + doubleVec build 12-Sep-2018 15:30:25 + doubleArray build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -253,7 +273,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -328,12 +348,12 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 This task simultaneously fits one or more gaussian singlets lorentzian singlets, gaussian multiplets, and/or a polynomial to one dimensional profiles. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 PARAMETER SUMMARY build 12-Sep-2018 15:30:25 imagename Name of the input (CASA, FITS, MIRIAD) image build 12-Sep-2018 15:30:25 -box Rectangular region to select in direction plane. build 12-Sep-2018 15:30:25 +box Rectangular region to select in direction plane. build 12-Sep-2018 15:30:25 for details. Default is to use the entire direction plane. build 12-Sep-2018 15:30:25 region Region selection. Default is to use the build 12-Sep-2018 15:30:25 full image. build 12-Sep-2018 15:30:25 @@ -345,7 +365,7 @@ axis Axis along which to do the fit(s). <0 means use the spectral build 12-Sep-2018 15:30:25 zeroth axis if a spectral axis is not present. build 12-Sep-2018 15:30:25 mask Mask to use. Default is none. build 12-Sep-2018 15:30:25 stretch Stretch the input mask if necessary and possible? Only used if a mask is specified. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 ngauss Maximum number of gaussians to fit. build 12-Sep-2018 15:30:25 poly Order of polynomial to fit. <0 means do not fit a polynomial. build 12-Sep-2018 15:30:25 estimates Name of file containing initial gaussian estimates. build 12-Sep-2018 15:30:25 @@ -362,7 +382,7 @@ fwhmerr Name of fwhm solution error image. Default: do not write the ima build 12-Sep-2018 15:30:25 integral Name of integral solution image. Default: do not write the image ("") build 12-Sep-2018 15:30:25 integralerr Name of integral solution error image. Default: do not write the image ("") build 12-Sep-2018 15:30:25 wantreturn If true, return a record summarizing the fit results, if false, return false. build 12-Sep-2018 15:30:25 -stretch Stretch the mask if necessary and possible? build 12-Sep-2018 15:30:25 +stretch Stretch the mask if necessary and possible? build 12-Sep-2018 15:30:25 logresults Output results to logger? build 12-Sep-2018 15:30:25 pampest Initial estimate of PCF profile (gaussian or lorentzian) amplitudes. build 12-Sep-2018 15:30:25 pcenterest Initial estimate PCF profile centers, in pixels. build 12-Sep-2018 15:30:25 @@ -490,7 +510,7 @@ being a triplet. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Initial estimates of all gaussians in all multiplets are specified via the gm*est parameters which must be arrays of numbers. The order build 12-Sep-2018 15:30:25 starts with the zeroth component of the zeroth multiplet to the last component of the zeroth multiplet, then the zeroth component of build 12-Sep-2018 15:30:25 -the first multiplet to the last compoenent of the first multiplet, etc to the zeroth component of the last multiplet to the last build 12-Sep-2018 15:30:25 +the first multiplet to the last compoenent of the first multiplet, etc to the zeroth component of the last multiplet to the last build 12-Sep-2018 15:30:25 element of the last multiplet. The zeroth element of a multiplet is defined as the reference component of that multiplet and has the special build 12-Sep-2018 15:30:25 significance that it is the profile to which all constraints of all other profiles in that multiplet are referenced (see below). So, build 12-Sep-2018 15:30:25 in our example of gmncomps=[2, 4, 3], gmampest, gmcenterest, and gmfwhmest must each be nine (the total number of individual gaussian build 12-Sep-2018 15:30:25 @@ -519,7 +539,7 @@ gfwhmcon="" build 12-Sep-2018 15:30:25 In this case we have our previous example of one doublet, one quadruplet, and one triplet. The first component of the doublet has the constraint build 12-Sep-2018 15:30:25 that its center is offset by 24.2 pixels from the zeroth (reference) component. The first component of the quadruplet is constrained to have build 12-Sep-2018 15:30:25 an amplitude of 0.2 times that of the quadruplet's zeroth component and its center is constrained to be offset by 45.6 pixels from the build 12-Sep-2018 15:30:25 -reference component. The second component of the quadruplet is constained to have its center offset by 92.7 pixels from the associated build 12-Sep-2018 15:30:25 +reference component. The second component of the quadruplet is constained to have its center offset by 92.7 pixels from the associated build 12-Sep-2018 15:30:25 reference component and the third component is constrained to have an amplitude of 0.1 times that of the associated reference component. build 12-Sep-2018 15:30:25 The first component of the triplet is constrained to have an amplitude of 4.5 times that of its associated reference component and its center build 12-Sep-2018 15:30:25 is constrained to be offset by -22.8 pixels from the reference component's center. The second component of the triplet is constrained to have build 12-Sep-2018 15:30:25 @@ -655,8 +675,7 @@ Writing analogous images for polynomial coefficients is not supported. build 12-Sep-2018 15:30:25 EXAMPLE build 12-Sep-2018 15:30:25 res = specif(imagename="myspectrum.im", ngauss=2, box="3,3,4,5", poly=2, multifit=true, wantreturn=True) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/specflux.xml b/gcwrap/tasks/specflux.xml build 12-Sep-2018 15:30:25 index fcc9c1b..8ca6484 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/specflux.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/specflux.xml build 12-Sep-2018 15:30:25 @@ -7,7 +7,7 @@ xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd build 12-Sep-2018 15:30:25 file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Report spectral profile and calculate spectral flux over a user specified region build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -74,7 +74,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 False build 12-Sep-2018 15:30:25 overwrite=true build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -99,7 +99,7 @@ PARAMETER SUMMARY build 12-Sep-2018 15:30:25 imagename Name of the input (CASA, FITS, MIRIAD) image build 12-Sep-2018 15:30:25 region Region selection. Default is to use build 12-Sep-2018 15:30:25 the full image. build 12-Sep-2018 15:30:25 -box Rectangular region to select in direction plane. build 12-Sep-2018 15:30:25 +box Rectangular region to select in direction plane. build 12-Sep-2018 15:30:25 for details. Default is to use the entire direction plane. build 12-Sep-2018 15:30:25 chans Channels to use. Default is to use build 12-Sep-2018 15:30:25 all channels. build 12-Sep-2018 15:30:25 @@ -107,7 +107,7 @@ stokes Stokes planes to use. Default is to use build 12-Sep-2018 15:30:25 all Stokes planes. build 12-Sep-2018 15:30:25 mask Mask to use. Default is none. build 12-Sep-2018 15:30:25 stretch Stretch the input mask if necessary and possible. Only used if a mask is specified. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 function Aggregate function to use for computing per channel values. Supported values are build 12-Sep-2018 15:30:25 "flux density", "mean", "median", "sum". Minimal match supported. build 12-Sep-2018 15:30:25 unit Unit to use for the spectral flux calculation. Must be conformant with a typical build 12-Sep-2018 15:30:25 @@ -127,14 +127,14 @@ overwrite Controls if an already existing log file by the build 12-Sep-2018 15:30:25 if it exists is automatically overwritten. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 This application retrieves details of an image spectrum which has been integrated over a specified build 12-Sep-2018 15:30:25 -region (or the entire image if no region has been specified). build 12-Sep-2018 15:30:25 +region (or the entire image if no region has been specified). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 One may specify which function to use to aggregate pixel values using the function parameter. Supported build 12-Sep-2018 15:30:25 values are "flux density", "mean", "median", and "sum". Minimal match is supported. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The spectral flux is reported in units flux density consistent with the image brightness unit times the build 12-Sep-2018 15:30:25 specified spectral unit (eg, Jy*km/s, K*arcsec2*km/s). If the units are K*arcsec2..., multiply the build 12-Sep-2018 15:30:25 -reported value by 2.3504430539098e-8*d*d, where d is the distance in pc, to convert to units of K*pc2... build 12-Sep-2018 15:30:25 +reported value by 2.3504430539098e-8*d*d, where d is the distance in pc, to convert to units of K*pc2... build 12-Sep-2018 15:30:25 If provided, major and minor will be used to compute the beam size, and hence the per channel flux build 12-Sep-2018 15:30:25 densities (if function="flux density"), overriding the input image beam information, if present. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/spxfit.xml b/gcwrap/tasks/spxfit.xml build 12-Sep-2018 15:30:25 index fa473ed..0dff0e5 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/spxfit.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/spxfit.xml build 12-Sep-2018 15:30:25 @@ -8,7 +8,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Fit a 1-dimensional model(s) to an image(s) or region for determination of spectral index. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -166,7 +166,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 This task fits a power logarithmic polynomial or a logarithmic tranformed polynomial to one dimensional profiles for determination of spectral indices. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 PARAMETER SUMMARY build 12-Sep-2018 15:30:25 @@ -174,7 +174,7 @@ imagename Name of the input image(s). More than one image name can be give build 12-Sep-2018 15:30:25 array, in which case the images are concatenated along the specified axis build 12-Sep-2018 15:30:25 and the resultant image is what is used by the fitter. In this case, build 12-Sep-2018 15:30:25 all images must have the same dimensions along all axes other than the fit axis. build 12-Sep-2018 15:30:25 -box Rectangular region to select in direction plane. build 12-Sep-2018 15:30:25 +box Rectangular region to select in direction plane. build 12-Sep-2018 15:30:25 Default is to use the entire direction plane. build 12-Sep-2018 15:30:25 region Region selection. Default is to use the full image. build 12-Sep-2018 15:30:25 chans Channels to use. Default is to use all channels. build 12-Sep-2018 15:30:25 @@ -183,7 +183,7 @@ axis Axis along which to do the fit(s). <0 means use the spectral build 12-Sep-2018 15:30:25 zeroth axis if a spectral axis is not present. build 12-Sep-2018 15:30:25 mask Mask to use. Default is none. build 12-Sep-2018 15:30:25 stretch Stretch the input mask if necessary and possible? Only used if a mask is specified. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 minpts Minimum number of points necessary to attempt a fit. build 12-Sep-2018 15:30:25 multifit Fit models at each pixel in region (true) or average profiles and fit a single model (false). build 12-Sep-2018 15:30:25 spxtype Type of function to fit. "plp" => power logarithmic polynomial, "ltp" => logarithmic build 12-Sep-2018 15:30:25 @@ -200,7 +200,7 @@ spxerr Name of the function coeffecients error image to write. build 12-Sep-2018 15:30:25 model Name of model image to write. build 12-Sep-2018 15:30:25 residual Name of residual image to write. build 12-Sep-2018 15:30:25 wantreturn If true, return a record summarizing the fit results, if false, return false. build 12-Sep-2018 15:30:25 -stretch Stretch the mask if necessary and possible? build 12-Sep-2018 15:30:25 +stretch Stretch the mask if necessary and possible? build 12-Sep-2018 15:30:25 logresults Output results to logger? build 12-Sep-2018 15:30:25 logfile File in which to log results. Default is not to write a logfile. build 12-Sep-2018 15:30:25 append Append results to logfile? Logfile must be specified. Default is to append. False means overwrite existing file if it exists. build 12-Sep-2018 15:30:25 @@ -330,15 +330,14 @@ too much leverage to large flux values. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 If the weights are unknown or will not be considered by the fitting algorithm, then I prefer the log-transformed polynomial model. However, build 12-Sep-2018 15:30:25 this does not work well in low signal-to-noise regions. A conservative mask could be created such that only high s/n areas are fit, build 12-Sep-2018 15:30:25 -but this could hinder many science objectives. build 12-Sep-2018 15:30:25 +but this could hinder many science objectives. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 EXAMPLES build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 res = spxfit(imagename=["im0.im","im1.im"], multifit=true, spxtype="plp", spxest=[0.5,2,0.1], div="1GHz", spxsol="myplpsolutions.im") build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/ssoflux.xml b/gcwrap/tasks/ssoflux.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index ab41463..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/ssoflux.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,163 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Fills the model column with the visibilities of a calibrator build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - *This is an experimental clone of setjy while flux calibration with build 12-Sep-2018 15:30:25 - Solar System objects is being tested. It will eventually be merged build 12-Sep-2018 15:30:25 - back into setjy.* build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The task places the model visibility amp and phase associated build 12-Sep-2018 15:30:25 - with a specified clean components image into the model column build 12-Sep-2018 15:30:25 - of the data set. The flux density (I,Q,U,V) for a point source build 12-Sep-2018 15:30:25 - calibrator can be entered explicitly. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Models are available for 3C48, 3C138, and 3C286 between build 12-Sep-2018 15:30:25 - 1.4 and 43 GHz. 3C147 is available above 13 GHz. These models build 12-Sep-2018 15:30:25 - are scaled to the precise frequency of the data. Only I models are build 12-Sep-2018 15:30:25 - presently available. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The location of the models is system dependent: At the AOC, the build 12-Sep-2018 15:30:25 - models are in the directory::/usr/lib/casapy/data/nrao/VLA/CalModels/ build 12-Sep-2018 15:30:25 - 3C286_L.im (egs) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ssoflux need only be run on the calibrator sources with a known flux build 12-Sep-2018 15:30:25 - density and/or model. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of input visibility file build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Field name(s) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Spectral window identifier (list) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - File location for field model build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Specified flux density [I,Q,U,V]; -1 will lookup values build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Flux density standard build 12-Sep-2018 15:30:25 - Perley-Taylor 99 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Perley-Butler 2010 build 12-Sep-2018 15:30:25 - Perley-Taylor 99 build 12-Sep-2018 15:30:25 - Baars build 12-Sep-2018 15:30:25 - Perley 90 build 12-Sep-2018 15:30:25 - Perley-Taylor 95 build 12-Sep-2018 15:30:25 - Butler-JPL-Horizons 2010 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - *This is an experimental clone of setjy while flux calibration with build 12-Sep-2018 15:30:25 - Solar System objects is being tested. It will eventually be merged build 12-Sep-2018 15:30:25 - back into setjy.* build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - This task sets the model visibility amp and phase of a build 12-Sep-2018 15:30:25 - specified source (generally a calibrator). The simplest way is build 12-Sep-2018 15:30:25 - to enter the flux density (I,Q,U,V) explicitly, but this is build 12-Sep-2018 15:30:25 - valid only for a point source. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - For an extended source, the clean model (image.model) can be build 12-Sep-2018 15:30:25 - specified and the model visibilities associated with this clean build 12-Sep-2018 15:30:25 - model is placed in the visibility model column. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Models are available for 3C48, 3C138, 3C286 between build 12-Sep-2018 15:30:25 - 1.4 and 43 GHz. 3C147 is available above 13 GHz. These models build 12-Sep-2018 15:30:25 - are scaled to the precise frequency of the data. Only I source build 12-Sep-2018 15:30:25 - model can be inserted at a time. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The location of the models are system dependent: At the AOC and CV, build 12-Sep-2018 15:30:25 - the models are in the directory::/usr/lib/casapy/data/nrao/VLA/CalModels build 12-Sep-2018 15:30:25 - or /usr/lib64/casapy/data/nrao/VLA/CalModel. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ssoflux need only be run on the calibrator sources with a known flux build 12-Sep-2018 15:30:25 - density and/or model. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of input visibility file build 12-Sep-2018 15:30:25 - default: none. example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - field -- Select field using field id(s) or field name(s). build 12-Sep-2018 15:30:25 - default: ''=all fields, but run ssoflux one field at a time. build 12-Sep-2018 15:30:25 - [run listobs to obtain the list id's or names of calibrators] build 12-Sep-2018 15:30:25 - If field is a non-negative integer, it is assumed to be a field build 12-Sep-2018 15:30:25 - index. Otherwise, it is taken to be a field name. build 12-Sep-2018 15:30:25 - field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 - field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 - field='3C286,3C295'; field named 3C286 and 3C295 build 12-Sep-2018 15:30:25 - field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 - spw -- Select spectral window/channels build 12-Sep-2018 15:30:25 - default: ''=all spectral windows and channels build 12-Sep-2018 15:30:25 - spw='0~2,4'; spectral windows 0,1,2,4 (all channels) build 12-Sep-2018 15:30:25 - spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 - spw='0:5~61'; spw 0, channels 5 to 61 build 12-Sep-2018 15:30:25 - spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, channels 3 to 45. build 12-Sep-2018 15:30:25 - spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. build 12-Sep-2018 15:30:25 - spw='0:0~10;15~60'; spectral window 0 with channels 0-10,15-60 build 12-Sep-2018 15:30:25 - spw='0:0~10,1:20~30,2:1;2;4'; spw 0, channels 0-10, build 12-Sep-2018 15:30:25 - spw 1, channels 20-30, and spw 2, channels, 1,2 and 4 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Use one of the two methods below: modimage or fluxdensity build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - modimage -- Model image (I only) for setting the model visibilities. build 12-Sep-2018 15:30:25 - default: '' means use fluxdensity instead of modimage. build 12-Sep-2018 15:30:25 - Each field must be done separately. The image clean model build 12-Sep-2018 15:30:25 - will be scaled from the frequency in the model to that actually used, build 12-Sep-2018 15:30:25 - unless fluxdensity = 0 (or fluxdensity[0] = 0). build 12-Sep-2018 15:30:25 - Both the amplitude and phase are calculated. build 12-Sep-2018 15:30:25 - At the AOC or CV, the models are located in build 12-Sep-2018 15:30:25 - /usr/lib/casapy/data/nrao/VLA/CalModels/3C286_L.im (egs) build 12-Sep-2018 15:30:25 - lib64 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - fluxdensity -- Specified flux density [I,Q,U,V] in Jy build 12-Sep-2018 15:30:25 - default: -1, uses [1,0,0,0] flux density for all sources, build 12-Sep-2018 15:30:25 - except for 3C286, 3C48 and 3C147, which use standard flux build 12-Sep-2018 15:30:25 - densities. It is recommended to use modimage for build 12-Sep-2018 15:30:25 - these sources if they are resolved by the observation. build 12-Sep-2018 15:30:25 - Only one flux density can be specified at a time. The phases are build 12-Sep-2018 15:30:25 - set to zero. build 12-Sep-2018 15:30:25 - example fluxdensity=-1 will insert 1.0 for all calibrators build 12-Sep-2018 15:30:25 - except 3C286, 3C147 and 3C48. build 12-Sep-2018 15:30:25 - example field = '1'; fluxdensity=[3.2,0,0,0] wil put in build 12-Sep-2018 15:30:25 - a flux density of I=3.2 for field='1' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - At present (June 2000), this is the only method to insert a build 12-Sep-2018 15:30:25 - polarized flux density model. build 12-Sep-2018 15:30:25 - example: fluxdensity=[2.63,0.21,-0.33,0.02] build 12-Sep-2018 15:30:25 - will put in I,Q,U,V flux densities of 2.63,0.21,-0.33, build 12-Sep-2018 15:30:25 - and 0.02, respectively, in the model column. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - standard -- Flux density standard, used if fluxdensity<0 build 12-Sep-2018 15:30:25 - default: 'Perley-Taylor 99'; example: standard='Baars' build 12-Sep-2018 15:30:25 - Options: 'Baars','Perley 90','Perley-Taylor 95', build 12-Sep-2018 15:30:25 - 'Perley-Taylor 99', 'Perley-Butler 2010', build 12-Sep-2018 15:30:25 - and 'Butler-JPL-Horizons 2010'. build 12-Sep-2018 15:30:25 - All but the last one are for extragalactic calibrators, build 12-Sep-2018 15:30:25 - and the final one is for Solar System objects. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/statwt.xml b/gcwrap/tasks/statwt.xml build 12-Sep-2018 15:30:25 index a29ad51..845cda4 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/statwt.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/statwt.xml build 12-Sep-2018 15:30:25 @@ -5,292 +5,337 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" build 12-Sep-2018 15:30:25 xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd build 12-Sep-2018 15:30:25 file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Reweight visibilities according to their scatter (Experimental) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of measurement set build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Use rms instead of stddev? build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Estimate the noise per antenna -not implemented (vs. per baseline) build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - If solving by antenna, treat autocorrs separately (not implemented) build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The signal-free spectral window:channels to estimate the scatter from build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The signal-free correlation(s) to estimate the scatter from (not implemented) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Let estimates span changes in spw, corr, scan and/or state build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Bin length for estimates (not implemented) build 12-Sep-2018 15:30:25 - 0s build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Minimum number of unflagged visibilities for estimating the scatter build 12-Sep-2018 15:30:25 - 2 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select field using ID(s) or name(s) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Compute and set weights based on variance of data. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Name of measurement set build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Enable data selection parameters build 12-Sep-2018 15:30:25 + True build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Selection based on field names or field index numbers. Default is all. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + "0~2", or "3C286" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select spectral window/channels build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data based on antenna/baseline build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data by time range build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data by scan numbers build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data by scan intents build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select (sub)array(s) by array ID number build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Selection based on spectral windows:channels. Default is all. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + "3" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select correlations to reweight (DEPRECATED in CASA v4.5) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select by observation ID(s) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Selection based on intents. Default is all. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + "my_intent" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Selection based on array IDs. Default is all. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + "1" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Selection based on observation IDs. Default is all. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + "1" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Ignore changes in these columns (scan, field, and/or state) when aggregating samples to compute weights. The value "corr" is also supported to aggregate samples across correlations. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + "scan,field" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Length for binning in time to determine statistics. Can either be integer to be multiplied by the representative integration time, a quantity (string) in time units build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + 1 build 12-Sep-2018 15:30:25 + 5 or "100s" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Use a sliding window for time binning, as opposed to time block processing? build 12-Sep-2018 15:30:25 + False build 12-Sep-2018 15:30:25 + True build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Channel bin width for computing weights. Can either be integer, in which case it is interpreted as number of channels to include in each bin, or a string "spw" or quantity with frequency units. build 12-Sep-2018 15:30:25 + spw build 12-Sep-2018 15:30:25 + 5 or "1.5MHz" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Minimum number of unflagged visibilities required for computing weights in a sample. Must be >= 2. build 12-Sep-2018 15:30:25 + 2 build 12-Sep-2018 15:30:25 + 10 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Statistics algorithm to use for computing variances. Supported values are "chauvenet", "classic", "fit-half", and "hinges-fences". Minimum match is supported, although the full string must be specified for the subparameters to appear in the inputs list. build 12-Sep-2018 15:30:25 + classic build 12-Sep-2018 15:30:25 + "cl", "ch", "f", or "h" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Fence value for statalg="hinges-fences". A negative value means use the entire data set (ie default to the "classic" algorithm). Ignored if statalg is not "hinges-fences". build 12-Sep-2018 15:30:25 + -1 build 12-Sep-2018 15:30:25 + 0.2 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Center to use for statalg="fit-half". Valid choices are "mean", "median", and "zero". Ignored if statalg is not "fit-half". build 12-Sep-2018 15:30:25 + mean build 12-Sep-2018 15:30:25 + "mean", "median", or "zero" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + For statalg="fit-half", real data are <=; center? If false, real data are >= center. Ignored if statalg is not "fit-half". build 12-Sep-2018 15:30:25 + True build 12-Sep-2018 15:30:25 + True build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + For statalg="chauvenet", this is the target maximum number of standard deviations data may have to be included. If negative, use Chauvenet\'s criterion. Ignored if statalg is not "chauvenet". build 12-Sep-2018 15:30:25 + -1 build 12-Sep-2018 15:30:25 + 3.5 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + For statalg="chauvenet", this is the maximum number of iterations to attempt. Iterating will stop when either this limit is reached, or the zscore criterion is met. If negative, iterate until the zscore criterion is met. Ignored if statalg is not "chauvenet". build 12-Sep-2018 15:30:25 + -1 build 12-Sep-2018 15:30:25 + 10 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Channels to exclude from the computation of weights. Specified as an MS select channel selection string. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + "0:5~30" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Range of acceptable weights. Data with weights outside this range will be flagged. Empty array (default) means all weights are good. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + [0.1, 10] build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Back up the state of flags before the run? build 12-Sep-2018 15:30:25 + True build 12-Sep-2018 15:30:25 + True, False build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Preview mode. If True, no data is changed, although the amount of data that would have been flagged is reported. build 12-Sep-2018 15:30:25 + False build 12-Sep-2018 15:30:25 + True or False build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Data column to use to compute weights. Supported values are "data", "corrected", "residual", and "residual_data" (case insensitive, minimum match supported). build 12-Sep-2018 15:30:25 + corrected build 12-Sep-2018 15:30:25 + "data" or "corrected" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Which data column to calculate the scatter from build 12-Sep-2018 15:30:25 - corrected build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - corrected build 12-Sep-2018 15:30:25 - float_data build 12-Sep-2018 15:30:25 - model build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + "" build 12-Sep-2018 15:30:25 + "" build 12-Sep-2018 15:30:25 + "" build 12-Sep-2018 15:30:25 + "" build 12-Sep-2018 15:30:25 + "" build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + -1 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + mean build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + True build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + -1 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + -1 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The WEIGHT and SIGMA columns of measurement sets are often set to arbitrary build 12-Sep-2018 15:30:25 - values (e.g. 1), or theoretically estimated from poorly known antenna and build 12-Sep-2018 15:30:25 - receiver properties. Many tasks (e.g. clean) are insensitive to an overall build 12-Sep-2018 15:30:25 - scale error in WEIGHT, but are affected by errors in the relative weights build 12-Sep-2018 15:30:25 - between visibilities. Other tasks, such as uvmodelfit, or anything which build 12-Sep-2018 15:30:25 - depends on theoretical estimates of the noise, require (reasonably) correct build 12-Sep-2018 15:30:25 - weights and sigmas. statwt empirically measures the visibility scatter build 12-Sep-2018 15:30:25 - (typically as a function of time, antenna, and/or baseline) and uses that build 12-Sep-2018 15:30:25 - to set WEIGHT and SIGMA. It is important that all necessary calibrations build 12-Sep-2018 15:30:25 - are applied to the data prior to running this task for correct determination of build 12-Sep-2018 15:30:25 - weights and sigmas. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Note: Some of the parameters (byantenna, sepacs, fitcorr, and timebin) build 12-Sep-2018 15:30:25 - are not fully implemented for CASA 3.4. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of the measurement set. build 12-Sep-2018 15:30:25 - default: none; example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - dorms -- Estimate the scatter using rms instead of the standard build 12-Sep-2018 15:30:25 - deviation? build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Ideally the visibilities used to estimate the scatter, as build 12-Sep-2018 15:30:25 - selected by fitspw and fitcorr, should be pure noise. If you build 12-Sep-2018 15:30:25 - know for certain that they are, then setting dorms to True build 12-Sep-2018 15:30:25 - will give the best result. Otherwise, use False (standard build 12-Sep-2018 15:30:25 - sample standard deviation). More robust scatter estimates build 12-Sep-2018 15:30:25 - like the interquartile range or median absolute deviation from build 12-Sep-2018 15:30:25 - the median are not offered because they require sorting by build 12-Sep-2018 15:30:25 - value, which is not possible for complex numbers. build 12-Sep-2018 15:30:25 - default: False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - byantenna -- Assume that the noise is factorable by antenna (feed). build 12-Sep-2018 15:30:25 - If false, treat it separately for each baseline build 12-Sep-2018 15:30:25 - (recommended if there is strong signal). build 12-Sep-2018 15:30:25 - default: False (*** byantenna=True is not yet implemented) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - sepacs -- If solving by antenna, treat autocorrelations separately. build 12-Sep-2018 15:30:25 - (Acknowledge that what autocorrelations "see" is very build 12-Sep-2018 15:30:25 - different from what crosscorrelations see.) build 12-Sep-2018 15:30:25 - default: True (*** not yet implemented) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - --- Data Selection (see help par.selectdata for more detailed build 12-Sep-2018 15:30:25 - information) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - fitspw -- The (ideally) signal-free spectral window:channels to build 12-Sep-2018 15:30:25 - estimate the scatter from. build 12-Sep-2018 15:30:25 - default: '' (All) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - fitcorr -- The (ideally) signal-free correlations to build 12-Sep-2018 15:30:25 - estimate the scatter from. build 12-Sep-2018 15:30:25 - default: '' (All) build 12-Sep-2018 15:30:25 - *** not yet implemented build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - combine -- Let samples span multiple spws, corrs, scans, and/or states. build 12-Sep-2018 15:30:25 - combine = 'spw': Recommended when a line spans an entire spw build 12-Sep-2018 15:30:25 - - set fitspw to the neighboring spws and build 12-Sep-2018 15:30:25 - apply their weight to the line spw(s). build 12-Sep-2018 15:30:25 - However, the effect of the line signal per build 12-Sep-2018 15:30:25 - visibility may be relatively harmless build 12-Sep-2018 15:30:25 - compared to the noise difference between build 12-Sep-2018 15:30:25 - spws. build 12-Sep-2018 15:30:25 - combine = 'scan': Can be useful when the scan number build 12-Sep-2018 15:30:25 - goes up with each integration, build 12-Sep-2018 15:30:25 - as in many WSRT MSes. build 12-Sep-2018 15:30:25 - combine = ['scan', 'spw']: disregard scan and spw build 12-Sep-2018 15:30:25 - numbers when gathering samples. build 12-Sep-2018 15:30:25 - combine = 'spw,scan': Same as above. build 12-Sep-2018 15:30:25 - default: '' (None) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - timebin -- Sample interval. build 12-Sep-2018 15:30:25 - default: '0s' or '-1s' (1 integration at a time) build 12-Sep-2018 15:30:25 - example: timebin='30s' build 12-Sep-2018 15:30:25 - '10' means '10s' build 12-Sep-2018 15:30:25 - *** not yet implemented build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - minsamp -- Minimum number of unflagged visibilities for estimating the build 12-Sep-2018 15:30:25 - scatter. Selected visibilities for which the weight cannot build 12-Sep-2018 15:30:25 - be estimated will be flagged. Note that minsamp is build 12-Sep-2018 15:30:25 - effectively at least 2 if dorms is False, and 1 if it is build 12-Sep-2018 15:30:25 - True. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - field -- Select field using field id(s) or field name(s). build 12-Sep-2018 15:30:25 - [run listobs to obtain the list id's or names] build 12-Sep-2018 15:30:25 - default: ''=all fields If field string is a non-negative build 12-Sep-2018 15:30:25 - integer, it is assumed to be a field index build 12-Sep-2018 15:30:25 - otherwise, it is assumed to be a field name build 12-Sep-2018 15:30:25 - field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 - field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 - field='3C286,3C295'; fields named 3C286 and 3C295 build 12-Sep-2018 15:30:25 - field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - spw -- Select spectral window/channels for changing WEIGHT and SIGMA. build 12-Sep-2018 15:30:25 - default: ''=all spectral windows and channels build 12-Sep-2018 15:30:25 - spw='0~2,4'; spectral windows 0,1,2,4 (all channels) build 12-Sep-2018 15:30:25 - spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 - spw='0:5~61'; spw 0, channels 5 to 61 build 12-Sep-2018 15:30:25 - spw='0,10,3:3~45'; spw 0,10 all channels, spw 3 - chans 3 to 45. build 12-Sep-2018 15:30:25 - spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. build 12-Sep-2018 15:30:25 - spw = '*:3~64' channels 3 through 64 for all sp id's build 12-Sep-2018 15:30:25 - spw = ' :3~64' will NOT work. build 12-Sep-2018 15:30:25 - statwt does not support multiple channel ranges per spectral build 12-Sep-2018 15:30:25 - window (';') because it is not clear whether to keep the ranges build 12-Sep-2018 15:30:25 - in the original spectral window or make a new spectral window build 12-Sep-2018 15:30:25 - for each additional range. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - antenna -- Select antennas/baselines for changing WEIGHT and SIGMA. build 12-Sep-2018 15:30:25 - default: '' (all) build 12-Sep-2018 15:30:25 - Non-negative integers are assumed to be antenna indices, and build 12-Sep-2018 15:30:25 - anything else is taken as an antenna name. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Examples: build 12-Sep-2018 15:30:25 - antenna='5&6': baseline between antenna index 5 and index 6. build 12-Sep-2018 15:30:25 - antenna='VA05&VA06': baseline between VLA antenna 5 and 6. build 12-Sep-2018 15:30:25 - antenna='5&6;7&8': baselines 5-6 and 7-8 build 12-Sep-2018 15:30:25 - antenna='5': all baselines with antenna 5 build 12-Sep-2018 15:30:25 - antenna='5,6,10': all baselines including antennas 5, 6, or 10 build 12-Sep-2018 15:30:25 - antenna='5,6,10&': all baselines with *only* antennas 5, 6, or build 12-Sep-2018 15:30:25 - 10. (cross-correlations only. Use && build 12-Sep-2018 15:30:25 - to include autocorrelations, and &&& build 12-Sep-2018 15:30:25 - to get only autocorrelations.) build 12-Sep-2018 15:30:25 - antenna='!ea03,ea12,ea17': all baselines except those that build 12-Sep-2018 15:30:25 - include EVLA antennas ea03, ea12, or build 12-Sep-2018 15:30:25 - ea17. build 12-Sep-2018 15:30:25 - timerange -- Select data based on time range: build 12-Sep-2018 15:30:25 - default = '' (all); examples, build 12-Sep-2018 15:30:25 - timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss' build 12-Sep-2018 15:30:25 - Note: if YYYY/MM/DD is missing date, timerange defaults to the build 12-Sep-2018 15:30:25 - first day in the dataset build 12-Sep-2018 15:30:25 - timerange='09:14:0~09:54:0' picks 40 min on first day build 12-Sep-2018 15:30:25 - timerange='25:00:00~27:30:00' picks 1 hr to 3 hr 30min build 12-Sep-2018 15:30:25 - on next day build 12-Sep-2018 15:30:25 - timerange='09:44:00' data within one integration of time build 12-Sep-2018 15:30:25 - timerange='>10:24:00' data after this time build 12-Sep-2018 15:30:25 - scan -- Scan number range build 12-Sep-2018 15:30:25 - default: ''=all build 12-Sep-2018 15:30:25 - intent -- Select by scan intent (state). Case sensitive. build 12-Sep-2018 15:30:25 - default: '' = all build 12-Sep-2018 15:30:25 - Examples: build 12-Sep-2018 15:30:25 - intent = 'CALIBRATE_ATMOSPHERE_REFERENCE' build 12-Sep-2018 15:30:25 - intent = 'calibrate_atmosphere_reference'.upper() # same as above build 12-Sep-2018 15:30:25 - # Select states that include one or both of CALIBRATE_WVR.REFERENCE build 12-Sep-2018 15:30:25 - # or OBSERVE_TARGET_ON_SOURCE. build 12-Sep-2018 15:30:25 - intent = 'CALIBRATE_WVR.REFERENCE, OBSERVE_TARGET_ON_SOURCE' build 12-Sep-2018 15:30:25 - array -- (Sub)array number range build 12-Sep-2018 15:30:25 - default: ''=all build 12-Sep-2018 15:30:25 - correlation -- Select correlations, e.g. 'rr, ll' or ['XY', 'YX']. build 12-Sep-2018 15:30:25 - default '' (all). build 12-Sep-2018 15:30:25 - NB: In CASA v4.5, non-trivial correlation selection has build 12-Sep-2018 15:30:25 - been disabled since it was not working correctly, and build 12-Sep-2018 15:30:25 - it is likely undesirable to set the weights in a build 12-Sep-2018 15:30:25 - correlation-dependent way. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - observation -- Select by observation ID(s). build 12-Sep-2018 15:30:25 - default: '' = all build 12-Sep-2018 15:30:25 - datacolumn -- Which data column to calculate the scatter from build 12-Sep-2018 15:30:25 - default='corrected'; example: datacolumn='data' build 12-Sep-2018 15:30:25 - Options: 'data', 'corrected', 'model', 'float_data' build 12-Sep-2018 15:30:25 - note: 'corrected' will fall back to DATA if CORRECTED_DATA build 12-Sep-2018 15:30:25 - is absent. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + IF NOT RUN IN PREVIEW MODE, THIS APPLICATION WILL MODIFY THE WEIGHT, WEIGHT SPECTRUM, FLAG, build 12-Sep-2018 15:30:25 + AND FLAG_ROW COLUMNS OF THE INPUT MS. IF YOU WANT A PRISTINE COPY OF THE INPUT MS TO BE build 12-Sep-2018 15:30:25 + PRESERVED, YOU SHOULD MAKE A COPY OF IT BEFORE RUNNING THIS APPLICATION. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + This application computes weights for the WEIGHT and WEIGHT_SPECTRUM (if present) columns build 12-Sep-2018 15:30:25 + based on the variance of values in the CORRECTED_DATA or DATA column. If the MS does not build 12-Sep-2018 15:30:25 + have the specified data column, the application will fail. The following algorithm is used: build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + 1. For unflagged data in each sample, create two sets of values, one set is composed solely build 12-Sep-2018 15:30:25 + of the real part of the data values, the other set is composed solely of the imaginary build 12-Sep-2018 15:30:25 + part of the data values. build 12-Sep-2018 15:30:25 + 2. Compute the variance of each of these sets, vr and vi. build 12-Sep-2018 15:30:25 + 3. Compute veq = (vr + vi)/2. build 12-Sep-2018 15:30:25 + 4. The associated weight is just the reciprocal of veq. The weight will have unit build 12-Sep-2018 15:30:25 + of (data unit)^(-2), eg Jy^(-2). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Data are aggregated on a per-baseline, per-data description ID basis. Data are aggregated build 12-Sep-2018 15:30:25 + in bins determined by the specified values of the timebin and chanbin parameters. By default, build 12-Sep-2018 15:30:25 + data for separate correlations are aggregated separately. This behavior can be overriden build 12-Sep-2018 15:30:25 + by specifying combine="corr" (see below). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + RULES REGARDING CREATING/INITIALIZING WEIGHT_SPECTRUM COLUMN build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + 1. If run in preview mode (preview=True), no data are modified and no columns are added. build 12-Sep-2018 15:30:25 + 2. Else if the MS already has a WEIGHT_SPECTRUM and this column has been initialized (has values), build 12-Sep-2018 15:30:25 + it will always be populated with the new weights. The WEIGHT column will be populated with build 12-Sep-2018 15:30:25 + the corresponding median values of the associated WEIGHT_SPECTRUM array. build 12-Sep-2018 15:30:25 + 3. Else if the frequency range specified for the sample is not the default ("spw"), the build 12-Sep-2018 15:30:25 + WEIGHT_SPECTRUM column will be created (if it doesn't already exist) and the new weights build 12-Sep-2018 15:30:25 + will be written to it. The WEIGHT column should be populated with the corresponding median build 12-Sep-2018 15:30:25 + values of the WEIGHT_SPECTRUM array. build 12-Sep-2018 15:30:25 + 4. Otherwise the single value for each spectral window will be written to the WEIGHT column; build 12-Sep-2018 15:30:25 + the WEIGHT_SPECTRUM column will not be added if it doesn't already exist, and if it does, build 12-Sep-2018 15:30:25 + it will remain uninitialized (no values will be written to it). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + TIME BINNING build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + One of two algorithms can be used for time binning. If slidetimebin=True, then build 12-Sep-2018 15:30:25 + a sliding time bin of the specified width is used. If slidetimebin=False, then build 12-Sep-2018 15:30:25 + block time processing is used. The sliding time bin algorithm will generally be build 12-Sep-2018 15:30:25 + both more memory intensive and take longer than the block processing algorithm. build 12-Sep-2018 15:30:25 + Each algorithm is discussed in detail below. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + If the value of timebin is an integer, it means that the specified value should be build 12-Sep-2018 15:30:25 + multiplied by the representative integration time in the MS. This integration is the build 12-Sep-2018 15:30:25 + median value of all the values in the INTERVAL column. Flags are not considered in build 12-Sep-2018 15:30:25 + the integration time computation. If either extrema in the INTERVAL column differs from build 12-Sep-2018 15:30:25 + the median by more than 25%, the application will fail because the values vary too much build 12-Sep-2018 15:30:25 + for there to be a single, representative, integration time. The timebin parameter can build 12-Sep-2018 15:30:25 + also be specified as a quantity (string) that must have time conformant units. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Block Time Processing build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The data are processed in blocks. This means that all weight spectrum values will be set to build 12-Sep-2018 15:30:25 + the same value for all points within the same time bin/channel bin/correlation bin ( build 12-Sep-2018 15:30:25 + see the section on channel binning and description of combine="corr" for more details on build 12-Sep-2018 15:30:25 + channel binning and correlation binning). build 12-Sep-2018 15:30:25 + The time bins are not necessarily contiguous and are not necessarily the same width. The start build 12-Sep-2018 15:30:25 + of a bin is always coincident with a value from the TIME column, So for example, if values build 12-Sep-2018 15:30:25 + from the time column are [20, 60, 100, 140, 180, 230], and the width of the bins is chosen build 12-Sep-2018 15:30:25 + to be 110s, the first bin would start at 20s and run to 130s, so that data from timestamps build 12-Sep-2018 15:30:25 + 20, 60, and 100 will be included in the first bin. The second bin would start at 140s, so that build 12-Sep-2018 15:30:25 + data for timestamps 140, 180, and 230 would be included in the second bin. Also, time binning build 12-Sep-2018 15:30:25 + does not span scan boundaries, so that data associated with different scan numbers will build 12-Sep-2018 15:30:25 + always be binned separately; changes in SCAN_NUMBER will cause a new time bin to be created, build 12-Sep-2018 15:30:25 + with its starting value coincident with the time of the new SCAN_NUMBER. Similar behavior can build 12-Sep-2018 15:30:25 + be expected for changes in FIELD_ID and ARRAY_ID. One can override this behavior for some build 12-Sep-2018 15:30:25 + columns by specifying the combine parameter (see below). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Sliding Time Window Processing build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + In this case, the time window is always centered on the timestamp of the row in question build 12-Sep-2018 15:30:25 + and extends +/-timebin/2 around that timestamp, subject the the time block boundaries. build 12-Sep-2018 15:30:25 + Rows with the same baselines and data description IDs which are included in that window build 12-Sep-2018 15:30:25 + are used for determining the weight of that row. The boundaries of the time block to which build 12-Sep-2018 15:30:25 + the window is restricted are determined by changes in FIELD_ID, ARRAY_ID, and SCAN_NUMBER. build 12-Sep-2018 15:30:25 + One can override this behavior for FIELD_ID and/or SCAN_NUMBER by specifying the combine build 12-Sep-2018 15:30:25 + parameter (see below). Unlike the time block processing algorithm, this sliding time window build 12-Sep-2018 15:30:25 + algorithm requires that details all rows for the time block in question are kept in memory, build 12-Sep-2018 15:30:25 + and thus the sliding window algorithm in general requires more memory than the blcok build 12-Sep-2018 15:30:25 + processing method. Also, unlike the block processing method which computes a single value build 12-Sep-2018 15:30:25 + for all weights within a single bin, the sliding window method requires that each row build 12-Sep-2018 15:30:25 + (along with each channel and correlation bin) be processed individually, so in general build 12-Sep-2018 15:30:25 + the sliding window method will take longer than the block processing method. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + CHANNEL BINNING build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The width of channel bins is specified via the chanbin parameter. Channel binning occurs within build 12-Sep-2018 15:30:25 + individual spectral windows; bins never span multiple spectral windows. Each channel will build 12-Sep-2018 15:30:25 + be included in exactly one bin. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The default value "spw" indicates that all channels in each spectral window are to be build 12-Sep-2018 15:30:25 + included in a single bin. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Any other string value is interpreted as a quantity, and so should have frequency units, eg build 12-Sep-2018 15:30:25 + "1MHz". In this case, the channel frequencies from the CHAN_FREQ column of the SPECTRAL_WINDOW build 12-Sep-2018 15:30:25 + subtable of the MS are used to determine the bins. The first bin starts at the channel frequency build 12-Sep-2018 15:30:25 + of the 0th channel in the spectral window. Channels with frequencies that differ by less than build 12-Sep-2018 15:30:25 + the value specified by the chanbin parameter are included in this bin. The next bin starts at build 12-Sep-2018 15:30:25 + the frequency of the first channel outside the first bin, and the process is repeated until all build 12-Sep-2018 15:30:25 + channels have been binned. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + If specified as an integer, the value is interpreted as the number of channels to include in build 12-Sep-2018 15:30:25 + each bin. The final bin in the spectral window may not necessarily contain this number of build 12-Sep-2018 15:30:25 + channels. For example, if a spectral window has 15 channels, and chanbin is specified to be 6, build 12-Sep-2018 15:30:25 + then channels 0-5 will comprise the first bin, channels 6-11 the second, and channels 12-14 the build 12-Sep-2018 15:30:25 + third, so that only three channels will comprise the final bin. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + MINIMUM REQUIRED NUMBER OF VISIBILITIES build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The minsamp parameter allows the user to specify the minimum number of unflagged visibilities that build 12-Sep-2018 15:30:25 + must be present in a sample for that sample's weight to be computed. If a sample has less than build 12-Sep-2018 15:30:25 + this number of unflagged points, the associated weights of all the points in the sample are build 12-Sep-2018 15:30:25 + set to zero, and all the points in the sample are flagged. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + AGGREGATING DATA ACROSS BOUNDARIES build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + By default, data are not aggregated across changes in values in the columns ARRAY_ID, build 12-Sep-2018 15:30:25 + SCAN_NUMBER, STATE_ID, FIELD_ID, and DATA_DESC_ID. One can override this behavior for build 12-Sep-2018 15:30:25 + SCAN_NUMBER, STATE_ID, and FIELD_ID by specifying the combine parameter. For example, build 12-Sep-2018 15:30:25 + specifying combine="scan" will ignore scan boundaries when aggregating data. Specifying build 12-Sep-2018 15:30:25 + combine="field, scan" will ignore both scan and field boundaries when aggregating data. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Also by default, data for separate correlations are aggregated separately. Data for all build 12-Sep-2018 15:30:25 + correlations within each spectral window can be aggregated together by specifying build 12-Sep-2018 15:30:25 + "corr" in the combine parameter. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Any combination and permutation of "scan", "field", "state", and "corr" are supported build 12-Sep-2018 15:30:25 + by the combine parameter. Other values will be silently ignored. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + STATISTICS ALGORITHMS build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The supported statistics algorithms are described in detail in the imstat and ia.statistics() build 12-Sep-2018 15:30:25 + help. For the current application, these algorithms are used to compute vr and vi (see above), build 12-Sep-2018 15:30:25 + such that the set of the real parts of the visibilities and the set of the imaginary parts of build 12-Sep-2018 15:30:25 + the visibilities are treated as independent data sets. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + RANGE OF ACCEPTABLE WEIGHTS build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The wtrange parameter allows one to specify the acceptable range (inclusive, except for zero) build 12-Sep-2018 15:30:25 + for weights. Data with weights computed to be outside this range will be flagged. If not build 12-Sep-2018 15:30:25 + specified (empty array), all weights are considered to be acceptable. If specified, the array build 12-Sep-2018 15:30:25 + must contain exactly two nonnegative numeric values. Note that data with weights of zero are build 12-Sep-2018 15:30:25 + always flagged. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + EXCLUDING CHANNELS build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Channels can be excluded from the computation of the weights by specifying the excludechans build 12-Sep-2018 15:30:25 + parameter. This parameter accepts a valid MS channel selection string. Data associated with build 12-Sep-2018 15:30:25 + the selected channels will not be used in computing the weights. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + PREVIEW MODE build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + By setting preview=True, the application is run in "preview" mode. In this mode, no data build 12-Sep-2018 15:30:25 + in the input MS are changed, although the amount of data that the application would have build 12-Sep-2018 15:30:25 + flagged is reported. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + DATA COLUMN build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The datacolumn parameter can be specified to indicate which data column should be used build 12-Sep-2018 15:30:25 + for computing the weights. The values "corrected" for the CORRECTED_DATA column and "data" build 12-Sep-2018 15:30:25 + for the DATA column are supported (minimum match, case insensitive). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + OTHER CONSIDERATIONS build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Flagged values are not used in computing the weights, although the associated weights of build 12-Sep-2018 15:30:25 + these values are updated. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + If the variance for a set of data is 0, all associated flags for that data are set to True, build 12-Sep-2018 15:30:25 + and the corresponding weights are set to 0. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + EXAMPLE build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + # update the weights of an MS using time binning of 300s build 12-Sep-2018 15:30:25 + statwt("my.ms", timebin="300s") build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/statwt2.xml b/gcwrap/tasks/statwt2.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index b6fbd2a..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/statwt2.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,341 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Compute and set weights based on variance of data. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of measurement set build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Enable data selection parameters build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Selection based on field names or field index numbers. Default is all. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - "0~2", or "3C286" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Selection based on spectral windows:channels. Default is all. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - "3" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Selection based on intents. Default is all. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - "my_intent" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Selection based on array IDs. Default is all. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - "1" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Selection based on observation IDs. Default is all. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - "1" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Ignore changes in these columns (scan, field, and/or state) when aggregating samples to compute weights. The value "corr" is also supported to aggregate samples across correlations. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - "scan,field" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Length for binning in time to determine statistics. Can either be integer to be multiplied by the representative integration time, a quantity (string) in time units build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - 5 or "100s" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Use a sliding window for time binning, as opposed to time block processing? build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Channel bin width for computing weights. Can either be integer, in which case it is interpreted as number of channels to include in each bin, or a string "spw" or quantity with frequency units. build 12-Sep-2018 15:30:25 - spw build 12-Sep-2018 15:30:25 - 5 or "1.5MHz" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Minimum number of unflagged visibilities required for computing weights in a sample. Must be >= 2. build 12-Sep-2018 15:30:25 - 2 build 12-Sep-2018 15:30:25 - 10 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Statistics algorithm to use for computing variances. Supported values are "chauvenet", "classic", "fit-half", and "hinges-fences". Minimum match is supported, although the full string must be specified for the subparameters to appear in the inputs list. build 12-Sep-2018 15:30:25 - classic build 12-Sep-2018 15:30:25 - "cl", "ch", "f", or "h" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Fence value for statalg="hinges-fences". A negative value means use the entire data set (ie default to the "classic" algorithm). Ignored if statalg is not "hinges-fences". build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - 0.2 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Center to use for statalg="fit-half". Valid choices are "mean", "median", and "zero". Ignored if statalg is not "fit-half". build 12-Sep-2018 15:30:25 - mean build 12-Sep-2018 15:30:25 - "mean", "median", or "zero" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - For statalg="fit-half", real data are <=; center? If false, real data are >= center. Ignored if statalg is not "fit-half". build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - For statalg="chauvenet", this is the target maximum number of standard deviations data may have to be included. If negative, use Chauvenet\'s criterion. Ignored if statalg is not "chauvenet". build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - 3.5 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - For statalg="chauvenet", this is the maximum number of iterations to attempt. Iterating will stop when either this limit is reached, or the zscore criterion is met. If negative, iterate until the zscore criterion is met. Ignored if statalg is not "chauvenet". build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - 10 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Channels to exclude from the computation of weights. Specified as an MS select channel selection string. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - "0:5~30" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Range of acceptable weights. Data with weights outside this range will be flagged. Empty array (default) means all weights are good. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - [0.1, 10] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Back up the state of flags before the run? build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - True, False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Preview mode. If True, no data is changed, although the amount of data that would have been flagged is reported. build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - True or False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Data column to use to compute weights. Supported values are "data", "corrected", "residual", and "residual_data" (case insensitive, minimum match supported). build 12-Sep-2018 15:30:25 - corrected build 12-Sep-2018 15:30:25 - "data" or "corrected" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - "" build 12-Sep-2018 15:30:25 - "" build 12-Sep-2018 15:30:25 - "" build 12-Sep-2018 15:30:25 - "" build 12-Sep-2018 15:30:25 - "" build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mean build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - IF NOT RUN IN PREVIEW MODE, THIS APPLICATION WILL MODIFY THE WEIGHT, WEIGHT SPECTRUM, FLAG, build 12-Sep-2018 15:30:25 - AND FLAG_ROW COLUMNS OF THE INPUT MS. IF YOU WANT A PRISTINE COPY OF THE INPUT MS TO BE build 12-Sep-2018 15:30:25 - PRESERVED, YOU SHOULD MAKE A COPY OF IT BEFORE RUNNING THIS APPLICATION. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - This application computes weights for the WEIGHT and WEIGHT_SPECTRUM (if present) columns build 12-Sep-2018 15:30:25 - based on the variance of values in the CORRECTED_DATA or DATA column. If the MS does not build 12-Sep-2018 15:30:25 - have the specified data column, the application will fail. The following algorithm is used: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1. For unflagged data in each sample, create two sets of values, one set is composed solely build 12-Sep-2018 15:30:25 - of the real part of the data values, the other set is composed solely of the imaginary build 12-Sep-2018 15:30:25 - part of the data values. build 12-Sep-2018 15:30:25 - 2. Compute the variance of each of these sets, vr and vi. build 12-Sep-2018 15:30:25 - 3. Compute veq = (vr + vi)/2. build 12-Sep-2018 15:30:25 - 4. The associated weight is just the reciprocal of veq. The weight will have unit build 12-Sep-2018 15:30:25 - of (data unit)^(-2), eg Jy^(-2). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Data are aggregated on a per-baseline, per-data description ID basis. Data are aggregated build 12-Sep-2018 15:30:25 - in bins determined by the specified values of the timebin and chanbin parameters. By default, build 12-Sep-2018 15:30:25 - data for separate correlations are aggregated separately. This behavior can be overriden build 12-Sep-2018 15:30:25 - by specifying combine="corr" (see below). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - RULES REGARDING CREATING/INITIALIZING WEIGHT_SPECTRUM COLUMN build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1. If run in preview mode (preview=True), no data are modified and no columns are added. build 12-Sep-2018 15:30:25 - 2. Else if the MS already has a WEIGHT_SPECTRUM and this column has been initialized (has values), build 12-Sep-2018 15:30:25 - it will always be populated with the new weights. The WEIGHT column will be populated with build 12-Sep-2018 15:30:25 - the corresponding median values of the associated WEIGHT_SPECTRUM array. build 12-Sep-2018 15:30:25 - 3. Else if the frequency range specified for the sample is not the default ("spw"), the build 12-Sep-2018 15:30:25 - WEIGHT_SPECTRUM column will be created (if it doesn't already exist) and the new weights build 12-Sep-2018 15:30:25 - will be written to it. The WEIGHT column should be populated with the corresponding median build 12-Sep-2018 15:30:25 - values of the WEIGHT_SPECTRUM array. build 12-Sep-2018 15:30:25 - 4. Otherwise the single value for each spectral window will be written to the WEIGHT column; build 12-Sep-2018 15:30:25 - the WEIGHT_SPECTRUM column will not be added if it doesn't already exist, and if it does, build 12-Sep-2018 15:30:25 - it will remain uninitialized (no values will be written to it). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - TIME BINNING build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - One of two algorithms can be used for time binning. If slidetimebin=True, then build 12-Sep-2018 15:30:25 - a sliding time bin of the specified width is used. If slidetimebin=False, then build 12-Sep-2018 15:30:25 - block time processing is used. The sliding time bin algorithm will generally be build 12-Sep-2018 15:30:25 - both more memory intensive and take longer than the block processing algorithm. build 12-Sep-2018 15:30:25 - Each algorithm is discussed in detail below. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - If the value of timebin is an integer, it means that the specified value should be build 12-Sep-2018 15:30:25 - multiplied by the representative integration time in the MS. This integration is the build 12-Sep-2018 15:30:25 - median value of all the values in the INTERVAL column. Flags are not considered in build 12-Sep-2018 15:30:25 - the integration time computation. If either extrema in the INTERVAL column differs from build 12-Sep-2018 15:30:25 - the median by more than 25%, the application will fail because the values vary too much build 12-Sep-2018 15:30:25 - for there to be a single, representative, integration time. The timebin parameter can build 12-Sep-2018 15:30:25 - also be specified as a quantity (string) that must have time conformant units. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Block Time Processing build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The data are processed in blocks. This means that all weight spectrum values will be set to build 12-Sep-2018 15:30:25 - the same value for all points within the same time bin/channel bin/correlation bin ( build 12-Sep-2018 15:30:25 - see the section on channel binning and description of combine="corr" for more details on build 12-Sep-2018 15:30:25 - channel binning and correlation binning). build 12-Sep-2018 15:30:25 - The time bins are not necessarily contiguous and are not necessarily the same width. The start build 12-Sep-2018 15:30:25 - of a bin is always coincident with a value from the TIME column, So for example, if values build 12-Sep-2018 15:30:25 - from the time column are [20, 60, 100, 140, 180, 230], and the width of the bins is chosen build 12-Sep-2018 15:30:25 - to be 110s, the first bin would start at 20s and run to 130s, so that data from timestamps build 12-Sep-2018 15:30:25 - 20, 60, and 100 will be included in the first bin. The second bin would start at 140s, so that build 12-Sep-2018 15:30:25 - data for timestamps 140, 180, and 230 would be included in the second bin. Also, time binning build 12-Sep-2018 15:30:25 - does not span scan boundaries, so that data associated with different scan numbers will build 12-Sep-2018 15:30:25 - always be binned separately; changes in SCAN_NUMBER will cause a new time bin to be created, build 12-Sep-2018 15:30:25 - with its starting value coincident with the time of the new SCAN_NUMBER. Similar behavior can build 12-Sep-2018 15:30:25 - be expected for changes in FIELD_ID and ARRAY_ID. One can override this behavior for some build 12-Sep-2018 15:30:25 - columns by specifying the combine parameter (see below). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Sliding Time Window Processing build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - In this case, the time window is always centered on the timestamp of the row in question build 12-Sep-2018 15:30:25 - and extends +/-timebin/2 around that timestamp, subject the the time block boundaries. build 12-Sep-2018 15:30:25 - Rows with the same baselines and data description IDs which are included in that window build 12-Sep-2018 15:30:25 - are used for determining the weight of that row. The boundaries of the time block to which build 12-Sep-2018 15:30:25 - the window is restricted are determined by changes in FIELD_ID, ARRAY_ID, and SCAN_NUMBER. build 12-Sep-2018 15:30:25 - One can override this behavior for FIELD_ID and/or SCAN_NUMBER by specifying the combine build 12-Sep-2018 15:30:25 - parameter (see below). Unlike the time block processing algorithm, this sliding time window build 12-Sep-2018 15:30:25 - algorithm requires that details all rows for the time block in question are kept in memory, build 12-Sep-2018 15:30:25 - and thus the sliding window algorithm in general requires more memory than the blcok build 12-Sep-2018 15:30:25 - processing method. Also, unlike the block processing method which computes a single value build 12-Sep-2018 15:30:25 - for all weights within a single bin, the sliding window method requires that each row build 12-Sep-2018 15:30:25 - (along with each channel and correlation bin) be processed individually, so in general build 12-Sep-2018 15:30:25 - the sliding window method will take longer than the block processing method. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - CHANNEL BINNING build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The width of channel bins is specified via the chanbin parameter. Channel binning occurs within build 12-Sep-2018 15:30:25 - individual spectral windows; bins never span multiple spectral windows. Each channel will build 12-Sep-2018 15:30:25 - be included in exactly one bin. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The default value "spw" indicates that all channels in each spectral window are to be build 12-Sep-2018 15:30:25 - included in a single bin. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Any other string value is interpreted as a quantity, and so should have frequency units, eg build 12-Sep-2018 15:30:25 - "1MHz". In this case, the channel frequencies from the CHAN_FREQ column of the SPECTRAL_WINDOW build 12-Sep-2018 15:30:25 - subtable of the MS are used to determine the bins. The first bin starts at the channel frequency build 12-Sep-2018 15:30:25 - of the 0th channel in the spectral window. Channels with frequencies that differ by less than build 12-Sep-2018 15:30:25 - the value specified by the chanbin parameter are included in this bin. The next bin starts at build 12-Sep-2018 15:30:25 - the frequency of the first channel outside the first bin, and the process is repeated until all build 12-Sep-2018 15:30:25 - channels have been binned. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - If specified as an integer, the value is interpreted as the number of channels to include in build 12-Sep-2018 15:30:25 - each bin. The final bin in the spectral window may not necessarily contain this number of build 12-Sep-2018 15:30:25 - channels. For example, if a spectral window has 15 channels, and chanbin is specified to be 6, build 12-Sep-2018 15:30:25 - then channels 0-5 will comprise the first bin, channels 6-11 the second, and channels 12-14 the build 12-Sep-2018 15:30:25 - third, so that only three channels will comprise the final bin. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - MINIMUM REQUIRED NUMBER OF VISIBILITIES build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The minsamp parameter allows the user to specify the minimum number of unflagged visibilities that build 12-Sep-2018 15:30:25 - must be present in a sample for that sample's weight to be computed. If a sample has less than build 12-Sep-2018 15:30:25 - this number of unflagged points, the associated weights of all the points in the sample are build 12-Sep-2018 15:30:25 - set to zero, and all the points in the sample are flagged. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - AGGREGATING DATA ACROSS BOUNDARIES build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - By default, data are not aggregated across changes in values in the columns ARRAY_ID, build 12-Sep-2018 15:30:25 - SCAN_NUMBER, STATE_ID, FIELD_ID, and DATA_DESC_ID. One can override this behavior for build 12-Sep-2018 15:30:25 - SCAN_NUMBER, STATE_ID, and FIELD_ID by specifying the combine parameter. For example, build 12-Sep-2018 15:30:25 - specifying combine="scan" will ignore scan boundaries when aggregating data. Specifying build 12-Sep-2018 15:30:25 - combine="field, scan" will ignore both scan and field boundaries when aggregating data. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Also by default, data for separate correlations are aggregated separately. Data for all build 12-Sep-2018 15:30:25 - correlations within each spectral window can be aggregated together by specifying build 12-Sep-2018 15:30:25 - "corr" in the combine parameter. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Any combination and permutation of "scan", "field", "state", and "corr" are supported build 12-Sep-2018 15:30:25 - by the combine parameter. Other values will be silently ignored. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - STATISTICS ALGORITHMS build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The supported statistics algorithms are described in detail in the imstat and ia.statistics() build 12-Sep-2018 15:30:25 - help. For the current application, these algorithms are used to compute vr and vi (see above), build 12-Sep-2018 15:30:25 - such that the set of the real parts of the visibilities and the set of the imaginary parts of build 12-Sep-2018 15:30:25 - the visibilities are treated as independent data sets. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - RANGE OF ACCEPTABLE WEIGHTS build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The wtrange parameter allows one to specify the acceptable range (inclusive, except for zero) build 12-Sep-2018 15:30:25 - for weights. Data with weights computed to be outside this range will be flagged. If not build 12-Sep-2018 15:30:25 - specified (empty array), all weights are considered to be acceptable. If specified, the array build 12-Sep-2018 15:30:25 - must contain exactly two nonnegative numeric values. Note that data with weights of zero are build 12-Sep-2018 15:30:25 - always flagged. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - EXCLUDING CHANNELS build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Channels can be excluded from the computation of the weights by specifying the excludechans build 12-Sep-2018 15:30:25 - parameter. This parameter accepts a valid MS channel selection string. Data associated with build 12-Sep-2018 15:30:25 - the selected channels will not be used in computing the weights. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - PREVIEW MODE build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - By setting preview=True, the application is run in "preview" mode. In this mode, no data build 12-Sep-2018 15:30:25 - in the input MS are changed, although the amount of data that the application would have build 12-Sep-2018 15:30:25 - flagged is reported. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - DATA COLUMN build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The datacolumn parameter can be specified to indicate which data column should be used build 12-Sep-2018 15:30:25 - for computing the weights. The values "corrected" for the CORRECTED_DATA column and "data" build 12-Sep-2018 15:30:25 - for the DATA column are supported (minimum match, case insensitive). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - OTHER CONSIDERATIONS build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Flagged values are not used in computing the weights, although the associated weights of build 12-Sep-2018 15:30:25 - these values are updated. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - If the variance for a set of data is 0, all associated flags for that data are set to True, build 12-Sep-2018 15:30:25 - and the corresponding weights are set to 0. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - EXAMPLE build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - # update the weights of an MS using time binning of 300s build 12-Sep-2018 15:30:25 - statwt2("my.ms", timebin="300s") build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/tclean.xml b/gcwrap/tasks/tclean.xml build 12-Sep-2018 15:30:25 index 3e3ecdd..29784ef 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/tclean.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/tclean.xml build 12-Sep-2018 15:30:25 @@ -6,16 +6,16 @@ xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd build 12-Sep-2018 15:30:25 file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Radio Interferometric Image Reconstruction build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Form images from visibilities and reconstruct a sky model. build 12-Sep-2018 15:30:25 - This task handles continuum images and spectral line cubes, build 12-Sep-2018 15:30:25 + Form images from visibilities and reconstruct a sky model. build 12-Sep-2018 15:30:25 + This task handles continuum images and spectral line cubes, build 12-Sep-2018 15:30:25 supports outlier fields, contains standard clean based algorithms build 12-Sep-2018 15:30:25 along with algorithms for multi-scale and wideband image build 12-Sep-2018 15:30:25 - reconstruction, widefield imaging correcting for the w-term, build 12-Sep-2018 15:30:25 - full primary-beam imaging and joint mosaic imaging (with build 12-Sep-2018 15:30:25 + reconstruction, widefield imaging correcting for the w-term, build 12-Sep-2018 15:30:25 + full primary-beam imaging and joint mosaic imaging (with build 12-Sep-2018 15:30:25 heterogeneous array support for ALMA). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -29,7 +29,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Name of input visibility file(s) build 12-Sep-2018 15:30:25 Name(s) of input visibility file(s) build 12-Sep-2018 15:30:25 - default: none; build 12-Sep-2018 15:30:25 + default: none; build 12-Sep-2018 15:30:25 example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 vis=['ngc5921a.ms','ngc5921b.ms']; multiple MSes build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -40,7 +40,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Enable data selection parameters build 12-Sep-2018 15:30:25 -Enable data selection parameters. build 12-Sep-2018 15:30:25 +Enable data selection parameters. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 True build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -51,7 +51,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 ['go listobs' to obtain the list id's or names] build 12-Sep-2018 15:30:25 default: ''= all fields build 12-Sep-2018 15:30:25 If field string is a non-negative integer, it is assumed to build 12-Sep-2018 15:30:25 - be a field index otherwise, it is assumed to be a build 12-Sep-2018 15:30:25 + be a field index otherwise, it is assumed to be a build 12-Sep-2018 15:30:25 field name build 12-Sep-2018 15:30:25 field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 @@ -59,7 +59,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 For multiple MS input, a list of field strings can be used: build 12-Sep-2018 15:30:25 field = ['0~2','0~4']; field ids 0-2 for the first MS and 0-4 build 12-Sep-2018 15:30:25 - for the second build 12-Sep-2018 15:30:25 + for the second build 12-Sep-2018 15:30:25 field = '0~2'; field ids 0-2 for all input MSes build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -71,12 +71,12 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 spw(s)/channels to select build 12-Sep-2018 15:30:25 Select spectral window/channels build 12-Sep-2018 15:30:25 NOTE: channels de-selected here will contain all zeros if build 12-Sep-2018 15:30:25 - selected by the parameter mode subparameters. build 12-Sep-2018 15:30:25 + selected by the parameter mode subparameters. build 12-Sep-2018 15:30:25 default: ''=all spectral windows and channels build 12-Sep-2018 15:30:25 spw='0~2,4'; spectral windows 0,1,2,4 (all channels) build 12-Sep-2018 15:30:25 spw='0:5~61'; spw 0, channels 5 to 61 build 12-Sep-2018 15:30:25 spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 - spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, build 12-Sep-2018 15:30:25 + spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, build 12-Sep-2018 15:30:25 channels 3 to 45. build 12-Sep-2018 15:30:25 spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. build 12-Sep-2018 15:30:25 For multiple MS input, a list of spw strings can be used: build 12-Sep-2018 15:30:25 @@ -99,19 +99,19 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 default: '' (all); examples, build 12-Sep-2018 15:30:25 timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss' build 12-Sep-2018 15:30:25 - Note: if YYYY/MM/DD is missing date defaults to first build 12-Sep-2018 15:30:25 + Note: if YYYY/MM/DD is missing date defaults to first build 12-Sep-2018 15:30:25 day in data set build 12-Sep-2018 15:30:25 timerange='09:14:0~09:54:0' picks 40 min on first day build 12-Sep-2018 15:30:25 - timerange='25:00:00~27:30:00' picks 1 hr to 3 hr build 12-Sep-2018 15:30:25 + timerange='25:00:00~27:30:00' picks 1 hr to 3 hr build 12-Sep-2018 15:30:25 30min on NEXT day build 12-Sep-2018 15:30:25 - timerange='09:44:00' pick data within one integration build 12-Sep-2018 15:30:25 + timerange='09:44:00' pick data within one integration build 12-Sep-2018 15:30:25 of time build 12-Sep-2018 15:30:25 timerange='> 10:24:00' data after this time build 12-Sep-2018 15:30:25 For multiple MS input, a list of timerange strings can be build 12-Sep-2018 15:30:25 used: build 12-Sep-2018 15:30:25 timerange=['09:14:0~09:54:0','> 10:24:00'] build 12-Sep-2018 15:30:25 timerange='09:14:0~09:54:0''; apply the same timerange for build 12-Sep-2018 15:30:25 - all input MSes build 12-Sep-2018 15:30:25 + all input MSes build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -139,18 +139,18 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 Select data based on antenna/baseline build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 default: '' (all) build 12-Sep-2018 15:30:25 - If antenna string is a non-negative integer, it is build 12-Sep-2018 15:30:25 + If antenna string is a non-negative integer, it is build 12-Sep-2018 15:30:25 assumed to be an antenna index, otherwise, it is build 12-Sep-2018 15:30:25 considered an antenna name. build 12-Sep-2018 15:30:25 - antenna='5\&6'; baseline between antenna index 5 and build 12-Sep-2018 15:30:25 + antenna='5\&6'; baseline between antenna index 5 and build 12-Sep-2018 15:30:25 index 6. build 12-Sep-2018 15:30:25 - antenna='VA05\&VA06'; baseline between VLA antenna 5 build 12-Sep-2018 15:30:25 + antenna='VA05\&VA06'; baseline between VLA antenna 5 build 12-Sep-2018 15:30:25 and 6. build 12-Sep-2018 15:30:25 antenna='5\&6;7\&8'; baselines 5-6 and 7-8 build 12-Sep-2018 15:30:25 antenna='5'; all baselines with antenna index 5 build 12-Sep-2018 15:30:25 - antenna='05'; all baselines with antenna number 05 build 12-Sep-2018 15:30:25 + antenna='05'; all baselines with antenna number 05 build 12-Sep-2018 15:30:25 (VLA old name) build 12-Sep-2018 15:30:25 - antenna='5,6,9'; all baselines with antennas 5,6,9 build 12-Sep-2018 15:30:25 + antenna='5,6,9'; all baselines with antennas 5,6,9 build 12-Sep-2018 15:30:25 index number build 12-Sep-2018 15:30:25 For multiple MS input, a list of antenna strings can be build 12-Sep-2018 15:30:25 used: build 12-Sep-2018 15:30:25 @@ -177,7 +177,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Observation ID range build 12-Sep-2018 15:30:25 Observation ID range build 12-Sep-2018 15:30:25 @@ -193,8 +193,8 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 Scan Intent(s) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 default: '' (all) build 12-Sep-2018 15:30:25 - example: intent='TARGET_SOURCE' build 12-Sep-2018 15:30:25 - example: intent='TARGET_SOURCE1,TARGET_SOURCE2' build 12-Sep-2018 15:30:25 + example: intent='TARGET_SOURCE' build 12-Sep-2018 15:30:25 + example: intent='TARGET_SOURCE1,TARGET_SOURCE2' build 12-Sep-2018 15:30:25 example: intent='TARGET_POINTING*' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -206,7 +206,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 Data column to image (data or observed, corrected) build 12-Sep-2018 15:30:25 default:'corrected' build 12-Sep-2018 15:30:25 ( If 'corrected' does not exist, it will use 'data' instead ) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 corrected build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -219,7 +219,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Pre-name of output images build 12-Sep-2018 15:30:25 Pre-name of output images build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 example : imagename='try' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Output images will be (a subset of) : build 12-Sep-2018 15:30:25 @@ -234,30 +234,30 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Widefield projection algorithms (gridder=mosaic,awproject) will build 12-Sep-2018 15:30:25 compute the following images too. build 12-Sep-2018 15:30:25 - try.weight - FT of gridded weights or the build 12-Sep-2018 15:30:25 + try.weight - FT of gridded weights or the build 12-Sep-2018 15:30:25 un-normalized sum of PB-square (for all pointings) build 12-Sep-2018 15:30:25 Here, PB = sqrt(weight) normalized to a maximum of 1.0 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - For multi-term wideband imaging, all relevant images above will build 12-Sep-2018 15:30:25 + For multi-term wideband imaging, all relevant images above will build 12-Sep-2018 15:30:25 have additional .tt0,.tt1, etc suffixes to indicate Taylor terms, build 12-Sep-2018 15:30:25 plus the following extra output images. build 12-Sep-2018 15:30:25 try.alpha - spectral index build 12-Sep-2018 15:30:25 try.alpha.error - estimate of error on spectral index build 12-Sep-2018 15:30:25 try.beta - spectral curvature (if nterms \> 2) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Tip : Include a directory name in 'imagename' for all build 12-Sep-2018 15:30:25 + Tip : Include a directory name in 'imagename' for all build 12-Sep-2018 15:30:25 output images to be sent there instead of the build 12-Sep-2018 15:30:25 current working directory : imagename='mydir/try' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Tip : Restarting an imaging run without changing 'imagename' build 12-Sep-2018 15:30:25 + Tip : Restarting an imaging run without changing 'imagename' build 12-Sep-2018 15:30:25 implies continuation from the existing model image on disk. build 12-Sep-2018 15:30:25 - - If 'startmodel' was initially specified it needs to be set to "" build 12-Sep-2018 15:30:25 + - If 'startmodel' was initially specified it needs to be set to "" build 12-Sep-2018 15:30:25 for the restart run (or tclean will exit with an error message). build 12-Sep-2018 15:30:25 - By default, the residual image and psf will be recomputed build 12-Sep-2018 15:30:25 - but if no changes were made to relevant parameters between build 12-Sep-2018 15:30:25 + but if no changes were made to relevant parameters between build 12-Sep-2018 15:30:25 the runs, set calcres=False, calcpsf=False to resume directly from build 12-Sep-2018 15:30:25 the minor cycle without the (unnecessary) first major cycle. build 12-Sep-2018 15:30:25 - To automatically change 'imagename' with a numerical build 12-Sep-2018 15:30:25 + To automatically change 'imagename' with a numerical build 12-Sep-2018 15:30:25 increment, set restart=False (see tclean docs for 'restart'). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Note : All imaging runs will by default produce restored images. build 12-Sep-2018 15:30:25 @@ -274,7 +274,7 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 Number of pixels build 12-Sep-2018 15:30:25 example : imsize = [350,250] build 12-Sep-2018 15:30:25 imsize = 500 is equivalent to [500,500] build 12-Sep-2018 15:30:25 - To take proper advantage of internal optimized FFT routines, the build 12-Sep-2018 15:30:25 + To take proper advantage of internal optimized FFT routines, the build 12-Sep-2018 15:30:25 number of pixels must be even and factorizable by 2,3,5,7 only. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -308,19 +308,24 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Stokes Planes to make build 12-Sep-2018 15:30:25 Stokes Planes to make build 12-Sep-2018 15:30:25 default='I'; example: stokes='IQUV'; build 12-Sep-2018 15:30:25 - Options: 'I','Q','U','V','IV','QU','IQ','UV','IQUV','RR','LL','XX','YY','RRLL','XXYY' build 12-Sep-2018 15:30:25 + Options: 'I','Q','U','V','IV','QU','IQ','UV','IQUV','RR','LL','XX','YY','RRLL','XXYY','pseudoI' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Note : Due to current internal code constraints, if any correlation pair build 12-Sep-2018 15:30:25 - is flagged, no data for that row in the MS will be used. build 12-Sep-2018 15:30:25 - So, in an MS with XX,YY, if only YY is flagged, neither a build 12-Sep-2018 15:30:25 + Note : Due to current internal code constraints, if any correlation pair build 12-Sep-2018 15:30:25 + is flagged, by default, no data for that row in the MS will be used. build 12-Sep-2018 15:30:25 + So, in an MS with XX,YY, if only YY is flagged, neither a build 12-Sep-2018 15:30:25 Stokes I image nor an XX image can be made from those data points. build 12-Sep-2018 15:30:25 In such a situation, please split out only the unflagged correlation into build 12-Sep-2018 15:30:25 - a separate MS. This constraint shall be removed (where logical) build 12-Sep-2018 15:30:25 - in a future release. build 12-Sep-2018 15:30:25 + a separate MS. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Note : The 'pseudoI' option is a partial solution, allowing Stokes I imaging build 12-Sep-2018 15:30:25 + when either of the parallel-hand correlations are unflagged. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The remaining constraints shall be removed (where logical) in a future release. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 I build 12-Sep-2018 15:30:25 @@ -340,12 +345,13 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 YY build 12-Sep-2018 15:30:25 RRLL build 12-Sep-2018 15:30:25 XXYY build 12-Sep-2018 15:30:25 + pseudoI build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Coordinate projection (SIN, HPX) build 12-Sep-2018 15:30:25 -Coordinate projection build 12-Sep-2018 15:30:25 +Coordinate projection build 12-Sep-2018 15:30:25 Examples : SIN, NCP build 12-Sep-2018 15:30:25 A list of supported (but untested) projections can be found here : build 12-Sep-2018 15:30:25 http://casa.nrao.edu/active/docs/doxygen/html/classcasa_1_1Projection.html#a3d5f9ec787e4eabdce57ab5edaf7c0cd build 12-Sep-2018 15:30:25 @@ -386,15 +392,15 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 Name of starting model image build 12-Sep-2018 15:30:25 Name of starting model image build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - The contents of the supplied starting model image will be build 12-Sep-2018 15:30:25 + The contents of the supplied starting model image will be build 12-Sep-2018 15:30:25 copied to the imagename.model before the run begins. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - example : startmodel = 'singledish.im' build 12-Sep-2018 15:30:25 + example : startmodel = 'singledish.im' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 For deconvolver='mtmfs', one image per Taylor term must be provided. build 12-Sep-2018 15:30:25 example : startmodel = ['try.model.tt0', 'try.model.tt1'] build 12-Sep-2018 15:30:25 startmodel = ['try.model.tt0'] will use a starting model only build 12-Sep-2018 15:30:25 - for the zeroth order term. build 12-Sep-2018 15:30:25 + for the zeroth order term. build 12-Sep-2018 15:30:25 startmodel = ['','try.model.tt1'] will use a starting model only build 12-Sep-2018 15:30:25 for the first order term. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -404,11 +410,11 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 A common usage is to set this parameter equal to a single dish image build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Negative components in the model image will be included as is. build 12-Sep-2018 15:30:25 + Negative components in the model image will be included as is. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - [ Note : If an error occurs during image resampling/regridding, build 12-Sep-2018 15:30:25 + [ Note : If an error occurs during image resampling/regridding, build 12-Sep-2018 15:30:25 please try using task imregrid to resample the starting model build 12-Sep-2018 15:30:25 - image onto a CASA image with the target shape and build 12-Sep-2018 15:30:25 + image onto a CASA image with the target shape and build 12-Sep-2018 15:30:25 coordinate system before supplying it via startmodel ] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -424,7 +430,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Spectral definition mode (mfs,cube,cubedata) build 12-Sep-2018 15:30:25 Spectral definition mode (mfs,cube,cubedata) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 mode='mfs' : Continuum imaging with only one output image channel. build 12-Sep-2018 15:30:25 (mode='cont' can also be used here) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -433,17 +439,17 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 coordinate system and can be specified either in terms build 12-Sep-2018 15:30:25 of channel numbers, frequency or velocity in whatever build 12-Sep-2018 15:30:25 spectral frame is specified in 'outframe'. build 12-Sep-2018 15:30:25 - All internal and output images are made with outframe as the build 12-Sep-2018 15:30:25 + All internal and output images are made with outframe as the build 12-Sep-2018 15:30:25 base spectral frame. However imaging code internally uses the fixed build 12-Sep-2018 15:30:25 - spectral frame, LSRK for automatic internal software build 12-Sep-2018 15:30:25 + spectral frame, LSRK for automatic internal software build 12-Sep-2018 15:30:25 Doppler tracking so that a spectral line observed over an build 12-Sep-2018 15:30:25 extended time range will line up appropriately. build 12-Sep-2018 15:30:25 - Therefore the output images have additional spectral frame conversion build 12-Sep-2018 15:30:25 - layer in LSRK on the top the base frame. build 12-Sep-2018 15:30:25 + Therefore the output images have additional spectral frame conversion build 12-Sep-2018 15:30:25 + layer in LSRK on the top the base frame. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - (Note : Even if the input parameters are specified in a frame build 12-Sep-2018 15:30:25 - other than LSRK, the viewer still displays spectral build 12-Sep-2018 15:30:25 + (Note : Even if the input parameters are specified in a frame build 12-Sep-2018 15:30:25 + other than LSRK, the viewer still displays spectral build 12-Sep-2018 15:30:25 axis in LSRK by default because of the conversion frame build 12-Sep-2018 15:30:25 layer mentioned above. The viewer can be used to relabel build 12-Sep-2018 15:30:25 the spectral axis in any desired frame - via the spectral build 12-Sep-2018 15:30:25 @@ -451,7 +457,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 data display options window.) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 may be smeared out in frequency. There is strictly build 12-Sep-2018 15:30:25 no valid spectral frame with which to label the output build 12-Sep-2018 15:30:25 images, but they will list the frame defined in the MS. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 mfs build 12-Sep-2018 15:30:25 @@ -505,17 +511,17 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 First channel (e.g. start=3,start=\'1.1GHz\',start=\'15343km/s\') build 12-Sep-2018 15:30:25 First channel (e.g. start=3,start=\'1.1GHz\',start=\'15343km/s\') build 12-Sep-2018 15:30:25 - of output cube images specified by data channel number (integer), build 12-Sep-2018 15:30:25 + of output cube images specified by data channel number (integer), build 12-Sep-2018 15:30:25 velocity (string with a unit), or frequency (string with a unit). build 12-Sep-2018 15:30:25 - Default:''; The first channel is automatically determined based on build 12-Sep-2018 15:30:25 + Default:''; The first channel is automatically determined based on build 12-Sep-2018 15:30:25 the 'spw' channel selection and 'width'. build 12-Sep-2018 15:30:25 When the channel number is used along with the channel selection build 12-Sep-2018 15:30:25 in 'spw' (e.g. spw='0:6~100'), build 12-Sep-2018 15:30:25 - 'start' channel number is RELATIVE (zero-based) to the selected build 12-Sep-2018 15:30:25 + 'start' channel number is RELATIVE (zero-based) to the selected build 12-Sep-2018 15:30:25 channels in 'spw'. So for the above example, build 12-Sep-2018 15:30:25 - start=1 means that the first image channel is the second selected build 12-Sep-2018 15:30:25 + start=1 means that the first image channel is the second selected build 12-Sep-2018 15:30:25 data channel, which is channel 7. build 12-Sep-2018 15:30:25 - For specmode='cube', when velocity or frequency is used it is build 12-Sep-2018 15:30:25 + For specmode='cube', when velocity or frequency is used it is build 12-Sep-2018 15:30:25 interpreted with the frame defined in outframe. [The parameters of build 12-Sep-2018 15:30:25 the desired output cube can be estimated by using the 'transform' build 12-Sep-2018 15:30:25 functionality of 'plotms'] build 12-Sep-2018 15:30:25 @@ -533,14 +539,14 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 Default:''; data channel width build 12-Sep-2018 15:30:25 The sign of width defines the direction of the channels to be incremented. build 12-Sep-2018 15:30:25 For width specified in velocity or frequency with '-' in front gives image channels in build 12-Sep-2018 15:30:25 - decreasing velocity or frequency, respectively. build 12-Sep-2018 15:30:25 - For specmode='cube', when velocity or frequency is used it is interpreted with build 12-Sep-2018 15:30:25 - the reference frame defined in outframe. build 12-Sep-2018 15:30:25 + decreasing velocity or frequency, respectively. build 12-Sep-2018 15:30:25 + For specmode='cube', when velocity or frequency is used it is interpreted with build 12-Sep-2018 15:30:25 + the reference frame defined in outframe. build 12-Sep-2018 15:30:25 examples: width='2.0km/s'; results in channels with increasing velocity build 12-Sep-2018 15:30:25 width='-2.0km/s'; results in channels with decreasing velocity build 12-Sep-2018 15:30:25 width='40kHz'; results in channels with increasing frequency build 12-Sep-2018 15:30:25 - width=-2; results in channels averaged of 2 data channels incremented from build 12-Sep-2018 15:30:25 - high to low channel numbers build 12-Sep-2018 15:30:25 + width=-2; results in channels averaged of 2 data channels incremented from build 12-Sep-2018 15:30:25 + high to low channel numbers build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -553,9 +559,9 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 example: outframe='bary' for Barycentric frame build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 REST -- Rest frequency build 12-Sep-2018 15:30:25 - LSRD -- Local Standard of Rest (J2000) build 12-Sep-2018 15:30:25 + LSRD -- Local Standard of Rest (J2000) build 12-Sep-2018 15:30:25 -- as the dynamical definition (IAU, [9,12,7] km/s in galactic coordinates) build 12-Sep-2018 15:30:25 - LSRK -- LSR as a kinematical (radio) definition build 12-Sep-2018 15:30:25 + LSRK -- LSR as a kinematical (radio) definition build 12-Sep-2018 15:30:25 -- 20.0 km/s in direction ra,dec = [270,+30] deg (B1900.0) build 12-Sep-2018 15:30:25 BARY -- Barycentric (J2000) build 12-Sep-2018 15:30:25 GEO --- Geocentric build 12-Sep-2018 15:30:25 @@ -574,7 +580,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 Velocity type (radio, z, ratio, beta, gamma, optical) build 12-Sep-2018 15:30:25 For start and/or width specified in velocity, specifies the velocity definition build 12-Sep-2018 15:30:25 Options: 'radio','optical','z','beta','gamma','optical' build 12-Sep-2018 15:30:25 - NOTE: the viewer always defaults to displaying the 'radio' frame, build 12-Sep-2018 15:30:25 + NOTE: the viewer always defaults to displaying the 'radio' frame, build 12-Sep-2018 15:30:25 but that can be changed in the position tracking pull down. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The different types (with F = f/f0, the frequency ratio), are: build 12-Sep-2018 15:30:25 @@ -587,7 +593,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 GAMMA = ((1 + F2)/2F) * build 12-Sep-2018 15:30:25 RELATIVISTIC == BETA (== v/c) build 12-Sep-2018 15:30:25 DEFAULT == RADIO build 12-Sep-2018 15:30:25 - Note that the ones with an '*' have no real interpretation build 12-Sep-2018 15:30:25 + Note that the ones with an '*' have no real interpretation build 12-Sep-2018 15:30:25 (although the calculation will proceed) if given as a velocity. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -626,9 +632,9 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Spectral interpolation (nearest,linear,cubic) build 12-Sep-2018 15:30:25 Spectral interpolation (nearest,linear,cubic) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Interpolation rules to use when binning data channels onto image channels build 12-Sep-2018 15:30:25 - and evaluating visibility values at the centers of image channels. build 12-Sep-2018 15:30:25 + and evaluating visibility values at the centers of image channels. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Note : 'linear' and 'cubic' interpolation requires data points on both sides of build 12-Sep-2018 15:30:25 each image frequency. Errors are therefore possible at edge channels, or near build 12-Sep-2018 15:30:25 @@ -657,31 +663,31 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The following options choose different gridding convolution build 12-Sep-2018 15:30:25 functions for the process of convolutional resampling of the measured build 12-Sep-2018 15:30:25 - visibilities onto a regular uv-grid prior to an inverse FFT. build 12-Sep-2018 15:30:25 + visibilities onto a regular uv-grid prior to an inverse FFT. build 12-Sep-2018 15:30:25 Model prediction (degridding) also uses these same functions. build 12-Sep-2018 15:30:25 - Several wide-field effects can be accounted for via careful choices of build 12-Sep-2018 15:30:25 - convolution functions. Gridding (degridding) runtime will rise in build 12-Sep-2018 15:30:25 + Several wide-field effects can be accounted for via careful choices of build 12-Sep-2018 15:30:25 + convolution functions. Gridding (degridding) runtime will rise in build 12-Sep-2018 15:30:25 proportion to the support size of these convolution functions (in uv-pixels). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - standard : Prolate Spheroid with 3x3 uv pixel support size build 12-Sep-2018 15:30:25 + standard : Prolate Spheroid with 3x3 uv pixel support size build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 [ This mode can also be invoked using 'ft' or 'gridft' ] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 wproject : W-Projection algorithm to correct for the widefield build 12-Sep-2018 15:30:25 non-coplanar baseline effect. [Cornwell et.al 2008] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - wprojplanes is the number of distinct w-values at build 12-Sep-2018 15:30:25 + wprojplanes is the number of distinct w-values at build 12-Sep-2018 15:30:25 which to compute and use different gridding convolution build 12-Sep-2018 15:30:25 - functions (see help for wprojplanes). build 12-Sep-2018 15:30:25 + functions (see help for wprojplanes). build 12-Sep-2018 15:30:25 Convolution function support size can range build 12-Sep-2018 15:30:25 - from 5x5 to few 100 x few 100. build 12-Sep-2018 15:30:25 + from 5x5 to few 100 x few 100. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 [ This mode can also be invoked using 'wprojectft' ] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 widefield : Facetted imaging with or without W-Projection per facet. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 A set of facets x facets subregions of the specified image build 12-Sep-2018 15:30:25 - are gridded separately using their respective phase centers build 12-Sep-2018 15:30:25 + are gridded separately using their respective phase centers build 12-Sep-2018 15:30:25 (to minimize max W). Deconvolution is done on the joint build 12-Sep-2018 15:30:25 full size image, using a PSF from the first subregion. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -702,86 +708,86 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 VLA : PB polynomial fit model (Napier and Rots, 1982) build 12-Sep-2018 15:30:25 EVLA : PB polynomial fit model (Perley, 2015) build 12-Sep-2018 15:30:25 ALMA : Airy disks for a 10.7m dish (for 12m dishes) and build 12-Sep-2018 15:30:25 - 6.25m dish (for 7m dishes) each with 0.75m build 12-Sep-2018 15:30:25 + 6.25m dish (for 7m dishes) each with 0.75m build 12-Sep-2018 15:30:25 blockages (Hunter/Brogan 2011). Joint mosaic build 12-Sep-2018 15:30:25 imaging supports heterogeneous arrays for ALMA. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Typical gridding convolution function support sizes are build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Typical gridding convolution function support sizes are build 12-Sep-2018 15:30:25 between 7 and 50 depending on the desired build 12-Sep-2018 15:30:25 accuracy (given by the uv cell size or image field of view). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 [ This mode can also be invoked using 'mosaicft' or 'ftmosaic' ] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - awproject : A-Projection with azimuthally asymmetric beams and build 12-Sep-2018 15:30:25 + awproject : A-Projection with azimuthally asymmetric beams and build 12-Sep-2018 15:30:25 including beam rotation, squint correction, build 12-Sep-2018 15:30:25 - conjugate frequency beams and W-projection. build 12-Sep-2018 15:30:25 + conjugate frequency beams and W-projection. build 12-Sep-2018 15:30:25 [Bhatnagar et.al, 2008] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Gridding convolution functions are computed from build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Gridding convolution functions are computed from build 12-Sep-2018 15:30:25 aperture illumination models per antenna and optionally build 12-Sep-2018 15:30:25 combined with W-Projection kernels and a prolate spheroid. build 12-Sep-2018 15:30:25 This gridder can be run on single fields as well as mosaics. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - VLA : Uses ray traced model (VLA and EVLA) including feed build 12-Sep-2018 15:30:25 - leg and subreflector shadows, off-axis feed location build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + VLA : Uses ray traced model (VLA and EVLA) including feed build 12-Sep-2018 15:30:25 + leg and subreflector shadows, off-axis feed location build 12-Sep-2018 15:30:25 (for beam squint and other polarization effects), and build 12-Sep-2018 15:30:25 a Gaussian fit for the feed beams (Ref: Brisken 2009) build 12-Sep-2018 15:30:25 ALMA : Similar ray-traced model as above (but the correctness build 12-Sep-2018 15:30:25 of its polarization properties remains un-verified). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Typical gridding convolution function support sizes are build 12-Sep-2018 15:30:25 + Typical gridding convolution function support sizes are build 12-Sep-2018 15:30:25 between 7 and 50 depending on the desired build 12-Sep-2018 15:30:25 - accuracy (given by the uv cell size or image field of view). build 12-Sep-2018 15:30:25 + accuracy (given by the uv cell size or image field of view). build 12-Sep-2018 15:30:25 When combined with W-Projection they can be significantly larger. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 [ This mode can also be invoked using 'awprojectft' ] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 imagemosaic : (untested implementation) build 12-Sep-2018 15:30:25 Grid and iFT each pointing separately and combine the build 12-Sep-2018 15:30:25 - images as a linear mosaic (weighted by a PB model) in build 12-Sep-2018 15:30:25 - the image domain before a joint minor cycle. build 12-Sep-2018 15:30:25 + images as a linear mosaic (weighted by a PB model) in build 12-Sep-2018 15:30:25 + the image domain before a joint minor cycle. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 VLA/ALMA PB models are same as for gridder='mosaicft' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - ------ Notes on PB models : build 12-Sep-2018 15:30:25 + ------ Notes on PB models : build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - (1) Several different sources of PB models are used in the modes build 12-Sep-2018 15:30:25 - listed above. This is partly for reasons of algorithmic flexibility build 12-Sep-2018 15:30:25 - and partly due to the current lack of a common beam model build 12-Sep-2018 15:30:25 + (1) Several different sources of PB models are used in the modes build 12-Sep-2018 15:30:25 + listed above. This is partly for reasons of algorithmic flexibility build 12-Sep-2018 15:30:25 + and partly due to the current lack of a common beam model build 12-Sep-2018 15:30:25 repository or consensus on what beam models are most appropriate. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - (2) For ALMA and gridder='mosaic', ray-traced (TICRA) beams build 12-Sep-2018 15:30:25 - are also available via the vpmanager tool. build 12-Sep-2018 15:30:25 + (2) For ALMA and gridder='mosaic', ray-traced (TICRA) beams build 12-Sep-2018 15:30:25 + are also available via the vpmanager tool. build 12-Sep-2018 15:30:25 For example, call the following before the tclean run. build 12-Sep-2018 15:30:25 - vp.setpbimage(telescope="ALMA", build 12-Sep-2018 15:30:25 - compleximage='/home/casa/data/trunk/alma/responses/ALMA_0_DV__0_0_360_0_45_90_348.5_373_373_GHz_ticra2007_VP.im', build 12-Sep-2018 15:30:25 - antnames=['DV'+'%02d'%k for k in range(25)]) build 12-Sep-2018 15:30:25 + vp.setpbimage(telescope="ALMA", build 12-Sep-2018 15:30:25 + compleximage='/home/casa/data/trunk/alma/responses/ALMA_0_DV__0_0_360_0_45_90_348.5_373_373_GHz_ticra2007_VP.im', build 12-Sep-2018 15:30:25 + antnames=['DV'+'%02d'%k for k in range(25)]) build 12-Sep-2018 15:30:25 vp.saveastable('mypb.tab') build 12-Sep-2018 15:30:25 Then, supply vptable='mypb.tab' to tclean. build 12-Sep-2018 15:30:25 ( Currently this will work only for non-parallel runs ) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - ------ Note on PB masks : build 12-Sep-2018 15:30:25 + ------ Note on PB masks : build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 In tclean, A-Projection gridders (mosaic and awproject) produce a build 12-Sep-2018 15:30:25 .pb image and use the 'pblimit' subparameter to decide normalization build 12-Sep-2018 15:30:25 cutoffs and construct an internal T/F mask in the .pb and .image images. build 12-Sep-2018 15:30:25 - However, this T/F mask cannot directly be used during deconvolution build 12-Sep-2018 15:30:25 + However, this T/F mask cannot directly be used during deconvolution build 12-Sep-2018 15:30:25 (which needs a 1/0 mask). There are two options for making a pb based build 12-Sep-2018 15:30:25 deconvolution mask. build 12-Sep-2018 15:30:25 - -- Run tclean with niter=0 to produce the .pb, construct a 1/0 image build 12-Sep-2018 15:30:25 - with the desired threshold (using ia.open('newmask.im'); build 12-Sep-2018 15:30:25 - ia.calc('iif("xxx.pb">0.3,1.0,0.0)');ia.close() for example), build 12-Sep-2018 15:30:25 - and supply it via the 'mask' parameter in a subsequent run build 12-Sep-2018 15:30:25 + -- Run tclean with niter=0 to produce the .pb, construct a 1/0 image build 12-Sep-2018 15:30:25 + with the desired threshold (using ia.open('newmask.im'); build 12-Sep-2018 15:30:25 + ia.calc('iif("xxx.pb">0.3,1.0,0.0)');ia.close() for example), build 12-Sep-2018 15:30:25 + and supply it via the 'mask' parameter in a subsequent run build 12-Sep-2018 15:30:25 (with calcres=F and calcpsf=F to restart directly from the minor cycle). build 12-Sep-2018 15:30:25 -- Run tclean with usemask='pb' for it to automatically construct build 12-Sep-2018 15:30:25 - a 1/0 mask from the internal T/F mask from .pb at a fixed 0.2 threshold. build 12-Sep-2018 15:30:25 + a 1/0 mask from the internal T/F mask from .pb at a fixed 0.2 threshold. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ----- Making PBs for gridders other than mosaic,awproject build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 After the PSF generation, a PB is constructed using the same build 12-Sep-2018 15:30:25 models used in gridder='mosaic' but just evaluated in the image build 12-Sep-2018 15:30:25 - domain without consideration to weights. build 12-Sep-2018 15:30:25 + domain without consideration to weights. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 standard build 12-Sep-2018 15:30:25 @@ -806,7 +812,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 Number of facets on a side build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 A set of (facets x facets) subregions of the specified image build 12-Sep-2018 15:30:25 - are gridded separately using their respective phase centers build 12-Sep-2018 15:30:25 + are gridded separately using their respective phase centers build 12-Sep-2018 15:30:25 (to minimize max W). Deconvolution is done on the joint build 12-Sep-2018 15:30:25 full size image, using a PSF from the first subregion/facet. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -814,6 +820,19 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 1 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Phase center of the image build 12-Sep-2018 15:30:25 +For mosaic use psf centered of this optional direction build 12-Sep-2018 15:30:25 + example: psfphasecenter=6 build 12-Sep-2018 15:30:25 + psfphasecenter='J2000 19h30m00 -40d00m00' build 12-Sep-2018 15:30:25 + psfphasecenter='J2000 292.5deg -40.0deg' build 12-Sep-2018 15:30:25 + psfphasecenter='J2000 5.105rad -0.698rad' build 12-Sep-2018 15:30:25 + psfphasecenter='ICRS 13:05:27.2780 -049.28.04.458' build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Number of channel chunks build 12-Sep-2018 15:30:25 Number of channel chunks to grid separately build 12-Sep-2018 15:30:25 @@ -822,13 +841,13 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 as they loop over all available image planes for each row of data build 12-Sep-2018 15:30:25 accessed. To prevent this problem, we can grid subsets of channels build 12-Sep-2018 15:30:25 in sequence so that at any given time only part of the image cube build 12-Sep-2018 15:30:25 - needs to be loaded into memory. This parameter controls the build 12-Sep-2018 15:30:25 - number of chunks to split the cube into. build 12-Sep-2018 15:30:25 + needs to be loaded into memory. This parameter controls the build 12-Sep-2018 15:30:25 + number of chunks to split the cube into. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Example : chanchunks = 4 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 [ This feature is experimental and may have restrictions on how build 12-Sep-2018 15:30:25 - chanchunks is to be chosen. For now, please pick chanchunks so build 12-Sep-2018 15:30:25 + chanchunks is to be chosen. For now, please pick chanchunks so build 12-Sep-2018 15:30:25 that nchan/chanchunks is an integer. ] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -840,22 +859,22 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 Number of distinct w-values at which to compute and use different build 12-Sep-2018 15:30:25 gridding convolution functions for W-Projection build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - An appropriate value of wprojplanes depends on the presence/absence build 12-Sep-2018 15:30:25 - of a bright source far from the phase center, the desired dynamic build 12-Sep-2018 15:30:25 - range of an image in the presence of a bright far out source, build 12-Sep-2018 15:30:25 + An appropriate value of wprojplanes depends on the presence/absence build 12-Sep-2018 15:30:25 + of a bright source far from the phase center, the desired dynamic build 12-Sep-2018 15:30:25 + range of an image in the presence of a bright far out source, build 12-Sep-2018 15:30:25 the maximum w-value in the measurements, and the desired trade off build 12-Sep-2018 15:30:25 between accuracy and computing cost. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 As a (rough) guide, VLA L-Band D-config may require a build 12-Sep-2018 15:30:25 - value of 128 for a source 30arcmin away from the phase build 12-Sep-2018 15:30:25 + value of 128 for a source 30arcmin away from the phase build 12-Sep-2018 15:30:25 center. A-config may require 1024 or more. To converge to an build 12-Sep-2018 15:30:25 appropriate value, try starting with 128 and then increasing build 12-Sep-2018 15:30:25 it if artifacts persist. W-term artifacts (for the VLA) typically look build 12-Sep-2018 15:30:25 - like arc-shaped smears in a synthesis image or a shift in source build 12-Sep-2018 15:30:25 + like arc-shaped smears in a synthesis image or a shift in source build 12-Sep-2018 15:30:25 position between images made at different times. These artifacts build 12-Sep-2018 15:30:25 are more pronounced the further the source is from the phase center. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - There is no harm in simply always choosing a large value (say, 1024) build 12-Sep-2018 15:30:25 + There is no harm in simply always choosing a large value (say, 1024) build 12-Sep-2018 15:30:25 but there will be a significant performance cost to doing so, especially build 12-Sep-2018 15:30:25 for gridder='awproject' where it is combined with A-Projection. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -875,23 +894,23 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 EVLA : old VLA models. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Other primary beam models can be chosen via the vpmanager tool. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Step 1 : Set up the vpmanager tool and save its state in a table build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - vp.setpbpoly(telescope='EVLA', coeff=[1.0, -1.529e-3, 8.69e-7, -1.88e-10]) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + vp.setpbpoly(telescope='EVLA', coeff=[1.0, -1.529e-3, 8.69e-7, -1.88e-10]) build 12-Sep-2018 15:30:25 vp.saveastable('myvp.tab') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Step 2 : Supply the name of that table in tclean. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 tclean(....., vptable='myvp.tab',....) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Please see the documentation for the vpmanager for more details on how to build 12-Sep-2018 15:30:25 + Please see the documentation for the vpmanager for more details on how to build 12-Sep-2018 15:30:25 choose different beam models. Work is in progress to update the defaults build 12-Sep-2018 15:30:25 for EVLA and ALMA. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Note : AWProjection currently does not use this mechanism to choose build 12-Sep-2018 15:30:25 beam models. It instead uses ray-traced beams computed from build 12-Sep-2018 15:30:25 - parameterized aperture illumination functions, which are not build 12-Sep-2018 15:30:25 + parameterized aperture illumination functions, which are not build 12-Sep-2018 15:30:25 available via the vpmanager. So, gridder='awproject' does not allow build 12-Sep-2018 15:30:25 the user to set this parameter. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -928,22 +947,22 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Use conjugate frequency for wideband A-terms build 12-Sep-2018 15:30:25 -Use conjugate frequency for wideband A-terms build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - While gridding data from one frequency channel, choose a build 12-Sep-2018 15:30:25 +Use conjugate frequency for wideband A-terms build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + While gridding data from one frequency channel, choose a build 12-Sep-2018 15:30:25 convolution function from a 'conjugate' frequency such that build 12-Sep-2018 15:30:25 the resulting baseline primary beam is approximately constant build 12-Sep-2018 15:30:25 across frequency. For a system in which the primary beam scales build 12-Sep-2018 15:30:25 with frequency, this step will eliminate instrumental spectral build 12-Sep-2018 15:30:25 structure from the measured data and leave only the sky spectrum build 12-Sep-2018 15:30:25 for the minor cycle to model and reconstruct [Bhatnagar et.al,2013]. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 As a rough guideline for when this is relevant, a source at the half build 12-Sep-2018 15:30:25 - power point of the PB at the center frequency will see an artificial build 12-Sep-2018 15:30:25 + power point of the PB at the center frequency will see an artificial build 12-Sep-2018 15:30:25 spectral index of -1.4 due to the frequency dependence of the PB build 12-Sep-2018 15:30:25 [Sault and Wieringa, 1994]. If left uncorrected during gridding, this build 12-Sep-2018 15:30:25 spectral structure must be modeled in the minor cycle (using the build 12-Sep-2018 15:30:25 - mtmfs algorithm) to avoid dynamic range limits (of a few hundred build 12-Sep-2018 15:30:25 + mtmfs algorithm) to avoid dynamic range limits (of a few hundred build 12-Sep-2018 15:30:25 for a 2:1 bandwidth). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -957,9 +976,9 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 Name of a directory in which to store gridding convolution functions. build 12-Sep-2018 15:30:25 This cache is filled at the beginning of an imaging run. This step can be time build 12-Sep-2018 15:30:25 consuming but the cache can be reused across multiple imaging runs that build 12-Sep-2018 15:30:25 - use the same image parameters (cell size, field-of-view, spectral data build 12-Sep-2018 15:30:25 + use the same image parameters (cell size, field-of-view, spectral data build 12-Sep-2018 15:30:25 selections, etc). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 By default, cfcache = imagename + '.cf' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -968,8 +987,8 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 At what parallactic angle interval to recompute AIFs (deg) build 12-Sep-2018 15:30:25 -At what parallactic angle interval to recompute aperture build 12-Sep-2018 15:30:25 - illumination functions (deg) build 12-Sep-2018 15:30:25 +At what parallactic angle interval to recompute aperture build 12-Sep-2018 15:30:25 + illumination functions (deg) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 This parameter controls the accuracy of the aperture illumination function build 12-Sep-2018 15:30:25 used with AProjection for alt-az mount dishes where the AIF rotates on the build 12-Sep-2018 15:30:25 @@ -981,10 +1000,10 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 At what parallactic angle interval to rotate nearest AIF (deg) build 12-Sep-2018 15:30:25 -At what parallactic angle interval to rotate nearest build 12-Sep-2018 15:30:25 - aperture illumination function (deg) build 12-Sep-2018 15:30:25 +At what parallactic angle interval to rotate nearest build 12-Sep-2018 15:30:25 + aperture illumination function (deg) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Instead of recomputing the AIF for every timestep's parallactic angle, build 12-Sep-2018 15:30:25 + Instead of recomputing the AIF for every timestep's parallactic angle, build 12-Sep-2018 15:30:25 the nearest existing AIF is picked and rotated in steps of this amount. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 For example, computepastep=360.0 and rotatepastep=5.0 will compute build 12-Sep-2018 15:30:25 @@ -1004,13 +1023,13 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 Additionally, by default, an internal T/F mask is applied to the .pb, .image and build 12-Sep-2018 15:30:25 .residual images to mask out (T) all invalid pixels outside the pblimit area. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Note : This internal T/F mask cannot be used as a deconvolution mask. build 12-Sep-2018 15:30:25 + Note : This internal T/F mask cannot be used as a deconvolution mask. build 12-Sep-2018 15:30:25 To do so, please follow the steps listed above in the Notes for the build 12-Sep-2018 15:30:25 'gridder' parameter. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Note : To prevent the internal T/F mask from appearing in anything other build 12-Sep-2018 15:30:25 than the .pb and .image.pbcor images, 'pblimit' can be set to a build 12-Sep-2018 15:30:25 - negative number. The absolute value will still be used as a valid 'pblimit'. build 12-Sep-2018 15:30:25 + negative number. The absolute value will still be used as a valid 'pblimit'. build 12-Sep-2018 15:30:25 A tclean restart using existing output images on disk that already build 12-Sep-2018 15:30:25 have this T/F mask in the .residual and .image but only pblimit set build 12-Sep-2018 15:30:25 to a negative value, will remove this mask after the next major cycle. build 12-Sep-2018 15:30:25 @@ -1021,10 +1040,10 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Normalization type (flatnoise, flatsky,pbsquare) build 12-Sep-2018 15:30:25 -Normalization type (flatnoise, flatsky, pbsquare) build 12-Sep-2018 15:30:25 +Normalization type (flatnoise, flatsky, pbsquare) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Gridded (and FT'd) images represent the PB-weighted sky image. build 12-Sep-2018 15:30:25 - Qualitatively it can be approximated as two instances of the PB build 12-Sep-2018 15:30:25 + Qualitatively it can be approximated as two instances of the PB build 12-Sep-2018 15:30:25 applied to the sky image (one naturally present in the data build 12-Sep-2018 15:30:25 and one introduced during gridding via the convolution functions). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1033,17 +1052,17 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 normtype='flatnoise' : Divide the raw image by sqrt(.weight) so that build 12-Sep-2018 15:30:25 the input to the minor cycle represents the build 12-Sep-2018 15:30:25 - product of the sky and PB. The noise is 'flat' build 12-Sep-2018 15:30:25 + product of the sky and PB. The noise is 'flat' build 12-Sep-2018 15:30:25 across the region covered by each PB. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 normtype='flatsky' : Divide the raw image by .weight so that the input build 12-Sep-2018 15:30:25 - to the minor cycle represents only the sky. build 12-Sep-2018 15:30:25 - The noise is higher in the outer regions of the build 12-Sep-2018 15:30:25 + to the minor cycle represents only the sky. build 12-Sep-2018 15:30:25 + The noise is higher in the outer regions of the build 12-Sep-2018 15:30:25 primary beam where the sensitivity is low. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - normtype='pbsquare' : No normalization after gridding and FFT. build 12-Sep-2018 15:30:25 + normtype='pbsquare' : No normalization after gridding and FFT. build 12-Sep-2018 15:30:25 The minor cycle sees the sky times pb square build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 flatnoise build 12-Sep-2018 15:30:25 @@ -1058,10 +1077,10 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Minor cycle algorithm (hogbom,clark,multiscale,mtmfs,mem,clarkstokes) build 12-Sep-2018 15:30:25 Name of minor cycle algorithm (hogbom,clark,multiscale,mtmfs,mem,clarkstokes) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Each of the following algorithms operate on residual images and psfs build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Each of the following algorithms operate on residual images and psfs build 12-Sep-2018 15:30:25 from the gridder and produce output model and restored images. build 12-Sep-2018 15:30:25 - Minor cycles stop and a major cycle is triggered when cyclethreshold build 12-Sep-2018 15:30:25 + Minor cycles stop and a major cycle is triggered when cyclethreshold build 12-Sep-2018 15:30:25 or cycleniter are reached. For all methods, components are picked from build 12-Sep-2018 15:30:25 the entire extent of the image or (if specified) within a mask. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1073,7 +1092,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 - Repeat build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 clark : An adapted version of Clark Clean [Clark, 1980] build 12-Sep-2018 15:30:25 - - Find the location of max(I^2+Q^2+U^2+V^2) build 12-Sep-2018 15:30:25 + - Find the location of max(I^2+Q^2+U^2+V^2) build 12-Sep-2018 15:30:25 - Add delta functions to each stokes plane of the model image build 12-Sep-2018 15:30:25 - Subtract a scaled and shifted PSF within a small patch size build 12-Sep-2018 15:30:25 from regions of the residual image where the two overlap. build 12-Sep-2018 15:30:25 @@ -1082,7 +1101,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 - Repeat build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ( Note : 'clark' maps to imagermode='' in the old clean task. build 12-Sep-2018 15:30:25 - 'clark_exp' is another implementation that maps to build 12-Sep-2018 15:30:25 + 'clark_exp' is another implementation that maps to build 12-Sep-2018 15:30:25 imagermode='mosaic' or 'csclean' in the old clean task build 12-Sep-2018 15:30:25 but the behavior is not identical. For now, please build 12-Sep-2018 15:30:25 use deconvolver='hogbom' if you encounter problems. ) build 12-Sep-2018 15:30:25 @@ -1104,9 +1123,9 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 - Solve a NTxNT system of equations per scale size to compute build 12-Sep-2018 15:30:25 Taylor coefficients for components at all locations build 12-Sep-2018 15:30:25 - Compute gradient chi-square and pick the Taylor coefficients build 12-Sep-2018 15:30:25 - and scale size at the location with maximum reduction in build 12-Sep-2018 15:30:25 + and scale size at the location with maximum reduction in build 12-Sep-2018 15:30:25 chi-square build 12-Sep-2018 15:30:25 - - Add multi-scale components to each Taylor-coefficient build 12-Sep-2018 15:30:25 + - Add multi-scale components to each Taylor-coefficient build 12-Sep-2018 15:30:25 model image build 12-Sep-2018 15:30:25 - Subtract scaled,smoothed,shifted PSF (within a small patch size build 12-Sep-2018 15:30:25 per scale) from all smoothed Taylor residual images build 12-Sep-2018 15:30:25 @@ -1116,10 +1135,10 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 mem : Maximum Entropy Method [Cornwell and Evans, 1985] build 12-Sep-2018 15:30:25 - Iteratively solve for values at all individual pixels via the build 12-Sep-2018 15:30:25 MEM method. It minimizes an objective function of build 12-Sep-2018 15:30:25 - chi-square plus entropy (here, a measure of difference build 12-Sep-2018 15:30:25 + chi-square plus entropy (here, a measure of difference build 12-Sep-2018 15:30:25 between the current model and a flat prior model). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - (Note : This MEM implementation is not very robust. build 12-Sep-2018 15:30:25 + (Note : This MEM implementation is not very robust. build 12-Sep-2018 15:30:25 Improvements will be made in the future.) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1142,20 +1161,20 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 List of scale sizes (in pixels) for multi-scale algorithms build 12-Sep-2018 15:30:25 List of scale sizes (in pixels) for multi-scale and mtmfs algorithms. build 12-Sep-2018 15:30:25 - --> scales=[0,6,20] build 12-Sep-2018 15:30:25 - This set of scale sizes should represent the sizes build 12-Sep-2018 15:30:25 - (diameters in units of number of pixels) build 12-Sep-2018 15:30:25 + --> scales=[0,6,20] build 12-Sep-2018 15:30:25 + This set of scale sizes should represent the sizes build 12-Sep-2018 15:30:25 + (diameters in units of number of pixels) build 12-Sep-2018 15:30:25 of dominant features in the image being reconstructed. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 The smallest scale size is recommended to be 0 (point source), build 12-Sep-2018 15:30:25 the second the size of the synthesized beam and the third 3-5 build 12-Sep-2018 15:30:25 - times the synthesized beam, etc. For example, if the synthesized build 12-Sep-2018 15:30:25 + times the synthesized beam, etc. For example, if the synthesized build 12-Sep-2018 15:30:25 beam is 10" FWHM and cell=2",try scales = [0,5,15]. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 For numerical stability, the largest scale must be build 12-Sep-2018 15:30:25 smaller than the image (or mask) size and smaller than or build 12-Sep-2018 15:30:25 - comparable to the scale corresponding to the lowest measured build 12-Sep-2018 15:30:25 - spatial frequency (as a scale size much larger than what the build 12-Sep-2018 15:30:25 + comparable to the scale corresponding to the lowest measured build 12-Sep-2018 15:30:25 + spatial frequency (as a scale size much larger than what the build 12-Sep-2018 15:30:25 instrument is sensitive to is unconstrained by the data making build 12-Sep-2018 15:30:25 it harder to recovery from errors during the minor cycle). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1171,38 +1190,38 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 - nterms=2 : Spectrum is a straight line with a slope build 12-Sep-2018 15:30:25 - nterms=N : A polynomial of order N-1 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - From a Taylor expansion of the expression of a power law, the build 12-Sep-2018 15:30:25 + From a Taylor expansion of the expression of a power law, the build 12-Sep-2018 15:30:25 spectral index is derived as alpha = taylorcoeff_1 / taylorcoeff_0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Spectral curvature is similarly derived when possible. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - The optimal number of Taylor terms depends on the available build 12-Sep-2018 15:30:25 - signal to noise ratio, bandwidth ratio, and spectral shape of the build 12-Sep-2018 15:30:25 + The optimal number of Taylor terms depends on the available build 12-Sep-2018 15:30:25 + signal to noise ratio, bandwidth ratio, and spectral shape of the build 12-Sep-2018 15:30:25 source as seen by the telescope (sky spectrum x PB spectrum). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - nterms=2 is a good starting point for wideband EVLA imaging build 12-Sep-2018 15:30:25 + nterms=2 is a good starting point for wideband EVLA imaging build 12-Sep-2018 15:30:25 and the lower frequency bands of ALMA (when fractional bandwidth build 12-Sep-2018 15:30:25 - is greater than 10%) and if there is at least one bright source for build 12-Sep-2018 15:30:25 + is greater than 10%) and if there is at least one bright source for build 12-Sep-2018 15:30:25 which a dynamic range of greater than few 100 is desired. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Spectral artifacts for the VLA often look like spokes radiating out from build 12-Sep-2018 15:30:25 a bright source (i.e. in the image made with standard mfs imaging). build 12-Sep-2018 15:30:25 If increasing the number of terms does not eliminate these artifacts, build 12-Sep-2018 15:30:25 - check the data for inadequate bandpass calibration. If the source is away build 12-Sep-2018 15:30:25 + check the data for inadequate bandpass calibration. If the source is away build 12-Sep-2018 15:30:25 from the pointing center, consider including wide-field corrections too. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 (Note : In addition to output Taylor coefficient images .tt0,.tt1,etc build 12-Sep-2018 15:30:25 - images of spectral index (.alpha), an estimate of error on build 12-Sep-2018 15:30:25 + images of spectral index (.alpha), an estimate of error on build 12-Sep-2018 15:30:25 spectral index (.alpha.error) and spectral curvature (.beta, build 12-Sep-2018 15:30:25 - if nterms is greater than 2) are produced. build 12-Sep-2018 15:30:25 - - These alpha, alpha.error and beta images contain build 12-Sep-2018 15:30:25 - internal T/F masks based on a threshold computed build 12-Sep-2018 15:30:25 - as peakresidual/10. Additional masking based on build 12-Sep-2018 15:30:25 + if nterms is greater than 2) are produced. build 12-Sep-2018 15:30:25 + - These alpha, alpha.error and beta images contain build 12-Sep-2018 15:30:25 + internal T/F masks based on a threshold computed build 12-Sep-2018 15:30:25 + as peakresidual/10. Additional masking based on build 12-Sep-2018 15:30:25 .alpha/.alpha.error may be desirable. build 12-Sep-2018 15:30:25 - - .alpha.error is a purely empirical estimate derived build 12-Sep-2018 15:30:25 + - .alpha.error is a purely empirical estimate derived build 12-Sep-2018 15:30:25 from the propagation of error during the division of build 12-Sep-2018 15:30:25 two noisy numbers (alpha = xx.tt1/xx.tt0) where the build 12-Sep-2018 15:30:25 - 'error' on tt1 and tt0 are simply the values picked from build 12-Sep-2018 15:30:25 + 'error' on tt1 and tt0 are simply the values picked from build 12-Sep-2018 15:30:25 the corresponding residual images. The absolute value build 12-Sep-2018 15:30:25 of the error is not always accurate and it is best to interpret build 12-Sep-2018 15:30:25 the errors across the image only in a relative sense.) build 12-Sep-2018 15:30:25 @@ -1216,7 +1235,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 A bias towards smaller scale sizes build 12-Sep-2018 15:30:25 A numerical control to bias the solution towards smaller scales. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - The peak from each scale's smoothed residual is build 12-Sep-2018 15:30:25 + The peak from each scale's smoothed residual is build 12-Sep-2018 15:30:25 multiplied by ( 1 - smallscalebias * scale/maxscale ) build 12-Sep-2018 15:30:25 to increase or decrease the amplitude relative to other scales, build 12-Sep-2018 15:30:25 before the scale with the largest peak is chosen. build 12-Sep-2018 15:30:25 @@ -1236,15 +1255,15 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Do restoration steps (or not) build 12-Sep-2018 15:30:25 Restore the model image. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Construct a restored image : imagename.image by convolving the model build 12-Sep-2018 15:30:25 - image with a clean beam and adding the residual image to the result. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Construct a restored image : imagename.image by convolving the model build 12-Sep-2018 15:30:25 + image with a clean beam and adding the residual image to the result. build 12-Sep-2018 15:30:25 If a restoringbeam is specified, the residual image is also build 12-Sep-2018 15:30:25 smoothed to that target resolution before adding it in. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 If a .model does not exist, it will make an empty one and create build 12-Sep-2018 15:30:25 the restored image from the residuals ( with additional smoothing if needed ). build 12-Sep-2018 15:30:25 - With algorithm='mtmfs', this will construct Taylor coefficient maps from build 12-Sep-2018 15:30:25 + With algorithm='mtmfs', this will construct Taylor coefficient maps from build 12-Sep-2018 15:30:25 the residuals and compute .alpha and .alpha.error. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1255,10 +1274,10 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Restoring beam shape to use. Default is the PSF main lobe build 12-Sep-2018 15:30:25 Restoring beam shape/size to use. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 - restoringbeam='' or [''] build 12-Sep-2018 15:30:25 - A Gaussian fitted to the PSF main lobe (separately per image plane). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + A Gaussian fitted to the PSF main lobe (separately per image plane). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 - restoringbeam='10.0arcsec' build 12-Sep-2018 15:30:25 Use a circular Gaussian of this width for all planes build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1267,7 +1286,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - restoringbeam='common' build 12-Sep-2018 15:30:25 Automatically estimate a common beam shape/size appropriate for build 12-Sep-2018 15:30:25 - all planes. build 12-Sep-2018 15:30:25 + all planes. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Note : For any restoring beam different from the native resolution build 12-Sep-2018 15:30:25 the model image is convolved with the beam and added to build 12-Sep-2018 15:30:25 @@ -1283,20 +1302,20 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 Apply PB correction on the output restored image build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 A new image with extension .image.pbcor will be created from build 12-Sep-2018 15:30:25 - the evaluation of .image / .pb for all pixels above the specified pblimit. build 12-Sep-2018 15:30:25 + the evaluation of .image / .pb for all pixels above the specified pblimit. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Note : Stand-alone PB-correction can be triggered by re-running build 12-Sep-2018 15:30:25 - tclean with the appropriate imagename and with build 12-Sep-2018 15:30:25 + Note : Stand-alone PB-correction can be triggered by re-running build 12-Sep-2018 15:30:25 + tclean with the appropriate imagename and with build 12-Sep-2018 15:30:25 niter=0, calcpsf=False, calcres=False, pbcor=True, vptable='vp.tab' build 12-Sep-2018 15:30:25 - ( where vp.tab is the name of the vpmanager file. build 12-Sep-2018 15:30:25 + ( where vp.tab is the name of the vpmanager file. build 12-Sep-2018 15:30:25 See the inline help for the 'vptable' parameter ) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Note : Multi-term PB correction that includes a correction for the build 12-Sep-2018 15:30:25 - spectral index of the PB has not been enabled for the 4.7 release. build 12-Sep-2018 15:30:25 - Please use the widebandpbcor task instead. build 12-Sep-2018 15:30:25 + spectral index of the PB has not been enabled for the 4.7 release. build 12-Sep-2018 15:30:25 + Please use the widebandpbcor task instead. build 12-Sep-2018 15:30:25 ( Wideband PB corrections are required when the amplitude of the build 12-Sep-2018 15:30:25 - brightest source is known accurately enough to be sensitive build 12-Sep-2018 15:30:25 - to the difference in the PB gain between the upper and lower build 12-Sep-2018 15:30:25 + brightest source is known accurately enough to be sensitive build 12-Sep-2018 15:30:25 + to the difference in the PB gain between the upper and lower build 12-Sep-2018 15:30:25 end of the band at its location. As a guideline, the artificial spectral build 12-Sep-2018 15:30:25 index due to the PB is -1.4 at the 0.5 gain level and less than -0.2 build 12-Sep-2018 15:30:25 at the 0.9 gain level at the middle frequency ) build 12-Sep-2018 15:30:25 @@ -1320,12 +1339,12 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 Name of outlier-field image definitions build 12-Sep-2018 15:30:25 Name of outlier-field image definitions build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - A text file containing sets of parameter=value pairs, build 12-Sep-2018 15:30:25 - one set per outlier field. build 12-Sep-2018 15:30:25 + A text file containing sets of parameter=value pairs, build 12-Sep-2018 15:30:25 + one set per outlier field. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Example : outlierfile='outs.txt' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Contents of outs.txt : build 12-Sep-2018 15:30:25 + Contents of outs.txt : build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 imagename=tst1 build 12-Sep-2018 15:30:25 nchan=1 build 12-Sep-2018 15:30:25 @@ -1344,27 +1363,27 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 The following parameters are currently allowed to be different between build 12-Sep-2018 15:30:25 the main field and the outlier fields (i.e. they will be recognized if found build 12-Sep-2018 15:30:25 in the outlier text file). If a parameter is not listed, the value is picked from build 12-Sep-2018 15:30:25 - what is defined in the main task input. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + what is defined in the main task input. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 imagename, imsize, cell, phasecenter, startmodel, mask build 12-Sep-2018 15:30:25 - specmode, nchan, start, width, nterms, reffreq, build 12-Sep-2018 15:30:25 + specmode, nchan, start, width, nterms, reffreq, build 12-Sep-2018 15:30:25 gridder, deconvolver, wprojplanes build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Note : 'specmode' is an option, so combinations of mfs and cube build 12-Sep-2018 15:30:25 for different image fields, for example, are supported. build 12-Sep-2018 15:30:25 'deconvolver' and 'gridder' are also options that allow different build 12-Sep-2018 15:30:25 - imaging or deconvolution algorithm per image field. build 12-Sep-2018 15:30:25 + imaging or deconvolution algorithm per image field. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 For example, multiscale with wprojection and 16 w-term planes build 12-Sep-2018 15:30:25 on the main field and mtmfs with nterms=3 and wprojection build 12-Sep-2018 15:30:25 with 64 planes on a bright outlier source for which the frequency build 12-Sep-2018 15:30:25 dependence of the primary beam produces a strong effect that build 12-Sep-2018 15:30:25 - must be modeled. The traditional alternative to this approach is build 12-Sep-2018 15:30:25 + must be modeled. The traditional alternative to this approach is build 12-Sep-2018 15:30:25 to first image the outlier, subtract it out of the data (uvsub) and build 12-Sep-2018 15:30:25 then image the main field. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Note : If you encounter a use-case where some other parameter needs build 12-Sep-2018 15:30:25 - to be allowed in the outlier file (and it is logical to do so), please build 12-Sep-2018 15:30:25 + to be allowed in the outlier file (and it is logical to do so), please build 12-Sep-2018 15:30:25 send us feedback. The above is an initial list. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1380,30 +1399,30 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 Weighting scheme (natural,uniform,briggs) build 12-Sep-2018 15:30:25 Weighting scheme (natural,uniform,briggs,superuniform,radial) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - During gridding of the dirty or residual image, each visibility value is build 12-Sep-2018 15:30:25 - multiplied by a weight before it is accumulated on the uv-grid. build 12-Sep-2018 15:30:25 + During gridding of the dirty or residual image, each visibility value is build 12-Sep-2018 15:30:25 + multiplied by a weight before it is accumulated on the uv-grid. build 12-Sep-2018 15:30:25 The PSF's uv-grid is generated by gridding only the weights (weightgrid). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - weighting='natural' : Gridding weights are identical to the data weights build 12-Sep-2018 15:30:25 - from the MS. For visibilities with similar data weights, build 12-Sep-2018 15:30:25 - the weightgrid will follow the sample density build 12-Sep-2018 15:30:25 - pattern on the uv-plane. This weighting scheme build 12-Sep-2018 15:30:25 - provides the maximum imaging sensitivity at the build 12-Sep-2018 15:30:25 + weighting='natural' : Gridding weights are identical to the data weights build 12-Sep-2018 15:30:25 + from the MS. For visibilities with similar data weights, build 12-Sep-2018 15:30:25 + the weightgrid will follow the sample density build 12-Sep-2018 15:30:25 + pattern on the uv-plane. This weighting scheme build 12-Sep-2018 15:30:25 + provides the maximum imaging sensitivity at the build 12-Sep-2018 15:30:25 expense of a possibly fat PSF with high sidelobes. build 12-Sep-2018 15:30:25 It is most appropriate for detection experiments build 12-Sep-2018 15:30:25 where sensitivity is most important. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 weighting='uniform' : Gridding weights per visibility data point are the build 12-Sep-2018 15:30:25 - original data weights divided by the total weight of build 12-Sep-2018 15:30:25 - all data points that map to the same uv grid cell : build 12-Sep-2018 15:30:25 + original data weights divided by the total weight of build 12-Sep-2018 15:30:25 + all data points that map to the same uv grid cell : build 12-Sep-2018 15:30:25 ' data_weight / total_wt_per_cell '. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The weightgrid is as close to flat as possible resulting build 12-Sep-2018 15:30:25 in a PSF with a narrow main lobe and suppressed build 12-Sep-2018 15:30:25 sidelobes. However, since heavily sampled areas of build 12-Sep-2018 15:30:25 - the uv-plane get down-weighted, the imaging build 12-Sep-2018 15:30:25 + the uv-plane get down-weighted, the imaging build 12-Sep-2018 15:30:25 sensitivity is not as high as with natural weighting. build 12-Sep-2018 15:30:25 - It is most appropriate for imaging experiments where build 12-Sep-2018 15:30:25 + It is most appropriate for imaging experiments where build 12-Sep-2018 15:30:25 a well behaved PSF can help the reconstruction. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 weighting='briggs' : Gridding weights per visibility data point are given by build 12-Sep-2018 15:30:25 @@ -1415,13 +1434,13 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 (robust=0.5 is equivalent to robust=0.0 in AIPS IMAGR.) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Robust/Briggs weighting generates a PSF that can build 12-Sep-2018 15:30:25 - vary smoothly between 'natural' and 'uniform' and build 12-Sep-2018 15:30:25 + vary smoothly between 'natural' and 'uniform' and build 12-Sep-2018 15:30:25 allow customized trade-offs between PSF shape and build 12-Sep-2018 15:30:25 imaging sensitivity. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 weighting='superuniform' : This is similar to uniform weighting except that build 12-Sep-2018 15:30:25 - the total_wt_per_cell is replaced by the build 12-Sep-2018 15:30:25 - total_wt_within_NxN_cells around the uv cell of build 12-Sep-2018 15:30:25 + the total_wt_per_cell is replaced by the build 12-Sep-2018 15:30:25 + total_wt_within_NxN_cells around the uv cell of build 12-Sep-2018 15:30:25 interest. ( N = subparameter 'npixels' ) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 This method tends to give a PSF with inner build 12-Sep-2018 15:30:25 @@ -1431,9 +1450,9 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 closer to natural weighting. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 weighting='radial' : Gridding weights are given by ' data_weight * uvdistance ' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - This method approximately minimizes rms sidelobes build 12-Sep-2018 15:30:25 - for an east-west synthesis array. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + This method approximately minimizes rms sidelobes build 12-Sep-2018 15:30:25 + for an east-west synthesis array. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 For more details on weighting please see Chapter3 build 12-Sep-2018 15:30:25 of Dan Briggs' thesis (http://www.aoc.nrao.edu/dissertations/dbriggs) build 12-Sep-2018 15:30:25 @@ -1453,7 +1472,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Robustness parameter build 12-Sep-2018 15:30:25 Robustness parameter for Briggs weighting. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 robust = -2.0 maps to uniform weighting. build 12-Sep-2018 15:30:25 robust = +2.0 maps to natural weighting. build 12-Sep-2018 15:30:25 (robust=0.5 is equivalent to robust=0.0 in AIPS IMAGR.) build 12-Sep-2018 15:30:25 @@ -1476,12 +1495,12 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 around a point is used to calculate weight density. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 npixels=2 goes from -1 to +1 and covers 3 pixels on a side. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 npixels=0 implies a single pixel, which does not make sense for build 12-Sep-2018 15:30:25 superuniform weighting. Therefore, if npixels=0 it will build 12-Sep-2018 15:30:25 be forced to 6 (or a box of -3pixels to +3pixels) to cover build 12-Sep-2018 15:30:25 7 pixels on a side. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 0 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1498,9 +1517,9 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 uv-taper on outer baselines in uv-plane build 12-Sep-2018 15:30:25 uv-taper on outer baselines in uv-plane build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Apply a Gaussian taper in addition to the weighting scheme specified build 12-Sep-2018 15:30:25 + Apply a Gaussian taper in addition to the weighting scheme specified build 12-Sep-2018 15:30:25 via the 'weighting' parameter. Higher spatial frequencies are weighted build 12-Sep-2018 15:30:25 - down relative to lower spatial frequencies to suppress artifacts build 12-Sep-2018 15:30:25 + down relative to lower spatial frequencies to suppress artifacts build 12-Sep-2018 15:30:25 arising from poorly sampled areas of the uv-plane. It is equivalent to build 12-Sep-2018 15:30:25 smoothing the PSF obtained by other weighting schemes and can be build 12-Sep-2018 15:30:25 specified either as a Gaussian in uv-space (eg. units of lambda) build 12-Sep-2018 15:30:25 @@ -1510,11 +1529,11 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 NOTE: the on-sky FWHM in arcsec is roughly the uv taper/200 (klambda). build 12-Sep-2018 15:30:25 default: uvtaper=[]; no Gaussian taper applied build 12-Sep-2018 15:30:25 - example: uvtaper=['5klambda'] circular taper build 12-Sep-2018 15:30:25 + example: uvtaper=['5klambda'] circular taper build 12-Sep-2018 15:30:25 FWHM=5 kilo-lambda build 12-Sep-2018 15:30:25 uvtaper=['5klambda','3klambda','45.0deg'] build 12-Sep-2018 15:30:25 uvtaper=['10arcsec'] on-sky FWHM 10 arcseconds build 12-Sep-2018 15:30:25 - uvtaper=['300.0'] default units are lambda build 12-Sep-2018 15:30:25 + uvtaper=['300.0'] default units are lambda build 12-Sep-2018 15:30:25 in aperture plane build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1541,10 +1560,10 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 Maximum number of iterations build 12-Sep-2018 15:30:25 Maximum number of iterations build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - A stopping criterion based on total iteration count. build 12-Sep-2018 15:30:25 + A stopping criterion based on total iteration count. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Iterations are typically defined as the selecting one flux component build 12-Sep-2018 15:30:25 - and partially subtracting it out from the residual image. build 12-Sep-2018 15:30:25 + Iterations are typically defined as the selecting one flux component build 12-Sep-2018 15:30:25 + and partially subtracting it out from the residual image. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 niter=0 : Do only the initial major cycle (make dirty image, psf, pb, etc) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1561,23 +1580,23 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 'cyclethreshold' : Automatically computed threshold related to the build 12-Sep-2018 15:30:25 max sidelobe level of the PSF and peak residual. build 12-Sep-2018 15:30:25 Divergence, detected as an increase of 10% in peak residual from the build 12-Sep-2018 15:30:25 - minimum so far (during minor cycle iterations) build 12-Sep-2018 15:30:25 + minimum so far (during minor cycle iterations) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The first criterion to be satisfied takes precedence. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Note : Iteration counts for cubes or multi-field images : build 12-Sep-2018 15:30:25 - For images with multiple planes (or image fields) on which the build 12-Sep-2018 15:30:25 - deconvolver operates in sequence, iterations are counted across build 12-Sep-2018 15:30:25 - all planes (or image fields). The iteration count is compared with build 12-Sep-2018 15:30:25 + For images with multiple planes (or image fields) on which the build 12-Sep-2018 15:30:25 + deconvolver operates in sequence, iterations are counted across build 12-Sep-2018 15:30:25 + all planes (or image fields). The iteration count is compared with build 12-Sep-2018 15:30:25 'niter' only after all channels/planes/fields have completed their build 12-Sep-2018 15:30:25 minor cycles and exited either due to 'cycleniter' or 'cyclethreshold'. build 12-Sep-2018 15:30:25 - Therefore, the actual number of iterations reported in the logger build 12-Sep-2018 15:30:25 + Therefore, the actual number of iterations reported in the logger build 12-Sep-2018 15:30:25 can sometimes be larger than the user specified value in 'niter'. build 12-Sep-2018 15:30:25 For example, with niter=100, cycleniter=20,nchan=10,threshold=0, build 12-Sep-2018 15:30:25 a total of 200 iterations will be done in the first set of minor cycles build 12-Sep-2018 15:30:25 before the total is compared with niter=100 and it exits. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Note : Additional global stopping criteria include build 12-Sep-2018 15:30:25 + Note : Additional global stopping criteria include build 12-Sep-2018 15:30:25 - no change in peak residual across two major cycles build 12-Sep-2018 15:30:25 - a 50% or more increase in peak residual across one major cycle build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1589,15 +1608,15 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Loop gain build 12-Sep-2018 15:30:25 Loop gain build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Fraction of the source flux to subtract out of the residual image build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Fraction of the source flux to subtract out of the residual image build 12-Sep-2018 15:30:25 for the CLEAN algorithm and its variants. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 A low value (0.2 or less) is recommended when the sky brightness build 12-Sep-2018 15:30:25 - distribution is not well represented by the basis functions used by build 12-Sep-2018 15:30:25 + distribution is not well represented by the basis functions used by build 12-Sep-2018 15:30:25 the chosen deconvolution algorithm. A higher value can be tried when build 12-Sep-2018 15:30:25 there is a good match between the true sky brightness structure and build 12-Sep-2018 15:30:25 - the basis function shapes. For example, for extended emission, build 12-Sep-2018 15:30:25 + the basis function shapes. For example, for extended emission, build 12-Sep-2018 15:30:25 multiscale clean with an appropriate set of scale sizes will tolerate build 12-Sep-2018 15:30:25 a higher loop gain than Clark clean (for example). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1613,20 +1632,20 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 Stopping threshold build 12-Sep-2018 15:30:25 Stopping threshold (number in units of Jy, or string) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - A global stopping threshold that the peak residual (within clean mask) build 12-Sep-2018 15:30:25 + A global stopping threshold that the peak residual (within clean mask) build 12-Sep-2018 15:30:25 across all image planes is compared to. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - threshold = 0.005 : 5mJy build 12-Sep-2018 15:30:25 - threshold = '5.0mJy' build 12-Sep-2018 15:30:25 + threshold = 0.005 : 5mJy build 12-Sep-2018 15:30:25 + threshold = '5.0mJy' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Note : A 'cyclethreshold' is internally computed and used as a major cycle build 12-Sep-2018 15:30:25 - trigger. It is related what fraction of the PSF can be reliably build 12-Sep-2018 15:30:25 + trigger. It is related what fraction of the PSF can be reliably build 12-Sep-2018 15:30:25 used during minor cycle updates of the residual image. By default build 12-Sep-2018 15:30:25 the minor cycle iterations terminate once the peak residual reaches build 12-Sep-2018 15:30:25 - the first sidelobe level of the brightest source. build 12-Sep-2018 15:30:25 + the first sidelobe level of the brightest source. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - 'cyclethreshold' is computed as follows using the settings in build 12-Sep-2018 15:30:25 - parameters 'cyclefactor','minpsffraction','maxpsffraction','threshold' : build 12-Sep-2018 15:30:25 + 'cyclethreshold' is computed as follows using the settings in build 12-Sep-2018 15:30:25 + parameters 'cyclefactor','minpsffraction','maxpsffraction','threshold' : build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 psf_fraction = max_psf_sidelobe_level * 'cyclefactor' build 12-Sep-2018 15:30:25 psf_fraction = max(psf_fraction, 'minpsffraction'); build 12-Sep-2018 15:30:25 @@ -1634,13 +1653,13 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 cyclethreshold = peak_residual * psf_fraction build 12-Sep-2018 15:30:25 cyclethreshold = max( cyclethreshold, 'threshold' ) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - If nsigma is set (>0.0), the N-sigma threshold is calculated (see build 12-Sep-2018 15:30:25 + If nsigma is set (>0.0), the N-sigma threshold is calculated (see build 12-Sep-2018 15:30:25 the description under nsigma), then cyclethreshold is further modified as, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 cyclethreshold = max( cyclethreshold, nsgima_threshold ) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - 'cyclethreshold' is made visible and editable only in the build 12-Sep-2018 15:30:25 + 'cyclethreshold' is made visible and editable only in the build 12-Sep-2018 15:30:25 interactive GUI when tclean is run with interactive=True. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1653,8 +1672,8 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 N-sigma threshold is calculated as nsigma * rms value per image plane determined build 12-Sep-2018 15:30:25 from a robust statistics. For nsigma > 0.0, in a minor cycle, a maximum of the two values, build 12-Sep-2018 15:30:25 - the N-sigma threshold and cyclethreshold, is used to trigger a major cycle build 12-Sep-2018 15:30:25 - (see also the descreption under 'threshold'). build 12-Sep-2018 15:30:25 + the N-sigma threshold and cyclethreshold, is used to trigger a major cycle build 12-Sep-2018 15:30:25 + (see also the descreption under 'threshold'). build 12-Sep-2018 15:30:25 Set nsigma=0.0 to preserve the previous tclean behavior without this feature. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1663,17 +1682,17 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Maximum number of minor-cycle iterations build 12-Sep-2018 15:30:25 -Maximum number of minor-cycle iterations (per plane) before triggering build 12-Sep-2018 15:30:25 +Maximum number of minor-cycle iterations (per plane) before triggering build 12-Sep-2018 15:30:25 a major cycle build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 For example, for a single plane image, if niter=100 and cycleniter=20, build 12-Sep-2018 15:30:25 there will be 5 major cycles after the initial one (assuming there is no build 12-Sep-2018 15:30:25 threshold based stopping criterion). At each major cycle boundary, if build 12-Sep-2018 15:30:25 - the number of iterations left over (to reach niter) is less than cycleniter, build 12-Sep-2018 15:30:25 + the number of iterations left over (to reach niter) is less than cycleniter, build 12-Sep-2018 15:30:25 it is set to the difference. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Note : cycleniter applies per image plane, even if cycleniter x nplanes build 12-Sep-2018 15:30:25 - gives a total number of iterations greater than 'niter'. This is to build 12-Sep-2018 15:30:25 + Note : cycleniter applies per image plane, even if cycleniter x nplanes build 12-Sep-2018 15:30:25 + gives a total number of iterations greater than 'niter'. This is to build 12-Sep-2018 15:30:25 preserve consistency across image planes within one set of minor build 12-Sep-2018 15:30:25 cycle iterations. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1690,7 +1709,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 cyclefactor=1.0 results in a cyclethreshold at the first sidelobe level of build 12-Sep-2018 15:30:25 the brightest source in the residual image before the minor cycle starts. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 cyclefactor=0.5 allows the minor cycle to go deeper. build 12-Sep-2018 15:30:25 cyclefactor=2.0 triggers a major cycle sooner. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1700,7 +1719,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 PSF fraction that marks the max depth of cleaning in the minor cycle build 12-Sep-2018 15:30:25 -PSF fraction that marks the max depth of cleaning in the minor cycle build 12-Sep-2018 15:30:25 +PSF fraction that marks the max depth of cleaning in the minor cycle build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Please refer to the Note under the documentation for 'threshold' that build 12-Sep-2018 15:30:25 discussed the calculation of 'cyclethreshold' build 12-Sep-2018 15:30:25 @@ -1714,7 +1733,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 PSF fraction that marks the minimum depth of cleaning in the minor cycle build 12-Sep-2018 15:30:25 -PSF fraction that marks the minimum depth of cleaning in the minor cycle build 12-Sep-2018 15:30:25 +PSF fraction that marks the minimum depth of cleaning in the minor cycle build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Please refer to the Note under the documentation for 'threshold' that build 12-Sep-2018 15:30:25 discussed the calculation of 'cyclethreshold' build 12-Sep-2018 15:30:25 @@ -1739,22 +1758,22 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 interactive=True will trigger an interactive GUI at every major cycle build 12-Sep-2018 15:30:25 boundary (after the major cycle and before the minor cycle). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 The interactive mode is currently not available for parallel cube imaging (please also build 12-Sep-2018 15:30:25 refer to the Note under the documentation for 'parallel' below). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Options for runtime parameter modification are : build 12-Sep-2018 15:30:25 + Options for runtime parameter modification are : build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Interactive clean mask : Draw a 1/0 mask (appears as a contour) by hand. build 12-Sep-2018 15:30:25 If a mask is supplied at the task interface or if build 12-Sep-2018 15:30:25 automasking is invoked, the current mask is build 12-Sep-2018 15:30:25 - displayed in the GUI and is available for manual build 12-Sep-2018 15:30:25 + displayed in the GUI and is available for manual build 12-Sep-2018 15:30:25 editing. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Note : If a mask contour is not visible, please build 12-Sep-2018 15:30:25 - check the cursor display at the bottom of build 12-Sep-2018 15:30:25 + check the cursor display at the bottom of build 12-Sep-2018 15:30:25 GUI to see which parts of the mask image build 12-Sep-2018 15:30:25 - have ones and zeros. If the entire mask=1 build 12-Sep-2018 15:30:25 + have ones and zeros. If the entire mask=1 build 12-Sep-2018 15:30:25 no contours will be visible. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1765,21 +1784,21 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 after the next major cycle. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Iteration control : -- max cycleniter : Trigger for the next major cycle build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The display begins with build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The display begins with build 12-Sep-2018 15:30:25 [ min( cycleniter, niter - itercount ) ] build 12-Sep-2018 15:30:25 - and can be edited by hand. build 12-Sep-2018 15:30:25 + and can be edited by hand. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - -- iterations left : The display begins with [niter-itercount ] build 12-Sep-2018 15:30:25 - and can be edited to increase or build 12-Sep-2018 15:30:25 + -- iterations left : The display begins with [niter-itercount ] build 12-Sep-2018 15:30:25 + and can be edited to increase or build 12-Sep-2018 15:30:25 decrease the total allowed niter. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -- threshold : Edit global stopping threshold build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - -- cyclethreshold : The display begins with the build 12-Sep-2018 15:30:25 - automatically computed value build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + -- cyclethreshold : The display begins with the build 12-Sep-2018 15:30:25 + automatically computed value build 12-Sep-2018 15:30:25 (see Note in help for 'threshold'), build 12-Sep-2018 15:30:25 - and can be edited by hand. build 12-Sep-2018 15:30:25 + and can be edited by hand. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 All edits will be reflected in the log messages that appear build 12-Sep-2018 15:30:25 once minor cycles begin. build 12-Sep-2018 15:30:25 @@ -1797,7 +1816,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Type of mask(s) for deconvolution: user, pb, auto-multithresh, auto-thresh(deprecated, will be removed in CASA 5.4), or auto-thresh(deprecated, will be removed in CASA 5.4) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1809,36 +1828,36 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 subparameter: pbmask build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Example: usemask="pb", pbmask=0.2 build 12-Sep-2018 15:30:25 - Construct a mask at the 0.2 pb gain level. build 12-Sep-2018 15:30:25 - (Currently, this option will work only with build 12-Sep-2018 15:30:25 + Construct a mask at the 0.2 pb gain level. build 12-Sep-2018 15:30:25 + (Currently, this option will work only with build 12-Sep-2018 15:30:25 gridders that produce .pb (i.e. mosaic and awproject) build 12-Sep-2018 15:30:25 or if an externally produced .pb image exists on disk) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 [Automasking algorithms available] build 12-Sep-2018 15:30:25 - auto-multithresh (recommended) : automask by multiple thresholds for deconvolution build 12-Sep-2018 15:30:25 + auto-multithresh (recommended) : automask by multiple thresholds for deconvolution build 12-Sep-2018 15:30:25 subparameters : sidelobethreshold, noisethreshold, lownoisethreshold, negativethrehsold, smoothfactor, build 12-Sep-2018 15:30:25 minbeamfrac, cutthreshold, pbmask, growiterations, dogrowprune, minpercentchange, verbose build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 if pbmask is >0.0, the region outside the specified pb gain level is excluded from build 12-Sep-2018 15:30:25 - image statistics in determination of the threshold. build 12-Sep-2018 15:30:25 + image statistics in determination of the threshold. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 auto-thresh (deprecated, will be removed in CASA 5.4): automask by threshold for deconvolution (binned residual image is used for build 12-Sep-2018 15:30:25 to defining masks) build 12-Sep-2018 15:30:25 subparameters : maskthreshold, maskresolution, pbmask, nmask build 12-Sep-2018 15:30:25 maskresolution and nmask are used to 'prune' the automask regions. build 12-Sep-2018 15:30:25 - if nmask > 0, 'pruning' of the found automask regions will be applied. build 12-Sep-2018 15:30:25 + if nmask > 0, 'pruning' of the found automask regions will be applied. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 auto-thresh2 (deprecated, will be removed in CASA 5.4) : automask by threshold for deconvolution without binning build 12-Sep-2018 15:30:25 subparameters : maskthreshold, maskresolution, pbmask, nmask build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Note: By default the intermediate mask generated by automask at each deconvolution cycle build 12-Sep-2018 15:30:25 - is over-written in the next cycle but one can save them by setting build 12-Sep-2018 15:30:25 - the environment variable, SAVE_ALL_AUTOMASKS="true". build 12-Sep-2018 15:30:25 - (e.g. in the CASA prompt, os.environ['SAVE_ALL_AUTOMASKS']="true" ) build 12-Sep-2018 15:30:25 - The saved CASA mask image name will be imagename.mask.autothresh#, where build 12-Sep-2018 15:30:25 - # is the iteration cycle number. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Note: By default the intermediate mask generated by automask at each deconvolution cycle build 12-Sep-2018 15:30:25 + is over-written in the next cycle but one can save them by setting build 12-Sep-2018 15:30:25 + the environment variable, SAVE_ALL_AUTOMASKS="true". build 12-Sep-2018 15:30:25 + (e.g. in the CASA prompt, os.environ['SAVE_ALL_AUTOMASKS']="true" ) build 12-Sep-2018 15:30:25 + The saved CASA mask image name will be imagename.mask.autothresh#, where build 12-Sep-2018 15:30:25 + # is the iteration cycle number. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 user build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1850,11 +1869,11 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Mask (a list of image name(s) or region file(s) or region string(s) ) build 12-Sep-2018 15:30:25 Mask (a list of image name(s) or region file(s) or region string(s) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 be considered for the centers of flux components in the minor cycle. build 12-Sep-2018 15:30:25 If regions specified fall completely outside of the image, tclean will throw an error. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Manual mask options/examples : build 12-Sep-2018 15:30:25 + Manual mask options/examples : build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - mask='xxx.mask' : Use this CASA image named xxx.mask and containing build 12-Sep-2018 15:30:25 - ones and zeros as the mask. If this image is a different build 12-Sep-2018 15:30:25 - shape from what is being made it will be resampled to build 12-Sep-2018 15:30:25 + mask='xxx.mask' : Use this CASA image named xxx.mask and containing build 12-Sep-2018 15:30:25 + ones and zeros as the mask. If this image is a different build 12-Sep-2018 15:30:25 + shape from what is being made it will be resampled to build 12-Sep-2018 15:30:25 the target coordinate system before being used. build 12-Sep-2018 15:30:25 + When a continuum (single channel) mask is given for spectral build 12-Sep-2018 15:30:25 + cube imaging, it will be extended (copied) to all channels. build 12-Sep-2018 15:30:25 + Similarly, when a Stokes I mask is given, it will be extended build 12-Sep-2018 15:30:25 + to multi-Stokes imaging. Extension of a cube stokes I mask build 12-Sep-2018 15:30:25 + to other Stokes planes is possible only if the spectral build 12-Sep-2018 15:30:25 + coordinate and the number of the channels matches with the output build 12-Sep-2018 15:30:25 + image. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 [ Note : If an error occurs during image resampling or build 12-Sep-2018 15:30:25 if the expected mask does not appear, please try build 12-Sep-2018 15:30:25 - using tasks 'imregrid' or 'makemask' to resample build 12-Sep-2018 15:30:25 - the mask image onto a CASA image with the target build 12-Sep-2018 15:30:25 - shape and coordinates and supply it via the 'mask' build 12-Sep-2018 15:30:25 + using tasks 'imregrid' or 'makemask' to resample build 12-Sep-2018 15:30:25 + the mask image onto a CASA image with the target build 12-Sep-2018 15:30:25 + shape and coordinates and supply it via the 'mask' build 12-Sep-2018 15:30:25 parameter. ] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 mask='xxx.crtf' : A text file with region strings and the following on the first line build 12-Sep-2018 15:30:25 ( #CRTFv0 CASA Region Text Format version 0 ) build 12-Sep-2018 15:30:25 This is the format of a file created via the viewer's region build 12-Sep-2018 15:30:25 tool when saved in CASA region file format. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 mask='circle[[40pix,40pix],10pix]' : A CASA region string. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 mask=['xxx.mask','xxx.crtf', 'circle[[40pix,40pix],10pix]'] : a list of masks build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -1911,7 +1937,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 held within each CASA image. These two types of masks are not build 12-Sep-2018 15:30:25 automatically interchangeable, so please use the makemask task build 12-Sep-2018 15:30:25 to copy between them if you need to construct a 1/0 based mask build 12-Sep-2018 15:30:25 - from a T/F one. build 12-Sep-2018 15:30:25 + from a T/F one. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Note : Work is in progress to generate more flexible masking options and build 12-Sep-2018 15:30:25 enable more controls. build 12-Sep-2018 15:30:25 @@ -1928,20 +1954,20 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 primary beam mask build 12-Sep-2018 15:30:25 -Sub-parameter for usemask='auto-thresh','auto-thresh2',or 'auto-multithresh': primary beam mask build 12-Sep-2018 15:30:25 +Sub-parameter for usemask='auto-thresh','auto-thresh2',or 'auto-multithresh': primary beam mask build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Examples : pbmask=0.0 (default, no pb mask) build 12-Sep-2018 15:30:25 - pbmask=0.2 (construct a mask at the 0.2 pb gain level) build 12-Sep-2018 15:30:25 + pbmask=0.2 (construct a mask at the 0.2 pb gain level) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 0.0 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 threshold for automasking (string with unit, e.g. "1.0mJy", sigma, or fraction of peak ,e.g. 0.1) build 12-Sep-2018 15:30:25 -Sub-parameter for "auto-thresh" and "auto-thresh2": threshold for automasking build 12-Sep-2018 15:30:25 +Sub-parameter for "auto-thresh" and "auto-thresh2": threshold for automasking build 12-Sep-2018 15:30:25 Threshold value in a string with a unit, sigma (e.g. 3.0) or fraction of peak (e.g, 0.05) build 12-Sep-2018 15:30:25 For a float value, if it is >= 1.0, it is interpreted as sigma (i.e. sigma*rms for threshold). If it is < 1.0, it is interpreted as build 12-Sep-2018 15:30:25 - the fraction of peak. build 12-Sep-2018 15:30:25 + the fraction of peak. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Examples : threshold = '1.0mJy' build 12-Sep-2018 15:30:25 threshold = 0.05 (threshold used is 0.05 * peak) build 12-Sep-2018 15:30:25 @@ -1953,7 +1979,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 resolution for automasking (string, e.g. "10arcsec", or a float value as multiplicative factor of the beam) build 12-Sep-2018 15:30:25 Sub-parameter for "auto-thresh" and "auto-thresh2": resolution for automasking build 12-Sep-2018 15:30:25 - The residual image is binned (npix x npix), where npix is maskresolution converted in the number of pixels build 12-Sep-2018 15:30:25 + The residual image is binned (npix x npix), where npix is maskresolution converted in the number of pixels build 12-Sep-2018 15:30:25 Examples : maskresolution='10arcsec' build 12-Sep-2018 15:30:25 maskresolution=2.0 (2 x bmaj) build 12-Sep-2018 15:30:25 maskresolution='' (default, use a restoring beam major axis) build 12-Sep-2018 15:30:25 @@ -1963,7 +1989,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 the maximum number of masks to be added by automasking build 12-Sep-2018 15:30:25 Sub-parameter for "auto-thresh" and "auto-thresh2": Maximum number of mask regions to be added by automasking at the beginning each minor cycles run build 12-Sep-2018 15:30:25 - Examples : nmask=2 build 12-Sep-2018 15:30:25 + Examples : nmask=2 build 12-Sep-2018 15:30:25 nmask=0 (default, set no limit on the number of mask regions to be added) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 0 build 12-Sep-2018 15:30:25 @@ -1975,25 +2001,30 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 3.0 build 12-Sep-2018 15:30:25 Sub-parameter for "auto-multithresh": mask threshold based on sidelobe levels: sidelobethreshold * max_sidelobe_level * peak residual build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - The rms is calculated from MAD with rms = 1.4826*MAD. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 noisethreshold * rms in residual image build 12-Sep-2018 15:30:25 5.0 build 12-Sep-2018 15:30:25 Sub-parameter for "auto-multithresh": mask threshold based on the noise level: noisethreshold * rms build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The rms is calculated from MAD with rms = 1.4826*MAD. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 lownoisethreshold * rms in residual image build 12-Sep-2018 15:30:25 1.5 build 12-Sep-2018 15:30:25 Sub-parameter for "auto-multithresh": mask threshold to grow previously masked regions via binary dilation: lownoisethreshold * rms in residual image build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The rms is calculated from MAD with rms = 1.4826*MAD. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 negativethreshold * rms in residual image build 12-Sep-2018 15:30:25 0.0 build 12-Sep-2018 15:30:25 -Sub-parameter for "auto-multithresh": mask threshold for negative features: -1.0* negativethreshold * rms build 12-Sep-2018 15:30:25 +Sub-parameter for "auto-multithresh": mask threshold for negative features: -1.0* negativethreshold * rms build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The rms is calculated from MAD with rms = 1.4826*MAD. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2018,29 +2049,29 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 number of binary dilation iterations for growing the mask build 12-Sep-2018 15:30:25 75 build 12-Sep-2018 15:30:25 -Sub-parameter for "auto-multithresh": Maximum number of iterations to perform using binary dilation for growing the mask build 12-Sep-2018 15:30:25 +Sub-parameter for "auto-multithresh": Maximum number of iterations to perform using binary dilation for growing the mask build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Do pruning on the grow mask build 12-Sep-2018 15:30:25 True build 12-Sep-2018 15:30:25 -Experimental sub-parameter for "auto-multithresh": Do pruning on the grow mask build 12-Sep-2018 15:30:25 +Experimental sub-parameter for "auto-multithresh": Do pruning on the grow mask build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 minimum percentage change in mask size (per channel plane) to trigger updating of mask by automask build 12-Sep-2018 15:30:25 -1.0 build 12-Sep-2018 15:30:25 -If the change in the mask size in a particular channel is less than minpercentchange, stop masking that channel in subsequent cycles. This check is only applied when noise based threshold is used and when the previous clean major cycle had a cyclethreshold value equal to the clean threshold. Values equal to -1.0 (or any value less than 0.0) will turn off this check (the default). Automask will still stop masking if the current channel mask is an empty mask and the noise threshold was used to determine the mask. build 12-Sep-2018 15:30:25 +If the change in the mask size in a particular channel is less than minpercentchange, stop masking that channel in subsequent cycles. This check is only applied when noise based threshold is used and when the previous clean major cycle had a cyclethreshold value equal to the clean threshold. Values equal to -1.0 (or any value less than 0.0) will turn off this check (the default). Automask will still stop masking if the current channel mask is an empty mask and the noise threshold was used to determine the mask. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 True: print more automasking information in the logger build 12-Sep-2018 15:30:25 False build 12-Sep-2018 15:30:25 - If it is set to True, the summary of automasking at the end of each automasking process build 12-Sep-2018 15:30:25 - is printed in the logger. Following information per channel will be listed in the summary. build 12-Sep-2018 15:30:25 + If it is set to True, the summary of automasking at the end of each automasking process build 12-Sep-2018 15:30:25 + is printed in the logger. Following information per channel will be listed in the summary. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 chan: channel number build 12-Sep-2018 15:30:25 masking?: F - stop updating automask for the subsequent iteration cycles build 12-Sep-2018 15:30:25 @@ -2052,8 +2083,8 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 N_pruned: number of the automask regions removed by pruning build 12-Sep-2018 15:30:25 N_grow: number of the grow mask regions build 12-Sep-2018 15:30:25 N_grow_pruned: number of the grow mask regions removed by pruning build 12-Sep-2018 15:30:25 - N_neg_pix: number of pixels for negative mask regions build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + N_neg_pix: number of pixels for negative mask regions build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Note that for a large cube, extra logging may slow down the process. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2063,53 +2094,53 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 True : Re-use existing images. False : Increment imagename build 12-Sep-2018 15:30:25 - Restart using existing images (and start from an existing model image) build 12-Sep-2018 15:30:25 + Restart using existing images (and start from an existing model image) build 12-Sep-2018 15:30:25 or automatically increment the image name and make a new image set. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 True : Re-use existing images. If imagename.model exists the subsequent build 12-Sep-2018 15:30:25 run will start from this model (i.e. predicting it using current gridder build 12-Sep-2018 15:30:25 settings and starting from the residual image). Care must be taken build 12-Sep-2018 15:30:25 when combining this option with startmodel. Currently, only one or build 12-Sep-2018 15:30:25 - the other can be used. build 12-Sep-2018 15:30:25 + the other can be used. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - startmodel='', imagename.model exists : build 12-Sep-2018 15:30:25 + startmodel='', imagename.model exists : build 12-Sep-2018 15:30:25 - Start from imagename.model build 12-Sep-2018 15:30:25 - startmodel='xxx', imagename.model does not exist : build 12-Sep-2018 15:30:25 + startmodel='xxx', imagename.model does not exist : build 12-Sep-2018 15:30:25 - Start from startmodel build 12-Sep-2018 15:30:25 - startmodel='xxx', imagename.model exists : build 12-Sep-2018 15:30:25 - - Exit with an error message requesting the user to pick build 12-Sep-2018 15:30:25 + startmodel='xxx', imagename.model exists : build 12-Sep-2018 15:30:25 + - Exit with an error message requesting the user to pick build 12-Sep-2018 15:30:25 only one model. This situation can arise when doing one build 12-Sep-2018 15:30:25 - run with startmodel='xxx' to produce an output build 12-Sep-2018 15:30:25 + run with startmodel='xxx' to produce an output build 12-Sep-2018 15:30:25 imagename.model that includes the content of startmodel, build 12-Sep-2018 15:30:25 and wanting to restart a second run to continue deconvolution. build 12-Sep-2018 15:30:25 Startmodel should be set to '' before continuing. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 If any change in the shape or coordinate system of the image is build 12-Sep-2018 15:30:25 - desired during the restart, please change the image name and build 12-Sep-2018 15:30:25 + desired during the restart, please change the image name and build 12-Sep-2018 15:30:25 use the startmodel (and mask) parameter(s) so that the old model build 12-Sep-2018 15:30:25 (and mask) can be regridded to the new coordinate system before starting. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - False : A convenience feature to increment imagename with '_1', '_2', build 12-Sep-2018 15:30:25 - etc as suffixes so that all runs of tclean are fresh starts (without build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + False : A convenience feature to increment imagename with '_1', '_2', build 12-Sep-2018 15:30:25 + etc as suffixes so that all runs of tclean are fresh starts (without build 12-Sep-2018 15:30:25 having to change the imagename parameter or delete images). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 This mode will search the current directory for all existing build 12-Sep-2018 15:30:25 imagename extensions, pick the maximum, and adds 1. build 12-Sep-2018 15:30:25 For imagename='try' it will make try.psf, try_2.psf, try_3.psf, etc. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - This also works if you specify a directory name in the path : build 12-Sep-2018 15:30:25 - imagename='outdir/try'. If './outdir' does not exist, it will create it. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + This also works if you specify a directory name in the path : build 12-Sep-2018 15:30:25 + imagename='outdir/try'. If './outdir' does not exist, it will create it. build 12-Sep-2018 15:30:25 Then it will search for existing filenames inside that directory. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - If outlier fields are specified, the incrementing happens for each build 12-Sep-2018 15:30:25 - of them (since each has its own 'imagename'). The counters are build 12-Sep-2018 15:30:25 + If outlier fields are specified, the incrementing happens for each build 12-Sep-2018 15:30:25 + of them (since each has its own 'imagename'). The counters are build 12-Sep-2018 15:30:25 synchronized across imagefields, to make it easier to match up sets build 12-Sep-2018 15:30:25 - of output images. It adds 1 to the 'max id' from all outlier names build 12-Sep-2018 15:30:25 - on disk. So, if you do two runs with only the main field build 12-Sep-2018 15:30:25 - (imagename='try'), and in the third run you add an outlier with build 12-Sep-2018 15:30:25 - imagename='outtry', you will get the following image names build 12-Sep-2018 15:30:25 - for the third run : 'try_3' and 'outtry_3' even though build 12-Sep-2018 15:30:25 - 'outry' and 'outtry_2' have not been used. build 12-Sep-2018 15:30:25 + of output images. It adds 1 to the 'max id' from all outlier names build 12-Sep-2018 15:30:25 + on disk. So, if you do two runs with only the main field build 12-Sep-2018 15:30:25 + (imagename='try'), and in the third run you add an outlier with build 12-Sep-2018 15:30:25 + imagename='outtry', you will get the following image names build 12-Sep-2018 15:30:25 + for the third run : 'try_3' and 'outtry_3' even though build 12-Sep-2018 15:30:25 + 'outry' and 'outtry_2' have not been used. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2117,7 +2148,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Options to save model visibilities (none, virtual, modelcolumn) build 12-Sep-2018 15:30:25 Options to save model visibilities (none, virtual, modelcolumn) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2125,9 +2156,9 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 to be later used for self-calibration (or to just plot and view them). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 none : Do not save any model visibilities in the MS. The MS is opened build 12-Sep-2018 15:30:25 - in readonly mode. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Model visibilities can be predicted in a separate step by build 12-Sep-2018 15:30:25 + in readonly mode. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Model visibilities can be predicted in a separate step by build 12-Sep-2018 15:30:25 restarting tclean with niter=0,savemodel=virtual or modelcolumn build 12-Sep-2018 15:30:25 and not changing any image names so that it finds the .model on build 12-Sep-2018 15:30:25 disk (or by changing imagename and setting startmodel to the build 12-Sep-2018 15:30:25 @@ -2139,13 +2170,13 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 All future references to model visibilities will activate the build 12-Sep-2018 15:30:25 (de)gridder to compute them on-the-fly. This mode is useful build 12-Sep-2018 15:30:25 when the dataset is large enough that an additional model data build 12-Sep-2018 15:30:25 - column on disk may be too much extra disk I/O, when the build 12-Sep-2018 15:30:25 + column on disk may be too much extra disk I/O, when the build 12-Sep-2018 15:30:25 gridder is simple enough that on-the-fly recomputing of the build 12-Sep-2018 15:30:25 model visibilities is quicker than disk I/O. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 modelcolumn : In the last major cycle, save predicted model visibilities build 12-Sep-2018 15:30:25 in the MODEL_DATA column of the MS. This mode is useful when build 12-Sep-2018 15:30:25 - the de-gridding cost to produce the model visibilities is higher build 12-Sep-2018 15:30:25 + the de-gridding cost to produce the model visibilities is higher build 12-Sep-2018 15:30:25 than the I/O required to read the model visibilities from disk. build 12-Sep-2018 15:30:25 This mode is currently required for gridder='awproject'. build 12-Sep-2018 15:30:25 This mode is also required for the ability to later pull out build 12-Sep-2018 15:30:25 @@ -2155,11 +2186,11 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 Note 1 : The imagename.model image on disk will always be constructed build 12-Sep-2018 15:30:25 if the minor cycle runs. This savemodel parameter applies only to build 12-Sep-2018 15:30:25 model visibilities created by de-gridding the model image. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Note 2 : It is possible for an MS to have both a virtual model build 12-Sep-2018 15:30:25 - as well as a model_data column, but under normal operation, build 12-Sep-2018 15:30:25 - the last used mode will get triggered. Use the delmod task to build 12-Sep-2018 15:30:25 - clear out existing models from an MS if confusion arises. build 12-Sep-2018 15:30:25 + as well as a model_data column, but under normal operation, build 12-Sep-2018 15:30:25 + the last used mode will get triggered. Use the delmod task to build 12-Sep-2018 15:30:25 + clear out existing models from an MS if confusion arises. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 none build 12-Sep-2018 15:30:25 @@ -2172,15 +2203,15 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 This parameter controls what the first major cycle does. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - calcres=False with niter greater than 0 will assume that build 12-Sep-2018 15:30:25 - a .residual image already exists and that the minor cycle can build 12-Sep-2018 15:30:25 + calcres=False with niter greater than 0 will assume that build 12-Sep-2018 15:30:25 + a .residual image already exists and that the minor cycle can build 12-Sep-2018 15:30:25 begin without recomputing it. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 calcres=False with niter=0 implies that only the PSF will be made build 12-Sep-2018 15:30:25 @@ -2210,7 +2241,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Usage example : For large runs (or a pipeline scripts) it may be build 12-Sep-2018 15:30:25 useful to first run tclean with niter=0 to create build 12-Sep-2018 15:30:25 - an initial .residual to look at and perhaps make build 12-Sep-2018 15:30:25 + an initial .residual to look at and perhaps make build 12-Sep-2018 15:30:25 a custom mask for. Imaging can be resumed build 12-Sep-2018 15:30:25 without recomputing it. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2222,28 +2253,28 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Calculate PSF build 12-Sep-2018 15:30:25 Calculate PSF build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 This parameter controls what the first major cycle does. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 calcpsf=False will assume that a .psf image already exists build 12-Sep-2018 15:30:25 and that the minor cycle can begin without recomputing it. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 True build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 auto build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 --> build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Construct an imagename.pb image normalized to 1.0 at its peak. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 writepb='auto' : Construct a PB only for A-Projection gridders that build 12-Sep-2018 15:30:25 - produce .weight images build 12-Sep-2018 15:30:25 + produce .weight images build 12-Sep-2018 15:30:25 [ .pb = sqrt(.weight) / max( sqrt(.weight) ) ] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 writepb=True : Always construct a .pb image. For gridders that do not build 12-Sep-2018 15:30:25 produce .weight, construct .pb explicitly. build 12-Sep-2018 15:30:25 - Note : For now, this option will create an empty image. build 12-Sep-2018 15:30:25 + Note : For now, this option will create an empty image. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ( The makepb script can be used as described in the build 12-Sep-2018 15:30:25 - gridder section to make .pb images externally ) build 12-Sep-2018 15:30:25 + gridder section to make .pb images externally ) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 auto build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Run major cycles in parallel build 12-Sep-2018 15:30:25 Run major cycles in parallel (this feature is experimental) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Parallel tclean will run only if casa has already been started using mpirun. build 12-Sep-2018 15:30:25 Please refer to HPC documentation for details on how to start this on your system. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Example : mpirun -n 3 -xterm 0 `which casa` build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Continuum Imaging : build 12-Sep-2018 15:30:25 @@ -2302,9 +2333,9 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 - All processes are synchronized at major cycle boundaries for convergence checks build 12-Sep-2018 15:30:25 - At the end, cubes from all partitions are concatenated along the spectral axis build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Note 1 : Iteration control for cube imaging is independent per partition. build 12-Sep-2018 15:30:25 + Note 1 : Iteration control for cube imaging is independent per partition. build 12-Sep-2018 15:30:25 - There is currently no communication between them to synchronize build 12-Sep-2018 15:30:25 - information such as peak residual and cyclethreshold. Therefore, build 12-Sep-2018 15:30:25 + information such as peak residual and cyclethreshold. Therefore, build 12-Sep-2018 15:30:25 different chunks may trigger major cycles at different levels. build 12-Sep-2018 15:30:25 - For cube imaging in parallel, there is currently no interactive masking. build 12-Sep-2018 15:30:25 (Proper synchronization of iteration control is work in progress.) build 12-Sep-2018 15:30:25 @@ -2336,7 +2367,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 "" build 12-Sep-2018 15:30:25 "corrected" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 "" build 12-Sep-2018 15:30:25 "" build 12-Sep-2018 15:30:25 "" build 12-Sep-2018 15:30:25 @@ -2362,11 +2393,11 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 "" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 "SIN" build 12-Sep-2018 15:30:25 "" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2442,12 +2473,14 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 "" build 12-Sep-2018 15:30:25 0.2 build 12-Sep-2018 15:30:25 True build 12-Sep-2018 15:30:25 + "" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 "flatnoise" build 12-Sep-2018 15:30:25 "" build 12-Sep-2018 15:30:25 0.2 build 12-Sep-2018 15:30:25 True build 12-Sep-2018 15:30:25 + "" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 "flatnoise" build 12-Sep-2018 15:30:25 @@ -2523,7 +2556,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - 2 build 12-Sep-2018 15:30:25 + 2 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2561,10 +2594,10 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - "" build 12-Sep-2018 15:30:25 - "" build 12-Sep-2018 15:30:25 + "" build 12-Sep-2018 15:30:25 + "" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2577,14 +2610,14 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 0.2 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 0.0 build 12-Sep-2018 15:30:25 "" build 12-Sep-2018 15:30:25 "" build 12-Sep-2018 15:30:25 0 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 0.0 build 12-Sep-2018 15:30:25 "" build 12-Sep-2018 15:30:25 "" build 12-Sep-2018 15:30:25 @@ -2623,7 +2656,7 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2639,9 +2672,9 @@ HPX HEALPix grid. --> build 12-Sep-2018 15:30:25 (A) A suite of test programs that demo all usable modes of tclean on small test datasets build 12-Sep-2018 15:30:25 https://svn.cv.nrao.edu/svn/casa/branches/release-4_5/gcwrap/python/scripts/tests/test_refimager.py build 12-Sep-2018 15:30:25 (B) A set of demo examples for ALMA imaging build 12-Sep-2018 15:30:25 - https://casaguides.nrao.edu/index.php/TCLEAN_and_ALMA build 12-Sep-2018 15:30:25 + https://casaguides.nrao.edu/index.php/TCLEAN_and_ALMA build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/tclean2.xml b/gcwrap/tasks/tclean2.xml build 12-Sep-2018 15:30:25 index ee5775d..d826271 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/tclean2.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/tclean2.xml build 12-Sep-2018 15:30:25 @@ -6,7 +6,7 @@ build 12-Sep-2018 15:30:25 file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Radio Interferometric Image Reconstruction build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/tsdimaging.xml b/gcwrap/tasks/tsdimaging.xml build 12-Sep-2018 15:30:25 index 52110bb..4a959d6 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/tsdimaging.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/tsdimaging.xml build 12-Sep-2018 15:30:25 @@ -37,7 +37,14 @@ channels selected.\n build 12-Sep-2018 15:30:25 Finally, polarizations of image is defined by stokes parameter or build 12-Sep-2018 15:30:25 polarization. For example, stokes='XXYY' produces an image cube with build 12-Sep-2018 15:30:25 each plane contains the image of one of the polarizations, while build 12-Sep-2018 15:30:25 -stokes='I' produces a 'total intensity' or Stokes I image.\n build 12-Sep-2018 15:30:25 +stokes='I' produces a 'total intensity' or Stokes I image. build 12-Sep-2018 15:30:25 +The stokes parameter has a special option, 'pseudoI'. The option is build 12-Sep-2018 15:30:25 +introduced to support imaging of partially flagged correlations. build 12-Sep-2018 15:30:25 +Main difference between 'I' and 'pseudoI' is that the former only takes build 12-Sep-2018 15:30:25 +into account the data whose correlations are all valid (this is the build 12-Sep-2018 15:30:25 +Stokes I in the strict sense) while the latter accumulates partially build 12-Sep-2018 15:30:25 +flagged data in addition. Note that the 'pseudoI' option is compatible build 12-Sep-2018 15:30:25 +with 'I' for sdimaging task. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The task also supports various grid function (convolution kernel) to build 12-Sep-2018 15:30:25 weight spectra as well as an option to remove the most extreme minimum build 12-Sep-2018 15:30:25 @@ -247,7 +254,25 @@ values. See description below for details of gridfunction available. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 stokes parameters or polarization types to image, e.g. \'I\', \'XX\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + I build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + I build 12-Sep-2018 15:30:25 + Q build 12-Sep-2018 15:30:25 + U build 12-Sep-2018 15:30:25 + V build 12-Sep-2018 15:30:25 + IV build 12-Sep-2018 15:30:25 + QU build 12-Sep-2018 15:30:25 + IQ build 12-Sep-2018 15:30:25 + UV build 12-Sep-2018 15:30:25 + IQUV build 12-Sep-2018 15:30:25 + RR build 12-Sep-2018 15:30:25 + LL build 12-Sep-2018 15:30:25 + XX build 12-Sep-2018 15:30:25 + YY build 12-Sep-2018 15:30:25 + RRLL build 12-Sep-2018 15:30:25 + XXYY build 12-Sep-2018 15:30:25 + pseudoI build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -525,9 +550,12 @@ pointingcolumn -- pointing data column to use build 12-Sep-2018 15:30:25 restfreq -- specify rest frequency to use for output image build 12-Sep-2018 15:30:25 default: '' (refer input data) build 12-Sep-2018 15:30:25 example: 1.0e11, '100GHz' build 12-Sep-2018 15:30:25 -stokes -- stokes parameters or polarization types to image build 12-Sep-2018 15:30:25 - default: '' (use all polarizations) build 12-Sep-2018 15:30:25 - example: 'XX' build 12-Sep-2018 15:30:25 +stokes -- Stokes Planes to make build 12-Sep-2018 15:30:25 + default='I'; example: stokes='XXYY'; build 12-Sep-2018 15:30:25 + options: 'I','Q','U','V','IV','QU','IQ','UV','IQUV','RR','LL','XX','YY','RRLL','XXYY','pseudoI' build 12-Sep-2018 15:30:25 + Note : The 'pseudoI' option is a partial solution, allowing Stokes I imaging build 12-Sep-2018 15:30:25 + when either of the parallel-hand correlations are unflagged. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 minweight -- Minimum weight ratio to the median of weight used in build 12-Sep-2018 15:30:25 weight correction and weight based masking build 12-Sep-2018 15:30:25 default: 0.1 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/visstat.xml b/gcwrap/tasks/visstat.xml build 12-Sep-2018 15:30:25 index 4c9316e..276b5b4 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/visstat.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tasks/visstat.xml build 12-Sep-2018 15:30:25 @@ -7,11 +7,11 @@ build 12-Sep-2018 15:30:25 file:///opt/casa/code/xmlcasa/xml/casa.xsd"> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Displays statistical information from a Measurement Set, or from a Multi-MS build 12-Sep-2018 15:30:25 + Displays statistical information from a MeasurementSet, or from a Multi-MS build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Name of Measurement Set or Multi-MS build 12-Sep-2018 15:30:25 + Name of MeasurementSet or Multi-MS build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 vis='ngc5921.ms' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -194,32 +194,33 @@ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Statistical information for the selected measurement set build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - {} build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - This task returns statistical information about data in a Measurement build 12-Sep-2018 15:30:25 - Set or Multi-MS. build 12-Sep-2018 15:30:25 + This task returns statistical information about data in a MeasurementSet build 12-Sep-2018 15:30:25 + or Multi-MS. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - The following values are computed: mean value, sum of values, sum of build 12-Sep-2018 15:30:25 + The following statistics are computed: mean value, sum of values, sum of build 12-Sep-2018 15:30:25 squared values, median, median absolute deviation, first and third build 12-Sep-2018 15:30:25 quartiles, minimum, maximum, variance, standard deviation, and root mean build 12-Sep-2018 15:30:25 square. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - The following axes are supported: uvw, flag, weight, sigma, antenna1, build 12-Sep-2018 15:30:25 - antenna2, feed1, feed2, field_id, array_id, data_desc_id, flag_row, build 12-Sep-2018 15:30:25 - interval, scan, scan_number, time, weight_spectrum, amp, amplitude, build 12-Sep-2018 15:30:25 - phase, real, imag, imaginary, and uvrange. build 12-Sep-2018 15:30:25 + Statistics may be computed on any of the following values: uvw, flag, build 12-Sep-2018 15:30:25 + weight, sigma, antenna1, antenna2, feed1, feed2, field_id, array_id, build 12-Sep-2018 15:30:25 + data_desc_id, flag_row, interval, scan, scan_number, time, build 12-Sep-2018 15:30:25 + weight_spectrum, amp, amplitude, phase, real, imag, imaginary, and build 12-Sep-2018 15:30:25 + uvrange. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + The 'reportingaxes' argument is used to partition the sample set along an build 12-Sep-2018 15:30:25 + axis. For example, setting its value to 'ddid' will result in the build 12-Sep-2018 15:30:25 + statistics of the chosen sample values partitioned by unique values of the build 12-Sep-2018 15:30:25 + data description id. Thus setting 'axis' to 'amp' and 'reportingaxes' to build 12-Sep-2018 15:30:25 + 'ddid' will report statistics of visibility amplitudes for each unique build 12-Sep-2018 15:30:25 + value of data description id in the MeasurementSet. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Optionally, the statistical information can be computed based only build 12-Sep-2018 15:30:25 - on a given subset of the measurement set. build 12-Sep-2018 15:30:25 + on a given subset of the MeasurementSet. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Note: If the MS consists of inhomogeneous data, for example several build 12-Sep-2018 15:30:25 spectral windows each having a different number of channels, it may be build 12-Sep-2018 15:30:25 @@ -228,7 +229,7 @@ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Keyword arguments: build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - vis --- Name of input Measurement Set or Multi-MS build 12-Sep-2018 15:30:25 + vis --- Name of input MeasurementSet or Multi-MS build 12-Sep-2018 15:30:25 default: '', example: vis='my.ms' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 axis -- Which data to analyze. build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/visstat2.xml b/gcwrap/tasks/visstat2.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index aa4eef7..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/visstat2.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,357 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Displays statistical information from a Measurement Set, or from a Multi-MS build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of Measurement Set or Multi-MS build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Which values to use build 12-Sep-2018 15:30:25 - amplitude build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Which data column to use (data, corrected, model, float_data) build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - corrected build 12-Sep-2018 15:30:25 - model build 12-Sep-2018 15:30:25 - float_data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Take flagging into account? build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - useflags=True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - spectral-window/frequency/channel build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Field names or field index numbers: \'\'==>all, field=\'0~2,3C286\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - More data selection parameters (antenna, timerange etc) build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - antenna/baselines: \'\'==>all, antenna = \'3,VA04\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - uv range: \'\'==>all; uvrange = \'0~100klambda\', default units=meters build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - time range: \'\'==>all, timerange=\'09:14:0~09:54:0\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data based on correlation build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - scan numbers: \'\'==>all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - (sub)array numbers: \'\'==>all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - observation ID number(s): \'\' = all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Average data in time. build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Bin width for time averaging. build 12-Sep-2018 15:30:25 - 0s build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Span the timebin across scan, state or both. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Maximum separation of start-to-end baselines that can be included in an average. (meters) build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Hidden parameter for internal use only. Do not change it! build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Hidden parameter for internal use only. Do not change it! build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Table query for nested selections build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Hidden parameter for internal use only. Do not change it! build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data by scan intent. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Which reporting axis to use (ddid, field, integration) build 12-Sep-2018 15:30:25 - ddid build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ddid build 12-Sep-2018 15:30:25 - field build 12-Sep-2018 15:30:25 - integration build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0s build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Statistical information for the selected measurement set build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - {} build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - This task returns statistical information about data in a Measurement build 12-Sep-2018 15:30:25 - Set or Multi-MS. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The use of "visstat2" has been deprecated; the "visstat2" task has been build 12-Sep-2018 15:30:25 - renamed as "visstat". build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The following values are computed: mean value, sum of values, sum of build 12-Sep-2018 15:30:25 - squared values, median, median absolute deviation, first and third build 12-Sep-2018 15:30:25 - quartiles, minimum, maximum, variance, standard deviation, and root mean build 12-Sep-2018 15:30:25 - square. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The following axes are supported: uvw, flag, weight, sigma, antenna1, build 12-Sep-2018 15:30:25 - antenna2, feed1, feed2, field_id, array_id, data_desc_id, flag_row, build 12-Sep-2018 15:30:25 - interval, scan, scan_number, time, weight_spectrum, amp, amplitude, build 12-Sep-2018 15:30:25 - phase, real, imag, imaginary, and uvrange. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Optionally, the statistical information can be computed based only build 12-Sep-2018 15:30:25 - on a given subset of the measurement set. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Note: If the MS consists of inhomogeneous data, for example several build 12-Sep-2018 15:30:25 - spectral windows each having a different number of channels, it may be build 12-Sep-2018 15:30:25 - necessary to use selection parameters to select a homogeneous subset of build 12-Sep-2018 15:30:25 - the MS, e.g. spw='2'. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - vis --- Name of input Measurement Set or Multi-MS build 12-Sep-2018 15:30:25 - default: '', example: vis='my.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - axis -- Which data to analyze. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - default: 'amplitude' build 12-Sep-2018 15:30:25 - axis='phase' build 12-Sep-2018 15:30:25 - axis='imag' build 12-Sep-2018 15:30:25 - axis='scan_number' build 12-Sep-2018 15:30:25 - axis='flag' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The phase of a complex number is in radians in the range [-pi; pi[. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - datacolumn -- Which data column to use for complex data. build 12-Sep-2018 15:30:25 - default: 'data' build 12-Sep-2018 15:30:25 - datacolumn='data' build 12-Sep-2018 15:30:25 - datacolumn='corrected' build 12-Sep-2018 15:30:25 - datacolumn='model' build 12-Sep-2018 15:30:25 - datacolumn='float_data' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - useflags -- Take MS flags into account? build 12-Sep-2018 15:30:25 - default: True build 12-Sep-2018 15:30:25 - useflags=False build 12-Sep-2018 15:30:25 - useflags=True build 12-Sep-2018 15:30:25 - If useflags=False, flagged values are included in the statistics. build 12-Sep-2018 15:30:25 - If useflags=True, any flagged values are not used in the statistics. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - spw -- Select data based on spectral window and channels build 12-Sep-2018 15:30:25 - default: '' (all); example: spw='1' build 12-Sep-2018 15:30:25 - spw='<2' #spectral windows less than 2 build 12-Sep-2018 15:30:25 - spw='>1' #spectral windows greater than 1 build 12-Sep-2018 15:30:25 - spw='0:0~10' # first 10 channels from spw 0 build 12-Sep-2018 15:30:25 - spw='0:0~5;56~60' # multiple separated channel chunks. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - field -- Select data based on field id(s) or name(s) build 12-Sep-2018 15:30:25 - default: '' (all); example: field='1' build 12-Sep-2018 15:30:25 - field='0~2' # field ids inclusive from 0 to 2 build 12-Sep-2018 15:30:25 - field='3C*' # all field names starting with 3C build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - selectdata -- Other data selection parameters build 12-Sep-2018 15:30:25 - default: True build 12-Sep-2018 15:30:25 - antenna -- Select data based on baseline build 12-Sep-2018 15:30:25 - default: '' (all); example: antenna='5&6' baseline 5-6 build 12-Sep-2018 15:30:25 - antenna='5&6;7&8' #baseline 5-6 and 7-8 build 12-Sep-2018 15:30:25 - antenna='5' # all baselines with antenna 5 build 12-Sep-2018 15:30:25 - antenna='5,6' # all baselines with antennas 5 and 6 build 12-Sep-2018 15:30:25 - correlation -- Correlation types build 12-Sep-2018 15:30:25 - default: '' (all); build 12-Sep-2018 15:30:25 - example: correlation='RR LL' build 12-Sep-2018 15:30:25 - uvrange -- Select data within uvrange (default units meters) build 12-Sep-2018 15:30:25 - default: '' (all); example: build 12-Sep-2018 15:30:25 - uvrange='0~1000klambda'; uvrange from 0-1000 kilo-lambda build 12-Sep-2018 15:30:25 - uvrange='>4klambda';uvranges greater than 4 kilo-lambda build 12-Sep-2018 15:30:25 - uvrange='0~1000km'; uvrange in kilometers build 12-Sep-2018 15:30:25 - timerange -- Select data based on time range: build 12-Sep-2018 15:30:25 - default = '' (all); example, build 12-Sep-2018 15:30:25 - timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss' build 12-Sep-2018 15:30:25 - Note: YYYY/MM/DD can be dropped as needed: build 12-Sep-2018 15:30:25 - timerange='09:14:0~09:54:0' # this time range build 12-Sep-2018 15:30:25 - timerange='09:44:00' # data within one integration of time build 12-Sep-2018 15:30:25 - timerange='>10:24:00' # data after this time build 12-Sep-2018 15:30:25 - timerange='09:44:00+00:13:00' #data 13 minutes after time build 12-Sep-2018 15:30:25 - scan -- Select data based on scan number build 12-Sep-2018 15:30:25 - default: '' (all); example: scan='>3' build 12-Sep-2018 15:30:25 - array -- Selection based on the antenna array build 12-Sep-2018 15:30:25 - observation -- Selection by observation ID(s). build 12-Sep-2018 15:30:25 - default: '' (all); example: observation='1~3' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - --- Time averaging parameters --- build 12-Sep-2018 15:30:25 - timeaverage -- Average data in time. Flagged data will be included in the build 12-Sep-2018 15:30:25 - average calculation, unless the parameter useflags is set to True. In this build 12-Sep-2018 15:30:25 - case only partially flagged rows will be used in the average. build 12-Sep-2018 15:30:25 - default: False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - timebin -- Bin width for time averaging. build 12-Sep-2018 15:30:25 - default: '0s' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - timespan -- Let the timebin span across scan, state or both. build 12-Sep-2018 15:30:25 - State is equivalent to sub-scans. One scan may have several build 12-Sep-2018 15:30:25 - state ids. For ALMA MSs, the sub-scans are limited to about build 12-Sep-2018 15:30:25 - 30s duration each. In these cases, the task will automatically build 12-Sep-2018 15:30:25 - add state to the timespan parameter. To see the number of states build 12-Sep-2018 15:30:25 - in an MS, use the msmd tool. See help msmd. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - default: '' (separate time bins by both of the above) build 12-Sep-2018 15:30:25 - options: 'scan', 'state', 'state,scan' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - examples: build 12-Sep-2018 15:30:25 - timespan = 'scan'; can be useful when the scan number build 12-Sep-2018 15:30:25 - goes up with each integration as in many WSRT MSs. build 12-Sep-2018 15:30:25 - timespan = ['scan', 'state']: disregard scan and state build 12-Sep-2018 15:30:25 - numbers when time averaging. build 12-Sep-2018 15:30:25 - timespan = 'state,scan'; same as above. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - maxuvwdistance -- Provide a maximum separation of start-to-end baselines build 12-Sep-2018 15:30:25 - that can be included in an average. (int) build 12-Sep-2018 15:30:25 - default: 0.0 (given in meters) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/visstatold.xml b/gcwrap/tasks/visstatold.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 0c21d6b..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/visstatold.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,235 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Displays statistical information from a Measurement Set, or from a Multi-MS build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Name of Measurement Set or Multi-MS build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Which values to use build 12-Sep-2018 15:30:25 - amplitude build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Which data column to use (data, corrected, model) build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - corrected build 12-Sep-2018 15:30:25 - model build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Take flagging into account? build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - useflags=True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - spectral-window/frequency/channel build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Field names or field index numbers: \'\'==>all, field=\'0~2,3C286\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - More data selection parameters (antenna, timerange etc) build 12-Sep-2018 15:30:25 - True build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - antenna/baselines: \'\'==>all, antenna = \'3,VA04\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - uv range: \'\'==>all; uvrange = \'0~100klambda\', default units=meters build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - time range: \'\'==>all, timerange=\'09:14:0~09:54:0\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data based on correlation build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - scan numbers: \'\'==>all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - (sub)array numbers: \'\'==>all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - observation ID number(s): \'\' = all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Statistical information for the selected measurement set build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - {} build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - This task returns statistical information about data in a Measurement build 12-Sep-2018 15:30:25 - Set or Multi-MS. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The use of "visstatold" has been deprecated; please use the "visstat" task build 12-Sep-2018 15:30:25 - in preference to "visstatold". visstatold will be removed in a future CASA build 12-Sep-2018 15:30:25 - release. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The following values are computed: mean value, sum of values, build 12-Sep-2018 15:30:25 - sum of squared values, median, median absolute deviation, quartile, build 12-Sep-2018 15:30:25 - minimum, maximum, variance, standard deviation, and root mean square. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The following axes are supported: uvw, flag, weight, sigma, antenna1, build 12-Sep-2018 15:30:25 - antenna2, feed1, feed2, field_id, array_id, data_desc_id, flag_row, build 12-Sep-2018 15:30:25 - interval, scan, scan_number, time, weight_spectrum, amp, amplitude, build 12-Sep-2018 15:30:25 - phase, real, imag, imaginary, and uvrange. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Optionally, the statistical information can be computed based only build 12-Sep-2018 15:30:25 - on a given subset of the measurement set. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Note: If the MS consists of inhomogeneous data, for example several build 12-Sep-2018 15:30:25 - spectral windows each having a different number of channels, it may be build 12-Sep-2018 15:30:25 - necessary to use selection parameters to select a homogeneous subset of build 12-Sep-2018 15:30:25 - the MS, e.g. spw='2'. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - vis --- Name of input Measurement Set or Multi-MS build 12-Sep-2018 15:30:25 - default: '', example: vis='my.ms' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - axis -- Which data to analyze. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - default: 'amplitude' build 12-Sep-2018 15:30:25 - axis='phase' build 12-Sep-2018 15:30:25 - axis='imag' build 12-Sep-2018 15:30:25 - axis='scan_number' build 12-Sep-2018 15:30:25 - axis='flag' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The phase of a complex number is in radians in the range [-pi; pi[. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - datacolumn -- Which data column to use for complex data. build 12-Sep-2018 15:30:25 - default: 'data' build 12-Sep-2018 15:30:25 - datacolumn='data' build 12-Sep-2018 15:30:25 - datacolumn='corrected' build 12-Sep-2018 15:30:25 - datacolumn='model' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - useflags -- Take MS flags into account? build 12-Sep-2018 15:30:25 - default: True build 12-Sep-2018 15:30:25 - useflag=False build 12-Sep-2018 15:30:25 - useflag=True build 12-Sep-2018 15:30:25 - If useflags=False, flagged values are included in the statistics. build 12-Sep-2018 15:30:25 - If useflags=True, any flagged values are not used in the statistics. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - spw -- Select data based on spectral window and channels build 12-Sep-2018 15:30:25 - default: '' (all); example: spw='1' build 12-Sep-2018 15:30:25 - spw='<2' #spectral windows less than 2 build 12-Sep-2018 15:30:25 - spw='>1' #spectral windows greater than 1 build 12-Sep-2018 15:30:25 - spw='0:0~10' # first 10 channels from spw 0 build 12-Sep-2018 15:30:25 - spw='0:0~5;56~60' # multiple separated channel chunks. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - field -- Select data based on field id(s) or name(s) build 12-Sep-2018 15:30:25 - default: '' (all); example: field='1' build 12-Sep-2018 15:30:25 - field='0~2' # field ids inclusive from 0 to 2 build 12-Sep-2018 15:30:25 - field='3C*' # all field names starting with 3C build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - selectdata -- Other data selection parameters build 12-Sep-2018 15:30:25 - default: True build 12-Sep-2018 15:30:25 - antenna -- Select data based on baseline build 12-Sep-2018 15:30:25 - default: '' (all); example: antenna='5&6' baseline 5-6 build 12-Sep-2018 15:30:25 - antenna='5&6;7&8' #baseline 5-6 and 7-8 build 12-Sep-2018 15:30:25 - antenna='5' # all baselines with antenna 5 build 12-Sep-2018 15:30:25 - antenna='5,6' # all baselines with antennas 5 and 6 build 12-Sep-2018 15:30:25 - correlation -- Correlation types build 12-Sep-2018 15:30:25 - default: '' (all); build 12-Sep-2018 15:30:25 - example: correlation='RR LL' build 12-Sep-2018 15:30:25 - uvrange -- Select data within uvrange (default units meters) build 12-Sep-2018 15:30:25 - default: '' (all); example: build 12-Sep-2018 15:30:25 - uvrange='0~1000klambda'; uvrange from 0-1000 kilo-lambda build 12-Sep-2018 15:30:25 - uvrange='>4klambda';uvranges greater than 4 kilo-lambda build 12-Sep-2018 15:30:25 - uvrange='0~1000km'; uvrange in kilometers build 12-Sep-2018 15:30:25 - timerange -- Select data based on time range: build 12-Sep-2018 15:30:25 - default = '' (all); example, build 12-Sep-2018 15:30:25 - timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss' build 12-Sep-2018 15:30:25 - Note: YYYY/MM/DD can be dropped as needed: build 12-Sep-2018 15:30:25 - timerange='09:14:0~09:54:0' # this time range build 12-Sep-2018 15:30:25 - timerange='09:44:00' # data within one integration of time build 12-Sep-2018 15:30:25 - timerange='>10:24:00' # data after this time build 12-Sep-2018 15:30:25 - timerange='09:44:00+00:13:00' #data 13 minutes after time build 12-Sep-2018 15:30:25 - scan -- Select data based on scan number build 12-Sep-2018 15:30:25 - default: '' (all); example: scan='>3' build 12-Sep-2018 15:30:25 - array -- Selection based on the antenna array build 12-Sep-2018 15:30:25 - observation -- Selection by observation ID(s). build 12-Sep-2018 15:30:25 - default: '' (all); example: observation='1~3' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tasks/widefield.xml b/gcwrap/tasks/widefield.xml build 12-Sep-2018 15:30:25 deleted file mode 100644 build 12-Sep-2018 15:30:25 index 5a7859c..0000000 build 12-Sep-2018 15:30:25 --- a/gcwrap/tasks/widefield.xml build 12-Sep-2018 15:30:25 +++ /dev/null build 12-Sep-2018 15:30:25 @@ -1,655 +0,0 @@ build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Wide-field imaging and deconvolution with selected algorithm build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -This is the main wide-field imaging/deconvolution task. It build 12-Sep-2018 15:30:25 -uses the wprojection method for a large field of view, can build 12-Sep-2018 15:30:25 -make many facets, and can include outlier fields. Several build 12-Sep-2018 15:30:25 -deconvolution algorithms are supported. Interactive cleaning build 12-Sep-2018 15:30:25 -is also supported build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - name of input visibility file build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Pre-name of output images build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Text file with image names, sizes, centers build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Field Name build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Spectral windows:channels: \'\' is all build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Other data selection parameters build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Range of time to select from data build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data within uvrange build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Select data based on antenna/baseline build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - scan number range build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Type of selection (mfs, channel, velocity, frequency) build 12-Sep-2018 15:30:25 - mfs build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - mfs build 12-Sep-2018 15:30:25 - channel build 12-Sep-2018 15:30:25 - velocity build 12-Sep-2018 15:30:25 - frequency build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Maximum number of iterations build 12-Sep-2018 15:30:25 - 500 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Loop gain for cleaning build 12-Sep-2018 15:30:25 - 0.1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Flux level to stop cleaning. Must include units build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0.0Jy build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Algorithm to use (clark, hogbom) build 12-Sep-2018 15:30:25 - clark build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - clark build 12-Sep-2018 15:30:25 - hogbom build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Gridding method for the image (wproject, ft) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ft build 12-Sep-2018 15:30:25 - wproject build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Number of facets along each axis in main image only build 12-Sep-2018 15:30:25 - 3 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Number of planes to use in wprojection convolutiuon function build 12-Sep-2018 15:30:25 - 64 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - set deconvolution scales (pixels), default: multiscale=[] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Stop cleaning if the largest scale finds this number of neg components build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - use interactive clean (with GUI viewer) build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - cleanbox(es), mask image(s), and/or region(s) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Number of channels (planes) in output image build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - First channel in input to use build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Number of input channels to average build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Image size in pixels (nx,ny), single value okay build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 256256 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The image cell size in arcseconds [x,y], single value okay. build 12-Sep-2018 15:30:25 - 1.01.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Field Identififier or direction of the image phase center build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - rest frequency to assign to image (see help) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Stokes params to image (I,IV,QU,IQUV,RR,LL,XX,YY,RRLL,XXYY) build 12-Sep-2018 15:30:25 - I build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - I build 12-Sep-2018 15:30:25 - IV build 12-Sep-2018 15:30:25 - QU build 12-Sep-2018 15:30:25 - IQUV build 12-Sep-2018 15:30:25 - RR build 12-Sep-2018 15:30:25 - LL build 12-Sep-2018 15:30:25 - RRLL build 12-Sep-2018 15:30:25 - XX build 12-Sep-2018 15:30:25 - YY build 12-Sep-2018 15:30:25 - XXYY build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Weighting to apply to visibilities build 12-Sep-2018 15:30:25 - natural build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - natural build 12-Sep-2018 15:30:25 - uniform build 12-Sep-2018 15:30:25 - briggs build 12-Sep-2018 15:30:25 - briggsabs build 12-Sep-2018 15:30:25 - radial build 12-Sep-2018 15:30:25 - superuniform build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Briggs robustness parameter build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - -2.0 build 12-Sep-2018 15:30:25 - 2.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - number of pixels to determine cell size for superuniform or briggs weighting build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - noise parameter for briggs abs mode weighting build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1.0Jy build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Threshold for minor/major cycles (see pdoc) build 12-Sep-2018 15:30:25 - 1.5 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Cycle threshold doubles in this number of iterations build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Number of iterations before interactive masking prompt build 12-Sep-2018 15:30:25 - 100 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Apply additional uv tapering of visibilities. build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - uv-taper on outer baselines in uv-plane build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - uv-taper in center of uv-plane build 12-Sep-2018 15:30:25 - 1.0 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Output Gaussian restoring beam for CLEAN image build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Create scratch columns and store model visibilities so that selfcal can be run after clean build 12-Sep-2018 15:30:25 - False build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - -1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - -11 build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - first channel in image relative to data channels build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - 0.0km/s build 12-Sep-2018 15:30:25 - Velocity of first image channel: e.g \'0.0km/s\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1km/s build 12-Sep-2018 15:30:25 - image channel width in velocity units: e.g \'-1.0km/s\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - 1.4GHz build 12-Sep-2018 15:30:25 - Frequency of first image channel: e.q. \'1.4GHz\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 10kHz build 12-Sep-2018 15:30:25 - Image channel width in frequency units: e.g \'10kHz\' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - number of pixels to determine uv-cell size 0=> field of view build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0.0 build 12-Sep-2018 15:30:25 - 1.0Jy build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - number of pixels to determine uv-cell size 0=> field of view build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 0 build 12-Sep-2018 15:30:25 - number of pixels to determine uv-cell size 0=> +/-3pixels build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 100 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 256 build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Wide-field imaging and deconvolution with selected algorithm: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - This is the main wide-field imaging/deconvolution task. It build 12-Sep-2018 15:30:25 - uses the wprojection method for a large field of view, can build 12-Sep-2018 15:30:25 - make many facets, and can include outlier fields. Several build 12-Sep-2018 15:30:25 - deconvolution algorithms are supported. Interactive cleaning build 12-Sep-2018 15:30:25 - is also supported. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - For making large images (>2000 on a size), see hints at the build 12-Sep-2018 15:30:25 - end of the descriptions. For making images larger than about build 12-Sep-2018 15:30:25 - 5000x5000, the available memory must be larger than 2 Gbytes. For such build 12-Sep-2018 15:30:25 - images therefore a computer with a 64-bit operating system may be build 12-Sep-2018 15:30:25 - needed. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Keyword arguments: build 12-Sep-2018 15:30:25 - vis -- Name of all input visibility files build 12-Sep-2018 15:30:25 - default: none; example: vis='ngc5921.ms' build 12-Sep-2018 15:30:25 - example: vis=['data01.ms', 'data02.ms'] build 12-Sep-2018 15:30:25 - imagename -- Pre-name of output images: build 12-Sep-2018 15:30:25 - default: none; example: imagename='n5921' build 12-Sep-2018 15:30:25 - if outlier fields are included, then build 12-Sep-2018 15:30:25 - imagename=['n5921', 'outlier1', outlier2'] build 12-Sep-2018 15:30:25 - and the first imagename is the wide-field image build 12-Sep-2018 15:30:25 - output images names are: n5921.clean, n5921.residual, build 12-Sep-2018 15:30:25 - n5921.model, n5921.interactive.mask build 12-Sep-2018 15:30:25 - mode -- Type of selection build 12-Sep-2018 15:30:25 - default: 'mfs'; example: mode='channel'; build 12-Sep-2018 15:30:25 - Options: 'mfs', channel, velocity, frequency' build 12-Sep-2018 15:30:25 - alg -- Algorithm to use build 12-Sep-2018 15:30:25 - default: 'clark'; build 12-Sep-2018 15:30:25 - Options: 'clark', 'hogbom','multiscale','entropy' build 12-Sep-2018 15:30:25 - Strongly advise 'clark'. multiscale and entropy build 12-Sep-2018 15:30:25 - well-tested. build 12-Sep-2018 15:30:25 - imsize -- Image pixel size (x,y) build 12-Sep-2018 15:30:25 - default = [256,256]; example: imsize=[500,500], or imsize=500 build 12-Sep-2018 15:30:25 - example for multiple fields: imsize=[(1000, 1000), (100, 100)] build 12-Sep-2018 15:30:25 - cell -- Cell size (x,y) build 12-Sep-2018 15:30:25 - default=['1arcsec,'1arcsec'] build 12-Sep-2018 15:30:25 - example: cell=['0.5arcsec,'0.5arcsec'], or cell='0.5arcsec' build 12-Sep-2018 15:30:25 - phasecenter -- direction position or the field for the image center build 12-Sep-2018 15:30:25 - A list of the above is needed for multiple-fields build 12-Sep-2018 15:30:25 - default: '' -->field='0' as center; example: phasecenter='6' build 12-Sep-2018 15:30:25 - phasecenter='J2000 19h30m00 -40d00m00' build 12-Sep-2018 15:30:25 - phasecenter=['J2000 19h30m00 -40d00m00', 'J2000 19h57m00 40d00m00'] build 12-Sep-2018 15:30:25 - for wide-field, plus one outlier field. build 12-Sep-2018 15:30:25 - stokes -- Stokes parameters to image build 12-Sep-2018 15:30:25 - default='I'; example: stokes='IQUV'; build 12-Sep-2018 15:30:25 - Options: 'I','IV','IQU','IQUV' build 12-Sep-2018 15:30:25 - niter -- Number iterations, set to zero for no CLEANing build 12-Sep-2018 15:30:25 - default: 500; example: niter=500 build 12-Sep-2018 15:30:25 - gain -- Loop gain for CLEANing build 12-Sep-2018 15:30:25 - default: 0.1; example: gain=0.1 build 12-Sep-2018 15:30:25 - threshold -- Flux level at which to stop CLEANing (units=mJy) build 12-Sep-2018 15:30:25 - default: 0.0; example: threshold=0.0 build 12-Sep-2018 15:30:25 - mask -- Name(s) of mask image(s) used for CLEANing build 12-Sep-2018 15:30:25 - default: '' example: mask='orion.mask' build 12-Sep-2018 15:30:25 - Number of mask fields must equal number of imaged fields build 12-Sep-2018 15:30:25 - cleanbox -- List of [blc-x,blc-y,trc-x,trc-y] values build 12-Sep-2018 15:30:25 - default: []; example: cleanbox=[110,110,150,145] build 12-Sep-2018 15:30:25 - Note: This can also be a filename with clean values: build 12-Sep-2018 15:30:25 - fieldindex blc-x blc-y trc-x trc-y build 12-Sep-2018 15:30:25 - cleanbox = 'interactive' is very useful. build 12-Sep-2018 15:30:25 - --- Data Selection build 12-Sep-2018 15:30:25 - nchan -- Number of channels to select build 12-Sep-2018 15:30:25 - default: 1; example: nchan=45 build 12-Sep-2018 15:30:25 - start -- Start channel, 0-relative build 12-Sep-2018 15:30:25 - default=0; example: start=5 build 12-Sep-2018 15:30:25 - if mode='frequency' then a frequency value e.g start='1.4GHz' build 12-Sep-2018 15:30:25 - width -- Channel width (value > 1 indicates channel averaging) build 12-Sep-2018 15:30:25 - default=1; example: width=5 build 12-Sep-2018 15:30:25 - if mode='frequency' then a frequency value e.g width='10kHz' build 12-Sep-2018 15:30:25 - step -- Step in channel number build 12-Sep-2018 15:30:25 - default=1; example: step=2 build 12-Sep-2018 15:30:25 - field -- Select field using field id(s) or field name(s). build 12-Sep-2018 15:30:25 - [run listobs to obtain the list id's or names] build 12-Sep-2018 15:30:25 - default: ''=all fields build 12-Sep-2018 15:30:25 - If field string is a non-negative integer, it is assumed a field index build 12-Sep-2018 15:30:25 - otherwise, it is assumed a field name build 12-Sep-2018 15:30:25 - field='0~2'; field ids 0,1,2 build 12-Sep-2018 15:30:25 - field='0,4,5~7'; field ids 0,4,5,6,7 build 12-Sep-2018 15:30:25 - field='3C286,3C295'; field named 3C286 adn 3C295 build 12-Sep-2018 15:30:25 - field = '3,4C*'; field id 3, all names starting with 4C build 12-Sep-2018 15:30:25 - example for multiple ms in vis parameter: build 12-Sep-2018 15:30:25 - field=['0~2', '1,2'] build 12-Sep-2018 15:30:25 - spw -- Select spectral window/channels build 12-Sep-2018 15:30:25 - default: ''=all spectral windows and channels build 12-Sep-2018 15:30:25 - spw='0~2,4'; spectral windows 0,1,2,4 (all channels) build 12-Sep-2018 15:30:25 - spw='<2'; spectral windows less than 2 (i.e. 0,1) build 12-Sep-2018 15:30:25 - spw='0:5~61'; spw 0, channels 5 to 61 build 12-Sep-2018 15:30:25 - spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, channels 3 to 45. build 12-Sep-2018 15:30:25 - spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. build 12-Sep-2018 15:30:25 - spw='0:0~10;15~60'; spectral window 0 with channels 0-10,15-60 build 12-Sep-2018 15:30:25 - spw='0:0~10,1:20~30,2:1;2;3'; spw 0, channels 0-10, build 12-Sep-2018 15:30:25 - spw 1, channels 20-30, and spw 2, channels, 1,2 and 3 build 12-Sep-2018 15:30:25 - For multiple ms in vis parameter: build 12-Sep-2018 15:30:25 - spw=['0,10,3:3~45', '<2'] build 12-Sep-2018 15:30:25 - timerange -- Select time range subset of data (not implemented yet) build 12-Sep-2018 15:30:25 - default='' meaning no time selection build 12-Sep-2018 15:30:25 - example: timerange='YYYY/MM/DD/HH:MM:SS.sss' build 12-Sep-2018 15:30:25 - timerange='< YYYY/MM/DD/HH:MM:SS.sss' build 12-Sep-2018 15:30:25 - timerange='> YYYY/MM/DD/HH:MM:SS.sss' build 12-Sep-2018 15:30:25 - timerange='ddd/HH:MM:SS.sss' build 12-Sep-2018 15:30:25 - timerange='< ddd/HH:MM:SS.sss' build 12-Sep-2018 15:30:25 - timerange='> ddd/HH:MM:SS.sss' build 12-Sep-2018 15:30:25 - restfreq -- Specify rest frequency to use for image build 12-Sep-2018 15:30:25 - default='' (i.e., try to use the restfreq specified in the visibility data) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - --- Weighting build 12-Sep-2018 15:30:25 - weighting -- Weighting to apply to visibilities build 12-Sep-2018 15:30:25 - default='natural'; example: weighting='uniform'; build 12-Sep-2018 15:30:25 - Options: 'natural','uniform','briggs','briggsabs','radial', 'superuniform' build 12-Sep-2018 15:30:25 - robust -- 'briggs' and 'brigssabs' robustness parameter build 12-Sep-2018 15:30:25 - default=0.0; example: robust=0.5; build 12-Sep-2018 15:30:25 - Options: -2.0 to 2.0; -2 (uniform)/+2 (natural) build 12-Sep-2018 15:30:25 - npixels -- number of pixels to determine uv-cell size for weight calculation build 12-Sep-2018 15:30:25 - -- Used with superuniform or briggs weighting schemes build 12-Sep-2018 15:30:25 - example: npixels=3 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - --- widefield controls build 12-Sep-2018 15:30:25 - ftmachine -- Gridding method for the image; build 12-Sep-2018 15:30:25 - ft (standard interferometric gridding). build 12-Sep-2018 15:30:25 - wproject (wprojection algorithm for gridding) build 12-Sep-2018 15:30:25 - default: wproject build 12-Sep-2018 15:30:25 - wprojplanes -- Number w-projection planes to use for gridding build 12-Sep-2018 15:30:25 - default: 256 build 12-Sep-2018 15:30:25 - example: wprojplanes=64 build 12-Sep-2018 15:30:25 - Good value = BMAX(klambda) * Map width(arcmin)^2 / 600 build 12-Sep-2018 15:30:25 - facets -- Number of facets along one axis on central image build 12-Sep-2018 15:30:25 - image is divided in facets x facets rectangles. build 12-Sep-2018 15:30:25 - default: 1 build 12-Sep-2018 15:30:25 - example: facets=3 makes 3x3 images to cover the field build 12-Sep-2018 15:30:25 - if ftmachine = 'ft', only faceting is used build 12-Sep-2018 15:30:25 - if ftmachine = 'wproject', both wplanes and faceting build 12-Sep-2018 15:30:25 - can be used (see below). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - cyclefactor -- Change the threshold at which the deconvolution cycle will build 12-Sep-2018 15:30:25 - stop and degrid and subtract from the visibilities. For bad PSFs, build 12-Sep-2018 15:30:25 - reconcile often (cyclefactor=4 or 5); For good PSFs, use build 12-Sep-2018 15:30:25 - cyclefactor 1.5 to 2.0. build 12-Sep-2018 15:30:25 - default: 2.5; example: cyclefactor=4, but decreases speed considerably. build 12-Sep-2018 15:30:25 - <cycle threshold = cyclefactor * max sidelobe * max residual> build 12-Sep-2018 15:30:25 - cyclespeedup -- Cycle threshold doubles in this number of iterations build 12-Sep-2018 15:30:25 - default: -1; example: cyclespeedup=500 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - --- MEM parameters (Experimental, not well-tested) build 12-Sep-2018 15:30:25 - sigma -- Target image sigma build 12-Sep-2018 15:30:25 - default: '0.001Jy'; example: sigma='0.1Jy' build 12-Sep-2018 15:30:25 - targetflux -- Target flux for final image build 12-Sep-2018 15:30:25 - default: '1.0Jy'; example: targetflux='200Jy' build 12-Sep-2018 15:30:25 - constrainflux -- Constrain image to match target flux; build 12-Sep-2018 15:30:25 - otherwise, targetflux is used to initialize model only. build 12-Sep-2018 15:30:25 - default: False; example: constrainflux=True build 12-Sep-2018 15:30:25 - prior -- Name of MEM prior images build 12-Sep-2018 15:30:25 - default: ['']; example: prior='source_mem.image' build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - --- Multi-scale parameters (Experimental, not well-tested) build 12-Sep-2018 15:30:25 - negcomponent -- Stop component search when the largest scale has found this build 12-Sep-2018 15:30:25 - number of negative components; -1 means continue component search build 12-Sep-2018 15:30:25 - even if the largest component is negative. build 12-Sep-2018 15:30:25 - default: 2; example: negcomponent=-1 build 12-Sep-2018 15:30:25 - scales -- Used for alg='multiscale'; set a number of scales or a vector build 12-Sep-2018 15:30:25 - default: [0,3,10]; example: scales=[0.0,3.0,10.0, 30] build 12-Sep-2018 15:30:25 - -- interactive masking build 12-Sep-2018 15:30:25 - npercycle -- when cleanbox is set to 'interactive', build 12-Sep-2018 15:30:25 - this is the number of iterations between each clean to update mask build 12-Sep-2018 15:30:25 - interactively. However, this number can be adjusted during execution. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - uvtaper -- Apply additional uv tapering of the visibilities. build 12-Sep-2018 15:30:25 - default: uvtaper=False; example: uvtaper=True build 12-Sep-2018 15:30:25 - uvtaper=True expandable parameters build 12-Sep-2018 15:30:25 - outertaper -- uv-taper on outer baselines in uv-plane build 12-Sep-2018 15:30:25 - [bmaj, bmin, bpa] taper Gaussian scale in uv or build 12-Sep-2018 15:30:25 - angular units. NOTE: uv taper in (klambda) is build 12-Sep-2018 15:30:25 - roughly on-sky FWHM(arcsec/200) build 12-Sep-2018 15:30:25 - default: outertaper=[]; no outer taper applied build 12-Sep-2018 15:30:25 - example: outertaper=['5klambda'] circular taper build 12-Sep-2018 15:30:25 - FWHM=5 kilo-lambda build 12-Sep-2018 15:30:25 - outertaper=['5klambda','3klambda','45.0deg'] build 12-Sep-2018 15:30:25 - outertaper=['10arcsec'] on-sky FWHM 10" build 12-Sep-2018 15:30:25 - outertaper=['300.0'] default units are meters build 12-Sep-2018 15:30:25 - in aperture plane build 12-Sep-2018 15:30:25 - innertaper -- uv-taper in center of uv-plane build 12-Sep-2018 15:30:25 - NOT YET IMPLEMENTED build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - restoringbeam -- Output Gaussian restoring beam for CLEAN image build 12-Sep-2018 15:30:25 - [bmaj, bmin, bpa] elliptical Gaussian restoring beam build 12-Sep-2018 15:30:25 - default units are in arc-seconds for bmaj,bmin, degrees build 12-Sep-2018 15:30:25 - for bpa default: restoringbeam=[]; Use PSF calculated build 12-Sep-2018 15:30:25 - from dirty beam. build 12-Sep-2018 15:30:25 - example: restoringbeam=['10arcsec'] circular Gaussian build 12-Sep-2018 15:30:25 - FWHM 10" example: build 12-Sep-2018 15:30:25 - restoringbeam=['10.0','5.0','45.0deg'] 10"x5" build 12-Sep-2018 15:30:25 - at 45 degrees build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - calready -- if True will create scratch columns if they are build 12-Sep-2018 15:30:25 - not there. And after clean completes the predicted model build 12-Sep-2018 15:30:25 - visibility is from the clean components are build 12-Sep-2018 15:30:25 - written to the ms. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - async -- Run asynchronously build 12-Sep-2018 15:30:25 - default = False; do not run asychronously build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - ====================================================================== build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - HINTS ON RUNNING WIDEFIELD build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 1. Decide if the images will be specified directly in the build 12-Sep-2018 15:30:25 - inputs or with an outlier file. For more than a few fields, build 12-Sep-2018 15:30:25 - an outlier file more convenient. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Direct Method: build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - cell = ['1.0arcsec', '1.0arcsec'] build 12-Sep-2018 15:30:25 - imagename = ['M1_0','M1_1','M1_2] build 12-Sep-2018 15:30:25 - imsize = [[1024,1024],[128,128],[128,128]] build 12-Sep-2018 15:30:25 - phasecenter = ['J2000 13h27m20.98 43d26m28.0', build 12-Sep-2018 15:30:25 - 'J2000 13h30m52.159 43d23m08.02', 'J2000 13h24m08.16 43d09m48.0'] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Text file method (in outlier.txt) build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - imagename = 'M1' build 12-Sep-2018 15:30:25 - outlierfile = 'outlier.txt' build 12-Sep-2018 15:30:25 - [phasecenter, imsize ignored] build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Contents of outlier.txt build 12-Sep-2018 15:30:25 - C 0 1024 1024 13 27 20.98 43 26 28.0 build 12-Sep-2018 15:30:25 - C 1 128 128 13 30 52.158 43 23 08.00 build 12-Sep-2018 15:30:25 - C 2 128 128 13 24 08.163 43 09 48.00 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - In both cases the following images will be made: build 12-Sep-2018 15:30:25 - M1_0.image, M1_1.image, M1_2.image cleaned images build 12-Sep-2018 15:30:25 - M1.0.model, M1_1.model, M1_2.model model images build 12-Sep-2018 15:30:25 - M1.0.residual, M1_1.residual, M1_2.residual residual images build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 2. Wprojection: It is fastest to use wprojection without faceting. build 12-Sep-2018 15:30:25 - ftmachine = 'wproject' build 12-Sep-2018 15:30:25 - wprojplane = NN build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - The value of NN should be chosen as small as possible to reduce build 12-Sep-2018 15:30:25 - execution time. The algorithm build 12-Sep-2018 15:30:25 - NN = BMAX(klambda) * imagewidth (arcmin)^2 / 600, with a minimum build 12-Sep-2018 15:30:25 - of 16, should be adequate. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 3. Depending on the memory of the computer, a limit of about build 12-Sep-2018 15:30:25 - 5000x5000 may occur for example if a computer has 2Gbyte of build 12-Sep-2018 15:30:25 - RAM. Also a 32-bit computer has a maximum limit of 2Gbyte build 12-Sep-2018 15:30:25 - memory usable per process, irrespective of how much physical build 12-Sep-2018 15:30:25 - RAM is present. Hence it is recommended to move to a 64-bit build 12-Sep-2018 15:30:25 - computer with more than 2 GByte of RAM for >5000x5000 images build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - 4. For data with extremely large 'w' values, i.e low frequency, build 12-Sep-2018 15:30:25 - long baseline and very widefield image, the wprojection build 12-Sep-2018 15:30:25 - convolution can be very large and either not fit in memory or build 12-Sep-2018 15:30:25 - slow for processing. In these cases you should consider using build 12-Sep-2018 15:30:25 - both ftmachine='wproject' and facets=xx where is 3. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/CMakeLists.txt b/gcwrap/tools/CMakeLists.txt build 12-Sep-2018 15:30:25 index 5c4d957..37271e2 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tools/CMakeLists.txt build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/CMakeLists.txt build 12-Sep-2018 15:30:25 @@ -121,6 +121,7 @@ casa_add_library( tools build 12-Sep-2018 15:30:25 synthesis/simulator_cmpt.cc build 12-Sep-2018 15:30:25 synthesis/synthesisimager_cmpt.cc build 12-Sep-2018 15:30:25 synthesis/synthesisdeconvolver_cmpt.cc build 12-Sep-2018 15:30:25 + synthesis/synthesismaskhandler_cmpt.cc build 12-Sep-2018 15:30:25 synthesis/synthesisnormalizer_cmpt.cc build 12-Sep-2018 15:30:25 synthesis/synthesisimstore_cmpt.cc build 12-Sep-2018 15:30:25 synthesis/synthesisiterbot_cmpt.cc build 12-Sep-2018 15:30:25 @@ -190,6 +191,7 @@ casa_add_tools( tools_swig tools_sources tools_py build 12-Sep-2018 15:30:25 synthesis/simulator.xml build 12-Sep-2018 15:30:25 synthesis/synthesisimager.xml build 12-Sep-2018 15:30:25 synthesis/synthesisdeconvolver.xml build 12-Sep-2018 15:30:25 + synthesis/synthesismaskhandler.xml build 12-Sep-2018 15:30:25 synthesis/synthesisnormalizer.xml build 12-Sep-2018 15:30:25 synthesis/synthesisimstore.xml build 12-Sep-2018 15:30:25 synthesis/synthesisiterbot.xml build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/images/image.xml b/gcwrap/tools/images/image.xml build 12-Sep-2018 15:30:25 index 1129dbf..25f3729 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tools/images/image.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/images/image.xml build 12-Sep-2018 15:30:25 @@ -865,8 +865,7 @@ print "\t----\t Intro Ex 10 \t----" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Construct a new image analysis tool using the specified image. build 12-Sep-2018 15:30:25 -(Also known as newimagefromfile.) build 12-Sep-2018 15:30:25 + Construct a new image analysis tool using the specified image. (Also known as newimagefromfile.) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -877,15 +876,13 @@ print "\t----\t Intro Ex 10 \t----" build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -This method is identical to ia.newimagefromfile(). The description of build 12-Sep-2018 15:30:25 -how it works is in the online help for that method. build 12-Sep-2018 15:30:25 +This method is identical to ia.newimagefromfile(). The description of how it works is in the help for that method. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Construct a new image analysis tool using the specified image. build 12-Sep-2018 15:30:25 -(Also known as newimage.) build 12-Sep-2018 15:30:25 + Construct a new image analysis tool using the specified image. (Also known as newimage.) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -898,11 +895,11 @@ how it works is in the online help for that method. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 This method returns an image analysis tool associated with the specified image. build 12-Sep-2018 15:30:25 Constructing a image analysis tool in addition to the default ia tool allows the build 12-Sep-2018 15:30:25 -user to operate on multiple images without having to close one build 12-Sep-2018 15:30:25 -before opening another. All ia.newimagefrom*() methods share this functionality. build 12-Sep-2018 15:30:25 +user to operate on multiple images simultaneously. All ia.newimagefrom*() build 12-Sep-2018 15:30:25 +methods share this behavior. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The parameter infile may refer to a CASA image, a Miriad image, or a FITS image. build 12-Sep-2018 15:30:25 -FITS images of types Float, Double, Long, and Short are supported. build 12-Sep-2018 15:30:25 +FITS images of types Float are supported. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 When finished with the newly created tool, the user should close it to free build 12-Sep-2018 15:30:25 up system resources (eg memory). build 12-Sep-2018 15:30:25 @@ -1514,85 +1511,87 @@ bigim.done() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Construct a \casa\ image from a numerical (integer or float) array build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Output image file name. Default is unset. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Numeric array build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Coordinate System. Default is unset. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Make a linear Coordinate System if csys not given build 12-Sep-2018 15:30:25 - false build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Overwrite (unprompted) pre-existing output file? build 12-Sep-2018 15:30:25 - false build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - Write image creation messages to logger build 12-Sep-2018 15:30:25 - true build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -This function converts a numerical (integer or float) numpy array of any size and build 12-Sep-2018 15:30:25 -dimensionality into a \casa\ image. It will create both float and complex valued images. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -The image analysis tool on which this method is called will reference the created image; build 12-Sep-2018 15:30:25 -if this tool referenced another image before this call, that image will no longer be referenced build 12-Sep-2018 15:30:25 -by the tool after the creation of the new image. If you would rather have a new image analysis build 12-Sep-2018 15:30:25 -tool returned, keeping the one on which this method is called unaltered, use newimagefromarray() build 12-Sep-2018 15:30:25 -instead. If {\stfaf outfile} is given, the image is written to disk, if not, the image tool on build 12-Sep-2018 15:30:25 -which this method was called will reference a temporary image (either in memory or on disk, build 12-Sep-2018 15:30:25 -depending on its size) that will be deleted when the tool build 12-Sep-2018 15:30:25 -is closed. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -Float valued images are produced from real-valued arrays. Complex-valued images are produced from build 12-Sep-2018 15:30:25 -complex-valued arrays. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Construct a \casa\ image from a numerical numpy array build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Output image file name. Default is unset. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Numeric array build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Coordinate System. Default is to construct an appropriate coordinate system given the array shape. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Make a linear Coordinate System if csys not given build 12-Sep-2018 15:30:25 + false build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Overwrite the output image if it already exists? build 12-Sep-2018 15:30:25 + false build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Write image creation messages to logger build 12-Sep-2018 15:30:25 + true build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Pixel data type to write. 'f' (float precision) or 'd' (double precision) build 12-Sep-2018 15:30:25 + f build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -The coordinate system, provided as a coordsys \tool converted to a record build 12-Sep-2018 15:30:25 -is optional. If you provide it, it must have the same number of dimensions build 12-Sep-2018 15:30:25 -as the pixels array (see also coordsys). build 12-Sep-2018 15:30:25 -Call the naxes() method on the coordinate system tool to see how many dimensions the coordinate build 12-Sep-2018 15:30:25 -system has. A coordinate system can be created from scratch using the coordinate system (cs) tool and build 12-Sep-2018 15:30:25 -methods therein, but often users prefer to use a coordinate system from an already existing image. build 12-Sep-2018 15:30:25 -This can be gotten using ia.coordsys() which returns a coordinate system tool. A torecord() call build 12-Sep-2018 15:30:25 -on that tool will result in a python dictionary describing the coordinate system which is the build 12-Sep-2018 15:30:25 -necessary format for the csys input parameter of ia.fromarray(). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -If csys is not specified, a default coordinate system build 12-Sep-2018 15:30:25 -is created. If {\stfaf linear=F} (the default) the created coordinate system will have build 12-Sep-2018 15:30:25 -standard RA/DEC/Stokes/Spectral Coordinate axes depending upon build 12-Sep-2018 15:30:25 -the shape of the {\stfaf pixels} array (Stokes axis must be no longer build 12-Sep-2018 15:30:25 -than 4 pixels and you may find the spectral axis preceding the build 12-Sep-2018 15:30:25 -Stokes axis if say, {\cf shape=[64,64,32,4]}). Extra dimensions are build 12-Sep-2018 15:30:25 -given linear coordinates. If {\stfaf linear=T}, then all the resulting coordinates build 12-Sep-2018 15:30:25 -are linear with the axes represent lengths. In this case each axis will have a value build 12-Sep-2018 15:30:25 -of 0.0 at its center pixel. The increment of each axis will be 1.0 km. build 12-Sep-2018 15:30:25 +This application converts a numerical numpy array of any size and dimensionality build 12-Sep-2018 15:30:25 +into a CASA image. It will create float, double, complex-float, and complex-double build 12-Sep-2018 15:30:25 +valued images. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The image analysis tool on which this method is called will reference the created build 12-Sep-2018 15:30:25 +image; if this tool referenced another image before this call, that image will no build 12-Sep-2018 15:30:25 +longer be referenced by the tool after the creation of the new image. If you build 12-Sep-2018 15:30:25 +would rather have a new image analysis tool returned, keeping the one on which build 12-Sep-2018 15:30:25 +this method is called unaltered, use newimagefromarray() instead. If outfile is build 12-Sep-2018 15:30:25 +specified, a persistent image is written to disk, if not, the image tool on build 12-Sep-2018 15:30:25 +which this method was called will reference a temporary image (either in memory build 12-Sep-2018 15:30:25 +or on disk, depending on its size) that will be deleted when the tool is closed. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The type parameter controls the data type/precision of the pixel values of the build 12-Sep-2018 15:30:25 +created image. 'f' indicates that float precision point (32 bit precision) pixel build 12-Sep-2018 15:30:25 +values should be writted. 'd' indicates that double precision (64 bit precision) build 12-Sep-2018 15:30:25 +pixel values should be written. If the input array has complex (as opposed to build 12-Sep-2018 15:30:25 +real) values, then complex pixel values, with each of the real and imaginary build 12-Sep-2018 15:30:25 +parts having the specified precision, will be written. Array values will be cast build 12-Sep-2018 15:30:25 +automatically to the specified precision, so that the precision of the input build 12-Sep-2018 15:30:25 +array values may be increased, decreased, or unchanged depending on the input build 12-Sep-2018 15:30:25 +array type. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The coordinate system, provided as a a dictionary (use eg, cs.torecord() to do build 12-Sep-2018 15:30:25 +that), is optional. If specified, it must have the same number of dimensions build 12-Sep-2018 15:30:25 +as the pixels array. Call the naxes() method on the coordinate system tool to build 12-Sep-2018 15:30:25 +see how many dimensions the coordinate system has. A coordinate system can be build 12-Sep-2018 15:30:25 +created from scratch using the coordinate system (cs) tool and methods therein, build 12-Sep-2018 15:30:25 +but often users prefer to use a coordinate system from an already existing image. build 12-Sep-2018 15:30:25 +This can be gotten using ia.coordsys() which returns a coordinate system tool. build 12-Sep-2018 15:30:25 +A torecord() call on that tool will result in a python dictionary describing build 12-Sep-2018 15:30:25 +the coordinate system which is the necessary format for the csys input parameter build 12-Sep-2018 15:30:25 +of ia.fromarray(). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +If csys is not specified, a default coordinate system will be created. If build 12-Sep-2018 15:30:25 +linear=False (the default), the created coordinate system will have standard build 12-Sep-2018 15:30:25 +RA/DEC/Stokes/Spectral Coordinate axes depending upon the shape of the pixels build 12-Sep-2018 15:30:25 +array (Stokes axis must be no longer than 4 pixels and the spectral axis may build 12-Sep-2018 15:30:25 +precede the Stokes axis if eg, shape=[64,64,32,4]. Extra dimensions are given build 12-Sep-2018 15:30:25 +linear coordinates. If linear=True, then all the resulting coordinates build 12-Sep-2018 15:30:25 +are linear with the axes represent lengths. In this case each axis will have a build 12-Sep-2018 15:30:25 +value of 0.0 at its center pixel. The increment of each axis will be 1.0 km. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The method returns True if creation of the image was successful, False otherwise, build 12-Sep-2018 15:30:25 -so you can check programmatically if the image creation was successful. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 +so a check can be made programmatically if the image creation was successful. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -2100,31 +2099,29 @@ of the image, and all pixels of other axes. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -This function creates a CASA image with the specified shape. All build 12-Sep-2018 15:30:25 -the pixel values in the image are set to 0. One may create an image build 12-Sep-2018 15:30:25 -with float precision pixels (type='f'), complex float precision pixels build 12-Sep-2018 15:30:25 -(type='c'), double precision pixels (type='d'), or complex double build 12-Sep-2018 15:30:25 -precision pixels ('cd'). To use a numpy array of values to create an build 12-Sep-2018 15:30:25 -image, use ia.fromarray(). To make a 2-D image from a packaged FITS build 12-Sep-2018 15:30:25 -file, use ia.maketestimage(). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -If outfile is given, the image is written to the specified disk build 12-Sep-2018 15:30:25 -file. If outfile is unset, the image analysis tool is associated with build 12-Sep-2018 15:30:25 -a temporary image. This temporary image may be in memory or on disk, build 12-Sep-2018 15:30:25 -depending on its size. When you close the image analysis tool (with build 12-Sep-2018 15:30:25 -the ia.close() method, the temporary image is deleted. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -The coordinate system, provided as a coordinate system tool record, is build 12-Sep-2018 15:30:25 -optional. If provided, it must be dimensionally consistent with the build 12-Sep-2018 15:30:25 -specified shape. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -If the coordinate system is not provided, a default coordinate system build 12-Sep-2018 15:30:25 -will be created. If linear=False (the default), then it is a build 12-Sep-2018 15:30:25 -standard RA/DEC/Stokes/Spectral coordinate system depending exactly upon build 12-Sep-2018 15:30:25 -the shape (the Stokes axis must be no longer than 4 pixels and spectral build 12-Sep-2018 15:30:25 -axis may occur prior to the Stokes axis if eg, shape=[64,64,32,4]. Extra build 12-Sep-2018 15:30:25 -dimensions are given linear coordinates. If linear=True, then the build 12-Sep-2018 15:30:25 -coordinate system will have linear coordinates. build 12-Sep-2018 15:30:25 +This function creates a CASA image with the specified shape. All the pixel build 12-Sep-2018 15:30:25 +values in the image are set to 0. One may create an image with float precision build 12-Sep-2018 15:30:25 +pixels (type='f'), complex float precision pixels (type='c'), double precision build 12-Sep-2018 15:30:25 +pixels (type='d'), or complex double precision pixels ('cd'). To use a numpy build 12-Sep-2018 15:30:25 +array of values to create an image, use ia.fromarray(). To make a 2-D image from build 12-Sep-2018 15:30:25 +a packaged FITS file, use ia.maketestimage(). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +If outfile is given, the image is written to the specified disk file. If build 12-Sep-2018 15:30:25 +outfile is unset, the image analysis tool is associated with a temporary image. build 12-Sep-2018 15:30:25 +This temporary image may be in memory or on disk, depending on its size. When build 12-Sep-2018 15:30:25 +you close the image analysis tool (with the ia.close() method, the temporary build 12-Sep-2018 15:30:25 +image is deleted. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The coordinate system, provided as a coordinate system tool record, is optional. build 12-Sep-2018 15:30:25 +If provided, it must be dimensionally consistent with the specified shape. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +If the coordinate system is not provided, a default coordinate system will be build 12-Sep-2018 15:30:25 +created. If linear=False (the default), then it is a build 12-Sep-2018 15:30:25 +standard RA/DEC/Stokes/Spectral coordinate system depending exactly upon the build 12-Sep-2018 15:30:25 +shape (the Stokes axis must be no longer than 4 pixels and spectral axis may build 12-Sep-2018 15:30:25 +occur prior to the Stokes axis if eg, shape=[64,64,32,4]. Extra dimensions are build 12-Sep-2018 15:30:25 +given linear coordinates. If linear=True, then the coordinate system will have build 12-Sep-2018 15:30:25 +linear coordinates. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 The method returns True if successful, False otherwise. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -3078,30 +3075,24 @@ This shows a mixed type expression. The real part of the complex image build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -This method is used to create a new \pixelmask\ via a Boolean LEL expression. build 12-Sep-2018 15:30:25 -This gives you much more scope than the simple build 12-Sep-2018 15:30:25 -set and build 12-Sep-2018 15:30:25 -putregion functions. build 12-Sep-2018 15:30:25 -Both float and complex valued images are supported. build 12-Sep-2018 15:30:25 +This method is used to create a new pixel mask via a boolean LEL expression. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -See http://casa.nrao.edu/aips2_docs/notes/223/index.shtml build 12-Sep-2018 15:30:25 -which describes the the syntax and functionality of LEL in detail. Also build 12-Sep-2018 15:30:25 -in this document is a description of ways to escape image names that build 12-Sep-2018 15:30:25 -contain certain non-alphanumeric characters so they are compatible build 12-Sep-2018 15:30:25 -with LEL syntax. build 12-Sep-2018 15:30:25 +See http://casa.nrao.edu/aips2_docs/notes/223/index.shtml which describes the build 12-Sep-2018 15:30:25 +the syntax and functionality of LEL in detail. Also in this document is a build 12-Sep-2018 15:30:25 +description of ways to escape image names that contain certain non-alphanumeric build 12-Sep-2018 15:30:25 +characters so they are compatible with LEL syntax. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -If the expression is not a scalar, the shapes and coordinates of the build 12-Sep-2018 15:30:25 -image and expression must conform. If the expression is a scalar build 12-Sep-2018 15:30:25 -then the entire \pixelmask\ will be set to that value. build 12-Sep-2018 15:30:25 +If the expression is not a scalar, the shapes and coordinates of the image and build 12-Sep-2018 15:30:25 +expression must conform. If the expression is a scalar then the entire pixel build 12-Sep-2018 15:30:25 +mask will be set to that value. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -By default (argument {\stfaf name}) the name of a new \pixelmask\ is made up build 12-Sep-2018 15:30:25 -for you. However, if you specify a \pixelmask\ name (use function build 12-Sep-2018 15:30:25 -summary or build 12-Sep-2018 15:30:25 -maskhandler to see the mask names) build 12-Sep-2018 15:30:25 -then it is used. If the \pixelmask\ already exists, it is overwritten. build 12-Sep-2018 15:30:25 +By specifying the name parameter to be an empty string, the method automatically build 12-Sep-2018 15:30:25 +determines the name of the output mask. Otherwise, the output mask is named the build 12-Sep-2018 15:30:25 +value specified by the name parameter. If a mask by that name already exists, build 12-Sep-2018 15:30:25 +it is overwritten. Use method ia.summary() to view existing mask names. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -You can specify whether the new \pixelmask\ should be the default mask or not. build 12-Sep-2018 15:30:25 -By default, it is made the default \pixelmask\ ! build 12-Sep-2018 15:30:25 +The asdefault parameter specifies if the new mask should be set as the default build 12-Sep-2018 15:30:25 +pixel mask of the image. This value is set to True by default. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -4469,6 +4460,7 @@ We use the Componentlist GUI to look at the strongest component. build 12-Sep-2018 15:30:25 Region selection. Default is to use the full image. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 path build 12-Sep-2018 15:30:25 + string build 12-Sep-2018 15:30:25 record build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -5607,37 +5599,30 @@ ia.close() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -This function recovers the image pixel or \pixelmask\ values in the build 12-Sep-2018 15:30:25 -given region-of-interest. build 12-Sep-2018 15:30:25 -Regardless of the shape of the {\stfaf region} you have specified, the build 12-Sep-2018 15:30:25 -shape of the {\stfaf pixels} and {\stfaf pixelmask} arrays must build 12-Sep-2018 15:30:25 -necessarily be the bounding box of the specified region. If the region build 12-Sep-2018 15:30:25 -extends beyond the image, it is truncated. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -Recall that the recovered \pixelmask\ will reflect both the \pixelmask\ build 12-Sep-2018 15:30:25 -stored in the image, and the \region\ (their masks are `anded') -- see build 12-Sep-2018 15:30:25 -the \htmlref{discussion}{IMAGE:MASKSANDREGIONS} in the introduction build 12-Sep-2018 15:30:25 -about this. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -The argument {\stfaf axes} can be used to reduce the dimensionality of build 12-Sep-2018 15:30:25 -the output array. It specifies which pixel axes of the image to build 12-Sep-2018 15:30:25 -average the data over. For example, consider a 3-D image. With build 12-Sep-2018 15:30:25 -{\stfaf axes=[0,1]} and all other arguments left at their defaults, build 12-Sep-2018 15:30:25 -the result would be a 1-D vector, a profile along the third axis, with build 12-Sep-2018 15:30:25 +This function recovers the image pixel or pixel mask values in the given region build 12-Sep-2018 15:30:25 +of interest. Regardless of the shape of the specified, the shape of the pixels and build 12-Sep-2018 15:30:25 +pixelmask arrays must necessarily be the bounding box of the specified region. If build 12-Sep-2018 15:30:25 +the region extends beyond the image, it is truncated. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +Recall that the recovered pixelmask will reflect both the pixelmask stored in the build 12-Sep-2018 15:30:25 +image, and the region (their masks are `anded' together). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The argument axes can be used to reduce the dimensionality of the output array. It build 12-Sep-2018 15:30:25 +specifies which pixel axes of the image to average the data over. For example, build 12-Sep-2018 15:30:25 +consider a 3-D image. With axes=[0,1] and all other arguments left at their build 12-Sep-2018 15:30:25 +defaults, the result would be a 1-D vector, a profile along the third axis, with build 12-Sep-2018 15:30:25 the data averaged over the first two axes. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -This function differs in three ways from {\stff getchunk}. First, the build 12-Sep-2018 15:30:25 -region can be much more complex (e.g. a union of polygons) than the build 12-Sep-2018 15:30:25 -simple {\stfaf blc}, {\stfaf trc}, and {\stfaf inc} of {\stff build 12-Sep-2018 15:30:25 -getchunk} (although such a region can be created of course). Second, build 12-Sep-2018 15:30:25 -it can be used to recover the \pixelmask\ or the pixels. Third, it is build 12-Sep-2018 15:30:25 -less efficient than {\stff getchunk} for doing the same thing as build 12-Sep-2018 15:30:25 -{\stff getchunk}. So if you are interested in say, iterating through build 12-Sep-2018 15:30:25 -an image, getting a regular hyper-cube of pixels and doing something build 12-Sep-2018 15:30:25 -with them, then {\stff getchunk} will be faster. This would be build 12-Sep-2018 15:30:25 -especially noticeable if you iterated line by line through a large build 12-Sep-2018 15:30:25 -image. build 12-Sep-2018 15:30:25 +This method differs in a couple of ways from the getchunk() method. For example, build 12-Sep-2018 15:30:25 +the specified region can be much more complex (eg, a union of polygons) than the build 12-Sep-2018 15:30:25 +limited, simple regions that can be specified in getchunk(), which must be build 12-Sep-2018 15:30:25 +rectangular. On the other hand, getregion() is less effective than getchunk() build 12-Sep-2018 15:30:25 +for the same region specification. So if one is interested in say, iterating build 12-Sep-2018 15:30:25 +through an image, getting a regular hyper-cube of pixels and doing something build 12-Sep-2018 15:30:25 +with them, then getchunk() will be faster. This would be especially noticeable if build 12-Sep-2018 15:30:25 +you iterated line by line through a large image (and of course, in both cases, build 12-Sep-2018 15:30:25 +retrieving very large regions will become very resource intensive, as these build 12-Sep-2018 15:30:25 +returned arrays are completely stored in memory). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -5822,24 +5807,28 @@ ia.done() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -This function returns a 1-D slice (the pixels and opionally the pixel mask) from the build 12-Sep-2018 15:30:25 -\imagefile. The slice is constrained to lie in a plane of two cardinal axes build 12-Sep-2018 15:30:25 -(e.g. XY or YZ). At some point this constraint will be relaxed. build 12-Sep-2018 15:30:25 -A range of interpolation schemes are available. build 12-Sep-2018 15:30:25 +This function returns a 1-D slice (the pixels and opionally the pixel mask) from build 12-Sep-2018 15:30:25 +the attached image. The slice is constrained to lie in a plane of two cardinal build 12-Sep-2018 15:30:25 +axes (e.g. XY or YZ). Interpolation is permitted between pixels, and a set of build 12-Sep-2018 15:30:25 +interpolation schemes is available. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The slice is specified as a polyline giving the x and y coordinates and the axes build 12-Sep-2018 15:30:25 +of the plane holding that slice. The absolute pixel coordinates of the other build 12-Sep-2018 15:30:25 +axes may be specified using the coord parameter. If not specified, these values build 12-Sep-2018 15:30:25 +default to pixel 0 on the relevant axes. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -You specify the slice as a polyline giving the x ({\stfaf x}) and y build 12-Sep-2018 15:30:25 -({\stfaf y}) coordinates and the axes of the plane holding that slice build 12-Sep-2018 15:30:25 -({\stfaf axes}). As well, you must specify the absolute pixel build 12-Sep-2018 15:30:25 -coordinates of the other axes ({\stfaf coord}). This defaults to the build 12-Sep-2018 15:30:25 -first pixel (e.g. first plane). build 12-Sep-2018 15:30:25 +The npts parameter allows the number of values to be returned. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -The return value is a record with fields 'pixels' (interpolated intensity), build 12-Sep-2018 15:30:25 +The method parameter allows specification of the interpolation method to be build 12-Sep-2018 15:30:25 +used. Allowed values are 'nearest', 'linear', and 'cubic'. In the case of an build 12-Sep-2018 15:30:25 +image with complex valued pixels, the interpolation is done independently on the build 12-Sep-2018 15:30:25 +real and imaginary values. For example, the linearly interpolated value midway build 12-Sep-2018 15:30:25 +between pixels with values of 1 + 5j and 2 + 7j would be 1.5 + 6j. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The return value is a dictionary with keys 'pixels' (interpolated pixel values), build 12-Sep-2018 15:30:25 'mask' (interpolated mask), 'xpos' (x-location in absolute pixel coordinates), build 12-Sep-2018 15:30:25 'ypos' (y-location in absolute pixel coordinates), 'distance' (distance along build 12-Sep-2018 15:30:25 -slice in pixels), 'axes' (the x and y axes of slice). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 +slice in pixels), and 'axes' (the x and y axes of slice). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -6185,21 +6174,14 @@ ia.close() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -This function allows you to access the history file. build 12-Sep-2018 15:30:25 +This method interogates the history of an image. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -If {\stfaf browse=F} and {\stfaf list=F}, the history is returned by build 12-Sep-2018 15:30:25 -the function as a vector of strings. If {\stfaf list=T}, the history build 12-Sep-2018 15:30:25 -is sent to the logger. build 12-Sep-2018 15:30:25 +The history is returned as an array of strings, where each element represents build 12-Sep-2018 15:30:25 +an individual history entry. If True, the list parameter will also cause the build 12-Sep-2018 15:30:25 +history to be emitted by the logger. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -\casa\ tools that modify the MeasurementSet or an image file will save build 12-Sep-2018 15:30:25 -history information. Also, you can directly annotate the history file build 12-Sep-2018 15:30:25 -with the function sethistory. History build 12-Sep-2018 15:30:25 -from \fits\ file conversions is also stored and listable here. build 12-Sep-2018 15:30:25 +Note that entries can be permanently added to the image history by using the build 12-Sep-2018 15:30:25 +ia.sethistory() method. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -6295,8 +6277,7 @@ ia.close() # close default tool and build 12-Sep-2018 15:30:25 Bool build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -This function can be used to find out whether the Image \tool\ build 12-Sep-2018 15:30:25 -is associated with an image or not. build 12-Sep-2018 15:30:25 +This method returns True if the image tool has an attached image. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -6320,7 +6301,6 @@ ia.close() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Is the image persistent? build 12-Sep-2018 15:30:25 @@ -6543,63 +6523,45 @@ ia.makefloat('abs.im', 'complex.im', 'abs') # creates abs.im build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -This function is used to manage build 12-Sep-2018 15:30:25 -or handle \pixelmasks\ . A \casa\ image may contain zero, one or more build 12-Sep-2018 15:30:25 -\pixelmasks. Any of these masks can be designated the default build 12-Sep-2018 15:30:25 -\pixelmask. The default mask is acted upon by \casa\ applications. build 12-Sep-2018 15:30:25 -For example, if you ask for statistics from an image, pixels which are build 12-Sep-2018 15:30:25 -masked as bad (F) will be excluded from the calculations. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -This function has an argument ({\stfaf op}) that specifies the build 12-Sep-2018 15:30:25 -behaviour. In all cases, you can shorten the operation string to three build 12-Sep-2018 15:30:25 -characters. It is not the job of this function to modify the values of build 12-Sep-2018 15:30:25 -masks. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -\begin{itemize} build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -\item{default - } this retrieves the name of the default \pixelmask\ build 12-Sep-2018 15:30:25 -as the return value of the function call. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -\item{get - } this retrieves the name(s) of the existing \pixelmasks\ build 12-Sep-2018 15:30:25 -as the return value of the function call (string or vector of strings). build 12-Sep-2018 15:30:25 +This method is used to manage or handle pixel masks . A CASA image may contain build 12-Sep-2018 15:30:25 +zero, one, or more pixel masks. Any of these masks can be designated the build 12-Sep-2018 15:30:25 +default pixel mask assoicated with the given image. The default mask is acted build 12-Sep-2018 15:30:25 +upon and/or used by CASA applications. For example, if ia.statistics() will build 12-Sep-2018 15:30:25 +exclude pixels which are masked as bad (False) from the calculations. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -\item{set - } this lets you change the default \pixelmask\ to that given by the build 12-Sep-2018 15:30:25 -{\stfaf name} argument. If {\stfaf name} is empty, then the default build 12-Sep-2018 15:30:25 -mask is unset (i.e. an all good mask is effectively applied). build 12-Sep-2018 15:30:25 +This method does not modify the individual boolean values of any masks. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -\item{delete - } this lets you delete the \pixelmasks\ specified by the build 12-Sep-2018 15:30:25 -{\stfaf name} argument. To delete more than one mask, {\stfaf name} can build 12-Sep-2018 15:30:25 -be a vector of strings. Any supplied \pixelmask\ name that does not build 12-Sep-2018 15:30:25 -exist is silently ignored. build 12-Sep-2018 15:30:25 +The op parameter is used to specify the behaviour. In all cases, the specified build 12-Sep-2018 15:30:25 +operation can be specified by a three character string. Supported values of the build 12-Sep-2018 15:30:25 +op parameter are: build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -\item{rename - } this lets you rename the mask specified by {\stfaf name[0]} build 12-Sep-2018 15:30:25 -to {\stfaf name[1]}. Thus the {\stfaf name} argument must be a vector of build 12-Sep-2018 15:30:25 -length 2. build 12-Sep-2018 15:30:25 +'default': Retrieve the name of the default pixel mask associated with the build 12-Sep-2018 15:30:25 +image. A one element array containing the empty string is returned if the image build 12-Sep-2018 15:30:25 +has no default mask. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -\item{copy - } this lets you copy a mask to another in the same image, or build 12-Sep-2018 15:30:25 -copy a mask from another image into this image. Thus the {\stfaf name} build 12-Sep-2018 15:30:25 -argument must be a vector of length 2. build 12-Sep-2018 15:30:25 +'get': Retrieve the name(s) of all the existing pixel masks. Note that the build 12-Sep-2018 15:30:25 +ia.summary() method may also be used to view the pixel masks associated with an build 12-Sep-2018 15:30:25 +image. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -For the first case, the first element of {\stfaf name} must be the name build 12-Sep-2018 15:30:25 -of the mask to copy, and the second element must be the name of the build 12-Sep-2018 15:30:25 -\pixelmask\ to which it will be copied. build 12-Sep-2018 15:30:25 +'set': Set the default pixel mask to the value specified by the name parameter. build 12-Sep-2018 15:30:25 +If the value of the name parameter is the empty string, then the default mask is build 12-Sep-2018 15:30:25 +unset (ie, all the pixels will be treated as being unmasked). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -For the second case, the first element of {\stfaf name} must be the name build 12-Sep-2018 15:30:25 -of the input image and \pixelmask\ with a colon delimiter (e.g. {\cf build 12-Sep-2018 15:30:25 -hcn:mask2}). The second element must be the name of the \pixelmask\ to build 12-Sep-2018 15:30:25 -which the input \pixelmask\ will be copied. build 12-Sep-2018 15:30:25 +'delete': Delete the pixel mask(s) specified by the name parameter. To delete build 12-Sep-2018 15:30:25 +more than one mask, the name parameter can be an array of strings. Any supplied build 12-Sep-2018 15:30:25 +pixel mask name that does not exist is silently ignored. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -\end{itemize} build 12-Sep-2018 15:30:25 +'rename': Rename the mask specified as the first element of the name array build 12-Sep-2018 15:30:25 +parameter (name[0]) to the value specified in the second element of the name build 12-Sep-2018 15:30:25 +array parameter (name[1]]. In this case, the name array parameter must have build 12-Sep-2018 15:30:25 +exactly two elements. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -Use the summary function to see the build 12-Sep-2018 15:30:25 -available \pixelmasks. You can do this either via the logger display, or via build 12-Sep-2018 15:30:25 -the returned record, which contains the mask names. In the logger display, build 12-Sep-2018 15:30:25 -any \pixelmask\ which is not the default mask is listed in square brackets. If build 12-Sep-2018 15:30:25 -a default mask is set, it is listed first, and is not enclosed in square build 12-Sep-2018 15:30:25 -brackets. build 12-Sep-2018 15:30:25 +'copy': Copy the mask specified in the first element of the name array build 12-Sep-2018 15:30:25 +parameter (name[0]) to the a mask name specified in the second element of the build 12-Sep-2018 15:30:25 +name array parameter (name[1]]. In this case, the name array parameter must have build 12-Sep-2018 15:30:25 +exactly two elements. A mask from another image can be copied by using the build 12-Sep-2018 15:30:25 +imagename:maskname syntax for the first element in the name array, eg, build 12-Sep-2018 15:30:25 +'myimage:mask2'. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -7578,7 +7540,7 @@ ia.close() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 This method puts an array into the image (which must be writable, eg it build 12-Sep-2018 15:30:25 -will fail on FITS images). If there is a default pixel mask, it is build 12-Sep-2018 15:30:25 +will fail on FITS images). If there is a default pixel mask, it is build 12-Sep-2018 15:30:25 ignored. It is the complement of the getchunk() method. The blc, trc, build 12-Sep-2018 15:30:25 and increment (inc) may be specified. If they are unspecified, they build 12-Sep-2018 15:30:25 default to the beginning of the image and an increment of one. build 12-Sep-2018 15:30:25 @@ -7737,38 +7699,37 @@ ia.close() build 12-Sep-2018 15:30:25 T or fail build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -This function replaces data and/or \pixelmask\ values in the image in build 12-Sep-2018 15:30:25 -the specified \region. The {\stfaf pixels} and/or {\stfaf pixelmask} build 12-Sep-2018 15:30:25 -arrays must be the shape of the bounding box, and the whole bounding box build 12-Sep-2018 15:30:25 -is replaced in the image. The \region\ is really only used to specify build 12-Sep-2018 15:30:25 -the bounding box. If the region extends beyond the image, it is build 12-Sep-2018 15:30:25 -truncated. If the {\stfaf pixels} or {\stfaf pixelmask} array shapes do not build 12-Sep-2018 15:30:25 -match the bounding box, an error will result. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -When you put a \pixelmask, it either replaces the current default \pixelmask, or build 12-Sep-2018 15:30:25 -is created. The \pixelmask\ is put before the pixels. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -The argument {\stfaf usemask} is only relevant when you are putting build 12-Sep-2018 15:30:25 -pixel values and there is a \pixelmask\ (meaning also the one you might have build 12-Sep-2018 15:30:25 -just put in place). If {\stfaf usemask=T} then only pixels for which build 12-Sep-2018 15:30:25 -the mask is good (T) are altered. If {\stfaf usemask=F} then all the build 12-Sep-2018 15:30:25 -pixels in the region are altered - the mask is ignored. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -The argument {\stfaf replicate} can be used to replicate the array build 12-Sep-2018 15:30:25 -throughout the image (from the blc to the trc). For example, if you build 12-Sep-2018 15:30:25 -provide a 2D array to a 3D image, you can replicate it through the third build 12-Sep-2018 15:30:25 -axis by setting {\stfaf replicate=T}. The replication build 12-Sep-2018 15:30:25 -is done in the specified {\stfaf region}. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -The argument {\stfaf locking} controls two things. If True, then build 12-Sep-2018 15:30:25 -after the function is called, the image is unlocked (so some other build 12-Sep-2018 15:30:25 -process can acquire a lock) and it is indicated that the image has build 12-Sep-2018 15:30:25 -changed. The reason for having this argument is build 12-Sep-2018 15:30:25 -that the unlocking and updating processes are quite expensive. If you build 12-Sep-2018 15:30:25 -are repeatedly calling {\stff putregion} in a for loop, you would be build 12-Sep-2018 15:30:25 -advised to use this switch (and to consider using {\stff putchunk}). build 12-Sep-2018 15:30:25 +This function replaces data and/or pixel mask values in the image in the build 12-Sep-2018 15:30:25 +specified region. The pixels and/or pixelmask arrays must be the shape of build 12-Sep-2018 15:30:25 +the bounding box, and the whole bounding box is replaced in the image. The build 12-Sep-2018 15:30:25 +region is only used to specify the bounding box. If the region extends build 12-Sep-2018 15:30:25 +beyond the image, it is truncated. If the pixels or pixelmask array shapes build 12-Sep-2018 15:30:25 +do not match the bounding box, an error will result. Values in the pixels build 12-Sep-2018 15:30:25 +array must share the same domain as the pixel values in the image. If the build 12-Sep-2018 15:30:25 +pixels array contains real values and the image pixels contain complex build 12-Sep-2018 15:30:25 +values (or vice versa), an exception will be thrown. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +When you put a pixel mask, it either replaces the current default pixel mask, build 12-Sep-2018 15:30:25 +or is created. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The usemask parameter is only relevant when you are putting pixel values and build 12-Sep-2018 15:30:25 +there is a pixel mask (meaning also the one you might have just put in place). build 12-Sep-2018 15:30:25 +If usemask=True, then only pixels for which the mask is good (True) are build 12-Sep-2018 15:30:25 +altered. If usemask=False, then all the pixels in the region are altered. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The replicate parameter can be used to replicate the array throughout the build 12-Sep-2018 15:30:25 +image (from the blc to the trc). For example, if a two dimensional array is build 12-Sep-2018 15:30:25 +provided for a three dimensional image, it can be replicated along the third build 12-Sep-2018 15:30:25 +axis by setting replicate=True. The replication is done in the specified build 12-Sep-2018 15:30:25 +region. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The locking parameter controls two things. If True, then after the method build 12-Sep-2018 15:30:25 +is called, the image is unlocked (so some other process can acquire a lock) build 12-Sep-2018 15:30:25 +and it is indicated that the image has changed. The reason for this build 12-Sep-2018 15:30:25 +parameter is that the unlocking and updating processes are quite expensive. build 12-Sep-2018 15:30:25 +If putregion() is being called multiple times, in a for loop, for example, build 12-Sep-2018 15:30:25 +it is recommended to set locking=True (and to consider using putchunk() build 12-Sep-2018 15:30:25 +instead). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 See the related functions putchunk, build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -This function regrids the current image onto a grid specified by the build 12-Sep-2018 15:30:25 -given Coordinate System. You can also specify the shape of the build 12-Sep-2018 15:30:25 -output image. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -The Coordinate System must be given via a Coordsys \tool\ (using build 12-Sep-2018 15:30:25 -coordsys.torecord()). It is optional; if not specified, the Coordinate build 12-Sep-2018 15:30:25 -System from the input image (i.e. the one to which you are applying build 12-Sep-2018 15:30:25 -the regrid function) is taken. The order of the coordinates and axes build 12-Sep-2018 15:30:25 -in the output image is always the same as the input image. It simply build 12-Sep-2018 15:30:25 -'finds' the relevant coordinate in the supplied Coordinate System in build 12-Sep-2018 15:30:25 -order to figure out the regridding parameters. The supplied build 12-Sep-2018 15:30:25 -Coordinate System must have at least as many coordinates as are build 12-Sep-2018 15:30:25 -required to accomodate the axes you are regridding (e.g. if you build 12-Sep-2018 15:30:25 -regrid the first two axes, and these belong to a Direction Coordinate, build 12-Sep-2018 15:30:25 -you need one Direction Coordinate in the supplied Coordinate System). build 12-Sep-2018 15:30:25 -Coordinates pertaining to axes that are not being regridded are build 12-Sep-2018 15:30:25 -supplied from the input image, not the given Coordinate System. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -Reference changes are handled (e.g. J2000 to B1950, LSR to TOPO). In build 12-Sep-2018 15:30:25 -general, the conversion machinery attempts to work out how sophisticated build 12-Sep-2018 15:30:25 -it needs to be (e.g. am I regridding LSR to LSR or LSR to TOPO). build 12-Sep-2018 15:30:25 -However, it errs on the side of conservatism so that it can be that the build 12-Sep-2018 15:30:25 -conversion machine requires more information than it actually needs. build 12-Sep-2018 15:30:25 -For full frame conversions, one needs to know things like location on build 12-Sep-2018 15:30:25 -earth (e.g. observatory), direction of observation, and time of build 12-Sep-2018 15:30:25 -observation. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -If you get the above errors and you {\bf are} doing a frame conversion, build 12-Sep-2018 15:30:25 -then that means you must insert some extra information into the build 12-Sep-2018 15:30:25 -Coordinate System of your image. Most likely it's the time build 12-Sep-2018 15:30:25 -(coordsys.setepoch) and location build 12-Sep-2018 15:30:25 -(coordsys.settelescope) that are build 12-Sep-2018 15:30:25 -missing. If you get these errors and you {\bf know} that you are not build 12-Sep-2018 15:30:25 -specifying a frame change (e.g. regrid LSR to LSR) then try setting build 12-Sep-2018 15:30:25 -{\stfaf doref=F}. This will (silently) bypass all possible frame build 12-Sep-2018 15:30:25 -conversions. Note that if you {\bf are} requesting a frame conversion build 12-Sep-2018 15:30:25 -and you set {\stfaf doref=F} you are doing a bad thing (and you will build 12-Sep-2018 15:30:25 -get no warnings). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -If you regrid a plane holding a Direction Coordinate and the units are build 12-Sep-2018 15:30:25 -Jy/pixel then the output is scaled to conserve flux (roughly; just one build 12-Sep-2018 15:30:25 -scale factor at the reference pixel is computed). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -Regridding of complex-valued images is supported. The real and imaginary parts are build 12-Sep-2018 15:30:25 -regridded independently and the resulting regridded pixel values are combined to build 12-Sep-2018 15:30:25 -form the regridded, complex-valued image. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -A variety of interpolation schemes are provided (you need only specify build 12-Sep-2018 15:30:25 -the first three characters to {\stfaf method}). The cubic interpolation build 12-Sep-2018 15:30:25 -is substantially slower than linear, and often the improvement is build 12-Sep-2018 15:30:25 -modest. By default you get linear interpolation. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -You specify the shape of the output image ({\stfaf shape}) and which build 12-Sep-2018 15:30:25 -output axes you want to regrid ({\stfaf axes}). Note that a Stokes axis build 12-Sep-2018 15:30:25 -cannot be regridded (you will get a warning if you try). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -The {\stfaf axes} argument cannot be used to discard axes from the build 12-Sep-2018 15:30:25 -output image; it can only be used to specify which {\bf output} axes are build 12-Sep-2018 15:30:25 -going to be regridded and which are not. Any axis that you are not build 12-Sep-2018 15:30:25 -regridding must have the same output shape as the input image shape for build 12-Sep-2018 15:30:25 -that axis. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -The {\stfaf axes} argument can also be used to specify the order in build 12-Sep-2018 15:30:25 -which the {\bf output} axes are regridded. This may give you build 12-Sep-2018 15:30:25 -significant performance benefits. For example, imagine we are going to build 12-Sep-2018 15:30:25 -regrid a spectral-line cube of shape [512,512,1204] to shape build 12-Sep-2018 15:30:25 -[256,256,32]. If you specified {\stfaf axes=[0,1,2]} then first, the build 12-Sep-2018 15:30:25 -Direction axes would be regridded for each of the 1024 pixels (and build 12-Sep-2018 15:30:25 -stored in a temporary image). Then each profile at each spatial build 12-Sep-2018 15:30:25 -location in the temporary image would be regridded to 32 pixels. You build 12-Sep-2018 15:30:25 -could speed this process up significantly by setting {\stfaf build 12-Sep-2018 15:30:25 -axes=[2,0,1]}. In this case, first each profile would be regridded to build 12-Sep-2018 15:30:25 -32 pixels, and then each plane of the 32 pixels would be regridded. build 12-Sep-2018 15:30:25 -Note that the order of {\stfaf axes} does not affect the order of the build 12-Sep-2018 15:30:25 -{\stfaf shape} argument. I.e. it should be given in the natural pixel build 12-Sep-2018 15:30:25 -axis order of the image {\stfaf [256,256,32]} in both cases. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -You can also specify a \region\ to be applied to the input image. If build 12-Sep-2018 15:30:25 -you do this, you need to be careful with the output shape for build 12-Sep-2018 15:30:25 -non-regridded axes (must match that of the region - use function build 12-Sep-2018 15:30:25 -boundingbox to find that out). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -If {\stfaf outfile} is given, the image is written to the specified build 12-Sep-2018 15:30:25 -disk file. If {\stfaf outfile} is unset, the on-the-fly Image \tool\ build 12-Sep-2018 15:30:25 -returned by this function is associated with a temporary image. This build 12-Sep-2018 15:30:25 -temporary image may be in memory or on disk, depending on its size. build 12-Sep-2018 15:30:25 -When you destroy the on-the-fly Image \tool\ (with the done function) this build 12-Sep-2018 15:30:25 -temporary image is deleted. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -The argument {\stfaf replicate} can be used to simply replicate pixels build 12-Sep-2018 15:30:25 -rather than regridding them. Normally ({\stfaf replicate=F}), for every build 12-Sep-2018 15:30:25 -output pixel, its world coordinate is computed and the corresponding build 12-Sep-2018 15:30:25 -input pixel found (then a little interpolation grid is generated). If build 12-Sep-2018 15:30:25 -you set {\stfaf replicate=T}, then what happens is that for every output build 12-Sep-2018 15:30:25 -axis, a vector of regularly sampled input pixels is generated (based on build 12-Sep-2018 15:30:25 -the ratio of the output and input axis shapes). So this just means the build 12-Sep-2018 15:30:25 -pixels get replicated (by whatever interpolation scheme you use) rather build 12-Sep-2018 15:30:25 -than regridded in world coordinate space. This process is much faster, build 12-Sep-2018 15:30:25 -but its not a true world coordinate based regrid. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -As decribed above, when {\stfaf replicate} is False, a coordinate is build 12-Sep-2018 15:30:25 -computed for each output pixel; this is an expensive operation. The build 12-Sep-2018 15:30:25 -argument {\stfaf decimate} allows you to decimate the computation of build 12-Sep-2018 15:30:25 -that coordinate grid to a sparse grid, which is then filled in via fast build 12-Sep-2018 15:30:25 -interpolation. The default for {\stfaf decimate} is 10. The number of build 12-Sep-2018 15:30:25 -pixels per axis in the sparse grid is the number of output pixels for build 12-Sep-2018 15:30:25 -that axis divided by the decimation factor. A factor of 10 does pretty build 12-Sep-2018 15:30:25 -well. You may find that for very non-linear coordinate systems (e.g. build 12-Sep-2018 15:30:25 -very close to the pole) that you have to reduce the decimation factor. build 12-Sep-2018 15:30:25 -You may also have to reduce the decimation factor if the number of pixels build 12-Sep-2018 15:30:25 -in the output image along an axis to be regridded is less than about 50, or build 12-Sep-2018 15:30:25 -the output image may be completely masked. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -If one of the axes to be regridded is a spectral axis and asvelocity=True, build 12-Sep-2018 15:30:25 -the axis will be regridded to match the velocity, not the frequency, build 12-Sep-2018 15:30:25 -description of the template coordinate system. Thus the output pixel build 12-Sep-2018 15:30:25 -values will correspond only to the velocity, not the frequency, of the build 12-Sep-2018 15:30:25 -output axis. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -Sometimes it is useful to drop axes of length one (degenerate axes). build 12-Sep-2018 15:30:25 -Use the {\stfaf dropdeg} argument if you want to do this. It will build 12-Sep-2018 15:30:25 -discard the axes from the input image. Therefore the output shape and build 12-Sep-2018 15:30:25 -Coordinate System that you supply must be consistent with the input build 12-Sep-2018 15:30:25 -image after the degenerate axes are dropped. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -Argument {\stfaf force} can be used to force all specified axes to be build 12-Sep-2018 15:30:25 -regridded, even if the algorithm determines that they don't need to be (because build 12-Sep-2018 15:30:25 -the input and output coordinate information is identical). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -There is a useful function build 12-Sep-2018 15:30:25 -setreferencelocation that build 12-Sep-2018 15:30:25 -you can use to keep a specific world coordinate in the center of an build 12-Sep-2018 15:30:25 -image when regridding (see example below). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -The output \pixelmask\ will be good (T) unless the regridding failed to build 12-Sep-2018 15:30:25 -find a value for that output pixel in which case it will be bad (F). build 12-Sep-2018 15:30:25 -For example, if the total input mask (default input \pixelmask\ plus OTF build 12-Sep-2018 15:30:25 -mask) for all of the relevant input pixels were masked bad build 12-Sep-2018 15:30:25 -then the output pixel would be masked bad (F). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -{\bf Multiple axis Coordinates limitation} -- Some cooordinates pertain build 12-Sep-2018 15:30:25 -to more than one axis. E.g. a Direction Coordinate holds longitude and build 12-Sep-2018 15:30:25 -latitude. A Linear Coordinate can also hold many axes. When you regrid build 12-Sep-2018 15:30:25 -*any* axis from a Coordinate which holds multiple axes, you must fully build 12-Sep-2018 15:30:25 -specify the coordinate information for all axes in that Coordinate in build 12-Sep-2018 15:30:25 -the Coordinate System that you provide. For example, you have a Linear build 12-Sep-2018 15:30:25 -Coordinate with two axes and you want to regrid axis one only. In the build 12-Sep-2018 15:30:25 -Coordinate System you provide, the coordinate information for axis two build 12-Sep-2018 15:30:25 -(not being regridded) must correctly be a copy from the input coordinate build 12-Sep-2018 15:30:25 -system (it won't be filled in for you). build 12-Sep-2018 15:30:25 +This function regrids the current image onto a grid specified by the given build 12-Sep-2018 15:30:25 +coordinate system. The shape of the output image may also be specified. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The coordinate system must be specified via a cs tool (using cs.torecord()). It build 12-Sep-2018 15:30:25 +is optional; if not specified, the coordinate system from the input image (ie, build 12-Sep-2018 15:30:25 +the one to which you are applying the regrid function) is used. The order of the build 12-Sep-2018 15:30:25 +coordinates and axes in the output image is always the same as the input image. build 12-Sep-2018 15:30:25 +It simply finds the relevant coordinate in the supplied coordinate system in build 12-Sep-2018 15:30:25 +order to determine the regridding parameters. The supplied coordinate system build 12-Sep-2018 15:30:25 +must have at least as many coordinates as are required to accomodate the axes build 12-Sep-2018 15:30:25 +that are to be regridded (eg, if the first two axes are to be regridded, and build 12-Sep-2018 15:30:25 +these belong to a direction coordinate, one direction coordinate in the supplied build 12-Sep-2018 15:30:25 +coordinate system is required). Coordinates pertaining to axes that are not build 12-Sep-2018 15:30:25 +being regridded are supplied from the input image, not the specified coordinate build 12-Sep-2018 15:30:25 +system. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +Reference changes are handled (eg, J2000 to B1950, LSR to TOPO). In general, the build 12-Sep-2018 15:30:25 +conversion machinery attempts to work out how sophisticated it needs to be (eg, build 12-Sep-2018 15:30:25 +is the regridding being done from LSR to LSR or from LSR to TOPO). However, it build 12-Sep-2018 15:30:25 +errs on the side of caution if the conversion machine requires more information build 12-Sep-2018 15:30:25 +than it actually needs. For full frame conversions, one needs to know things build 12-Sep-2018 15:30:25 +like the position on the earth's surface where the observation occurred, build 12-Sep-2018 15:30:25 +direction (celestial coordinates) of observation, and time of observation. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +If you get such errors and you are doing a frame conversion, then that means you build 12-Sep-2018 15:30:25 +must insert some extra information into the coordinate system of your image. build 12-Sep-2018 15:30:25 +Most likely it's the time (in which case you can use cs.setepoch()) and/or build 12-Sep-2018 15:30:25 +position (in which case you can use cs.settelescope()) that are missing. If you build 12-Sep-2018 15:30:25 +get these errors and you are certain that you are not specifying a frame change build 12-Sep-2018 15:30:25 +(eg, regrid LSR to LSR) then try setting doref=False. This will (silently) build 12-Sep-2018 15:30:25 +bypass all possible frame conversions. Note that if you are requesting a frame build 12-Sep-2018 15:30:25 +conversion and you set doref=False, no warnings will be emitted and the output build 12-Sep-2018 15:30:25 +image will likely be nonsensical. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +If you regrid a plane holding a direction coordinate and the units are Jy/pixel, build 12-Sep-2018 15:30:25 +then the output is scaled to conserve flux (roughly; just one scale factor at build 12-Sep-2018 15:30:25 +the reference pixel is computed). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +Regridding of complex-valued images is supported. The real and imaginary parts build 12-Sep-2018 15:30:25 +are regridded independently and the resulting regridded pixel values are build 12-Sep-2018 15:30:25 +combined to form the regridded, complex-valued image. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +A variety of interpolation schemes are provided (you need only specify the first build 12-Sep-2018 15:30:25 +three characters to the method parameter). The cubic interpolation is build 12-Sep-2018 15:30:25 +substantially slower than linear, and often the improvement is modest. By build 12-Sep-2018 15:30:25 +default, linear interpolation is used. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +You specify the shape of the output image using the shape parameter and which build 12-Sep-2018 15:30:25 +output axes you want to regrid. Note that a Stokes axis cannot be regridded build 12-Sep-2018 15:30:25 +(you will get a warning if you try). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The axes parameter cannot be used to discard axes from the output image; it can build 12-Sep-2018 15:30:25 +only be used to specify which output axes are going to be regridded and which build 12-Sep-2018 15:30:25 +are not. Any axis that you are not regridding must have the same output shape as build 12-Sep-2018 15:30:25 +the input image shape for that axis. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The axes parameter can also be used to specify the order in which the output build 12-Sep-2018 15:30:25 +axes are regridded. This may give you significant performance benefits. For build 12-Sep-2018 15:30:25 +example, imagine we are going to regrid a spectral-line cube of shape build 12-Sep-2018 15:30:25 +[512,512,1204] to shape [256,256,32]. If you specified axes=[0,1,2] then first, build 12-Sep-2018 15:30:25 +the direction axes would be regridded for each of the 1024 pixels (and stored in build 12-Sep-2018 15:30:25 +a temporary image). Then each spectral profile at each spatial location in the build 12-Sep-2018 15:30:25 +temporary image would be regridded to 32 pixels. You could speed this process build 12-Sep-2018 15:30:25 +up significantly by setting axes=[2,0,1]. In this case, first each spectral build 12-Sep-2018 15:30:25 +profile would be regridded to 32 pixels, and then each plane of the 32 pixels build 12-Sep-2018 15:30:25 +would be regridded. Note that the order of axes does not affect the order of the build 12-Sep-2018 15:30:25 +shape parameter; ie, it should be given in the natural pixel axis order of the build 12-Sep-2018 15:30:25 +image ()[256,256,32] in both cases of this example). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +You can also specify a region to be applied to the input image. If you do this, build 12-Sep-2018 15:30:25 +you need to be careful with the output shape for non-regridded axes (must match build 12-Sep-2018 15:30:25 +that of the region - use function ia.boundingbox() to determine that). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +If the outfile parameter is specified, the image is written to the specified build 12-Sep-2018 15:30:25 +disk file. If this parameter is unset, the on-the-fly image analysis tool build 12-Sep-2018 15:30:25 +returned by this method is associated with a temporary image. This temporary build 12-Sep-2018 15:30:25 +image may be in memory or on disk, depending on its size. When you destroy the build 12-Sep-2018 15:30:25 +on-the-fly image analysis tool (with either the ia.close() or ia.done() build 12-Sep-2018 15:30:25 +methods), this temporary image is deleted. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The replicate parameter can be used to simply replicate pixels rather than build 12-Sep-2018 15:30:25 +regridding them. Normally replicate=False, for every output pixel, its world build 12-Sep-2018 15:30:25 +coordinate is computed and the corresponding input pixel found (then a little build 12-Sep-2018 15:30:25 +interpolation grid is generated). If replicate=True, then for every output build 12-Sep-2018 15:30:25 +axis, a vector of regularly sampled input pixels is generated (based on the build 12-Sep-2018 15:30:25 +ratio of the output and input axis shapes). So this just means the pixels get build 12-Sep-2018 15:30:25 +replicated (by whatever interpolation scheme you use) rather than regridded in build 12-Sep-2018 15:30:25 +world coordinate space. This process is much faster, but its not a true world build 12-Sep-2018 15:30:25 +coordinate based regrid. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +As decribed above, when replicate=False, a coordinate is computed for each build 12-Sep-2018 15:30:25 +output pixel; this is an expensive operation. The decimate parameter allows you build 12-Sep-2018 15:30:25 +to decimate the computation of that coordinate grid to a sparse grid, which is build 12-Sep-2018 15:30:25 +then filled in via fast interpolation. The default is decimate=10. The number build 12-Sep-2018 15:30:25 +of pixels per axis in the sparse grid is the number of output pixels for that build 12-Sep-2018 15:30:25 +axis divided by the decimation factor. A factor of 10 does pretty well. You may build 12-Sep-2018 15:30:25 +find that for very non-linear coordinate systems (e.g. very close to the pole) build 12-Sep-2018 15:30:25 +that you have to reduce the decimation factor. You may also have to reduce the build 12-Sep-2018 15:30:25 +decimation factor if the number of pixels in the output image along an axis to build 12-Sep-2018 15:30:25 +be regridded is less than about 50, or the output image may be completely build 12-Sep-2018 15:30:25 +masked. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +If one of the axes to be regridded is a spectral axis and asvelocity=True, the build 12-Sep-2018 15:30:25 +axis will be regridded to match the velocity, not the frequency, description of build 12-Sep-2018 15:30:25 +the template spectral coordinate. Thus the output pixel values will correspond build 12-Sep-2018 15:30:25 +only to the velocity, not the frequency, of the output axis. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +Sometimes it is useful to drop axes of length one (degenerate axes). Setting build 12-Sep-2018 15:30:25 +the dropdeg parameter to True will do that. It will discard the axes from the build 12-Sep-2018 15:30:25 +input image. Therefore the output shape and coordinate system that you supply build 12-Sep-2018 15:30:25 +must be consistent with the input image after the degenerate axes are dropped. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The force parameter can be used to force all specified axes to be regridded, build 12-Sep-2018 15:30:25 +even if the algorithm determines that they don't need to be (because the input build 12-Sep-2018 15:30:25 +and output coordinate information is identical). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The cs tool has a useful method, cs.setreferencelocation(), that can be used to build 12-Sep-2018 15:30:25 +keep a specific world coordinate in the center of an image when regridding (see build 12-Sep-2018 15:30:25 +example below). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The output pixel mask will be True (good) unless the regridding failed to find a build 12-Sep-2018 15:30:25 +value for that output pixel in which case it will be False. For example, if the build 12-Sep-2018 15:30:25 +total input mask (default input pixel mask plus OTF mask) for all of the build 12-Sep-2018 15:30:25 +relevant input pixels were masked bad then the output pixel would be masked build 12-Sep-2018 15:30:25 +(False). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +MULTIPLE AXIS COORDINATES LIMITATION build 12-Sep-2018 15:30:25 +Some cooordinates contain multiple axes. For example, a direction coordinate build 12-Sep-2018 15:30:25 +contains both longitude-like and latitude-like axes. A linear coordinate can build 12-Sep-2018 15:30:25 +also contain multiple axes. When you regrid *any* axis from a coordinate which build 12-Sep-2018 15:30:25 +contains multiple axes, you must fully specify the coordinate information for build 12-Sep-2018 15:30:25 +all axes in that coordinate in the coordinate system that you provide. For build 12-Sep-2018 15:30:25 +example, if you have a linear coordinate with two axes and you want to regrid build 12-Sep-2018 15:30:25 +axis one only. In the coordinate system you provide, the coordinate information build 12-Sep-2018 15:30:25 +for axis two (not being regridded) must correctly be a copy from the input build 12-Sep-2018 15:30:25 +coordinate system (it won't be filled in for you). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 If an image has per-plane beams and one attempts to regrid the spectral axis, build 12-Sep-2018 15:30:25 an exception is thrown. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 IMPORTANT NOTE ABOUT FLUX CONSERVATION build 12-Sep-2018 15:30:25 -in general regridding is inaccurate for images that the angular resolution is poorly build 12-Sep-2018 15:30:25 -sampled. A check is done for such cases and a warning message is emitted if a beam present. build 12-Sep-2018 15:30:25 -However, no such check is done if there is no beam present. To add a restoring beam to build 12-Sep-2018 15:30:25 -an image, use ia.setrestoringbeam(). build 12-Sep-2018 15:30:25 +in general regridding is inaccurate for images that the angular resolution is build 12-Sep-2018 15:30:25 +poorly sampled. A check is done for such cases and a warning message is emitted build 12-Sep-2018 15:30:25 +if a beam present. However, no such check is done if there is no beam present. build 12-Sep-2018 15:30:25 +To add a restoring beam to an image, use ia.setrestoringbeam(). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -9455,8 +9400,9 @@ ib.done() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Region selection. Default is to use the full image. build 12-Sep-2018 15:30:25 + path build 12-Sep-2018 15:30:25 + string build 12-Sep-2018 15:30:25 record build 12-Sep-2018 15:30:25 - path build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -10788,40 +10734,53 @@ other process can gain immediate access to the \imagefile. build 12-Sep-2018 15:30:25 Write image creation messages to logger build 12-Sep-2018 15:30:25 true build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Pixel data type to write. 'f' (float precision) or 'd' (double precision) build 12-Sep-2018 15:30:25 + f build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -This function converts an array of any size into a \casa\ build 12-Sep-2018 15:30:25 -\imagefile. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -If {\stfaf outfile} is given, the image is written to the specified build 12-Sep-2018 15:30:25 -disk file. If {\stfaf outfile} is unset, the on-the-fly Image \tool\ build 12-Sep-2018 15:30:25 -returned by this function is associated with a temporary image. This build 12-Sep-2018 15:30:25 -temporary image may be in memory or on disk, depending on its size. build 12-Sep-2018 15:30:25 -When you destroy the on-the-fly Image \tool\ (with the done function) this build 12-Sep-2018 15:30:25 -temporary image is deleted. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -At present, no matter what type the {\stfaf pixels} array is, a build 12-Sep-2018 15:30:25 -real-valued image will be written (the input pixels will be converted build 12-Sep-2018 15:30:25 -to Float). In the future, Complex images will be supported. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -The Coordinate System, provided as a record describing a Coordsys \tool\ (via build 12-Sep-2018 15:30:25 -coordsys.torecord(), for instance) is optional. If you provide it, it build 12-Sep-2018 15:30:25 -must be dimensionally consistent with the pixels array you give (see build 12-Sep-2018 15:30:25 -also coordsys). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -If you don't provide the Coordinate System (unset), a default Coordinate System build 12-Sep-2018 15:30:25 -is made for you. If {\stfaf linear=F} (the default) then it is a build 12-Sep-2018 15:30:25 -standard RA/DEC/Stokes/Spectral Coordinate System depending exactly upon build 12-Sep-2018 15:30:25 -the shape of the {\stfaf pixels} array (Stokes axis must be no longer build 12-Sep-2018 15:30:25 -than 4 pixels and you may find the spectral axis coming out before the build 12-Sep-2018 15:30:25 -Stokes axis if say, {\cf shape=[64,64,32,4]}). Extra dimensions are build 12-Sep-2018 15:30:25 -given linear coordinates. If {\stfaf linear=T} then you get a linear build 12-Sep-2018 15:30:25 -Coordinate System. build 12-Sep-2018 15:30:25 +This application converts a numpy array of any size into a CASA image. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +If outfile is specified, the image is written to the specified build 12-Sep-2018 15:30:25 +(persistent) disk file. If outfile is unset, the returned image tool build 12-Sep-2018 15:30:25 +is associated with a temporary image. This temporary image may be in build 12-Sep-2018 15:30:25 +memory or on disk, depending on its size. In this case, when the build 12-Sep-2018 15:30:25 +close() or done() method is called on the returned image tool, the build 12-Sep-2018 15:30:25 +associated temporary image is deleted. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The type parameter controls the data type/precision of the pixel values of the build 12-Sep-2018 15:30:25 +created image. 'f' indicates that float precision point (32 bit precision) pixel build 12-Sep-2018 15:30:25 +values should be writted. 'd' indicates that double precision (64 bit precision) build 12-Sep-2018 15:30:25 +pixel values should be written. If the input array has complex (as opposed to build 12-Sep-2018 15:30:25 +real) values, then complex pixel values, with each of the real and imaginary build 12-Sep-2018 15:30:25 +parts having the specified precision, will be written. Array values will be cast build 12-Sep-2018 15:30:25 +automatically to the specified precision, so that the precision of the input build 12-Sep-2018 15:30:25 +array values may be increased, decreased, or unchanged depending on the input build 12-Sep-2018 15:30:25 +array type. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The coordinate system, provided as a a dictionary (use eg, cs.torecord() to do build 12-Sep-2018 15:30:25 +that), is optional. If specified, it must have the same number of dimensions build 12-Sep-2018 15:30:25 +as the pixels array. Call the naxes() method on the coordinate system tool to build 12-Sep-2018 15:30:25 +see how many dimensions the coordinate system has. A coordinate system can be build 12-Sep-2018 15:30:25 +created from scratch using the coordinate system (cs) tool and methods therein, build 12-Sep-2018 15:30:25 +but often users prefer to use a coordinate system from an already existing image. build 12-Sep-2018 15:30:25 +This can be gotten using ia.coordsys() which returns a coordinate system tool. build 12-Sep-2018 15:30:25 +A torecord() call on that tool will result in a python dictionary describing build 12-Sep-2018 15:30:25 +the coordinate system which is the necessary format for the csys input parameter build 12-Sep-2018 15:30:25 +of ia.fromarray(). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +If csys is not specified, a default coordinate system will be created. If build 12-Sep-2018 15:30:25 +linear=False (the default), the created coordinate system will have standard build 12-Sep-2018 15:30:25 +RA/DEC/Stokes/Spectral Coordinate axes depending upon the shape of the pixels build 12-Sep-2018 15:30:25 +array (Stokes axis must be no longer than 4 pixels and the spectral axis may build 12-Sep-2018 15:30:25 +precede the Stokes axis if eg, shape=[64,64,32,4]. Extra dimensions are given build 12-Sep-2018 15:30:25 +linear coordinates. If linear=True, then all the resulting coordinates build 12-Sep-2018 15:30:25 +are linear with the axes represent lengths. In this case each axis will have a build 12-Sep-2018 15:30:25 +value of 0.0 at its center pixel. The increment of each axis will be 1.0 km. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -11037,8 +10996,6 @@ im2.done() build 12-Sep-2018 15:30:25 # build 12-Sep-2018 15:30:25 """ build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -11050,7 +11007,7 @@ of the image, and all pixels of other axes.--> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Name of output image file. Default is unset. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -11085,33 +11042,31 @@ of the image, and all pixels of other axes.--> build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -This function creates a \casa\ \imagefile\ with the specified shape. All build 12-Sep-2018 15:30:25 -the pixel values in the image are set to 0. Both float valued and complex build 12-Sep-2018 15:30:25 -valued images are supported; the data type of the image is specified via build 12-Sep-2018 15:30:25 -the type parameter. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -If {\stfaf outfile} is given, the image is written to the specified build 12-Sep-2018 15:30:25 -disk file. If {\stfaf outfile} is unset, the on-the-fly Image \tool\ build 12-Sep-2018 15:30:25 -returned by this function is associated with a temporary image. This build 12-Sep-2018 15:30:25 -temporary image may be in memory or on disk, depending on its size. build 12-Sep-2018 15:30:25 -When you destroy the on-the-fly Image \tool\ (with the done function) this build 12-Sep-2018 15:30:25 -temporary image is deleted. build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -The Coordinate System, provided as a record describing a Coordsys \tool\ (created via build 12-Sep-2018 15:30:25 -coordsys.torecord(), for instance), is optional. If you provide it, build 12-Sep-2018 15:30:25 -it must be dimensionally consistent with the pixels array you give build 12-Sep-2018 15:30:25 -(see also coordsys). build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 -If you don't provide the Coordinate System, a default Coordinate System build 12-Sep-2018 15:30:25 -is made for you. If {\stfaf linear=F} (the default) then it is a build 12-Sep-2018 15:30:25 -standard RA/DEC/Stokes/Spectral Coordinate System depending exactly upon build 12-Sep-2018 15:30:25 -the shape (Stokes axis must be no longer than 4 pixels and you may find build 12-Sep-2018 15:30:25 -the spectral axis coming out before the Stokes axis if say, {\cf build 12-Sep-2018 15:30:25 -shape=[64,64,32,4]}). Extra dimensions are given linear coordinates. build 12-Sep-2018 15:30:25 -If {\stfaf linear=T} then you get a linear Coordinate System. build 12-Sep-2018 15:30:25 +This function creates a CASA image with the specified shape. It is similar to build 12-Sep-2018 15:30:25 +ia.fromshape(), but instead returns a new image analysis tool attached to the build 12-Sep-2018 15:30:25 +new image, rather than attaching the new image to the current tool. All the build 12-Sep-2018 15:30:25 +pixel values in the image are set to 0. One may create an image with float build 12-Sep-2018 15:30:25 +precision pixels (type='f'), complex float precision pixels (type='c'), double build 12-Sep-2018 15:30:25 +precision pixels (type='d'), or complex double precision pixels ('cd'). To use a build 12-Sep-2018 15:30:25 +numpy array of values to create an image, use ia.(newimage)fromarray(). To make build 12-Sep-2018 15:30:25 +a 2-D image from a packaged FITS file, use ia.maketestimage(). build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +If outfile is given, the image is written to the specified disk file. If build 12-Sep-2018 15:30:25 +outfile is unset, the image analysis tool is associated with a temporary image. build 12-Sep-2018 15:30:25 +This temporary image may be in memory or on disk, depending on its size. When build 12-Sep-2018 15:30:25 +you close the image analysis tool (with the ia.close() method, the temporary build 12-Sep-2018 15:30:25 +image is deleted. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +The coordinate system, provided as a coordinate system tool record, is optional. build 12-Sep-2018 15:30:25 +If provided, it must be dimensionally consistent with the specified shape. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +If the coordinate system is not provided, a default coordinate system will be build 12-Sep-2018 15:30:25 +created. If linear=False (the default), then it is a build 12-Sep-2018 15:30:25 +standard RA/DEC/Stokes/Spectral coordinate system depending exactly upon the build 12-Sep-2018 15:30:25 +shape (the Stokes axis must be no longer than 4 pixels and spectral axis may build 12-Sep-2018 15:30:25 +occur prior to the Stokes axis if eg, shape=[64,64,32,4]. Extra dimensions are build 12-Sep-2018 15:30:25 +given linear coordinates. If linear=True, then the coordinate system will have build 12-Sep-2018 15:30:25 +linear coordinates. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -11220,6 +11175,19 @@ used to create a 2D temporary image. build 12-Sep-2018 15:30:25 pbia.done() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Get the pixel data type of the attached image build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + This application returns the data type of the pixels of the attached image as a string. build 12-Sep-2018 15:30:25 + The possible values are: "float" which indicates real valued, floating point, 32 bit pixel build 12-Sep-2018 15:30:25 + values, "complex" which indicates complex valued, floating point, 32 bit (for each of the build 12-Sep-2018 15:30:25 + real and imaginary parts) pixel values, "double" which indicates real valued, floating build 12-Sep-2018 15:30:25 + point, 64 bit pixel values, and "dcomplex" which indicates complex valued, floating point, build 12-Sep-2018 15:30:25 + 64 bit (for each of the real and imaginary parts) pixel values. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/images/image_cmpt.cc b/gcwrap/tools/images/image_cmpt.cc build 12-Sep-2018 15:30:25 index 5a50e0e..32ffd98 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tools/images/image_cmpt.cc build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/images/image_cmpt.cc build 12-Sep-2018 15:30:25 @@ -150,14 +150,17 @@ image::image(casa::SPIIC inImage) : build 12-Sep-2018 15:30:25 _log(), _imageF(), _imageC(inImage), _imageD(), _imageDC() { build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -image::image(casa::SPIID inImage) : build 12-Sep-2018 15:30:25 - _log(), _imageF(), _imageC(), _imageD(inImage), _imageDC() { build 12-Sep-2018 15:30:25 -} build 12-Sep-2018 15:30:25 +image::image(casa::SPIID inImage) build 12-Sep-2018 15:30:25 + : _imageD(inImage) {} build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -image::image(casa::SPIIDC inImage) : build 12-Sep-2018 15:30:25 - _log(), _imageF(), _imageC(), _imageD(), _imageDC(inImage) { build 12-Sep-2018 15:30:25 +image::image(casa::SPIIDC inImage) build 12-Sep-2018 15:30:25 + : _imageDC(inImage) {} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +image::image(ITUPLE mytuple) { build 12-Sep-2018 15:30:25 + _setImage(mytuple); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 image::~image() {} build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 image* image::adddegaxes( build 12-Sep-2018 15:30:25 @@ -537,16 +540,26 @@ bool image::calcmask( build 12-Sep-2018 15:30:25 if (_detached()) { build 12-Sep-2018 15:30:25 return false; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - _notSupported(__func__); build 12-Sep-2018 15:30:25 Record region; build 12-Sep-2018 15:30:25 if (_imageF) { build 12-Sep-2018 15:30:25 ImageMaskHandler imh(_imageF); build 12-Sep-2018 15:30:25 imh.calcmask(mask, region, maskName, makeDefault); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - else { build 12-Sep-2018 15:30:25 + else if (_imageC){ build 12-Sep-2018 15:30:25 ImageMaskHandler imh(_imageC); build 12-Sep-2018 15:30:25 imh.calcmask(mask, region, maskName, makeDefault); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + else if (_imageD) { build 12-Sep-2018 15:30:25 + ImageMaskHandler imh(_imageD); build 12-Sep-2018 15:30:25 + imh.calcmask(mask, region, maskName, makeDefault); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageDC) { build 12-Sep-2018 15:30:25 + ImageMaskHandler imh(_imageDC); build 12-Sep-2018 15:30:25 + imh.calcmask(mask, region, maskName, makeDefault); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("Logic error"); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 vector names {"mask", "name", "asdefault"}; build 12-Sep-2018 15:30:25 vector values {mask, maskName, makeDefault}; build 12-Sep-2018 15:30:25 _addHistory(__func__, names, values); build 12-Sep-2018 15:30:25 @@ -1104,15 +1117,20 @@ coordsys* image::coordsys(const std::vector& pixelAxes) { build 12-Sep-2018 15:30:25 if (_detached()) { build 12-Sep-2018 15:30:25 return nullptr; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - _notSupported(__func__); build 12-Sep-2018 15:30:25 if (_imageF) { build 12-Sep-2018 15:30:25 return _coordsys(_imageF, pixelAxes); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 else if (_imageC) { build 12-Sep-2018 15:30:25 return _coordsys(_imageC, pixelAxes); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + else if (_imageD) { build 12-Sep-2018 15:30:25 + return _coordsys(_imageD, pixelAxes); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageDC) { build 12-Sep-2018 15:30:25 + return _coordsys(_imageDC, pixelAxes); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 else { build 12-Sep-2018 15:30:25 - ThrowCc("This type of image is not supported by this method"); build 12-Sep-2018 15:30:25 + ThrowCc("Logic error"); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 catch (const AipsError& x) { build 12-Sep-2018 15:30:25 @@ -1964,86 +1982,145 @@ record* image::fitprofile(const string& box, const variant& region, build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 bool image::fromarray( build 12-Sep-2018 15:30:25 - const std::string& outfile, build 12-Sep-2018 15:30:25 - const variant& pixels, const record& csys, build 12-Sep-2018 15:30:25 - bool linear, bool overwrite, bool log build 12-Sep-2018 15:30:25 + const std::string& outfile, const variant& pixels, build 12-Sep-2018 15:30:25 + const record& csys, bool linear, bool overwrite, build 12-Sep-2018 15:30:25 + bool log, const std::string& type build 12-Sep-2018 15:30:25 ) { build 12-Sep-2018 15:30:25 try { build 12-Sep-2018 15:30:25 _reset(); build 12-Sep-2018 15:30:25 - auto mypair = _fromarray( build 12-Sep-2018 15:30:25 - outfile, pixels, csys, build 12-Sep-2018 15:30:25 - linear, overwrite, log build 12-Sep-2018 15:30:25 + auto mytuple = _fromarray( build 12-Sep-2018 15:30:25 + outfile, pixels, csys, linear, build 12-Sep-2018 15:30:25 + overwrite, log, type build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 - _imageF = mypair.first; build 12-Sep-2018 15:30:25 - _imageC = mypair.second; build 12-Sep-2018 15:30:25 - vector names {"pixels", "csys", "linear", "overwrite", "log"}; build 12-Sep-2018 15:30:25 + _setImage(mytuple); build 12-Sep-2018 15:30:25 + vector names { build 12-Sep-2018 15:30:25 + "pixels", "csys", "linear", build 12-Sep-2018 15:30:25 + "overwrite", "log", "type" build 12-Sep-2018 15:30:25 + }; build 12-Sep-2018 15:30:25 variant k("[...]"); build 12-Sep-2018 15:30:25 const auto* mpixels = pixels.size() <= 100 ? &pixels : &k; build 12-Sep-2018 15:30:25 - vector values {*mpixels, csys, linear, overwrite, log}; build 12-Sep-2018 15:30:25 + vector values { build 12-Sep-2018 15:30:25 + *mpixels, csys, linear, overwrite, log, type build 12-Sep-2018 15:30:25 + }; build 12-Sep-2018 15:30:25 _addHistory(__func__, names, values); build 12-Sep-2018 15:30:25 return true; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 catch (const AipsError& x) { build 12-Sep-2018 15:30:25 _log << LogIO::SEVERE << "Exception Reported: " << x.getMesg() build 12-Sep-2018 15:30:25 - << LogIO::POST; build 12-Sep-2018 15:30:25 + << LogIO::POST; build 12-Sep-2018 15:30:25 RETHROW(x); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 return false; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -std::pair image::_fromarray( build 12-Sep-2018 15:30:25 +ITUPLE image::_fromarray( build 12-Sep-2018 15:30:25 const string& outfile, build 12-Sep-2018 15:30:25 - const variant& pixels, const record& csys, build 12-Sep-2018 15:30:25 - bool linear, bool overwrite, bool log build 12-Sep-2018 15:30:25 + const ::casac::variant& pixels, const record& csys, build 12-Sep-2018 15:30:25 + bool linear, bool overwrite, bool log, build 12-Sep-2018 15:30:25 + const string& type build 12-Sep-2018 15:30:25 ) { build 12-Sep-2018 15:30:25 - Vector shape = pixels.arrayshape(); build 12-Sep-2018 15:30:25 + String mytype = type; build 12-Sep-2018 15:30:25 + mytype.downcase(); build 12-Sep-2018 15:30:25 ThrowIf( build 12-Sep-2018 15:30:25 - shape.ndim() == 0, build 12-Sep-2018 15:30:25 - "The pixels array cannot be empty" build 12-Sep-2018 15:30:25 + ! (mytype == "d" || mytype == "f"), build 12-Sep-2018 15:30:25 + "Unsupported value for type: \"" + type + "\". " build 12-Sep-2018 15:30:25 + "Supported values are \"d\" and \"f\"" build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 - Array floatArray; build 12-Sep-2018 15:30:25 - Array complexArray; build 12-Sep-2018 15:30:25 - if (pixels.type() == variant::DOUBLEVEC) { build 12-Sep-2018 15:30:25 - std::vector pixelVector = pixels.getDoubleVec(); build 12-Sep-2018 15:30:25 - floatArray.resize(IPosition(shape)); build 12-Sep-2018 15:30:25 - Vector localpix(pixelVector); build 12-Sep-2018 15:30:25 - convertArray(floatArray, localpix.reform(IPosition(shape))); build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - else if (pixels.type() == ::casac::variant::INTVEC) { build 12-Sep-2018 15:30:25 - vector pixelVector = pixels.getIntVec(); build 12-Sep-2018 15:30:25 - floatArray.resize(IPosition(shape)); build 12-Sep-2018 15:30:25 - Vector localpix(pixelVector); build 12-Sep-2018 15:30:25 - convertArray(floatArray, localpix.reform(IPosition(shape))); build 12-Sep-2018 15:30:25 + auto doFloat = mytype == "f"; build 12-Sep-2018 15:30:25 + ::casacore::IPosition shape = pixels.arrayshape(); build 12-Sep-2018 15:30:25 + ThrowIf( build 12-Sep-2018 15:30:25 + shape.empty(), "The pixels array cannot be empty" build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + ::casacore::Array<::casacore::Float> floatArray; build 12-Sep-2018 15:30:25 + ::casacore::Array<::casacore::Double> doubleArray; build 12-Sep-2018 15:30:25 + ::casacore::Array<::casacore::Complex> complexArray; build 12-Sep-2018 15:30:25 + ::casacore::Array<::casacore::DComplex> dcomplexArray; build 12-Sep-2018 15:30:25 + auto pixType = pixels.type(); build 12-Sep-2018 15:30:25 + if ( build 12-Sep-2018 15:30:25 + pixType == ::casac::variant::DOUBLEVEC build 12-Sep-2018 15:30:25 + || pixType == ::casac::variant::INTVEC build 12-Sep-2018 15:30:25 + || pixType == ::casac::variant::LONGVEC build 12-Sep-2018 15:30:25 + || pixType == ::casac::variant::UINTVEC build 12-Sep-2018 15:30:25 + ) { build 12-Sep-2018 15:30:25 + ::casacore::Array<::casacore::Double> dv; build 12-Sep-2018 15:30:25 + if (pixType == ::casac::variant::DOUBLEVEC) { build 12-Sep-2018 15:30:25 + dv = ::casacore::Vector<::casacore::Double>( build 12-Sep-2018 15:30:25 + pixels.getDoubleVec() build 12-Sep-2018 15:30:25 + ).reform(shape); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (pixType == ::casac::variant::INTVEC) { build 12-Sep-2018 15:30:25 + dv = ::casacore::Vector<::casacore::Double>( build 12-Sep-2018 15:30:25 + pixels.getIntVec() build 12-Sep-2018 15:30:25 + ).reform(shape); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (pixType == ::casac::variant::LONGVEC) { build 12-Sep-2018 15:30:25 + dv = ::casacore::Vector<::casacore::Double>( build 12-Sep-2018 15:30:25 + pixels.getLongVec() build 12-Sep-2018 15:30:25 + ).reform(shape); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (pixType == ::casac::variant::UINTVEC) { build 12-Sep-2018 15:30:25 + dv = ::casacore::Vector<::casacore::Double>( build 12-Sep-2018 15:30:25 + pixels.getuIntVec() build 12-Sep-2018 15:30:25 + ).reform(shape); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("Logic error"); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + if (doFloat) { build 12-Sep-2018 15:30:25 + floatArray.resize(shape); build 12-Sep-2018 15:30:25 + ::casacore::convertArray(floatArray, dv); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + doubleArray = dv; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 else if (pixels.type() == ::casac::variant::COMPLEXVEC) { build 12-Sep-2018 15:30:25 - vector > pixelVector = pixels.getComplexVec(); build 12-Sep-2018 15:30:25 - complexArray.resize(IPosition(shape)); build 12-Sep-2018 15:30:25 - Vector localpix(pixelVector); build 12-Sep-2018 15:30:25 - convertArray(complexArray, localpix.reform(IPosition(shape))); build 12-Sep-2018 15:30:25 + auto localpix = ::casacore::Vector<::casacore::DComplex>( build 12-Sep-2018 15:30:25 + pixels.getComplexVec() build 12-Sep-2018 15:30:25 + ).reform(shape); build 12-Sep-2018 15:30:25 + if(doFloat) { build 12-Sep-2018 15:30:25 + complexArray.resize(shape); build 12-Sep-2018 15:30:25 + ::casacore::convertArray(complexArray, localpix); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + dcomplexArray = localpix; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 else { build 12-Sep-2018 15:30:25 - ThrowCc( build 12-Sep-2018 15:30:25 - "pixels is not understood, try using an array " build 12-Sep-2018 15:30:25 - ); build 12-Sep-2018 15:30:25 + ThrowCc("pixels is not understood, try using an array"); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - LogOrigin lor("image", __func__); build 12-Sep-2018 15:30:25 + casacore::LogOrigin lor("image", __func__); build 12-Sep-2018 15:30:25 _log << lor; build 12-Sep-2018 15:30:25 std::unique_ptr coordinates(toRecord(csys)); build 12-Sep-2018 15:30:25 SPIIF f; build 12-Sep-2018 15:30:25 SPIIC c; build 12-Sep-2018 15:30:25 - if (floatArray.ndim() > 0) { build 12-Sep-2018 15:30:25 + SPIID d; build 12-Sep-2018 15:30:25 + SPIIDC dc; build 12-Sep-2018 15:30:25 + if (! floatArray.empty()) { build 12-Sep-2018 15:30:25 f = ImageFactory::imageFromArray( build 12-Sep-2018 15:30:25 outfile, floatArray, *coordinates, build 12-Sep-2018 15:30:25 linear, overwrite, log build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - else { build 12-Sep-2018 15:30:25 + else if (! doubleArray.empty()) { build 12-Sep-2018 15:30:25 + d = ImageFactory::imageFromArray( build 12-Sep-2018 15:30:25 + outfile, doubleArray, *coordinates, build 12-Sep-2018 15:30:25 + linear, overwrite, log build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (! complexArray.empty()) { build 12-Sep-2018 15:30:25 c = ImageFactory::imageFromArray( build 12-Sep-2018 15:30:25 outfile, complexArray, *coordinates, build 12-Sep-2018 15:30:25 linear, overwrite, log build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - return make_pair(f, c); build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + dc = ImageFactory::imageFromArray( build 12-Sep-2018 15:30:25 + outfile, dcomplexArray, *coordinates, build 12-Sep-2018 15:30:25 + linear, overwrite, log build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return ::casa::ITUPLE(f, c, d, dc); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 bool image::fromascii( build 12-Sep-2018 15:30:25 @@ -2177,13 +2254,11 @@ bool image::fromimage( build 12-Sep-2018 15:30:25 _log << _ORIGIN; build 12-Sep-2018 15:30:25 String theMask = _getMask(mask); build 12-Sep-2018 15:30:25 SHARED_PTR regionPtr(_getRegion(region, false)); build 12-Sep-2018 15:30:25 - auto imagePair = ImageFactory::fromImage( build 12-Sep-2018 15:30:25 + auto imagePtrs = ImageFactory::fromImage( build 12-Sep-2018 15:30:25 outfile, infile, *regionPtr, theMask, build 12-Sep-2018 15:30:25 dropdeg, overwrite build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 - _reset(); build 12-Sep-2018 15:30:25 - _imageF = imagePair.first; build 12-Sep-2018 15:30:25 - _imageC = imagePair.second; build 12-Sep-2018 15:30:25 + _setImage(imagePtrs); build 12-Sep-2018 15:30:25 vector names { build 12-Sep-2018 15:30:25 "outfile", "infile", "region", build 12-Sep-2018 15:30:25 "mask", "dropdeg", "overwrite" build 12-Sep-2018 15:30:25 @@ -2228,9 +2303,8 @@ bool image::fromrecord(const record& imrecord, const string& outfile) { build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 bool image::fromshape( build 12-Sep-2018 15:30:25 - const string& outfile, const vector& shape, build 12-Sep-2018 15:30:25 - const record& csys, const bool linear, const bool overwrite, build 12-Sep-2018 15:30:25 - const bool log, const string& type build 12-Sep-2018 15:30:25 + const string& outfile, const vector& shape, const record& csys, build 12-Sep-2018 15:30:25 + const bool linear, const bool overwrite, const bool log, const string& type build 12-Sep-2018 15:30:25 ) { build 12-Sep-2018 15:30:25 try { build 12-Sep-2018 15:30:25 LogOrigin lor("image", __func__); build 12-Sep-2018 15:30:25 @@ -2529,55 +2603,32 @@ variant* image::getregion( build 12-Sep-2018 15:30:25 if (_detached()) { build 12-Sep-2018 15:30:25 return nullptr; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - _notSupported(__func__); build 12-Sep-2018 15:30:25 - SHARED_PTR Region(_getRegion(region, false)); build 12-Sep-2018 15:30:25 - auto Mask = _getMask(mask); build 12-Sep-2018 15:30:25 - Vector iaxes(axes); build 12-Sep-2018 15:30:25 - // if default value change it to empty vector build 12-Sep-2018 15:30:25 - if (iaxes.size() == 1 && iaxes[0] < 0) { build 12-Sep-2018 15:30:25 - iaxes.resize(); build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - Record ret; build 12-Sep-2018 15:30:25 if (_imageF) { build 12-Sep-2018 15:30:25 - PixelValueManipulator pvm( build 12-Sep-2018 15:30:25 - _imageF, Region.get(), Mask build 12-Sep-2018 15:30:25 - ); build 12-Sep-2018 15:30:25 - pvm.setAxes(IPosition(iaxes)); build 12-Sep-2018 15:30:25 - pvm.setVerbosity( build 12-Sep-2018 15:30:25 - list ? ImageTask::DEAFENING : ImageTask::QUIET build 12-Sep-2018 15:30:25 + return _getregion2( build 12-Sep-2018 15:30:25 + _imageF, region, axes, mask, list, build 12-Sep-2018 15:30:25 + dropdeg, getmask, stretch build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 - pvm.setDropDegen(dropdeg); build 12-Sep-2018 15:30:25 - pvm.setStretch(stretch); build 12-Sep-2018 15:30:25 - ret = pvm.get(); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - else { build 12-Sep-2018 15:30:25 - PixelValueManipulator pvm( build 12-Sep-2018 15:30:25 - _imageC, Region.get(), Mask build 12-Sep-2018 15:30:25 - ); build 12-Sep-2018 15:30:25 - pvm.setAxes(IPosition(iaxes)); build 12-Sep-2018 15:30:25 - pvm.setVerbosity( build 12-Sep-2018 15:30:25 - list ? ImageTask::DEAFENING : ImageTask::QUIET build 12-Sep-2018 15:30:25 + else if (_imageC) { build 12-Sep-2018 15:30:25 + return _getregion2( build 12-Sep-2018 15:30:25 + _imageC, region, axes, mask, list, build 12-Sep-2018 15:30:25 + dropdeg, getmask, stretch build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 - pvm.setDropDegen(dropdeg); build 12-Sep-2018 15:30:25 - pvm.setStretch(stretch); build 12-Sep-2018 15:30:25 - ret = pvm.get(); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - Array pixelmask = ret.asArrayBool("mask"); build 12-Sep-2018 15:30:25 - std::vector s_shape = pixelmask.shape().asStdVector(); build 12-Sep-2018 15:30:25 - if (getmask) { build 12-Sep-2018 15:30:25 - pixelmask.shape().asVector().tovector(s_shape); build 12-Sep-2018 15:30:25 - std::vector s_pixelmask(pixelmask.begin(), pixelmask.end()); build 12-Sep-2018 15:30:25 - return new ::casac::variant(s_pixelmask, s_shape); build 12-Sep-2018 15:30:25 + else if (_imageD) { build 12-Sep-2018 15:30:25 + return _getregion2( build 12-Sep-2018 15:30:25 + _imageD, region, axes, mask, list, build 12-Sep-2018 15:30:25 + dropdeg, getmask, stretch build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - else if (_imageF) { build 12-Sep-2018 15:30:25 - Array pixels = ret.asArrayFloat("values"); build 12-Sep-2018 15:30:25 - std::vector d_pixels(pixels.begin(), pixels.end()); build 12-Sep-2018 15:30:25 - return new ::casac::variant(d_pixels, s_shape); build 12-Sep-2018 15:30:25 + else if (_imageDC) { build 12-Sep-2018 15:30:25 + return _getregion2( build 12-Sep-2018 15:30:25 + _imageDC, region, axes, mask, list, build 12-Sep-2018 15:30:25 + dropdeg, getmask, stretch build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 else { build 12-Sep-2018 15:30:25 - Array pixels = ret.asArrayComplex("values"); build 12-Sep-2018 15:30:25 - std::vector > d_pixels(pixels.begin(), pixels.end()); build 12-Sep-2018 15:30:25 - return new ::casac::variant(d_pixels, s_shape); build 12-Sep-2018 15:30:25 + ThrowCc("Logic error"); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 catch (const AipsError& x) { build 12-Sep-2018 15:30:25 @@ -2588,6 +2639,62 @@ variant* image::getregion( build 12-Sep-2018 15:30:25 return nullptr; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 +template variant* image::_getregion2( build 12-Sep-2018 15:30:25 + SPIIT image, const variant& region, build 12-Sep-2018 15:30:25 + const std::vector& axes, const variant& mask, build 12-Sep-2018 15:30:25 + bool list, bool dropdeg, bool getmask, bool stretch build 12-Sep-2018 15:30:25 +) { build 12-Sep-2018 15:30:25 + auto Region = _getRegion(region, false); build 12-Sep-2018 15:30:25 + auto Mask = _getMask(mask); build 12-Sep-2018 15:30:25 + Vector iaxes(axes); build 12-Sep-2018 15:30:25 + // if default value change it to empty vector build 12-Sep-2018 15:30:25 + if (iaxes.size() == 1 && iaxes[0] < 0) { build 12-Sep-2018 15:30:25 + iaxes.resize(); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + PixelValueManipulator pvm( build 12-Sep-2018 15:30:25 + image, Region.get(), Mask build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + pvm.setAxes(IPosition(iaxes)); build 12-Sep-2018 15:30:25 + pvm.setVerbosity( build 12-Sep-2018 15:30:25 + list ? ImageTask::DEAFENING : ImageTask::QUIET build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + pvm.setDropDegen(dropdeg); build 12-Sep-2018 15:30:25 + pvm.setStretch(stretch); build 12-Sep-2018 15:30:25 + auto ret = pvm.get(); build 12-Sep-2018 15:30:25 + auto pixelmask = ret.asArrayBool("mask"); build 12-Sep-2018 15:30:25 + auto s_shape = pixelmask.shape().asStdVector(); build 12-Sep-2018 15:30:25 + if (getmask) { build 12-Sep-2018 15:30:25 + pixelmask.shape().asVector().tovector(s_shape); build 12-Sep-2018 15:30:25 + std::vector s_pixelmask(pixelmask.begin(), pixelmask.end()); build 12-Sep-2018 15:30:25 + return new ::casac::variant(s_pixelmask, s_shape); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + if (_imageF || _imageD) { build 12-Sep-2018 15:30:25 + std::vector d_pixels; build 12-Sep-2018 15:30:25 + if (_imageF) { build 12-Sep-2018 15:30:25 + auto pixels = ret.asArrayFloat("values"); build 12-Sep-2018 15:30:25 + d_pixels = std::vector(pixels.begin(), pixels.end()); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + d_pixels = ret.asArrayDouble("values").tovector(); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return new ::casac::variant(d_pixels, s_shape); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageC || _imageDC) { build 12-Sep-2018 15:30:25 + std::vector > d_pixels; build 12-Sep-2018 15:30:25 + if (_imageC) { build 12-Sep-2018 15:30:25 + auto pixels = ret.asArrayComplex("values"); build 12-Sep-2018 15:30:25 + d_pixels = std::vector>(pixels.begin(), pixels.end()); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + d_pixels = ret.asArrayDComplex("values").tovector(); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return new ::casac::variant(d_pixels, s_shape); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("Logic error"); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 record* image::getslice( build 12-Sep-2018 15:30:25 const std::vector& x, const std::vector& y, build 12-Sep-2018 15:30:25 const std::vector& axes, const std::vector& coord, build 12-Sep-2018 15:30:25 @@ -2598,30 +2705,52 @@ record* image::getslice( build 12-Sep-2018 15:30:25 if (_detached()) { build 12-Sep-2018 15:30:25 return nullptr; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - ThrowIf( build 12-Sep-2018 15:30:25 - ! _imageF, build 12-Sep-2018 15:30:25 - "This method only supports Float valued images" build 12-Sep-2018 15:30:25 - ); build 12-Sep-2018 15:30:25 - // handle default coord build 12-Sep-2018 15:30:25 - vector ncoord(coord); build 12-Sep-2018 15:30:25 + Vector ncoord(coord); build 12-Sep-2018 15:30:25 if (ncoord.size() == 1 && ncoord[0] == -1) { build 12-Sep-2018 15:30:25 - ncoord.assign(_imageF->ndim(), 0); build 12-Sep-2018 15:30:25 + ncoord.resize(shape().size()); build 12-Sep-2018 15:30:25 + ncoord.set(0); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 unique_ptr outRec; build 12-Sep-2018 15:30:25 if (_imageF) { build 12-Sep-2018 15:30:25 outRec.reset( build 12-Sep-2018 15:30:25 PixelValueManipulator::getSlice( build 12-Sep-2018 15:30:25 _imageF, Vector(x), Vector(y), build 12-Sep-2018 15:30:25 - Vector (axes), Vector (ncoord), build 12-Sep-2018 15:30:25 - npts, method build 12-Sep-2018 15:30:25 + Vector(axes), ncoord, npts, method build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + else if (_imageC) { build 12-Sep-2018 15:30:25 + outRec.reset( build 12-Sep-2018 15:30:25 + PixelValueManipulator::getSlice( build 12-Sep-2018 15:30:25 + _imageC, Vector(x), Vector(y), build 12-Sep-2018 15:30:25 + Vector(axes), ncoord, npts, method build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageD) { build 12-Sep-2018 15:30:25 + outRec.reset( build 12-Sep-2018 15:30:25 + PixelValueManipulator::getSlice( build 12-Sep-2018 15:30:25 + _imageD, Vector(x), Vector(y), build 12-Sep-2018 15:30:25 + Vector(axes), ncoord, npts, method build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageDC) { build 12-Sep-2018 15:30:25 + outRec.reset( build 12-Sep-2018 15:30:25 + PixelValueManipulator::getSlice( build 12-Sep-2018 15:30:25 + _imageDC, Vector(x), Vector(y), build 12-Sep-2018 15:30:25 + Vector(axes), ncoord, npts, method build 12-Sep-2018 15:30:25 + ) build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("Logic error"); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 return fromRecord(*outRec); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 catch (const AipsError& x) { build 12-Sep-2018 15:30:25 _log << LogIO::SEVERE << "Exception Reported: " << x.getMesg() build 12-Sep-2018 15:30:25 - << LogIO::POST; build 12-Sep-2018 15:30:25 + << LogIO::POST; build 12-Sep-2018 15:30:25 RETHROW(x); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 return nullptr; build 12-Sep-2018 15:30:25 @@ -2807,15 +2936,24 @@ std::vector image::history(bool list) { build 12-Sep-2018 15:30:25 return vector(); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 if (_imageF) { build 12-Sep-2018 15:30:25 - SPIIF im = _imageF; build 12-Sep-2018 15:30:25 - ImageHistory hist(im); build 12-Sep-2018 15:30:25 + ImageHistory hist(_imageF); build 12-Sep-2018 15:30:25 return fromVectorString(hist.get(list)); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - else { build 12-Sep-2018 15:30:25 - SPIIC im = _imageC; build 12-Sep-2018 15:30:25 - ImageHistory hist(im); build 12-Sep-2018 15:30:25 + else if (_imageC) { build 12-Sep-2018 15:30:25 + ImageHistory hist(_imageC); build 12-Sep-2018 15:30:25 + return fromVectorString(hist.get(list)); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageD) { build 12-Sep-2018 15:30:25 + ImageHistory hist(_imageD); build 12-Sep-2018 15:30:25 return fromVectorString(hist.get(list)); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + else if (_imageDC) { build 12-Sep-2018 15:30:25 + ImageHistory hist(_imageDC); build 12-Sep-2018 15:30:25 + return fromVectorString(hist.get(list)); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("Logic error"); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 } catch (const AipsError& x) { build 12-Sep-2018 15:30:25 _log << LogIO::SEVERE << "Exception Reported: " << x.getMesg() build 12-Sep-2018 15:30:25 << LogIO::POST; build 12-Sep-2018 15:30:25 @@ -3003,7 +3141,7 @@ bool image::isopen() { build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 catch (const AipsError& x) { build 12-Sep-2018 15:30:25 _log << LogIO::SEVERE << "Exception Reported: " << x.getMesg() build 12-Sep-2018 15:30:25 - << LogIO::POST; build 12-Sep-2018 15:30:25 + << LogIO::POST; build 12-Sep-2018 15:30:25 RETHROW(x); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 return false; build 12-Sep-2018 15:30:25 @@ -3278,12 +3416,24 @@ vector image::maskhandler( build 12-Sep-2018 15:30:25 if (_detached()) { build 12-Sep-2018 15:30:25 return vector(0); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - _notSupported(__func__); build 12-Sep-2018 15:30:25 String oper = op; build 12-Sep-2018 15:30:25 oper.upcase(); build 12-Sep-2018 15:30:25 - vector res = _imageF build 12-Sep-2018 15:30:25 - ? _handleMask(_imageF, oper, name) build 12-Sep-2018 15:30:25 - : _handleMask(_imageC, oper, name); build 12-Sep-2018 15:30:25 + vector res; build 12-Sep-2018 15:30:25 + if (_imageF) { build 12-Sep-2018 15:30:25 + res = _handleMask(_imageF, oper, name); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageC) { build 12-Sep-2018 15:30:25 + res = _handleMask(_imageC, oper, name); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageD) { build 12-Sep-2018 15:30:25 + res = _handleMask(_imageD, oper, name); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageDC) { build 12-Sep-2018 15:30:25 + res = _handleMask(_imageDC, oper, name); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("Logic error"); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 if (res.empty()) { build 12-Sep-2018 15:30:25 res = vector(1, "T"); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 @@ -3602,25 +3752,31 @@ String image::_name(bool strippath) const { build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 image* image::newimage(const string& fileName) { build 12-Sep-2018 15:30:25 - image *rstat = newimagefromfile(fileName); build 12-Sep-2018 15:30:25 - if (!rstat) build 12-Sep-2018 15:30:25 - throw AipsError("Unable to create image"); build 12-Sep-2018 15:30:25 - return rstat; build 12-Sep-2018 15:30:25 + try { build 12-Sep-2018 15:30:25 + _log << _ORIGIN; build 12-Sep-2018 15:30:25 + auto *rstat = newimagefromfile(fileName); build 12-Sep-2018 15:30:25 + ThrowIf(! rstat, "Unable to create image"); build 12-Sep-2018 15:30:25 + return rstat; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + catch (const AipsError& x) { build 12-Sep-2018 15:30:25 + _log << LogIO::SEVERE << "Exception Reported: " << x.getMesg() build 12-Sep-2018 15:30:25 + << LogIO::POST; build 12-Sep-2018 15:30:25 + RETHROW(x); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return nullptr; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 image* image::newimagefromarray( build 12-Sep-2018 15:30:25 const string& outfile, const variant& pixels, build 12-Sep-2018 15:30:25 const record& csys, bool linear, build 12-Sep-2018 15:30:25 - bool overwrite, bool log build 12-Sep-2018 15:30:25 + bool overwrite, bool log, const string& type build 12-Sep-2018 15:30:25 ) { build 12-Sep-2018 15:30:25 try { build 12-Sep-2018 15:30:25 - auto mypair = _fromarray( build 12-Sep-2018 15:30:25 + auto mytuple = _fromarray( build 12-Sep-2018 15:30:25 outfile, pixels, csys, build 12-Sep-2018 15:30:25 - linear, overwrite, log build 12-Sep-2018 15:30:25 + linear, overwrite, log, type build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 - auto res = mypair.first build 12-Sep-2018 15:30:25 - ? new image(mypair.first) build 12-Sep-2018 15:30:25 - : new image(mypair.second); build 12-Sep-2018 15:30:25 + auto* res = new image(mytuple); build 12-Sep-2018 15:30:25 vector names = { build 12-Sep-2018 15:30:25 "outfile", "pixels", "csys", build 12-Sep-2018 15:30:25 "linear", "overwrite", "log" build 12-Sep-2018 15:30:25 @@ -3638,7 +3794,7 @@ image* image::newimagefromarray( build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 catch (const AipsError& x) { build 12-Sep-2018 15:30:25 _log << LogIO::SEVERE << "Exception Reported: " << x.getMesg() build 12-Sep-2018 15:30:25 - << LogIO::POST; build 12-Sep-2018 15:30:25 + << LogIO::POST; build 12-Sep-2018 15:30:25 RETHROW(x); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 return nullptr; build 12-Sep-2018 15:30:25 @@ -3647,24 +3803,9 @@ image* image::newimagefromarray( build 12-Sep-2018 15:30:25 image* image::newimagefromfile(const string& fileName) { build 12-Sep-2018 15:30:25 try { build 12-Sep-2018 15:30:25 _log << _ORIGIN; build 12-Sep-2018 15:30:25 - SPIIF imageF; build 12-Sep-2018 15:30:25 - SPIIC imageC; build 12-Sep-2018 15:30:25 - std::tie(imageF, imageC, std::ignore, std::ignore) build 12-Sep-2018 15:30:25 - = ImageFactory::fromFile(fileName); build 12-Sep-2018 15:30:25 - if (imageF || imageC) { build 12-Sep-2018 15:30:25 - unique_ptr ret( build 12-Sep-2018 15:30:25 - imageF ? new image(imageF) build 12-Sep-2018 15:30:25 - : new image(imageC) build 12-Sep-2018 15:30:25 - ); build 12-Sep-2018 15:30:25 - // not adding history because all this method does is open build 12-Sep-2018 15:30:25 - // the image, it doesn't change it build 12-Sep-2018 15:30:25 - return ret.release(); build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - else { build 12-Sep-2018 15:30:25 - _log << LogIO::WARN << "Pixel data type of requested image not supported" build 12-Sep-2018 15:30:25 - << LogIO::POST; build 12-Sep-2018 15:30:25 - return new image(); build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 + // not adding history because all this method does is open build 12-Sep-2018 15:30:25 + // the image, it doesn't change it build 12-Sep-2018 15:30:25 + return new image(ImageFactory::fromFile(fileName)); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 catch (const AipsError& x) { build 12-Sep-2018 15:30:25 _log << LogIO::SEVERE << "Exception Reported: " << x.getMesg() build 12-Sep-2018 15:30:25 @@ -3695,14 +3836,23 @@ image* image::newimagefromimage( build 12-Sep-2018 15:30:25 infile, outfile, region, build 12-Sep-2018 15:30:25 vmask, dropdeg, overwrite build 12-Sep-2018 15:30:25 }; build 12-Sep-2018 15:30:25 - if (ret.first) { build 12-Sep-2018 15:30:25 - _addHistory(ret.first, __func__, names, values); build 12-Sep-2018 15:30:25 - return new image(ret.first); build 12-Sep-2018 15:30:25 + auto f = std::get<0>(ret); build 12-Sep-2018 15:30:25 + auto c = std::get<1>(ret); build 12-Sep-2018 15:30:25 + auto d = std::get<2>(ret); build 12-Sep-2018 15:30:25 + auto dc = std::get<3>(ret); build 12-Sep-2018 15:30:25 + if (f) { build 12-Sep-2018 15:30:25 + _addHistory(f, __func__, names, values); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (c) { build 12-Sep-2018 15:30:25 + _addHistory(c, __func__, names, values); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - else if (ret.second) { build 12-Sep-2018 15:30:25 - _addHistory(ret.second, __func__, names, values); build 12-Sep-2018 15:30:25 - return new image(ret.second); build 12-Sep-2018 15:30:25 + else if (d) { build 12-Sep-2018 15:30:25 + _addHistory(d, __func__, names, values); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + else if (dc) { build 12-Sep-2018 15:30:25 + _addHistory(dc, __func__, names, values); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return new image(ret); build 12-Sep-2018 15:30:25 ThrowCc("Error creating image"); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 catch (const AipsError& x) { build 12-Sep-2018 15:30:25 @@ -3714,34 +3864,18 @@ image* image::newimagefromimage( build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 image* image::newimagefromshape( build 12-Sep-2018 15:30:25 - const string& outfile, const vector& shape, build 12-Sep-2018 15:30:25 - const record& csys, bool linear, build 12-Sep-2018 15:30:25 - bool overwrite, bool log, const string& type build 12-Sep-2018 15:30:25 + const string& outfile, const vector& shape, const record& csys, build 12-Sep-2018 15:30:25 + bool linear, bool overwrite, bool log, const string& type build 12-Sep-2018 15:30:25 ) { build 12-Sep-2018 15:30:25 try { build 12-Sep-2018 15:30:25 _log << _ORIGIN; build 12-Sep-2018 15:30:25 - unique_ptr coordinates(toRecord(csys)); build 12-Sep-2018 15:30:25 - String mytype = type; build 12-Sep-2018 15:30:25 - mytype.downcase(); build 12-Sep-2018 15:30:25 + unique_ptr ret(new image()); build 12-Sep-2018 15:30:25 + ret->dohistory(False); build 12-Sep-2018 15:30:25 ThrowIf( build 12-Sep-2018 15:30:25 - ! mytype.startsWith("f") && ! mytype.startsWith("c"), build 12-Sep-2018 15:30:25 - "Input parm type must start with either 'f' or 'c'" build 12-Sep-2018 15:30:25 + ! ret->fromshape( build 12-Sep-2018 15:30:25 + outfile, shape, csys, linear, overwrite, log, type build 12-Sep-2018 15:30:25 + ), "Failed to create image from shape" build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 - unique_ptr ret; build 12-Sep-2018 15:30:25 - if (mytype.startsWith("f")) { build 12-Sep-2018 15:30:25 - SPIIF myfloat = ImageFactory::floatImageFromShape( build 12-Sep-2018 15:30:25 - outfile, shape, *coordinates, build 12-Sep-2018 15:30:25 - linear, overwrite, log build 12-Sep-2018 15:30:25 - ); build 12-Sep-2018 15:30:25 - ret.reset(new image(myfloat)); build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - else { build 12-Sep-2018 15:30:25 - SPIIC mycomplex = ImageFactory::complexImageFromShape( build 12-Sep-2018 15:30:25 - outfile, shape, *coordinates, build 12-Sep-2018 15:30:25 - linear, overwrite, log build 12-Sep-2018 15:30:25 - ); build 12-Sep-2018 15:30:25 - ret.reset(new image(mycomplex)); build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 vector names { build 12-Sep-2018 15:30:25 "outfile", "shape", "csys", "linear", build 12-Sep-2018 15:30:25 "overwrite", "log", "type" build 12-Sep-2018 15:30:25 @@ -3750,6 +3884,7 @@ image* image::newimagefromshape( build 12-Sep-2018 15:30:25 outfile, shape, csys, linear, build 12-Sep-2018 15:30:25 overwrite, log, type build 12-Sep-2018 15:30:25 }; build 12-Sep-2018 15:30:25 + ret->dohistory(True); build 12-Sep-2018 15:30:25 if (_doHistory) { build 12-Sep-2018 15:30:25 ret->_addHistory(__func__, names, values); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 @@ -3927,6 +4062,36 @@ image* image::pbcor( build 12-Sep-2018 15:30:25 return nullptr; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 +std::string image::pixeltype() { build 12-Sep-2018 15:30:25 + try { build 12-Sep-2018 15:30:25 + _log << _ORIGIN; build 12-Sep-2018 15:30:25 + if (_detached()) { build 12-Sep-2018 15:30:25 + return ""; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + if (_imageF) { build 12-Sep-2018 15:30:25 + return "float"; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageC) { build 12-Sep-2018 15:30:25 + return "complex"; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageD) { build 12-Sep-2018 15:30:25 + return "double"; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageDC) { build 12-Sep-2018 15:30:25 + return "dcomplex"; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("Logic error"); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + catch (const AipsError& x) { build 12-Sep-2018 15:30:25 + _log << LogIO::SEVERE << "Exception Reported: " << x.getMesg() build 12-Sep-2018 15:30:25 + << LogIO::POST; build 12-Sep-2018 15:30:25 + RETHROW(x); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return ""; build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 record* image::pixelvalue(const vector& pixel) { build 12-Sep-2018 15:30:25 try { build 12-Sep-2018 15:30:25 _log << _ORIGIN; build 12-Sep-2018 15:30:25 @@ -4070,88 +4235,42 @@ template void image::_putchunk( build 12-Sep-2018 15:30:25 bool image::putregion( build 12-Sep-2018 15:30:25 const variant& v_pixels, const variant& v_pixelmask, build 12-Sep-2018 15:30:25 const variant& region, bool list, bool usemask, build 12-Sep-2018 15:30:25 - bool , bool replicateArray build 12-Sep-2018 15:30:25 + bool, bool replicateArray build 12-Sep-2018 15:30:25 ) { build 12-Sep-2018 15:30:25 try { build 12-Sep-2018 15:30:25 _log << _ORIGIN; build 12-Sep-2018 15:30:25 if (_detached()) { build 12-Sep-2018 15:30:25 return false; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - _notSupported(__func__); build 12-Sep-2018 15:30:25 - // create Array pixels build 12-Sep-2018 15:30:25 - Array pixels; build 12-Sep-2018 15:30:25 - if (_isUnset(v_pixels)) { build 12-Sep-2018 15:30:25 - // do nothing build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - else if (v_pixels.type() == ::casac::variant::DOUBLEVEC) { build 12-Sep-2018 15:30:25 - std::vector pixelVector = v_pixels.getDoubleVec(); build 12-Sep-2018 15:30:25 - Vector shape = v_pixels.arrayshape(); build 12-Sep-2018 15:30:25 - pixels.resize(IPosition(shape)); build 12-Sep-2018 15:30:25 - Vector localpix(pixelVector); build 12-Sep-2018 15:30:25 - casacore::convertArray(pixels, localpix.reform(IPosition(shape))); build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - else if (v_pixels.type() == ::casac::variant::INTVEC) { build 12-Sep-2018 15:30:25 - std::vector pixelVector = v_pixels.getIntVec(); build 12-Sep-2018 15:30:25 - Vector shape = v_pixels.arrayshape(); build 12-Sep-2018 15:30:25 - pixels.resize(IPosition(shape)); build 12-Sep-2018 15:30:25 - Vector localpix(pixelVector); build 12-Sep-2018 15:30:25 - casacore::convertArray(pixels, localpix.reform(IPosition(shape))); build 12-Sep-2018 15:30:25 + Bool ret; build 12-Sep-2018 15:30:25 + if (_imageF) { build 12-Sep-2018 15:30:25 + ret = _putregionReal( build 12-Sep-2018 15:30:25 + _imageF, v_pixels, v_pixelmask, region, build 12-Sep-2018 15:30:25 + list, usemask, replicateArray build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - else { build 12-Sep-2018 15:30:25 - _log << LogIO::SEVERE build 12-Sep-2018 15:30:25 - << "pixels is not understood, try using an array " build 12-Sep-2018 15:30:25 - << LogIO::POST; build 12-Sep-2018 15:30:25 - return false; build 12-Sep-2018 15:30:25 + else if (_imageC) { build 12-Sep-2018 15:30:25 + ret = _putregionComplex( build 12-Sep-2018 15:30:25 + _imageC, v_pixels, v_pixelmask, region, build 12-Sep-2018 15:30:25 + list, usemask, replicateArray build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 - // create Array mask build 12-Sep-2018 15:30:25 - Array mask; build 12-Sep-2018 15:30:25 - if (_isUnset(v_pixelmask)) { build 12-Sep-2018 15:30:25 - // do nothing build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - else if (v_pixelmask.type() == ::casac::variant::DOUBLEVEC) { build 12-Sep-2018 15:30:25 - std::vector maskVector = v_pixelmask.getDoubleVec(); build 12-Sep-2018 15:30:25 - Vector shape = v_pixelmask.arrayshape(); build 12-Sep-2018 15:30:25 - mask.resize(IPosition(shape)); build 12-Sep-2018 15:30:25 - Vector localmask(maskVector); build 12-Sep-2018 15:30:25 - casacore::convertArray(mask, localmask.reform(IPosition(shape))); build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - else if (v_pixelmask.type() == ::casac::variant::INTVEC) { build 12-Sep-2018 15:30:25 - std::vector maskVector = v_pixelmask.getIntVec(); build 12-Sep-2018 15:30:25 - Vector shape = v_pixelmask.arrayshape(); build 12-Sep-2018 15:30:25 - mask.resize(IPosition(shape)); build 12-Sep-2018 15:30:25 - Vector localmask(maskVector); build 12-Sep-2018 15:30:25 - casacore::convertArray(mask, localmask.reform(IPosition(shape))); build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - else if (v_pixelmask.type() == ::casac::variant::BOOLVEC) { build 12-Sep-2018 15:30:25 - std::vector maskVector = v_pixelmask.getBoolVec(); build 12-Sep-2018 15:30:25 - Vector shape = v_pixelmask.arrayshape(); build 12-Sep-2018 15:30:25 - mask.resize(IPosition(shape)); build 12-Sep-2018 15:30:25 - Vector localmask(maskVector); build 12-Sep-2018 15:30:25 - // casacore::convertArray(mask,localmask.reform(IPosition(shape))); build 12-Sep-2018 15:30:25 - mask = localmask.reform(IPosition(shape)); build 12-Sep-2018 15:30:25 + else if (_imageD) { build 12-Sep-2018 15:30:25 + ret = _putregionReal( build 12-Sep-2018 15:30:25 + _imageD, v_pixels, v_pixelmask, region, build 12-Sep-2018 15:30:25 + list, usemask, replicateArray build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - else { build 12-Sep-2018 15:30:25 - _log << LogIO::SEVERE build 12-Sep-2018 15:30:25 - << "mask is not understood, try using an array " build 12-Sep-2018 15:30:25 - << LogIO::POST; build 12-Sep-2018 15:30:25 - return false; build 12-Sep-2018 15:30:25 + else if (_imageDC) { build 12-Sep-2018 15:30:25 + ret = _putregionComplex( build 12-Sep-2018 15:30:25 + _imageDC, v_pixels, v_pixelmask, region, build 12-Sep-2018 15:30:25 + list, usemask, replicateArray build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - if (pixels.size() == 0 && mask.size() == 0) { build 12-Sep-2018 15:30:25 - _log << "You must specify at least either the pixels or the mask" build 12-Sep-2018 15:30:25 - << LogIO::POST; build 12-Sep-2018 15:30:25 - return false; build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("Logic error") build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - auto theRegion = _getRegion(region, false); build 12-Sep-2018 15:30:25 - if ( build 12-Sep-2018 15:30:25 - ( build 12-Sep-2018 15:30:25 - _imageF build 12-Sep-2018 15:30:25 - && PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:25 - _imageF, pixels, mask, *theRegion, build 12-Sep-2018 15:30:25 - list, usemask, replicateArray build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 - ) { build 12-Sep-2018 15:30:25 + if (ret) { build 12-Sep-2018 15:30:25 _stats.reset(0); build 12-Sep-2018 15:30:25 vector names { build 12-Sep-2018 15:30:25 "pixels", "pixelmask", "region", build 12-Sep-2018 15:30:25 @@ -4164,9 +4283,11 @@ bool image::putregion( build 12-Sep-2018 15:30:25 replicateArray build 12-Sep-2018 15:30:25 }; build 12-Sep-2018 15:30:25 _addHistory(__func__, names, values); build 12-Sep-2018 15:30:25 - return true; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - ThrowCc("Error putting region."); build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("Error putting region."); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return ret; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 catch (const AipsError& x) { build 12-Sep-2018 15:30:25 _log << LogIO::SEVERE << "Exception Reported: " << x.getMesg() build 12-Sep-2018 15:30:25 @@ -4176,6 +4297,117 @@ bool image::putregion( build 12-Sep-2018 15:30:25 return false; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +template bool image::_putregionComplex( build 12-Sep-2018 15:30:25 + SPIIT image, const variant& v_pixels, const variant& v_pixelmask, build 12-Sep-2018 15:30:25 + const variant& region, bool list, bool usemask, build 12-Sep-2018 15:30:25 + bool replicateArray build 12-Sep-2018 15:30:25 +) { build 12-Sep-2018 15:30:25 + Array pixels; build 12-Sep-2018 15:30:25 + if (! _isUnset(v_pixels)) { build 12-Sep-2018 15:30:25 + IPosition shape(v_pixels.arrayshape()); build 12-Sep-2018 15:30:25 + auto mytype = v_pixels.type(); build 12-Sep-2018 15:30:25 + ThrowIf( build 12-Sep-2018 15:30:25 + mytype == variant::DOUBLEVEC || mytype == variant::INTVEC, build 12-Sep-2018 15:30:25 + "Real values cannot be put in images with complex valued pixels" build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + if (mytype == variant::COMPLEXVEC) { build 12-Sep-2018 15:30:25 + _convertArray( build 12-Sep-2018 15:30:25 + pixels, Vector(v_pixels.getComplexVec()), shape build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("pixels is not understood, try using an array of real values"); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return _putregion2( build 12-Sep-2018 15:30:25 + image, pixels, v_pixelmask, region, list, build 12-Sep-2018 15:30:25 + usemask, replicateArray build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +template bool image::_putregionReal( build 12-Sep-2018 15:30:25 + SPIIT image, const variant& v_pixels, const variant& v_pixelmask, build 12-Sep-2018 15:30:25 + const variant& region, bool list, bool usemask, build 12-Sep-2018 15:30:25 + bool replicateArray build 12-Sep-2018 15:30:25 +) { build 12-Sep-2018 15:30:25 + Array pixels; build 12-Sep-2018 15:30:25 + if (! _isUnset(v_pixels)) { build 12-Sep-2018 15:30:25 + IPosition shape(v_pixels.arrayshape()); build 12-Sep-2018 15:30:25 + auto mytype = v_pixels.type(); build 12-Sep-2018 15:30:25 + ThrowIf( build 12-Sep-2018 15:30:25 + mytype == variant::COMPLEXVEC, build 12-Sep-2018 15:30:25 + "Complex values cannot be put in images with real valued pixels" build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + if (mytype == variant::DOUBLEVEC) { build 12-Sep-2018 15:30:25 + _convertArray( build 12-Sep-2018 15:30:25 + pixels, Vector(v_pixels.getDoubleVec()), shape build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (mytype == variant::INTVEC) { build 12-Sep-2018 15:30:25 + _convertArray( build 12-Sep-2018 15:30:25 + pixels, Vector(v_pixels.getIntVec()), shape build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("pixels is not understood, try using an array of real values"); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return _putregion2( build 12-Sep-2018 15:30:25 + image, pixels, v_pixelmask, region, list, build 12-Sep-2018 15:30:25 + usemask, replicateArray build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +template bool image::_putregion2( build 12-Sep-2018 15:30:25 + SPIIT image, const Array& pixels, const variant& v_pixelmask, build 12-Sep-2018 15:30:25 + const variant& region, bool list, bool usemask, build 12-Sep-2018 15:30:25 + bool replicateArray build 12-Sep-2018 15:30:25 +) { build 12-Sep-2018 15:30:25 + Array mask; build 12-Sep-2018 15:30:25 + if (! _isUnset(v_pixelmask)) { build 12-Sep-2018 15:30:25 + IPosition shape(v_pixelmask.arrayshape()); build 12-Sep-2018 15:30:25 + auto mytype = v_pixelmask.type(); build 12-Sep-2018 15:30:25 + if (mytype == variant::DOUBLEVEC) { build 12-Sep-2018 15:30:25 + _convertArray( build 12-Sep-2018 15:30:25 + mask, Vector(v_pixelmask.getDoubleVec()), shape build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (mytype == variant::INTVEC) { build 12-Sep-2018 15:30:25 + _convertArray( build 12-Sep-2018 15:30:25 + mask, Vector(v_pixelmask.getIntVec()), shape build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (mytype == ::casac::variant::BOOLVEC) { build 12-Sep-2018 15:30:25 + _convertArray( build 12-Sep-2018 15:30:25 + mask, Vector(v_pixelmask.getBoolVec()), shape build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("mask is not understood, try using an array"); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + if (pixels.empty() && mask.empty()) { build 12-Sep-2018 15:30:25 + ThrowCc( build 12-Sep-2018 15:30:25 + "You must specify at least either the pixels or the mask" build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + auto theRegion = _getRegion(region, false); build 12-Sep-2018 15:30:25 + return PixelValueManipulator::putRegion( build 12-Sep-2018 15:30:25 + image, pixels, mask, *theRegion, build 12-Sep-2018 15:30:25 + list, usemask, replicateArray build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +template build 12-Sep-2018 15:30:25 +void image::_convertArray( build 12-Sep-2018 15:30:25 + casacore::Array& out, const casacore::Vector& in, build 12-Sep-2018 15:30:25 + const IPosition& shape build 12-Sep-2018 15:30:25 +) { build 12-Sep-2018 15:30:25 + out.resize(shape); build 12-Sep-2018 15:30:25 + convertArray(out, in.reform(shape)); build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 image* image::pv( build 12-Sep-2018 15:30:25 const string& outfile, const variant& start, build 12-Sep-2018 15:30:25 const variant& end, const variant& center, const variant& length, build 12-Sep-2018 15:30:25 @@ -4464,28 +4696,24 @@ image* image::rebin( build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 image* image::regrid( build 12-Sep-2018 15:30:25 - const string& outfile, const vector& inshape, build 12-Sep-2018 15:30:25 - const record& csys, const vector& inaxes, build 12-Sep-2018 15:30:25 - const variant& region, const variant& vmask, build 12-Sep-2018 15:30:25 - const string& method, int decimate, bool replicate, build 12-Sep-2018 15:30:25 - bool doRefChange, bool dropDegenerateAxes, build 12-Sep-2018 15:30:25 - bool overwrite, bool forceRegrid, build 12-Sep-2018 15:30:25 - bool specAsVelocity, bool /* async */, build 12-Sep-2018 15:30:25 - bool stretch build 12-Sep-2018 15:30:25 + const string& outfile, const vector& inshape, const record& csys, build 12-Sep-2018 15:30:25 + const vector& inaxes, const variant& region, const variant& vmask, build 12-Sep-2018 15:30:25 + const string& method, int decimate, bool replicate, bool doRefChange, build 12-Sep-2018 15:30:25 + bool dropDegenerateAxes, bool overwrite, bool forceRegrid, build 12-Sep-2018 15:30:25 + bool specAsVelocity, bool /* async */, bool stretch build 12-Sep-2018 15:30:25 ) { build 12-Sep-2018 15:30:25 try { build 12-Sep-2018 15:30:25 LogOrigin lor(_class, __func__); build 12-Sep-2018 15:30:25 _log << lor; build 12-Sep-2018 15:30:25 if (_detached()) { build 12-Sep-2018 15:30:25 - throw AipsError("Unable to create image"); build 12-Sep-2018 15:30:25 - return 0; build 12-Sep-2018 15:30:25 + ThrowCc("Unable to create image"); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - _notSupported(__func__); build 12-Sep-2018 15:30:25 unique_ptr csysRec(toRecord(csys)); build 12-Sep-2018 15:30:25 - unique_ptr coordinates(CoordinateSystem::restore(*csysRec, "")); build 12-Sep-2018 15:30:25 + unique_ptr coordinates( build 12-Sep-2018 15:30:25 + CoordinateSystem::restore(*csysRec, "") build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 ThrowIf ( build 12-Sep-2018 15:30:25 - ! coordinates.get(), build 12-Sep-2018 15:30:25 - "Invalid specified coordinate system record." build 12-Sep-2018 15:30:25 + ! coordinates.get(), "Invalid specified coordinate system record." build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 auto regionPtr = _getRegion(region, true); build 12-Sep-2018 15:30:25 String mask = _getMask(vmask); build 12-Sep-2018 15:30:25 @@ -4496,44 +4724,64 @@ image* image::regrid( build 12-Sep-2018 15:30:25 vector msgs; build 12-Sep-2018 15:30:25 if (_doHistory) { build 12-Sep-2018 15:30:25 vector names { build 12-Sep-2018 15:30:25 - "outfile", "shape", "csys", "axes", build 12-Sep-2018 15:30:25 - "region", "mask", "method", "decimate", build 12-Sep-2018 15:30:25 - "replicate", "doref", "dropdegen", build 12-Sep-2018 15:30:25 - "overwrite", "force", "asvelocity", "stretch" build 12-Sep-2018 15:30:25 + "outfile", "shape", "csys", "axes", "region", "mask", "method", build 12-Sep-2018 15:30:25 + "decimate", "replicate", "doref", "dropdegen", "overwrite", build 12-Sep-2018 15:30:25 + "force", "asvelocity", "stretch" build 12-Sep-2018 15:30:25 }; build 12-Sep-2018 15:30:25 vector values { build 12-Sep-2018 15:30:25 - outfile, inshape, csys, inaxes, build 12-Sep-2018 15:30:25 - region, vmask, method, decimate, replicate, build 12-Sep-2018 15:30:25 - doRefChange, dropDegenerateAxes, build 12-Sep-2018 15:30:25 - overwrite, forceRegrid, build 12-Sep-2018 15:30:25 - specAsVelocity, stretch build 12-Sep-2018 15:30:25 + outfile, inshape, csys, inaxes, region, vmask, method, decimate, build 12-Sep-2018 15:30:25 + replicate, doRefChange, dropDegenerateAxes, overwrite, build 12-Sep-2018 15:30:25 + forceRegrid, specAsVelocity, stretch build 12-Sep-2018 15:30:25 }; build 12-Sep-2018 15:30:25 msgs = _newHistory(__func__, names, values); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 if (_imageF) { build 12-Sep-2018 15:30:25 - ImageRegridder regridder( build 12-Sep-2018 15:30:25 - _imageF, regionPtr.get(), build 12-Sep-2018 15:30:25 - mask, outfile, overwrite, *coordinates, build 12-Sep-2018 15:30:25 - IPosition(axes), IPosition(inshape) build 12-Sep-2018 15:30:25 + ImageRegridder regridder( build 12-Sep-2018 15:30:25 + _imageF, regionPtr.get(), mask, outfile, overwrite, build 12-Sep-2018 15:30:25 + *coordinates, IPosition(axes), IPosition(inshape) build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 return _regrid( build 12-Sep-2018 15:30:25 - regridder, method, decimate, replicate, build 12-Sep-2018 15:30:25 - doRefChange, forceRegrid, specAsVelocity, build 12-Sep-2018 15:30:25 - stretch, dropDegenerateAxes, lor, msgs build 12-Sep-2018 15:30:25 + regridder, method, decimate, replicate, doRefChange, build 12-Sep-2018 15:30:25 + forceRegrid, specAsVelocity, stretch, dropDegenerateAxes, lor, build 12-Sep-2018 15:30:25 + msgs build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - else { build 12-Sep-2018 15:30:25 - ComplexImageRegridder regridder( build 12-Sep-2018 15:30:25 - _imageC, regionPtr.get(), build 12-Sep-2018 15:30:25 - mask, outfile, overwrite, *coordinates, build 12-Sep-2018 15:30:25 - IPosition(axes), IPosition(inshape) build 12-Sep-2018 15:30:25 + else if (_imageC) { build 12-Sep-2018 15:30:25 + ComplexImageRegridder regridder( build 12-Sep-2018 15:30:25 + _imageC, regionPtr.get(), mask, outfile, overwrite, build 12-Sep-2018 15:30:25 + *coordinates, IPosition(axes), IPosition(inshape) build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + return _regrid( build 12-Sep-2018 15:30:25 + regridder, method, decimate, replicate, doRefChange, build 12-Sep-2018 15:30:25 + forceRegrid, specAsVelocity, stretch, dropDegenerateAxes, lor, build 12-Sep-2018 15:30:25 + msgs build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + if (_imageD) { build 12-Sep-2018 15:30:25 + ImageRegridder regridder( build 12-Sep-2018 15:30:25 + _imageD, regionPtr.get(), mask, outfile, overwrite, build 12-Sep-2018 15:30:25 + *coordinates, IPosition(axes), IPosition(inshape) build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 return _regrid( build 12-Sep-2018 15:30:25 - regridder, method, decimate, replicate, build 12-Sep-2018 15:30:25 - doRefChange, forceRegrid, specAsVelocity, build 12-Sep-2018 15:30:25 - stretch, dropDegenerateAxes, lor, msgs build 12-Sep-2018 15:30:25 + regridder, method, decimate, replicate, doRefChange, build 12-Sep-2018 15:30:25 + forceRegrid, specAsVelocity, stretch, dropDegenerateAxes, lor, build 12-Sep-2018 15:30:25 + msgs build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + else if (_imageDC) { build 12-Sep-2018 15:30:25 + ComplexImageRegridder regridder( build 12-Sep-2018 15:30:25 + _imageDC, regionPtr.get(), mask, outfile, overwrite, build 12-Sep-2018 15:30:25 + *coordinates, IPosition(axes), IPosition(inshape) build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + return _regrid( build 12-Sep-2018 15:30:25 + regridder, method, decimate, replicate, doRefChange, build 12-Sep-2018 15:30:25 + forceRegrid, specAsVelocity, stretch, dropDegenerateAxes, lor, build 12-Sep-2018 15:30:25 + msgs build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("Logic Error"); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 catch (const AipsError& x) { build 12-Sep-2018 15:30:25 _log << LogIO::SEVERE << "Exception Reported: " << x.getMesg() build 12-Sep-2018 15:30:25 @@ -5416,67 +5664,44 @@ record* image::statistics( build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 image* image::subimage( build 12-Sep-2018 15:30:25 - const string& outfile, const variant& region, build 12-Sep-2018 15:30:25 - const variant& vmask, bool dropDegenerateAxes, build 12-Sep-2018 15:30:25 - bool overwrite, bool list, bool stretch, build 12-Sep-2018 15:30:25 + const string& outfile, const variant& region, const variant& vmask, build 12-Sep-2018 15:30:25 + bool dropDegenerateAxes, bool overwrite, bool list, bool stretch, build 12-Sep-2018 15:30:25 bool wantreturn, const vector& keepaxes build 12-Sep-2018 15:30:25 ) { build 12-Sep-2018 15:30:25 try { build 12-Sep-2018 15:30:25 _log << _ORIGIN; build 12-Sep-2018 15:30:25 - ThrowIf( build 12-Sep-2018 15:30:25 - _detached(), build 12-Sep-2018 15:30:25 - "Unable to create image" build 12-Sep-2018 15:30:25 - ); build 12-Sep-2018 15:30:25 - _notSupported(__func__); build 12-Sep-2018 15:30:25 - SHARED_PTR regionRec = _getRegion(region, false); build 12-Sep-2018 15:30:25 - String regionStr = region.type() == variant::STRING build 12-Sep-2018 15:30:25 - ? region.toString() build 12-Sep-2018 15:30:25 - : ""; build 12-Sep-2018 15:30:25 - String mask = vmask.toString(); build 12-Sep-2018 15:30:25 - if (mask == "[]") { build 12-Sep-2018 15:30:25 - mask = ""; build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 + ThrowIf(_detached(), "Unable to create image"); build 12-Sep-2018 15:30:25 if (outfile.empty() && ! wantreturn) { build 12-Sep-2018 15:30:25 - _log << LogIO::WARN << "outfile was not specified and wantreturn is false. " build 12-Sep-2018 15:30:25 - << "The resulting image will be inaccessible" << LogIO::POST; build 12-Sep-2018 15:30:25 - } build 12-Sep-2018 15:30:25 - vector names; build 12-Sep-2018 15:30:25 - vector values; build 12-Sep-2018 15:30:25 - if (_doHistory) { build 12-Sep-2018 15:30:25 - vector n { build 12-Sep-2018 15:30:25 - "outfile", "region", "mask", "dropdeg", "overwrite", build 12-Sep-2018 15:30:25 - "list", "stretch", "wantreturn", "keepaxes" build 12-Sep-2018 15:30:25 - }; build 12-Sep-2018 15:30:25 - vector v { build 12-Sep-2018 15:30:25 - outfile, region, vmask, dropDegenerateAxes, build 12-Sep-2018 15:30:25 - overwrite, list, stretch, wantreturn, keepaxes build 12-Sep-2018 15:30:25 - }; build 12-Sep-2018 15:30:25 - names = n; build 12-Sep-2018 15:30:25 - values = v; build 12-Sep-2018 15:30:25 + _log << LogIO::WARN << "outfile was not specified and wantreturn " build 12-Sep-2018 15:30:25 + << "is false. The resulting image will be inaccessible" build 12-Sep-2018 15:30:25 + << LogIO::POST; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 if (_imageF) { build 12-Sep-2018 15:30:25 - auto im = _subimage( build 12-Sep-2018 15:30:25 - SHARED_PTR >( build 12-Sep-2018 15:30:25 - _imageF->cloneII() build 12-Sep-2018 15:30:25 - ), build 12-Sep-2018 15:30:25 - outfile, *regionRec, mask, dropDegenerateAxes, build 12-Sep-2018 15:30:25 - overwrite, list, stretch, keepaxes build 12-Sep-2018 15:30:25 + return _subimage( build 12-Sep-2018 15:30:25 + _imageF, outfile, region, vmask, dropDegenerateAxes, overwrite, build 12-Sep-2018 15:30:25 + list, stretch, keepaxes, wantreturn build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 - _addHistory(im, __func__, names, values); build 12-Sep-2018 15:30:25 - auto res = wantreturn ? new image(im) : nullptr; build 12-Sep-2018 15:30:25 - return res; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - else { build 12-Sep-2018 15:30:25 - auto im = _subimage( build 12-Sep-2018 15:30:25 - SHARED_PTR >( build 12-Sep-2018 15:30:25 - _imageC->cloneII() build 12-Sep-2018 15:30:25 - ), build 12-Sep-2018 15:30:25 - outfile, *regionRec, mask, dropDegenerateAxes, build 12-Sep-2018 15:30:25 - overwrite, list, stretch, keepaxes build 12-Sep-2018 15:30:25 + else if (_imageC) { build 12-Sep-2018 15:30:25 + return _subimage( build 12-Sep-2018 15:30:25 + _imageC, outfile, region, vmask, dropDegenerateAxes, overwrite, build 12-Sep-2018 15:30:25 + list, stretch, keepaxes, wantreturn build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageD) { build 12-Sep-2018 15:30:25 + return _subimage( build 12-Sep-2018 15:30:25 + _imageD, outfile, region, vmask, dropDegenerateAxes, overwrite, build 12-Sep-2018 15:30:25 + list, stretch, keepaxes, wantreturn build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 - _addHistory(im, __func__, names, values); build 12-Sep-2018 15:30:25 - auto res = wantreturn ? new image(im) : nullptr; build 12-Sep-2018 15:30:25 - return res; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else if (_imageDC) { build 12-Sep-2018 15:30:25 + return _subimage( build 12-Sep-2018 15:30:25 + _imageDC, outfile, region, vmask, dropDegenerateAxes, overwrite, build 12-Sep-2018 15:30:25 + list, stretch, keepaxes, wantreturn build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + ThrowCc("Logic error"); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 catch (const AipsError& x) { build 12-Sep-2018 15:30:25 @@ -5487,30 +5712,39 @@ image* image::subimage( build 12-Sep-2018 15:30:25 return nullptr; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -template SPIIT image::_subimage( build 12-Sep-2018 15:30:25 - SPIIT clone, build 12-Sep-2018 15:30:25 - const String& outfile, const Record& region, build 12-Sep-2018 15:30:25 - const String& mask, bool dropDegenerateAxes, build 12-Sep-2018 15:30:25 - bool overwrite, bool list, bool stretch, build 12-Sep-2018 15:30:25 - const vector& keepaxes build 12-Sep-2018 15:30:25 +template image* image::_subimage( build 12-Sep-2018 15:30:25 + SPIIT clone, const String& outfile, const variant& region, build 12-Sep-2018 15:30:25 + const variant& vmask, bool dropDegenerateAxes, bool overwrite, bool list, build 12-Sep-2018 15:30:25 + bool stretch, const vector& keepaxes, bool wantreturn build 12-Sep-2018 15:30:25 ) { build 12-Sep-2018 15:30:25 + SPIIT im; build 12-Sep-2018 15:30:25 + auto regionRec = _getRegion(region, false); build 12-Sep-2018 15:30:25 + auto mask = _getMask(vmask); build 12-Sep-2018 15:30:25 if (! dropDegenerateAxes || keepaxes.empty()) { build 12-Sep-2018 15:30:25 - return SPIIT( build 12-Sep-2018 15:30:25 - SubImageFactory::createImage( build 12-Sep-2018 15:30:25 - *clone, outfile, region, mask, build 12-Sep-2018 15:30:25 - dropDegenerateAxes, overwrite, list, stretch build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 + im = SubImageFactory::createImage( build 12-Sep-2018 15:30:25 + *clone, outfile, *regionRec, mask, dropDegenerateAxes, build 12-Sep-2018 15:30:25 + overwrite, list, stretch build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 else { build 12-Sep-2018 15:30:25 - return SPIIT( build 12-Sep-2018 15:30:25 - SubImageFactory::createImage( build 12-Sep-2018 15:30:25 - *clone, outfile, region, mask, build 12-Sep-2018 15:30:25 - AxesSpecifier(IPosition(Vector(keepaxes))), build 12-Sep-2018 15:30:25 - overwrite, list, stretch build 12-Sep-2018 15:30:25 - ) build 12-Sep-2018 15:30:25 + im = SubImageFactory::createImage( build 12-Sep-2018 15:30:25 + *clone, outfile, *regionRec, mask, build 12-Sep-2018 15:30:25 + AxesSpecifier(IPosition(Vector(keepaxes))), build 12-Sep-2018 15:30:25 + overwrite, list, stretch build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 + if (_doHistory) { build 12-Sep-2018 15:30:25 + vector names { build 12-Sep-2018 15:30:25 + "outfile", "region", "mask", "dropdeg", "overwrite", build 12-Sep-2018 15:30:25 + "list", "stretch", "wantreturn", "keepaxes" build 12-Sep-2018 15:30:25 + }; build 12-Sep-2018 15:30:25 + vector values { build 12-Sep-2018 15:30:25 + outfile, region, vmask, dropDegenerateAxes, build 12-Sep-2018 15:30:25 + overwrite, list, stretch, wantreturn, keepaxes build 12-Sep-2018 15:30:25 + }; build 12-Sep-2018 15:30:25 + _addHistory(im, "subimage", names, values); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return wantreturn ? new image(im) : nullptr; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 record* image::summary( build 12-Sep-2018 15:30:25 @@ -5632,15 +5866,15 @@ bool image::tofits( build 12-Sep-2018 15:30:25 VersionInfo::report(buffer); build 12-Sep-2018 15:30:25 origin = String(buffer); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - // sanitize: replace CR and LF by SPACE build 12-Sep-2018 15:30:25 - const Char *cOrigin = origin.chars(); build 12-Sep-2018 15:30:25 - for(String::size_type i=0; i image::_getRegion( build 12-Sep-2018 15:30:25 - const variant& region, const bool nullIfEmpty, const string& otherImageName build 12-Sep-2018 15:30:25 + const ::casac::variant& region, const bool nullIfEmpty, build 12-Sep-2018 15:30:25 + const string& otherImageName build 12-Sep-2018 15:30:25 ) const { build 12-Sep-2018 15:30:25 switch (region.type()) { build 12-Sep-2018 15:30:25 case variant::BOOLVEC: build 12-Sep-2018 15:30:25 @@ -6304,11 +6539,11 @@ SHARED_PTR image::_getRegion( build 12-Sep-2018 15:30:25 case variant::RECORD: build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 SHARED_PTR clon(region.clone()); build 12-Sep-2018 15:30:25 - return SHARED_PTR( build 12-Sep-2018 15:30:25 + return SHARED_PTR( build 12-Sep-2018 15:30:25 nullIfEmpty && region.size() == 0 build 12-Sep-2018 15:30:25 - ? 0 build 12-Sep-2018 15:30:25 + ? nullptr build 12-Sep-2018 15:30:25 : toRecord( build 12-Sep-2018 15:30:25 - SHARED_PTR(region.clone())->asRecord() build 12-Sep-2018 15:30:25 + SHARED_PTR<::casac::variant>(region.clone())->asRecord() build 12-Sep-2018 15:30:25 ) build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 @@ -6317,6 +6552,38 @@ SHARED_PTR image::_getRegion( build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 +void image::_setImage(casa::ITUPLE mytuple) { build 12-Sep-2018 15:30:25 + auto imageF = std::get<0>(mytuple); build 12-Sep-2018 15:30:25 + auto imageC = std::get<1>(mytuple); build 12-Sep-2018 15:30:25 + auto imageD = std::get<2>(mytuple); build 12-Sep-2018 15:30:25 + auto imageDC = std::get<3>(mytuple); build 12-Sep-2018 15:30:25 + uInt n = 0; build 12-Sep-2018 15:30:25 + if (imageF) { build 12-Sep-2018 15:30:25 + ++n; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + if (imageC) { build 12-Sep-2018 15:30:25 + ++n; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + if (imageD) { build 12-Sep-2018 15:30:25 + ++n; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + if (imageDC) { build 12-Sep-2018 15:30:25 + ++n; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + ThrowIf(n == 0, "No image defined"); build 12-Sep-2018 15:30:25 + ThrowIf( build 12-Sep-2018 15:30:25 + n > 1, build 12-Sep-2018 15:30:25 + "Multiple images (" + String::toString(n) build 12-Sep-2018 15:30:25 + + ") defined" build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + _reset(); build 12-Sep-2018 15:30:25 + _imageF = imageF; build 12-Sep-2018 15:30:25 + _imageC = imageC; build 12-Sep-2018 15:30:25 + _imageD = imageD; build 12-Sep-2018 15:30:25 + _imageDC = imageDC; build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 vector image::_toDoubleVec(const variant& v) { build 12-Sep-2018 15:30:25 variant::TYPE type = v.type(); build 12-Sep-2018 15:30:25 ThrowIf( build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/images/image_private.h b/gcwrap/tools/images/image_private.h build 12-Sep-2018 15:30:25 index 02435c7..0077512 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tools/images/image_private.h build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/images/image_private.h build 12-Sep-2018 15:30:25 @@ -16,23 +16,24 @@ image(SHARED_PTR > inImage); build 12-Sep-2018 15:30:25 image(SHARED_PTR > inImage); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 image(SHARED_PTR > inImage); build 12-Sep-2018 15:30:25 -//image(SHARED_PTR ia); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +image(casa::ITUPLE mytuple); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 private: build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 typedef casacore::GaussianBeam Angular2DGaussian; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -mutable casacore::LogIO _log; build 12-Sep-2018 15:30:25 +mutable casacore::LogIO _log = casacore::LogIO(); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 // This class needs to be templated. For now, we maintain two pointers. build 12-Sep-2018 15:30:25 // At least one of which will be zero for a valid object state. build 12-Sep-2018 15:30:25 // SHARED_PTR > _imageFloat; build 12-Sep-2018 15:30:25 // SHARED_PTR > _imageComplex; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -casa::SPIIF _imageF; build 12-Sep-2018 15:30:25 -casa::SPIIC _imageC; build 12-Sep-2018 15:30:25 -casa::SPIID _imageD; build 12-Sep-2018 15:30:25 -casa::SPIIDC _imageDC; build 12-Sep-2018 15:30:25 +casa::SPIIF _imageF = casa::SPIIF(); build 12-Sep-2018 15:30:25 +casa::SPIIC _imageC = casa::SPIIC(); build 12-Sep-2018 15:30:25 +casa::SPIID _imageD = casa::SPIID(); build 12-Sep-2018 15:30:25 +casa::SPIIDC _imageDC = casa::SPIIDC(); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 std::auto_ptr _stats; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -99,9 +100,10 @@ template image* _decimate( build 12-Sep-2018 15:30:25 const vector& msgs build 12-Sep-2018 15:30:25 ) const; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -std::pair _fromarray( build 12-Sep-2018 15:30:25 - const string& outfile, const variant& pixels, build 12-Sep-2018 15:30:25 - const record& csys, bool linear, bool overwrite, bool log build 12-Sep-2018 15:30:25 +casa::ITUPLE _fromarray( build 12-Sep-2018 15:30:25 + const std::string& outfile, const casac::variant& pixels, build 12-Sep-2018 15:30:25 + const casac::record& csys, bool linear, bool overwrite, build 12-Sep-2018 15:30:25 + bool log, const std::string& type build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 template casacore::Record _getchunk( build 12-Sep-2018 15:30:25 @@ -127,6 +129,12 @@ SHARED_PTR _getRegion( build 12-Sep-2018 15:30:25 const std::string& otherImageName="" build 12-Sep-2018 15:30:25 ) const; build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 +template variant* _getregion2( build 12-Sep-2018 15:30:25 + SPIIT image, const variant& region, build 12-Sep-2018 15:30:25 + const std::vector& axes, const variant& mask, build 12-Sep-2018 15:30:25 + bool list, bool dropdeg, bool getmask, bool stretch build 12-Sep-2018 15:30:25 +); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 template vector _handleMask( build 12-Sep-2018 15:30:25 SPIIT myimage, const casacore::String& op, build 12-Sep-2018 15:30:25 const vector& name build 12-Sep-2018 15:30:25 @@ -176,6 +184,30 @@ template void _putchunk( build 12-Sep-2018 15:30:25 const bool list, const bool locking, const bool replicate build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 +template bool _putregionComplex( build 12-Sep-2018 15:30:25 + SPIIT image, const variant& v_pixels, const variant& v_pixelmask, build 12-Sep-2018 15:30:25 + const variant& region, bool list, bool usemask, build 12-Sep-2018 15:30:25 + bool replicateArray build 12-Sep-2018 15:30:25 +); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +template bool _putregionReal( build 12-Sep-2018 15:30:25 + SPIIT image, const variant& v_pixels, const variant& v_pixelmask, build 12-Sep-2018 15:30:25 + const variant& region, bool list, bool usemask, build 12-Sep-2018 15:30:25 + bool replicateArray build 12-Sep-2018 15:30:25 +); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +template bool _putregion2( build 12-Sep-2018 15:30:25 + SPIIT image, const casacore::Array& pixels, build 12-Sep-2018 15:30:25 + const variant& v_pixelmask, const variant& region, build 12-Sep-2018 15:30:25 + bool list, bool usemask, bool replicateArray build 12-Sep-2018 15:30:25 +); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +template build 12-Sep-2018 15:30:25 +void _convertArray( build 12-Sep-2018 15:30:25 + casacore::Array& out, const casacore::Vector& in, build 12-Sep-2018 15:30:25 + const casacore::IPosition& shape build 12-Sep-2018 15:30:25 +); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 template image* _regrid( build 12-Sep-2018 15:30:25 casa::ImageRegridderBase& regridder, build 12-Sep-2018 15:30:25 const string& method, int decimate, bool replicate, build 12-Sep-2018 15:30:25 @@ -189,11 +221,13 @@ void _remove(bool verbose); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 void _reset(); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -template SHARED_PTR > _subimage( build 12-Sep-2018 15:30:25 +void _setImage(casa::ITUPLE mytuple); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +template image* _subimage( build 12-Sep-2018 15:30:25 SHARED_PTR > clone, build 12-Sep-2018 15:30:25 - const casacore::String& outfile, const casacore::Record& region, build 12-Sep-2018 15:30:25 - const casacore::String& mask, bool dropDegenerateAxes, build 12-Sep-2018 15:30:25 - bool overwrite, bool list, bool stretch, const vector& keepaxes build 12-Sep-2018 15:30:25 + const casacore::String& outfile, const casac::variant& region, build 12-Sep-2018 15:30:25 + const casac::variant& vmask, bool dropDegenerateAxes, bool overwrite, build 12-Sep-2018 15:30:25 + bool list, bool stretch, const vector& keepaxes, bool wantReturn build 12-Sep-2018 15:30:25 ); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 template static record* _summary( build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/ms/ms.xml b/gcwrap/tools/ms/ms.xml build 12-Sep-2018 15:30:25 index 55b8db4..d9be364 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tools/ms/ms.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/ms/ms.xml build 12-Sep-2018 15:30:25 @@ -3412,7 +3412,7 @@ in spectral window 1. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Compute and set weights based on variance of data. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -3541,21 +3541,43 @@ in spectral window 1. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 1. If run in preview mode (preview=True), no data are modified and build 12-Sep-2018 15:30:25 no columns are added. build 12-Sep-2018 15:30:25 - 2. Else if the MS already has a WEIGHT_SPECTRUM and this column has build 12-Sep-2018 15:30:25 - been initialized (has values), it will always be populated with build 12-Sep-2018 15:30:25 + 2. Else if datacolumn equals 'residual' or 'residual_data' and build 12-Sep-2018 15:30:25 + a CORRECTED_DATA column exists, the WEIGHT and WEIGHT_SPECTRUM build 12-Sep-2018 15:30:25 + columns are not modified. build 12-Sep-2018 15:30:25 + 3. Else if the MS already has a WEIGHT_SPECTRUM and this column has build 12-Sep-2018 15:30:25 + been initialized (has values), it will be populated with build 12-Sep-2018 15:30:25 the new weights. The WEIGHT column will be populated with the build 12-Sep-2018 15:30:25 corresponding median values of the associated WEIGHT_SPECTRUM build 12-Sep-2018 15:30:25 array. build 12-Sep-2018 15:30:25 - 3. Else if the frequency range specified for the sample is not the build 12-Sep-2018 15:30:25 + 4. Else if the frequency range specified for the sample is not the build 12-Sep-2018 15:30:25 default ("spw"), the WEIGHT_SPECTRUM column will be created (if build 12-Sep-2018 15:30:25 it doesn't already exist) and the new weights will be written to build 12-Sep-2018 15:30:25 it. The WEIGHT column should be populated with the build 12-Sep-2018 15:30:25 corresponding median values of the WEIGHT_SPECTRUM array. build 12-Sep-2018 15:30:25 - 4. Otherwise the single value for each spectral window will be build 12-Sep-2018 15:30:25 + 5. Otherwise the single value for each spectral window will be build 12-Sep-2018 15:30:25 written to the WEIGHT column; the WEIGHT_SPECTRUM column will build 12-Sep-2018 15:30:25 not be added if it doesn't already exist, and if it does, it build 12-Sep-2018 15:30:25 will remain uninitialized (no values will be written to it). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + RULES FOR MODIFYING WEIGHT, WEIGHT_SPECTRUM, SIGMA, and SIGMA_SPECTRUM build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + 1. If datacolum='corrected' or 'residual' then values are written build 12-Sep-2018 15:30:25 + to the WEIGHT and WEIGHT_SPECTRUM (if applicable) columns only. build 12-Sep-2018 15:30:25 + 2. If datacolumn='data' or 'residual_data' and the 'CORRECTED_DATA' build 12-Sep-2018 15:30:25 + column does not exist, then values are written to the WEIGHT and build 12-Sep-2018 15:30:25 + WEIGHT_SPECTRUM (if applicable) columns and values in the SIGMA build 12-Sep-2018 15:30:25 + and SIGMA_SPECTRUM are set to 1/sqrt(newly computed weight). If build 12-Sep-2018 15:30:25 + a weight value is 0, the corresponding sigma value is -1. build 12-Sep-2018 15:30:25 + 3. If datacolumn='data' or 'residual_data' and the 'CORRECTED_DATA' build 12-Sep-2018 15:30:25 + column does exist, then the WEIGHT and WEIGHT_SPECTRUM columns build 12-Sep-2018 15:30:25 + are not updated and values in the SIGMA and build 12-Sep-2018 15:30:25 + SIGMA_SPECTRUM are set to 1/sqrt(of the newly computed weight). build 12-Sep-2018 15:30:25 + If a weight value is 0, the corresponding sigma value is -1. build 12-Sep-2018 15:30:25 + In this case, you should either split out the DATA column and build 12-Sep-2018 15:30:25 + run statwt, or run with datacolumn='corrected' or 'residual' build 12-Sep-2018 15:30:25 + to update WEIGHT/WEIGHT_SPECTRUM. Otherwise the data are build 12-Sep-2018 15:30:25 + internally not consistent. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 TIME BINNING build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 One of two algorithms can be used for time binning. If build 12-Sep-2018 15:30:25 @@ -3758,7 +3780,7 @@ in spectral window 1. build 12-Sep-2018 15:30:25 # update the weights of an MS build 12-Sep-2018 15:30:25 ms.open("my.ms", nomodify=False) build 12-Sep-2018 15:30:25 # compute weights, using time bins of 300s build 12-Sep-2018 15:30:25 - if ms.statwt2(timebin=("300s")): build 12-Sep-2018 15:30:25 + if ms.statwt(timebin=("300s")): build 12-Sep-2018 15:30:25 print "Successfully updated weights" build 12-Sep-2018 15:30:25 else: build 12-Sep-2018 15:30:25 print "Updating weights failed" build 12-Sep-2018 15:30:25 @@ -3768,10 +3790,10 @@ in spectral window 1. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 Set WEIGHT and SIGMA from the scatter of the visibilities build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - statwt build 12-Sep-2018 15:30:25 + oldstatwt build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 How the scatter should be estimated (True -> rms, False -> stddev). build 12-Sep-2018 15:30:25 @@ -3894,13 +3916,13 @@ in spectral window 1. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 ms.open("multiwin.ms", nomodify=False) build 12-Sep-2018 15:30:25 - ms.statwt(fitspw='0:0~123;145~211,2:124~255', field=[0], build 12-Sep-2018 15:30:25 + ms.oldstatwt(fitspw='0:0~123;145~211,2:124~255', field=[0], build 12-Sep-2018 15:30:25 spw='0,2') build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 In this example the noise estimates are separately made from and build 12-Sep-2018 15:30:25 applied to spws 0 and 2. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - ms.statwt(fitspw='0:0~123;145~211,2:124~255', fitorder=0, build 12-Sep-2018 15:30:25 + ms.oldstatwt(fitspw='0:0~123;145~211,2:124~255', fitorder=0, build 12-Sep-2018 15:30:25 field=[0], combine='spw') build 12-Sep-2018 15:30:25 ms.close() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/ms/ms_cmpt.cc b/gcwrap/tools/ms/ms_cmpt.cc build 12-Sep-2018 15:30:25 index 6d2de1a..c8fee6f 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tools/ms/ms_cmpt.cc build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/ms/ms_cmpt.cc build 12-Sep-2018 15:30:25 @@ -88,6 +88,7 @@ build 12-Sep-2018 15:30:25 #include build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 #include build 12-Sep-2018 15:30:25 +#include build 12-Sep-2018 15:30:25 #include build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 #include build 12-Sep-2018 15:30:25 @@ -5916,7 +5917,7 @@ bool ms::contsub(const std::string& outputms, const ::casac::variant& fitspw, build 12-Sep-2018 15:30:25 return rstat; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -bool ms::statwt(const bool dorms, const bool /*byantenna*/, build 12-Sep-2018 15:30:25 +bool ms::oldstatwt(const bool dorms, const bool /*byantenna*/, build 12-Sep-2018 15:30:25 const bool /*sepacs*/, const ::casac::variant& fitspw, build 12-Sep-2018 15:30:25 const ::casac::variant& /*fitcorr*/, const std::string& combine, build 12-Sep-2018 15:30:25 const ::casac::variant& timebin, const int minsamp, build 12-Sep-2018 15:30:25 @@ -5929,7 +5930,7 @@ bool ms::statwt(const bool dorms, const bool /*byantenna*/, build 12-Sep-2018 15:30:25 Bool rstat(false); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 try { build 12-Sep-2018 15:30:25 - *itsLog << LogOrigin("ms", "statwt"); build 12-Sep-2018 15:30:25 + *itsLog << LogOrigin("ms", __func__); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Reweighter reweighter(itsMS->tableName(), dorms, minsamp); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -6292,11 +6293,12 @@ ms::iterinit(const std::vector& columns, const double interval, build 12-Sep-2018 15:30:25 return rstat; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 -record* ms::statwt2( build 12-Sep-2018 15:30:25 - const string& combine, const variant& timebin, bool slidetimebin, build 12-Sep-2018 15:30:25 - const variant& chanbin, int minsamp, const string& statalg, build 12-Sep-2018 15:30:25 - double fence, const string& center, bool lside, build 12-Sep-2018 15:30:25 - double zscore, int maxiter, const string& excludechans, build 12-Sep-2018 15:30:25 +record* ms::statwt( build 12-Sep-2018 15:30:25 + const string& combine, const casac::variant& timebin, build 12-Sep-2018 15:30:25 + bool slidetimebin, const casac::variant& chanbin, build 12-Sep-2018 15:30:25 + int minsamp, const string& statalg, double fence, build 12-Sep-2018 15:30:25 + const string& center, bool lside, double zscore, build 12-Sep-2018 15:30:25 + int maxiter, const string& excludechans, build 12-Sep-2018 15:30:25 const std::vector& wtrange, bool preview, build 12-Sep-2018 15:30:25 const string& datacolumn build 12-Sep-2018 15:30:25 ) { build 12-Sep-2018 15:30:25 @@ -6305,7 +6307,10 @@ record* ms::statwt2( build 12-Sep-2018 15:30:25 if (detached()) { build 12-Sep-2018 15:30:25 return nullptr; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 - StatWt statwt(itsMS); build 12-Sep-2018 15:30:25 + StatWtColConfig statwtColConfig( build 12-Sep-2018 15:30:25 + itsOriginalMS, preview, datacolumn, chanbin build 12-Sep-2018 15:30:25 + ); build 12-Sep-2018 15:30:25 + StatWt statwt(itsMS, &statwtColConfig); build 12-Sep-2018 15:30:25 if (slidetimebin) { build 12-Sep-2018 15:30:25 // make the size of the encompassing chunks build 12-Sep-2018 15:30:25 // very large, so that chunk boundaries are determined only build 12-Sep-2018 15:30:25 @@ -6314,7 +6319,7 @@ record* ms::statwt2( build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 else { build 12-Sep-2018 15:30:25 // block time processing build 12-Sep-2018 15:30:25 - if (timebin.type() == variant::INT) { build 12-Sep-2018 15:30:25 + if (timebin.type() == casac::variant::INT) { build 12-Sep-2018 15:30:25 auto n = timebin.toInt(); build 12-Sep-2018 15:30:25 ThrowIf(n <= 0, "timebin must be positive"); build 12-Sep-2018 15:30:25 statwt.setTimeBinWidthUsingInterval(timebin.touInt()); build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/ms/msmetadata.xml b/gcwrap/tools/ms/msmetadata.xml build 12-Sep-2018 15:30:25 index 80d75a3..5f47340 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tools/ms/msmetadata.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/ms/msmetadata.xml build 12-Sep-2018 15:30:25 @@ -673,7 +673,7 @@ windows in the dataset and close the tool. build 12-Sep-2018 15:30:25 msmd.open("my.ms") build 12-Sep-2018 15:30:25 # get the exposure time for scan 1, spwid 2, and polid 3 build 12-Sep-2018 15:30:25 # for obsid=0 and arrayid=0 build 12-Sep-2018 15:30:25 - integration_time = msmd.getexposuretime(scan=1, spwid=2, polid=3) build 12-Sep-2018 15:30:25 + integration_time = msmd.exposuretime(scan=1, spwid=2, polid=3) build 12-Sep-2018 15:30:25 msmd.done() build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/plotms/plotms.xml b/gcwrap/tools/plotms/plotms.xml build 12-Sep-2018 15:30:25 index 8becb8e..4f7f22d 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tools/plotms/plotms.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/plotms/plotms.xml build 12-Sep-2018 15:30:25 @@ -796,22 +796,22 @@ specifying multiple plots per page will be added here) build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - If true, iterated plots should share a common x-axis label per column. build 12-Sep-2018 15:30:25 + When true, iterated plots have a common x-axis range (scale). build 12-Sep-2018 15:30:25 false build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - If true, iterated plots should share a common y-axis label per row. build 12-Sep-2018 15:30:25 + When true, iterated plots have a common y-axis range (scale). build 12-Sep-2018 15:30:25 false build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Plots should share a common x-axis. Must also set xselfscale=True. build 12-Sep-2018 15:30:25 + Iterated plots on a grid share a common external x-axis per column. Must also set xselfscale=True and gridrows>1. build 12-Sep-2018 15:30:25 false build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Plots should share a common y-axis. Must also set yselfscale=True. build 12-Sep-2018 15:30:25 + Iterated plots on a grid share a common external y-axis per row. Must also set yselfscale=True and gridcols>1. build 12-Sep-2018 15:30:25 false build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 @@ -921,7 +921,7 @@ Gets the MS calibration parameters for the plot at the given index as a record build 12-Sep-2018 15:30:25 Export all iteration plots or only the current one. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 - Plot export range (for multiple page iterations): All plots or only the current one (blank). build 12-Sep-2018 15:30:25 + Plot export range (for multiple page iterations): All plots or only the current one (blank). build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/synthesis/synthesisimager.xml b/gcwrap/tools/synthesis/synthesisimager.xml build 12-Sep-2018 15:30:25 index ec7c3c6..896a2f1 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tools/synthesis/synthesisimager.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/synthesis/synthesisimager.xml build 12-Sep-2018 15:30:25 @@ -638,7 +638,79 @@ Define the image coordinate systems and shapes. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + calculate images of different type by gridding build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +This tool function actually does gridding (and Fourier inversion if build 12-Sep-2018 15:30:25 +needed) of visibility data to make an image. It allows calculation of build 12-Sep-2018 15:30:25 +various types of image: build 12-Sep-2018 15:30:25 +\begin{description} build 12-Sep-2018 15:30:25 +\item[observed] Make the dirty image from the DATA column ({\em default}) build 12-Sep-2018 15:30:25 +\item[model] Make the dirty image from the MODEL\_DATA column build 12-Sep-2018 15:30:25 +\item[corrected] Make the dirty image from the CORRECTED\_DATA column build 12-Sep-2018 15:30:25 +\item[residual] Make the dirty image from the difference of the build 12-Sep-2018 15:30:25 +CORRECTED\_DATA and MODEL\_DATA columns build 12-Sep-2018 15:30:25 +\item[psf] Make the point spread function build 12-Sep-2018 15:30:25 +\item[singledish] Make a single dish image build 12-Sep-2018 15:30:25 +\item[coverage] Make a single dish or mosaic coverage image build 12-Sep-2018 15:30:25 +\item[holography] Make a complex holography image (experimental) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +\end{description} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Type of output image build 12-Sep-2018 15:30:25 + observed build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + observed build 12-Sep-2018 15:30:25 + model build 12-Sep-2018 15:30:25 + corrected build 12-Sep-2018 15:30:25 + residual build 12-Sep-2018 15:30:25 + psf build 12-Sep-2018 15:30:25 + singledish build 12-Sep-2018 15:30:25 + coverage build 12-Sep-2018 15:30:25 + holography build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Name of output image build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Name of output complex image build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + In case of multifield which image build 12-Sep-2018 15:30:25 + 0 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + release some images attached to this process build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Try to unlock images if the need arise build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + which image or outlier to unlock build 12-Sep-2018 15:30:25 + 0 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/synthesis/synthesisimager_cmpt.cc b/gcwrap/tools/synthesis/synthesisimager_cmpt.cc build 12-Sep-2018 15:30:25 index f3d9515..d8df95e 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tools/synthesis/synthesisimager_cmpt.cc build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/synthesis/synthesisimager_cmpt.cc build 12-Sep-2018 15:30:25 @@ -578,6 +578,23 @@ bool synthesisimager::makesdimage() build 12-Sep-2018 15:30:25 return rstat; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 +bool synthesisimager::makeimage(const std::string& type, const std::string& image, build 12-Sep-2018 15:30:25 + const std::string& compleximage, const int model) build 12-Sep-2018 15:30:25 +{ build 12-Sep-2018 15:30:25 + Bool rstat(true); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + try { build 12-Sep-2018 15:30:25 + itsImager = makeSI(); build 12-Sep-2018 15:30:25 + itsImager->makeImage(String(type), String(image), String(compleximage), build 12-Sep-2018 15:30:25 + model ); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + } catch (AipsError x) { build 12-Sep-2018 15:30:25 + RETHROW(x); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return rstat; build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 bool synthesisimager::makesdpsf() build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 Bool rstat(false); build 12-Sep-2018 15:30:25 @@ -593,7 +610,21 @@ bool synthesisimager::makesdpsf() build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 return rstat; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 +bool synthesisimager::unlockimages(const int id) build 12-Sep-2018 15:30:25 +{ build 12-Sep-2018 15:30:25 + Bool rstat(false); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + try { build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + //if( ! itsImager ) itsImager = new SynthesisImager(); build 12-Sep-2018 15:30:25 + itsImager = makeSI(); build 12-Sep-2018 15:30:25 + rstat=(itsImager->imageStore(id))->releaseLocks(); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + } catch (AipsError x) { build 12-Sep-2018 15:30:25 + RETHROW(x); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return rstat; build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 synthesisimstore* synthesisimager::getimstore(const int id) build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 synthesisimstore *rstat; build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/synthesis/synthesismaskhandler.xml b/gcwrap/tools/synthesis/synthesismaskhandler.xml build 12-Sep-2018 15:30:25 new file mode 100644 build 12-Sep-2018 15:30:25 index 0000000..30c42ae build 12-Sep-2018 15:30:25 --- /dev/null build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/synthesis/synthesismaskhandler.xml build 12-Sep-2018 15:30:25 @@ -0,0 +1,107 @@ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + tool for mask handling in sysnthesis imaging build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +synthesismaskhandler is a tool to manupilate mask image used in imager build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + tools/synthesis/synthesismaskhandler_forward.h build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + tools/synthesis/synthesismaskhandler_private.h build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Construct an synthesismaskhandler tool build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +This is used to construct {\tt synthesismaskhandler} tool. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +# create a synthesismaskhandler tool build 12-Sep-2018 15:30:25 +maskhandler=casac.synthesismaskhandler() build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +nchan=5 # input mask is a cube of 5 channel build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +#define channel flag: 1 to skip the channel for pruning build 12-Sep-2018 15:30:25 +chanflag = np.zeros(nchan) # prune every channel build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +maskhandler.pruneregions('testMask.image',2.0, chanflag) build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +# output python dictionary contains the number of origin regions build 12-Sep-2018 15:30:25 +and the number of regions removed at each channel, and prunesize used. build 12-Sep-2018 15:30:25 +For skipped channels, N_reg and N_reg_pruned elements will be -1. build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +{'N_reg': array([5, 0, 0, 1, 1], dtype=uint32), build 12-Sep-2018 15:30:25 + 'N_reg_pruned': array([4, 0, 0, 1, 1], dtype=uint32), build 12-Sep-2018 15:30:25 + 'prunesize': 2.0} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +# the resultant pruned mask is create as testMask.image.pruned build 12-Sep-2018 15:30:25 +maskhandler.done() # to close the synthesismaskhandler tool build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + prune mask regions build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + input mask image name build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + size in pixels to apply pruning build 12-Sep-2018 15:30:25 + 0.0 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + list of channel flags build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + optional pruned mask name. If unspecified, use the default name: inmaskname.pruned build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + close maskhandler tool build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/synthesis/synthesismaskhandler_cmpt.cc b/gcwrap/tools/synthesis/synthesismaskhandler_cmpt.cc build 12-Sep-2018 15:30:25 new file mode 100644 build 12-Sep-2018 15:30:25 index 0000000..933d85c build 12-Sep-2018 15:30:25 --- /dev/null build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/synthesis/synthesismaskhandler_cmpt.cc build 12-Sep-2018 15:30:25 @@ -0,0 +1,136 @@ build 12-Sep-2018 15:30:25 +/*** build 12-Sep-2018 15:30:25 + * Framework independent implementation file for imager... build 12-Sep-2018 15:30:25 + * build 12-Sep-2018 15:30:25 + * Implement the imager component here. build 12-Sep-2018 15:30:25 + * build 12-Sep-2018 15:30:25 + * // TODO: WRITE YOUR DESCRIPTION HERE! build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + ***/ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +#include build 12-Sep-2018 15:30:25 +#include build 12-Sep-2018 15:30:25 +#include build 12-Sep-2018 15:30:25 +#include build 12-Sep-2018 15:30:25 +#include build 12-Sep-2018 15:30:25 +#include build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +#include build 12-Sep-2018 15:30:25 +#include build 12-Sep-2018 15:30:25 +#include build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +#include build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +#include build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +using namespace std; build 12-Sep-2018 15:30:25 +using namespace casacore; build 12-Sep-2018 15:30:25 +using namespace casa; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +using namespace casacore; build 12-Sep-2018 15:30:25 +namespace casac { build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +synthesismaskhandler::synthesismaskhandler() build 12-Sep-2018 15:30:25 +{ build 12-Sep-2018 15:30:25 + itsLog = new LogIO(); build 12-Sep-2018 15:30:25 + itsMaskHandler = new SDMaskHandler(); build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +synthesismaskhandler::~synthesismaskhandler() build 12-Sep-2018 15:30:25 +{ build 12-Sep-2018 15:30:25 + done(); build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + casac::record* synthesismaskhandler::pruneregions(const string& inmaskname, double prunesize, const std::vector& chanflag, const string& outmaskname) build 12-Sep-2018 15:30:25 +{ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + casac::record* rstat(0); build 12-Sep-2018 15:30:25 + *itsLog << casacore::LogOrigin("synthesismaskhandler", __func__); build 12-Sep-2018 15:30:25 + try build 12-Sep-2018 15:30:25 + { build 12-Sep-2018 15:30:25 + PagedImage inmask(inmaskname); build 12-Sep-2018 15:30:25 + CoordinateSystem inCsys = inmask.coordinates(); build 12-Sep-2018 15:30:25 + IPosition inShape = inmask.shape(); build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + String outmasknameMod; build 12-Sep-2018 15:30:25 + if (outmaskname=="") { build 12-Sep-2018 15:30:25 + outmasknameMod = String(inmaskname)+String(".pruned"); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + else { build 12-Sep-2018 15:30:25 + outmasknameMod = outmaskname; build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + PagedImage outmask(TiledShape(inShape), inCsys, outmasknameMod); build 12-Sep-2018 15:30:25 + Vector chanFlag(chanflag); build 12-Sep-2018 15:30:25 + if (chanFlag.nelements()==0) { build 12-Sep-2018 15:30:25 + *itsLog< allpruned; build 12-Sep-2018 15:30:25 + Vector nreg; build 12-Sep-2018 15:30:25 + Vector npruned; build 12-Sep-2018 15:30:25 + SHARED_PTR > tempIm_ptr = itsMaskHandler->YAPruneRegions(inmask, chanFlag, allpruned, nreg, npruned, prunesize); build 12-Sep-2018 15:30:25 + *itsLog<<"nreg="< build 12-Sep-2018 15:30:25 +namespace casacore{ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + class LogIO; build 12-Sep-2018 15:30:25 +} build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +namespace casa build 12-Sep-2018 15:30:25 +{ build 12-Sep-2018 15:30:25 + class SDMaskHandler; build 12-Sep-2018 15:30:25 +}; build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/synthesis/synthesismaskhandler_private.h b/gcwrap/tools/synthesis/synthesismaskhandler_private.h build 12-Sep-2018 15:30:25 new file mode 100644 build 12-Sep-2018 15:30:25 index 0000000..963369d build 12-Sep-2018 15:30:25 --- /dev/null build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/synthesis/synthesismaskhandler_private.h build 12-Sep-2018 15:30:25 @@ -0,0 +1,4 @@ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 +casacore::LogIO *itsLog; build 12-Sep-2018 15:30:25 +casa::SDMaskHandler *itsMaskHandler; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/synthesis/synthesisnormalizer.xml b/gcwrap/tools/synthesis/synthesisnormalizer.xml build 12-Sep-2018 15:30:25 index 6ba4139..f5fe959 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tools/synthesis/synthesisnormalizer.xml build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/synthesis/synthesisnormalizer.xml build 12-Sep-2018 15:30:25 @@ -195,6 +195,19 @@ This is used to construct {\tt synthesisnormalizer} tool. build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + unlock the images held by this normalizer build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Set ImageStore build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 diff --git a/gcwrap/tools/synthesis/synthesisnormalizer_cmpt.cc b/gcwrap/tools/synthesis/synthesisnormalizer_cmpt.cc build 12-Sep-2018 15:30:25 index 3f60cdb..4f7f4e8 100644 build 12-Sep-2018 15:30:25 --- a/gcwrap/tools/synthesis/synthesisnormalizer_cmpt.cc build 12-Sep-2018 15:30:25 +++ b/gcwrap/tools/synthesis/synthesisnormalizer_cmpt.cc build 12-Sep-2018 15:30:25 @@ -82,6 +82,19 @@ synthesisimstore* synthesisnormalizer::getimstore() build 12-Sep-2018 15:30:25 return rstat; build 12-Sep-2018 15:30:25 } build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 + bool synthesisnormalizer::unlockimages(){ build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + Bool rstat(false); build 12-Sep-2018 15:30:25 + try { build 12-Sep-2018 15:30:25 + rstat=(itsNormalizer->getImageStore())->releaseLocks(); build 12-Sep-2018 15:30:25 + } catch (AipsError x) { build 12-Sep-2018 15:30:25 + RETHROW(x); build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + return rstat; build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 + } build 12-Sep-2018 15:30:25 + build 12-Sep-2018 15:30:25 bool synthesisnormalizer::gatherweightdensity() build 12-Sep-2018 15:30:25 { build 12-Sep-2018 15:30:25 Bool rstat(false); build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Comparison returned: 1 build 12-Sep-2018 15:30:25 Checkout: git checkout ARD-3 error 12-Sep-2018 15:30:25 Already on 'ARD-3' build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 [git, tag, -a, 5.3.0-124-test-ARD-3-CppAWVRtesting-2, -m 'Automatic tag'] build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Done tagging 5.3.0-124-test-ARD-3-CppAWVRtesting-2 build 12-Sep-2018 15:30:25 Pushing 5.3.0-124-test-ARD-3-CppAWVRtesting-2 to origin error 12-Sep-2018 15:30:25 To ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git error 12-Sep-2018 15:30:25 * [new tag] 5.3.0-124-test-ARD-3-CppAWVRtesting-2 -> 5.3.0-124-test-ARD-3-CppAWVRtesting-2 build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Pushed 5.3.0-124-test-ARD-3-CppAWVRtesting-2 to origin build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 BUILD SUCCESSFUL build 12-Sep-2018 15:30:25 build 12-Sep-2018 15:30:25 Total time: 11.633 secs simple 12-Sep-2018 15:30:26 Finished task 'Script' with result: Success simple 12-Sep-2018 15:30:26 Running post build plugin 'Docker Container Cleanup' simple 12-Sep-2018 15:30:26 Running post build plugin 'NCover Results Collector' simple 12-Sep-2018 15:30:26 Running post build plugin 'Clover Results Collector' simple 12-Sep-2018 15:30:26 Running post build plugin 'npm Cache Cleanup' simple 12-Sep-2018 15:30:26 Running post build plugin 'Artifact Copier' simple 12-Sep-2018 15:30:26 Finalising the build... simple 12-Sep-2018 15:30:26 Stopping timer. simple 12-Sep-2018 15:30:26 Build ARD-BPT4-TBFP-4 completed. simple 12-Sep-2018 15:30:26 Running on server: post build plugin 'NCover Results Collector' simple 12-Sep-2018 15:30:26 Running on server: post build plugin 'Build Hanging Detection Configuration' simple 12-Sep-2018 15:30:26 Running on server: post build plugin 'Clover Delta Calculator' simple 12-Sep-2018 15:30:26 Running on server: post build plugin 'Maven Dependencies Postprocessor' simple 12-Sep-2018 15:30:26 All post build plugins have finished simple 12-Sep-2018 15:30:26 Generating build results summary... simple 12-Sep-2018 15:30:26 Saving build results to disk... simple 12-Sep-2018 15:30:26 Logging substituted variables... simple 12-Sep-2018 15:30:26 Indexing build results... simple 12-Sep-2018 15:30:26 Finished building ARD-BPT4-TBFP-4.