-
Notifications
You must be signed in to change notification settings - Fork 15
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
Changing meshgrid to mgrid - fixing gdX, gdY and ext_x, ext_y for 2D kCS... #7
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,10 +127,8 @@ def make_src_2D(X, Y, n_src, ext_x, ext_y, R_init): | |
ext_x_n = (Lx_nn - Lx)/2 | ||
ext_y_n = (Ly_nn - Ly)/2 | ||
|
||
lin_x = np.linspace(np.min(X) - ext_x_n, np.max(X) + ext_x_n, nx) | ||
lin_y = np.linspace(np.min(Y) - ext_y_n, np.max(Y) + ext_y_n, ny) | ||
|
||
X_src, Y_src = np.meshgrid(lin_x, lin_y) | ||
X_src, Y_src = np.mgrid[(np.min(X) - ext_x_n):(np.max(X) + ext_x_n):np.complex(0,nx), | ||
(np.min(Y) - ext_y_n):(np.max(Y) + ext_y_n):np.complex(0,ny)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to avoid long lines:
Also maybe the parameters inside np.meshgrid could be given names? |
||
|
||
d = round(R_init/ds) | ||
R = d * ds | ||
|
@@ -247,6 +245,7 @@ def make_src_3D(X, Y, Z, n_src, ext_x, ext_y, ext_z, R_init): | |
|
||
(X_src, Y_src, Z_src) = np.meshgrid(lin_x, lin_y, lin_z) | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why? :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was trying to fix it for the 3D case as well, but I gave up. |
||
d = np.round(R_init/ds) | ||
R = d * ds | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid long lines: