The radar utilities are shared by the weather radar page in the aircraft apps and in the standalone Radar app. They provide:
SvgScene.In the beam geometry functions, altitudes are in feet, distances are in nautical miles, and angles are in degrees. A beam tilt is positive above horizontal and negative below horizontal.
The radar weather model is based on the freezing level. In stable weather, the high reflectivity zone is a band around the freezing level (from hrTopTemp to hrBotTemp), and the moderate reflectivity zone extends above it to mrTopTemp. In unstable (convective) weather, the high reflectivity zone extends from the stable bottom of the zone up to unstableTopAlt. A radar beam shows weather when it spans these zones.
The radar utilities are not re-exported by common/aero/export.js. Import them directly from common/aero/radarUtil.js.
ERADIUSThe radius of the earth in nautical miles: 6371.01 km, or about 3440.07 nm.
mrTopTempThe temperature in degrees Celsius at the top of the moderate reflectivity zone: -20.
hrTopTempThe temperature in degrees Celsius at the top of the high reflectivity (freezing level) zone: -5.
hrBotTempThe temperature in degrees Celsius at the bottom of the high reflectivity (freezing level) zone: 2.
unstableTopAltThe altitude in feet of the top of the moderate reflectivity zone in unstable conditions: 30,000.
classToFillAn object that maps radar display classes to SVG fill colors. The classes are:
noReflect: A pale red. The beam is over or under the weather (no reflectivity), and in overfly mode the area that is too close to the aircraft altitude.modReflect: A pale green. The beam spans the moderate reflectivity zone.hiReflect: A green. The beam spans the high reflectivity zone.freezingLevel: A bright green. The freezing level line.safetyZone: Light yellow. The overfly safety zone.MAX_TACTICAL_RANGEThe maximum outer range in nautical miles for an overfly (tactical) scan: 200 (about 20 minutes at 600 knots).
nearZoneThe size in feet of the overscan zone below the aircraft altitude in overfly mode: 5,000.
stableRiseThe maximum rise rate of low convection in feet per minute: 1,000. The radar page uses it to warn of a possible dangerous overscan when an overfly scan would spend longer in the red zone than convection could take to rise across the gap to the overfly altitude.
beamAltitude()beamAltitude(acAlt, angle, dist, gndAlt)
Returns the altitude of the center of a radar beam at a distance from the aircraft, accounting for the curvature of the earth. If the beam is pointed at the ground and the distance is at or beyond the tangent point, the ground altitude is returned.
acAltangledistgndAltThe beam altitude in feet, rounded to the nearest foot, and never lower than gndAlt.
beamDistToAltitude()beamDistToAltitude(fromAlt, angle, toAlt)
Returns the distances along a beam that start at altitude fromAlt with a tilt of angle at which the beam reaches altitude toAlt. If toAlt is not lower than fromAlt, there is one solution. If toAlt is lower than fromAlt, the beam crosses toAlt twice (going down and then up again after the earth curves away), so there are two solutions.
fromAltangletoAltAn array with 1 or 2 distances in nautical miles. With two distances, the nearer one is first. A distance is NaN if the beam never reaches toAlt.
beamTangentDistance()beamTangentDistance(acAlt, targetAlt)
Returns the distance at which a beam from the aircraft would be tangent to the earth at altitude targetAlt. For targetAlt equal to the ground altitude, this is the distance to the horizon.
acAlttargetAltThe tangent distance in nautical miles.
beamTanAngle()beamTanAngle(acAlt, targetAlt)
Returns the tilt angle at which a beam from the aircraft would be tangent to the earth at altitude targetAlt. This is the beam tilt that just touches the horizon.
acAlttargetAltThe tilt in degrees. It is negative (below horizontal) when targetAlt is below acAlt.
beamWidthAtDistance()beamWidthAtDistance(dist, beamWidth)
Returns the width in nautical miles of a beam at a distance.
distbeamWidthThe width of the beam in nautical miles at dist.
earthCenterDistance()earthCenterDistance(ft)
Returns the distance from an altitude to the center of the earth.
ftThe distance in nautical miles from the center of the earth: ERADIUS plus the altitude.
lowestBeamAlt()lowestBeamAlt(acAlt, gndAlt, tilt, tiltOffset, beamWidth, range)
Returns the lowest altitude reached by the bottom edge of the weather beam in normal mode, within the selected range. The effective tilt is the manual tilt plus the radar's mount tiltOffset. The bottom edge of the beam is half the beamWidth below that. If the bottom edge points up (zero or positive), the lowest point is the aircraft altitude. Otherwise, it is the beam altitude at the nearer of the earth-tangent distance of the bottom edge and the selected range.
acAltgndAlttilttiltOffsetbeamWidthrangeThe lowest altitude of the beam in feet. It is never lower than gndAlt.
oatAtAltitude()oatAtAltitude(targetOat, acAlt, oat)
Returns the altitude at which the temperature is targetOat, given the temperature oat at altitude acAlt, assuming the standard temperature lapse rate (STD_TEMP_LAPSE). It is used to find the altitudes of the reflectivity zones from the freezing level (where the temperature is 0): for example, oatAtAltitude(hrTopTemp, freezingLevel, 0).
targetOatacAltoat.oatacAlt.The altitude in feet, rounded to the nearest 1,000 feet. It is never lower than 0.
The radar diagram functions draw SVG drawings into the wrapper node of an svg state variable, like the aeronautical diagram functions. They are designed to be assigned as the value of an svg state variable. The function sets the innerHTML of node. If node is falsy, nothing is drawn. Instead of reading the page's state variables, they take a plain values object so that both the aircraft radar pages and the standalone Radar app can share them.
The v argument of the diagram functions is an object with the following properties:
pageMode'normal' or 'overfly'.tilttiltOffsetrangeoverflyOuterRange, overflyInnerRangeoverflyOuterTilt, overflyInnerTiltoverflyBeams'1' or '2': the number of beams used in overfly mode. The inner beam values are used only for '2'.overflyAltacAltgndAltfreezingLevelstabletrue for stable weather, and false for convective weather.beamWidthgrBeamWidthgndSpeedmaxAltdrawProfileSvg().darkModetrue to draw text and axes for dark mode.drawProfileSvg()drawProfileSvg(node, v)
Draws a side view (profile) of the radar beam into node. The view shows the curved earth, the beam or beams (the weather beam and the narrower ground return beam) with distance rings and distances, the freezing level, the high and moderate reflectivity zones, altitude lines every 10,000 feet, and the ground. The beams are clipped against the ground and the earth's shadow beyond the horizon. In overfly mode, the safety zone (yellow) and the zone within nearZone feet below the aircraft (red) are also drawn. The vertical scale is stretched so that maxAlt down to the ground at the maximum range fills the diagram height.
nodesvg state variable.vNone.
drawScopeSvg()drawScopeSvg(node, v)
Draws a picture of the radar scope into node. The scope is a 90° fan out to the scan range (v.range in normal mode, v.overflyOuterRange in overfly mode) that shows how the radar would display weather. The fan is divided into distance bands that are colored by the reflectivity class of the beam at that distance (see classToFill): the beam is over or under the weather, spans the moderate reflectivity zone, or spans the high reflectivity zone. In overfly mode, bands that show no weather are colored red where the beam bottom is within nearZone feet below the aircraft, or yellow where it provides overfly coverage. Dot patterns show the ground return, and the ground return from the weather beam. The fan has quarter-range arcs labeled with distance and time at the ground speed, and ellipses that show the beam width and how the beam smears with distance. A legend and the range of the ground return are drawn at the left.
The function asserts that the scan range is greater than 0.
nodesvg state variable.vNone.