| ``search (string='both_latest')`` - Search algorithm to use. Supported values are "both_latest" and "both_closest". For "both_latest", the last updated position for each antenna within 30 days after the observation will be returned, taking into account snr if specified. If provided, tw will override the 30 day default value. For "both_closest", the position of each antenna closest in time to the observation, within 30 days (before or after the observation) will be returned, subject to the value of snr if it is specified. If specified, the value of tw will override the default 30 days. The default algorithm to use will be "both_latest".
from casatasks import casalog
from casatools import quanta
from datetime import datetime
from urllib import request
from urllib.error import HTTPError, URLError
from urllib.parse import urlencode, urlparse
def _is_valid_url_host(url):
return bool(parsed.netloc)
context = ssl.create_default_context(cafile=certifi.where())
with request.urlopen(url, context=context, timeout=400) as response:
if response.status == 200:
myjson = response.read().decode('utf-8')
f"Caught HTTPError: {e.code} {e.reason}: {e.read().decode('utf-8')}",
casalog.post(f"Caught URLError: {str(e)}", "WARN")
casalog.post(f"Caught Exception when trying to connect: {str(e)}", "WARN")
outfile='', overwrite=False, asdm='', tw='', snr="default", search='both_latest',
hosts=['tbd1.alma.cl', 'tbd2.alma.cl']
Retrieve antenna positions by querying ALMA web service.
[`Description`_] [`Examples`_] [`Development`_] [`Details`_]
- outfile_ (path='') - Name of output file to which to write retrieved antenna positions.
- overwrite_ (bool=False) - Overwrite a file by the same name if it exists?
- asdm_ (string='') - The associated ASDM name. Must be specified
- tw_ (string='') - Optional time window in which to consider baseline measurements in the database, when calculating the antenna positions.
- snr_ (float=0) - Optional signal-to-noise.
- search_ (string='both_latest') - Search algorithm to use.
- hosts_ (stringVec=['https://asa.alma.cl/uncertainties-service/uncertainties/versions/last/measurements/casa/']) - Priority-ranked list of hosts to query.
.. warning:: **WARNING**: This task should be considered experimental