hanningsmooth
- hanningsmooth(vis, outputvis='', keepmms=True, field='', spw='', scan='', antenna='', correlation='', timerange='', intent='', array='', uvrange='', observation='', feed='', datacolumn='all')[source]
Hanning smooth frequency channel data to remove Gibbs ringing
[Description] [Examples] [Development] [Details]
- Parameters
vis (path) - Name of input visibility file
outputvis (string=’’) - Name of output visibility file
keepmms (bool=True) - Create a Multi-MS as the output if the input is a Multi-MS.
field ({string, stringVec, int, intVec}=’’) - Select field using field id(s) or field name(s)
spw ({string, stringVec, int, intVec}=’’) - Select spectral window/channels
scan ({string, stringVec, int, intVec}=’’) - Scan number range
antenna ({string, stringVec, int, intVec}=’’) - Select data based on antenna/baseline
correlation ({string, stringVec}=’’) - Select data based on correlation
timerange ({string, stringVec, int, intVec}=’’) - Select data based on time range
intent ({string, stringVec, int, intVec}=’’) - Select observing intent
array ({string, stringVec, int, intVec}=’’) - Select (sub)array(s) by array ID number.
uvrange ({string, stringVec, int, intVec}=’’) - Select data by baseline length.
observation ({string, stringVec, int, intVec}=’’) - Select by observation ID(s)
feed ({string, stringVec, int, intVec}=’’) - Multi-feed numbers: Not yet implemented.
datacolumn (string=’all’) - Which data column(s) to use for processing
- Description
This is the new implementation of hanningsmooth.
Note
Task hanningsmooth2 has been renamed to hanningsmooth. Please, update your scripts to call hanningsmooth instead.
The new hanningsmooth task uses the MSTransform framework underneath but keeps roughly the same interface as previous version of hanningsmooth.
This function Hanning smooths the frequency channels with a weighted running average. The weights are 0.5 for the central channel and 0.25 for each of the two adjacent channels. The first and last channels are flagged. Inclusion of a flagged value in an average causes that data value to be flagged.
If the CORRECTED data column is requested for an MS that does not contain this column, it will use DATA to calculate the smoothing and save it to DATA in the output MS.
Warning
WARNING: by default, all visibility columns will be smoothed.
Parameter Descriptions
Input and output MeasurementSets
The input visibility file (MS or MMS) given by the vis parameters will be Hanning smoothed and saved in an output given by the outputvis parameter.
For example, vis = [‘ngc5921.ms’], output vis = ‘out_ngc5921.mms’.
Output MS or Multi-MS: keepmms parameter
If keepmms = True, a Multi-MS will be created as the output if the input is a Multi-MS(MMS), which is the default behaviour. The output Multi-MS will have the same partition axis of the input MMS. See the Parallel Processing chapter for more information on the MMS format.
Data Column parameter
The parameter datacolumn chooses which column to use for the processing (case-insensitive). The default is set to all columns that exist in the input MS.
Data Selection parameters
For more details on how to perform data selection within the MS (i.e., selecting by field, SPW, antenna, etc.), see the Visibility Data Selection chapter.
- Examples
Apply Hanning smoothing on the CORRECTED column. The output will be saved into the DATA column.
hanningsmooth(vis='example.ms', outputvis='test.ms', datacolumn='corrected')
Apply Hanning smoothing on all visibility columns of the Multi-MS. In this case, if CASA is started with mpicasa, the processing will happen in parallel.
hanningsmooth(vis='example.mms', outputvis='test.mms') --> default hanningsmooth(vis='example.mms', outputvis='test.mms', datacolumn='all', keepmms=True) --> set the parameters explicitly
- Development
The following information was in the inline help for hanningsmooth but is now being maintained in one place in the Visibility Data Selection chapter, so a link has been added to those pages. It has been deleted from the Description tab for now and included below for reference in case it’s needed, once a comprehensive plan has been established for all task pages with this issue.
— Data selection parameters —
- field – Select field using field id(s) or field name(s).
[run listobs to obtain the list iof d’s or names]
If field string is a non-negative integer then it is assumed to be a field index. Otherwise, it is assumed to be a field name.
default: ‘’=all fields field=’0~2’; field ids 0,1,2 field=’0,4,5~7’; field ids 0,4,5,6,7 field=’3C286,3C295’; fields named 3C286 and 3C295 field = ‘3,4C*’; field id 3, all names starting with 4C
- spw – Select spectral window/channels
default: ‘’=all spectral windows and channels spw=’0~2,4’; spectral windows 0,1,2,4 (all channels) spw=’<2’; spectral windows less than 2 (i.e. 0,1) spw=’0:5~61’; spw 0, channels 5 to 61 spw=’0,10,3:3~45’; spw 0,10 all channels, spw 3 - chans 3 to 45. spw=’0~2:2~6’; spw 0,1,2 with channels 2 through 6 in each. spw = ‘*:3~64’ channels 3 through 64 for all sp id’s spw = ‘ :3~64’ will NOT work.
NOTE: mstransform does not support multiple channel ranges per spectral window (‘;’).
- scan – Scan number range
default: ‘’=all
- antenna – Select data based on antenna/baseline
- default: ‘’ (all)
Non-negative integers are assumed to be antenna indices, and anything else is taken as an antenna name.
- examples:
antenna=’5&6’: baseline between antenna index 5 and index 6. antenna=’VA05&VA06’: baseline between VLA antenna 5 and 6. antenna=’5&6;7&8’: baselines 5-6 and 7-8 antenna=’5’: all baselines with antenna 5 antenna=’5,6,10’: all baselines including antennas 5, 6, or 10 antenna=’5,6,10&’: all baselines with *only* antennas 5, 6, or . 10. (cross-correlations only. Use && . to include autocorrelations, and &&& . to get only autocorrelations.) antenna=’!ea03,ea12,ea17’: all baselines except those that . include EVLA antennas ea03, ea12, or . ea17.
- correlation – Correlation types or expression.
default: ‘’ (all correlations) example: correlation=’XX,YY’
- timerange – Select data based on time range:
- default: ‘’ (all); examples,
timerange = ‘YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss’ Note: if YYYY/MM/DD is missing date, timerange defaults to the first day in the dataset timerange=’09:14:0~09:54:0’ picks 40 min on first day timerange=’25:00:00~27:30:00’ picks 1 hr to 3 hr 30min on next day timerange=’09:44:00’ data within one integration of time timerange=’>10:24:00’ data after this time
- array – (Sub)array number range
default: ‘’=all
- uvrange – Select data within uvrange (default units meters)
- default: ‘’=all; example:
uvrange=’0~1000klambda’; uvrange from 0-1000 kilo-lambda uvrange=’>4klambda’;uvranges greater than 4 kilo-lambda uvrange=’0~1000km’; uvrange in kilometers
- observation – Select by observation ID(s)
default: ‘’=all
- feed – Selection based on the feed - NOT IMPLEMENTED YET
default: ‘’=all
- datacolumn – Which data column to use for processing (case-insensitive).
default: ‘all’; whichever of the visibility data columns that are present. options: ‘data’, ‘model’, ‘corrected’, ‘all’,’float_data’, ‘lag_data’.
- example1: datacolumn=’data’; it will smooth the input DATA column and save the
smoothed data in DATA of the output MS.
- example2: datacolumn=’corrected’; it will smooth the input CORRECTED_DATA column
and save the smoothed data in DATA of the output MS.
- example3: datacolumn=’all’, where the input MS has DATA,CORRECTED_DATA,MODEL_DATA.
It will smooth all three columns and save the smoothed data in DATA, CORRECTED_DATA and MODEL_DATA of the output MS.
- Parameter Details
Detailed descriptions of each function parameter
vis (path)
- Name of input visibility fileDefault: noneExample: vis=’ngc5921.ms’outputvis (string='')
- Name of output visibility fileDefault: ‘’ (same as vis)Example: outputvis=’ngc5921_out.ms’keepmms (bool=True)
- Create a Multi-MS as the output if the input is aMulti-MS.Default: TrueOptions: True|FalseBy default it will create a Multi-MS when theinput is a Multi-MS. The output Multi-MS willhave the same partition axis of the inputMMS. See CASA Docs for more information onthe MMS format.field ({string, stringVec, int, intVec}='')
- Select field using field id(s) or field name(s)Default: ‘’ (all fields)Use ‘go listobs’ to obtain the list id’s ornames. If field string is a non-negative integer,it is assumed a field index, otherwise, it isassumed a field name.Examples:field=’0~2’; field ids 0,1,2field=’0,4,5~7’; field ids 0,4,5,6,7field=’3C286,3C295’; field named 3C286 and3C295field = ‘3,4C*’; field id 3, all namesstarting with 4Cspw ({string, stringVec, int, intVec}='')
- Select spectral window/channelsDefault: ‘’=all spectral windows and channelsExamples:spw=’0~2,4’; spectral windows 0,1,2,4 (all channels)spw=’<2’; spectral windows less than 2 (i.e. 0,1)spw=’0:5~61’; spw 0, channels 5 to 61spw=’0,10,3:3~45’; spw 0,10 all channels, spw3 - chans 3 to 45.spw=’0~2:2~6’; spw 0,1,2 with channels 2through 6 in each.spw = ‘*:3~64’ channels 3 through 64 for all sp id’sspw = ‘ :3~64’ will NOT work.NOTE: mstransform does not support multiplechannel ranges per spectral window (‘;’).scan ({string, stringVec, int, intVec}='')
- Scan number rangeSubparameter of selectdata=TrueDefault: ‘’ = allantenna ({string, stringVec, int, intVec}='')
- Select data based on antenna/baselineSubparameter of selectdata=TrueDefault: ‘’ (all)If antenna string is a non-negative integer, itis assumed an antenna index, otherwise, it isassumed as an antenna nameExamples:antenna=’5&6’; baseline between antennaindex 5 and index 6.antenna=’VA05&VA06’; baseline between VLAantenna 5 and 6.antenna=’5&6;7&8’; baselines withindices 5-6 and 7-8antenna=’5’; all baselines with antenna index5antenna=’05’; all baselines with antennanumber 05 (VLA old name)antenna=’5,6,10’; all baselines with antennas5,6,10 index numbersantenna=’!ea03,ea12,ea17’: all baselinesexcept those that include EVLA antennasea03, ea12, or ea17.correlation ({string, stringVec}='')
- Select data based on correlationDefault: ‘’ ==> allExample: correlation=”XX,YY”.timerange ({string, stringVec, int, intVec}='')
- Select data based on time rangeSubparameter of selectdata=TrueDefault = ‘’ (all)Examples:timerange =‘YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss’(Note: if YYYY/MM/DD is missing date defaultsto first day in data set.)timerange=’09:14:0~09:54:0’ picks 40 min onfirst daytimerange= ‘25:00:00~27:30:00’ picks 1 hr to 3hr 30min on NEXT daytimerange=’09:44:00’ pick data within oneintegration of timetimerange=’>10:24:00’ data after this timeintent ({string, stringVec, int, intVec}='')
- Select observing intentDefault: ‘’ (no selection by intent)Example: intent=’BANDPASS’ (selects datalabelled with BANDPASS intent)array ({string, stringVec, int, intVec}='')
- (Sub)array number rangeDefault: ‘’ (all)uvrange ({string, stringVec, int, intVec}='')
- Select data by baseline length.Default = ‘’ (all)Examples:uvrange=’0~1000klambda’; uvrange from 0-1000 kilo-lambdauvrange=’>4klambda’;uvranges greater than 4 kilo-lambdauvrange=’0~1000km’; uvrange in kilometersobservation ({string, stringVec, int, intVec}='')
- Select by observation ID(s)Subparameter of selectdata=TrueDefault: ‘’ = allExample: observation=’0~2,4’feed ({string, stringVec, int, intVec}='')
- Selection based on the feedNOT IMPLEMENTED YET!Default: ‘’ = alldatacolumn (string='all')
- Which data column(s) to use for processing(case-insensitive).Default: ‘all’ (= whichever of the options thatare present)Options: ‘data’, ‘model’, ‘corrected’,‘all’,’float_data’, ‘lag_data’,‘float_data,data’, ‘lag_data,data’Example: datacolumn=’data’