本文整理汇总了Python中SOAPpy.SOAPProxy.getWaterLevelRawSixMin方法的典型用法代码示例。如果您正苦于以下问题:Python SOAPProxy.getWaterLevelRawSixMin方法的具体用法?Python SOAPProxy.getWaterLevelRawSixMin怎么用?Python SOAPProxy.getWaterLevelRawSixMin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SOAPpy.SOAPProxy
的用法示例。
在下文中一共展示了SOAPProxy.getWaterLevelRawSixMin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getWaterLevelSoappyNow
# 需要导入模块: from SOAPpy import SOAPProxy [as 别名]
# 或者: from SOAPpy.SOAPProxy import getWaterLevelRawSixMin [as 别名]
def getWaterLevelSoappyNow(stationId,debug=False):
'''
Use OLD SOAPpy interface to get the waterlevel for a station
'''
d = datetime.datetime.utcnow()
print 'FIX: do this in seconds space!!!! This is crap!'
startD = d + datetime.timedelta(minutes=-20)
endD = d + datetime.timedelta(minutes=10)
#startMin = int(d.minute) - 6
#endMin = int(d.minute) + 1
print startD,endD,d
beginDate = str(startD.year)+('%02d' % startD.month)+('%02d' % startD.day)+' '+ ('%02d' % (startD.hour))+':'+('%02d' % (startD.minute))
endDate = str(endD.year)+('%02d' % endD.month)+('%02d' % endD.day)+' '+ ('%02d' % (endD.hour))+':'+('%02d' % (endD.minute))
#print beginDate,endDate
from SOAPpy import SOAPProxy
url = 'http://opendap.co-ops.nos.noaa.gov/axis/services/WaterLevelRawSixMin'
namespace='urn:WaterLevelRawSixMin' # This really can be anything. It is ignored
server = SOAPProxy(url,namespace)
if debug: server.config.debug=1
#response = server.getWaterLevelRawSixMin(stationId=str(stationId),beginDate='20051201 00:00',endDate='20051201 00:18',datum='MLLW',unit=0,timeZone=0)
response = server.getWaterLevelRawSixMin(stationId=str(stationId),beginDate=beginDate,endDate=endDate,datum='MLLW',unit=0,timeZone=0)
# only return the last entry
return response.item[-1]
示例2: len
# 需要导入模块: from SOAPpy import SOAPProxy [as 别名]
# 或者: from SOAPpy.SOAPProxy import getWaterLevelRawSixMin [as 别名]
# endDate='2006'+('%02d' % mon )+str(daysPerMon[mon])
# print beginDate,'...',endDate
# response = server.getWaterLevelRawSixMin(stationId=str(stationId),beginDate=beginDate,endDate=endDate,datum='MSL',unit=0,timeZone=0)
# print len(response.item)
# #print response
for mon in range(options.monthStart,options.monthEnd+1):
#print mon
beginDate=str(options.year)+('%02d' % mon )+'01'
endDate=str(options.year)+('%02d' % mon )+str(daysPerMon[mon])
#if verbose:
print beginDate,'...', endDate
response = server.getWaterLevelRawSixMin(stationId=str(stationId)
,beginDate=beginDate,endDate=endDate,
datum=options.datum
,unit=0
,timeZone=0)
for wl in response.item:
#if verbose:
# print wl
try:
wlStr = noaawaterlevel2aisMsg8Nmea(stationId,mmsi,datum=options.datum,wl=wl)
except:
print 'ERROR: something with this line'
print wl
continue
#if verbose: print wlStr
o.write( wlStr + '\n' )
if False: