import json import os import random interfaceOpt = 1 # set it the same as which you used to train your model # ==1 default, the recommended and more interpretable version # ==0 the "pro" version # Define root directory of database and output # Modify this based on your own location of CAMELS dataset and saved models rootDatabase = os.path.join(os.path.sep, "scratch", "Camels") # CAMELS dataset root directory camels.initcamels( rootDatabase ) # initialize three camels module-scope variables in camels.py: dirDB, gageDict, statDict rootOut = os.path.join(os.path.sep, "data", "rnnStreamflow") # Model output root directory # The directory you defined in training to save the model under the above rootOut exp_name = "PUR" exp_disp = "Testrun" save_path = os.path.join(rootOut, exp_name, exp_disp) random.seed(159654) # this random is only used for fractional FDC scenarios and # to sample which basins in the target region have FDCs. # same as training, get the 7 regions basin ID for testing
# Define root directory of database and output # Modify this based on your own location rootDatabase = os.path.join(os.path.sep, absRoot, 'scratch', 'SNTemp') # dataset root directory: rootOut = os.path.join(os.path.sep, absRoot, 'TempDemo', 'FirstRun') # Model output root directory: forcing_path = os.path.join(os.path.sep, rootDatabase, 'Forcing', 'Forcing_new', 'no_dam_forcing_60%_days118sites.feather') # forcing_data = [] #pd.read_feather(forcing_path) attr_path = os.path.join(os.path.sep, rootDatabase, 'Forcing', 'attr_new', 'no_dam_attr_temp60%_days118sites.feather') attr_data = [] #pd.read_feather(attr_path) camels.initcamels( forcing_data, attr_data, TempTarget, rootDatabase ) # initialize three camels module-scope variables in camels.py: dirDB, gageDict, statDict # Define all the configurations into dictionary variables # three purposes using these dictionaries. 1. saved as configuration logging file. 2. for future testing. 3. can also # be used to directly train the model when interfaceOpt == 0 # define dataset optData = default.optDataCamels optData = default.update(optData, tRange=Ttrain, target='StreamTemp', doNorm=[True, True]) # Update the training period # define model and update parameters if torch.cuda.is_available(): optModel = default.optLstm else: