Hello,
I am trying to create a "BINARY WINDS FILE" from a existing SELAFIN file (to no start from scratch) with the help of Thomas Benson's Matlab routines.
Basically, I apply interpolated U and V wind velocities on the grid points and increment the timesteps. See simple Matlab code below:
load('wnd_export2.mat')
load('xy2_utm58s.xyz')
X=xy2_utm58s(:,1);
Y=xy2_utm58s(:,2);
%
n = telheadr('WACRES');
fid = telheadw(n,'new_wind_file.slf');
for i=1:length(time)
windut=squeeze(wind_u(:,:,i));
windvt=squeeze(wind_v(:,:,i));
Fu = scatteredInterpolant(X,Y,windut(:));
uq = Fu(n.XYZ(:,1),n.XYZ(:,2));
Fv = scatteredInterpolant(X,Y,windvt(:));
vq = Fv(n.XYZ(:,1),n.XYZ(:,2));
n.timestep=int32(i);
n.AT=int32((i-1)*3600);
n.RESULT(:,1)=int32(uq);
n.RESULT(:,2)=int32(vq);
fid = telstepw(n,fid);
end
fclose all;
I can read the new SELAFIN (the wind file) fine in Bluekenue but Tomawac only recognizes the last time step when I use it as "BINARY WINDS FILE" (with WINDS FILE FORMAT = 3).
I am not sure if the Group Tomawac is the most appropriate for this topic as it is more relevant to SELAFIN file characteristics. But in case, a Tomawac user who create its own wind file had come across this issue, I would be very grateful for any guidance.
With best regards,
Alexis