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

[AWIPS #FTX-514016]: Python-awips



Hi Jamie,

Sorry, I missed you second email before I sent that response.  I'm not sure why 
it won't let you read it 
but I've copied the contents below:

#!/awips2/python/bin/python

from ufpy.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 required identifiers
#required = DataAccessLayer.getRequiredIdentifiers(req)
#print(required)

#print out optional identifiers
#optional = DataAccessLayer.getOptionalIdentifiers(req)
#print(optional)

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

#set the parameter to turbulence intensity
req.setParameters("turbInten")
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)
#print out the turbulence intensity for one of the data objects in the array
#print data[3].getString("turbInten")

#cycle through all the objects and print out their turbulence intensities
for d in data:
        turb = d.getString("turbInten")
        if turb != "":
                print d.getString("turbInten")


Just save that into a text file with .py extension and you'll have to make sure 
it's 
executable and you should be good to go.

Let me know if that works!



--Shay Carter

Software Engineer II
UCAR - Unidata

Ticket Details
===================
Ticket ID: FTX-514016
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.