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

annotate velocity in non-cubic datasets #1014

Open
yt-fido opened this issue Apr 20, 2015 · 9 comments
Open

annotate velocity in non-cubic datasets #1014

yt-fido opened this issue Apr 20, 2015 · 9 comments
Labels
enhancement Making something better viz: 2D
Milestone

Comments

@yt-fido
Copy link
Collaborator

yt-fido commented Apr 20, 2015

Originally reported by: Anonymous


It looks like the annotate_velocity method on SlicePlots selects a number of points uniformly distributed in the x and y coordinates but this does not work well for slices where one of the dimensions is much larger than the other. Is it possible to scale the number of displayed arrows with the size of each axis of the domain?


@yt-fido
Copy link
Collaborator Author

yt-fido commented Apr 20, 2015

Original comment by Nathan Goldbaum (Bitbucket: ngoldbaum, GitHub: ngoldbaum):


Can you create a short example that illustrates this issue? It helps if you use one of the test datasets on yt-project.org/data, since it then makes it easy for someone else to reproduce and debug the issue locally.

Also if you want to take a hand at fixing this yourself, the velocity callback is defined in yt/visualization/plot_modications.py.

@yt-fido
Copy link
Collaborator Author

yt-fido commented Apr 21, 2015

Original comment by Miguel de Val-Borro (Bitbucket: migueldvb, GitHub: migueldvb):


I have a dataset which is elongated in one of the spatial dimensions. The number of blocks is chosen so that the cells are roughly cubic so that it has about five times more blocks in the x direction than in z direction. However I think that annotate_velocity distributes the arrows uniformly as if the x and z dimensions were equal which looks like this figure.

chcyg_3d_noniner_tst_0016_Slice_y_density.png

I wonder if one can scale the displayed arrows by the number of blocks in each dimension which should be related with the real dimensions of the domain.

@yt-fido
Copy link
Collaborator Author

yt-fido commented Apr 21, 2015

Original comment by Nathan Goldbaum (Bitbucket: ngoldbaum, GitHub: ngoldbaum):


Right now the number of arrows is fixed along each direction. If you want to change this, you will need to alter the QuiverCallback to (optionally) allow for a different number of arrows along the x and y directions. One way to do this would be to allow the factor keyword argument to be a tuple, and then handle that tuple appropriately. This will require code changes in VelocityCallback, MagneticFieldCallback, QuiverCallback, and CuttingQuiverCallback.

I don't have time to do this right now, but please feel free to go ahead and try for yourself. The callback code is relatively straightforward and self-contained. Please also feel free to raise this issue on the mailing list if you run into trouble.

@yt-fido
Copy link
Collaborator Author

yt-fido commented Apr 21, 2015

Original comment by Miguel de Val-Borro (Bitbucket: migueldvb, GitHub: migueldvb):


Thank you for the explanation. I can try to make those changes.

@yt-fido
Copy link
Collaborator Author

yt-fido commented Mar 24, 2016

Original comment by chummels (Bitbucket: chummels, GitHub: chummels):


@migueldvb : Have you made any progress on this?

@yt-fido
Copy link
Collaborator Author

yt-fido commented Mar 24, 2016

Original comment by Miguel de Val-Borro (Bitbucket: migueldvb, GitHub: migueldvb):


@chummels let me see if I did something to fix this problem.

@yt-fido
Copy link
Collaborator Author

yt-fido commented Mar 25, 2016

Original comment by Miguel de Val-Borro (Bitbucket: migueldvb, GitHub: migueldvb):


@chummels I did not fix this issue but I can do it for 3.4. Sorry that I completely forgot about this.

@yt-fido
Copy link
Collaborator Author

yt-fido commented Mar 25, 2016

Original comment by chummels (Bitbucket: chummels, GitHub: chummels):


It's OK. I just wanted to see what the current situation was.

@yt-fido
Copy link
Collaborator Author

yt-fido commented Apr 1, 2016

Original comment by Miguel de Val-Borro (Bitbucket: migueldvb, GitHub: migueldvb):


@ngoldbaum When I replace the factor keyword by a tuple to get different number of arrows in the x and y directions I get strange behavior like in the figure below.
chcyg_3d_noniner_tst_0016_Slice_y_density.png
The velocities should have roughly spherical symmetry about the origin. Perhaps the right way to do it is to use the physical dimensions of the image to select the number of points in each dimension?

@yt-fido yt-fido added major enhancement Making something better viz: 2D labels Apr 20, 2017
@yt-fido yt-fido added this to the moderate milestone Apr 20, 2017
@ngoldbaum ngoldbaum removed the major label May 3, 2017
@ngoldbaum ngoldbaum removed this from the moderate milestone May 3, 2017
@ngoldbaum ngoldbaum changed the title annotate velocity in on-cubic datasets annotate velocity in non-cubic datasets May 3, 2017
@ngoldbaum ngoldbaum modified the milestone: 3.4 May 4, 2017
@ngoldbaum ngoldbaum removed the 3.4 label May 4, 2017
@ngoldbaum ngoldbaum modified the milestones: 3.4, 4.0 May 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Making something better viz: 2D
Projects
None yet
Development

No branches or pull requests

2 participants