~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to bin/examples/optics_examples/match_step_4_beta_function.py

  • Committer: Chris Rogers
  • Date: 2014-04-16 11:48:45 UTC
  • mfrom: (707 merge)
  • mto: This revision was merged to the branch mainline in revision 711.
  • Revision ID: chris.rogers@stfc.ac.uk-20140416114845-h3u3q7pdcxkxvovs
Update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
460
460
    make_root_legend(bz_canvas, [bz_graph_1, bz_graph_2], 0.15, 0.15, 0.5, 0.4)
461
461
    make_root_legend(beta_canvas, [beta_graph_1, beta_graph_2],
462
462
                                                          0.15, 0.15, 0.5, 0.35)
463
 
    beta_canvas.Print(lattice_optimiser.lattice.plot_file('beta_vs_z'))
464
 
    bz_canvas.Print(lattice_optimiser.lattice.plot_file('bz_vs_z'))
 
463
 
 
464
    lattice = lattice_optimiser.lattice
 
465
    beta_canvas.Print(lattice.plot_file('beta_vs_z'))
 
466
    bz_canvas.Print(lattice.plot_file('bz_vs_z'))
 
467
    
 
468
    ellipse_start = lattice.transport_covariance_matrix(-2900.)
 
469
    beta_start = lattice.get_beta(ellipse_start)
 
470
    ellipse_end = lattice.transport_covariance_matrix(2900.)
 
471
    beta_end = lattice_optimiser.lattice.get_beta(ellipse_end)
 
472
    print "beta at start is ", beta_start, "mm"
 
473
    print "beta at end is  ", beta_end, "mm"
465
474
 
466
475
    print "Finished - press <Enter> to end"
467
476
    raw_input()