Formatting your data
In order to be used by nanotrappy
, the fields in the data folder have to have a specific formatting.
The names of the files don't matter nor their order.
Attention
The files must be numpy arrays stored in .npy files. The array must be done as follows
[![mode.npy = lmbda, x, y, z, E][1]][1]
where E is a 4-dimensional np.array of size **(3,len(x),len(y),len(z))**.
The first dimension corresponds to Ex, Ey and Ez.
The program will check all the .npy files in the specified folder, open them and store the first element (the wavelength) in a list. It will then compare it to the specified wavelengths for trapping to check is the modes are available.
Saving electric field simulations from nanotrappy pre-implemented structure¶
Create a Nanofiber with the right material, cladding and radius:
5 |
|
Define wavelengths used for trapping: we will have a red standing wave so only one is needed for the red-detuned beam and two blue-detuned beams slightly detuned from each other.
6 7 8 9 10 11 |
|
Then compute the actual fields in 3D and save them. Be careful, we should always save fields in 3D even if we computed them in a 2D plane. In that case the 3rd dimension should be set as an array of length 1 (see z here).
12 13 14 15 16 17 |
|