Exemplo n.º 1
0
    def plot(exps, n_epochs, fig_name, y_lim):

        viz = Viz(
            exps = exps,
            n_epochs = n_epochs,
            x_label = 'epoch',
            y_label = 'perplexity',
            x_lim = None,
            y_lim = y_lim,
            title = '',
            fig_name = fig_name
        )
        viz.plot()
Exemplo n.º 2
0
    # Parse command line arguments
    args = sys.argv[1:]
    VARIANCE_CUTOFF = float(args[0])
    TIME_MIN = int(args[1])
    TIME_MAX = int(args[2])
    SOURCE_FILE = args[3]
    PLOT_FILE = args[4]
    NUM_CHANNELS = int(args[5])

    # Build and run anomaly detector
    anomaly_file = "spectrum4.csv"
    detector = AstroHTM(SOURCE_FILE + '.fits',
                        VARIANCE_CUTOFF,
                        headers,
                        model_params.MODEL_PARAMS,
                        anomaly_file,
                        select_cols=True)
    detector.runAstroAnomaly()

    # Write original spectra to csv
    spectrum_file = SOURCE_FILE + '.csv'
    detector.data.write_data_to_csv(spectrum_file)

    # Visualize original spectra with anomalies
    viz = Viz(spectrum_file, TIME_MIN, TIME_MAX, cutoffs=detector.data.cutoffs)
    viz.choose_spectra(0, NUM_CHANNELS)
    viz.add_anomalies(anomaly_file)
    #print viz.df
    viz.plot(PLOT_FILE)
    print "Plot was saved to", PLOT_FILE