-
Notifications
You must be signed in to change notification settings - Fork 7
Add support for plotting isocontours of vector potential in snap.py #7
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
Open
soumide1102
wants to merge
4
commits into
lanl:master
Choose a base branch
from
soumide1102:add_overlay_field_to_snap
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f2f57d8
Add support for plotting isocontours of vector potential in snap.py
soumide1102 70a66c0
Adjust zorder
soumide1102 fecb200
Make zorder an input param in snap.py and pass it to overlay_field
soumide1102 6e395d6
correct type and default for zorder
soumide1102 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,24 @@ | |
| parser.add_argument('-c','--cmap', | ||
| type=str,default='jet', | ||
| help='Colormap used') | ||
| parser.add_argument('--A-contours', action="store_true", | ||
| default=False, | ||
| help='Flag to overlay contours of the vector potential') | ||
| parser.add_argument('--nlev', | ||
| type=int, default=20, | ||
| help='Number of positive/negative A-contour levels. Needed only if using --A-contours') | ||
| parser.add_argument('--linestyle', | ||
| type=str, default='-', | ||
| help='Linestyle of A-contours. Needed only if using --A-contours') | ||
| parser.add_argument('--linewidth', | ||
| type=int, default=1, | ||
| help='Linewidth of A-contours. Needed only if using --A-contours') | ||
| parser.add_argument('--linecolor', | ||
| type=str, default='k', | ||
| help='Linecolor of A-contours. Needed only if using --A-contours') | ||
| parser.add_argument('--zorder', | ||
| type=int, default=2, | ||
| help='zorder for A-contours. Needed only if using --A-contours') | ||
| parser.add_argument('--save', | ||
| type=str,default=None, | ||
| help='Figure filename if you want to save the figure') | ||
|
|
@@ -101,6 +119,10 @@ def make_snap(dfnam,vnam,coords,size,cmap,logplot, | |
| bplt.plot_xz(ax, geom, var, dump, cmap=cmap, vmin=vmin, vmax=vmax, | ||
| cbar=False, label=label, ticks=None, shading='gouraud') | ||
| ax.set_xlim([-size,size]); ax.set_ylim([-size,size]) | ||
| if args.A_contours: | ||
|
Collaborator
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 just noticed that args is referenced in |
||
| bplt.overlay_field(ax, geom, dump, NLEV=args.nlev, | ||
| linestyle=args.linestyle, linewidth=args.linewidth, | ||
| linecolor=args.linecolor, zorder=args.zorder) | ||
| ax = a1 | ||
| if coords == 'mks': | ||
| bplt.plot_X1X3(ax, geom, var, dump, cmap=cmap, vmin=vmin, vmax=vmax, | ||
|
|
@@ -120,6 +142,10 @@ def make_snap(dfnam,vnam,coords,size,cmap,logplot, | |
| bplt.plot_xz(ax, geom, var, dump, cmap=cmap, vmin=vmin, vmax=vmax, | ||
| cbar=True, label=label, ticks=None, shading='gouraud') | ||
| ax.set_xlim([0,size]); ax.set_ylim([-size,size]) | ||
| if args.A_contours: | ||
| bplt.overlay_field(ax, geom, dump, NLEV=args.nlev, | ||
| linestyle=args.linestyle, linewidth=args.linewidth, | ||
| linecolor=args.linecolor, zorder=args.zorder) | ||
|
|
||
| if savefig == False: | ||
| plt.show() | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why are you dividing
hdr['N1']by 2?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.
Yes, this is the line that I wanted to check with you.
Is
A_phi[j,N1-1-i]calculating A in the -ve direction andA_phi[j,i+N1]in the +ve direction? So if I don't divide by 2, ultimately, in line 363,rcylandzends up having dimensions 256 X 256, andA_phiis 256 X 512. So I divided by 2 to make N1 represent cells in either the +ve/-ve direction only.