2012-01-06 08:55:05 -06:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<svg width="80" height="80"
|
|
|
|
viewBox="0 0 80 80"
|
|
|
|
overflow="visible"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
xmlns:xlink="http://www.w3.org/1999/xlink" style="stroke: rgb(255,255,255);">
|
|
|
|
<defs>
|
2013-09-05 11:06:25 -05:00
|
|
|
<script type="text/python" plotDelegate="plotDelegate">
|
|
|
|
import time
|
|
|
|
|
|
|
|
class AirepPlotDelegate(PlotDelegate):
|
|
|
|
def __init__(self):
|
|
|
|
PlotDelegate.__init__(self)
|
|
|
|
|
|
|
|
def getSampleText(self, rec):
|
|
|
|
sampleString = "ARP "
|
|
|
|
sampleString += rec.getString("stationId")
|
|
|
|
sampleString += " "
|
|
|
|
lat = rec.getFloat("latitude")
|
|
|
|
if(lat < 0):
|
|
|
|
sampleString += "%.3fS " % (-1*lat)
|
|
|
|
else:
|
|
|
|
sampleString += "%.3fN " % (lat)
|
|
|
|
lon = rec.getFloat("longitude")
|
|
|
|
if(lon < 0):
|
|
|
|
sampleString += "%.3fW " % (-1*lon)
|
|
|
|
else:
|
|
|
|
sampleString += "%.3fE " % (lon)
|
|
|
|
timeObs = rec.getLong("timeObs")
|
|
|
|
sampleString += time.strftime("%H%M",time.localtime(timeObs/1000))
|
|
|
|
sampleString += " F%d" % (rec.getInt("flightLevel")/100)
|
|
|
|
temp = rec.getFloat("temperature")
|
|
|
|
if temp < -273.15:
|
|
|
|
pass
|
|
|
|
elif temp < 0:
|
|
|
|
sampleString += " M%d" % (int(-1*temp))
|
|
|
|
else:
|
|
|
|
sampleString += " P%d" % (int(temp))
|
|
|
|
windDir = int(rec.getFloat("windDir"))
|
|
|
|
windSpeed = int(rec.getFloat("windSpeed"))
|
|
|
|
if windDir > -1080 or windSpeed > 0:
|
|
|
|
sampleString += " %d/%dKT" % (windDir, windSpeed)
|
|
|
|
turbFreq = rec.getString("turbFreq")
|
|
|
|
turbInten = rec.getString("turbInten")
|
|
|
|
turbType = rec.getString("turbType")
|
|
|
|
if turbFreq != "" or turbInten != "" or turbType != "":
|
|
|
|
sampleString += " TB"
|
|
|
|
if turbFreq != "":
|
|
|
|
sampleString += " "
|
|
|
|
sampleString += turbFreq
|
|
|
|
if turbInten != "":
|
|
|
|
sampleString += " "
|
|
|
|
sampleString += turbInten
|
|
|
|
if turbType != "":
|
|
|
|
sampleString += " "
|
|
|
|
sampleString += turbType
|
|
|
|
return sampleString
|
|
|
|
|
2015-09-15 13:38:48 +00:00
|
|
|
def isValid(self, rec):
|
|
|
|
# DCS10257
|
|
|
|
# need icing or hazard
|
|
|
|
# only show non-severe / no severity
|
|
|
|
if rec.isValidParameter("iceInten"):
|
|
|
|
iceInten = rec.getString("iceInten")
|
|
|
|
else:
|
|
|
|
iceInten = ""
|
|
|
|
if rec.isValidParameter("iceType"):
|
|
|
|
iceType = rec.getString("iceType")
|
|
|
|
else:
|
|
|
|
iceType = ""
|
|
|
|
if rec.isValidParameter("flightHazard"):
|
|
|
|
flightHazard = rec.getInt("flightHazard")
|
|
|
|
else:
|
|
|
|
flightHazard = -1
|
|
|
|
if (iceInten == "") and (iceType == "") and (flightHazard == -1):
|
|
|
|
# no icing or hazard data
|
|
|
|
return False
|
|
|
|
elif (iceInten == "SEV") or (iceInten == "EXTRM") or (flightHazard == 8) or (flightHazard == 9):
|
|
|
|
# incorrect severity/hazard level (from AIREPWeather)
|
|
|
|
return False
|
|
|
|
else:
|
|
|
|
# low or no severity, and has some icing data
|
|
|
|
return True
|
|
|
|
|
2013-09-05 11:06:25 -05:00
|
|
|
plotDelegate = AirepPlotDelegate()
|
|
|
|
|
|
|
|
</script>
|
2012-01-06 08:55:05 -06:00
|
|
|
<style type="text/css">
|
|
|
|
<![CDATA[
|
|
|
|
@font-face { font-family: "WindSymbolFont";
|
|
|
|
src: url(WindSymbols.svg#WindSymbols); }
|
|
|
|
@font-face { font-family: "StandardFont";
|
|
|
|
src: url(Standard.svg#Standard); }
|
|
|
|
@font-face { font-family: "WxSymbolFont";
|
|
|
|
src: url(WxSymbols.svg#WxSymbols); }
|
|
|
|
@font-face { font-family: "SpecialSymbolFont";
|
|
|
|
src: url(SpecialSymbols.svg#SpecialSymbols); }
|
|
|
|
|
|
|
|
text.text
|
|
|
|
{
|
|
|
|
fill: none;
|
|
|
|
font-size: 1em;
|
|
|
|
stroke-width: 1px;
|
|
|
|
font-family: StandardFont;
|
|
|
|
font-size: 1em;
|
|
|
|
}
|
|
|
|
]]>
|
|
|
|
</style>
|
|
|
|
<symbol overflow="visible" id="plotData" class="info">
|
2013-09-05 11:06:25 -05:00
|
|
|
<text id="sampleParams1" plotMode="sample" plotParam="stationId,longitude,latitude,timeObs,flightLevel"> </text>
|
|
|
|
<text id="sampleParams2" plotMode="sample" plotParam="temperature,windDir,windSpeed,turbInten,turbFreq,turbType"> </text>
|
2015-09-15 13:38:48 +00:00
|
|
|
<text id="validityParams" plotMode="null" class="text" plotParam="iceType,iceInten" x="0" y="0" visibility="hidden">0</text>
|
2013-09-05 11:06:25 -05:00
|
|
|
<text id="iceInensity" plotMode="table" class="weather" plotLookupTable="airep_icing_intens_trans.txt" plotParam="flightHazard" x="0" y="0">0</text>
|
|
|
|
<text id="fltLvlText" plotMode="text" plotParam="flightLevel" plotFormat="%3.0f" plotUnit="hft" style="text-anchor: end;" x="-15px" y="0px">75</text>
|
2012-01-06 08:55:05 -06:00
|
|
|
</symbol>
|
|
|
|
|
|
|
|
</defs>
|
|
|
|
<use id="wind" x="40" y="40" width="80" height="80" visibility="visible" xlink:href="#plotData"/>
|
|
|
|
</svg>
|