Tracking Auroras : The Aurora Tracker Python Script

Do you or your better half really love Auroras, have you ever gazed up at the night sky, hoping to catch a glimpse of the mesmerizing auroras? These stunning natural light displays, typically seen in polar regions, are caused by the interaction between the Earth’s magnetic field and charged particles from the sun. Before I finally got lucky to see it, I have missed the chance to see the auroras on multiple occasions and found out about it next day on instagram or news(my wife regrets missing more than me). To overcome the challenge of missing Auroras, I developed the Aurora Tracker — a Python script that monitors aurora forecasts and sends email notifications when conditions are favorable in the next three days. See here for the code

Finally got to see it !

Key Features Link to heading

  • Data Retrieval: The script fetches aurora forecast data from NOAA’s 3-day forecast API.
  • Time Conversion: It converts UTC times to AEDT (Australian Eastern Daylight Time), making it easier for users in Australia to understand when to look for auroras.
  • Email Notifications: If a Kp index of 7 or higher is detected, the script automatically sends an email alert to subscribed users.

Code Overview Link to heading

The Aurora Tracker is designed to run within a Docker container, ensuring a consistent and isolated environment for execution. Below is the directory structure of the project:

├── aurora.py                   # The Main Script
├── build_docker_container.sh   # nothing fancy, create docker image and run docker compose
├── crontab                     # Cron job configuration file
├── docker-compose.yaml         # Docker Compose configuration
├── Dockerfile                  # Instructions for building the Docker image
├── receiver_email_list.txt     # List of email addresses for notifications
└── requirements.txt            # Python dependencies

How to Run the Aurora Tracker Link to heading

  1. Set Up the Cron Job: Edit the crontab file to specify how often you want the script to run. For example, to run the script daily at 2 AM
    0 2 * * * /usr/local/bin/python /app/aurora.py >> /var/log/cron.log 2>&1
    
  2. Add the Receivers Email:
  3. Add your Email Details: Fill out the .env file with email details
    EMAIL_PASSWORD='YOUR-PASSWORD'
    USERNAME='YOUR-EMAIL'
    
  4. Build the Docker Container: To build the Docker container, run the following command in your terminal:
    docker build -t aurora_tracker . # This builds the docker image
    docker compose up -d # Run the docker compose
    

Guide: How to Optimize Aurora Photos with Your iPhone Link to heading

Taking photos of the aurora can be an unforgettable experience. Here’s how to make the most of your iPhone’s camera to get that perfect shot!

  1. Enable Night Mode
    • Open the Camera App: Your iPhone will automatically enable Night Mode in low-light conditions.
    • Check for Night Mode Icon: Look for the crescent moon icon. If it’s illuminated, Night Mode is active.
  2. Adjust Exposure Time
    • Tap the Night Mode Icon: This will allow you to adjust the exposure time.
    • Set to Maximum: Drag the slider to the maximum (up to 10 seconds, depending on your model) for optimal light capture.
  3. Fine-tune Exposure Adjustment (Optional)
    • Adjust Exposure: If you want to tweak the brightness, tap the screen where the aurora is visible and slide your finger up or down to increase or decrease exposure.
    • Consider Experimenting: While you may not have adjusted this, it can help depending on the conditions.
  4. Additional Tips
    • Use a Tripod: Keep your iPhone steady for the best results.
    • Capture in RAW Format: If you have an app that allows for shooting in RAW, it will give you more editing flexibility later.
    • Use a Remote Shutter: This helps avoid camera shake when taking the shot.
    • Scout Your Location: Find a spot with minimal light pollution for a clearer view of the aurora.

Conclusion Link to heading

The Aurora Tracker is designed to ensure you never miss the breathtaking beauty of the auroras. By setting up this tool, you can stay informed about auroral activity and seize the opportunity to witness this natural wonder. Whether you’re an avid photographer, a nature lover, or simply curious about the night sky, the Aurora Tracker enhances your chances of experiencing these magical displays.

Now that your script is up and running, you can focus on capturing stunning photos and creating lasting memories under the shimmering lights. Happy tracking, and may the auroras light up your nights!