function ploterp(td,time,dirs,src)
if nargin<1, td=caltomjd([1990,1,1]); end
if nargin<2, time=(0:365*16+3)*86400; end
if nargin<3, dirs='K:\gps\erp'; end
if nargin<4, src='c04'; end

for n=1:length(time), erps(n,:)=readerp(td+time(n)/86400,dirs,src); end
erps(erps(:,1)==0,:)=nan;
erps(:,1:2)=erps(:,1:2)*180/pi*3600; % rad->"

labels={'Xp (")','Yp (")','UT1-UTC (sec)'};
gut('newfigg','','',[600,400]);
margin=[0.08,0.03,0.04,0.012];
for n=1:3
    if n<3, opts='nolabel'; else opts=''; end
    ggt('subplotv','',n,3,'taxis',td,'topts',opts,'xlim',[time(1),time(end)]/3600,...
        'margin',margin);
    plot(time/3600,erps(:,n),'.-');
    ylabel(labels{n});
    if n==1,
        title(['Earth Rotation Parameters (',src,') : ',tstr(td+time(1)/86400),...
               '-',tstr(td+time(end)/86400)]);
    end
end

function s=tstr(t)
ep=mjdtocal(t); s=sprintf('%04d/%02d/%02d %02d:%02d',ep(1:5));
