var zoom,elevator1,infowindow,SiteLon,SiteLat,SatLon,Height_over_ocean,AntSize,Frequency,Geosync_radius,Day,Month,Year,season,SatelliteName,SatNameCurrentIndex,currentAddressResponse,map,currentselectedlocation=new google.maps.LatLng(60.19,10.81),geocoder,multipleoutagesoutput,lastprintedoutage,autointerval,autointerval2,polygon1,outage_beamwidth,new_outage_aerea_polygon,coverage_polygon1,polygon_for_alt_plot,testpolygon,coveragemarkers,Nan1markers,NaN2markers,GlobalNaN1markers,GlobalNaN2markers, selection_polygon,extracted_footprint_polygon,coveragearray_for_alternative_footprint_plot,polygon_max_min_lat_for_outage,polyline_peaklat,inchtometer,feettometer,metertoinch,metertofeet,inchtofeet,feettoinch,SiteMarker,SunRadius,globalarray_indexCN_degrad_output_offaxis=[],globalarray_index_offaxis_output_CN_degrad=[],arrayofoutagepolygons=[],currentselectedinterval,script_updated="Script updated 21 October 2014",footprint_array=[],globalcoveragearray=[],labelarray=[],markerarray=[],motherarray= [],labelmotherarray=[],markermotherarray=[],marker=[],label=[],labelposition=[];for(i=0;1500>i;i++)motherarray[i]=[],labelmotherarray[i]=[],markermotherarray[i]=[];currentselectedinterval=0;SunRadius=.25;inchtometer=.0254;inctofeet=1/12;feettometer=12*inchtometer;metertoinch=1/inchtometer;metertofeet=metertoinch/12;feettoinch=12;SatelliteName="";Day=9;Month=10;Year=2012;lastprintedoutage=multipleoutagesoutput=""; function selectsatellites(a){for(i=0;ib?Math.abs(a-b):Math.abs(b-a)} function d_difference(a,b){return a>b?a-b:b-a}function difference(a,b){var c;180<=a&&(a-=360);180<=b&&(b-=360);-180>a&&(a=360-a);-180>b&&(b=360-b);b>a&&(c=b-a);b<=a&&(c=-(a-b));180c&&(c=180-c);return-1*c}function angulardifference(a,b){var c;180<=a&&(a-=360);180<=b&&(b-=360);-180>a&&(a=360-a);-180>b&&(b=360-b);b>a&&(c=b-a);b<=a&&(c=-(a-b));180c&&(c=180-c);return c}function halfangle(){alert(111);var a=Deg(Math.cos(.8));alert(a)} function setlocaltimeinhtmlfields(){var a=new Date;var b=a.getMonth()+1;var c=a.getDate();var e=a.getFullYear();var g=a.getHours();var h=a.getMinutes();a=a.getSeconds();document.getElementById("YearNow").value=1*e;document.getElementById("Month").value=1*b;document.getElementById("Day").value=1*c;document.getElementById("Hour").value=1*g;document.getElementById("Minute").value=1*h;document.getElementById("Second").value=1*a;document.getElementById("LocalTimeZoneDescription").innerHTML=get_timezone_offset_text()} function onchange_antenna_size(){AntSize=1*document.getElementById("AntSize").value;document.getElementById("AntSizeFeet").value=formatvalue(AntSize*metertofeet,4);document.getElementById("AntSizeInches").value=formatvalue(AntSize*metertoinch,5);SetCookie();load_tables();print_outages()} function onchange_antenna_size_feet(){var a=1*document.getElementById("AntSizeFeet").value;AntSize=a*feettometer;document.getElementById("AntSize").value=formatvalue(AntSize,4);document.getElementById("AntSizeInches").value=formatvalue(a*feettoinch,5);SetCookie();load_tables();print_outages()} function onchange_antenna_size_inches(){var a=1*document.getElementById("AntSizeInches").value;AntSize=a*inchtometer;document.getElementById("AntSize").value=formatvalue(AntSize,4);document.getElementById("AntSizeFeet").value=formatvalue(a*inctofeet,5);SetCookie();load_tables();print_outages()} function onchange_band(){1==document.getElementById("c-band").checked?(Frequency=3.95,document.getElementById("NoiseTempLNB").value=15,document.getElementById("NoiseTempLNB_dB").value=.219,document.getElementById("circular").checked=!0):1==document.getElementById("ku-band").checked?(Frequency=11.95,document.getElementById("linear").checked=!0,document.getElementById("NoiseTempLNB").value=58.66,document.getElementById("NoiseTempLNB_dB").value=.8):1==document.getElementById("user-band").checked&&(Frequency= 1*document.getElementById("Frequency").value);document.getElementById("Frequency").value=Frequency;SetCookie();load_tables();print_outages()}function onchange_frequency(){document.getElementById("user-band").checked=!0;Frequency=1*document.getElementById("Frequency").value;SetCookie();load_tables();print_outages()}function onchange_year(){Year=1*document.getElementById("Year").value;print_outages()} function onchange_season(){season=1==document.getElementById("Spring").checked?0:1;print_outages()} function find_peak_latitude(a){var b;var c="N/A2";var e=90;document.getElementById("SunInt_Peak_Latitude").innerHTML="
";for(b=-9E4;9E4>b;b++){var g=Deg(-Math.atan2(3964*Math.sin(Radians(b/1E3)),22300+3964*(1-Math.cos(Radians(b/1E3)))));3964*(-22300==1-Math.cos(Radians(b/1E3)))?c="N/A3":Math.abs(difference(g,a))"}function set_todays_dateandtime(){var a=new Date;var b=a.getUTCMonth()+1;var c=a.getUTCDate();var e=a.getUTCFullYear();var g=a.getUTCHours();var h=a.getUTCMinutes();a=a.getUTCSeconds();return daynumber(c,b,e,g,h,a)}function getsunintpeak(){}
function getPeakLatitude(a){var b,c=[];var e=.01;var g="---";sunangles=sun_angles(a,60,60);SunDeclination=sunangles[2];outage_beamwidth=calculateantennabeamwidth(1*Frequency,1*AntSize,70);document.getElementById("SunInt_Peak_Latitude").innerHTML="---";SimpleElevationEquatorCrossing(0,79,0,0);for(b=-8130;8130>b;b++){var h=b/100;var f=SimpleElevationEquatorCrossing(0,Math.abs(h),0,0);var l=0SunDeclination?-h:h,e=Math.abs(difference(l,SunDeclination)))}document.getElementById("SunInt_Peak_Latitude").innerHTML=document.getElementById("SunInt_Peak_Latitude").innerHTML+" InpoutDecl= "+SunDeclination+" Found lat="+g+" Recalc Declundefined SelectedSatLon "+SatLon+" Outage beamwidth "+outage_beamwidth+" Date: "+d_to_date_and_time(a)+"
";c[0]=g;c[1]=1;c[2]=SunDeclination;c[3]=void 0;c[4]=void 0;return c} function getCorrectedPeakLatitude(a,b,c,e,g,h,f){var l,m=[];var n=.01;var p="---";sunangles=sun_angles(a,60,60);SunDeclination=sunangles[2];outage_beamwidth=calculateantennabeamwidth(1*Frequency,1*AntSize,70);document.getElementById("SunInt_Peak_Latitude").innerHTML="---";c=SimpleElevationEquatorCrossing(0,79,0,0);for(l=-8130;8130>l;l++){var q=l/100;var r=GetVariableDeclination(b,q,e,g,h,f);Math.abs(difference(SunDeclination,r))";m[0]=p;m[1]=1;m[2]=SunDeclination;m[3]=void 0;m[4]=void 0;return m} function getPeakMaxMinLatitude(a){var b,c,e,g,h,f=[];var l=e=b=.01;var m="---";sunangles=sun_angles(a,60,60);SunDeclination=sunangles[2];1==document.getElementById("id3dBBeamwidth").checked&&0==document.getElementById("idThresholdLinkMargin").checked?outage_beamwidth=calculateantennabeamwidth(Frequency,AntSize,70):(a=1*document.getElementById("idInputLinkMargin").value,document.getElementById("AntEfficiency"),outage_beamwidth=a=1*globalarray_indexCN_degrad_output_offaxis[Math.round(10*a)],8.6833> Math.abs(SunDeclination+outage_beamwidth+.02)&&(g=SunDeclination+outage_beamwidth),8.6833>Math.abs(SunDeclination-outage_beamwidth-.02)&&(h=SunDeclination-outage_beamwidth));1==document.getElementById("id3dBBeamwidth").checked&&0==document.getElementById("idThresholdLinkMargin").checked?(8.6833>Math.abs(SunDeclination+outage_beamwidth+.27)&&(g=SunDeclination+outage_beamwidth+.25),8.6833>Math.abs(SunDeclination-outage_beamwidth-.27)&&(h=SunDeclination-outage_beamwidth-.25)):l=1;document.getElementById("SunInt_Peak_Latitude").innerHTML= "---";SimpleElevationEquatorCrossing(0,79,0,0);for(c=-8130;8130>c;c++){var n=c/100;a=SimpleElevationEquatorCrossing(0,Math.abs(n),0,0);var p=GetVariableDeclination(0,n,0,0,0,42164.14);Math.abs(difference(SunDeclination,p))e;e++){var h=e;var f=Elevation2(c,a,h,0,0,42164.57);h=Azimuth2(c,a,h,0,0,42164.57);CalculateDeclination2(1*a,h,f);CalculateSatHourangle(h,0,g,a)}} function getPeakLongitude(a,b){var c,e,g;var h="---";var f=g="N/A";var l=1*SatLon;var m=.01;document.getElementById("SunInt_Peak_Longitude").innerHTML="---";var n=[];for(i=0;36E3>i;i++){var p=i/100;0==p&&(p=1E-6);90==p&&(p=90.000001);270==p&&(p=270.000001);360==p&&(p=359.999999);var q=sun_angles(a,p,b);var r=q[14];var u=q[2];q=Elevation2(l,b,p,0,0,42164.57);var t=Azimuth2(l,b,p,0,0,42164.57);var v=CalculateDeclination2(1*b,t,q);CalculateSatHourangle(t,q,v,b);t=CalculateSatHourangle(t,q,1*u,b);u=difference(u, v);n[1]=b+u;u=e=1;Math.abs(difference(t,r))\n SatDecl:"+v;"---"!=h?c=h:"---"==h&&(c=h);"---"!=h&&0!=u&&0!=e&&(new google.maps.LatLng(b,180");test_sat_HA_for_all_Lon(b,g);n[0]=c;return n} function getFastPeakLongitude(a,b){var c,e,g;var h="---";var f=g="N/A";var l=1*SatLon;var m=1;document.getElementById("SunInt_Peak_Longitude").innerHTML="---";var n=[];for(i=0;360>i;i++){var p=i;0==p&&(p=1E-6);90==p&&(p=90.000001);270==p&&(p=270.000001);360==p&&(p=359.999999);var q=sun_angles(a,p,b);var r=q[14];var u=q[2];q=Elevation2(l,b,p,0,0,42164.57);var t=Azimuth2(l,b,p,0,0,42164.57);var v=CalculateDeclination2(1*b,t,q);CalculateSatHourangle(t,q,v,b);t=CalculateSatHourangle(t,q,1*u,b);u=difference(u, v);n[1]=b+u;u=e=1;Math.abs(difference(t,r))\n SatDecl:"+v;"---"!=h?c=h:"---"==h&&(c=h);"---"!=h&&0!=u&&0!=e&&(new google.maps.LatLng(b,180");test_sat_HA_for_all_Lon(b,g);n[0]=c;return n}function placeMarker(a){} function clearmarkers(){currentselectedinterval=0;clearInterval(autointerval);clearInterval(autointerval2);document.getElementById("10s").style.borderWidth="medium";document.getElementById("10s").style.borderColor="grey";document.getElementById("20s").style.borderWidth="medium";document.getElementById("20s").style.borderColor="grey";document.getElementById("30s").style.borderWidth="medium";document.getElementById("30s").style.borderColor="grey";document.getElementById("60s").style.borderWidth="medium"; document.getElementById("60s").style.borderColor="grey";document.getElementById("Simulatebutton").style.borderWidth="medium";document.getElementById("Simulatebutton").style.borderColor="grey"} function draw_footprint(a,b,c,e,g,h){b=angulardifference(b,c);document.getElementById("SunInt_misc").innerHTML="Lon_SB: "+b;var f=Deg(Math.acos(Math.cos(Radians(a))*Math.cos(Radians(b))));f=Rev(f);f=Deg(Math.atan2(Math.sin(Radians(f)),6.6235-Math.cos(Radians(f))));"NA"!=h&&(f=1*h);h=Deg(Math.acos(Math.cos(Radians(f))*Math.cos(Radians(g))+Math.sin(Radians(f))*Math.sin(Radians(g))*Math.cos(Radians(e))));var l=Math.sin(Radians(e));g=Math.sin(Radians(f))*Math.cos(Radians(g))/Math.sin(Radians(g));g-=Math.cos(Radians(f))* Math.cos(Radians(e));e=Deg(Math.atan2(l,g));e=Deg(Math.atan2(Math.sin(Radians(b)),Math.tan(Radians(a))))+e;b=Deg(Math.asin(6.6235*Math.sin(Radians(h))))-h;a=Deg(Math.asin(Math.sin(Radians(b))*Math.cos(Radians(e))));e=Deg(Math.atan2(Math.tan(Radians(b))*Math.sin(Radians(e)),1));c-=e;0>c&&(c+=360);return new google.maps.LatLng(a,c)} function test_draw_footprint(a,b,c,e,g,h){var f=[];var l=angulardifference(b,c);document.getElementById("SunInt_misc").innerHTML="Lon_SB: "+l;var m=Deg(Math.acos(Math.cos(Radians(a))*Math.cos(Radians(l))));m=Rev(m);var n=Deg(Math.atan2(Math.sin(Radians(m)),6.6235-Math.cos(Radians(m))));"NA"!=h&&(n=-h);h=Deg(Math.acos(Math.cos(Radians(n))*Math.cos(Radians(g))+Math.sin(Radians(n))*Math.sin(Radians(g))*Math.cos(Radians(e))));var p=Math.sin(Radians(e));var q=Math.sin(Radians(n))*Math.cos(Radians(g))/ Math.sin(Radians(g));q-=Math.cos(Radians(n))*Math.cos(Radians(e));p=Deg(Math.atan2(p,q));q=Deg(Math.atan2(Math.sin(Radians(l)),Math.tan(Radians(a))))+p;var r=Deg(Math.asin(6.6235*Math.sin(Radians(h))))-h;alert(r);var u=Deg(Math.asin(Math.sin(Radians(r))*Math.cos(Radians(q))));var t=Deg(Math.atan2(Math.tan(Radians(r))*Math.sin(Radians(q)),1));t=c-t;0>t&&(t+=360);f[0]=1*l;f[1]=1*m;f[2]=1*n;f[3]=1*h;f[4]=1*p;f[5]=1*q;f[6]=1*u;f[7]=1*t;f[8]=1*u;f[9]=1*b;f[10]=1*a;f[11]=1*c;f[12]=1*e;f[13]=1*g;f[14]=1* r;a="\nSatLon: "+f[11];a+="\nBoresLON:"+f[9];a+="\nBoresLAT:"+f[10];a+="\nLonSB:"+f[0];a+="\nBeta:"+f[1]+" (coverageangle, lat korrigert for flattning?)";a+="\nYb:"+f[2]+" (declination)";a+="\nYn:"+f[3]+" (declination point n, korriger denne for h\u00f8yere deklinasjon?)";a+="\nB_n:"+f[14]+"(beta point n)";a+="\nFi_n:"+f[4];a+="\nE_n:"+f[5];a+="\nLat_n_point:"+f[6];a+="\nLon n point:"+f[7];a+="\nLat n point:"+f[8];a+="\nW rotation:"+f[12];a+="\nBeamwidth:"+f[13];alert(a);return output_array} function test_footprint(){var a=test_draw_footprint(50,10,0,90,1,"NA");alert(1*a[0]+"test");var b="\nSatLon: "+1*a[11];b+="\nBoresLON:"+a[9];b+="\nBoresLAT:"+a[10];b+="\nLonSB:"+a[0];b+="\nBeta:"+a[1];b+="\nYb:"+a[2]+" (declination?)";b+="\nYn:"+a[3];b+="\nFi_n:"+a[4];b+="\nE_n:"+a[5];b+="\nLat_n_point:"+a[6];b+="\nLon n point:"+a[7];b+="\nLat n point:"+a[8];b+="\nW rotation:"+a[12];b+="\nBeamwidth:"+a[13];alert(b)} function PlaceCoveragemarkers(a){coveragemarkers=new google.maps.Marker({position:a,map:map,icon:"https://maps.google.com/mapfiles/marker_whiteA.png"})}function PlaceNan1markers(a){Nan1markers=new google.maps.Marker({position:a,map:map,icon:"https://maps.google.com/mapfiles/marker_purpleA.png"})}function PlaceNaN2markers(a){NaN2markers=new google.maps.Marker({position:a,map:map,icon:"https://maps.google.com/mapfiles/marker_yellowA.png"})} function PlaceGlobalNaN1markers(a){GlobalNaN1markers=new google.maps.Marker({position:a,map:map,icon:"https://maps.google.com/mapfiles/dd-start.png"})}function PlaceGlobalNaN2markers(a){GlobalNaN2markers=new google.maps.Marker({position:a,map:map,icon:"https://maps.google.com/mapfiles/dd-end.png"})}function PlaceSitemarker(a){SiteMarker=new google.maps.Marker({position:a,map:map,icon:"https://maps.google.com/mapfiles/dd-end.png"})} function draw_satellite_coverage_aera(){var a=[],b;print_max_north_south_outage();var c=180b;b++)null!=marker[b]&&marker[b].setMap(null);if(!document.getElementById("plotall").checked&&!document.getElementById("plotall").checked){for(b=0;361>b;b++){var e=b;e=draw_footprint(0,c,c,e,8.683333333333334,"NA");isNaN(e.lng())|| isNaN(e.lat())||a.push(e)}b={path:a,strokeColor:"green",strokeOpacity:1,strokeWeight:2,geodesic:!1};globalcoveragearray=a;coverage_polygon1=new google.maps.Polyline(b);coverage_polygon1.setMap(map)}} function footprinttestplotter(){outage_beamwidth=calculateantennabeamwidth(1*Frequency,1*AntSize,70);document.getElementById("SunInt_lonsearch").innerHTML='';var a=[];var b="
";for(i=0;361>i;i++){var c=get_skew(55,110,359.2,i,outage_beamwidth);var e=new google.maps.LatLng(c[7],c[9]);isNaN(e.lat())||isNaN(e.lng())||a.push(e);b=b+""}document.getElementById("SunInt_lonsearch").innerHTML=b+"
Vridning: "+i+"Lon_SB: "+c[0]+"Beta: "+c[1]+"Yb: "+c[2]+"Yn: "+c[3]+"Fi_n: "+c[4]+"E_n: "+ c[5]+"B_n: "+c[6]+"Lat_n_point: "+c[7]+"Lon_n_point_rel_to_sub_point: "+c[8]+"LonReal: "+c[9]+"
";polygon1=new google.maps.Polygon({path:a,strokeColor:"blue",strokeOpacity:1,strokeWeight:1,fillColor:"#0000FF",fillOpacity:.2,geodesic:!0});polygon1.setMap(map)}function calcTime(a){d=new Date;utc=d.getTime()+6E4*d.getTimezoneOffset();nd=new Date(utc+36E5*offset);return 1} function print_new_affectedarea(a,b,c){} function print_max_north_south_outage(){var a=[],b=[];set_todays_dateandtime();var c=1*document.getElementById("YearNow").value;var e=1*document.getElementById("Month").value;var g=1*document.getElementById("Day").value;var h=1*document.getElementById("Hour").value;var f=1*document.getElementById("Minute").value;var l=1*document.getElementById("Second").value;var m=daynumber(g,e,c,h,f,l);m+=(new Date(1*c,1*e-1,1*g,1*h,1*f,1*l,0)).getTimezoneOffset()/1440;c=getPeakMaxMinLatitude(m);document.getElementById("showtimecalculated").innerHTML= d_to_date_and_time(m);m=c[0];e=1*c[3];c=1*c[4];null!=polygon_max_min_lat_for_outage&&polygon_max_min_lat_for_outage.setMap(null);null!=polyline_peaklat&&polyline_peaklat.setMap(null);null!=polygon_max_min_lat_for_outage&&google.maps.event.clearListeners(polygon_max_min_lat_for_outage,"click");isNaN(e)||isNaN(c)?!isNaN(e)&&isNaN(c)?(b[0]=new google.maps.LatLng(e,-180),b[1]=new google.maps.LatLng(e,0),b[2]=new google.maps.LatLng(e,180),b[3]=new google.maps.LatLng(80.88,180),b[4]=new google.maps.LatLng(80.88, 0),b[5]=new google.maps.LatLng(80.88,-180),b={path:b,strokeColor:"orange",strokeOpacity:0,strokeWeight:1,fillColor:"orange",fillOpacity:.1},polygon_max_min_lat_for_outage=new google.maps.Polygon(b),polygon_max_min_lat_for_outage.setMap(map),google.maps.event.addListener(polygon_max_min_lat_for_outage,"click",calculatesunintdate)):isNaN(e)&&!isNaN(c)&&(b[0]=new google.maps.LatLng(-80.88,-180),b[1]=new google.maps.LatLng(-80.88,0),b[2]=new google.maps.LatLng(-80.88,180),b[3]=new google.maps.LatLng(c, 180),b[4]=new google.maps.LatLng(c,0),b[5]=new google.maps.LatLng(c,-180),b={path:b,strokeColor:"orange",strokeOpacity:0,strokeWeight:1,fillColor:"orange",fillOpacity:.1},polygon_max_min_lat_for_outage=new google.maps.Polygon(b),polygon_max_min_lat_for_outage.setMap(map),google.maps.event.addListener(polygon_max_min_lat_for_outage,"click",calculatesunintdate)):(b[0]=new google.maps.LatLng(e,-180),b[1]=new google.maps.LatLng(e,0),b[2]=new google.maps.LatLng(e,180),b[3]=new google.maps.LatLng(c,180), b[4]=new google.maps.LatLng(c,0),b[5]=new google.maps.LatLng(c,-180),b={path:b,strokeColor:"orange",strokeOpacity:0,strokeWeight:1,fillColor:"orange",fillOpacity:.1},polygon_max_min_lat_for_outage=new google.maps.Polygon(b),polygon_max_min_lat_for_outage.setMap(map),google.maps.event.addListener(polygon_max_min_lat_for_outage,"click",calculatesunintdate));isNaN(m)||(a[0]=new google.maps.LatLng(1*m,-179.99),a[1]=new google.maps.LatLng(1*m,0),a[2]=new google.maps.LatLng(1*m,180),polyline_peaklat=new google.maps.Polyline({path:a, strokeColor:"red",strokeOpacity:.5,strokeWeight:1}),polyline_peaklat.setMap(map))}function test_t_ant(){var a=getCN_degradation(1*Frequency,1*AntSize,0);alert(a[0])} function Get_ITUR_BO1213_AntennaGain(a,b,c,e,g){var h;var f=Math.PI;e=Math.pow(10,1.36);c=299792458/(1E9*c);var l=a/c;var m=10*log10(f*a/c*b*(f*a/c));f=c/a*95;var n=29-25*log10(f);b=c/a*Math.sqrt((m-n)/.0025);0<=g&&gg&&(h=-5);70<=g&&180>g&&(h=0);return 11<=l?a=Math.pow(10,h/10):0} function calculate_cn_reduction_detailed_approach(a,b,c,e,g,h){var f;var l=Math.PI;if(.266g&&(h=-5);70<=g&&180>g&&(h=0);return 11<=l?h-m:99} function find_offaxis_for_gain_reduction(a,b,c){var e,g;for(i=0;1800>i;i++){var h=i/10;var f=ITUR_BO1213_AntennaPattern(1*b,1*c,1*Frequency,54,h);if(99==f)break;if(fe;e++)if(h=g/10+e/1E4,f=ITUR_BO1213_AntennaPattern(1*b,.7,1*Frequency,54,h),fh;h++){var f=h/10;var l=getCN_degradation(1*a,1*b,f);l=1*l[0];if(0==f&&lg;g++)if(f=e/10+g/1E4,l=getCN_degradation(1*a,1*b,1*f),l=1*l[0],li;i++){var b=i/10;b=getCN_degradation(1*Frequency,1*AntSize,1*b);a[i]=b[0]}return a} function CNdegradationIndex_vs_offaxis_table(){var a=[];for(i=0;200>i;i++){var b=i/10;a[i]=find_beamwidth_based_on_cn_degradation(1*Frequency,1*AntSize,1*b)}return a} function load_tables(){globalarray_indexCN_degrad_output_offaxis=CNdegradationIndex_vs_offaxis_table();globalarray_index_offaxis_output_CN_degrad=offaxisIndex__vs_CN_degradation_table();document.getElementById("peakCNdegrad").innerHTML=" (peak C/N degradation="+globalarray_index_offaxis_output_CN_degrad[1]+" dB)";print_max_north_south_outage()} function getCN_degradation(a,b,c){var e=[];var g=1==document.getElementById("circular").checked?1:.5;var h=1*Tsys();var f=12E4*g*Math.pow(a,-.75);var l=3E8/(1E9*a)*70/b;b=ITUR_BO1213_AntennaPattern(b,.7,1*a,50,1*c);f=.48g[0]&&na&&--e;l[0]=e;l[1]=n;l[2]=a;l[3]=8*h;l[4]=g;return l} function showsunlongitude(){set_todays_dateandtime();var a=1*document.getElementById("YearNow").value;var b=1*document.getElementById("Month").value;var c=1*document.getElementById("Day").value;var e=1*document.getElementById("Hour").value;var g=1*document.getElementById("Minute").value;var h=1*document.getElementById("Second").value;var f=new Date(1*a,1*b-1,1*c,1*e,1*g,1*h,0);b=daynumber(c,b,a,e,g,h);e=b+=f.getTimezoneOffset()/1440;b=sun_angles(e,0,0);document.getElementById("sunlongitude").innerHTML= "";document.getElementById("sunlongitude").style.color="red";f=1*b[12];c=1*b[2];c=Math.abs(c);b=get_global_start_and_stop_time_for_selected_satellite_date(SatLon,SiteLon,Math.abs(SiteLat),0,a,1*Frequency,1*AntSize,0,1*Geosync_radius,e);b[1]<=e&&(b=get_global_start_and_stop_time_for_selected_satellite_date(SatLon,SiteLon,SiteLat,0,a,1*Frequency,1*AntSize,0,1*Geosync_radius,1*(e+1)));1==document.getElementById("id3dBBeamwidth").checked&&0==document.getElementById("idThresholdLinkMargin").checked?(a= calculateantennabeamwidth(Frequency,AntSize,70),a=getAffectedSatPositions(c,1*(a+.25))):(document.getElementById("AntEfficiency"),a=1*document.getElementById("idInputLinkMargin").value,a=1*globalarray_indexCN_degrad_output_offaxis[Math.round(10*a)],a=calculatebeamwidth_for_offpeak(a,0,0),a=getAffectedSatPositions(c,1*a));isNaN(a)?(document.getElementById("sunlongitude").style.color="blue",document.getElementById("sunlongitude").innerHTML="No potential outages for this date&time"):(c= Rev(DegEastFormat(f-a)),e=Rev(DegEastFormat(f+a)),document.getElementById("sunlongitude").innerHTML="",a=180>f?formatvalue(f,5)+"\u00b0E ":formatvalue(f,5)+"\u00b0E ("+formatvalue(360-f,5)+"\u00b0W)",c=180>c?formatvalue(c,5)+"\u00b0E":formatvalue(c,6)+"\u00b0E ("+formatvalue(360-c,6)+"\u00b0W)",e=180>e?formatvalue(e,5)+"\u00b0E":formatvalue(e,6)+"\u00b0E ("+formatvalue(360-e,6)+"\u00b0W)",document.getElementById("sunlongitude").innerHTML=document.getElementById("sunlongitude").innerHTML+'
Sun interference has just started at '+ c+" and just ended at "+e+"",document.getElementById("sunlongitude").innerHTML=document.getElementById("sunlongitude").innerHTML+"
Sun@Earth Longitude: "+a+"",document.getElementById("sunlongitude").innerHTML=document.getElementById("sunlongitude").innerHTML+"

Outages in coverage area for selected satellite will start at: "+d_to_date_and_time(b[0]),document.getElementById("sunlongitude").innerHTML=document.getElementById("sunlongitude").innerHTML+"
Outages in coverage area for selected satellite will stop at: "+ d_to_date_and_time(b[1]),document.getElementById("sunlongitude").innerHTML=document.getElementById("sunlongitude").innerHTML+"
Sun transit Satellite Longitude at : "+d_to_date_and_time(b[2]));return f}function getsatellites(){var a;var b=[];for(a=0;ai;i++){var u=i/100;var t=c+Math.cos(Radians(u))*q;var v=b+Math.sin(Radians(u))* q;u=Math.acos(Math.cos(Radians(v))*Math.cos(Radians(t)));v=Math.atan2(Math.sin(Radians(t)),Math.tan(Radians(v)));u=Math.asin(6.617*Math.sin(u))-u;t=Deg(Math.asin(Math.sin(u)*Math.cos(v)))+g;Deg(Math.atan(Math.tan(u)*Math.sin(v)));u=Deg(Math.atan2(Math.tan(u)*Math.sin(v),1))+e;t=new google.maps.LatLng(t,u);isNaN(t.lng())||isNaN(t.lat())||(m.push(t),0==r&&201>n&&(r="-"+Math.round(n/10)+"dB",null!=markerarray[n]&&markermotherarray[h][n].setMap(null),markermotherarray[h][n]=new google.maps.Marker({position:t, title:r,map:map}),markermotherarray[h][n].setVisible(!1),labelmotherarray[h][n]=new Label({map:map}),labelmotherarray[h][n].set("zIndex",1234),labelmotherarray[h][n].bindTo("position",markermotherarray[h][n],"position"),labelmotherarray[h][n].set("text",r),r=!0),201==n&&0==document.getElementById("contours").checked&&(labelposition[h]=t))}}r="-"+Math.round(n/10);t=["red","darkolivegreen","black"];q=[.2,.2,.2];var w;fill_color=w=t[h%3];u=1*q[h%3];v="black";t=1;strokeOpc=.6;201==n&&(t=3,v="black",strokeOpc= .6,u=document.getElementById("contours").checked?0:1*q[h%3],fill_color=w);q={path:m,strokeColor:v,strokeOpacity:strokeOpc,strokeWeight:t,fillColor:fill_color,fillOpacity:u,geodesic:!0,title:r};null!=motherarray[h][n]&&motherarray[h][n].setMap(null);motherarray[h][n]=new google.maps.Polygon(q);motherarray[h][n].setMap(map);null!=motherarray[h][n]&&google.maps.event.clearListeners(motherarray[h][n],"click");google.maps.event.addListener(motherarray[h][n],"click",calculatesunintdate);201==n&&(n=200)}n-= 10}if(Math.sqrt(b*b+c*c)<8.8+a){t=c;v=b;u=Math.acos(Math.cos(Radians(v))*Math.cos(Radians(t)));v=Math.atan2(Math.sin(Radians(t)),Math.tan(Radians(v)));u=Math.asin(6.617*Math.sin(u))-u;t=Deg(Math.asin(Math.sin(u)*Math.cos(v)))+g;Deg(Math.atan(Math.tan(u)*Math.sin(v)));u=Deg(Math.atan2(Math.tan(u)*Math.sin(v),1))+e;a=1*globalarray_index_offaxis_output_CN_degrad[0];e=180l[1]?f+"
"+e+"
Incl. "+formatvalue(l[1], 4)+"\u00b0S
-"+formatvalue(a,4)+"dB":f+"
"+e+"
Incl. "+formatvalue(l[1],4)+"\u00b0N
-"+formatvalue(a,4)+"dB";null!=marker[h]&&marker[h].setMap(null);f=new google.maps.LatLng(t,u);if(isNaN(f.lng())||isNaN(f.lat()))f=labelposition[h];isNaN(f.lng())||isNaN(f.lat())||(p=1);isNaN(f.lng())||isNaN(f.lat())||(null!=marker[h]&&marker[h].setMap(null),marker[h]=new google.maps.Marker({position:f,title:r,map:map}),marker[h].setVisible(!1),null!=label[h]&&label[h].setMap(null),label[h]=new Label({map:map}), label[h].set("zIndex",1234),label[h].bindTo("position",marker[h],"position"),label[h].set("text",r))}return p} function draw_new_coverage(){var a=[];for(i=0;360001>i;i++){var b=8.683333333333334*Math.sin(Radians(i/1E3));var c=8.683333333333334*Math.cos(Radians(i/1E3));var e=Math.acos(Math.cos(Radians(b))*Math.cos(Radians(c)))+Radians(0);c=Math.atan2(Math.sin(Radians(c)),Math.tan(Radians(b)))+Radians(0);b=Math.asin(6.6235*Math.sin(e))-e;e=Deg(Math.asin(Math.sin(b)*Math.cos(c)));Deg(Math.atan(Math.sin(Radians(e))/(6.61078-Math.cos(Radians(e))))-Math.atan(Math.sin(Radians(e))/Math.sqrt(43.7024122084-Math.cos(Radians(e))* Math.cos(Radians(e)))));Deg(Math.atan(.9933056151556835*Math.tan(Radians(e))));c=Deg(Math.atan2(Math.tan(b)*Math.sin(c),1))-50.1;e=new google.maps.LatLng(e,c);if(isNaN(e.lng())||isNaN(e.lat()))e=new google.maps.LatLng(0,28.21);a.push(e)}} function print_footprint_on_google_map(a,b){var c;var e=showsunlongitude();var g=SatLon;set_todays_dateandtime();var h=1*document.getElementById("YearNow").value;var f=1*document.getElementById("Month").value;var l=1*document.getElementById("Day").value;var m=1*document.getElementById("Hour").value;var n=1*document.getElementById("Minute").value;var p=1*document.getElementById("Second").value;var q=new Date(1*h,1*f-1,1*l,1*m,1*n,1*p,0);document.getElementById("time_for_calculation").innerHTML=''+ q+"";document.getElementById("LocalTimeZoneDescription").innerHTML=get_timezone_offset_text_new(q);h=daynumber(l,f,h,m,n,p);h+=q.getTimezoneOffset()/1440;f=formatnumber_fourspaces(q.getUTCFullYear())+"-"+formatnumber_twospaces(q.getUTCMonth())+"-"+formatnumber_twospaces(q.getUTCDate())+" "+formatnumber_twospaces(q.getUTCHours())+":"+formatnumber_twospaces(q.getUTCMinutes())+":"+formatnumber_twospaces(q.getUTCSeconds())+" UTC";document.getElementById("time_for_calculation").innerHTML=''+ q+"";document.getElementById("time_for_calculation_utc").innerHTML=''+f+"";q=h;document.getElementById("showtimecalculated").innerHTML=d_to_date_and_time(q);window.document.title="Sun Outage Visualizer Simulator for Geostationary Satellites - Projects area affected by potential Sun outage - Jens T. S\u00e6tre - https://www.satellite-calculations.com "+document.getElementById("showtimecalculated").innerHTML;getPeakLatitude(q);q=sun_angles(q, 60,60)[2];var r=difference(g,e);f=getsatellites()[1];h=Math.acos(Math.cos(Radians(-1*q))*Math.cos(Radians(0)));l=Math.atan2(Math.sin(Radians(0)),Math.tan(Radians(-1*q)));h=Deg(Math.asin(Math.sin(Math.asin(6.617*Math.sin(h))-h)*Math.cos(l)));var u=document.Position.SelectList.value;m=u.split(":");var t=0;if(0==document.getElementById("plotall").checked&&0==document.getElementById("plotselected").checked&&0==document.getElementById("altplot").checked&&0==document.getElementById("plotallfiltered").checked){test_satreferredcoordinates(1* b,-1*q,1*r,1*g,1*f,t,m[4].trim(),m);f=showsunlongitude();180n&&ul;)f=0,g=1*l/10,m=[1*g,0,42164,28184,"test",1023.0244812045,-42147.7814604451,-.00121153714057367,0],r=difference(g,e),1==test_satreferredcoordinates(1*b,-1*q,1*r,1*g,1*f,t,"",m)&&(t+=1),l+=10*document.getElementById("SatLonResolution").value}new google.maps.LatLng(h,e);if(document.getElementById("plotselected").checked){null!= coverage_polygon1&&coverage_polygon1.setMap(null);for(l=0;lURL link with settings';document.getElementById("URL").style.backgroundColor="grey"} function calculatesunintdate(a){var b=[],c=a.latLng;currentselectedlocation=c;SiteLat=currentselectedlocation.lat();SiteLon=currentselectedlocation.lng();reverseGeocode(currentselectedlocation);b.push(c);elevator1.getElevationForLocations({locations:b},function(a,b){if(b==google.maps.ElevationStatus.OK)if(a[0]){Height_over_ocean=0>a[0].elevation?0:1*a[0].elevation/1E3;print_outages();infowindow.setPosition(c);var e=infowindow.getPosition();e.lng();e.lat();map.setCenter(c);null!=SiteMarker&&SiteMarker.setMap(null); PlaceSitemarker(c);SetCookie()}else alert("No results found");else alert("Elevation service failed due to: "+b)})}function DegEastFormat(a){return 0>a?360+a:a} function start_moving_marker_on_map(){clearInterval(autointerval);loadfootprint();autointerval=setInterval("setlocaltimeinhtmlfields();loadfootprint()",1E4);automatic_600s();document.getElementById("30s").style.borderWidth="thick";document.getElementById("30s").style.borderColor="red";document.getElementById("10s").style.borderWidth="medium";document.getElementById("10s").style.borderColor="grey";document.getElementById("20s").style.borderWidth="medium";document.getElementById("20s").style.borderColor= "grey";document.getElementById("60s").style.borderWidth="medium";document.getElementById("60s").style.borderColor="grey";document.getElementById("Simulatebutton").style.borderWidth="medium";document.getElementById("Simulatebutton").style.borderColor="grey";currentselectedinterval=10} function automatic_20seconds(){clearInterval(autointerval);loadfootprint();autointerval=setInterval("setlocaltimeinhtmlfields();loadfootprint()",5E3);automatic_600s();document.getElementById("20s").style.borderWidth="thick";document.getElementById("20s").style.borderColor="red";document.getElementById("10s").style.borderWidth="medium";document.getElementById("10s").style.borderColor="grey";document.getElementById("30s").style.borderWidth="medium";document.getElementById("30s").style.borderColor="grey"; document.getElementById("60s").style.borderWidth="medium";document.getElementById("60s").style.borderColor="grey";document.getElementById("Simulatebutton").style.borderWidth="medium";document.getElementById("Simulatebutton").style.borderColor="grey";currentselectedinterval=5} function automatic_60seconds(){clearInterval(autointerval);loadfootprint();autointerval=setInterval("setlocaltimeinhtmlfields();loadfootprint()",6E4);automatic_600s();document.getElementById("60s").style.borderWidth="thick";document.getElementById("60s").style.borderColor="red";document.getElementById("10s").style.borderWidth="medium";document.getElementById("10s").style.borderColor="grey";document.getElementById("20s").style.borderWidth="medium";document.getElementById("20s").style.borderColor="grey"; document.getElementById("30s").style.borderWidth="medium";document.getElementById("30s").style.borderColor="grey";document.getElementById("Simulatebutton").style.borderWidth="medium";document.getElementById("Simulatebutton").style.borderColor="grey";currentselectedinterval=60} function automatic_10seconds(){clearInterval(autointerval);loadfootprint();autointerval=setInterval("setlocaltimeinhtmlfields();loadfootprint()",1E3);automatic_600s();document.getElementById("10s").style.borderWidth="thick";document.getElementById("10s").style.borderColor="red";document.getElementById("20s").style.borderWidth="medium";document.getElementById("20s").style.borderColor="grey";document.getElementById("30s").style.borderWidth="medium";document.getElementById("30s").style.borderColor="grey"; document.getElementById("60s").style.borderWidth="medium";document.getElementById("60s").style.borderColor="grey";document.getElementById("Simulatebutton").style.borderWidth="medium";document.getElementById("Simulatebutton").style.borderColor="grey";currentselectedinterval=1}function automatic_600s(){clearInterval(autointerval2);setlocaltimeinhtmlfields();print_max_north_south_outage();autointerval2=setInterval("setlocaltimeinhtmlfields();print_max_north_south_outage()",3E5)} function simulation(){clearInterval(autointerval2);var a=1*document.getElementById("YearNow").value;var b=1*document.getElementById("Month").value;var c=1*document.getElementById("Day").value;var e=1*document.getElementById("Hour").value;var g=1*document.getElementById("Minute").value;var h=1*document.getElementById("Second").value;daynumber(c,b,a,e,g,h);(new Date(1*a,1*b-1,1*c,1*e,1*g,1*h,0)).getTimezoneOffset();var f=1*document.getElementById("Simulationrefresh").value;h=new Date(1*a,1*b-1,1*c, 1*e,1*g,1*h,0);b=h.getMonth()+1;c=h.getDate();a=h.getFullYear();e=h.getHours();g=h.getMinutes();h=h.getSeconds();document.getElementById("YearNow").value=1*a;document.getElementById("Month").value=1*b;document.getElementById("Day").value=1*c;document.getElementById("Hour").value=1*e;document.getElementById("Minute").value=1*g;document.getElementById("Second").value=1*h;document.getElementById("Simulatebutton").style.borderWidth="thick";document.getElementById("Simulatebutton").style.borderColor="red"; document.getElementById("20s").style.borderWidth="medium";document.getElementById("20s").style.borderColor="grey";document.getElementById("30s").style.borderWidth="medium";document.getElementById("30s").style.borderColor="grey";document.getElementById("60s").style.borderWidth="medium";document.getElementById("60s").style.borderColor="grey";document.getElementById("10s").style.borderWidth="medium";document.getElementById("10s").style.borderColor="grey";loadfootprint();autointerval2=setInterval("setsimulationtimeinhtmlfields();loadfootprint()", 1E3*f)} function setsimulationtimeinhtmlfields(){var a=1*document.getElementById("YearNow").value;var b=1*document.getElementById("Month").value;var c=1*document.getElementById("Day").value;var e=1*document.getElementById("Hour").value;var g=1*document.getElementById("Minute").value;var h=1*document.getElementById("Second").value;daynumber(c,b,a,e,g,h);h=new Date(1*a,1*b-1,1*c,1*e,1*g,1*h,0);c=1*document.getElementById("Simulatestep").value;h=new Date(1*h+1E3*c);b=h.getMonth()+1;c=h.getDate();a=h.getFullYear();e= h.getHours();g=h.getMinutes();h=h.getSeconds();document.getElementById("YearNow").value=1*a;document.getElementById("Month").value=1*b;document.getElementById("Day").value=1*c;document.getElementById("Hour").value=1*e;document.getElementById("Minute").value=1*g;document.getElementById("Second").value=1*h;document.getElementById("LocalTimeZoneDescription").innerHTML=get_timezone_offset_text();print_max_north_south_outage()} function loadfootprint(){var a;for(a=0;1500>a;a++)null!=label[a]&&label[a].setMap(null);for(a=0;1500>a;a++)null!=marker[a]&&marker[a].setMap(null);null!=new_outage_aerea_polygon&&new_outage_aerea_polygon.setMap(null);for(a=0;202>a;a++)null!=markerarray[a]&&markerarray[a].setMap(null);for(a=0;202>a;a++)null!=arrayofoutagepolygons[a]&&arrayofoutagepolygons[a].setMap(null);for(k=0;1500>k;k++)for(a=0;202>a;a++)null!=motherarray[k][a]&&motherarray[k][a].setMap(null),null!=labelmotherarray[k][a]&&labelmotherarray[k][a].setMap(null), null!=markermotherarray[k][a]&&markermotherarray[k][a].setMap(null);a=SatLon;if(1==document.getElementById("id3dBBeamwidth").checked&&0==document.getElementById("idThresholdLinkMargin").checked)var b=calculateantennabeamwidth(1*Frequency,1*AntSize,70)+SunRadius;else{b=1*document.getElementById("idInputLinkMargin").value;document.getElementById("AntEfficiency");var c=1*globalarray_indexCN_degrad_output_offaxis[Math.round(10*b)];b=calculatebeamwidth_for_offpeak(1*c,0,0);0==c&&(b=0)}0!=b&&null!=b?print_footprint_on_google_map(1* a,1*b):polygon_max_min_lat_for_outage.setMap(null)} function sun_angles(a,b,c){var e=Math.PI;var g=[];var h=282.9404+4.70935E-5*a;var f=.016709-1.151E-9*a;var l=356.047+.9856002585*a;var m=23.4393-3.563E-7*a;var n=h+Rev(l);n=Rev(n);var p=l+180/e*f*Math.sin(Radians(l))*(1+f*Math.cos(Radians(l)));p=Rev(p);var q=1*Math.cos(Radians(p))-f;var r=1*Math.sin(Radians(Rev(p)))*Math.sqrt(1-f*f);p=Math.sqrt(q*q+r*r);var u=Deg(Math.atan2(r,q));u=Rev(u+h);q=p*Math.cos(Radians(u));r=p*Math.sin(Radians(u));var t=0;var v=q;var w=r*Math.cos(Radians(m))+t*Math.sin(Radians(m)); t=r*Math.sin(Radians(m))+t*Math.cos(Radians(m));var x=Rev(Deg(Math.atan2(w,v)));v=Deg(Math.atan2(t,Math.sqrt(v*v+w*w)));w=n+180;a-=Math.floor(a);b=w+360*a+b-x;q=Math.cos(b*e/180)*Math.cos(v*e/180);r=Math.sin(b*e/180)*Math.cos(v*e/180);t=Math.sin(v*e/180);var y=q*Math.sin(c*e/180)-t*Math.cos(c*e/180);t=e=Deg(Math.asin(q*Math.cos(c*e/180)+t*Math.sin(c*e/180)));e=ElevationRefraction(e);SunAzimuth=Deg(Math.atan2(r,y));g[0]=e;g[1]=SunAzimuth+180;g[14]=0SiteLat){var r="South";a=-SiteLat}else r="North",a=SiteLat;if(0\n\n\n\x3c!--[if lt IE 10]>";b+='\n