Skip to content

Block the beam branch with specific beam index#21

Open
lyuqinshu wants to merge 1 commit intoUMassIonTrappers:mainfrom
lyuqinshu:beam_block
Open

Block the beam branch with specific beam index#21
lyuqinshu wants to merge 1 commit intoUMassIonTrappers:mainfrom
lyuqinshu:beam_block

Conversation

@lyuqinshu
Copy link
Copy Markdown

In the original package there is no way of controlling the beam propagation

from PyOpticL import layout, optomech
import FreeCAD as App

base_dx = 200
base_dy = 200
base_dz = 100
gap = 3
inch = layout.inch
spacing = 25

def demo_layout(x=0, y=0, angle=0):
    bp = layout.baseplate(
        base_dx, base_dy, base_dz,
        x=x, y=y, angle=angle,
        gap=gap, optics_dz = 50,
        name="demo",
        label="demo",
    )
    bp.metric = True
    layout.set_max_beam_index(1024)  

    beam = bp.add_beam_path(x=100, y=base_dy, angle=layout.cardinal['down'], color=(1.0, 0.0, 0.0))

    bp.place_element_along_beam("HWP1", optomech.waveplate, beam,
                                       beam_index=0b1, distance=50, angle=layout.cardinal['down'],
                                       mount_type=optomech.rotation_stage_rsp05)

    bp.place_element_along_beam("PBS1", optomech.cube_splitter, beam,
                                       beam_index=0b1, distance=50, angle=layout.cardinal['left'],
                                       mount_type=optomech.skate_mount)
                                                                                                         

    return bp

if __name__ == "__main__":
    demo_layout()
    layout.redraw()

This produces a beam that is split by the cube.

demo_no_block

Now with this patch you can turn off a specific branch. Add this after beam instantiation

beam.BlockedBeams = [0b10]

You can get pure reflection.
demo_block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant