ML_SWE-2.jpg

Prediction Simulation for Water Year 2019#

We will be testing and evaluating the performance of the model over the 2019 WY at select locations

For example, the operational capacity of the model should begin at the beginning of the water year (WY week 1) with a previous SWE value of 0-in for each 1-km grid. Model evaluation could then assess the forecasting skill on a hold-out dataset of an entire year in which known neighboring values do not control predictions, but rather driving to-date predictions from the predicted previous SWE values. Due to the high model performance, future work will target the assessment of model skill with an operational motivation

Model Training/Testing influence on Model Results.#

The model training/testing partitioning methodology has a strong influence on model performance and the goal of model evaluation. The objective of the modeling effort was to examine the spatial extrapolation capacity of the model from selected monitoring stations to the overall region, best suited to a 75/25% training/testing split, respectively. While it is critical to address the strong serial correlation in SWE accumulation and melt throughout the season, the high correlation between weeks has the potential to inflate model skill when using a 75/25% training/testing split due to the previous SWE feature being known. An assessment of the operational capacity of the model is different than assessing the ability to extrapolate regional SWE from in-situ monitoring stations. For example, the operational capacity of the model should begin at the beginning of the water year (WY week 1) with a previous SWE value of 0-in for each 1-km grid. Model evaluation could then assess the forecasting skill on a hold-out dataset of an entire year in which known neighboring values do not control predictions, but rather driving to-date predictions from the predicted previous SWE values. Due to the high model performance, future work will target the assessment of model skill with an operational motivation.

%pip install myst-nb pandas==1.4.3 xarray rioxarray contextily rasterio geopandas==0.10.2 h5py tqdm tables scikit-learn seaborn tensorflow progressbar hydroeval folium==0.12.1.post1 vincent hvplot==0.8.0   nbformat==5.7.0   matplotlib basemap numpy 
import os
import NSM_SCA #pip install progressbar
import Hindcast_Initialization #pip install contextily

#Set working directories
#cwd = os.getcwd()
#os.chdir("..")
#os.chdir("..")
#datapath = os.getcwd() 
cwd ='/home/jovyan/shared-public/snow-extrapolation-web/'
new_year = '2019'
threshold = '20.0' #This threshold is standardized for now, to recalculate see Dr. Johnson
Region_list = ['N_Sierras','S_Sierras_High', 'S_Sierras_Low']

datelist = Hindcast_Initialization.Hindcast_Initialization(cwd, cwd, new_year, threshold, Region_list)

Run your SSM in hindcast mode to evaluate operational capacity.#

#run the model through all time (data acqusition already completed)
for day in datelist:
    print('Updating SWE predictions for ', day)
    #connect interactive script to Wasatch Snow module
    Snow = NSM_SCA.NSM_SCA(cwd, cwd, day, threshold=threshold, Regions = Region_list)
    
    #Go get SNOTEL observations - all data currently loaded, set to True to download
    #Snow.Get_Monitoring_Data_Threaded(getdata = False)

    #Initialize/Download the granules, all data preprocessed for the SSM activity, change to True to use the functions.
    #Snow.initializeGranules(getdata = False)

    #Process observations into Model prediction ready format,
    #Snow.Data_Processing()

    #Agument with SCA
    #Snow.augmentPredictionDFs()

    #Make predictions
    Snow.SWE_Predict()
Hindcast_Initialization.Snowgif(cwd, datelist, Region_list)

Model Hindcast complete#

Lets see how your model performs within SSWEET in the Hindcast_Evaluation notebook.