import pylab as pl from get_features import read_files, train_test, plot_prediction, add_asymmetry, read_files_nan from fit_method import * features, labels = read_files() features = add_asymmetry(features, np.arange(3), np.arange(3)) features = add_asymmetry(features, 3+np.arange(3), 3+np.arange(3)) features = add_asymmetry(features, 6+np.arange(3), 6+np.arange(3)) features = add_asymmetry(features, 9+np.arange(3), 9+np.arange(3)) features_train, features_test, labels_train, labels_test = train_test(features, labels) labels_train = np.squeeze(labels_train) labels_test = np.squeeze(labels_test) labels = np.squeeze(labels) features1, labels1, nan1 = read_files_nan() x_low = 0 y_low = 0 x_high = 100 y_high = 100 features2 = np.zeros(features1.shape) labels_true = np.zeros(labels1.shape) mask = np.zeros((252,252)) mask[x_low:x_high, y_low:y_high] = 1 mask = mask.reshape(-1,1) for i in xrange(features1.shape[0]): labels_true[i] = labels1[i]*(1. - mask[i]) for j in xrange(features1.shape[1]): features2[i,j] = features1[i,j]*mask[i]
import numpy as np import pylab as pl from get_features import read_files, train_test, plot_prediction, add_asymmetry, read_files_nan from fit_method import * features, labels, nan = read_files_nan() pl.figure('Features') pl.subplot(231) pl.title('k2v') pl.imshow(np.log(features[:,0]).reshape(252,252)) pl.colorbar(label='Log Intensity') pl.subplot(232) pl.title('k3') pl.imshow(np.log(features[:,1]).reshape(252,252)) pl.colorbar(label='Log Intensity') pl.subplot(233) pl.title('k2r') pl.imshow(np.log(features[:,2]).reshape(252,252)) pl.colorbar(label='Log Intensity') pl.subplot(234) pl.title('k2v') pl.imshow(features[:,6].reshape(252,252)) pl.colorbar(label='Doppler shift') pl.subplot(235) pl.title('k3') pl.imshow(features[:,7].reshape(252,252)) pl.colorbar(label='Doppler shift') pl.subplot(236) pl.title('k2r')