Here’s a **# Asteroid Visualization Tool
A web-based 3D visualization tool for viewing Near-Earth Objects (NEOs) using NASA's API data. This project converts asteroid data into an interactive 3D space environment where you can explore asteroids, their orbits, and detailed information.
- 3D Visualization: Interactive 3D space environment with Sun, Earth, and asteroids
- Real NASA Data: Fetches real-time asteroid data from NASA's NEO API
- Interactive Controls:
- Mouse controls for camera movement (zoom, pan, rotate)
- Click on asteroids to view detailed information
- Search functionality to find specific asteroids
- Animation controls (pause, speed up, slow down)
- Filtering Options: Filter asteroids by size range
- Responsive Design: Works on desktop and mobile devices
- A modern web browser with WebGL support
- Internet connection for NASA API access
-
Get NASA API Key (Optional but recommended):
- Visit NASA API Portal
- Sign up for a free API key
- The application will work with the demo key but has rate limits
-
Configure API Key:
- Open
script.js - Find the line:
const NASA_API_KEY = 'DEMO_KEY'; - Replace
'DEMO_KEY'with your actual API key
- Open
-
Run the Application:
- Open
index.htmlin your web browser - Or serve it through a local web server for best performance
- Open
For better performance and to avoid CORS issues, serve the files through a local web server:
# Using Python 3
python -m http.server 8000
# Using Node.js (if you have http-server installed)
npx http-server
# Using PHP
php -S localhost:8000Then open http://localhost:8000 in your browser.
- Select Date Range: Use the date pickers to choose a start and end date for asteroid data
- Apply Filters (Optional): Enable size filtering to focus on asteroids within specific size ranges
- Fetch Data: Click "Fetch Asteroids" to retrieve data from NASA's API
- Explore:
- Use mouse to navigate the 3D space
- Click on asteroids to view detailed information
- Use the search box to find specific asteroids
- Control animation speed and pause/resume
- Reset View: Click "Reset View" to return to the default camera position
- Mouse:
- Left click + drag: Rotate view
- Right click + drag: Pan view
- Scroll wheel: Zoom in/out
- Click on asteroid: Select and view info
- Buttons:
- Pause/Resume: Toggle animation
- Speed Up/Slow Down: Control animation speed
- Reset View: Return to default camera position
- HTML5: Structure and layout
- CSS3: Styling and responsive design
- JavaScript (ES6+): Application logic
- Three.js: 3D graphics and rendering
- NASA NEO API: Real asteroid data
asteroid-visualization-tool/
├── index.html # Main HTML file
├── style.css # Styling and layout
├── script.js # JavaScript logic and Three.js code
├── .env.example # Environment variables template
└── README.md # This file
- NASA NEO API: https://api.nasa.gov/neo/rest/v1/feed
- Rate Limits: 1000 requests per hour with API key, 30 per hour with demo key
- Data Coverage: Near-Earth Objects for specified date ranges
Asteroids are color-coded by size:
- Green: Small asteroids (< 100m diameter)
- Blue: Medium asteroids (100m - 500m diameter)
- Red: Large asteroids (> 500m diameter)
The visualization uses scale factors to make the data visible:
- Distance scale: 0.00001 (distances are scaled down)
- Size scale: 100 (asteroid sizes are scaled up)
- Earth distance: 150 units from the Sun
-
"Error fetching data":
- Check your internet connection
- Verify your API key if using a custom one
- Try with demo data (automatic fallback)
-
3D scene not appearing:
- Ensure your browser supports WebGL
- Try using a different browser
- Check browser console for errors
-
Performance issues:
- Reduce the date range to fetch fewer asteroids
- Use size filtering to limit the number of objects
- Close other browser tabs to free up memory
- Chrome 80+
- Firefox 75+
- Safari 13+
- Edge 80+
- Asteroid trajectory predictions
- Real-time tracking mode
- VR/AR support
- Advanced filtering options
- Export functionality
- Historical data visualization
Feel free to fork this project and submit pull requests for improvements!
This project is open source and available under the MIT License.** file template for your Asteroid Visualization Tool GitHub repository:
An interactive tool for visualizing the orbits and properties of near-Earth objects (NEOs) using NASA’s NEO API. The tool allows users to explore asteroid data, select a date range, filter objects based on characteristics like size, and visualize their orbits in 3D.
The Asteroid Visualization Tool aims to educate users about the risks and characteristics of near-Earth objects (NEOs). By leveraging NASA's Near Earth Object Web Service (NeoWs) API, this project provides real-time data and interactive 3D visualization to help users explore and understand asteroids in a more engaging way.
- Fetch Real-Time Asteroid Data: Retrieves NEO data from NASA’s NEO API based on user-defined date ranges.
- Interactive 3D Visualization: Visualize asteroid orbits in a 3D space using VPython.
- Filter Asteroids: Filter asteroids by size, close approach date, or minimum distance from Earth.
- User-Friendly Interface: Simple, intuitive interface built with Tkinter for easy navigation and interaction.
- Educational Content: Inform users about the characteristics and potential risks of various asteroids.
- Programming Languages: Python
- API: NASA’s Near Earth Object (NEO) API
- Libraries:
- VPython: For 3D orbital visualization.
- Tkinter: For creating the graphical user interface (GUI).
- Requests: For handling API calls to NASA’s NEO API.
- Database (optional): MySQL for saving user preferences or search history.
- Python 3.x
- VPython library
- Tkinter library
- Requests library
-
Clone the Repository:
git clone https://github.com/NexionisJake/Asteroid-Visualization-Tool.git cd Asteroid-Visualization-Tool -
Install Required Libraries:
pip install vpython tkinter requests
-
Run the Application:
python main.py
- Open the Application: Launch the program by running the
main.pyfile. - Select Date Range: Use the GUI to input a specific date range for fetching NEO data.
- Filter Asteroids: Filter the data by asteroid size, distance from Earth, or other characteristics.
- View in 3D: Visualize the orbits of selected asteroids in a 3D environment.
- Educational Insights: Explore additional information on each asteroid, including potential risks and their significance.