<p>Does anyone know of any packages/functions in packages that can give mean line of sight velocities (losv) from a simulation snapshot (from the spatial and velocity coordinates or directly from the snapshot itself) that would be great. It could be in pynbody or other python packages. I was looking through them but could not find any functions that directly give the mean losv or variance of line of sight velocities.
I asked a related question earlier where I described in detail what problem I was working on:<a href="https://astronomy.stackexchange.com/questions/45407/how-to-calculate-mean-line-of-sight-velocity-of-stars-after-rotation-of-galaxy">How to calculate mean line of sight velocity of stars after rotation of galaxy?</a></p>
<p>So, I am trying to calculate mean losv etc from a simulation snapshot both manually through my own code and also by using packages to check if my own functions give the correct answer.  I mainly want to plot the mean losv and variance with changing inclination of the galaxy.</p>
<p>Also, how to use an integral field unit (IFU) mask on the galaxy coordinates in this context before calculating mean losv or variances? Any relevant literature would be great.</p>
<p>Thanks a lot. I am new to astrophysics and astronomy and studying alone in pandemic can be challenging. So, I appreciate your support!</p>

CC BY-SA 4.0
2021-08-23T14:49:19.963Z
Have a look at this question: https://stackoverflow.com/questions/62851904/projecting-the-velocity-on-the-line-of-sight-edited . I think they are doing something similar to you. You could use that code to check if yours is correct
Prallax
CC BY-SA 4.0
2021-08-24T10:24:20.870Z
Thanks a lot, Prallax but I am not looking to use FITS files though...however it was  useful because I am missing a lot of technical information on the method of analysing astronomical images and how to use masks, binning, manipulating coordinates to calculate different statistical quantities. I understand the physics but not yet the technicalities because I am new to coding as well. If you come across other examples like the one you mentioned, please feel free to share. You have been incredible :)
Jerome
<galaxy><python><n-body-simulations>
Are there python packages to calculate mean line of sight velocity, linewidth and other distributions from galaxy simulation snapshots?
Jerome
# Are there python packages to calculate mean line of sight velocity, linewidth and other distributions from galaxy simulation snapshots?

(Asked by: username_0 on 2021-08-23)

Does anyone know of any packages/functions in packages that can give mean line of sight velocities (losv) from a simulation snapshot (from the spatial and velocity coordinates or directly from the snapshot itself) that would be great. It could be in pynbody or other python packages. I was looking through them but could not find any functions that directly give the mean losv or variance of line of sight velocities.
I asked a related question earlier where I described in detail what problem I was working on:[How to calculate mean line of sight velocity of stars after rotation of galaxy?](https://astronomy.stackexchange.com/questions/45407/how-to-calculate-mean-line-of-sight-velocity-of-stars-after-rotation-of-galaxy)

So, I am trying to calculate mean losv etc from a simulation snapshot both manually through my own code and also by using packages to check if my own functions give the correct answer. I mainly want to plot the mean losv and variance with changing inclination of the galaxy.

Also, how to use an integral field unit (IFU) mask on the galaxy coordinates in this context before calculating mean losv or variances? Any relevant literature would be great.

Thanks a lot. I am new to astrophysics and astronomy and studying alone in pandemic can be challenging. So, I appreciate your support!

**Tags:** galaxy, python, n-body-simulations
> **Comments:**
> **username_1**: Have a look at this question: https://stackoverflow.com/questions/62851904/projecting-the-velocity-on-the-line-of-sight-edited . I think they are doing something similar to you. You could use that code to check if yours is correct  
> **username_0**: Thanks a lot, Prallax but I am not looking to use FITS files though...however it was  useful because I am missing a lot of technical information on the method of analysing astronomical images and how to use masks, binning, manipulating coordinates to calculate different statistical quantities. I understand the physics but not yet the technicalities because I am new to coding as well. If you come across other examples like the one you mentioned, please feel free to share. You have been incredible :)  

---

## 0 answers

