op_radio_antenna_gain_to_location_get()
Note: Requires Wireless functionality
Abstract
Gets an antenna’s gain to a given location.
Syntax
op_radio_antenna_gain_to_location_get (antenna_objid, x, y, z)
| Argument | Type | Description |
|---|---|---|
antenna_objid |
Objid |
Antenna of interest. |
x |
double |
Geocentric x coordinate of location of interest. |
y |
double |
Geocentric y coordinate of location of interest. |
z |
double |
Geocentric z coordinate of location of interest. |
Return Type
double
Antenna gain in direction of specified location, in dB. (If the gain cannot be obtained, 0.0 is returned.)
Example
/* Get receive antenna gain toward transmitter. */
objid rx_antenna_objid;
double tx_x, tx_y, tx_z, gain;
/* Obtain the geocentric coordinates of the transmitter. */
tx_x = op_td_get_dbl (pkptr, OPC_TDA_RA_TX_GEO_X);
tx_y = op_td_get_dbl (pkptr, OPC_TDA_RA_TX_GEO_Y);
tx_z = op_td_get_dbl (pkptr, OPC_TDA_RA_TX_GEO_Z);
/* Obtain the receiver antenna objid. */
rx_antenna_objid = op_td_get_int (pkptr, OPC_TDA_RA_RX_ANT_OBJID);
gain = op_radio_antenna_gain_to_location_get (rx_antenna_objid, tx_x, tx_y, tx_z);
Details
This function returns OPC_COMPCODE_FAILURE if no angle values to the location can be retrieved or they are irrelevant. For example, this applies when
- no antenna module is present (therefore, the antenna is isotropic)
- the antenna module uses an isotropic pattern
- the antenna and target locations are identical
Purpose
Provides a mechanism for getting the gain of an antenna in the direction of a specified location.
Errors
- None.
Reference
- None.