losses in BPM

Issue #23 resolved
Former user created an issue

I think the current BPM has a loss filter (supergaussian) on the edges of the propagation window. Users that are not aware of it might wonder why their field are lossy. At least we ran into this problem. It should be optional to have these absorbing windows, BR Tom

Comments (2)

  1. LUIS MIGUEL SANCHEZ BREA repo owner

    Thank you very much for your suggestion. I have included a new parameter in BPM and WPM algorithms to add or not the edges of the propagation window. I show you an example:

    from diffractio import degrees, eps, mm, um
    from diffractio import np, plt, sp
    from diffractio.scalar_fields_XZ import Scalar_field_XZ
    from diffractio.scalar_masks_X import Scalar_mask_X
    from diffractio.scalar_masks_XZ import Scalar_mask_XZ
    from diffractio.scalar_sources_X import Scalar_source_X
    
    from matplotlib import rcParams
    rcParams['figure.figsize']=[8,6]
    rcParams['figure.dpi']=250
    
    x0 = np.linspace(-20 * um, 20 * um, 1024)
    z0 = np.linspace(-20 * um, 30 * um, 1024)
    wavelength = 0.6238 * um
    
    u0 = Scalar_source_X(x=x0, wavelength=wavelength)
    u0.plane_wave(A=1, theta=0 * degrees)
    
    u1 = Scalar_mask_XZ(x=x0, z=z0, wavelength=wavelength)
    u1.incident_field(u0)
    
    u1.sphere(r0=(0,0), radius=10*um, refraction_index=1.5)
    u1.draw_refraction_index(scale='scaled');
    

    u1.clear_field()
    u1.BPM(has_edges=False);
    u1.draw(logarithm=1e1, draw_borders=True)
    

    u1.clear_field()
    u1.BPM(has_edges=True);
    u1.draw(logarithm=1e1, draw_borders=True);
    

    u1.clear_field()
    u1.WPM(has_edges=False);
    u1.draw(logarithm=1e1, draw_borders=True);
    

    u1.clear_field()
    u1.WPM(has_edges=True);
    u1.draw(logarithm=1e1, draw_borders=True);
    

  2. Log in to comment