Skip to content

Ny interp pol slice#1063

Merged
ZedThree merged 2 commits intonextfrom
nyInter_polSlice
May 23, 2018
Merged

Ny interp pol slice#1063
ZedThree merged 2 commits intonextfrom
nyInter_polSlice

Conversation

@d7919
Copy link
Member

@d7919 d7919 commented May 15, 2018

Allows data to be interpolated along the field line before doing the
transform to the poloidal plane.

Also fixes for v4 onwards due to change in meaning of nz (i.e. we no longer have the duplicate point).

d7919 added 2 commits May 15, 2018 16:07
Allows data to be interpolated along the field line before doing the
transform to the poloidal plane.

Routine assumes input is in field-aligned space. This is the not default
for BOUT++ >= v4.
try:
from numpy import linspace, meshgrid, append, newaxis
except ImportError:
print("ERROR: NumPy module not available")
Copy link
Member

@ZedThree ZedThree May 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure we require numpy for the pylib stuff, so we can just safely import it here. I think we also require scipy as well

(1.0 - p[x,y]*p[x,y]) * var3d[x,y,z0[x,y]] + \
0.5*p[x,y]*(p[x,y]+1.0) * var3d[x,y,zp[x,y]]
#For some reason numpy imposes a limit of 32 entries to choose
#so if nz>32 we have to use a different approach. This limit may change with numpy version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See here for a possible solution: https://stackoverflow.com/a/39169371/2043465

@ZedThree ZedThree merged commit b3368ca into next May 23, 2018
@ZedThree ZedThree deleted the nyInter_polSlice branch May 23, 2018 16:25
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

Successfully merging this pull request may close these issues.

3 participants