function dec_year = yyyyddd_to_decyear(yyyyddd)
% Seth Bushinsky 2008

dec_year = zeros(length(yyyyddd),1);
for j = 1:length(yyyyddd)
    
year = num2str(yyyyddd(j));
year = str2double(year(1:4));

day = num2str(yyyyddd(j));
day = str2double(day(5:7));

t = isleapyear(year);
if t==t,
    dec_year(j) = year + day./366;
else
    dec_year(j) = year + day./365;
end
    
end
end