|Will Barton 83463421ed||6 years ago|
|observation||6 years ago|
|tests||6 years ago|
|.gitignore||7 years ago|
|LICENSE||7 years ago|
|README.md||7 years ago|
|requirements.txt||7 years ago|
|setup.py||7 years ago|
The base library of the Observation Sky Conditions stack. This library processes the Canadian Meteorological Center's Astronomical forecasts, which are only provided in map form, to extract forecasts for specific GPS coordinates.
To retrieve all of the forecast maps (seeing, transparency, wind, temperature, humidity, and cloud cover):
# Import the two main classes we need to use from observation.conditions import ForecastMapSeries, Forecast # Create the map series for each type of map. image_path = "/tmp/observation" seeingSeries = ForecastMapSeries(3, SEEING_COLOR_TABLE, 'seeing', image_path) transparencySeries = ForecastMapSeries(3, TRANSPARENCY_COLOR_TABLE, 'transparency', image_path) windSeries = ForecastMapSeries(3, WIND_COLOR_TABLE, 'wind', image_path) temperatureSeries = ForecastMapSeries(3, TEMPERATURE_COLOR_TABLE, 'temperature', image_path) humiditySeries = ForecastMapSeries(3, HUMIDITY_COLOR_TABLE, 'humidity', image_path) cloudsSeries = ForecastMapSeries(3, CLOUDS_COLOR_TABLE, 'clouds', image_path, regions=['northeast', 'northwest', 'southeast', 'southwest']) # Create the overal forecast from the map series forecast = Forecast(seeingSeries, transparencySeries, windSeries, temperatureSeries, humiditySeries, cloudsSeries) # Refresh the forecast maps (this will download the images from the # Canadian Weather Office) forecast.refresh() # GPS Coordinates lat = 42.013750 lon = -73.883561 # Lookup the forecast for the given GPS coordinates for the present # time. print forecast(lat, lon, datetime.datetime.now(tz=tz.tzutc()))
This library does not attempt to handle keeping the images up to date with the Canadian Weather Office's 5:00 UTC and 17:00 UTC updates.
Note: basemap may require a manual install, as it has patched dependencies that pip cannot install. See http://matplotlib.org/basemap/users/installing.html for details.
BSD. See LICENSE file.