示例#1
0
def set_optics(v=None):
    el = []
    pp = []
    names = ['VFM', 'VFM_HFM', 'HFM', 'HFM_Watchpoint', 'Watchpoint', 'Watchpoint_Mask', 'Mask', 'Watchpoint2']
    for el_name in names:
        if el_name == 'VFM':
            # VFM: ellipsoidMirror 50.0m
            el.append(srwlib.SRWLOptMirEl(
                _p=v.op_VFM_p,
                _q=v.op_VFM_q,
                _ang_graz=v.op_VFM_ang,
                _size_tang=v.op_VFM_size_tang,
                _size_sag=v.op_VFM_size_sag,
                _nvx=v.op_VFM_nvx,
                _nvy=v.op_VFM_nvy,
                _nvz=v.op_VFM_nvz,
                _tvx=v.op_VFM_tvx,
                _tvy=v.op_VFM_tvy,
                _x=v.op_VFM_x,
                _y=v.op_VFM_y,
            ))
            pp.append(v.op_VFM_pp)
            
        elif el_name == 'VFM_HFM':
            # VFM_HFM: drift 50.0m
            el.append(srwlib.SRWLOptD(
                _L=v.op_VFM_HFM_L,
            ))
            pp.append(v.op_VFM_HFM_pp)
        elif el_name == 'HFM':
            # HFM: ellipsoidMirror 50.2m
            el.append(srwlib.SRWLOptMirEl(
                _p=v.op_HFM_p,
                _q=v.op_HFM_q,
                _ang_graz=v.op_HFM_ang,
                _size_tang=v.op_HFM_size_tang,
                _size_sag=v.op_HFM_size_sag,
                _nvx=v.op_HFM_nvx,
                _nvy=v.op_HFM_nvy,
                _nvz=v.op_HFM_nvz,
                _tvx=v.op_HFM_tvx,
                _tvy=v.op_HFM_tvy,
                _x=v.op_HFM_x,
                _y=v.op_HFM_y,
            ))
            pp.append(v.op_HFM_pp)
            
        elif el_name == 'HFM_Watchpoint':
            # HFM_Watchpoint: drift 50.2m
            el.append(srwlib.SRWLOptD(
                _L=v.op_HFM_Watchpoint_L,
            ))
            pp.append(v.op_HFM_Watchpoint_pp)
        elif el_name == 'Watchpoint':
            # Watchpoint: watch 50.4m
            pass
        elif el_name == 'Watchpoint_Mask':
            # Watchpoint_Mask: drift 50.4m
            el.append(srwlib.SRWLOptD(
                _L=v.op_Watchpoint_Mask_L,
            ))
            pp.append(v.op_Watchpoint_Mask_pp)
        elif el_name == 'Mask':
            # Mask: mask 50.6m
            el.append(srwlib.srwl_opt_setup_mask(
                _delta=v.op_Mask_delta,
                _atten_len=v.op_Mask_atten_len,
                _thick=v.op_Mask_thick,
                _grid_sh=v.op_Mask_grid_sh,
                _grid_dx=v.op_Mask_grid_dx,
                _grid_dy=v.op_Mask_grid_dy,
                _pitch_x=v.op_Mask_pitch_x,
                _pitch_y=v.op_Mask_pitch_y,
                _grid_nx=v.op_Mask_grid_nx,
                _grid_ny=v.op_Mask_grid_ny,
                _mask_Nx=v.op_Mask_mask_Nx,
                _mask_Ny=v.op_Mask_mask_Ny,
                _grid_angle=v.op_Mask_gridTiltAngle,
                _hx=v.op_Mask_hx,
                _hy=v.op_Mask_hy,
                _mask_x0=v.op_Mask_mask_x0,
                _mask_y0=v.op_Mask_mask_y0,
            ))
            pp.append(v.op_Mask_pp)
        elif el_name == 'Watchpoint2':
            # Watchpoint2: watch 50.6m
            pass
    pp.append(v.op_fin_pp)
    return srwlib.SRWLOptC(el, pp)
示例#2
0
def set_optics(v=None):
    el = []
    pp = []
    names = [
        'VFM', 'VFM_HFM', 'HFM', 'HFM_Watchpoint', 'Watchpoint',
        'Watchpoint_Mask', 'Mask', 'Watchpoint2'
    ]
    for el_name in names:
        if el_name == 'VFM':
            # VFM: ellipsoidMirror 50.0m
            el.append(
                srwlib.SRWLOptMirEl(
                    _p=v.op_VFM_p,
                    _q=v.op_VFM_q,
                    _ang_graz=v.op_VFM_ang,
                    _size_tang=v.op_VFM_size_tang,
                    _size_sag=v.op_VFM_size_sag,
                    _nvx=v.op_VFM_nvx,
                    _nvy=v.op_VFM_nvy,
                    _nvz=v.op_VFM_nvz,
                    _tvx=v.op_VFM_tvx,
                    _tvy=v.op_VFM_tvy,
                    _x=v.op_VFM_x,
                    _y=v.op_VFM_y,
                ))
            pp.append(v.op_VFM_pp)

        elif el_name == 'VFM_HFM':
            # VFM_HFM: drift 50.0m
            el.append(srwlib.SRWLOptD(_L=v.op_VFM_HFM_L, ))
            pp.append(v.op_VFM_HFM_pp)
        elif el_name == 'HFM':
            # HFM: ellipsoidMirror 50.2m
            el.append(
                srwlib.SRWLOptMirEl(
                    _p=v.op_HFM_p,
                    _q=v.op_HFM_q,
                    _ang_graz=v.op_HFM_ang,
                    _size_tang=v.op_HFM_size_tang,
                    _size_sag=v.op_HFM_size_sag,
                    _nvx=v.op_HFM_nvx,
                    _nvy=v.op_HFM_nvy,
                    _nvz=v.op_HFM_nvz,
                    _tvx=v.op_HFM_tvx,
                    _tvy=v.op_HFM_tvy,
                    _x=v.op_HFM_x,
                    _y=v.op_HFM_y,
                ))
            pp.append(v.op_HFM_pp)

        elif el_name == 'HFM_Watchpoint':
            # HFM_Watchpoint: drift 50.2m
            el.append(srwlib.SRWLOptD(_L=v.op_HFM_Watchpoint_L, ))
            pp.append(v.op_HFM_Watchpoint_pp)
        elif el_name == 'Watchpoint':
            # Watchpoint: watch 50.4m
            pass
        elif el_name == 'Watchpoint_Mask':
            # Watchpoint_Mask: drift 50.4m
            el.append(srwlib.SRWLOptD(_L=v.op_Watchpoint_Mask_L, ))
            pp.append(v.op_Watchpoint_Mask_pp)
        elif el_name == 'Mask':
            # Mask: mask 50.6m
            el.append(
                srwlib.srwl_opt_setup_mask(
                    _delta=v.op_Mask_delta,
                    _atten_len=v.op_Mask_atten_len,
                    _thick=v.op_Mask_thick,
                    _grid_sh=v.op_Mask_grid_sh,
                    _grid_dx=v.op_Mask_grid_dx,
                    _grid_dy=v.op_Mask_grid_dy,
                    _pitch_x=v.op_Mask_pitch_x,
                    _pitch_y=v.op_Mask_pitch_y,
                    _grid_nx=v.op_Mask_grid_nx,
                    _grid_ny=v.op_Mask_grid_ny,
                    _mask_Nx=v.op_Mask_mask_Nx,
                    _mask_Ny=v.op_Mask_mask_Ny,
                    _grid_angle=v.op_Mask_gridTiltAngle,
                    _hx=v.op_Mask_hx,
                    _hy=v.op_Mask_hy,
                    _mask_x0=v.op_Mask_mask_x0,
                    _mask_y0=v.op_Mask_mask_y0,
                ))
            pp.append(v.op_Mask_pp)
        elif el_name == 'Watchpoint2':
            # Watchpoint2: watch 50.6m
            pass
    pp.append(v.op_fin_pp)
    return srwlib.SRWLOptC(el, pp)
示例#3
0
def set_optics(v=None):
    el = []
    # VFM: ellipsoidMirror 50.0m
    el.append(
        srwlib.SRWLOptMirEl(_p=50.0,
                            _q=0.4,
                            _ang_graz=0.003,
                            _size_tang=0.2,
                            _size_sag=0.01,
                            _nvx=0.0,
                            _nvy=0.999995500003,
                            _nvz=-0.0029999955,
                            _tvx=0.0,
                            _tvy=-0.0029999955,
                            _x=0.0,
                            _y=0.0))

    el.append(srwlib.SRWLOptD(0.2))
    # HFM: ellipsoidMirror 50.2m
    el.append(
        srwlib.SRWLOptMirEl(_p=50.0,
                            _q=0.2,
                            _ang_graz=0.003,
                            _size_tang=0.2,
                            _size_sag=0.01,
                            _nvx=0.999995500003,
                            _nvy=0.0,
                            _nvz=-0.0029999955,
                            _tvx=-0.0029999955,
                            _tvy=0.0,
                            _x=0.0,
                            _y=0.0))

    el.append(srwlib.SRWLOptD(0.2))
    # Watchpoint: watch 50.4m

    el.append(srwlib.SRWLOptD(0.2))
    # Mask: mask 50.6m
    el.append(
        srwlib.srwl_opt_setup_mask(_delta=1.0,
                                   _atten_len=1.0,
                                   _thick=1.0,
                                   _grid_sh=0,
                                   _grid_dx=5e-06,
                                   _grid_dy=5e-06,
                                   _pitch_x=2e-05,
                                   _pitch_y=2e-05,
                                   _grid_nx=21,
                                   _grid_ny=21,
                                   _mask_Nx=1024,
                                   _mask_Ny=1024,
                                   _grid_angle=0.436332312999,
                                   _hx=7.32e-07,
                                   _hy=7.32e-07,
                                   _mask_x0=0.0,
                                   _mask_y0=0.0))
    # Watchpoint: watch 50.6m

    pp = []
    # VFM
    pp.append([
        0, 0, 1.0, 0, 0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
        0.0
    ])
    pp.append([
        0, 0, 1.0, 1, 0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
        0.0
    ])
    # HFM
    pp.append([
        0, 0, 1.0, 0, 0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
        0.0
    ])
    pp.append([
        0, 0, 1.0, 1, 0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
        0.0
    ])
    # Watchpoint
    pp.append([
        0, 0, 1.0, 1, 0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
        0.0
    ])
    # Mask
    pp.append([
        0, 0, 1.0, 0, 0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
        0.0
    ])
    # Watchpoint
    # final post-propagation
    pp.append([
        0, 0, 1.0, 0, 0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
        0.0
    ])
    return srwlib.SRWLOptC(el, pp)