CIGLR-ai-lab / GreatLakes-TempSensors

Collaborative repository for optimizing the placement of temperature sensors in the Great Lakes using the DeepSensor machine learning framework. Aiming to enhance the quantitative understanding of surface temperature variability for better environmental monitoring and decision-making.
MIT License
0 stars 0 forks source link

Explore Seasonal Variability of the Trained Model #37

Closed DaniJonesOcean closed 1 month ago

DaniJonesOcean commented 1 month ago

Task Description:

Investigate the seasonal variability of the trained DeepSensor model by generating plots of the prediction mean and prediction standard deviation for each season. Train the model using anomalies.

[NOTE: If you start running out of time/bandwith, it's totally fine to convert this issue to the simpler version of "plot some example snapshots from selected days".]

Checklist:

  1. Define Seasons:

    • [ ] Define the four seasons for analysis (e.g., Winter: December-February, Spring: March-May, Summer: June-August, Fall: September-November).
  2. Extract Seasonal Data:

    • [ ] Extract prediction data for each season from the trained DeepSensor model (see below).
  3. Generate Plots:

    • [ ] Create plots for the prediction mean for each season.
    • [ ] Create plots for the prediction standard deviation for each season.
    • [ ] Ensure that the plots are clear, labeled, and include legends for better interpretation.

    Example (This examples assumes that you have a prediction data xarray Dataset, with both a prediction_mean and prediction_std variable. This would have to be created using DeepSensor):

    import matplotlib.pyplot as plt
    import xarray as xr
    # Load prediction data
    prediction_data = xr.open_dataset('path_to_prediction_data.nc')
    
    # Define seasons
    seasons = {
       'Winter': ('12-01', '02-28'),
       'Spring': ('03-01', '05-31'),
       'Summer': ('06-01', '08-31'),
       'Fall': ('09-01', '11-30')
    }
    
    for season, (start_date, end_date) in seasons.items():
       season_data = prediction_data.sel(time=slice(start_date, end_date))
       prediction_mean = season_data['prediction_mean'].mean(dim='time')
       prediction_std = season_data['prediction_std'].mean(dim='time')
    
       # Plot prediction mean
       plt.figure()
       prediction_mean.plot()
       plt.title(f'Prediction Mean - {season}')
       plt.savefig(f'prediction_mean_{season.lower()}.png')
    
       # Plot prediction standard deviation
       plt.figure()
       prediction_std.plot()
       plt.title(f'Prediction Standard Deviation - {season}')
       plt.savefig(f'prediction_std_{season.lower()}.png')
  4. Analyze and Interpret Results:

    • [ ] Analyze the generated plots to observe how prediction means and standard deviations differ across seasons.
    • [ ] Document any notable patterns, differences, or insights observed from the plots.
  5. Document the Process and Findings:

    • [ ] Create a Jupyter notebook to document the process of exploring seasonal variability, including code for data extraction, plot generation, and analysis.
    • [ ] Save the generated plots as images.
    • [ ] Upload the Jupyter notebook and plot images to the shared GitHub repository under an appropriate directory (e.g., notebooks).
DaniJonesOcean commented 1 month ago

@eredding02 Feel free to put your seasonal plots here and close this issue! : )

eredding02 commented 1 month ago

@DaniJonesOcean

Screenshot 2024-07-18 at 10 02 46 AM Screenshot 2024-07-18 at 10 02 02 AM Screenshot 2024-07-18 at 10 02 20 AM Screenshot 2024-07-18 at 10 02 33 AM