Example #1
0
        bwin_eod = fish._eod[inx:max_inx]

        fish_type = fish.type_detector()
        print 'Fish No. ' + fish_file_number + ' is ' + fish_type + ' type!'
        s[current_fish].append(odml.Property("Fish_type", fish_type))

        fig = plt.figure(num='Fish # ' + fish_file_number, figsize=(11, 7))
        ax1 = fig.add_subplot(2, 2, 1)
        ax2 = fig.add_subplot(2, 2, 2)
        ax3 = fig.add_subplot(2, 1, 2)

        lowp_filter = 4  # This number multiplied by the fundamental frequency of the fish
                         # sets the low pass filter (not valid for pulse fishes!).

        fish.plot_eodform(ax=ax1, filtr=lowp_filter)
        fish.plot_spectogram(ax=ax2)
        fish.plot_wavenvelope(ax=ax3, win_edges=window_edges)

        plt.savefig(new_dir + '/' + new_mod_filename[:-7] + '.pdf')
        s[current_fish].append(odml.Property("Figure_file", new_mod_filename[:-7] + '.pdf'))

        doc = odml.Document()
        doc.append(s)
        # doc.author("Juan Sehuanes")
        writer = odml.tools.xmlparser.XMLWriter(doc)

        writer.write_file(new_dir + '/' + 'odml_file_from_' + str(sys.argv[-1]) + '.xml')
        print '\n Your analyze is done! Thank you for using thunderFish!'

    except:
        print """