Welcome, Guest
Username: Password: Remember me

TOPIC: Merging 2 results file same place but with different time of simulat

Merging 2 results file same place but with different time of simulat 6 years 6 months ago #29972

  • Spinel
  • Spinel's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 25
Good morning,

This topic is about merging two results files for the same place but with different simulation dates.
In details, let say that we have
Results1.slf from 0 to 1000s
Results2.slf from 1000s to 2000s (continuation from the previous with restart option)

Is there a way to generate a ResultsGlobal.slf that would contain simulation from 0 to 2000s?

(within the view to facilitate the simulation analysis(Water level time series a some location, water extension, water volume, ....)

Any advice is welcome :)
The administrator has disabled public write access.

Merging 2 results file same place but with different time of simulat 6 years 6 months ago #29975

  • jescobar
  • jescobar's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 22
  • Thank you received: 2
Hello,

If you have Matalab, or access to a pc with it, you can use the Matlab- Telemac tools.

nl.mathworks.com/matlabcentral/fileexchange/25021-telemac-tools

With them you can script the merging of your files. As an example of how these tools work, here is a script I use to cut portions of simulations that go wrong.
clear all
clc
%%
%---------------------------------------------------
% SLICE SELAFIN FILES
% useful if a simulation started giving bad
% results after certain timestep, then I slice
% only the good portion of the result file
%---------------------------------------------------

% File you want to slice
sim_file = 'SISRES';
% Initial timestep
dti = 1;
% Final Timestep
dtf = 5184;
% Name you want for result file
res_file = 'Cont_SISRES.sel';

%% Loop to go through timesteps of the SLF file
m = telheadr(sim_file);
fid = telheadw(m,res_file);
for i=dti:dtf
    m = telstepr(m,i);
    fid = telstepw(m,fid);
end
fclose(m.fid);
fclose(fid);




Regards,

Sebastian
The administrator has disabled public write access.
The following user(s) said Thank You: Spinel

Merging 2 results file same place but with different time of simulat 6 years 6 months ago #29993

  • Spinel
  • Spinel's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 25
Goodmorning Jescobar,

effectively it works.
As I had an issue with the telstepr function. I need to open/close every loop step. Anyway it works.

In attachment, I put the script.

Thank you.

File Attachment:

File Name: SelafinMerge.txt
File Size: 1 KB
The administrator has disabled public write access.
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.