<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def adjust_doy_calendar(source, target):
 """Interpolate from one set of dayofyear range to another calendar. Interpolate an array defined over a `dayofyear` range (say 1 to 360) to another `dayofyear` range (say 1 to 365). Parameters source : xarray.DataArray Array with `dayofyear` coordinates. target : xarray.DataArray Array with `time` coordinate. Returns ------- xarray.DataArray Interpolated source array over coordinates spanning the target `dayofyear` range. """

    doy_max_source = source.dayofyear.max()

    doy_max = infer_doy_max(target)
    if doy_max_source == doy_max:
        return source

    return _interpolate_doy_calendar(source, doy_max)