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

Shot coordinates #40

Open
walinchus opened this issue Feb 27, 2024 · 2 comments
Open

Shot coordinates #40

walinchus opened this issue Feb 27, 2024 · 2 comments

Comments

@walinchus
Copy link

Question about the event coordinates.

For some reason, when I map them out, I only see a few shots in the top right corner:

image

I tried to go on the PWHL website, but I couldn't find, even using view source, the coordinates of each shot to see if I could adjust them:
image

Is there any documentation on the shot coordinates? Like where they are supposed to start from, what's the units, etc?

@benhowell71
Copy link
Collaborator

the PWHL coordinate system is extremely weird. New update was pushed to fastRhockey tonight to translate the coordinates into a more traditional system.

  • x/y_coord are the traditional points that should be plotable on the geom_hockey rink
  • the other coordinates are either the original or extra flipped versions that I plan to use for some stuff. They are outlined here: updating PWHL rosters & play-by-play #41 (comment)

@walinchus
Copy link
Author

Thank you for doing this. Is there a coordinate system that you are setting it to? I tried to plot it but it still came out a bit up and to the right, no matter if I used x/ycoord, x/y_coord_original, x/y_coord_fixed, or x/y_coord right.

I think this is the issue: geom_hockey has (0,0) as thevery middle faceoff dot. So any play with a negative X value is on the TV left half of the ice and any with a positive X value is on the TV right half. But the opening faceoff has an x_coord of 100 and a y_coord of 42.5. The x_coord_original value is 300 and they_coord_originalvalue is 150.

Now that I know how to translate them, I can recalculate, but that might be something to think about for this in the future. I'm using the sportyR package to get the geom_hockey() function. Maybe there's another function that does rinks?

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

No branches or pull requests

2 participants