This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xcdat as xc | |
import xarray as xa | |
import glob | |
import zipfile | |
from osgeo import gdal | |
import numpy as np | |
import argparse | |
import os | |
def get_args(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calculate_kge(obs_data, model_data): | |
mean_obs = obs_data.mean(dim='time') | |
mean_model = model_data.mean(dim='time') | |
obs_std = obs_data.std(dim='time') | |
model_std = model_data.std(dim='time') | |
upper = (model_data-mean_model)*(obs_data-mean_obs) | |
upper = upper.sum(dim='time') | |
lower_x = np.square(model_data-mean_model) |