add the trace_field_line_toroidal function#60
add the trace_field_line_toroidal function#60louloufev wants to merge 1 commit intokripnerl:masterfrom
Conversation
The function does a similar job as trace_field_line, but doesn't use stopper method. Instead the toroidal angle is specified by the user.
kripnerl
left a comment
There was a problem hiding this comment.
Hi, thank you for the merge request.
I CR it for you and identified a couple of bugs in the code.
Generally, this should not be merged. In order to correctly (consistently) add this functionality, we need first to create a toroidal stopper factory and then implement this behaviour into the original trace_fieldline method. Adding t_eval parameter is a good idea.
Nevertheless, thank you for the suggestions; I will try to implement them soon. I now work on code improvements and general interface improvements.
| :param coords: | ||
| :return: list of coordinates | ||
| """ | ||
|
|
|
|
||
| for i in np.arange(len(coords)): | ||
|
|
||
| if 1: #i==0 or i==len(coords)-1 or i == np.int(len(coords)/2): |
There was a problem hiding this comment.
if 1 is nothing what is allowed in the code
| phi_start = coords.phi[i] | ||
|
|
||
| if phi_end is None: | ||
| phi_end = phi_start |
There was a problem hiding this comment.
If you set this, it will do nothing. You may require at least one toroidal orbit. See original function. There is a formula to resolve the direction.
| else: | ||
| phi_start = coords.phi[i] | ||
|
|
||
| if phi_end is None: |
There was a problem hiding this comment.
I guess there is no need to run this in each cycle of the for loop.
The function does a similar job as trace_field_line, but doesn't use stopper method. Instead the toroidal angle is specified by the user.