Python Forum
Starter programing using Pyton for Madagascar software.
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Starter programing using Pyton for Madagascar software.
#1
lines = {'S':251,'R':782}

color = {'S':4, 'R':2}

for case in 'SR':

# X-Y geometry

Flow(case+'.asc','Line_001.%cPS' % case, '''awk 'NR > 20 {print $8, " ", $9}' ''')

Flow(case,case+'.asc', ''' echo in=$SOURCE data_format=ascii_float n1=2 n2=%d | dd form=native ''' % lines[case],stdin=0)

Plot(case, ''' scale dscale=0.001 | dd type=complex | graph symbol=* title=%c plotcol=%d min1=684 max1=705 min2=3837 max2=3842 ''' % (case,color[case]))

Plot('s118', 'S', ''' window n2=1 f2=118 | scale dscale=0.001 | dd type=complex | graph symbol=O wanttitle=n plotcol=3 symbolsz=4 plotfat=10 min1=684 max1=705 min2=3837 max2=3842 ''')

Result('SRO','R S s118','Overlay')

I have those lines and i have a very shallow knowledge in python, so if anyone would like to help me, first im going to say what i know:

*"lines" and "color" are the input variables and need to be defined.

*I don't understand very well the "for case in 'SR'"

*The "flow" and "Plot" and "Result" mean, the structure of that flows is "target, input, command".

Well, hope you can help me to understand the commands used in this example or if anyone did this example of madagascar that would be great.

Thanks a lot !!

PD: I get this lines from this Madagascar example "http://www.ahay.org/wikilocal/docs/Field_data_example.pdf"
Reply
#2
repost/edit your post to fix indentation and use python tags
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Help- converting file with pyton script eltomassito 6 3,433 Jul-02-2021, 05:29 PM
Last Post: snippsat
  Help- converting file with pyton script grinleon 3 2,603 Sep-23-2020, 11:48 AM
Last Post: grinleon
  Python Starter-Looking for help! PythonStarter55561 3 2,415 Feb-04-2020, 10:46 PM
Last Post: Marbelous
  first time pyton user - help with json korenron 4 2,901 May-06-2019, 11:35 AM
Last Post: korenron
  Python Application Starter MistakenGuru 3 3,990 May-27-2017, 07:18 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020