Created
February 25, 2016 18:02
-
-
Save dgergel/4d471e6900ac9699e275 to your computer and use it in GitHub Desktop.
A few small functions:
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 | |
''' | |
ds_timeslice = ds.sel(time=slice(start_time, end_time)) | |
return(ds_timeslice) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment