ocw/utils.py
def adjust_model_years_for_climatology_calculation(dataset_array):
    ''' Using the time length of the first element in the input dataset_array, 
        adjust years in the rest ofi the dataset_array so that every dataset ends in the same year.
    :param dataset_array: an array of OCW datasets
    '''
    slc = trim_dataset(dataset_array[0])
    obs_times = dataset_array[0].times[slc]
    for idata, dataset in enumerate(dataset_array[1:]):
        year_diff = obs_times[-1].year - dataset.times[-1].year    
        nt = dataset.times.size
        for it in np.arange(nt):
            dataset.times[it] = dataset.times[it].replace(year = dataset.times[it].year + year_diff)
    return dataset_array
 Using the time length of the first element in the input dataset_array, 
        adjust years in the rest ofi the dataset_array so that every dataset ends in the same year.
    :param dataset_array: an array of OCW datasets
    
Using the time length of the first element in the input dataset_array,
adjust years in the rest ofi the dataset_array so that every dataset ends in the same year.
Using the time length of the first element in the input dataset_array adjust years in the rest ofi the dataset_array so that every dataset ends in the same year .
def adjust_model_years_for_climatology_calculation(dataset_array):
    slc = trim_dataset(dataset_array[0])
    obs_times = dataset_array[0].times[slc]
    for idata, dataset in enumerate(dataset_array[1:]):
        year_diff = obs_times[-1].year - dataset.times[-1].year    
        nt = dataset.times.size
        for it in np.arange(nt):
            dataset.times[it] = dataset.times[it].replace(year = dataset.times[it].year + year_diff)
    return dataset_array
def adjust_model_years_for_climatology_calculation ( dataset_array ) : slc = trim_dataset ( dataset_array [ 0 ] ) obs_times = dataset_array [ 0 ] . times [ slc ] for idata , dataset in enumerate ( dataset_array [ 1 : ] ) : year_diff = obs_times [ - 1 ] . year - dataset . times [ - 1 ] . year nt = dataset . times . size for it in np . arange ( nt ) : dataset . times [ it ] = dataset . times [ it ] . replace ( year = dataset . times [ it ] . year + year_diff ) return dataset_array
Using the time length of the first element in the input dataset_array,
adjust years in the rest ofi the dataset_array so that every dataset ends in the same year.
Using the time length of the first element in the input dataset_array adjust years in the rest ofi the dataset_array so that every dataset ends in the same year .
''' Using the time length of the first element in the input dataset_array, 
        adjust years in the rest ofi the dataset_array so that every dataset ends in the same year.
    :param dataset_array: an array of OCW datasets
    '''
dataset_array
an array of OCW datasets
an array of OCW datasets