simsopt icon indicating copy to clipboard operation
simsopt copied to clipboard

surface copying classmethod

Open smiet opened this issue 1 year ago • 8 comments

Added a classmethod to surfacerzfourier.py that copies an existing surface but allows the user to request a different nphi, ntheta and grid_range.

Usecase: your existing equilibrium has half period, but you want to plot the full surface, so you use this method to generate a brother with higher resolution and full range.

Currently only implemented surfaceRZFourier, if this is deemed useful, will generate for the other classes as well.

[is a bit of duplication when this is added to each inherited class, but cleaner than adding a classmethod to the Surface class, as different arrays need to be populated in each inherited class's constructor, which does not follow a neat pattern]

If useful, give me some time to add classmethod to other classes, otherwise please cancel request. If I'm duplicating functionality, my apoligies, Thanks!

smiet avatar Aug 29 '23 15:08 smiet