def METHOD_NAME(argv=None):
    if argv is None:
        argv = sys.argv
    try:
        opts, args = getopt.getopt(
            argv[1:], "hcdp:r:vz",
            ['help', 'clock', 'default', 'pressure=', 'read_period=',
             'verbose', 'zero_memory'])
    except getopt.error as msg:
        print('Error: %s\n' % msg, file=sys.stderr)
        print(__usage__.strip(), file=sys.stderr)
        return 1
    # process options
    clock = False
    default = False
    pressure = None
    read_period = None
    verbose = 0
    zero_memory = False
    for o, a in opts:
        if o in ('-h', '--help'):
            print(__usage__.strip())
            return 0
        elif o in ('-c', '--clock'):
            clock = True
        elif o in ('-d', '--default'):
            default = True
        elif o in ('-p', '--pressure'):
            pressure = int((float(a) * 10.0) + 0.5)
        elif o in ('-r', '--read_period'):
            read_period = int(a)
        elif o in ('-v', '--verbose'):
            verbose += 1
        elif o in ('-z', '--zero_memory'):
            zero_memory = True
    # check arguments
    if len(args) != 0:
        print("Error: No arguments required", file=sys.stderr)
        print(__usage__.strip(), file=sys.stderr)
        return 2
    pywws.logger.setup_handler(verbose)
    # open connection to weather station
    ws = pywws.weatherstation.WeatherStation()
    # set data to be sent to station
    data = []
    # set default values
    if default:
        ptr = ws.fixed_format['settings_1'][0]
        data.append((ptr, 0b00100000))
        ptr = ws.fixed_format['settings_2'][0]
        data.append((ptr, 0b00001000))
        ptr = ws.fixed_format['display_1'][0]
        data.append((ptr, 0b01000001))
        ptr = ws.fixed_format['display_2'][0]
        data.append((ptr, 0b00001001))
        ptr = ws.fixed_format['alarm_1'][0]
        data.append((ptr, 0b00000000))
        ptr = ws.fixed_format['alarm_2'][0]
        data.append((ptr, 0b00000000))
        ptr = ws.fixed_format['alarm_3'][0]
        data.append((ptr, 0b00000000))
    # set relative pressure
    if pressure:
        ptr = ws.fixed_format['rel_pressure'][0]
        data.append((ptr,   pressure % 256))
        data.append((ptr+1, pressure // 256))
    # set read period
    if read_period:
        data.append((ws.fixed_format['read_period'][0], read_period))
    # reset data count
    if zero_memory:
        ptr = ws.fixed_format['data_count'][0]
        data.append((ptr,   1))
        data.append((ptr+1, 0))
    # set clock
    if clock:
        print("Clock setting is not known to work on any model of weather station.")
        print("If it works for you, please let Jim Easterbrook know.")
        print("waiting for exact minute")
        now = datetime.now()
        if now.second >= 55:
            time.sleep(10)
            now = datetime.now()
        now += timedelta(minutes=1)
        ptr = ws.fixed_format['date_time'][0]
        data.append((ptr,   bcd_encode(now.year - 2000)))
        data.append((ptr+1, bcd_encode(now.month)))
        data.append((ptr+2, bcd_encode(now.day)))
        data.append((ptr+3, bcd_encode(now.hour)))
        data.append((ptr+4, bcd_encode(now.minute)))
        time.sleep(59 - now.second)
    # send it all in one go
    if data:
        ws.write_data(data)