# Simple separation of the sky dome

Dear Darren,

maybe the following .cal file would be useful to you. Bassicaly is a modification of skybright.cal and can by used in the same way.

{ patch.cal
modification of skybright.cal. It's been used to turn on one patch of the sky.
A liitle axtra effort is needed to create a discrete grid on the sky.

Dr. Aris Tsangrassoulis, 1999}
skybr = wmean((Dz+1.01)^10,select(A1, sunnysky, cloudysky, unifsky, intersky),(Dz+1.01)^-10, A3);

wmean(a, x, b, y) = (a*x + b*y) / (a + b);

sunnysky = A2 * (.91 + 10 * EXP(-3 * gamma) + .45 * cosgamma * cosgamma)* if( Dz - .01, 1.0 - exp(-.32/Dz), 1.0) / A4;

cloudysky = A2 * (1 + 2*Dz)/3;

dektis1=if(inside( 0 ,azim, 12 ),1,0); {azimuth from 0 to 12 degrees}

dektis2=if(inside( 0 ,eta, 12 ),1,0); {elevation from 0 to 12 degrees}

unifsky=if(and(dektis1,dektis2),100,0); {the patch is turned on}

azi=atan2(Dx,Dy)*180/3.141592;

azim=if(Dx,azi,azi+360);

intersky = A2 * ( (1.35*sin(5.631-3.59*eta)+3.12)*sin(4.396-2.6*zt)+ 6.37 - eta ) / 2.326 *exp(gamma*-.563*((2.629-eta)*(1.562-zt)+.812)) / A4;

cosgamma = Dx*A5 + Dy*A6 + Dz*A7;

gamma=acos(cosgamma);

zt=acos(A7);

eta=(1.5707-acos(Dz))*180/3.141592;

Please take into account that the existence of the patch can be verified by using the intereflection part of the calculation.

Regards,

Dr. Aris Tsangrassoulis