Python Forum

Full Version: Starter programing using Pyton for Madagascar software.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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"
repost/edit your post to fix indentation and use python tags