Welcome, Guest
Username: Password: Remember me

TOPIC: How to replace 'BOTTOM' values for geometry selafin file?

How to replace 'BOTTOM' values for geometry selafin file? 9 years 6 months ago #16818

  • chokudan
  • chokudan's Avatar
Hello users

I've been tring to modify the bottom value using python script.

In oder to chagne the depth in some nodes.

First, I extract the bottom value from geometry file using python script.

Second, I modified depths of some nodes with same array 'BOTTOM' values

And then, I want to create selafin file, How can do it?

I think, the simplest method is to replace only 'BOTTOM' values

because the other values are equal

Could help me, please? I'm python beginner.

Thnak you

--- script sample here ----

filename = "geometry.slf"
slf = SELAFIN(filename)

var_names=[item.rstrip() for item in slf.VARNAMES]

x = slf.MESHX
y = slf.MESHY
z = np.squeeze(slf.getVariablesAt(0, [var_names.index('BOTTOM')]))

I wanat to replace 'BOTTOM' and write new SELAFIN file
The administrator has disabled public write access.

How to replace 'BOTTOM' values for geometry selafin file? 9 years 6 months ago #16901

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
Are you sure it won't be easier to change the bottom value with BK or Fudaa-Prepro?
If you're a python beginner, and as there is some easy solutions without programming requirements, it seems curious to choose the hardest way...

Hope this helps
Christophe
The administrator has disabled public write access.
Moderators: borisb

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