SV3 2000 Sydney VisLab

Natures Finest Photonic Crystal

The Seamouse


Web Pages:

Visualisation Techniques

We only modelled a small part of the Brillouin zone for the seamouse hair structure. The Brillouin zone is the smallest symmetrically divisible component of space which can make up the hexagonal lattice structure. The picture below shows 2dn/lambda as the y-axis and k or the position in Brillouin zone of the structure as the x-axis. In relation to the whole structure the total band diagram is shown below so that the part we plotted may be put in perspective. The partial band diagram was made in avs and the total band diagram was plotted in MATLAB.

We made a visualisation of the lowest two bands and the band gap between them. The small part of the Brillouin zone we studied is shown in the partial band diagram below by the red and green lines.

The red and green line represent the travelling wave. The gap imbetween the two lines, the band gap, represents where no travelling waves should exist but where all light is reflected. The point imbetween where the travelling wave exist and the band gap starts is an interesting part, where the behaviour of the electric field is unknown and hence we have taken a larger number of values around the edges of this bad gap region. One of the interesting things about this visualisation is that it hasn't been done before, the sea mouse's photonic crystal properties were not known about until early this year and this would probably be one of the first visualisations of the way light is refracted through the structure.

The program which generated the datasets which we used in our visualisation was given to us by Ross McPhedran. Initially we intended to ftp the program down to vislab and use it there. However vislab did not have the same version of mathematica as the program we needed to use so some of the library files were missing. Since the program wouldn't run in vislab we generated the values on a computer in theoretical physics which did have Mathematica version 4.0 on it. This computer was unfortunately slow. It took about 5 minutes for the program to take its course and write the output dataset which we used to generate each frame. We could have either made interpolated images which were the average of its two neighbouring frames to increase the number of frames which would not be scientifically accurate since the movement of the set was unpredictable at times, or simply generate as many datasets as we had time for which is what we ended up doing. The more datasets we had the better quality our animation would be so I spent a lot of time generating the 127 datasets at 5 minutes per frame, rounding off to about 10 hours worth of generating datasets before visualising was started. This was one of the major problems in our visualisation as we started off with only 37 frames which gave a very jerky animation. The animation is quite smooth with 127 frames until you reach the end frames of the upper band which have a lot of interference from neighbouring bands, making the animation jump a huge amount for very small changes in wavelength. As an example I have included two neighbouring frames. The calculated difference in wavelength is just 0.006 nanometers which is a very small amount considering the wavelength is measured in hundreds of nanometers.


These results provide interesting patterns however and would require some further investigation to truly understand their origin.

Generating the Field Files

Field files are the link between a set of unformatted values from a dataset and reading them into AVS. To be able to read in the information to AVS we made several field files.

# AVS
#
ndim=2
dim1=60
dim2=60
nspace=2
veclen=2
field=uniform
data=float
variable 1 file=../seamousehex-00deg-10modes-015283.out filetype=ascii skip=6 stride=2 offset=0
variable 2 file=../seamousehex-00deg-10modes-015283.out filetype=ascii skip=6 stride=2 offset=1

This is the Field file used to interpret each of the 127 datasets generated by the mathematica program. As a quick interpretation of how the field file works, 'ndim' represents the number or dimensions. In this case we have two columns of data and hence two computational dimensions. Dim1 and dim2 represents the number of entries for each column. Nspace is the number of physical dimensions and 'veclen' gives the number of variables to read in. We want to read in the whole dataset so veclen =2. The field is uniform and the data is of type float. Each variable is then given a path and type. The filetype in this case is 'ascii' , 'skip' represents the number of bytes to skip before reading in data. This can be useful for files which have header information etc. Stride is the number of data points to skip after reading in a data point to get to the next data point. Offset represents the numbered column so that an offset of 0 is the first column of data and an offset of 1 is the second column of data. This enables AVS to read in the data. It remains up to the user to manipulate it into an understandable form.

Since their were 127 datasets which all required FIELD files and would require extra field files when new datasets had been generated it became necessary to have some way of automating the field file making process. Each field file was very similar except for the name of the file it was reading in so a perl script was written to automate the process. Nicole originally wrote the Perl script although we have altered it to generate the field file to our specifications. The script is shown below.

#!/usr/local/bin/perl
$J=0;
$K=1;

opendir(DIR,"."); 
while ( $file = readdir(DIR) )
	{
	$filenameList [$J]= $file;
	$J=$J+1;
	}
closedir(DIR);

mkdir("./FIELD/", 0755);

$size = scalar( @filenameList );
@filenameList = sort( @filenameList );

for( $I=$size-1; $I>=0; $I--)
	{
	if ($filenameList[$I] =~ /^seamousehex-00deg-10modes-/)
		{
		$fName = sprintf( "FIELD/s.%03d.fld", $K );
		open (OUT, ">$fName");

		print OUT "# AVS\n";
		print OUT "#\n";
		print OUT "ndim=2\n";
		print OUT "dim1=60\n";
		print OUT "dim2=60\n";
		print OUT "nspace=2\n";
		print OUT "veclen=2\n";
		print OUT "field=uniform\n";
		print OUT "data=float\n";
		print OUT "variable 1 file=../$filenameList[$I] filetype=ascii skip=6 stride=2 offset=0\n";
		print OUT "variable 2 file=../$filenameList[$I] filetype=ascii skip=6 stride=2 offset=1\n";
		$K++;
		}
	}

Basically this is just a loop which generates field files in descending numerical order based on the original file names until all datasets are generated. They are renamed according to the order they were generated and then placed in the FIELD directory for use in AVS.

The AVS network above was used to generate the components animation which shows the physical representation of the reflected wave, the imaginary part and the real part of the wave as the wavelength changes. The read field module reads in a field file which is generated separately for each dataset. The animate integer assigns a new incremented filename to each new image selected. The data set is two columns of real and imaginary numbers which represent the value of the electric field which will become the height data in the animation. The columns are read in separately by the two 'extract scalar' modules so that they can be depicted separately and together. To get the physical representation of the waves electric field the real and imaginary data set must be joined together to obtain the magnitude. This is done with the 'Field Math' module which takes the root mean squared (RMS) of the real and imaginary parts. The field mesh module gives controls the relative height of the electric field and is used to turn the 2d data set into a three dimensional volume. Each field mesh module has its own colour range and generate colour map module to enable the electric field data to be plotted in a way which can easily be visually understood.

Putting all three images into the same picture was an easy matter in AVS since they all had the same number of dimensions so could all simply be plugged into a geometry viewer module. Scaling the legend however was a bit of a mystery. I was able to get the legend to display the correct intensity numbers but unable to scale the intensity so that it stayed constant for each frame of the animation and each of the component images. Another pitfall of AVS is that it would be very difficult to generate the 7 circles arranged in a hexagonal structure required by the seamouse structure. However, AVS Express has a function called 'f2circle2d' which quite simply generates a circle on the plot by entering in the radius, and the origin of the desired circle.

This AVS network generates the partial band diagram. It was made before the advantages of AVS Express were discovered by my partner Tim and so was never used in the final animation. However, I found it an interesting insight into some of the little quirks of AVS. I tried using graph viewer to make the diagram, however 'graph viewer' was particularly limited in its functions and couldn't plot more than one y value on the same graph. The AVS graph module has many inputs so could handle the 5 line graph with ease. The pickiness of all the different viewers in AVS made it quite difficult to create a simple image.

The files above generate two separate sets of 127 x extension files which were then changed to rgb files ready yto be made into a movie. Movieconvert was used to join the 127 images together to make two separte animations of the graph, and then of the modal pattern data.

We then wanted to be able to shown how the modal pattern changed in relation to the band diagram which required have the two animations running simultaneaously. To put multiple images in one image viewer wasn't difficult if all the images had the same dimensions, however to put the 2 dimensional band diagram graph and the three dimensional modal pattern image in the same frame was a bit more difficult. AVS and AVS express weren't able to do it so the other solution which we ended up using was to create the animations separately and then lay them side by side in a program called moviemaker and run them simultaneaously to make the final animation.