Scootercam

scootercam-moonset-predictor plugin

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)

FactorPointsDescription
Moon Phase45Nearly full (85%+) = 45pts, Bright (70%+) = 35pts
Dawn Timing20Within 1hr of sunrise = 20pts, 2hrs = 15pts
Cross-Lake Clouds20Clear both sides = 20pts, averages local + Kenosha
Moon Position15West over lake (225-315ยฐ) = 15pts
Visibility10Crystal clear (10km+) = 10pts
Humidity5Low 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

  1. Go to WordPress Admin โ†’ Plugins
  2. Find “ScooterCam Lake Michigan Moonset Predictor”
  3. Click “Activate”

3. Configure API Keys

  1. Go to Settings โ†’ Moonset Predictor
  2. Add your API keys:

4. Add to Your Site

Use shortcodes in any page or post:

[moonset_score]
No notable moonset today

๐Ÿ“ฑ 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

No notable moonset today
[moonset_score display="time"]

Output: 6:42 AM

Next Great Opportunity

No notable moonset today
[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

ScoreGradeMeaning
85-100A+ to AExcellent – Drop everything and go!
70-84B+ to A-Great – Highly recommended viewing
50-69C to B-Good – Worth checking out
30-49D to C-Fair – Marginal conditions
0-29FPoor – 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:

  1. API keys invalid or expired
  2. API rate limits exceeded
  3. Network connectivity issues
  4. 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:

  1. Both APIs returning data (check cache file)
  2. Kenosha weather being fetched successfully
  3. Moon phase data is current
  4. 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 ๐ŸŒ•๐ŸŒŠ

Scootercam