当前位置: 首页>>代码示例>>Python>>正文


Python SOAPProxy.getWaterLevelRawSixMin方法代码示例

本文整理汇总了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]
开发者ID:FlavioFalcao,项目名称:noaadata,代码行数:32,代码来源:waterlevelraw.py

示例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:
开发者ID:FlavioFalcao,项目名称:noaadata,代码行数:33,代码来源:dumpallwl.py


注:本文中的SOAPpy.SOAPProxy.getWaterLevelRawSixMin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。