Source
xxxxxxxxxx
self.exception_verification(cm, "Both source and direction may not be simultaneously specified")
##########################################################################
# test_task_getcalmodvla.py
#
# Copyright (C) 2018
# Associated Universities, Inc. Washington DC, USA.
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
# License for more details.
#
# [Add the link to the JIRA ticket here once it exists]
#
# Based on the requirements listed in plone found here:
# https://casadocs.readthedocs.io/en/stable/api/tt/casatasks.manipulation.phaseshift.html
#
#
##########################################################################
import glob
import http.server
import numpy as np
import os
from pathlib import Path
import re
import shutil
import sys
import threading
import unittest
from urllib import request
from urllib.error import URLError
from urllib.parse import urlparse, parse_qs
from casatasks import casalog
from casatools import componentlist, measures
from casatasks import getcalmodvla
import casatestutils
# NOTE be certain to specify the top-level casatestutils directory
# in your PYTHONPATH so you load the casatestutils directory which
# is a subdir of that
class MockHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
"""HTTPServer mock request handler"""
def do_GET(self):
casalog.post("server path " + self.path, "WARN")
parms = parse_qs(urlparse(self.path).query)
casalog.post(f"server parms {parms}", "INFO")
good_sources = ("3C48", "3C286", "3C138", "3C147")
if "source" in parms and parms["source"][0].upper() not in good_sources:
explain = f"source must be one of {good_sources}"
self.send_error(400, message="Invalid input", explain=explain)
self.end_headers()