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

Make the position coordinates consistent across data groups #77

Merged
merged 16 commits into from
Feb 16, 2022

Conversation

nvaytet
Copy link
Collaborator

@nvaytet nvaytet commented Feb 14, 2022

This is essentially a renaming of xyz in the amr and sink groups to position, which is consistent with the part group.

In addition, the axes on map figures now have better names:

  • x and y if direction='z'
  • pos_u, pos_v if the orientation is not aligned with the grid axes

Fixes #73
Fixes #74

Copy link
Collaborator

@Adnan-Ali-Ahmad Adnan-Ali-Ahmad left a comment

Choose a reason for hiding this comment

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

I'm not sure how to request a change on a file without a commit on github, but line 41 of README.md needs to change center = data["amr"]["xyz"][ind.values] to center = data["amr"]["position"][ind.values]. Other than that, I have no comments.

dir_vecs = np.array([[0., 0.], [1., 0.], [0., 1.]])
dir_labs = {"x": "x", "y": "y"}

elif direction in ["top", "side"]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

direction.lower() ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I also applied it on "x", "y" and "z" strings.

zcenters = np.linspace(zmin + 0.5 * zspacing, zmax - 0.5 * zspacing,
resolution['z'])

if thick:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note that this change is somewhat unrelated.
When no dx was specified for the map, the extent in z depended on the size of the cells, and was necessarily symmetrical around the origin.
This meant that at the point of generating a mesh of sampling, the z coords were not always zero, and woudl lead to empty patches in the final map, because the sampling points did not agree with the selection of points done further up.

@nvaytet nvaytet merged commit 473b8cd into main Feb 16, 2022
@nvaytet nvaytet deleted the positions_inconsistencies branch February 16, 2022 08:45
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.

xyz_x and xyz_y axis labels on maps Rename xyz to position?
2 participants