Welcome, Guest
Username: Password: Remember me

TOPIC: convertSELAFIN.PY

convertSELAFIN.PY 4 years 7 months ago #35676

  • taoan
  • taoan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 52
  • Thank you received: 9
Yes, my mesh is on south hemisphere. You can check it on this print of my mesh on qgis.



I don't know how this python script works, but I think this could be a programation problem.

If you check this post you can see that bluekenue does not work for file on south hemisphere

www.opentelemac.org/index.php/community-...tm-shape-files#14733
The administrator has disabled public write access.

convertSELAFIN.PY 4 years 7 months ago #35677

  • taoan
  • taoan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 52
  • Thank you received: 9
sorry again, this is my qgis print on south hemisphere

qgis.gif
The administrator has disabled public write access.

convertSELAFIN.PY 4 years 7 months ago #35678

  • taoan
  • taoan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 52
  • Thank you received: 9
Another thing to check is the github site of original script author Tobias.Bieniek

github.com/Turbo87/utm


github.gif



There is two parameters UTM ZONE "NUMBER" AND "LETTER"

Why do not use it on telemac script?
The administrator has disabled public write access.

convertSELAFIN.PY 4 years 7 months ago #35679

  • Jose_filho
  • Jose_filho's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 42
  • Thank you received: 2
Hi,

Have you tried to use "northern=false"?
utm.to_latlon(east,north,zone_number=24,northern=False)

Hope it helps,

José
The administrator has disabled public write access.

convertSELAFIN.PY 4 years 7 months ago #35680

  • taoan
  • taoan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 52
  • Thank you received: 9
Hello José,

I don't know how to use this option "northern=false" directly on command line for runSELAFIN.py

Do you have any idea?

The unique parameter option that I can use is zone number 24.

runSELAFIN.py alter --utm2ll 24 "C:\Users\USUARIO\Downloads\bts3d-v7.slf" "C:\Users\USUARIO\Downloads\bts3d-v7-latlon.slf"

The script presupposes that I'm on north hemisphere, but this false.

Thank you for your help!

Taoan
The administrator has disabled public write access.

convertSELAFIN.PY 4 years 7 months ago #35683

  • PMV
  • PMV's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 149
  • Thank you received: 42
Hi Taoan,

I looked at the python code, you seem to be right that it only works for northern hemisphere, maybe one of the developers can confirm.

"northern=false" option is for the utm package of python, which is not used in the runSELAFIN.py file you call in the commandline.

You could change the code of convertUTM.py that is called by runSELAFIN.py, but this would require some programming.

I'm not familiar with QGIS, but can't you convert latlon in QGIS?

I know it's not the answer to your question, but I hope it clarifies the working a bit.

Patrick
The administrator has disabled public write access.

convertSELAFIN.PY 4 years 7 months ago #35686

  • taoan
  • taoan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 52
  • Thank you received: 9
Hello Patrick,

Yes, my conclusion is the same yours.

Unfortunately QGIS has few functionalities for Selafin, I think it is able "for read" only.

I'm not a python expert, but I'm trying change the code of convertUTM.py to turn it able for work on south hemisphere... I believe this is my best option for a while :/

Thank you very much for your support.

Taoan
The administrator has disabled public write access.

convertSELAFIN.PY 4 years 7 months ago #35687

  • taoan
  • taoan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 52
  • Thank you received: 9
Hello guys,

I found a solution!

Just change the line 120 of convertUTM.py

#if zone_letter < 'N': northing -= 10000000

to

northing -= 10000000

It is working for south now.


bluekenue.gif



This is my code edited for testing



Cheers
The administrator has disabled public write access.

convertSELAFIN.PY 4 years 7 months ago #35688

  • taoan
  • taoan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 52
  • Thank you received: 9

File Attachment:

File Name: convertUTM_south.py
File Size: 8 KB
The administrator has disabled public write access.

convertSELAFIN.PY 4 years 7 months ago #35692

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Hi,

I am going to update the script so it can work with both.
Could send me your mesh so I can add it as an example/validation for the script ?
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.
Moderators: borisb

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