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

ObitUVSoln.h File Reference

Obit utilities for manipulating Solution (SN) tables. More...

#include "Obit.h"
#include "ObitErr.h"
#include "ObitUV.h"
#include "ObitTableSN.h"
#include "ObitTableCL.h"

Go to the source code of this file.

Classes

struct  ObitUVSoln
 ObitUVSoln Class structure. More...
struct  ObitUVSolnClassInfo
 ClassInfo Structure. More...

Defines

#define ObitUVSolnUnref(in)   ObitUnref (in)
 Macro to unreference (and possibly destroy) an ObitUVSoln returns a ObitUVSoln*.
#define ObitUVSolnRef(in)   ObitRef (in)
 Macro to reference (update reference count) an ObitUVSoln.
#define ObitUVSolnIsA(in)   ObitIsA (in, ObitUVSolnGetClass())
 Macro to determine if an object is the member of this or a derived class.

Typedefs

typedef ObitUVSoln *(* ObitUVSolnCreateFP )(gchar *name, ObitUV *inUV)
 Typedef for definition of class pointer structure.
typedef void(* ObitUVSolnStartUpFP )(ObitUVSoln *in, ObitErr *err)
 Typedef for definition of class pointer structure.
typedef gboolean(* ObitUVSolnGetSNFP )(ObitUVSoln *in, ObitTableSNRow *SNrow, ObitErr *err)
 Typedef for definition of class pointer structure.
typedef void(* ObitUVSolnShutDownFP )(ObitUVSoln *in, ObitErr *err)
 Typedef for definition of class pointer structure.

Enumerations

enum  obitUVSolnInterMode {
  OBIT_UVSolnInterUnknown = 0, OBIT_UVSolnInter2PT, OBIT_UVSolnInterSELF, OBIT_UVSolnInterPOLY,
  OBIT_UVSolnInterSIMP, OBIT_UVSolnInterAMBG, OBIT_UVSolnInterCUBE, OBIT_UVSolnInterMWF,
  OBIT_UVSolnInterBOX, OBIT_UVSolnInterGAUS
}
 enum for UVSoln interpolation modes More...

Functions

void ObitUVSolnClassInit (void)
 Public: Class initializer.
ObitUVSolnnewObitUVSoln (gchar *name)
 Public: Default Constructor.
ObitUVSolnObitUVSolnCreate (gchar *name, ObitUV *inUV)
 Public: Create/initialize ObitUVSoln structures.
gconstpointer ObitUVSolnGetClass (void)
 Public: ClassInfo pointer.
ObitUVSolnObitUVSolnCopy (ObitUVSoln *in, ObitUVSoln *out, ObitErr *err)
 Public: Copy (deep) constructor.
void ObitUVSolnClone (ObitUVSoln *in, ObitUVSoln *out, ObitErr *err)
 Public: Copy structure.
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 smoTime, 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 smoTime, 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 smoTime, 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.


Detailed Description

Obit utilities for manipulating Solution (SN) tables.

This class manipulates, mostly interpolates, solutions tables to specified times and using a vareity of interpolation techniques.

The following options can be entered onto the info list prior to StartUp:

Any data selection parameters on the input UV data info object will be applied.

Creators and Destructors

An ObitUVSoln will usually be created using ObitUVSolnCreate which allows specifying a name for the object as well as other information.

A copy of a pointer to an ObitUVSoln should always be made using the ObitUVSolnRef function which updates the reference count in the object. Then whenever freeing an ObitUVSoln or changing a pointer, the function ObitUVSolnUnref will decrement the reference count and destroy the object when the reference count hits 0. There is no explicit destructor.


Define Documentation

#define ObitUVSolnIsA in   )     ObitIsA (in, ObitUVSolnGetClass())
 

Macro to determine if an object is the member of this or a derived class.

Returns TRUE if a member, else FALSE in = object to reference

#define ObitUVSolnRef in   )     ObitRef (in)
 

Macro to reference (update reference count) an ObitUVSoln.

returns a ObitUVSoln*. in = object to reference

#define ObitUVSolnUnref in   )     ObitUnref (in)
 

Macro to unreference (and possibly destroy) an ObitUVSoln returns a ObitUVSoln*.

in = object to unreference


Typedef Documentation

typedef ObitUVSoln*(* ObitUVSolnCreateFP)(gchar *name, ObitUV *inUV)
 

Typedef for definition of class pointer structure.

typedef gboolean(* ObitUVSolnGetSNFP)(ObitUVSoln *in, ObitTableSNRow *SNrow, ObitErr *err)
 

Typedef for definition of class pointer structure.

typedef void(* ObitUVSolnShutDownFP)(ObitUVSoln *in, ObitErr *err)
 

Typedef for definition of class pointer structure.

typedef void(* ObitUVSolnStartUpFP)(ObitUVSoln *in, ObitErr *err)
 

Typedef for definition of class pointer structure.


Enumeration Type Documentation

enum obitUVSolnInterMode
 

enum for UVSoln interpolation modes

Enumeration values:
OBIT_UVSolnInterUnknown  Undefined interpolation type.
OBIT_UVSolnInter2PT  linear vector interpolation with no SN smoothing.
OBIT_UVSolnInterSELF  Use only SN solution from same source.
OBIT_UVSolnInterPOLY  Fit a polynomial to the SN rates and delays.
OBIT_UVSolnInterSIMP  Simple linear phase connection.
OBIT_UVSolnInterAMBG  Linear phase connection using rates to resolve phase ambiguities.
OBIT_UVSolnInterCUBE  As AMBG but fit third order polynomial to phases and rates.
OBIT_UVSolnInterMWF  Median window filter of SN table before 2PT interpolation.
OBIT_UVSolnInterBOX  Boxcar smoothing of SN table before 2PT interpolation.
OBIT_UVSolnInterGAUS  Gaussian smoothing of SN table before 2PT interpolation.


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 ObitUVSolnClone ObitUVSoln in,
ObitUVSoln out,
ObitErr err
 

Public: Copy structure.

ObitUVSoln* ObitUVSolnCopy ObitUVSoln in,
ObitUVSoln out,
ObitErr err
 

Public: Copy (deep) constructor.

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 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.


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