Welcome, Guest
Username: Password: Remember me

TOPIC: convertSELAFIN.PY

convertSELAFIN.PY 5 years 5 months ago #33637

  • sanaz
  • sanaz's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 69
  • Thank you received: 1
Hello,
I am trying to convert HYCOMdata selafin file to UTM coordinates to get the same geographic system than my TELEMAC model.I have both t2d_hycom-2m.slf and t3d_hycom-2m.slf
what do I need to write as an argument in the command window to run the script?

Thanks in advance,
Sanaz
The administrator has disabled public write access.

convertSELAFIN.PY 5 years 5 months ago #33644

  • sanaz
  • sanaz's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 69
  • Thank you received: 1
Hello,
I could run the script by using an argument:
runSELAFIN.py alter --ll2utm LL2UTM t2d_hycom_2018-10-15_15days.slf t3d_hycom_2018-10-15_15days.slf
However, it is giving me the following error:


Interpreting command line options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Altering t2d_hycom_2018-10-15_15days.slf within C:\opentelemac-mascaret\v8p0r2\scripts\python27
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Traceback (most recent call last):
File "C:\opentelemac-mascaret\v8p0r2\scripts\python27\runSELAFIN.py", line 1208, in <module>
main()
File "C:\opentelemac-mascaret\v8p0r2\scripts\python27\runSELAFIN.py", line 903, in main
zone = int(options.ll2utm)
ValueError: invalid literal for int() with base 10: 'LL2UTM'



Your help is very much appreciated,
Sanaz
The administrator has disabled public write access.

convertSELAFIN.PY 5 years 5 months ago #33645

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
you should give the UTM value of your model in order to convert the values in the appropriate coordinates
Christophe
The administrator has disabled public write access.
The following user(s) said Thank You: sanaz

convertSELAFIN.PY 5 years 5 months ago #33646

  • sanaz
  • sanaz's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 69
  • Thank you received: 1
Thank you so much for your quick reply.
how can I give the UTM value? in the scripts or in the cammand window scripts?

Thanks a lot.
The administrator has disabled public write access.

convertSELAFIN.PY 5 years 5 months ago #33647

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
in place of LL2UTM as indicate
Christophe
The administrator has disabled public write access.
The following user(s) said Thank You: sanaz

convertSELAFIN.PY 4 years 7 months ago #35671

  • taoan
  • taoan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 52
  • Thank you received: 9
Dear c.coulet,

Can you give me some help how to use the converter utm2ll in south hemisphere?

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

I get this error ... Zone number out of range (must be between 1 and 60)


Or if I use runSELAFIN.py alter --utm2ll 24S "C:\Users\USUARIO\Downloads\bts3d-v7.slf" "C:\Users\USUARIO\Downloads\bts3d-v7-latlon.slf"

I get this error... zone = int(options.utm2ll)
ValueError: invalid literal for int() with base 10: '24S'

Is there some parameter that I'm missing?

Any help will be very appreciated.

With best regards,

Taoan
The administrator has disabled public write access.

convertSELAFIN.PY 4 years 7 months ago #35672

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

Your first error message says:
Zone number out of range (must be between 1 and 60)

So you should use '24'.

Patrick
The administrator has disabled public write access.

convertSELAFIN.PY 4 years 7 months ago #35673

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

Yes you are right, however my question is related with a hemisphere setting problem.

I tried to use '24', but If you look at this attached bluekenue print you can se that the script is putting my mesh coordinates on north hemisphere. I also attached my selafin file for you test it.





File Attachment:

File Name: bts3d-v7.slf
File Size: 757 KB


I believe that the script need some parameter setting to calculate coordinates on zone UTM 24 south.

Thank you for your help.

With best regards,

Taoan
The administrator has disabled public write access.

convertSELAFIN.PY 4 years 7 months ago #35674

  • taoan
  • taoan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 52
  • Thank you received: 9
sorry, some problem with my print file


bluekenue.png
The administrator has disabled public write access.

convertSELAFIN.PY 4 years 7 months ago #35675

  • PMV
  • PMV's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 149
  • Thank you received: 42
Are you sure about you northing and easting in the first place?

Your UTM mesh is at 8 650 000 northing; 540 000 easting

The python code uses northing to determine whether its north or south,
maxnord = np.max(northing)
if maxnord < 0:
northing = northing - 10000000 # South and North

Hope that helps,

Patrick

PS you can transfer in BlueKenue by firth assigning the coordinate system under: properties->spatial and then apply the required projection
The administrator has disabled public write access.
Moderators: borisb

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