[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AWIPS #QVN-243999]: DAF PIREPs



Hi Jamie,

I was playing around a bit with the pirep data, and noticed the parameter 
"numLayer". The "numLayer" parameter will tell you how many extra lines are 
associated with each main entry (those extra lines are the turbulance/ice 
information). What is confusing is when the get data selection is made, the 
"turbulance/ice" information is returned first, then the full station report.

Another odd thing I noticed, is that some reports have the /TB information, but 
the numLayer is 0. It looks to be the case when the actual obsText doesn't have 
a space between the last "report" and the "=".  Below are some examples of the 
numLayer and obsText.

numLayer=0:
0,UBUS01 KMSC 161600 161600 BIS UA /OV KBIS /TM 1630 /FL155 /TP M20T /TB NEG=
0,UBUS01 KMSC 161600 161600 HUF UA /OV TTH/TM 1628/FL390/TP B738/TB LGT=
0,UBUS01 KMSC 161800 161800 DVT UA /OV DVT001015 /TM 1849 /FL075 /TP P28A /TB 
LGT=

numLayer!=0:
1,UBUS01 KMSC 151900 151900 TLH UA /OV SZW360035/TM 1822/FL300/TP PC12/TB OCNL 
MOD =
1,UBUS01 KMSC 171000 171000 HJH UA /OV TKO/TM 0844/FL370/TP A20N/TB CONS LGT 
CHOP =
2,UBUS01 KMSC 162000 162000 CMH UA /OV CMH/TM 1945/FLDURD/TP A320/SK OVC050 
TOP090/TB LGT CHOP =

Here's some code that will print out the 
'flightLevel', 'numLayer', 'timeObs', 'latitude', 'longitude'
#['turbBaseHeight', 'turbTopHeight', 'turbInten']

=================== CODE =========================

#!/awips2/python/bin/python

from awips.dataaccess import DataAccessLayer

#connect to unidata edex
DataAccessLayer.changeEDEXHost("edex-cloud.unidata.ucar.edu")

#get a list of supported data types from the edex
types = DataAccessLayer.getSupportedDatatypes()
print(types)

#create a request and set the data type
req = DataAccessLayer.newDataRequest()
req.setDatatype("pirep")

#print out available parameters
param = DataAccessLayer.getAvailableParameters(req)
print(param)

#set the parameter to turbulence intensity
req.setParameters('timeObs', 'longitude', 'latitude', 'flightLevel', 
'numLayer', 'turbInten', 'turbTopHeight', 'turbBaseHeight')

print(req)

#print out available location names
locations = DataAccessLayer.getAvailableLocationNames(req)
#print(locations)

#actually get the data for the request -- this returns an array
data = DataAccessLayer.getGeometryData(req)

layerCount=0
layerString="\t"
header=1
#['flightLevel', 'numLayer', 'timeObs', 'latitude', 'longitude']
#['turbBaseHeight', 'turbTopHeight', 'turbInten']

for d in data:
    params = d.getParameters()
    print( params)
    if('numLayer' in params):
        dataString=""
        if(int(d.getString('numLayer')) == 0):
            layerString="\t"
        layerCount=0
        for p in params:
            dataString=dataString+","+d.getString(p)
        dataString=dataString.lstrip(',')
        print(dataString,"\n",layerString)
    if('turbInten' in params):
        if(layerCount == 0):
            layerString="\t"
            layerCount=layerCount+1
        for p in params:
            layerString=layerString+","+d.getString(p)
        layerString=layerString+"\n\t"

 
Thanks,

Tiffany Meyer
AWIPS Lead Software Engineer
UCAR-Unidata

Ticket Details
===================
Ticket ID: QVN-243999
Department: Support AWIPS
Priority: Normal
Status: Open
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.