def _calendar_month_middles(year):
    """List of middle day of each month, used by Linke turbidity lookup"""
    # remove mdays[0] since January starts at mdays[1]
    # make local copy of mdays since we need to change
    # February for leap years
    mdays = np.array(calendar.mdays[1:])
    ydays = 365
    # handle leap years
    if calendar.isleap(year):
        mdays[1] = mdays[1] + 1
        ydays = 366
    middles = np.concatenate(
        [[-calendar.mdays[-1] / 2.0],  # Dec last year
         np.cumsum(mdays) - np.array(mdays) / 2.,  # this year
         [ydays + calendar.mdays[1] / 2.0]])  # Jan next year
    return middles
def _calendar_month_middles ( year ) : mdays = np . array ( calendar . mdays [ 1 : ] ) ydays = 365 if calendar . isleap ( year ) : mdays [ 1 ] = mdays [ 1 ] + 1 ydays = 366 middles = np . concatenate ( [ [ - calendar . mdays [ - 1 ] / 2.0 ] , np . cumsum ( mdays ) - np . array ( mdays ) / 2. , [ ydays + calendar . mdays [ 1 ] / 2.0 ] ] ) return middles
List of middle day of each month, used by Linke turbidity lookup