Subversion Repositories lagranto.wrf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 michaesp 1
 
2
function c_map = col_scale (dat_values,d_map);
3
 
4
% Handling of irregularly spaced color tables
5
 
6
% Init the label strings and output values
7
for i=1:length(dat_values)
8
  c_map.label(i) = cellstr(num2str(dat_values(i))); 
9
end
10
c_map.values=dat_values;
11
c_map.xtick=linspace(0,1,length(dat_values));
12
c_map.caxis=[ min(c_map.xtick) max(c_map.xtick) ];
13
 
14
% Get the transformation 
15
%pp=spline(dat_values,[ 0 c_map.xtick 0]);
16
pp = interp1(dat_values,c_map.xtick,'linear','pp');
17
 
18
% Scale the output array
19
c_map.data=d_map;
20
c_map.data( c_map.data < min(dat_values) ) = min(dat_values);
21
c_map.data( c_map.data > max(dat_values) ) = max(dat_values);
22
c_map.data = ppval(c_map.data,pp);
23
c_map.testx = linspace(min(c_map.values),max(c_map.values),100);
24
c_map.testy = ppval(c_map.testx,pp);
25
 
26
 
27
 
28