casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Private Member Functions | Private Attributes
GBTACSTable Class Reference

A GBTBackendTable for the ACS. More...

#include <GBTACSTable.h>

Inheritance diagram for GBTACSTable:
GBTBackendTable

List of all members.

Public Types

enum  VanVleckCorr {
  NoVanVleck,
  Schwab,
  Old,
  DefaultVanVleck
}
 define the vanVleck correction to used. More...
enum  Smoothing {
  NoSmoothing,
  Hanning,
  Hamming,
  DefaultSmoothing
}
 define the smoothing to apply after the data have been corrected More...

Public Member Functions

 GBTACSTable (const String &fileName, VanVleckCorr vanVleckCorr=DefaultVanVleck, Smoothing smoothing=DefaultSmoothing, Int vvsize=65, Bool useDCBias=False, Double dcbias=0.0, Int minbiasfactor=-1, Bool fixlags=False, String fixlagslog="", Double sigmaFactor=6.0, Int spikeStart=200)
 Construct it from a file name.
 ~GBTACSTable ()
virtual Bool reopen (const String &fileName, Bool resync)
 Attach this GBTACSTable to a new file name.
virtual Bool reopen (const String &fileName)
 the default reopen from FITSTabular uses resync=True
virtual Array< Float > rawdata (uInt whichSampler)
 get the raw data from the specific sampler
virtual Array< Float > data (uInt whichSampler)
 get the data from the specific sampler, applying the vanVleck correction and smoothing specified
virtual Array< Bool > badData (uInt whichSampler)
 is the data bad for the specific sampler
virtual Array< Float > zeroChannel (uInt whichSampler)
 the zero channel for the specific sampler
virtual Double spacing ()
 the channel spacing as deduced from the CDELT keyword and number of lags
virtual Bool isValid () const
 separate isValid needed here to watch for problems in init
virtual Bool switchOK () const
 Do the switching signals in ACT_STATE follow the documentation? Prior to FITSVER 1.2 they had the opposite sense.
virtual Int nlevels () const
 return the number of sampler levels being used at the moment
virtual Float integrat (uInt whichSampler, uInt whichState) const
 The value of the INTEGRAT field in the current row for the given sampler and state.
virtual Double dmjd ()
 The DMJD value from the current row.
virtual Double timeMid ()
 The value of the TIME-MID field in the current row.
virtual String bank ()
 A string giving the bank here.

Private Member Functions

void vanVleck ()
void getACInfo (Double &threshold, Double &dcbias, Int &biasfactor, Int nlevel, Vector< Double > &aclags)
 get information from an AC lag vector
void vanVleckLags (Vector< Double > &lags, Int nlevel, Double thresh1, Double thresh2, Double dcbias1, Double dcbias2)
 This actually does the correction - in place.
void pow3lev ()
 Functions related to the old vv correction these are all in-place operations on itsCachedData 3-level sampling.
void vanvleck3lev ()
void pow9lev ()
 9-level sampling
void vanvleck9lev ()
void applyFFT ()
void smooth ()
 smoothing functions
void hamming ()
void hanning ()
Bool checkForBadData (Int nspectra)
 check for bad data, sets itsCachedBadData and returns True if there was any bad data.
Bool checkForDiscontinuities (Vector< Float > lags, Bool &badData, uInt spec, Bool isXcorr)
 Checks a lag set for any discontinuties in 1024-lag chunks.
void reportBadLags (uInt spec, String badChanStr, String comment="")
 Generates a report for a given bad lag.
Bool init ()
 initializes shapes and the cachedLevel, clears the booleans and the cached row number - does not read any data.
String bankPortPhase (const String &bank, Int port, Int phase)
 utility functions
 GBTACSTable ()
 Undefined and inaccessible.
 GBTACSTable (const GBTACSTable &)
GBTACSTableoperator= (const GBTACSTable &)

Private Attributes

VanVleckCorr itsVanVleckCorr
 remember what the cached data cube currently has
Smoothing itsSmoothing
Int itsVVsize
Int itsMinbiasfactor
Int itsSpikeStart
Bool itsUseDCBias
Bool itsNormalTintAxes
Bool itsNew
Bool itsFixlags
Double itsDCBias
Double itsTruncError
Double itsSigmaFactor
String itsTimestamp
 used in reporting
Int itsScan
Int itsCachedDataRow
 the last row that was corrected and FFTed and is now in itsCachedData.
Int itsCachedLagRow
Double itsSpacing
 cache the spacing when (re)opening the file
Array< Float > itsCachedData
 itsCachedData is what is returned by data().
Matrix< Float > * itsCachedDataMatrix
 itsCachedDataMatrix references the same values, but with a 2D shape to make it trivial to iterate through each spectra.
Array< Float > itsCachedZeroChannel
 itsCachedZeroChannel is the vector of corrected zero channels associated with itsCachedData - one per sampler
Vector< Float > * itsCachedZeroVector
Array< Bool > itsCachedBadData
 itsCachedBadData is the vector of booleans indicating which lag sequences are bad - one per sampler
Vector< Bool > * itsCachedBadDataVector
Vector< Bool > itsCachedBadZeroLags
Vector< Bool > itsCachedDiscontinuities
Array< Float > itsCachedLag
FFTServer< Float, Complex > itsFFTServer
Int itsCachedLevel
 remember the sampler level - used in a few places when processing the data
Matrix< Double > itsVVTemp
 van-vleck corr is done as a double for accuracy - this is a temp used for that
Vector< Float > itsFTTemp
 fourier transform is 2x size in first dimension - keep transients here one spectra at a time
Vector< Complex > itsFFTResult
Float itsNlagWeight
 weight to give the nlags elements in itsFTTemp when that is constructed set by smooth but defaults to 0.0
Vector< Float > itsSmoother
 smoothing vector - only depends on the number of lags and type of smoothing
Vector< Double > itsPowerLevels
 the power level for each spectra in a row is kept here, when requested
RORecordFieldPtr< Array< Float > > itsDataField
RORecordFieldPtr< Array< Float > > itsIntegrat
RORecordFieldPtr< Double > itsDMJD
RORecordFieldPtr< Double > itsTimeMid
Bool itsHasBadData
 A flag to indicate that at least one bad zero lag was detected.
Bool itsErrorEmitted
Bool itsHasDiscontinuities
 similarly for discontinuities
Bool itsDiscErrorEmitted
Bool isValid_p
 Is everything okay (appart from bad zero-lags)
IPosition itsStart
 used in the data slicing
IPosition itsEnd
uInt itsSampAxis
String itsBank
Vector< StringitsBankA
 The BANK_{A,B} and PORT_{A,B} column values from sampler()
Vector< StringitsBankB
Vector< Int > itsPortA
Vector< Int > itsPortB
String itsFixLagsLog

Detailed Description

A GBTBackendTable for the ACS.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Etymology

Synopsis

GBTACSTable is a GBTBackendTable with some additional methods specific to the ACS.

Example

Motivation

Definition at line 77 of file GBTACSTable.h.


Member Enumeration Documentation

define the smoothing to apply after the data have been corrected

Enumerator:
NoSmoothing 

No smoothing.

Hanning 

hanning smoothing

Hamming 

hamming smoothing

DefaultSmoothing 

the default smoothing

Definition at line 92 of file GBTACSTable.h.

define the vanVleck correction to used.

Enumerator:
NoVanVleck 

No vanVleck correction will be done.

Schwab 

The correction from Schwab as implemented in the VanVleck class.

Old 

The old correction from the Arecibo code.

DefaultVanVleck 

the default correction

Definition at line 81 of file GBTACSTable.h.


Constructor & Destructor Documentation

GBTACSTable::GBTACSTable ( const String fileName,
VanVleckCorr  vanVleckCorr = DefaultVanVleck,
Smoothing  smoothing = DefaultSmoothing,
Int  vvsize = 65,
Bool  useDCBias = False,
Double  dcbias = 0.0,
Int  minbiasfactor = -1,
Bool  fixlags = False,
String  fixlagslog = "",
Double  sigmaFactor = 6.0,
Int  spikeStart = 200 
)

Construct it from a file name.

Use the indicated vanVleck correction and smoothing in the data method. The vvsize is the table size used when the Schwab correction (the default) is requested. If useDCBias is True, an attemp is made to use the DCBias (the average of the autocorrrelations over the last 5% of the lags) in the vanVleck correction if the Schwab correction is specified. If usebias is False then dcbias is used as the bias. If minbiasfactor is >= 0 then the nearest integer >= minbiasfactor is found that, when multiplied by 0.5/65536, raises the mean of the last 5% of the lags to just > 0.0. This is an attempt to correct for a truncation error introduced when the lags are converted to 32-bit values.

GBTACSTable::GBTACSTable ( ) [private]

Undefined and inaccessible.

GBTACSTable::GBTACSTable ( const GBTACSTable ) [private]

Member Function Documentation

void GBTACSTable::applyFFT ( ) [private]
virtual Array<Bool> GBTACSTable::badData ( uInt  whichSampler) [virtual]

is the data bad for the specific sampler

virtual String GBTACSTable::bank ( ) [inline, virtual]

A string giving the bank here.

Definition at line 171 of file GBTACSTable.h.

References itsBank.

String GBTACSTable::bankPortPhase ( const String bank,
Int  port,
Int  phase 
) [private]

utility functions

Bool GBTACSTable::checkForBadData ( Int  nspectra) [private]

check for bad data, sets itsCachedBadData and returns True if there was any bad data.

Bool GBTACSTable::checkForDiscontinuities ( Vector< Float >  lags,
Bool &  badData,
uInt  spec,
Bool  isXcorr 
) [private]

Checks a lag set for any discontinuties in 1024-lag chunks.

A discontinuity is when a 1024-lag chunk is more than nsigma from the mean of the 512-lags on either side of that chunk. This will also fix it when one is found if itsFixLags is true. When fixed, that information is logged to the named logfile. If not fixed, then this should be flagged as bad. Returns True if any discontinuities were found. badData is set to True when the discontinuity was not fixed. The first 1024-lag segment is not checked here. If that is offset then it should get flagged elsewhere because the zero lag will be unphysical. The first 1024 segement can not be fixed.

virtual Array<Float> GBTACSTable::data ( uInt  whichSampler) [virtual]

get the data from the specific sampler, applying the vanVleck correction and smoothing specified

virtual Double GBTACSTable::dmjd ( ) [inline, virtual]

The DMJD value from the current row.

Definition at line 165 of file GBTACSTable.h.

References itsDMJD.

Referenced by GBTMultiACSTable::dmjd().

void GBTACSTable::getACInfo ( Double &  threshold,
Double &  dcbias,
Int &  biasfactor,
Int  nlevel,
Vector< Double > &  aclags 
) [private]

get information from an AC lag vector

void GBTACSTable::hamming ( ) [private]
void GBTACSTable::hanning ( ) [private]
Bool GBTACSTable::init ( ) [private]

initializes shapes and the cachedLevel, clears the booleans and the cached row number - does not read any data.

virtual Float GBTACSTable::integrat ( uInt  whichSampler,
uInt  whichState 
) const [virtual]

The value of the INTEGRAT field in the current row for the given sampler and state.

virtual Bool GBTACSTable::isValid ( ) const [inline, virtual]

separate isValid needed here to watch for problems in init

Reimplemented from GBTBackendTable.

Definition at line 149 of file GBTACSTable.h.

References isValid_p.

virtual Int GBTACSTable::nlevels ( ) const [inline, virtual]

return the number of sampler levels being used at the moment

Definition at line 158 of file GBTACSTable.h.

References itsCachedLevel.

GBTACSTable& GBTACSTable::operator= ( const GBTACSTable ) [private]
void GBTACSTable::pow3lev ( ) [private]

Functions related to the old vv correction these are all in-place operations on itsCachedData 3-level sampling.

void GBTACSTable::pow9lev ( ) [private]

9-level sampling

virtual Array<Float> GBTACSTable::rawdata ( uInt  whichSampler) [virtual]

get the raw data from the specific sampler

virtual Bool GBTACSTable::reopen ( const String fileName,
Bool  resync 
) [virtual]

Attach this GBTACSTable to a new file name.

when resync is True, if fileName is the same as the currently opened file, if there is one, then this just closes and reopens the FITS file setting things right back to the next row in the table, if there is one

Reimplemented from GBTBackendTable.

virtual Bool GBTACSTable::reopen ( const String fileName) [inline, virtual]

the default reopen from FITSTabular uses resync=True

Reimplemented from GBTBackendTable.

Definition at line 129 of file GBTACSTable.h.

References reopen(), and casa::True.

Referenced by reopen().

void GBTACSTable::reportBadLags ( uInt  spec,
String  badChanStr,
String  comment = "" 
) [private]

Generates a report for a given bad lag.

void GBTACSTable::smooth ( ) [private]

smoothing functions

virtual Double GBTACSTable::spacing ( ) [inline, virtual]

the channel spacing as deduced from the CDELT keyword and number of lags

Definition at line 146 of file GBTACSTable.h.

References itsSpacing.

virtual Bool GBTACSTable::switchOK ( ) const [inline, virtual]

Do the switching signals in ACT_STATE follow the documentation? Prior to FITSVER 1.2 they had the opposite sense.

Definition at line 154 of file GBTACSTable.h.

References GBTBackendTable::baseVersion(), and GBTBackendTable::deviceVersion().

Referenced by GBTMultiACSTable::switchOK().

virtual Double GBTACSTable::timeMid ( ) [inline, virtual]

The value of the TIME-MID field in the current row.

Definition at line 168 of file GBTACSTable.h.

References itsTimeMid.

Referenced by GBTMultiACSTable::timeMid().

void GBTACSTable::vanVleck ( ) [private]
void GBTACSTable::vanvleck3lev ( ) [private]
void GBTACSTable::vanvleck9lev ( ) [private]
void GBTACSTable::vanVleckLags ( Vector< Double > &  lags,
Int  nlevel,
Double  thresh1,
Double  thresh2,
Double  dcbias1,
Double  dcbias2 
) [private]

This actually does the correction - in place.

virtual Array<Float> GBTACSTable::zeroChannel ( uInt  whichSampler) [virtual]

the zero channel for the specific sampler


Member Data Documentation

Bool GBTACSTable::isValid_p [private]

Is everything okay (appart from bad zero-lags)

Reimplemented from GBTBackendTable.

Definition at line 244 of file GBTACSTable.h.

Referenced by isValid().

Definition at line 250 of file GBTACSTable.h.

Referenced by bank().

Vector<String> GBTACSTable::itsBankA [private]

The BANK_{A,B} and PORT_{A,B} column values from sampler()

Definition at line 253 of file GBTACSTable.h.

Vector<String> GBTACSTable::itsBankB [private]

Definition at line 253 of file GBTACSTable.h.

Array<Bool> GBTACSTable::itsCachedBadData [private]

itsCachedBadData is the vector of booleans indicating which lag sequences are bad - one per sampler

Definition at line 203 of file GBTACSTable.h.

Vector<Bool>* GBTACSTable::itsCachedBadDataVector [private]

Definition at line 204 of file GBTACSTable.h.

Vector<Bool> GBTACSTable::itsCachedBadZeroLags [private]

Definition at line 205 of file GBTACSTable.h.

Array<Float> GBTACSTable::itsCachedData [private]

itsCachedData is what is returned by data().

Definition at line 193 of file GBTACSTable.h.

Matrix<Float>* GBTACSTable::itsCachedDataMatrix [private]

itsCachedDataMatrix references the same values, but with a 2D shape to make it trivial to iterate through each spectra.

Definition at line 196 of file GBTACSTable.h.

the last row that was corrected and FFTed and is now in itsCachedData.

Definition at line 187 of file GBTACSTable.h.

Vector<Bool> GBTACSTable::itsCachedDiscontinuities [private]

Definition at line 205 of file GBTACSTable.h.

Array<Float> GBTACSTable::itsCachedLag [private]

Definition at line 207 of file GBTACSTable.h.

Definition at line 187 of file GBTACSTable.h.

remember the sampler level - used in a few places when processing the data

Definition at line 212 of file GBTACSTable.h.

Referenced by nlevels().

Array<Float> GBTACSTable::itsCachedZeroChannel [private]

itsCachedZeroChannel is the vector of corrected zero channels associated with itsCachedData - one per sampler

Definition at line 199 of file GBTACSTable.h.

Vector<Float>* GBTACSTable::itsCachedZeroVector [private]

Definition at line 200 of file GBTACSTable.h.

RORecordFieldPtr<Array<Float> > GBTACSTable::itsDataField [private]

Definition at line 232 of file GBTACSTable.h.

Double GBTACSTable::itsDCBias [private]

Definition at line 179 of file GBTACSTable.h.

Definition at line 241 of file GBTACSTable.h.

RORecordFieldPtr<Double> GBTACSTable::itsDMJD [private]

Definition at line 233 of file GBTACSTable.h.

Referenced by dmjd().

IPosition GBTACSTable::itsEnd [private]

Definition at line 247 of file GBTACSTable.h.

Definition at line 239 of file GBTACSTable.h.

Vector<Complex> GBTACSTable::itsFFTResult [private]

Definition at line 220 of file GBTACSTable.h.

FFTServer<Float, Complex> GBTACSTable::itsFFTServer [private]

Definition at line 209 of file GBTACSTable.h.

Bool GBTACSTable::itsFixlags [private]

Definition at line 178 of file GBTACSTable.h.

Definition at line 256 of file GBTACSTable.h.

Vector<Float> GBTACSTable::itsFTTemp [private]

fourier transform is 2x size in first dimension - keep transients here one spectra at a time

Definition at line 219 of file GBTACSTable.h.

A flag to indicate that at least one bad zero lag was detected.

This is set to true and an error message emited when a bad zero lag is seen and reset to false in reopen. In that way, the error message is only seen once per input file.

Definition at line 239 of file GBTACSTable.h.

similarly for discontinuities

Definition at line 241 of file GBTACSTable.h.

RORecordFieldPtr<Array<Float> > GBTACSTable::itsIntegrat [private]

Definition at line 232 of file GBTACSTable.h.

Definition at line 177 of file GBTACSTable.h.

Bool GBTACSTable::itsNew [private]

Definition at line 178 of file GBTACSTable.h.

Float GBTACSTable::itsNlagWeight [private]

weight to give the nlags elements in itsFTTemp when that is constructed set by smooth but defaults to 0.0

Definition at line 224 of file GBTACSTable.h.

Definition at line 178 of file GBTACSTable.h.

Vector<Int> GBTACSTable::itsPortA [private]

Definition at line 254 of file GBTACSTable.h.

Vector<Int> GBTACSTable::itsPortB [private]

Definition at line 254 of file GBTACSTable.h.

Vector<Double> GBTACSTable::itsPowerLevels [private]

the power level for each spectra in a row is kept here, when requested

Definition at line 230 of file GBTACSTable.h.

uInt GBTACSTable::itsSampAxis [private]

Definition at line 248 of file GBTACSTable.h.

Int GBTACSTable::itsScan [private]

Definition at line 183 of file GBTACSTable.h.

Double GBTACSTable::itsSigmaFactor [private]

Definition at line 179 of file GBTACSTable.h.

Vector<Float> GBTACSTable::itsSmoother [private]

smoothing vector - only depends on the number of lags and type of smoothing

Definition at line 227 of file GBTACSTable.h.

Definition at line 176 of file GBTACSTable.h.

Double GBTACSTable::itsSpacing [private]

cache the spacing when (re)opening the file

Definition at line 190 of file GBTACSTable.h.

Referenced by spacing().

Definition at line 177 of file GBTACSTable.h.

IPosition GBTACSTable::itsStart [private]

used in the data slicing

Definition at line 247 of file GBTACSTable.h.

RORecordFieldPtr<Double> GBTACSTable::itsTimeMid [private]

Definition at line 233 of file GBTACSTable.h.

Referenced by timeMid().

used in reporting

Definition at line 182 of file GBTACSTable.h.

Double GBTACSTable::itsTruncError [private]

Definition at line 179 of file GBTACSTable.h.

Bool GBTACSTable::itsUseDCBias [private]

Definition at line 178 of file GBTACSTable.h.

remember what the cached data cube currently has

Definition at line 175 of file GBTACSTable.h.

Int GBTACSTable::itsVVsize [private]

Definition at line 177 of file GBTACSTable.h.

Matrix<Double> GBTACSTable::itsVVTemp [private]

van-vleck corr is done as a double for accuracy - this is a temp used for that

Definition at line 215 of file GBTACSTable.h.


The documentation for this class was generated from the following file: