Smoothbandpass: Difference between revisions

From CASA Guides
Jump to navigationJump to search
No edit summary
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Return to [[Analysis Utilities]]'''
'''Return to [[Analysis Utilities]]'''


Until casa is able to smooth the uv data prior to solving for bandpass, it may be useful to smooth the solution instead, although this is not as good as the former method. After doing this smoothing, you can use [[plotbandpass]] to overlay the smoothed solution over the original solution. ''Note that if the signal to noise of your original solution is too low, this method will introduce unphysical spikes in the output solution!'' In this case, you may have to use BPOLY option of '''{{bandpass}}'''.
If you are using casapy v3.4 or greater, then you can use the solint parameter of '''{{bandpass}}''' to smooth the uv data prior to solving for bandpass.  This will yield the best results.  If you are forced to use casapy v3.3 or earlier, then you are stuck with smoothing the solution instead, although this is not as good as the former method. After doing this smoothing, you can use [[plotbandpass]] to overlay the smoothed solution over the original solution. ''Note that if the signal to noise of your original solution is too low, this method will introduce unphysical spikes in the output solution!'' In this case, you may have to use BPOLY option of '''{{bandpass}}'''.


<source lang="python">
<source lang="python">
Line 7: Line 7:
</source>
</source>
<code><pre>
<code><pre>
Usage: smoothbandpass(caltable, window_len=20, window='flat', method='ri')
Usage: smoothbandpass(caltable, window_len=20, window='flat', method='ri',  
The output table will have '_smoothXXwindow_method' appended to the name,
avoidflags=True, verbose=False, fullVerbose=False, help=False, log='', outputname=None)
where 'XX'=window_len and 'window' is the window type.  The window
type options are: 'flat', 'hanning', 'hamming', 'bartlett', 'blackman'.
Method types are 'ri' = real & imaginary or 'ap' = amp & phase
</pre></code>
</pre></code>
* Unless the outputname is specified, the output table will have '_smoothXXwindow_method' appended to the name, where 'XX'=window_len and 'window' is the window type. 
* The window type options are: 'flat', 'hanning', 'hamming', 'bartlett', 'blackman' (the flat window will produce a moving average smoothing).
* Method types are 'ri' = real & imaginary or 'ap' = amp & phase
* avoidflags: if True (default), replace all flagged channels with the value from the nearest unflagged channel prior to passing the data to the smoothing function. The input caltable is unchanged.
* verbose: if True, print a brief summary for each antenna/spw combination with flags.
* fullVerbose: if True, print each channel that is being replaced, and by which channel.
* log: if not blank, then write out the verbose information to the specified log file name.


For more info, see the Wikipedia page on window functions.
For more info, see the Wikipedia page on [http://en.wikipedia.org/wiki/Window_function window functions].
 
'''Examples'''
 
<code><pre>
CASA <3>: au.smoothbandpass('uid___A002_X3c7a84_X443.ms.split.bandpass_spw')
Avoided 201 flagged channels on pol=0, spw=0, antenna=0
Avoided 201 flagged channels on pol=1, spw=0, antenna=0
 
Smooth solution written to: uid___A002_X3c7a84_X443.ms.split.bandpass_spw_smooth20flat_ri
</pre></code>

Latest revision as of 17:25, 13 November 2012

Return to Analysis Utilities

If you are using casapy v3.4 or greater, then you can use the solint parameter of bandpass to smooth the uv data prior to solving for bandpass. This will yield the best results. If you are forced to use casapy v3.3 or earlier, then you are stuck with smoothing the solution instead, although this is not as good as the former method. After doing this smoothing, you can use plotbandpass to overlay the smoothed solution over the original solution. Note that if the signal to noise of your original solution is too low, this method will introduce unphysical spikes in the output solution! In this case, you may have to use BPOLY option of bandpass.

au.smoothbandpass(help=True)
Usage: smoothbandpass(caltable, window_len=20, window='flat', method='ri', 
avoidflags=True, verbose=False, fullVerbose=False, help=False, log='', outputname=None)
  • Unless the outputname is specified, the output table will have '_smoothXXwindow_method' appended to the name, where 'XX'=window_len and 'window' is the window type.
  • The window type options are: 'flat', 'hanning', 'hamming', 'bartlett', 'blackman' (the flat window will produce a moving average smoothing).
  • Method types are 'ri' = real & imaginary or 'ap' = amp & phase
  • avoidflags: if True (default), replace all flagged channels with the value from the nearest unflagged channel prior to passing the data to the smoothing function. The input caltable is unchanged.
  • verbose: if True, print a brief summary for each antenna/spw combination with flags.
  • fullVerbose: if True, print each channel that is being replaced, and by which channel.
  • log: if not blank, then write out the verbose information to the specified log file name.

For more info, see the Wikipedia page on window functions.

Examples

CASA <3>: au.smoothbandpass('uid___A002_X3c7a84_X443.ms.split.bandpass_spw')
Avoided 201 flagged channels on pol=0, spw=0, antenna=0
Avoided 201 flagged channels on pol=1, spw=0, antenna=0

Smooth solution written to: uid___A002_X3c7a84_X443.ms.split.bandpass_spw_smooth20flat_ri