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

AntennaResponses provides access to antenna response data. More...

#include <AntennaResponses.h>

List of all members.

Public Types

enum  FuncTypes {
  NA,
  AIF,
  EFP,
  VP,
  VPMAN,
  INTERNAL,
  N_FuncTypes,
  ANY,
  INVALID
}

Public Member Functions

 AntennaResponses ()
 this can of course be extended for additional types if necessary
 AntennaResponses (const String &path)
 Constructor, calls init()
Bool init (const String &path="")
 Takes the path (as taken from the new ANTENNA_RESPONSES column of the Observatories table) and uses it as the name and location of the AntennaResponses table, and then initializes the member vectors; can be called repeatedly with different paths; each call will overwrite the vectors.
Bool append (const String &path)
 As init but does not overwrite the table (member vectors) in memory.
Bool isInit ()
 returns True if paths_p has at least one member
Bool isInit (const String &path)
 returns True if path is a member element of paths_p, i.e.
Bool getRowAndIndex (uInt &row, uInt &subBand, const String &obsName, const MEpoch &obsTime, const MFrequency &freq, const FuncTypes &requFType=ANY, const String &antennaType="", const MDirection &center=MDirection(Quantity(0.,"deg"), Quantity(90.,"deg"), MDirection::AZEL), const String &receiverType="", const Int &beamNumber=0)
 find the row containing the information pertinent to the given parameters (this is also the index in the member vectors) and the index (subband) to the frequency channel of the response return false if no matching row could be found
Bool getRowAndIndex (uInt &row, uInt &subBand, const String &obsName, const Int &beamId, const MFrequency &freq)
 overloaded method: as previous method but using beamId (instead of obs.
Bool getImageName (String &functionImageName, uInt &funcChannel, MFrequency &nomFreq, FuncTypes &fType, MVAngle &rotAngOffset, const String &obsName, const MEpoch &obsTime, const MFrequency &freq, const FuncTypes &requFType=ANY, const String &antennaType="", const MDirection &center=MDirection(Quantity(0.,"deg"), Quantity(90.,"deg"), MDirection::AZEL), const String &receiverType="", const Int &beamNumber=0)
 getRowAndIndex is then used by the following methods
Bool getImageName (String &functionImageName, uInt &funcChannel, MFrequency &nomFreq, FuncTypes &fType, MVAngle &rotAngOffset, const String &obsName, const Int &beamId, const MFrequency &freq)
 Overloaded method: as previous method but using beamId (instead of obs.
Bool getAntennaTypes (Vector< String > &antTypes, const String &obsName, const MEpoch &obsTime, const MFrequency &freq, const FuncTypes &requFType=ANY, const MDirection &center=MDirection(Quantity(0.,"deg"), Quantity(90.,"deg"), MDirection::AZEL), const String &receiverType="", const Int &beamNumber=0)
 Get a vector containing all unique antenna type strings for the given constraints.
Bool putRow (uInt &row, const String &obsName, const Int &beamId, const Vector< String > &bandName, const Vector< MVFrequency > &subbandMinFreq, const Vector< MVFrequency > &subbandMaxFreq, const Vector< FuncTypes > &funcType, const Vector< String > &funcName, const Vector< uInt > &funcChannel, const Vector< MVFrequency > &nomFreq, const Vector< MVAngle > &rotAngOffset, const String &antennaType="", const MEpoch &startTime=MEpoch(MVEpoch(Quantity(40588.,"d")), MEpoch::UTC), const MDirection &center=MDirection(Quantity(0.,"deg"), Quantity(90.,"deg"), MDirection::AZEL), const MDirection &validCenterMin=MDirection(Quantity(0.,"deg"), Quantity(0.,"deg"), MDirection::AZEL), const MDirection &validCenterMax=MDirection(Quantity(360.,"deg"), Quantity(90.,"deg"), MDirection::AZEL), const String &receiverType="", const Int &beamNumber=0)
 Put the given row into the present antenna reponses table (in memory).
void create (const String &path)
 Create an new AntennaReponses table on disk at the given path and fill it with the table contents presently in memory.
FuncTypes FuncType (Int i)
 Convert from Int to FuncType.
Bool getBandName (String &bandName, const String &obsName, const MVFrequency &freq)
 get the name of the band corresponding to the frequency (in the rest frame of the observatory)

Static Public Member Functions

static FuncTypes FuncType (const String &sftyp)
 Convert from String to FuncType.

Private Attributes

Vector< Stringpaths_p
 after initialization, this contains the name of the path where the AntennaResponses table was read from; if append was used to read additional tables in the memory table, then this vector has several elements representing the different tables
uInt numRows_p
 here a complete copy of the AntennaResponses table is stored
Vector< StringObsName_p
Vector< MEpochStartTime_p
Vector< StringAntennaType_p
Vector< StringReceiverType_p
Vector< IntBeamId_p
Vector< IntBeamNumber_p
Vector< MDirectionValidCenter_p
Vector< MDirectionValidCenterMin_p
Vector< MDirectionValidCenterMax_p
Vector< uIntNumSubbands_p
Vector< Vector< String > > BandName_p
Vector< Vector< MVFrequency > > SubbandMinFreq_p
Vector< Vector< MVFrequency > > SubbandMaxFreq_p
Vector< Vector< FuncTypes > > FuncType_p
Vector< Vector< String > > FuncName_p
Vector< Vector< uInt > > FuncChannel_p
Vector< Vector< MVFrequency > > NomFreq_p
Vector< Vector< MVAngle > > RotAngOffset_p
Vector< uIntpathIndex_p
 not part of the table but same number of elements: memory of the path from which the row was read (index to paths_p)

Detailed Description

AntennaResponses provides access to antenna response data.

Intended use:

Internal

Review Status

Reviewed By:
Ger van Diepen, Max Voronkov, Dirk Petry, Remy Indebetouw
Date Reviewed:
Jan 2011
Test programs:
tAntennaResponses

Prerequisite

Etymology

Synopsis

The location of the AntennaResponses table for a given observatory is set in the column String ANTENNA_RESPONSES in the "Observatories" table (accessed via the MeasTable class).

The detailed rules of how the location and name of the table is derived from the string found in ANTENNA_RESPONSES is described further down in the comment to the initAntennaResponses() method.

E.g., for ALMA, the location of the table would be

    data/alma/AntennaResponses

and the entry in the Observatories table would be simply "alma/AntennaResponses".

"AntennaResponses" is the recommended name of the table but in principle any name can be used. That name will then have to be given in the Observatories table.

Contents of the AntennaResponses table:

column 0: Int BEAM_ID (a unique number in the table for the given observatory name) column 1: String NAME (name of the observatory as in the observatory table) column 2: Int BEAM_NUMBER (for observataories which support several simultaneous beams, zero-based) column 3: Double START_TIME (a Measure, the time from which onwards this table row is valid) column 4: String ANTENNA_TYPE (for ALMA: "DV", "DA", "PM", or "CM") column 5: String RECEIVER_TYPE (for ALMA this will not be filled, at least for the moment) column 6: Int NUM_SUBBANDS (number of response frequency sub-bands) column 7: Array String (size set by NUM_SUBBANDS) BAND_NAME (for ALMA: "1", "2" etc.) (if there is more than one sub-band per band, the band name repeats) column 8: Array Double (a Quantum, size set by NUM_SUBBANDS) SUBBAND_MIN_FREQ column 9: Array Double (a Quantum, size set by NUM_SUBBANDS) SUBBAND_MAX_FREQ column 10: MDirection CENTER (the nominal center sky position where this row is valid, default (0.,90.) AZEL) column 11: MDirection VALID_CENTER_MIN (sky position validity range min values, default (0.,0.) AZEL) column 12: MDirection VALID_CENTER_MAX (sky position validity range max values, default (360.,90.) AZEL) column 13: Array Int (size set by NUM_SUBBANDS) FUNCTION_TYPE (uses enum FuncTypes defined below: EFP = complex electric field pattern image, VP = voltage pattern image, AIF = complex aperture illumination function image, NA = the function is not yet available, here other codes can be easily added, e.g. VPMAN = the function is available in casa via the vp manager (details t.b.d.), INTERNAL = the function is generated on the fly internally using ray-tracing as for the EVLA) column 14: Array String (size set by NUM_SUBBANDS) FUNCTION_NAME (names of the images as paths relative to the directory where this table is located, empty string if no image is available for the band, e.g. "ticra_efield_patterns/melco12m_band6_efp.im") column 15: Array uInt (size set by NUM_SUBBANDS) FUNCTION_CHANNEL (the spectral image channel to use, can be different from 0 in the case that several antenna responses are stored in one image file) column 16: Array Double (a Quantum, size set by NUM_SUBBANDS) NOMINAL_FREQ (the nominal frequency of the channel given by FUNCTION_CHANNEL) column 17: Array Double (a Quantum, size set by NUM_SUBBANDS) RESPONSE_ROTATION_OFFSET (the angle of an additional constant rotation of the response image) project-dependent implementation)

It is assured by the table filling code that columns 10, 11, and 12 use the same MDirection type.

Example

Motivation

Information on receiver bands and corresponding primary beams (in whatever form) for different antenna types needs to be made available to the CASA code in a place where imaging code can pick it up.

To Do

Definition at line 147 of file AntennaResponses.h.


Member Enumeration Documentation

Enumerator:
NA 
AIF 
EFP 
VP 
VPMAN 
INTERNAL 
N_FuncTypes 
ANY 
INVALID 

Definition at line 151 of file AntennaResponses.h.


Constructor & Destructor Documentation

this can of course be extended for additional types if necessary

Constructor, does not call init()

Definition at line 165 of file AntennaResponses.h.

Constructor, calls init()


Member Function Documentation

As init but does not overwrite the table (member vectors) in memory.

Instead it appends to the vectors. Returns False if the path was already read before.

void casa::AntennaResponses::create ( const String path)

Create an new AntennaReponses table on disk at the given path and fill it with the table contents presently in memory.

Throw exceptions if there are problems writing the table.

Convert from Int to FuncType.

static FuncTypes casa::AntennaResponses::FuncType ( const String sftyp) [static]

Convert from String to FuncType.

Bool casa::AntennaResponses::getAntennaTypes ( Vector< String > &  antTypes,
const String obsName,
const MEpoch obsTime,
const MFrequency freq,
const FuncTypes requFType = ANY,
const MDirection center = MDirection(Quantity(0.,"deg"), Quantity(90.,"deg"), MDirection::AZEL),
const String receiverType = "",
const Int beamNumber = 0 
)

Get a vector containing all unique antenna type strings for the given constraints.

Bool casa::AntennaResponses::getBandName ( String bandName,
const String obsName,
const MVFrequency freq 
)

get the name of the band corresponding to the frequency (in the rest frame of the observatory)

Bool casa::AntennaResponses::getImageName ( String functionImageName,
uInt funcChannel,
MFrequency nomFreq,
FuncTypes fType,
MVAngle rotAngOffset,
const String obsName,
const MEpoch obsTime,
const MFrequency freq,
const FuncTypes requFType = ANY,
const String antennaType = "",
const MDirection center = MDirection(Quantity(0.,"deg"), Quantity(90.,"deg"), MDirection::AZEL),
const String receiverType = "",
const Int beamNumber = 0 
)

getRowAndIndex is then used by the following methods

Access methods for the response images: takes an observatory name, an observation time, the antenna type (e.g. "DV"), the receiverType, a frequency, a function type (enum FuncTypes, can be ANY, i.e. take the first available), a direction, and a beam number and finds the appropriate image in the AntennaResponses table which contains the image of the requested type and returns the path, the channel to use, the frequency of that channel, and the FuncType of the image. The image will contain a spectral axis even if degenerate. The direction axis pair of the stored images is set as follows: The axes are parallel to the ones given by the coordinate system type of the CENTER column of the AntennaReponses table. The center of the image is that given by the CENTER column. Furthermore, the images contain a Stokes axis (even if degenerate) to express the beams for the different polarizations or polarization products. Returns false if no appropriate image could be found.

Bool casa::AntennaResponses::getImageName ( String functionImageName,
uInt funcChannel,
MFrequency nomFreq,
FuncTypes fType,
MVAngle rotAngOffset,
const String obsName,
const Int beamId,
const MFrequency freq 
)

Overloaded method: as previous method but using beamId (instead of obs.

time, ant. type, rec. type, center, and functype)

Bool casa::AntennaResponses::getRowAndIndex ( uInt row,
uInt subBand,
const String obsName,
const MEpoch obsTime,
const MFrequency freq,
const FuncTypes requFType = ANY,
const String antennaType = "",
const MDirection center = MDirection(Quantity(0.,"deg"), Quantity(90.,"deg"), MDirection::AZEL),
const String receiverType = "",
const Int beamNumber = 0 
)

find the row containing the information pertinent to the given parameters (this is also the index in the member vectors) and the index (subband) to the frequency channel of the response return false if no matching row could be found

Bool casa::AntennaResponses::getRowAndIndex ( uInt row,
uInt subBand,
const String obsName,
const Int beamId,
const MFrequency freq 
)

overloaded method: as previous method but using beamId (instead of obs.

time, ant. type, rec. type, center, and beam number)

Bool casa::AntennaResponses::init ( const String path = "")

Takes the path (as taken from the new ANTENNA_RESPONSES column of the Observatories table) and uses it as the name and location of the AntennaResponses table, and then initializes the member vectors; can be called repeatedly with different paths; each call will overwrite the vectors.

If the path is an empty string, the member vectors will be reset to empty, i.e. this is interpreted to mean that there is no AntennaResponses table on disk. Returns True unless for some reason the initialisation fails (other than path=="").

returns True if paths_p has at least one member

returns True if path is a member element of paths_p, i.e.

the contents of path was read

Bool casa::AntennaResponses::putRow ( uInt row,
const String obsName,
const Int beamId,
const Vector< String > &  bandName,
const Vector< MVFrequency > &  subbandMinFreq,
const Vector< MVFrequency > &  subbandMaxFreq,
const Vector< FuncTypes > &  funcType,
const Vector< String > &  funcName,
const Vector< uInt > &  funcChannel,
const Vector< MVFrequency > &  nomFreq,
const Vector< MVAngle > &  rotAngOffset,
const String antennaType = "",
const MEpoch startTime = MEpoch(MVEpoch(Quantity(40588.,"d")), MEpoch::UTC),
const MDirection center = MDirection(Quantity(0.,"deg"), Quantity(90.,"deg"), MDirection::AZEL),
const MDirection validCenterMin = MDirection(Quantity(0.,"deg"), Quantity(0.,"deg"), MDirection::AZEL),
const MDirection validCenterMax = MDirection(Quantity(360.,"deg"), Quantity(90.,"deg"), MDirection::AZEL),
const String receiverType = "",
const Int beamNumber = 0 
)

Put the given row into the present antenna reponses table (in memory).

If the row exists at the position given by uInt row, it is overwritten. If it doesn't exist, the table is resized by one in memory and the new row is added at the last position. The variable "row" then contains the actual row that was filled. Returns false, if the table was not initialised or the given data was not consistent. Consistency checks:

  • all vectors have same dimension which is then used to set numSubbands
  • beamId is unique for the given observatory
  • center, validCenterMin, and validCenterMax have the same MDirection type

Member Data Documentation

Definition at line 333 of file AntennaResponses.h.

Definition at line 341 of file AntennaResponses.h.

Definition at line 335 of file AntennaResponses.h.

Definition at line 336 of file AntennaResponses.h.

Definition at line 346 of file AntennaResponses.h.

Definition at line 345 of file AntennaResponses.h.

Definition at line 344 of file AntennaResponses.h.

Definition at line 347 of file AntennaResponses.h.

here a complete copy of the AntennaResponses table is stored

Definition at line 330 of file AntennaResponses.h.

Definition at line 340 of file AntennaResponses.h.

Definition at line 331 of file AntennaResponses.h.

not part of the table but same number of elements: memory of the path from which the row was read (index to paths_p)

Definition at line 352 of file AntennaResponses.h.

after initialization, this contains the name of the path where the AntennaResponses table was read from; if append was used to read additional tables in the memory table, then this vector has several elements representing the different tables

Definition at line 327 of file AntennaResponses.h.

Definition at line 334 of file AntennaResponses.h.

Definition at line 348 of file AntennaResponses.h.

Definition at line 332 of file AntennaResponses.h.

Definition at line 343 of file AntennaResponses.h.

Definition at line 342 of file AntennaResponses.h.

Definition at line 337 of file AntennaResponses.h.

Definition at line 339 of file AntennaResponses.h.

Definition at line 338 of file AntennaResponses.h.


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