DRCL J-Sim API

drcl.inet.mac
Class Globe

java.lang.Object
  extended bydrcl.inet.mac.Globe

public class Globe
extends java.lang.Object

This class extracts the altitude of any place on earth from the Globe database.
WARNING: there is some code that MAY need to be changed depending on your computer system. This is because the GLOBE data base is stored in a binary format and unix systems must byte swap the data. PCs do not. The code can be found in subroutine getGlobeData. Follow instructions in the comments. This implementation has been tested on PCs with both Linux and Windows operating systems. If you are not sure if it extracts the right data on your computer system, use GlobeTest in this package to test it.

Author:
Honghai Zhang
See Also:
GlobeTest

Constructor Summary
Globe(double tx_lat, double tx_lon, double rx_lat, double rx_lon, int nPts, java.lang.String globepath)
          Constructs a Globe with transmitter and receiver's locations, number of sampling points and path containing the globe database.
Globe(java.lang.String globepath)
          Constructs a Globe with the path containing the globe database.
 
Method Summary
 void dispose()
          Release the open file resources.
 int get_pfl(double[] pfl)
          Extract a path profile array from Tx to Rx from the GLOBE data base.
 void resetPosition(double tx_lat, double tx_lon, double rx_lat, double rx_lon, int nPts)
          Reset transmitter and receiver's locations and number of sampling points.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Globe

public Globe(double tx_lat,
             double tx_lon,
             double rx_lat,
             double rx_lon,
             int nPts,
             java.lang.String globepath)
Constructs a Globe with transmitter and receiver's locations, number of sampling points and path containing the globe database.


Globe

public Globe(java.lang.String globepath)
Constructs a Globe with the path containing the globe database.

Method Detail

resetPosition

public void resetPosition(double tx_lat,
                          double tx_lon,
                          double rx_lat,
                          double rx_lon,
                          int nPts)
Reset transmitter and receiver's locations and number of sampling points.


get_pfl

public int get_pfl(double[] pfl)
Extract a path profile array from Tx to Rx from the GLOBE data base. Elevation points are in meters. The great circle SHORTEST path will be extracted from the data base. Longitude values should be in the range [-180 to +180 degrees], with +lon=East.
pfl = array to fill (result will be in meters)
pfl(0) = number of points to get between Tx and Rx
pfl(1) = distance between points (meters) thus, (pfl(0)-1)*pfl(1)=distance between Tx and Rx
pfl(2) = Tx elevation in meters
pfl(npoints+1) = Rx elevation in meters.
Return positive if no GLOBE data exists or error in Globe data file.
Written for the NOAA's Globe Version 1.0 elevation data.


dispose

public void dispose()
Release the open file resources.


DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~