Пример #1
0
######################################################################################################################
"""set api and initiate calls"""
# api_url = 'http://mlc67-cmp-00.egr.duke.edu/api/events' ##This is dukes server which Chunge created
api_url = 'http://mlc67-cmp-00.egr.duke.edu/api/caryevents'  ##This is carytown server

apikey = None
push_url = "https://onesignal.com/api/v1/notifications"
pushkey = None
sound_url = 'http://mlc67-cmp-00.egr.duke.edu/api/soundInfos'
soundkey = None
wav_url = ' http://mlc67-cmp-00.egr.duke.edu/api/sound-clips/container/upload'
wavkey = None
LOCATION = "Drone Detector A"
send = apicalls(
    api_url, apikey, push_url, pushkey, sound_url, soundkey, wav_url, wavkey,
    LOCATION)  ##This initiates the push notification and mongodb database
log.insertdf(3,
             str(datetime.datetime.now())
             [:-7])  #inserted dummy value to eliminate inconsistency
i = 0
bandpass = [600, 10000]  #filter unwanted frequencies
prev_time = tm.time()  #initiate time
reccount = 0
recdata = np.array([], dtype="float32")
basename = "drone"
"""main code"""
try:  #don't want useless user warnings
    while True:
        data, fs = record()
        #out = reduce_noise(data,noise)
Пример #2
0

# def drone_prediction_label(value):
#     if value == 1:
#         label = "drone"
#     elif value == 0:
#         label = "no drone"
#     return label

######################################################################################################################
"""set api and initiate calls"""
api_url = 'http://mlc67-cmp-00.egr.duke.edu/api/events'
apikey = None
push_url = "https://onesignal.com/api/v1/notifications"
pushkey = None
send = apicalls(api_url, apikey, push_url, pushkey)
log.insertdf(3,
             str(datetime.datetime.now())
             [:-7])  #inserted dummy value to eliminate inconsistency
i = 0
bandpass = [800, 8500]  #filter unwanted frequencies
prev_time = tm.time()  #initiate time
"""main code"""
try:  #don't want user warnings
    while True:
        data, fs = record()
        ns = fil.bandpass_filter(data, bandpass)
        try:
            p, freq, b = hmn.psddetectionresults(data)
        except IndexError:
            pass