# Running a script as though you had typed it at the command line is # simple. Just type execfile('intro_script.py') and this script will # fire off. # # execfile('intro_script_2.py') # # This version illustrates one way to script CASA reduction: place a # bunch of control flow and tuning parameters at the top of a file and # then put your code below. You can then tune these parameters and # execute the script, which will proceed in the tuned way you have # prescribed. # &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&% # CONTROL FLOW # &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&% do_step_a = True do_step_b = False do_step_c = True var1 = 1.0 var2 = "Name." # &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&% # CODE # &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&% # this is the same as if do_step_a==True if do_step_a: print "Step A executing." print var1**2 print "..." if do_step_b: print "Step B executing." print var1**3 print "\n" print "..." if do_step_c: print "Step C executing" print var2