from __future__ import absolute_import
from casatasks.private.casa_transition import is_CASA6
from casatasks import casalog
from casatools import table
def calstat(caltable=None,
casalog.origin('calstat')
if axis in ['amp', 'amplitude', 'phase', 'imag', 'imaginary', 'real']:
s = _tb.statistics(column=col.upper(),
complex_value=complex_type)
casalog.post(stats + " values --- ", "NORMAL")
casalog.post(" -- number of points [npts]: " + str(int(round(s[stats]['npts']))), "NORMAL")
casalog.post(" -- minimum value [min]: " + str(s[stats]['min' ]), "NORMAL")
casalog.post(" -- maximum value [max]: " + str(s[stats]['max' ]), "NORMAL")
casalog.post(" -- Sum of values [sum]: " + str(s[stats]['sum' ]), "NORMAL")
casalog.post(" -- Sum of squared values [sumsq]: " + str(s[stats]['sumsq']), "NORMAL")
casalog.post(stats + " statistics --- ", "NORMAL")
casalog.post(" -- Mean of the values [mean]: " + str(s[stats]['mean']), "NORMAL")
casalog.post(" -- Variance of the values [var]: " + str(s[stats]['var']), "NORMAL")
casalog.post(" -- Standard deviation of the values [stddev]: " + str(s[stats]['stddev']), "NORMAL")
casalog.post(" -- Root mean square [rms]: " + str(s[stats]['rms']), "NORMAL")
casalog.post(" -- Median of the pixel values [median]: " + str(s[stats]['median']), "NORMAL")
casalog.post(" -- Median of the deviations [medabsdevmed]: " + str(s[stats]['medabsdevmed']), "NORMAL")
casalog.post(" -- Quartile [quartile]: " + str(s[stats]['quartile']), "NORMAL")
casalog.post(stats + " -- No valid points found", "WARN")