Le Activity Drei

Thank God for sudo apt-get install scilab! Thank God for Ubuntu! Thank God for centered circle sample code! Thank God for user-friendly Scilab tutorials in the internet!

Here are the outputs for the activity:

Centered_squareSinusoidGratingAnnulusGraded_transparencyEllipseCross

Figure 1. (top row left) Centered square, (top row middle) Corrugated roof, (top row right) grating, (middle row left) Annulus, (middle row center) Gaussian graded transparency, (middle row right) Ellipse, (bottom row) Cross

Playing around with the code, here are other produced outputs:

 Graded_squareChecker Eye Sinusoid_gratingGraded_cross  asdf

Figure 2. (top left) Graded square, (top middle) Checker board, (top right) Elliptic Annulus, (bottom left) Grating + Sinusoid, (bottom right) Annulus + Checker board + Sinusoid

For this activity, I give myself an 11 (GOING BEYOOONNNNNDDD!!!)

Here are the codes used for the required images:

//Centered square aperture
x = linspace(-1,1,1000);
y = linspace(-1,1,1000);
[X,Y] = ndgrid(x,y);
A = zeros(1000,1000);
rx = sqrt(X.^2);
ry = sqrt(Y.^2);
A(find(rx<0.3 & ry<0.3)) = 1;
f = scf();
grayplot(x,y,A);
f.color_map = graycolormap(32);
//Grating along the x-direction
x = linspace(-1,1,500);
y = linspace(-1,1,500);
[X,Y] = ndgrid(x,y);
z = sin(X.*12);
f = scf();
grayplot(x,y,z);
f.color_map = graycolormap(32);
//Grating along the x-direction
x = linspace(-1,1,500);
y = linspace(-1,1,500);
[X,Y] = ndgrid(x,y);
A = zeros(500,500);
z = sin(X.*12);
A(find(z<-0)) = 1;
f = scf();
grayplot(x,y,A);
f.color_map = graycolormap(32);
//Annulus
x = linspace(-1,1,500);
y = linspace(-1,1,500);
[X,Y] = ndgrid(x,y);
A = zeros(500,500);
r = sqrt(X.^2 + Y.^2);
A(find(r<0.7 & r>0.3)) = 1;
f = scf();
grayplot(x,y,A);
f.color_map = graycolormap(32);
//Circular aperture with graded transparency (Gaussian transparency)
function y=gauss(x), y=exp(-(x)/2), endfunction
x = linspace(-1,1,1000);
y = linspace(-1,1,1000);
[X,Y] = ndgrid(x,y);
r = gauss(sqrt(X.^2+Y.^2));
r(find(r<0.7))=-0.5;
f = scf();
grayplot(x,y,r);
f.color_map = graycolormap(32);
//Ellipse
x = linspace(-1,1,500);
y = linspace(-1,1,500);
[X,Y] = ndgrid(x,y);
A = zeros(500,500);
r = sqrt((X.^2)/4 + (Y.^2)/2);
A(find(r<0.4)) = 1;
f = scf();
grayplot(x,y,A);
f.color_map = graycolormap(32);
//Cross
x = linspace(-1,1,500);
y = linspace(-1,1,500);
[X,Y] = ndgrid(x,y);
A = zeros(500,500);
rx = sqrt(X.^2);
ry = sqrt(Y.^2);
A(find(rx<0.2 | ry<0.2)) = 1;
A(find(rx>0.9 | ry>0.9)) = 0;
f = scf();
grayplot(x,y,A);
f.color_map = graycolormap(32);

Blog post won't be complete without a success gif sooo :)))
giphy

Le Activity Zwei

It’s been a long week. The search for the mysterious “Hand drawn Plot” was as perilous as ever. Hours were lost browsing the old books in Plasma. We searched in the darkness of the NIP Library (brownout) in the middle of a thunderstorm. And for what you ask? For the librarian to tell us that the plots from the 60’s thesis can’t be scanned. Worn out and tired, I was at my limit. Will the legendary plot ever be found? Meron nga kayang FOREVER? Then a blinding light appeared in front of me. Was God taking me into his kingdom? No, I was mistaken. It took the form of a man. An angel sent by God to aid me in my quest perhaps? It was… Mario (ACKNOWLEDGED!!!!), who graciously offered one of the plots in Photonics to be scanned. And once again, I found my purpose, and a new adventure begins!

(Kidding slightly aside) Now to create a reconstruction of the legendary plot. I borrowed the magic powers of Image J to collect the details of the plot and recorded it in the seemingly infinite capacity of spreadsheets (Excel and Libre Office).

Screenshot 2015-08-20 17:01:32Screenshot 2015-08-20 16:54:13giphy

Figure 1. (left) Image data acquisition using Image J, (middle) image calibration and image reconstruction using spreadsheets, (right) cool gif.

#suchdata#muchwow

Pleased with my reconstruction, I used my knowledge in basic Photoshop to compare it with my acquired “Hand drawn Plot”. I set the opacity to 50%. I saw it, and I was pleased.

11900703_10204630037533141_1362456179_o      giphy    11874343_10204630037493140_1053523698_o

Figure 2. (top) Image overlap using Photoshop CS5, (bottom left) success gif, (bottom right) image reconstruction (opacity=50%) on top of the “Hand drawn Plot”

For this activity I would give myself a 5 for technical correctness, and another 5 for presentation quality to total 10 points! :))

(I also acknowledge giphy.com for my awesome gifs)