casa
$Rev:20696$
|
AntennaResponses provides access to antenna response data. More...
#include <AntennaResponses.h>
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 ¢er=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 ¢er=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 ¢er=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 ¢er=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< String > | paths_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< String > | ObsName_p |
Vector< MEpoch > | StartTime_p |
Vector< String > | AntennaType_p |
Vector< String > | ReceiverType_p |
Vector< Int > | BeamId_p |
Vector< Int > | BeamNumber_p |
Vector< MDirection > | ValidCenter_p |
Vector< MDirection > | ValidCenterMin_p |
Vector< MDirection > | ValidCenterMax_p |
Vector< uInt > | NumSubbands_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< uInt > | pathIndex_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) |
AntennaResponses provides access to antenna response data.
Internal
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.
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.
Definition at line 147 of file AntennaResponses.h.
Definition at line 151 of file AntennaResponses.h.
casa::AntennaResponses::AntennaResponses | ( | ) | [inline] |
this can of course be extended for additional types if necessary
Constructor, does not call init()
Definition at line 165 of file AntennaResponses.h.
casa::AntennaResponses::AntennaResponses | ( | const String & | path | ) |
Constructor, calls init()
Bool casa::AntennaResponses::append | ( | const String & | path | ) |
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
Bool casa::AntennaResponses::isInit | ( | const String & | path | ) |
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:
Vector<String> casa::AntennaResponses::AntennaType_p [private] |
Definition at line 333 of file AntennaResponses.h.
Vector<Vector<String> > casa::AntennaResponses::BandName_p [private] |
Definition at line 341 of file AntennaResponses.h.
Vector<Int> casa::AntennaResponses::BeamId_p [private] |
Definition at line 335 of file AntennaResponses.h.
Vector<Int> casa::AntennaResponses::BeamNumber_p [private] |
Definition at line 336 of file AntennaResponses.h.
Vector<Vector<uInt> > casa::AntennaResponses::FuncChannel_p [private] |
Definition at line 346 of file AntennaResponses.h.
Vector<Vector<String> > casa::AntennaResponses::FuncName_p [private] |
Definition at line 345 of file AntennaResponses.h.
Vector<Vector<FuncTypes> > casa::AntennaResponses::FuncType_p [private] |
Definition at line 344 of file AntennaResponses.h.
Vector<Vector<MVFrequency> > casa::AntennaResponses::NomFreq_p [private] |
Definition at line 347 of file AntennaResponses.h.
uInt casa::AntennaResponses::numRows_p [private] |
here a complete copy of the AntennaResponses table is stored
Definition at line 330 of file AntennaResponses.h.
Vector<uInt> casa::AntennaResponses::NumSubbands_p [private] |
Definition at line 340 of file AntennaResponses.h.
Vector<String> casa::AntennaResponses::ObsName_p [private] |
Definition at line 331 of file AntennaResponses.h.
Vector<uInt> casa::AntennaResponses::pathIndex_p [private] |
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.
Vector<String> casa::AntennaResponses::paths_p [private] |
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.
Vector<String> casa::AntennaResponses::ReceiverType_p [private] |
Definition at line 334 of file AntennaResponses.h.
Vector<Vector<MVAngle> > casa::AntennaResponses::RotAngOffset_p [private] |
Definition at line 348 of file AntennaResponses.h.
Vector<MEpoch> casa::AntennaResponses::StartTime_p [private] |
Definition at line 332 of file AntennaResponses.h.
Vector<Vector<MVFrequency> > casa::AntennaResponses::SubbandMaxFreq_p [private] |
Definition at line 343 of file AntennaResponses.h.
Vector<Vector<MVFrequency> > casa::AntennaResponses::SubbandMinFreq_p [private] |
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.