begin - create the initial field or diffractive wavefront.
begin allocates memory for a square array of complex numbers, fills it with values corresponding to a uniform distribution of intensity and phase (plane wave) and construct a standard Scilab variant which include the header (containing information about sampling/wavelength/timstamp/frame,etc) and the formed field structure to use in the Scilab enviorment.
the amount of RAM needed : More than one megabyte is needed for 256x256 grid, 4MB for 512x512,16MB for 1024x1024 and a really large system is necessary for 2048x2048. These numbers may be slightly different for different computers. Some filters allocate additional memory (up to 8 times of the basic data structure in the worst case), rising further the memory requirements. If RAM is not sufficient, the system will swap to the hard-disk, slowing down not only your job, but the whole computer. The 512x512 size is safe for the majority of Unix systems.
m=1; nm=1e-9*m; mm=1e-3*m; cm=1e-2*m; lambda=550*nm; sizes=5*mm; N1=32; N2=64; F1=begin(sizes,lambda); field_plot(F1); dwf_fits(F1,"file1"); F2=begin(sizes,lambda,N1); field_plot(F2); dwf_fits(F2,"file2"); F3=begin(sizes,lambda,N1,N2); field_plot(F3); dwf_fits(F3,"file3");
Chen jingyuan, Gan guangyong (IAPCM, China.)
create_field , interpol , sp_wave , pl_wave , start , emitter ,