function template=template_generator(seed_values,time_vector,template_type,taper_template)
%description: makes template, either PSC-like (with or without taper) or gaussian
%called by: simulated_psc_in_noise
%calls: taperer
%notes: all temporal values in the inputs should be in terms of samples
    %taper_template(1) is negative is a special situation, a kind of non-taper, where abs(taper_template(1)) zeroes are prepended to the front of the template; if used, there is no additional tapering
%code confirmed date: jan 20, 2013 

if template_type == 1
    amplitude_scaler=seed_values(1);
    tau_rise=seed_values(2);
    tau_decay=seed_values(3);
    
    template=-1*amplitude_scaler*(1-exp(-time_vector/tau_rise)).*exp(-time_vector/tau_decay);
       
    if taper_template(1)<0;
        template=[zeros(1,abs(taper_template(1))) template];
    elseif taper_template(1) || taper_template(2)
       template=taperer(template,taper_template(1),taper_template(2)); 
    end
    
elseif template_type == 2
    peak_height=seed_values(1);
    center_time=seed_values(2);
    bell_width=seed_values(3);
    
    template=-1*peak_height*exp((-(time_vector-center_time).^2)./(2*bell_width^2));
end