Lake Michigan Moonset Predictor Plugin
Version: 1.0
Author: ScooterCam
For: ScooterCam.net
A specialized WordPress plugin that predicts spectacular moonset viewing conditions over Lake Michigan from the South Haven to Holland viewing area. This plugin analyzes moon phases, timing, atmospheric conditions, and critically—cross-lake cloud coverage from Kenosha, WI—to determine optimal moonset photography and viewing opportunities.
🌕 What Makes a Great Lake Michigan Moonset?
A truly spectacular Lake Michigan moonset occurs when:
- A nearly full moon (85%+ illumination) sets over the lake
- Timing coincides with dawn (within 1-2 hours of sunrise)
- Moon sets in the western sky (directly over Lake Michigan)
- Clear skies exist on BOTH sides of the lake
- Good visibility and low humidity enhance clarity
📋 Features
Core Functionality
- Real-time moonset scoring (0-100 scale with letter grades)
- Cross-lake cloud analysis – Monitors both South Haven and Kenosha weather
- Dawn timing optimization – Identifies perfect sunrise/moonset alignment
- Moon phase tracking – Prioritizes full moon events
- Next opportunity prediction – Calculates upcoming great moonsets
- Smart caching – Reduces API calls while staying current
Scoring System (100 points total)
Factor | Points | Description |
---|---|---|
Moon Phase | 45 | Nearly full (85%+) = 45pts, Bright (70%+) = 35pts |
Dawn Timing | 20 | Within 1hr of sunrise = 20pts, 2hrs = 15pts |
Cross-Lake Clouds | 20 | Clear both sides = 20pts, averages local + Kenosha |
Moon Position | 15 | West over lake (225-315°) = 15pts |
Visibility | 10 | Crystal clear (10km+) = 10pts |
Humidity | 5 | Low humidity (<60%) = 5pts |
Why Kenosha Weather Matters
The moonset occurs over Lake Michigan, which means clouds anywhere between South Haven, MI and Kenosha, WI can obscure the view. The plugin:
- Fetches weather from both South Haven (viewer location) and Kenosha (across the lake)
- Calculates average cloud coverage across the lake
- Penalizes high cloud coverage on either side
- Provides detailed cloud reports: “Clear skies across Lake Michigan (Local: 10%, Kenosha: 15%)”
This cross-lake analysis is critical for accurate predictions.
🚀 Installation
1. Upload Plugin Files
/wp-content/plugins/scootercam-moonset-predictor/
├── scootercam-moonset-predictor.php
├── class-lake-michigan-moonset-predictor.php
└── README.md
2. Activate Plugin
- Go to WordPress Admin → Plugins
- Find “ScooterCam Lake Michigan Moonset Predictor”
- Click “Activate”
3. Configure API Keys
- Go to Settings → Moonset Predictor
- Add your API keys:
- OpenWeatherMap API Key – Get free at openweathermap.org/api
- RapidAPI Moon Phase Key – Get at rapidapi.com/MoonAPIcom/api/moon-phase
4. Add to Your Site
Use shortcodes in any page or post:
[moonset_score]
[moonset_score]
📱 Usage Examples
Full Moonset Display
[moonset_score]
Shows complete prediction with score, timing, conditions, and all factors.
Score Only
[moonset_score display="score"]
Output: 85/100 (A)
Moonset Time Only
[moonset_score display=”time”]
[moonset_score display="time"]
Output: 6:42 AM
Next Great Opportunity
[moonset_score display=”next”]
[moonset_score display="next"]
Shows when the next excellent moonset will occur.
🎨 Display Modes
When Worth Watching (Score ≥30)
Displays full prediction card with:
- Large score circle with color-coded gradient
- Moon phase name and illumination percentage
- Moonset and sunrise times
- Detailed condition factors
- Alert banner for excellent conditions
When Not Worth Watching
Displays “Next Opportunity” card with:
- Current moon phase
- Date of next great moonset
- Estimated score for that date
- Days until opportunity
- Seasonal reasoning
🎯 Score Interpretation
Score | Grade | Meaning |
---|---|---|
85-100 | A+ to A | Excellent – Drop everything and go! |
70-84 | B+ to A- | Great – Highly recommended viewing |
50-69 | C to B- | Good – Worth checking out |
30-49 | D to C- | Fair – Marginal conditions |
0-29 | F | Poor – Not worth the trip |
🌤️ Weather Monitoring
Locations Monitored
South Haven, MI (42.5593, -86.2361)
- Primary viewing location
- Local weather conditions
- Visibility and humidity
Kenosha, WI (42.5847, -87.8212)
- Across Lake Michigan
- Critical for cloud interference detection
- West-to-east cloud movement
Cache System
- Moon data: 1 hour cache
- Weather data: 30 minute cache
- Kenosha weather: 30 minute cache
Caching reduces API costs while maintaining accuracy for evolving conditions.
🔧 Technical Details
API Requirements
OpenWeatherMap API
- Free tier: 1,000 calls/day
- Used for: Current weather (South Haven + Kenosha)
- Update frequency: Every 30 minutes
RapidAPI Moon Phase
- Free tier: 500 calls/month
- Used for: Moon position, phase, timing
- Update frequency: Every hour
File Structure
scootercam-moonset-predictor/
├── scootercam-moonset-predictor.php # Main plugin file
├── class-lake-michigan-moonset-predictor.php # Core prediction logic
└── README.md # Documentation
Cache File Location
/home/scootercam/public_html/wx/moonset_cache.json
Dependencies
- PHP 7.0+
- WordPress 5.0+
- JSON support
- file_get_contents() enabled
🎨 Styling
The plugin includes comprehensive CSS that creates:
- Beautiful gradient backgrounds (night sky theme)
- Responsive design (mobile-friendly)
- Color-coded score circles (purple → blue → pink based on quality)
- Professional card layouts
- Smooth animations
Customization
You can override styles by adding custom CSS to your theme:
.moonset-predictor {
/* Your custom styles */
}
📊 Seasonal Considerations
Best Seasons for Lake Michigan Moonsets
Winter (Dec-Feb)
- Longer nights = better dawn alignment
- Clearer atmospheres
- +15 point seasonal bonus
Fall (Sep-Nov)
- Good dawn timing
- Stable weather patterns
- +10 point seasonal bonus
Spring (Mar-May)
- Moderate conditions
- +5 point seasonal bonus
Summer (Jun-Aug)
- Short nights = poor alignment
- Dawn too early for good moonsets
- No seasonal bonus
🐛 Troubleshooting
“API keys not configured”
Solution: Go to Settings → Moonset Predictor and add both API keys
“Unable to load moonset data”
Possible causes:
- API keys invalid or expired
- API rate limits exceeded
- Network connectivity issues
- Cache file permission problems
Solutions:
- Verify API keys are active
- Check API usage quotas
- Ensure cache directory is writable:
chmod 755 /home/scootercam/public_html/wx/
Scores seem inaccurate
Check:
- Both APIs returning data (check cache file)
- Kenosha weather being fetched successfully
- Moon phase data is current
- Clear cache and force refresh
Cache Issues
Clear cache programmatically:
$predictor->clearCache();
Or delete manually:
rm /home/scootercam/public_html/wx/moonset_cache.json
🔮 Understanding the Predictions
Morning Moonset Requirement
Only moonsets occurring between 4 AM and 10 AM are considered. This ensures:
- Dawn light enhancement
- Reasonable viewing times
- Photographic opportunities
Cloud Analysis Logic
Average Clouds = (South Haven + Kenosha) / 2
Max Clouds = Maximum of either location
If avgClouds ≤ 15% AND maxClouds ≤ 25%
→ Excellent (20 points)
If avgClouds ≤ 30% AND maxClouds ≤ 45%
→ Good (14 points)
Otherwise
→ Points reduced dramatically
Azimuth Sweet Spot
The moon must set between 225° and 315° (west-facing) to be directly over Lake Michigan from the South Haven viewing area.
📈 Future Enhancements
Potential additions:
- Multi-day forecast predictions
- Historical moonset gallery integration
- Push notifications for excellent conditions
- Tide data integration
- Wind speed/direction analysis
- Light pollution index
🤝 Support
For issues, questions, or feature requests:
- Email: [your-email]
- Website: ScooterCam.net
- Report bugs: [github-url if applicable]
📜 License
This plugin is proprietary software created for ScooterCam.net.
🙏 Credits
- Weather data: OpenWeatherMap
- Moon data: RapidAPI Moon Phase API
- Developed for ScooterCam.net
- Lake Michigan viewing area: South Haven to Holland, MI
📝 Changelog
Version 1.0 (2025)
- Initial release
- Full moon phase scoring
- Dawn timing optimization
- Cross-lake cloud analysis from Kenosha
- Next opportunity predictions
- Smart caching system
- Responsive design
- Multiple display modes
Made with ❤️ for capturing the beauty of Lake Michigan moonsets 🌕🌊