Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heatmap generation #4

Open
HassanAbbas92 opened this issue Jul 2, 2019 · 1 comment
Open

Heatmap generation #4

HassanAbbas92 opened this issue Jul 2, 2019 · 1 comment

Comments

@HassanAbbas92
Copy link

HassanAbbas92 commented Jul 2, 2019

Hello ESanchezLozano

I'm trying to generate Heatmap for new AU is this a correct way ?

import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import multivariate_normal

# create a grid of (x,y) coordinates at which to evaluate the kernels
xlim = (0, 63)
ylim = (0, 63)
xres = 64
yres = 64

x = np.linspace(xlim[0], xlim[1], xres)
y = np.linspace(ylim[0], ylim[1], yres)
xx, yy = np.meshgrid(x,y)

x_1 = 10
y_1 = 10

x_2 = 40
y_2 = 40

o_x_1 = 5
o_y_1 = 5
o_x_2 = 5
o_y_2 = 5

A = 1
B = 0.5
f1 = A  *   np.exp( -( (np.power((xx - x_1),2) / (2*o_x_1**2)) + (np.power((yy - y_1),2) / (2*o_y_1**2)) ) )

f2 = B   *  np.exp( -( (np.power((xx - x_2),2) / (2*o_x_2**2)) + (np.power((yy - y_2),2) / (2*o_y_2**2)) ) )


zz = f1 + f2

# reshape and plot image
img = zz.reshape((xres,yres))
plt.imshow(img); plt.show()

image

@ESanchezLozano
Copy link
Owner

Hi,

They don't look pretty symmetric in the intensity, do they?

Please do use my @ so that I can realise there's a comment over here

Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants