for i in range(Ku.shape[0]): cov[i] = [[Ku["sigmaxx"].iloc[i], Ku["sigmaxy"].iloc[i]], [Ku["sigmaxy"].iloc[i], Ku["sigmayy"].iloc[i]]] # i = -1 # a = np.array([[ [dfcov["sigmaxx"].iloc[i], dfcov["sigmaxy"].iloc[i]], # [dfcov["sigmaxy"].iloc[i], dfcov["sigmayy"].iloc[i]] ]]) # for i in range(int(fetch.size/2)): # cov = np.vstack((cov, a)) # print(fetch.shape, cov.shape) # # print(cov) sigma0 = srf.cross_section(xi, cov) # sigma = sigma0 + np.random.normal(0, 0.2, sigma0.shape) # sigma0 = 10*np.log10(srf.cross_section(xi, cov)) sigma = 10 * np.log10(sigma0) # plt.plot(xi, sigma[:, 2]) # # plt.show() x, y = np.meshgrid(fetch.T[0], xi) # plt.figure(figsize=(10, 5)) plt.pcolor(x / 1e3, np.rad2deg(y), (sigma), vmin=sigma.min(), vmax=sigma.max()) # # plt.imshow(x/1e3, np.rad2deg(y), sigma) # print(sigma.max()) # plt.xlabel("X, км") # plt.ylabel("$\\theta$, градусы") # bar = plt.colorbar()
z = df['elevation'].values.reshape(rc.surface.gridSize) fig, ax = plt.subplots(ncols=2) ax[1].plot(X[0, :], z[0, :]) Xi = np.linspace(-12, 12, 50) N = np.zeros_like(Xi, dtype=float) for i, xi in enumerate(Xi): theta0 = sat.localIncidence(xi=xi) ind = sat.sort(theta0, xi=xi) theta1 = theta0.reshape(rc.surface.gridSize) # ax[0].plot(X[0,:], np.rad2deg(theta1[0,:])) # ax[1].plot(X.flatten()[ind], z.flatten()[ind], '.') N[i] = ind[0].size ax[0].plot(Xi, N / N.max()) sigma = surface.cross_section(np.deg2rad(Xi), cov) ax[0].plot(Xi, sigma / sigma.max()) surface.coordinates = [x, y, df1['elevation']] surface.normal = [df1['slopes x'], df1['slopes y'], np.ones(x.size)] cov = np.cov(df1['slopes x'], df1['slopes y']) sat = Experiment.experiment() z = df1['elevation'].values.reshape(rc.surface.gridSize) ax[1].plot(X[0, :], z[0, :]) Xi = np.linspace(-12, 12, 50) N = np.zeros_like(Xi, dtype=float) for i, xi in enumerate(Xi): theta0 = sat.localIncidence(xi=xi) ind = sat.sort(theta0, xi=xi)
for i in range(dfcov.shape[0]): cov[i] = [[dfcov["sigmaxx"].iloc[i], dfcov["sigmaxy"].iloc[i]], [dfcov["sigmaxy"].iloc[i], dfcov["sigmayy"].iloc[i]]] i = -1 a = np.array([[[dfcov["sigmaxx"].iloc[i], dfcov["sigmaxy"].iloc[i]], [dfcov["sigmaxy"].iloc[i], dfcov["sigmayy"].iloc[i]]]]) for i in range(int(fetch.size / 2)): cov = np.vstack((cov, a)) print(fetch.shape, cov.shape) # print(cov) sigma0 = srf.cross_section(xi, cov) sigma = sigma0 + np.random.normal(0, 0.2, sigma0.shape) sigma0 = 10 * np.log10(srf.cross_section(xi, cov)) sigma = 10 * np.log10(np.abs(sigma)) # plt.plot(xi, sigma[:, 2]) # plt.show() x, y = np.meshgrid(fetch, xi) plt.figure(figsize=(10, 5)) plt.pcolor(x / 1e3, np.rad2deg(y), (sigma), vmin=sigma.min(), vmax=sigma.max()) # plt.imshow(x/1e3, np.rad2deg(y), sigma) print(sigma.max()) plt.xlabel("X, км") plt.ylabel("$\\theta$, градусы") bar = plt.colorbar()
17, ) for root, dirs, files in os.walk('./'): for file in files: if regex.match(file): with open(file, "r") as f: df = pd.read_csv(f, sep="\s+", header=None) cov = np.zeros((2, 2)) cov[0, 0] = 0.0217 cov[1, 1] = 0.0325 xi_real = df[0].values[np.where(np.abs(df[0]) < 12)] sigma_real = df[1].values[np.where(np.abs(df[0]) < 12)] func = lambda xi, x, y: 10 * np.log10( srf.cross_section(np.deg2rad(xi), np.array([[x, 0], [0, y]] )).T[0]) from scipy.optimize import curve_fit popt = curve_fit(func, xdata=xi_real, ydata=sigma_real, p0=[1, 1], bounds=[0, 1])[0] A = 0.95 # A = 1 popt[0] *= A popt[1] *= 1 / A fig, ax = plt.subplots() ax.text( 0.5, 0.35,