# calstat

calstat(caltable, axis='amplitude', datacolumn='gain')[source]

Calculates statistical information on a calibration table

[Description] [Examples] [Development] [Details]

Parameters
• caltable (path) - Name of input calibration table

• axis (string=’amplitude’) - Which values to use

axis = amp
• datacolumn (string=’gain’) - Which data column to use

axis = amplitude
• datacolumn (string=’gain’) - Which data column to use

axis = phase
• datacolumn (string=’gain’) - Which data column to use

axis = real
• datacolumn (string=’gain’) - Which data column to use

axis = imag
• datacolumn (string=’gain’) - Which data column to use

axis = imaginary
• datacolumn (string=’gain’) - Which data column to use

Returns

stats (dict) - statistics from a given column in a calibration table

Description

The calstat task returns statistical information about a column in a calibration table. The following values are computed: mean value, sum of values, sum of squared values, median, median absolute deviation, quartile, minimum, maximum, variance, standard deviation, root mean square. The results are printed in the CASA logger. The statistics info can also be captured as a python dictionary return variable. See the examples.

At this time, it is not possible to apply selection to the caltable.

Parameters

caltable

Specify the name of the calibration table as a string in caltable.

axis

Specify the axis upon which to calculate statistics in axis. The possible values are ‘amp’ (or ‘amplitude’), ‘phase’, ‘real’, ‘imag’ (or ‘imaginary’). Also, the name of any real valued CalTable column can be given, e.g. TIME, POLY_COEFF_AMP, REF_ANT, ANTENNA1, FLAG, etc.

datacolumn

For axis=’amp’, ‘amplitude’, ‘phase’, ‘real’, ‘imag’, or ‘imaginary’ specify the name of the column from which to extract the axis values and calculate statistics. E.g., for a ‘G’ table from gaincal, use datacolumn=’CPARAM’.

useflags

Warning

NB: The useflags parameter is not yet implemented.

Examples

To extract amplitude statistics from a ‘G’ caltable called ngc5921.demo.gcal with calstat:

```gstat=calstat('ngc5921.demo.gcal',axis='amp',datacolumn='CPARAM')
```

The gstat variable will contain the following dictionary:

```{'CPARAM': {'max': 1.6031942367553711,
'mean': 1.4448433067117419,
'medabsdevmed': 0.0086394548416137695,
'median': 1.5732669830322266,
'min': 0.99916577339172363,
'npts': 280.0,
'quartile': 0.020265340805053711,
'rms': 1.4650156497955322,
'stddev': 0.24271160321065546,
'sum': 404.55612587928772,
'sumsq': 600.95579999685287,
'var': 0.058908922333086665}}
```
Development

No additional development details

Parameter Details

Detailed descriptions of each function parameter

`caltable (path)` - Name of input calibration table
Default: ‘’
Example: vis=’ggtau.1mm.amp.gcal’
`axis (string='amplitude')` - Which data to analyze.
Default: ‘amplitude’
Options: ‘amp’, ‘amplitude’, ‘phase’, ‘real’,
‘imag’, ‘imaginary’. Also, the name of any real
valued MS column can be given, e.g. TIME,
POLY_COEFF_AMP, REF_ANT, ANTENNA1, FLAG, …
Note: the phase of a complex number is in
radians in the range [-pi; pi].
`datacolumn (string='gain')` - Which data column to use if axis is ‘amp’, ‘amplitude’, ‘phase’, ‘real’, ‘imag’ or ‘imaginary’.
Default: ‘gain’