function J=ssec(nbase)
%function J=ssec(nbase)
% ssec color table
%
% Nicked from ncview
%

if nargin < 1
   nbase = size(get(gcf,'colormap'),1);
end
rgb = [ ...
    3.8400000e+01,  2.5600000e+01,  7.6800000e+01, ...
    3.8400000e+01,  2.5600000e+01,  7.6800000e+01, ...
    3.8400000e+01,  2.5600000e+01,  7.6800000e+01, ...
    3.8400000e+01,  2.5600000e+01,  7.6800000e+01, ...
    3.8400000e+01,  2.5600000e+01,  7.6800000e+01, ...
    3.8400000e+01,  2.5600000e+01,  7.6800000e+01, ...
    3.8400000e+01,  2.5600000e+01,  7.6800000e+01, ...
    3.8400000e+01,  2.5600000e+01,  7.6800000e+01, ...
    3.8400000e+01,  2.8444444e+01,  7.6800000e+01, ...
    3.8400000e+01,  3.2000000e+01,  7.6800000e+01, ...
    3.8400000e+01,  3.5555556e+01,  7.6800000e+01, ...
    3.9111111e+01,  3.9111111e+01,  7.6800000e+01, ...
    4.2666667e+01,  4.2666667e+01,  7.6800000e+01, ...
    4.6222222e+01,  4.6222222e+01,  7.6800000e+01, ...
    4.9777778e+01,  4.9777778e+01,  7.6800000e+01, ...
    5.3333333e+01,  5.3333333e+01,  7.6800000e+01, ...
    5.6888889e+01,  5.6888889e+01,  7.9555556e+01, ...
    6.0444444e+01,  6.0444444e+01,  8.4444444e+01, ...
    6.4000000e+01,  6.4000000e+01,  8.9333333e+01, ...
    6.7555556e+01,  6.7555556e+01,  9.4222222e+01, ...
    7.1111111e+01,  7.1111111e+01,  9.9111111e+01, ...
    7.4666667e+01,  7.4666667e+01,  1.0400000e+02, ...
    7.8222222e+01,  7.8222222e+01,  1.0888889e+02, ...
    8.1777778e+01,  8.1777778e+01,  1.1377778e+02, ...
    8.5333333e+01,  8.6666667e+01,  1.1733333e+02, ...
    8.8888889e+01,  9.1555556e+01,  1.2088889e+02, ...
    9.2444444e+01,  9.6444444e+01,  1.2444444e+02, ...
    9.6000000e+01,  1.0133333e+02,  1.2800000e+02, ...
    9.9555556e+01,  1.0622222e+02,  1.3155556e+02, ...
    1.0311111e+02,  1.1111111e+02,  1.3511111e+02, ...
    1.0666667e+02,  1.1600000e+02,  1.3866667e+02, ...
    1.1022222e+02,  1.2088889e+02,  1.4222222e+02, ...
    1.1377778e+02,  1.2577778e+02,  1.4577778e+02, ...
    1.1733333e+02,  1.3066667e+02,  1.4933333e+02, ...
    1.2088889e+02,  1.3555556e+02,  1.5288889e+02, ...
    1.2444444e+02,  1.4044444e+02,  1.5644444e+02, ...
    1.2800000e+02,  1.4533333e+02,  1.6000000e+02, ...
    1.3155556e+02,  1.5022222e+02,  1.6355556e+02, ...
    1.3511111e+02,  1.5511111e+02,  1.6711111e+02, ...
    1.3866667e+02,  1.6000000e+02,  1.7066667e+02, ...
    1.4222222e+02,  1.6488889e+02,  1.7422222e+02, ...
    1.4577778e+02,  1.6977778e+02,  1.7777778e+02, ...
    1.4933333e+02,  1.7466667e+02,  1.8133333e+02, ...
    1.5288889e+02,  1.7955556e+02,  1.8488889e+02, ...
    1.5644444e+02,  1.8444444e+02,  1.8844444e+02, ...
    1.6000000e+02,  1.8933333e+02,  1.9200000e+02, ...
    1.6355556e+02,  1.9422222e+02,  1.9555556e+02, ...
    1.6711111e+02,  1.9911111e+02,  1.9911111e+02, ...
    1.7266667e+02,  2.0266667e+02,  2.0266667e+02, ...
    1.7822222e+02,  2.0622222e+02,  2.0622222e+02, ...
    1.8377778e+02,  2.0977778e+02,  2.0977778e+02, ...
    1.8933333e+02,  2.1333333e+02,  2.1333333e+02, ...
    1.9488889e+02,  2.1688889e+02,  2.1688889e+02, ...
    2.0044444e+02,  2.2044444e+02,  2.2044444e+02, ...
    2.0600000e+02,  2.2400000e+02,  2.2400000e+02, ...
    2.1155556e+02,  2.2755556e+02,  2.2755556e+02, ...
    2.1711111e+02,  2.3111111e+02,  2.3111111e+02, ...
    2.2266667e+02,  2.3466667e+02,  2.3466667e+02, ...
    2.2822222e+02,  2.3822222e+02,  2.3822222e+02, ...
    2.3377778e+02,  2.4177778e+02,  2.4177778e+02, ...
    2.3933333e+02,  2.4533333e+02,  2.4533333e+02, ...
    2.4488889e+02,  2.4888889e+02,  2.4888889e+02, ...
    2.5044444e+02,  2.5244444e+02,  2.5244444e+02 ] ;

rgb=reshape(rgb,3,prod(size(rgb))/3);
rgb=rgb/256.;
ncol=size(rgb,2);



J=[];
for i=1:nbase
   rind=(ncol-1)*(i-1)/(nbase-1);
   l0=max(1,min(floor(rind)+1,ncol-1));
   l1=l0+1;
   w0=l1-1-rind;
   w1=1.-w0;

   r=w0*rgb(1,l0)+w1*rgb(1,l1);
   g=w0*rgb(2,l0)+w1*rgb(2,l1);
   b=w0*rgb(3,l0)+w1*rgb(3,l1);
   J=[J ; r g b];
   %disp([num2str(i) ' '  num2str(rind) ' '  num2str(l0) ' '  num2str(w0) ])
end
