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
# install packages not already on impactlab server | |
# !pip install xclim | |
# ! pip install cdsapi | |
%matplotlib inline | |
import xarray as xr | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import os |
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 slice_dataset_space(ds_array, ds_to_slice): | |
''' | |
slices second Dataset to fit first Dataset | |
''' | |
swe_mask_align, array_align = xray.align(ds_array, ds_to_slice, join='inner', copy=False) | |
return(array_align) | |
def slice_dataset_time(ds, start_time, end_time): | |
''' | |
slices dataset with start and end times |