jobovy / streamtools

Tools for modeling and analyzing stellar streams
https://streamtools.readthedocs.io/
MIT License
1 stars 4 forks source link

allow units in `.sample()` #5

Open nstarman opened 3 years ago

nstarman commented 3 years ago

Allow initializing Streamspraydf with units and returning unit-ful quantities in .sample().

Signed-off-by: Nathaniel Starkman (@nstarman) nstarkman@protonmail.com

jobovy commented 3 years ago

Can you post an example, e.g., the example from the docs with units on to show that it gives the equivalent result?

nstarman commented 3 years ago

Done! 🤞 https://gist.github.com/nstarman/5a7a1a17ff1759c12d2448846e9a1a9f

jobovy commented 3 years ago

Hi Nathaniel, just merged this with a change that Yansong made (to allow a stream to be generated in a moving system, like a dwarf galaxy). Could you check that the unit handling still works as expected? I did the merge on GitHub, so am not sure whether it actually worked. I'd like to merge this soon. Thanks!

nstarman commented 3 years ago

I rebased and pushed what I've done. Something I've been trying to figure out for a few days now is why this no longer works. In https://gist.github.com/nstarman/5a7a1a17ff1759c12d2448846e9a1a9f, the output had units. Now, while safer because of the additions of use_physical=False, there are no units.