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

Adds ability to plot Pfsspy field lines #12

Merged
merged 16 commits into from
Jun 12, 2021
Merged

Conversation

jeffreypaul15
Copy link
Collaborator

@jeffreypaul15 jeffreypaul15 commented Jun 10, 2021

A rough draft on adding functionality to plot field lines.
Most of the field creation of the lon, lat and and radius values are done in the example file and I'm not sure this is how we want it structured here.
Should we allow plot_field_lines method to accept Skycoord only as an argument and directly plot the field lines instead of creating the Skycoord with the lon, lat and r values being passed to SkyCood?

  • Specifying colors to the mesh

@nabobalis
Copy link
Contributor

What is the output from the new example?

examples/skip_plot_field_lines.py Outdated Show resolved Hide resolved
examples/skip_plot_field_lines.py Outdated Show resolved Hide resolved
from sunkit_pyvista import SunpyPlotter

###############################################################################
# We will firstly use an AIA 193 image from the sunpy sample data as the base image.
Copy link
Member

Choose a reason for hiding this comment

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

This will be an issue if the AIA map and the GONG map were not taken at the same time. I will see if I can add a GONG map to the pfsspy sample data that is taken at the same observation date as the AIA map. Lets not block this PR on this point, but we should fix it before releasing the package!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh okay, yes

Comment on lines 164 to 171
tracer = tracing.PythonTracer()
input_ = pfsspy.Input(gong_map, nrho, rss)
output_ = pfsspy.pfss(input_)

seeds = SkyCoord(lon, lat, radius*R_sun,
frame=gong_map.coordinate_frame)

field_lines = tracer.trace(seeds, output_)
Copy link
Member

Choose a reason for hiding this comment

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

These lines should all go in the example script, and the plot_field_lines method should just take field_lines and **kwargs as input. That way, the user has access to the PFSS solution if they want to trace different lines through it or do other things that aren't plotting the lines.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah this makes more sense, I'll update the PR

sunkit_pyvista/plotter.py Show resolved Hide resolved
sunkit_pyvista/plotter.py Show resolved Hide resolved
sunkit_pyvista/plotter.py Outdated Show resolved Hide resolved
@jeffreypaul15
Copy link
Collaborator Author

What is the output from the new example?

image

The colours have to be added in

@dstansby
Copy link
Member

This looks great!

Co-authored-by: Nabil Freij <nabil.freij@gmail.com>
@nabobalis nabobalis merged commit ab64bd8 into sunpy:main Jun 12, 2021
@jeffreypaul15 jeffreypaul15 deleted the pfsspy branch June 12, 2021 19:22
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