Main Page | Class List | Directories | File List | Class Members | File Members

ObitUVEdit.h File Reference

ObitUVEdit module definition for editing ObitUV data. More...

#include "ObitErr.h"
#include "ObitUV.h"

Go to the source code of this file.

Functions

void ObitUVEditTD (ObitUV *inUV, ObitUV *outUV, ObitErr *err)
 Public: Time domain editing, FG table out.
void ObitUVEditFD (ObitUV *inUV, ObitUV *outUV, ObitErr *err)
 Public: Frequency domain editing, FG table out.
void ObitUVEditStokes (ObitUV *inUV, ObitUV *outUV, ObitErr *err)
 Public: Edit by excessive amplitude in given Stokes, FG table out.
ObitUVObitUVEditClip (ObitUV *inUV, gboolean scratch, ObitUV *outUV, ObitErr *err)
 Public: Clip raw visibilities, uv data out.
ObitUVObitUVEditClipStokes (ObitUV *inUV, gboolean scratch, ObitUV *outUV, ObitErr *err)
 Public: Flag visibilities by Stokes, uv data out.
void ObitUVEditMedian (ObitUV *inUV, ObitUV *outUV, ObitErr *err)
 Public: Flag visibilities by running median.


Detailed Description

ObitUVEdit module definition for editing ObitUV data.

This utility module contains utility functions for editing uv data.


Function Documentation

ObitUV* ObitUVEditClip ObitUV inUV,
gboolean  scratch,
ObitUV outUV,
ObitErr err
 

Public: Clip raw visibilities, uv data out.

Writes edited UV data Control parameters are on the inUV info member:

  • "maxAmp" OBIT_float (1,1,1) Maximum allowed amplitude
  • "oper" OBIT_string (4,1,1) operation type: "flag" flag data with amplitudes in excess of maxAmp "clip" clip amplitudes at maxAmp and preserve phase default is "flag"
    Parameters:
    inUV Input uv data to clip.
    scratch True if scratch file desired, will be same type as inUV.
    outUV If not scratch, then the previously defined output file May be the same as inUV. May be NULL for scratch only If it exists and scratch, it will be Unrefed
    err Error stack, returns if not empty.
    Returns:
    the clipped ObitUV.

ObitUV* ObitUVEditClipStokes ObitUV inUV,
gboolean  scratch,
ObitUV outUV,
ObitErr err
 

Public: Flag visibilities by Stokes, uv data out.

Writes edited UV data Data with amplitudes of the selected stokes in excess of maxAmp are flagged. Optionally all correlations associated may be flagged. Stokes conversion as needed for test. Control parameters are on the inUV info member:

  • "flagStok" OBIT_string (1,1,1) Stokes value to clip (I, Q, U, V, R, L) default = "I"
  • "flagAll" Obit_bool (1,1,1) if true, flag all associated correlations default = True
  • "maxAmp" OBIT_float (1,1,1) Maximum allowed amplitude
Parameters:
inUV Input uv data to clip.
scratch True if scratch file desired, will be same type as inUV.
outUV If not scratch, then the previously defined output file May be the same as inUV. May be NULL for scratch only If it exists and scratch, it will be Unrefed
err Error stack, returns if not empty.
Returns:
the clipped ObitUV.

void ObitUVEditFD ObitUV inUV,
ObitUV outUV,
ObitErr err
 

Public: Frequency domain editing, FG table out.

Editing is done independently for each visibility measure. First clipping is done on correlator and Vpol amplitudes. Following this, an average and RMS is determined for each channel in each timeAvg period and a spectral baseline is established for the average values, either using a median window filter (FDwidMW>0) or a linear baseline fit (FDwidMW<=0) to specified channels. Channels with excessive RMSes or residual amplitudes are flagged. Flagging is done by entering the offending data in FG table flagTab on outUV. Routine adopted from the AIPSish FDEDIT.FOR/FDEDIT

Parameters:
inUV Name of input uvdata object. Any prior selection and editing is applied. Control parameters on info member of inUV:
  • "flagTab" OBIT_int (1,1,1) FG table version number [ def. 1]
  • "timeAvg" OBIT_float (1,1,1) Time interval over which to average data to be flagged (min) [def = 1 min.] NB: this should be at least 2 integrations.
  • "FDmaxAmp" OBIT_float (1,1,1) Maximum average amplitude allowed in the spectrum before fitting. Any channel exceeding this is flagged in advance. default -> infinite
  • "FDmaxV" OBIT_float (1,1,1) Maximum average amplitude allowed in V polarization; any channel exceeding this is flagged in advance of the baseline fitting or median filtering, Calculates V from difference in amplitudes. default -> infinite
  • "FDwidMW" OBIT_int (1,1,1) If > 0 the width of the median window in channels. An odd number (5) is recommended, default or 0 -> linear baseline
  • "FDmaxRMS" OBIT_float (2,1,1) Flag all channels having RMS values > maxRMS[0] of the channel median sigma.[default => 6.] plus maxRMS[1] (default 0.1) of the channel average in quadrature
  • "FDmaxRes" OBIT_float (1,1,1) Max. residual flux in sigma allowed for channels outside the baseline fitting regions. default => 6.
  • "FDmaxResBL" OBIT_float (1,1,1) Max. residual flux in sigma allowed for channels within the baseline fitting regions. Default = FDmaxRes
  • "FDbaseSel" OBIT_int (4,*,1) Channel selection to define spectral baseline Used only for linear baseline fitting. Select groups of channels/IF(s) to fit as sets of (Start,end,inc,IF), i.e., FDbaseSel = 6,37,1,0, 92,123,1,0 for two regions applying to all IFs. Channel and IF numbers 1 -rel The first group for which the end channel == 0 terminates the list Channel increments defaults to 1 If the IF==0 then the group applies to all IF. Default is channels 2 => nchan-1 all IFs
outUV UV data onto which the FG table is to be attached. May be the same as inUV.
err Error stack, returns if not empty.

void ObitUVEditMedian ObitUV inUV,
ObitUV outUV,
ObitErr err
 

Public: Flag visibilities by running median.

A running estimate of the amplitude of each baseline/correlation is determined using a quasi median window (alpha is used to control) filter. Amplitudes in excess of flagSig time a robust RMS in the window will be flagged. Data to be flagged are indicated in FG table flagTab on outUV. Control parameters are on the inUV info member:

  • "flagTab" OBIT_int (1,1,1) FG table version number [ def. 1] NB: this should not also being used to flag the input data!
  • "flagSig" OBIT_float (1,1,1) Sigma in window for flagging [def 10]
  • "alpha" OBIT_float (1,1,1) controls averaging [0.5] 0 -> 1 = pure boxcar -> pure MWF (alpha of the center data samples are ignored and the rest averaged).
  • "timeWind" OBIT_float (1,1,1) Window size (days) over which to determine medians, RMSes [1 min]
  • "timeAvg" OBIT_float (1,1,1) Previous averaging time in min if defaulted, determined from data.
Parameters:
inUV Input uv data to edit. Any prior selection/calibration applied.
outUV UV data onto which the FG table is to be attached. Channels, IS and polarizations will be appropriate for outUV May be the same as inUV.
err Error stack, returns if not empty.

void ObitUVEditStokes ObitUV inUV,
ObitUV outUV,
ObitErr err
 

Public: Edit by excessive amplitude in given Stokes, FG table out.

If a fraction of bad baselines on any antenna/channel/IF exceeds maxBad, then all data to that correlator is flagged. The actual clipping level is the lesser of maxAmp[0] and if maxAmp[1]<=0, a value determined from a statistical analysis of each interval intended to flag the most discrepant 3 percent of the data. Flagging entries are written into FG table flagTab. Results are unpredictable for uncalibrated data. Control parameters on info member of inUV:

  • "flagStok" OBIT_string (1,1,1) Stokes value to clip (I, Q, U, V, R, L) default = "V"
  • "flagTab" OBIT_int (1,1,1) FG table version number [ def. 1] NB: this should not also being used to flag the input data!
  • "timeAvg" OBIT_float (1,1,1) Time interval over which to determine data to be flagged (min) [def = 1 min.]
  • "maxAmp" OBIT_float (2,1,1) Maximum value allowed [0] = clipping level, [1]==0.0 use statistical level
  • "maxBad" OBIT_float (1,1,1) Fraction of allowed flagged baselines to an antenna above which all baselines are flagged. [default 0.25]
Parameters:
inUV Input uv data to edit.
outUV UV data onto which the FG table is to be attached. May be the same as inUV.
err Error stack, returns if not empty.

void ObitUVEditTD ObitUV inUV,
ObitUV outUV,
ObitErr err
 

Public: Time domain editing, FG table out.

All correlations are clipped on each baseline if the RMS is larger than the maximum. The clipping is done independently in each time interval defined by timeAvg. The clipping level is given by MIN (A, MAX (B,C)) where: A = sqrt (maxRMS[0]**2 + (avg_amp * maxRMS[1])**2) and avg_amp is the average amplitude on each baseline. B = median RMS + 3 * sigma of the RMS distribution. C = level corresponding to 3% of the data. All data on a given baseline/correlator are flagged if the RMS exceeds the limit. If a fraction of bad baselines on any correlator exceeds maxBad, then all data to that correlator is flagged. In addition, if the offending correlator is a parallel hand correlator then any corresponding cross hand correlations are also flagged. Flagging entries are written into FG table flagTab. Control parameters on info member of inUV:

  • "flagTab" OBIT_int (1,1,1) FG table version number [ def. 1]
  • "timeAvg" OBIT_float (1,1,1) Time interval over which to determine data to be flagged (min) [def = 1 min.] NB: this should be at least 2 integrations.
  • "maxRMS" OBIT_float (2,1,1) Maximum RMS allowed, constant plus amplitude coefficient.
  • "maxBad" OBIT_float (1,1,1) Fraction of allowed flagged baselines to a poln/channel/IF above which all baselines are flagged. [default 0.25]
Routine adapted from the AIPSish TDEDIT.FOR/TDEDIT
Parameters:
inUV Input uv data to edit.
outUV UV data onto which the FG table is to be attached. May be the same as inUV.
err Error stack, returns if error.


Generated on Fri Aug 31 22:13:10 2007 for Obit by  doxygen 1.3.9.1