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

[WIP] Plot poloidal plane with contourf #34

Merged
merged 15 commits into from
Dec 4, 2019

Conversation

TomNicholas
Copy link
Collaborator

Adds accessor methods to plot poloidal slices using the old griddata approach. Should be general enough to work for any tokamak geometry.

Adds da.bout.contourf(), which gives:
griddata_doublenull

Optionally plots both separatrices, and optionally marks the positions of the limiters with hatched lines to indicate solid surfaces.

Also adds da.bout.regions(), which I created for debugging purposes, but it helps understand how the griddata-style plotting approach works:

regions

To get this to work for any geometry I had to extend the old griddata and fix a few bugs with it, but the result is that it can now handle both X-points, both separatrices, and knows how big the limiters should be, as you can see in this s-alpha plot:
griddata_salpha

It would be good if someone could try it with (or just send me) a single-null grid file to test against, as I've only tried it with these two examples.

One problem I'm still having is getting the aspect ratio of the plot correct automatically. If I force it with plt.set_aspect() then I end up with loads of whitespace which I can't seem to get rid of.

(@ZedThree This PR should be based off of the grids PR, branch feature/grids on my forked version of xBOUT, but I couldn't quite work out how to do that.)

@TomNicholas TomNicholas added the enhancement New feature or request label Jul 9, 2019
@TomNicholas TomNicholas requested a review from ZedThree July 9, 2019 08:06
@pep8speaks
Copy link

pep8speaks commented Jul 9, 2019

Hello @TomNicholas! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 6:90: E501 line too long (94 > 89 characters)
Line 7:90: E501 line too long (99 > 89 characters)
Line 14:1: E265 block comment should start with '# '
Line 15:1: E265 block comment should start with '# '
Line 16:1: E265 block comment should start with '# '
Line 17:1: E265 block comment should start with '# '
Line 19:1: E265 block comment should start with '# '
Line 20:1: E265 block comment should start with '# '
Line 21:1: E265 block comment should start with '# '

Line 106:90: E501 line too long (112 > 89 characters)

Line 8:1: E302 expected 2 blank lines, found 1
Line 45:1: E303 too many blank lines (3)

Line 162:38: E221 multiple spaces before operator
Line 163:21: E128 continuation line under-indented for visual indent
Line 163:38: E221 multiple spaces before operator
Line 164:21: E128 continuation line under-indented for visual indent
Line 165:21: E128 continuation line under-indented for visual indent
Line 165:34: E221 multiple spaces before operator
Line 166:38: E221 multiple spaces before operator
Line 167:21: E128 continuation line under-indented for visual indent
Line 167:38: E221 multiple spaces before operator
Line 168:21: E128 continuation line under-indented for visual indent
Line 169:21: E128 continuation line under-indented for visual indent
Line 169:34: E221 multiple spaces before operator
Line 187:20: E128 continuation line under-indented for visual indent
Line 189:20: E128 continuation line under-indented for visual indent
Line 193:20: E128 continuation line under-indented for visual indent
Line 195:20: E128 continuation line under-indented for visual indent
Line 235:26: E128 continuation line under-indented for visual indent
Line 237:26: E128 continuation line under-indented for visual indent
Line 240:26: E128 continuation line under-indented for visual indent
Line 242:26: E128 continuation line under-indented for visual indent
Line 369:53: W292 no newline at end of file

Comment last updated at 2019-08-19 15:22:39 UTC

@TomNicholas TomNicholas removed the request for review from ZedThree July 25, 2019 21:59
@johnomotani johnomotani changed the base branch from keep_guard_cells to master August 10, 2019 18:42
@codecov-io
Copy link

Codecov Report

Merging #34 into master will decrease coverage by 14.84%.
The diff coverage is 7.48%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #34       +/-   ##
===========================================
- Coverage   48.76%   33.91%   -14.85%     
===========================================
  Files           8        9        +1     
  Lines         404      628      +224     
  Branches       79      108       +29     
===========================================
+ Hits          197      213       +16     
- Misses        185      393      +208     
  Partials       22       22
Impacted Files Coverage Δ
xbout/plotting/animate.py 13.51% <ø> (-1.49%) ⬇️
xbout/plotting/plotfuncs.py 13.33% <13.33%> (ø)
xbout/plotting/utils.py 5.34% <4.51%> (-14.66%) ⬇️
xbout/boutdataarray.py 30% <60%> (+4.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7966ec...293e0d3. Read the comment docs.

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

Successfully merging this pull request may close these issues.

4 participants