Skip to content

Tools to make local weather forecasts for terrestrial astronomical observations.

License

Notifications You must be signed in to change notification settings

klarrieu/astro-atmos

Repository files navigation

astro-atmos

Tools to make local weather forecasts for terrestrial astronomical observations.

Example forecast: Example forecast

Note

Because of the models/data sources currently implemented, this can only forecast locations within the United States. I have partially developed support for Canada too, but it is currently incomplete.

Forecast parameters

  • Cloud Cover: cloud cover scale
  • Probability of Precipitation: dark grey bars are shown on top of the cloud cover plot. Height of the bar corresponds to probability of precipitation from 0% (no bar) to 100% (bar fills full plot height). For example, in the example forecast above, we see a maximuim precipitation probability of ~30% on Wednesday afternoon.
  • Transparency: 1-5 scale representing the overall transparency of the atmosphere. Transparency is indicated using the same color scale as Seeing (below).
  • Seeing: 1-5 scale representing how clearly objects can be resolved for astronomical observation due to the effects of atmospheric turbulence. Poor seeing corresponds to "boiling" images and poor angular resolution. Seeing is indicated using the same color scale as Transparency. seeing/transparency scale
  • Planetary k-index (Kp): Represents the overall variance in Earth's magnetic fields due to solar flares/CMEs. High values of Kp correspond to geomagnetic storm levels (G-scale) and probability of auroras. Consistent with how Kp is displayed by NOAA's SWPC, the height of bars correspond to the value of Kp, and bars are also colored and labeled to indicate the geomagnetic storm level. k index scale
  • Sun/moon altitudes, lunar phase, and astronomical twilight/night times: Time series of the sun (gold line) and moon (blue line) altitudes for the forecast location are indicated in the Altitude plot. Icons of the sun and moon are shown at their current altitudes. The icon used to represent the moon also corresponds to the current lunar phase. The horizon is indicated by a horizontal black line. Astronomical twilight and night times are indicated by light and dark grey shading, respectively.
  • Temperature/Dewpoint: Time series of temperature and dewpoint temperature are shown in blue and purple, respectively. Daily high and low temperatures are also annotated.
  • Wind Speed/Gusts: Time series of average wind speed and wind gusts are shown in blue and red (dotted), respectively.

Installation

  1. Clone this git repository:

    git clone https://github.com/klarrieu/astro-atmos.git
    cd astro-atmos
    
  2. Install the required packages:

    Option 1: Using mamba/conda (current environment):

    mamba is preferred over conda since it resolves much faster, but these commands also work by replacing mamba with conda.

    mamba env update
    

    Option 2: Using mamba/conda (creating new environment):

    mamba env create -n <env-name> --file environment.yml
    mamba activate <env-name>
    

    Option 3: Using pip:

    pip install -r requirements.txt
    

Making Forecasts

  1. Enter desired forecast location by editing forecast_location.txt:

    [Location]
    # latitude, decimal degrees
    lat = 39.2
    # longitude, decimal degrees
    lon = -120.4
    # timezone name,timezone name, IANA format (optional, defaults to system timezone)
    timezone = US/Pacific
    # elevation in meters (optional, defaults to 0)
    elevation = 0

    Units of measurement for temperature and wind speed can also be adjusted in this file.

  2. Generate a forecast:

    python make_forecast.py
    

    After processing, an interactive plot will be generated. An image file for the forecast will also be saved.

  3. To further customize your forecast plots or grab the raw data from your forecast, check out the Docs.

Additional work-in-progress:

  • add smoke data source
  • add weather forecasts for Canada
  • annotate times for sunrise/sunset
  • lowpass filter temp for low/high annotation
  • add options for 12/24 hr times, light/dark styles
  • make subplots modular (separate method per subplot)
  • make web app interface (streamlit?)
  • more robust http requests with retries, checking data integrity

Data sources

Troubleshooting

Please submit an issue if you have any trouble using this code.

Contributing

Contributions are welcome and encouraged! Submit a PR.

About

Tools to make local weather forecasts for terrestrial astronomical observations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages