Build Small Star Movement Videos Using Python
by matt392 in Circuits > Computers
58 Views, 0 Favorites, 0 Comments
Build Small Star Movement Videos Using Python
Made several short video animations of the motion of stars near Earth. Used Claude.ai and Python.
Supplies
- Python
- Python libraries; install using pip command:
- pip install numpy pandas pyvista "imageio[ffmpeg]"
- numpy
- pandas
- pyvista
- imageio + imageio-ffmpeg
- Numpy files with data below [pos0, vel.npy, valid_counts]
- Video player like VLC: https://www.videolan.org/
Generate Animation Files
- Download all 4 files from previous step:
- the 3 .npy.txt files
- the Python file
- Place all 4 files into one folder
- Change the 3 .npy.txt file endings to .npy
- These are the numpy files that the Python program will refer to when it runs.
- Use IDLE in Python to open the Python file [stellar_timelapse.py]
- Edit RENDER_SAMPLE variable to choose star count (5 to 100,000)
- Edit OUTPUT_MP4 variable to change the output file name
- Run the Python file
- A mp4 file should be in the same folder that you can run using a media player like VLC.