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

ObitUVSoln.c File Reference

ObitUVSoln class function definitions. More...

#include "ObitUVSoln.h"
#include "ObitTableUtil.h"
#include "ObitTableSUUtil.h"

Functions

void ObitUVSolnInit (gpointer in)
 Private: Initialize newly instantiated object.
void ObitUVSolnClear (gpointer in)
 Private: Deallocate members.
void smoAmpPh (ObitTableSN *SNTab, ObitUVSel *sel, gchar *smoFunc, gchar *smoType, gfloat alpha, gfloat *smoParm, gint sub, gint ifbeg, gint ifend, gdouble *freqs, gboolean doBlank, gfloat *gncnt, gfloat *gnsum, ObitErr *err)
 Coherent amplitude/phase smoothing.
void smoIt (gchar *smmeth, gfloat width, gfloat alpha, gfloat *x, gfloat *t, gfloat *w, gint n, gfloat *xs, gfloat *ws, gfloat *wrk1, gfloat *wrk2, gboolean doBlank)
 Private: Generic smoothing.
ObitUVSolnnewObitUVSoln (gchar *name)
 Public: Default Constructor.
gconstpointer ObitUVSolnGetClass (void)
 Public: ClassInfo pointer.
ObitUVSolnObitUVSolnCreate (gchar *name, ObitUV *inUV)
 Public: Create/initialize ObitUVSoln structures.
void ObitUVSolnStartUp (ObitUVSoln *in, ObitErr *err)
 Public: Initialize interpolation.
gboolean ObitUVSolnGetSN (ObitUVSoln *in, ObitTableSNRow *SNrow, ObitErr *err)
 Public: interpolate calibration at a given time.
void ObitUVSolnShutDown (ObitUVSoln *in, ObitErr *err)
 Public: Shutdown interpolation.
void ObitUVSolnRefAnt (ObitTableSN *SNTab, gint isuba, gint *refant, ObitErr *err)
 Refererence phases to a common reference antenna.
void ObitUVSolnAvgRate (ObitTableSN *SNTab, ObitErr *err)
 Average fringe rates over IF/poln in an SN table.
void ObitUVSolnSNSmo (ObitTableSN *SNTab, gint isuba, ObitErr *err)
 Smooth an SN table and possible interpolate blanked soln.
void ObitUVSolnDeselSN (ObitTableSN *SNTab, gint isuba, gint fqid, gint nantf, gint *ants, gint nsou, gint *sources, gfloat timerange[2], ObitErr *err)
 Deselect records in an SN table.
void ObitUVSolnDeselCL (ObitTableCL *CLTab, gint isuba, gint fqid, gint nantf, gint *ants, gint nsou, gint *sources, gfloat timerange[2], ObitErr *err)
 Deselect records in a CL table.
void ObitUVSolnSNSmooth (ObitTableSN *SNTab, gchar *smoFunc, gchar *smoType, gfloat alpha, gfloat *smoParm, gint iif, gint sub, gfloat *gncnt, gfloat *gnsum, gint nxt, gfloat *work1, gfloat *work2, gboolean doBlank, ObitErr *err)
 Smooth solutions for a given IF and subarray.
void ObitUVSolnSmooBox (gfloat width, gfloat *x, gfloat *y, gfloat *w, gint n, gfloat *ys, gfloat *ws, gboolean doBlank)
 Boxcar smoothing with weighting of an irregularly spaced array.
void ObitUVSolnSmooGauss (gfloat width, gfloat *x, gfloat *y, gfloat *w, gint n, gfloat *ys, gfloat *ws, gfloat *wtsum, gboolean doBlank)
 Gaussian smoothing with weighting of an irregularly spaced array.
void ObitUVSolnSmooMWF (gfloat width, gfloat alpha, gfloat *x, gfloat *y, gfloat *w, gint n, gfloat *ys, gfloat *ws, gfloat *yor, gfloat *wor, gboolean doBlank)
 Median Window smoothing with weighting of an irregularly spaced array.
void ObitUVSolnClassInit (void)
 Public: Class initializer.


Detailed Description

ObitUVSoln class function definitions.

This clas allows manipulation (interpolation) of Solutions in an ObitTableSN. This class is derived from the Obit base class.


Function Documentation

ObitUVSoln* newObitUVSoln gchar *  name  ) 
 

Public: Default Constructor.

Initializes class if needed on first call.

Parameters:
name An optional name for the object.
Returns:
the new object.

void ObitUVSolnAvgRate ObitTableSN SNTab,
ObitErr err
 

Average fringe rates over IF/poln in an SN table.

Parameters:
SNTab SN table object
err Error/message stack, returns if error.

void ObitUVSolnClassInit void   ) 
 

Public: Class initializer.

void ObitUVSolnClear gpointer  inn  ) 
 

Private: Deallocate members.

Does (recursive) deallocation of parent class members.

Parameters:
inn Pointer to the object to deallocate. Actually it should be an ObitUVSoln* cast to an Obit*.

ObitUVSoln* ObitUVSolnCreate gchar *  name,
ObitUV inUV
 

Public: Create/initialize ObitUVSoln structures.

Parameters:
name An optional name for the object.
inUV UV data with input SN table
Returns:
the new object.

void ObitUVSolnDeselCL ObitTableCL CLTab,
gint  isuba,
gint  fqid,
gint  nantf,
gint *  ants,
gint  nsou,
gint *  sources,
gfloat  timerange[2],
ObitErr err
 

Deselect records in a CL table.

Parameters:
CLTab CL table object
isub Subarray number, <=0 -> any
fqid Selected FQ id, <=0 -> any
nantf Number of antennas in ants
ants List of antennas, NULL or 0 in first -> flag all
nsou Number of source ids in sources
sources List of sources, NULL or 0 in first -> flag all
timerange Timerange to flag, 0s -> all
err Error/message stack, returns if error.

void ObitUVSolnDeselSN ObitTableSN SNTab,
gint  isuba,
gint  fqid,
gint  nantf,
gint *  ants,
gint  nsou,
gint *  sources,
gfloat  timerange[2],
ObitErr err
 

Deselect records in an SN table.

Parameters:
SNTab SN table object
isub Subarray number, <=0 -> any
fqid Selected FQ id, <=0 -> any
nantf Number of antennas in ants
ants List of antennas, NULL or 0 in first -> flag all
nsou Number of source ids in sources
sources List of sources, NULL or 0 in first -> flag all
timerange Timerange to flag, 0s -> all
err Error/message stack, returns if error.

gconstpointer ObitUVSolnGetClass void   ) 
 

Public: ClassInfo pointer.

Returns:
pointer to the class structure.

gboolean ObitUVSolnGetSN ObitUVSoln in,
ObitTableSNRow SNrow,
ObitErr err
 

Public: interpolate calibration at a given time.

Input values on an ObitTableSNRow into which the results are added. Data selection is enabled.

Parameters:
in Solution Object.
SNRow SN row giving desired time, antenna..., and to receive output
err ObitError stack.
Returns:
TRUE if source, time etc. selected, else FALSE.

void ObitUVSolnInit gpointer  inn  ) 
 

Private: Initialize newly instantiated object.

Parent classes portions are (recursively) initialized first

Parameters:
inn Pointer to the object to initialize.

void ObitUVSolnRefAnt ObitTableSN SNTab,
gint  isuba,
gint *  refant,
ObitErr err
 

Refererence phases to a common reference antenna.

Leaves the output table sorted in antenna-time order. Routine translated from the AIPSish UVUTIL.FOR/SLFREF

Parameters:
SNTab SN table object
isuba Desired subarray, 0=> 1
refant Reference antenna, if 0 then the most commonly used reference antenna is picked.
err Error/message stack, returns if error.

void ObitUVSolnShutDown ObitUVSoln in,
ObitErr err
 

Public: Shutdown interpolation.

Close any open file and destroy structures.

Parameters:
in Calibrate Object.
err ObitError stack.

void ObitUVSolnSmooBox gfloat  width,
gfloat *  x,
gfloat *  y,
gfloat *  w,
gint  n,
gfloat *  ys,
gfloat *  ws,
gboolean  doBlank
 

Boxcar smoothing with weighting of an irregularly spaced array.

Only returns blanked values if no valid data found. First good value used for all previous points, last good value used for all subsequent points in which all data are blanked in the boxcar. A datum is blanked if its weight is <= 0 or fblank. Routine translated from the AIPSish SMBOX.FOR/SMBOX

Parameters:
width Width of boxcar in same units as X: 0 => replace blanks with interpolated closest 2, < 0 => replace only blanks with the boxcar smoothed values (all others remain unchanged)
x Abscissas of points to be smoothed in increasing order
y Values to be smoothed.
w Weights of data.
n Number of points to smooth.
ys Smoothed values.
ws Smoothed weights
doBlank replace blanked values with interpolated values?

void ObitUVSolnSmooGauss gfloat  width,
gfloat *  x,
gfloat *  y,
gfloat *  w,
gint  n,
gfloat *  ys,
gfloat *  ws,
gfloat *  wtsum,
gboolean  doBlank
 

Gaussian smoothing with weighting of an irregularly spaced array.

Only returns blanked values if no valid data found. First good value used for all previous points, last good value used for all subsequent points in which all data are blanked in the smoothing interval. A datum is considered blanked if its weight is <= 0 or its value fblank. Routine translated from the AIPSish SMGAUS.FOR/SMGAUS

Parameters:
width Width of boxcar in same units as X: 0 => replace blanks with interpolated closest 2, < 0 => replace only blanks with the b oxcar smoothed values (all others remain unchanged)
x Abscissas of points to be smoothed in increasing order
y Values to be smoothed.
w Weights of data.
n Number of points to smooth.
ys Smoothed values.
ws Smoothed weights
wtsum scratch
doBlank replace blanked values with interpolated values.

void ObitUVSolnSmooMWF gfloat  width,
gfloat  alpha,
gfloat *  x,
gfloat *  y,
gfloat *  w,
gint  n,
gfloat *  ys,
gfloat *  ws,
gfloat *  yor,
gfloat *  wor,
gboolean  doBlank
 

Median Window smoothing with weighting of an irregularly spaced array.

Only returns blanked values if no valid data found. First good value used for all previous points, last good value used for all subsequent points in which all data are blanked in the smoothing interval. A datum is considered blanked if its weight is <= 0 or its value fblank. Routine translated from the AIPSish SMMWF.FOR/SMMWF

Parameters:
width Width of boxcar in same units as X: 0 => replace blanks with interpolated closest 2, < 0 => replace only blanks with the b oxcar smoothed values (all others remain unchanged)
alpha 0 -> 1 = pure boxcar -> pure MWF (ALPHA of the data samples are discarded and the rest averaged).
x Abscissas of points to be smoothed in increasing order
y Values to be smoothed.
w Weights of data.
n Number of points to smooth.
ys Smoothed values.
ws Smoothed weights
yor Scratch
wor Scratch
doBlank replace blanked values with interpolated values.

void ObitUVSolnSNSmo ObitTableSN SNTab,
gint  isuba,
ObitErr err
 

Smooth an SN table and possible interpolate blanked soln.

Failed solutions are optionally interpolated. Leaves the output table sorted in antenna-time order. If SmoType='VLMB the host ObitUV of SNTab should have a valid selector and descriptor. All rates are averaged. Routine adapted from the AIPSish UVUTIL.FOR/SLFSMO Table MUST be in Time order when called and will be returned in antenna order Controls on SNTab:

  • smoFunc OBIT_string (4,1,1) smoothing function 'MWF' (median window filter), "GAUS' (Gaussian) else "BOX", [def "BOX"]
  • smoParm OBIT_float (5,1,1) Amplitude smoothing time in hr. [def 0.0] ampl, phase, rate, singleband delay, multiband delay
  • smoType OBIT_string (4,1,1) Data to be smoothed 'AMPL', 'PHAS', 'BOTH'[def], 'DELA', 'DERA', 'VLBI','VLMB', 'FULL', ' '='AMPL'
  • doBlank OBIT_bool (1,1,1) Replace blanked values with interpolated? [def false]
    Parameters:
    SNTab SN table object
    isuba Desired subarray, 0=> 1
    err Error/message stack, returns if error.

void ObitUVSolnSNSmooth ObitTableSN SNTab,
gchar *  smoFunc,
gchar *  smoType,
gfloat  alpha,
gfloat *  smoParm,
gint  iif,
gint  sub,
gfloat *  gncnt,
gfloat *  gnsum,
gint  nxt,
gfloat *  work1,
gfloat *  work2,
gboolean  doBlank,
ObitErr err
 

Smooth solutions for a given IF and subarray.

All poln present are smoothed but only one IF. The KOL pointers are presumed to point at the desired IF. An error is returned if there are any non-zero delays, rates, or multi-band delays. If the reference antenna changes and phase is being smoothed, an error is returned. Multiband delays only smoothed if iif==0; Input table must be in antenna-time order. Routine translated from the AIPSish SNSMOO.FOR/SNSMOO

Parameters:
SNTab SN table object; must be opened/closed externally
smoFunc Smoothing function: 'MWF', 'GAUS', else BOX
smoType Type of data to smooth 'AMPL', 'PHAS', 'BOTH'[def], 'VLBI','FULL' 'DERA' = Delay & Rate only
alpha Alpha clip for MWF (0 -> box, 1 -> pure MWF)
smoParm Smoothing time in days for: ampl, phase, rate, singleband delay, multiband delay 0=>fill in for blanked only.
iif Desired IF (0-rel)
sub Desired subarray (1-rel)
gncnt [In/Out] Count for gain normalization
gnsum [In/Out] Sum of gain modulii
nxt Number of times allowed in WRK
work1 Work buffer (NXT*16)
work2 Work area >= (NXT*m) (m=2 BOX, 3 GAUS, 4 MWF)
doBlank replace blanked values with interpolated values?
err Error/message stack, returns if error.

void ObitUVSolnStartUp ObitUVSoln in,
ObitErr err
 

Public: Initialize interpolation.

Parameters:
in Solution Object.
err ObitError stack.

void smoAmpPh ObitTableSN SNTab,
ObitUVSel sel,
gchar *  smoFunc,
gchar *  smoType,
gfloat  alpha,
gfloat *  smoParm,
gint  sub,
gint  ifbeg,
gint  ifend,
gdouble *  freqs,
gboolean  doBlank,
gfloat *  gncnt,
gfloat *  gnsum,
ObitErr err
 

Coherent amplitude/phase smoothing.

All poln present and the range of IF specified by IFBEG and IFEND are smoothed jointly. The values in a single polarization are averaged after correcting for multiband delay. Any delay and rate smoothing should be done before amplitude and phase smoothing. Any blanked delay and rate values will be set to 0.0. The phases are corrected by the integral of the rate functions from the first time before smoothing. All selected phases in each polarization are averaged and corrected using the integrated phase function for the first IF selected. Routine translated from the AIPSish /export/users/bcotton/Software.dir//AIPS/31DEC02/APL/PGM/NOTST/SNSMO.FOR/SMOAPH Input table must be in antenna-time order.

Parameters:
SNTab SN table object; must be opened/closed externally
sel pointer to uvdata selector to select data
smoFunc Smoothing function: 'MWF', 'GAUS', else BOX
smoType Type of data to smooth 'AMPL', 'PHAS', 'BOTH'[def]
alpha Alpha smooth for MWF (0 -> box, 1 -> pure MWF)
smoParm Smoothing time in days for: ampl, phase 0=>fill in for blanked only.
sub Desired subarray
ifbeg First IF
ifend Highest IF
freqs IF frequency array
doBlank replace blanked values with interpolated values?
gncnt [out] count for gain normalization
gnsum [out] sum of gain modulii
err Error/message stack, returns if error.

void smoIt gchar *  smmeth,
gfloat  width,
gfloat  alpha,
gfloat *  x,
gfloat *  y,
gfloat *  w,
gint  n,
gfloat *  ys,
gfloat *  ws,
gfloat *  wrk1,
gfloat *  wrk2,
gboolean  doBlank
 

Private: Generic smoothing.

Magic value blanking is supported. Routine adopted from the AIPSish 31DEC02/APL/PGM/NOTST/SNSMO.FOR/SNSMSM

Parameters:
smmeth Method 'BOX','MWF', 'GAUS', unknown = 'BOX'
width Smoothing time (days)
alpha 0 -> 1 = pure boxcar -> pure MWF (ALPHA of the data samples are discarded and the rest averaged).
x Abscissas of points to be smoothed in increasing order
y Values to be smoothed.
w Weights of data.
n Number of points to smooth.
ys [out] Smoothed values.
ws [out] Smoothed weights
yor Scratch
wor Scratch
doBlank replace blanked values with interpolated values.


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