radterrain

This Websocket server performs all DEM related computations, including multiprocessed LoS and propagation loss computations intergating splat via Boost and MPI.

class radterrain.Application

Bases: Application

Tornado Application class

class radterrain.RadTerrainWebSocketHandler(val1, val2)

Bases: WebSocketHandler

Tornado Websocket handler

check_origin(origin)

Override to enable support for allowing alternate origins.

The origin argument is the value of the Origin HTTP header, the url responsible for initiating this request. This method is not called for clients that do not send this header; such requests are always allowed (because all browsers that implement WebSockets support this header, and non-browser clients do not have the same cross-site security concerns).

Should return True to accept the request or False to reject it. By default, rejects all requests with an origin on a host other than this one.

This is a security protection against cross site scripting attacks on browsers, since WebSockets are allowed to bypass the usual same-origin policies and don’t use CORS headers.

Warning

This is an important security measure; don’t disable it without understanding the security implications. In particular, if your authentication is cookie-based, you must either restrict the origins allowed by check_origin() or implement your own XSRF-like protection for websocket connections. See these articles for more.

To accept all cross-origin traffic (which was the default prior to Tornado 4.0), simply override this method to always return True:

def check_origin(self, origin):
    return True

To allow connections from any subdomain of your site, you might do something like:

def check_origin(self, origin):
    parsed_origin = urllib.parse.urlparse(origin)
    return parsed_origin.netloc.endswith(".mydomain.com")

Added in version 4.0.

on_close()

Invoked when the WebSocket is closed.

If the connection was closed cleanly and a status code or reason phrase was supplied, these values will be available as the attributes self.close_code and self.close_reason.

Changed in version 4.0: Added close_code and close_reason attributes.

on_message(message)

Handle incoming messages on the WebSocket

This method must be overridden.

Changed in version 4.5: on_message can be a coroutine.

open()

Invoked when a new WebSocket is opened.

The arguments to open are extracted from the tornado.web.URLSpec regular expression, just like the arguments to tornado.web.RequestHandler.get.

open may be a coroutine. on_message will not be called until open has returned.

Changed in version 5.1: open may be a coroutine.

radterrain.get_pcl_max_los_grid_splat(radar_lon, radar_lat, radar_h, lon_start, lon_stop, lon_step, lat_start, lat_stop, lat_step, z_start, z_stop, z_step, loc_name, propagation, reverse_direction, sig_type, wished_nof_lats, wished_nof_lons)

Returns an array containing the minimum height in masl required at each grid point to have LoS. If no LoS even at terrain height then -999 will be the value. It also computes propagation losses and save to disk for a given query.

radterrain.get_pet_coverage_for_quadrant(queue, radar_h, theta_res, dist_step, rad_id, flight_height, radar_lat, radar_lon, erp_dbm, threshold_dbm, freq, quadrant, radioprop_enabled=0, use_antenna_diag=0, h_antenna_diagramm=None, v_antenna_diagramm=None, main_beam_azimuth=0, main_beam_elevation=0, magl_enabled=0)

” returns pet coverage for a given quadrant

radterrain.get_radar_coverage_above_Sensor(rad_id, flight_height, radar_lat, radar_lon, power, antenna_diam, freq, pulse_width, cpi_pulses, bandwidth, pfa, rcs, min_elev_deg, max_elev_deg, queue, radioprop_enabled=0)

computes radar coverage for a given altitude above the sensor

radterrain.get_radar_coverage_below_sensor(rad_id, flight_height, radar_lat, radar_lon, power, antenna_diam, freq, pulse_width, cpi_pulses, bandwidth, pfa, rcs, min_elev, max_elev, queue, radioprop_enabled=0, magl_enabled=0)

computes radar coverage for a given altitude below the sensor

radterrain.main()

main function