Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/plotweather.py: 56%
27 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 19:53 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 19:53 +0000
1##################### generated by xml-casa (v2) from plotweather.xml ###############
2##################### abe2a1783e25e06fd59f1f0120898342 ##############################
3from __future__ import absolute_import
4import numpy
5from casatools.typecheck import CasaValidator as _val_ctor
6_pc = _val_ctor( )
7from casatools.coercetype import coerce as _coerce
8from casatools.errors import create_error_string
9from .private.task_plotweather import plotweather as _plotweather_t
10from casatasks.private.task_logging import start_log as _start_log
11from casatasks.private.task_logging import end_log as _end_log
12from casatasks.private.task_logging import except_log as _except_log
14class _plotweather:
15 """
16 plotweather ---- Plot elements of the weather table; estimate opacity
18 --------- parameter descriptions ---------------------------------------------
20 vis MS name
21 seasonal_weight weight of the seasonal model
22 doPlot set this to True to create a plot
23 plotName (Optional) the name of the plot file
25 --------- examples -----------------------------------------------------------
28 Generates opacity estimates from both the weather data and a seasonal model; intended for VLA use only.
29 By default the returned opacity is the mean of these predictions, but this can be adjusted with seasonal_weight.
31 These methods and models are described in detail in EVLA Memo 143, VLA Test Memo 232, VLA Scientific Memo 176, and references therein.
33 Saves the plot to the following default file: MS name + .plotweather.png
34 Custom plot filenames must end in one of: .png, .pdf, .ps, .eps or .svg
36 If run as a function, will return the mean zenith opacity per spectral window.
38 The wind direction is defined as the direction where the wind is coming from.
39 The wind direction is thus in the opposite side of the arrow, with north at
40 the top and counterclockwise through west, south, and east.
42 Written by Josh Marvil, revised 02/06/12
44 example:
45 myTau = plotweather(vis='myMS.ms',seasonal_weight=0.5, doPlot=True)
48 """
50 _info_group_ = """visualization"""
51 _info_desc_ = """Plot elements of the weather table; estimate opacity"""
53 def __call__( self, vis='', seasonal_weight=float(0.5), doPlot=True, plotName='' ):
54 schema = {'vis': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'seasonal_weight': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'doPlot': {'type': 'cBool'}, 'plotName': {'type': 'cStr', 'coerce': _coerce.to_str}}
55 doc = {'vis': vis, 'seasonal_weight': seasonal_weight, 'doPlot': doPlot, 'plotName': plotName}
56 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
57 _logging_state_ = _start_log( 'plotweather', [ 'vis=' + repr(_pc.document['vis']), 'seasonal_weight=' + repr(_pc.document['seasonal_weight']), 'doPlot=' + repr(_pc.document['doPlot']), 'plotName=' + repr(_pc.document['plotName']) ] )
58 task_result = None
59 try:
60 task_result = _plotweather_t( _pc.document['vis'], _pc.document['seasonal_weight'], _pc.document['doPlot'], _pc.document['plotName'] )
61 except Exception as exc:
62 _except_log('plotweather', exc)
63 raise
64 finally:
65 task_result = _end_log( _logging_state_, 'plotweather', task_result )
66 return task_result
68plotweather = _plotweather( )