Hi Patricia,
I do not know exactly what you want to modify, but there should be several ways (e.g. using a Fortran subroutine, a Python script or a software like BlueKenue).
If you want to use Python scripts, you can try
PyTelTools.
To remove a variable, you can use the command line script
cli/slf_base.py or simply use
Extract Variables from the GUI (in the so-called classic interface).
After having installed PyTelTools, you can define also your own script and do some complex modification.
Here is an example in case you want to modify some variables for each frame (or time).
import numpy as np
from pyteltools.slf import Serafin
in_slf = 'r3d.slf'
out_slf = 'r3d_new.slf'
LANG = 'fr' # Change to 'en' if variables are written in english
with Serafin.Read(in_slf, LANG) as resin:
resin.read_header()
print(resin.header.summary())
resin.get_time()
output_header = resin.header.copy()
values = np.empty((output_header.nb_var, output_header.nb_nodes), dtype=output_header.np_float_type)
with Serafin.Write(out_slf, LANG) as resout:
resout.write_header(output_header)
for time_index, time in enumerate(resin.time):
print('Frame %i: time %ds' % (time_index, time))
for i, var_ID in enumerate(output_header.var_IDs):
print('Variable: %s' % var_ID)
values[i, :] = resin.read_var_in_frame(time_index, var_ID)
# Do you modification by position
if var_ID == 'W': # Modify W velocity (beware that LANG variable is ok)
values[i, :] = values[i, :]/10
if i == 1: # Modify second variable (Python is using 0-indexed iterator)
values[i, :] = -2.0
resout.write_entire_frame(output_header, time, values)
Hope it helps.
Regards,
Luc