AntexData Class Reference
[files]

#include <AntexData.hpp>

Inheritance diagram for AntexData:

Inheritance graph
[legend]
Collaboration diagram for AntexData:

Collaboration graph
[legend]
List of all members.

Detailed Description

Antex antenna data record: PCOs and PCVs for one antenna.

Do not attempt to use an object that is not valid (cf. isValid()).

NB. Optional data should be accessed only if the corresponding 'valid' string is true; e.g. if(valid & validFromValid) then validFrom may be used.

NB. In calls to the 'get' routines, double total_PCO = getTotalPhaseCenterOffset(freq, az, el_nad) Triple PCO = getPhaseCenterOffset(freq) double PCV = getPhaseCenterVariation(freq, az, el_nad), receivers and satellites (transmitters) are treated differently, in that receivers call with elevation angle (from North-East plane toward Up) while satellites call with nadir angle (from Z axis - the bore-sight direction).

NB. The return value of getPhaseCenterOffset is a vector (Triple) PCO, in the appropriate coordinate system (NEU for Rx, XYZ or body for SV), that is defined as the vector from the reference point (RP) to the actual phase center (PC). The RP is the ARP (Antenna Reference Point) for receivers and the COM (Center Of Mass) for satellites.

NB. The PCV and total_PCO value returned by the other two routines has the same sense as the PCO vector; that is the total offset is defined as PCO vector - PCV * LOS where LOS is a unit vector along the line of sight (defined by the azimuth and elevation/nadir angle passed into the routines), all in the appropriate coordinate system (receiver NEU or satellite body XYZ).

NB. Thus when correcting a measured range for the Receiver's total phase center offset one would subtract the total_PCO value (along the line of sight) from the measured range, that is (scalar equation, millimeters): Range(corr) = Range(meas) + total_PCO; // OR --> --> Range(corr) = Range(meas) + [PCO dot LOS - PCV]; however when correcting the satellite (COM) position for the Satellite's total phase center offset one would add the total vector offset (PCO - PCV*LOS) to the satellite COM (vector) position (in a consistent coordinate system, e.g. ECEF XYZ), that is (vector equation): --> --> --> --> SV(corr) = SV(COM) + [PCO - PCV * LOS]

NB. the PCV data is stored in a map <zenith angle, value> and the getPhaseCenterVariation() routine simply interpolates this map WITHOUT changing the sign of the value - it is the same as that in the ANTEX file.

See also:
gpstk::AntexStream and gpstk::AntexHeader.

Definition at line 110 of file AntexData.hpp.

Public Types

typedef std::map< double,
double > 
zenOffsetMap
 map from zenith angle (degrees) to PC offset (millimeters)
typedef std::map< double,
zenOffsetMap
azimZenMap
 map from azimuth angle (deg) to zenOffsetMap the zenOffsetMap WITHOUT azimuth dependence (NOAZI) will be azimZenMap[-1.0] (this may be the only entry)
enum  validBits {
  startAntennaValid = 0x00001, typeSerNumValid = 0x00002, methodValid = 0x00004, daziValid = 0x00008,
  zenithValid = 0x00010, numFreqValid = 0x00020, validFromValid = 0x00040, validUntilValid = 0x00080,
  sinexCodeValid = 0x00100, dataCommentValid = 0x00200, startFreqValid = 0x00400, neuFreqValid = 0x00800,
  endOfFreqValid = 0x01000, startFreqRMSValid = 0x02000, neuFreqRMSValid = 0x04000, endOfFreqRMSValid = 0x08000,
  endOfAntennaValid = 0x10000, allValid13 = 0x11C3F
}
 Validity bits for the ANTEX Data NB. More...

Public Member Functions

 AntexData ()
 Constructor.
virtual ~AntexData ()
 Destructor.
virtual bool isData () const
 AntexData is a "data", so this function always returns true.
bool isValid (void) const
 Convenience function returns true only if a valid object.
bool isValid (CommonTime &time) const throw ()
std::string name (void) const throw ()
 Generate a name from type and serial number.
double getTotalPhaseCenterOffset (const int freq, const double azimuth, const double elevation) const throw (Exception)
Triple getPhaseCenterOffset (const int freq) const throw (Exception)
 Get the PC offset values in mm (only, NOT the phase center variations, which should be computed using getPhaseCenterVariations() and added to the PCOs to get the total phase center offset).
double getPhaseCenterVariation (const int freq, const double azimuth, const double elev_nadir) const throw (Exception)
virtual void dump (std::ostream &s, int detail=0) const
 Dump AntexData.

Public Attributes

unsigned long valid
 Bits of valid are set when corresponding labels are found and data defined.
bool absolute
 if true, PCOs are absolute, else they are relative to another antenna
bool isRxAntenna
 if true, this is a receiver antenna, otherwise its a satellite; this flag is set based on the IGS codes kept in array SatelliteTypes.
int PRN
 PRN and SVN numbers; used only in the case of satellite antennas, and may not be present, in which case these are both -1.
int SVN
 PRN and SVN numbers; used only in the case of satellite antennas, and may not be present, in which case these are both -1.
char systemChar
 system character: G or blank GPS, R GLONASS, E GALILEO, M MIXED taken from START OF FREQUENCY record (not header)
unsigned int nFreq
 number of frequencies stored, equal to number of keys in map from "# OF FREQUENCIES" record
double azimDelta
 delta azimuth (degrees) stored in azimZenMap equal to 0 if there is no azimuth dependence from "DAZI" record
double zenRange [3]
 minimum, maximum and delta zenith (degrees) stored in zenOffsetMap from "ZEN1 / ZEN2 / DZEN" record
CommonTime validFrom
 time limits of validity (OPTIONAL); otherwise set to BEGINNING and END from "VALID FROM" and "VALID UNTIL" records keep the string version for file I/O b/c sometimes the time is of the form 1994 4 17 23 59 59.9999999 VALID UNTIL and converting this to CommonTime replaces it with ...
CommonTime validUntil
 time limits of validity (OPTIONAL); otherwise set to BEGINNING and END from "VALID FROM" and "VALID UNTIL" records keep the string version for file I/O b/c sometimes the time is of the form 1994 4 17 23 59 59.9999999 VALID UNTIL and converting this to CommonTime replaces it with ...
std::string stringValidFrom
std::string stringValidUntil
std::map< int, antennaPCOandPCVDatafreqPCVmap
 map from frequency (1,2,...nFreq) to antennaPCOandPCVData
std::string type
 antenna type from "TYPE / SERIAL NO"
std::string serialNo
 antenna serial number from "TYPE / SERIAL NO"
std::string satCode
 satellite code from "TYPE / SERIAL NO"
std::string cospar
 satellite COSPAR ID from "TYPE / SERIAL NO"
std::string method
 calibration method from "METH / BY / # / DATE"
std::string agency
 agency from "METH / BY / # / DATE"
int noAntCalibrated
 num. of ant. calibrated from "METH / BY / # / DATE"
std::string date
 date from "METH / BY / # / DATE"
std::string sinexCode
 name of ant. cal. model from "SINEX CODE" OPTIONAL
std::vector< std::string > commentList
 Comments in data (OPTIONAL).

Static Public Attributes

const std::vector< std::string > SatelliteTypes
 vector of type strings that identify satellites; must be kept updated.
AntexDataFormatStrings
ANTEX Data Formatting Strings

const std::string startAntennaString = "START OF ANTENNA"
 "START OF ANTENNA"
const std::string typeSerNumString = "TYPE / SERIAL NO"
 "TYPE / SERIAL NO"
const std::string methodString = "METH / BY / # / DATE"
 "METH / BY / # / DATE"
const std::string daziString = "DAZI"
 "DAZI"
const std::string zenithString = "ZEN1 / ZEN2 / DZEN"
 "ZEN1 / ZEN2 / DZEN"
const std::string numFreqString = "# OF FREQUENCIES"
 "# OF FREQUENCIES"
const std::string validFromString = "VALID FROM"
 "VALID FROM"
const std::string validUntilString = "VALID UNTIL"
 "VALID UNTIL"
const std::string sinexCodeString = "SINEX CODE"
 "SINEX CODE"
const std::string dataCommentString = "COMMENT"
 "COMMENT"
const std::string startFreqString = "START OF FREQUENCY"
 "START OF FREQUENCY"
const std::string neuFreqString = "NORTH / EAST / UP"
 "NORTH / EAST / UP"
const std::string endOfFreqString = "END OF FREQUENCY"
 "END OF FREQUENCY"
const std::string startFreqRMSString = "START OF FREQ RMS"
 "START OF FREQ RMS"
const std::string neuFreqRMSString = "NORTH / EAST / UP"
 "NORTH / EAST / UP"
const std::string endOfFreqRMSString = "END OF FREQ RMS"
 "END OF FREQ RMS"
const std::string endOfAntennaString = "END OF ANTENNA"
 "END OF ANTENNA"

Protected Member Functions

void evaluateZenithMap (const double &zen, const zenOffsetMap &eomap, double &zen_lo, double &zen_hi, double &pco_lo, double &pco_hi) const throw ()
 Find zenith angles bracketing the input zenith angle within the given map, and the corresponding PCOs.
virtual void reallyPutRecord (FFStream &s) const throw (std::exception, FFStreamError, StringUtils::StringException)
 Writes a correctly formatted record from this data to stream s.
virtual void reallyGetRecord (FFStream &s) throw (std::exception, FFStreamError, StringUtils::StringException)
 This functions obtains Antex antenna record from the given FFStream.


Member Typedef Documentation

typedef std::map<double, zenOffsetMap> azimZenMap
 

map from azimuth angle (deg) to zenOffsetMap the zenOffsetMap WITHOUT azimuth dependence (NOAZI) will be azimZenMap[-1.0] (this may be the only entry)

Definition at line 169 of file AntexData.hpp.

Referenced by AntexData::dump().

typedef std::map<double, double> zenOffsetMap
 

map from zenith angle (degrees) to PC offset (millimeters)

Definition at line 164 of file AntexData.hpp.

Referenced by AntexData::dump().


Member Enumeration Documentation

enum validBits
 

Validity bits for the ANTEX Data NB.

if version is updated, add allValid<ver> and update isValid()

Enumeration values:
startAntennaValid  "START OF ANTENNA" Required
typeSerNumValid  "TYPE / SERIAL NO" Required
methodValid  "METH / BY / # / DATE" Required
daziValid  "DAZI" Required
zenithValid  "ZEN1 / ZEN2 / DZEN" Required
numFreqValid  "# OF FREQUENCIES" Required
validFromValid  "VALID FROM"
validUntilValid  "VALID UNTIL"
sinexCodeValid  "SINEX CODE"
dataCommentValid  "COMMENT"
startFreqValid  "START OF FREQUENCY" Required
neuFreqValid  "NORTH / EAST / UP" Required
endOfFreqValid  "END OF FREQUENCY" Required
startFreqRMSValid  "START OF FREQ RMS"
neuFreqRMSValid  "NORTH / EAST / UP"
endOfFreqRMSValid  "END OF FREQ RMS"
endOfAntennaValid  "END OF ANTENNA" Required
allValid13  mask for all required valid fields

Definition at line 137 of file AntexData.hpp.


Constructor & Destructor Documentation

AntexData  )  [inline]
 

Constructor.

Definition at line 259 of file AntexData.hpp.

References gpstk::BEGINNING_OF_TIME, and gpstk::END_OF_TIME.

virtual ~AntexData  )  [inline, virtual]
 

Destructor.

Definition at line 264 of file AntexData.hpp.


Member Function Documentation

void dump std::ostream &  s,
int  detail = 0
const [virtual]
 

Dump AntexData.

Set detail = 0 for type, serial no., sat codes only; = 1 for all information except phase center offsets, = 2 for all data.

Definition at line 288 of file AntexData.cpp.

References AntexData::agency, gpstk::StringUtils::asString(), AntexData::azimDelta, AntexData::azimZenMap, AntexData::commentList, AntexData::cospar, AntexData::date, AntexData::freqPCVmap, AntexData::isRxAntenna, AntexData::method, AntexData::name(), AntexData::nFreq, AntexData::noAntCalibrated, AntexData::antennaPCOandPCVData::PCOrms, AntexData::antennaPCOandPCVData::PCOvalue, AntexData::antennaPCOandPCVData::PCVvalue, gpstk::printTime(), AntexData::PRN, AntexData::satCode, AntexData::serialNo, AntexData::sinexCode, AntexData::SVN, AntexData::type, AntexData::valid, AntexData::validFrom, AntexData::validUntil, AntexData::zenOffsetMap, and AntexData::zenRange.

Referenced by AntennaStore::dump().

void evaluateZenithMap const double &  zen,
const zenOffsetMap eomap,
double &  zen_lo,
double &  zen_hi,
double &  pco_lo,
double &  pco_hi
const throw () [protected]
 

Find zenith angles bracketing the input zenith angle within the given map, and the corresponding PCOs.

Definition at line 408 of file AntexData.cpp.

Triple getPhaseCenterOffset const int  freq  )  const throw (Exception)
 

Get the PC offset values in mm (only, NOT the phase center variations, which should be computed using getPhaseCenterVariations() and added to the PCOs to get the total phase center offset).

NB. see documentation of the class for coordinates, signs and application.

Parameters:
freq frequency (usually 1 or 2)
Returns:
Triple containing offsets in millimeters, in appropriate coordinate system (satellite-based XYZ or receiver-based NEU).
Exceptions:
if this object is invalid if frequency does not exist for this data

Definition at line 148 of file AntexData.cpp.

References GPSTK_THROW.

double getPhaseCenterVariation const int  freq,
const double  azimuth,
const double  elev_nadir
const throw (Exception)
 

Returns:
phase center offset in millimeters
Exceptions:
if this object is invalid if frequency does not exist for this data if azimuth is out of range, azimuth is replaced with azim 360

Definition at line 178 of file AntexData.cpp.

References GPSTK_THROW, AntexData::antennaPCOandPCVData::hasAzimuth, and AntexData::antennaPCOandPCVData::PCVvalue.

double getTotalPhaseCenterOffset const int  freq,
const double  azimuth,
const double  elevation
const throw (Exception)
 

Returns:
total phase center offset in millimeters
Exceptions:
if this object is invalid if frequency does not exist for this data if azimuth is out of range; azimuth is replaced with azim mod 360

Definition at line 117 of file AntexData.cpp.

References GPSTK_RETHROW.

virtual bool isData void   )  const [inline, virtual]
 

AntexData is a "data", so this function always returns true.

Reimplemented from FFData.

Definition at line 267 of file AntexData.hpp.

bool isValid CommonTime time  )  const throw ()
 

Returns:
true if the antenna object is valid at the given time. Base on the 'validFrom' and 'validUntil' fields.

true if the input time is either BEGINNING_ or END_OF_TIME

true if the 'valid' time limits are not given. NB. useful when adding satellite antennas for processing with a dataset; pass any time tag from the dataset.

Definition at line 98 of file AntexData.cpp.

bool isValid void   )  const [inline]
 

Convenience function returns true only if a valid object.

Definition at line 270 of file AntexData.hpp.

Referenced by AntennaStore::addANTEXfile().

std::string name void   )  const throw () [inline]
 

Generate a name from type and serial number.

Definition at line 281 of file AntexData.hpp.

Referenced by AntennaStore::addANTEXfile(), and AntexData::dump().

void reallyGetRecord FFStream s  )  throw (std::exception, FFStreamError, StringUtils::StringException) [protected, virtual]
 

This functions obtains Antex antenna record from the given FFStream.

If there is an error in reading from the stream, it is reset to its original position and its fail-bit is set.

Exceptions:
StringException when a StringUtils function fails
FFStreamError when exceptions(failbit) is set and a read or formatting error occurs. This also resets the stream to its pre-read position.

Implements FFData.

Definition at line 637 of file AntexData.cpp.

References FFTextStream::formattedGetLine(), GPSTK_THROW, AntexStream::header, AntexStream::headerRead, and gpstk::StringUtils::stripTrailing().

void reallyPutRecord FFStream s  )  const throw (std::exception, FFStreamError, StringUtils::StringException) [protected, virtual]
 

Writes a correctly formatted record from this data to stream s.

Implements FFData.

Definition at line 445 of file AntexData.cpp.

References gpstk::StringUtils::asString(), GPSTK_THROW, AntexData::antennaPCOandPCVData::hasAzimuth, gpstk::StringUtils::leftJustify(), FFTextStream::lineNumber, AntexData::antennaPCOandPCVData::PCOrms, AntexData::antennaPCOandPCVData::PCOvalue, AntexData::antennaPCOandPCVData::PCVrms, AntexData::antennaPCOandPCVData::PCVvalue, and gpstk::StringUtils::rightJustify().


Member Data Documentation

bool absolute
 

if true, PCOs are absolute, else they are relative to another antenna

Definition at line 201 of file AntexData.hpp.

std::string agency
 

agency from "METH / BY / # / DATE"

Definition at line 247 of file AntexData.hpp.

Referenced by AntexData::dump().

double azimDelta
 

delta azimuth (degrees) stored in azimZenMap equal to 0 if there is no azimuth dependence from "DAZI" record

Definition at line 225 of file AntexData.hpp.

Referenced by AntexData::dump().

std::vector<std::string> commentList
 

Comments in data (OPTIONAL).

Definition at line 253 of file AntexData.hpp.

Referenced by AntexData::dump().

std::string cospar
 

satellite COSPAR ID from "TYPE / SERIAL NO"

Definition at line 245 of file AntexData.hpp.

Referenced by AntexData::dump().

const string dataCommentString = "COMMENT" [static]
 

"COMMENT"

Definition at line 68 of file AntexData.cpp.

std::string date
 

date from "METH / BY / # / DATE"

Definition at line 249 of file AntexData.hpp.

Referenced by AntexData::dump().

const string daziString = "DAZI" [static]
 

"DAZI"

Definition at line 62 of file AntexData.cpp.

const string endOfAntennaString = "END OF ANTENNA" [static]
 

"END OF ANTENNA"

Definition at line 75 of file AntexData.cpp.

const string endOfFreqRMSString = "END OF FREQ RMS" [static]
 

"END OF FREQ RMS"

Definition at line 74 of file AntexData.cpp.

const string endOfFreqString = "END OF FREQUENCY" [static]
 

"END OF FREQUENCY"

Definition at line 71 of file AntexData.cpp.

std::map<int, antennaPCOandPCVData> freqPCVmap
 

map from frequency (1,2,...nFreq) to antennaPCOandPCVData

Definition at line 240 of file AntexData.hpp.

Referenced by AntexData::dump().

bool isRxAntenna
 

if true, this is a receiver antenna, otherwise its a satellite; this flag is set based on the IGS codes kept in array SatelliteTypes.

NB. this flag need not be used, if you know which antenna you have; however if used, the array SatelliteTypes must be kept updated.

Definition at line 207 of file AntexData.hpp.

Referenced by AntennaStore::addANTEXfile(), and AntexData::dump().

std::string method
 

calibration method from "METH / BY / # / DATE"

Definition at line 246 of file AntexData.hpp.

Referenced by AntexData::dump().

const string methodString = "METH / BY / # / DATE" [static]
 

"METH / BY / # / DATE"

Definition at line 61 of file AntexData.cpp.

const string neuFreqRMSString = "NORTH / EAST / UP" [static]
 

"NORTH / EAST / UP"

Definition at line 73 of file AntexData.cpp.

const string neuFreqString = "NORTH / EAST / UP" [static]
 

"NORTH / EAST / UP"

Definition at line 70 of file AntexData.cpp.

unsigned int nFreq
 

number of frequencies stored, equal to number of keys in map from "# OF FREQUENCIES" record

Definition at line 220 of file AntexData.hpp.

Referenced by AntexData::dump().

int noAntCalibrated
 

num. of ant. calibrated from "METH / BY / # / DATE"

Definition at line 248 of file AntexData.hpp.

Referenced by AntexData::dump().

const string numFreqString = "# OF FREQUENCIES" [static]
 

"# OF FREQUENCIES"

Definition at line 64 of file AntexData.cpp.

int PRN
 

PRN and SVN numbers; used only in the case of satellite antennas, and may not be present, in which case these are both -1.

NB. PRNs apply to GLONASS as well as GPS

Definition at line 212 of file AntexData.hpp.

Referenced by AntexData::dump().

std::string satCode
 

satellite code from "TYPE / SERIAL NO"

Definition at line 244 of file AntexData.hpp.

Referenced by AntexData::dump().

const vector< string > SatelliteTypes [static]
 

vector of type strings that identify satellites; must be kept updated.

keep this updated from the IGS file 'rcvr_ant.tab'

std::string serialNo
 

antenna serial number from "TYPE / SERIAL NO"

Definition at line 243 of file AntexData.hpp.

Referenced by AntexData::dump().

std::string sinexCode
 

name of ant. cal. model from "SINEX CODE" OPTIONAL

Definition at line 250 of file AntexData.hpp.

Referenced by AntexData::dump().

const string sinexCodeString = "SINEX CODE" [static]
 

"SINEX CODE"

Definition at line 67 of file AntexData.cpp.

const string startAntennaString = "START OF ANTENNA" [static]
 

"START OF ANTENNA"

Definition at line 59 of file AntexData.cpp.

const string startFreqRMSString = "START OF FREQ RMS" [static]
 

"START OF FREQ RMS"

Definition at line 72 of file AntexData.cpp.

const string startFreqString = "START OF FREQUENCY" [static]
 

"START OF FREQUENCY"

Definition at line 69 of file AntexData.cpp.

std::string stringValidFrom
 

Definition at line 237 of file AntexData.hpp.

std::string stringValidUntil
 

Definition at line 237 of file AntexData.hpp.

int SVN
 

PRN and SVN numbers; used only in the case of satellite antennas, and may not be present, in which case these are both -1.

NB. PRNs apply to GLONASS as well as GPS

Definition at line 212 of file AntexData.hpp.

Referenced by AntexData::dump().

char systemChar
 

system character: G or blank GPS, R GLONASS, E GALILEO, M MIXED taken from START OF FREQUENCY record (not header)

Definition at line 216 of file AntexData.hpp.

Referenced by AntennaStore::addANTEXfile().

std::string type
 

antenna type from "TYPE / SERIAL NO"

Definition at line 242 of file AntexData.hpp.

Referenced by AntexData::dump().

const string typeSerNumString = "TYPE / SERIAL NO" [static]
 

"TYPE / SERIAL NO"

Definition at line 60 of file AntexData.cpp.

unsigned long valid
 

Bits of valid are set when corresponding labels are found and data defined.

Definition at line 198 of file AntexData.hpp.

Referenced by AntexData::dump().

CommonTime validFrom
 

time limits of validity (OPTIONAL); otherwise set to BEGINNING and END from "VALID FROM" and "VALID UNTIL" records keep the string version for file I/O b/c sometimes the time is of the form 1994 4 17 23 59 59.9999999 VALID UNTIL and converting this to CommonTime replaces it with ...

24 0 0.000

Definition at line 236 of file AntexData.hpp.

Referenced by AntexData::dump().

const string validFromString = "VALID FROM" [static]
 

"VALID FROM"

Definition at line 65 of file AntexData.cpp.

CommonTime validUntil
 

time limits of validity (OPTIONAL); otherwise set to BEGINNING and END from "VALID FROM" and "VALID UNTIL" records keep the string version for file I/O b/c sometimes the time is of the form 1994 4 17 23 59 59.9999999 VALID UNTIL and converting this to CommonTime replaces it with ...

24 0 0.000

Definition at line 236 of file AntexData.hpp.

Referenced by AntexData::dump().

const string validUntilString = "VALID UNTIL" [static]
 

"VALID UNTIL"

Definition at line 66 of file AntexData.cpp.

const string zenithString = "ZEN1 / ZEN2 / DZEN" [static]
 

"ZEN1 / ZEN2 / DZEN"

Definition at line 63 of file AntexData.cpp.

double zenRange[3]
 

minimum, maximum and delta zenith (degrees) stored in zenOffsetMap from "ZEN1 / ZEN2 / DZEN" record

Definition at line 229 of file AntexData.hpp.

Referenced by AntexData::dump().


The documentation for this class was generated from the following files:
Generated on Wed Jun 19 03:31:36 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1