-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcode.min.js
1 lines (1 loc) · 46.4 KB
/
code.min.js
1
function createPopup(){minDate=moment(observatoriesCache[0].timeStart).toDate(),maxDate=moment(observatoriesCache[0].timeEnd).toDate(),$("#startDateDatepicker").datepicker({width:"100%",minDate:minDate,maxDate:maxDate}),$("#satSel").select2({placeholder:"Select a satellite",allowClear:!0,minimumInputLength:0,width:"100%"}).on("change",function(e){var A=$("#satSel").val(),t=_.findWhere(observatoriesCache,{id:A}),a=moment(t.timeStart).toDate(),i=moment(t.timeEnd).toDate();$("#startDateDatepicker").datepicker("option","minDate",a),$("#startDateDatepicker").datepicker("option","maxDate",i),$("#startDateDatepicker").val(""),$("#endDateDatepicker").datepicker("option","minDate",a),$("#endDateDatepicker").datepicker("option","maxDate",i),$("#endDateDatepicker").val("")}),$("#startHourTimepicker").timepicker({timeFormat:"HH:mm:ss",dynamic:!1,dropdown:!1,scrollbar:!1}),$("#endDateDatepicker").datepicker({width:"100%",minDate:minDate,maxDate:maxDate}),$("#endHourTimepicker").timepicker({timeFormat:"HH:mm:ss",dynamic:!1,dropdown:!1,scrollbar:!1}),$("#orbitType").select2({placeholder:"Select a State",allowClear:!0,minimumInputLength:0,width:"100%"}),$('[data-toggle="tooltip"]').tooltip()}function cleanAll(){viewer.entities.removeAll()}function satelliteAdd(){var e={satSel:$("#satSel").val(),startDateDatepicker:$("#startDateDatepicker").val(),startHourTimepicker:$("#startHourTimepicker").val(),endDateDatepicker:$("#endDateDatepicker").val(),endHourTimepicker:$("#endHourTimepicker").val(),orbitType:$("#orbitType").val(),inputColor:$("#inputColor").val()};iso8601RegExp=new RegExp("(\\d{4})-(\\d{2})-(\\d{2})([T\\s](\\d{2}))?(:(\\d{2}))?(:(\\d{2}))?(\\.(\\d{3}))?Z?");var A=moment($("#startDateDatepicker").val(),"MM/DD/YYYY").format("YYYY-MM-DD")+" "+$("#startHourTimepicker").val(),t=moment($("#endDateDatepicker").val(),"MM/DD/YYYY").format("YYYY-MM-DD")+" "+$("#endHourTimepicker").val();if(minDate>moment($("#startDateDatepicker").val(),"MM/DD/YYYY")||moment($("#startDateDatepicker").val(),"MM/DD/YYYY")>maxDate)jAlert2("Invalid Start date","error");else if(minDate>moment($("#endDateDatepicker").val(),"MM/DD/YYYY")||moment($("#endDateDatepicker").val(),"MM/DD/YYYY")>maxDate)jAlert2("Invalid End date","error");else if(iso8601RegExp.test(A))if(A=getIso8601FromInput(A),iso8601RegExp.test(t))if(t=getIso8601FromInput(t),getDateFromIso8601(A)>=getDateFromIso8601(t))jAlert2("Start Time must be less than Stop Time","error");else{var a=$("#satSel").val(),i=A.replace(/-\s*/g,"");i=(i=i.replace(/:\s*/g,"")).replace(".000","");var r=t.replace(/-\s*/g,"");r=(r=r.replace(/:\s*/g,"")).replace(".000",""),$.ajax({type:"GET",url:"https://sscweb.gsfc.nasa.gov/WS/sscr/2/locations/"+a+"/"+i+","+r+"/geo/",data:{},dataType:"json",contentType:"application/json",success:_.bind(addSatellitesToMap,this,e),error:getLocationsError})}else jAlert2("Invalid Stop Time","error");else jAlert2("Invalid Start Time","error")}function hexToRgb(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,A,t,a){return A+A+t+t+a+a});var A=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return A?{r:parseInt(A[1],16),g:parseInt(A[2],16),b:parseInt(A[3],16)}:null}function addSatellitesToMap(e,A){if(null!=A.Result.Data){for(var t=A.Result.Data[1][0].Coordinates[1][0].X[1],a=A.Result.Data[1][0].Coordinates[1][0].Y[1],i=A.Result.Data[1][0].Coordinates[1][0].Z[1],r=(A.Result.Data[1][0].RadialLength[1],A.Result.Data[1][0].Time[1]),o=[],n=[],s=0;s<t.length;s++){var l=geo2gdzProj4(t[s],a[s],i[s],6378.137,6356.7523142);o.push(l[0]),o.push(l[1]),o.push(1e3*l[2]),n.push(l[0]),n.push(l[1])}var d="";if(2==e.orbitType){var c=math.round(o[2]/1e3,1);if(o[o.length-1]>6e8&&o[o.length-1]<=17e8)jAlert2("Very hight altitude "+c+" km","warning");else if(o[o.length-1]>17e8)return void jAlert2("Very hight altitude "+c+" km","error");d=Cesium.Cartesian3.fromDegreesArrayHeights(o)}else d=Cesium.Cartesian3.fromDegreesArray(n);var m=hexToRgb(e.inputColor),p=(viewer.entities.add({name:e.satSel+" orbit",polyline:{positions:d,width:2,material:new Cesium.PolylineOutlineMaterialProperty({color:Cesium.Color.fromBytes(m.r,m.g,m.b,255),outlineWidth:1})}}),$("#satelliteDetailInit").html());p=(p=p.replace("longs",math.round(o[0],2))).replace("lats",math.round(o[1],2));c=math.round(o[2]/1e3,1);p=(p=p.replace("alts",c)).replace("dates",moment(r[0][1]).utc().format("YYYY-MM-DD HH:mm:ss")),2==e.orbitType?viewer.entities.add({name:e.satSel,description:p,position:Cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]),billboard:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AIMCwEtIYadOQAAAclJREFUSMe1ls9qFEEQxn+dbF88xINbrieR4BvEJ8glIYh4EsKuIggheIh4EQKhDk18AQ++gHcPGtSA+ACibyAeEhC1lYCHRamE9VKBYTK7TG+Sgmaamvoz9dVX3QMtRdQa92cqojYnanMlPp3CHFv+fHJeCS6UVj3TFvdpbSZWkFNE1DrAxZzi71rgLnCQUzyaugKXFWBf1HrACBiJ2hVgD1gqhqhGx5BTfAWsAzvAdV+vgbWc4htRC8X0FbVZUVupOonaXVH756tfe3dT1GIJ37uiNhS1QS3Qmqg9qOkGbttthKiprJziL2AeeCRqfW/2AtAFeqK24Lo+sAHMu88JuMPxhPoQVXk+crwXgYdAD7jh7z4BP4DnwAfgCxAqvkNgO6f4Z6YlarMNuiP/iDDJMYgaOcWmPvScOc9yii8comNa7uYUP4vaKvAYuJ1T/NZ6CEXtkjfuXq2h9xuavOq2l0tY1BG1Ww2B/o6h6bJPfPG5HyrBP4raO1F76/tB1WYcJKFFwmXgpTNq09VPga/AnZzizmnPovfANW9iAEJO8TtwFdg91X3gDDsEfo4ZRsaxsFUFkxzb2pTeaMPSG600wTbnJdP+tvwHQH/c3vjnMgoAAAAASUVORK5CYII="}}):viewer.entities.add({name:e.satSel,description:p,position:Cesium.Cartesian3.fromDegrees(o[0],o[1]),billboard:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AIMCwEtIYadOQAAAclJREFUSMe1ls9qFEEQxn+dbF88xINbrieR4BvEJ8glIYh4EsKuIggheIh4EQKhDk18AQ++gHcPGtSA+ACibyAeEhC1lYCHRamE9VKBYTK7TG+Sgmaamvoz9dVX3QMtRdQa92cqojYnanMlPp3CHFv+fHJeCS6UVj3TFvdpbSZWkFNE1DrAxZzi71rgLnCQUzyaugKXFWBf1HrACBiJ2hVgD1gqhqhGx5BTfAWsAzvAdV+vgbWc4htRC8X0FbVZUVupOonaXVH756tfe3dT1GIJ37uiNhS1QS3Qmqg9qOkGbttthKiprJziL2AeeCRqfW/2AtAFeqK24Lo+sAHMu88JuMPxhPoQVXk+crwXgYdAD7jh7z4BP4DnwAfgCxAqvkNgO6f4Z6YlarMNuiP/iDDJMYgaOcWmPvScOc9yii8comNa7uYUP4vaKvAYuJ1T/NZ6CEXtkjfuXq2h9xuavOq2l0tY1BG1Ww2B/o6h6bJPfPG5HyrBP4raO1F76/tB1WYcJKFFwmXgpTNq09VPga/AnZzizmnPovfANW9iAEJO8TtwFdg91X3gDDsEfo4ZRsaxsFUFkxzb2pTeaMPSG600wTbnJdP+tvwHQH/c3vjnMgoAAAAASUVORK5CYII="}}),getSateliteDetail(e,o,r)}else jAlert2("No data","error")}function getLocationsError(e,A,t){jAlert2("Server request error:\n HTTP error: "+t+"\n "+A+"\n ","error")}function sph2car(e,A,t){var a=[],i=math.PI/180,r=math.PI/2-A*i;return a.push(e*Math.sin(r)*Math.cos(t*i)),a.push(e*Math.sin(r)*Math.sin(t*i)),a.push(e*Math.cos(r)),a}function car2sph(e,A,t){var a,i,r=[],o=Math.PI/180,n=e*e+A*A,s=math.sqrt(n+t*t);return 0==n?(a=0,r.push(a),t<0?(i=-90,r.push(i)):(i=90,r.push(i)),r.push(s),r):(n=math.sqrt(n),a=math.atan2(A,e)/o,i=90-math.atan2(n,t)/o,r.push(a),r.push(i),r.push(s),r)}function geo2gdzProj4(e,A,t,a,i){var r,o,n,s,l,d,c,m,p,u,g,h,v,f,b,S,D=[],w=a*a,I=i*i,C=(w-I)/w,T=(w-I)/I,y=math.PI/2;if(v=!1,0!=e)f=math.atan2(A,e);else if(A>0)f=y;else if(A<0)f=-y;else if(v=!0,f=0,t>0)b=y;else{if(!(t<0))return b=y,S=i,D.push(180*f/math.PI),D.push(180*b/math.PI),D.push(S),D;b=-y}return o=e*e+A*A,n=1.0026*t,h=(r=math.sqrt(o))-a*C*(m=r/(l=math.sqrt(n*n+o)))*m*m,p=(s=t+i*T*((c=n/l)*c*c))/(d=math.sqrt(s*s+h*h)),u=h/d,g=a/math.sqrt(1-C*p*p),S=u>=.3826834323650898?r/u-g:u<=-.3826834323650898?r/-u-g:t/p+g*(C-1),0==v&&(b=math.atan(p/u)),D.push(180*f/math.PI),D.push(180*b/math.PI),D.push(S),D}function geo2gdz(e,A,t){var a=[],i=(math.pow(6378.16,2),math.pow(6356.775,2)),r=180/math.PI,o=math.atan2(A/r,e/r);a.push(math.round(180*o/math.PI,13));var n=math.sqrt(e*e+A*A),s=math.atan2(t,n);a.push(math.round(180*s/math.PI,13));var l=math.cos(s);return l<1e-15?(s/=r,(t-1)*math.sqrt(i)):n/l-1,a.push(0),$(location).attr("href").includes("sbesada")?a:[]}function getSatelites(){new Object;$.ajax({type:"GET",url:"https://sscweb.gsfc.nasa.gov/WS/sscr/2/observatories",data:{request:"sbesada"},dataType:"json",contentType:"application/json",success:displayObservatories,error:displayObservatoriesError})}function getSateliteDetail(e,A,t){var a="https://sscweb.gsfc.nasa.gov/WS/sscr/2";iso8601RegExp=new RegExp("(\\d{4})-(\\d{2})-(\\d{2})([T\\s](\\d{2}))?(:(\\d{2}))?(:(\\d{2}))?(\\.(\\d{3}))?Z?");var i=moment(e.startDateDatepicker,"MM/DD/YYYY").format("YYYY-MM-DD")+" "+e.startHourTimepicker,r=moment(e.endDateDatepicker,"MM/DD/YYYY").format("YYYY-MM-DD")+" "+e.endHourTimepicker;if(iso8601RegExp.test(i))if(i=getIso8601FromInput(i),iso8601RegExp.test(r))if(r=getIso8601FromInput(r),getDateFromIso8601(i)>=getDateFromIso8601(r))jAlert2("Start Time must be less than Stop Time","error");else{var o="<TimeInterval><Start>"+i+"</Start><End>"+r+"</End></TimeInterval>",n="";satId=e.satSel,n+="<Satellites><Id>"+satId+"</Id><ResolutionFactor>2</ResolutionFactor></Satellites>";var s='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><GraphRequest xmlns="http://sscweb.gsfc.nasa.gov/schema">',l='<BFieldModel><InternalBFieldModel>IGRF-10</InternalBFieldModel><ExternalBFieldModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Tsyganenko89cBFieldModel"><KeyParameterValues>KP3_3_3</KeyParameterValues></ExternalBFieldModel><TraceStopAltitude>100</TraceStopAltitude></BFieldModel>',d=(new Object,s+o+l+n+getGraphOptions("Orbit")+"</GraphRequest>"),c={control:e,coordinates:A,time:t,orbitGif:"",orbitPdf:"",mappedGif:"",mappedPdf:"",seriesGif:"",seriesPdf:""};_.delay(function(){addSatelliteDetail(c,{name:"orbitGif",value:"error"},{name:"orbitPdf",value:"error"})},5e3),_.delay(function(){addSatelliteDetail(c,{name:"seriesGif",value:"error"},{name:"seriesPdf",value:"error"})},5e3),_.delay(function(){addSatelliteDetail(c,{name:"mappedGif",value:"error"},{name:"mappedPdf",value:"error"})},5e3),$.ajax({type:"POST",url:a+"/graphs",data:d,dataType:"xml",contentType:"application/xml",processData:!1,success:_.bind(displayPlotOrbit,this,c),error:plotError}),_.delay(function(){var e=s+o+l+n+getGraphOptions("Mapped")+"</GraphRequest>";$.ajax({type:"POST",url:a+"/graphs",data:e,dataType:"xml",contentType:"application/xml",processData:!1,success:_.bind(displayPlotMapped,this,c),error:plotError})},500);var m=s+o+l+n+getGraphOptions()+"</GraphRequest>";_.delay(function(){$.ajax({type:"POST",url:a+"/graphs",data:m,dataType:"xml",contentType:"application/xml",processData:!1,success:_.bind(displayPlot,this,c),error:plotError})},1e3)}else jAlert2("Invalid Stop Time","error");else jAlert2("Invalid Start Time","error")}function addSatelliteDetail(e,A,t){if("orbitGif"==A.name&&(e.orbitGif=A.value),"orbitPdf"==t.name&&(e.orbitPdf=t.value),"mappedGif"==A.name&&(e.mappedGif=A.value),"mappedPdf"==t.name&&(e.mappedPdf=t.value),"seriesGif"==A.name&&(e.seriesGif=A.value),"seriesPdf"==t.name&&(e.seriesPdf=t.value),""!=e.orbitGif&&""!=e.orbitPdf&&""!=e.mappedGif&&""!=e.mappedPdf&&""!=e.seriesGif&&""!=e.seriesPdf){var a=$("#satelliteDetail").html(),i=e.coordinates;a=(a=a.replace("longs",math.round(i[i.length-3],2))).replace("lats",math.round(i[i.length-2],2));var r=math.round(i[i.length-1]/1e3,1);a=(a=(a=(a=(a=(a=(a=(a=a.replace("alts",r)).replace("dates",moment(e.time[e.time.length-1][1]).utc().format("YYYY-MM-DD HH:mm:ss"))).replace("orbitGif",e.orbitGif)).replace("orbitPdf",e.orbitPdf)).replace("mappedGif",e.mappedGif)).replace("mappedPdf",e.mappedPdf)).replace("seriesGif",e.seriesGif)).replace("seriesPdf",e.seriesPdf);if(2==e.control.orbitType){if("moon"==e.control.satSel){var o=Cesium.buildModuleUrl("https://sbesada.github.io/online.nasa.satellite.tracker.3d/images/NasaMoon.jpg");viewer.entities.add({name:e.control.satSel,description:a,position:Cesium.Cartesian3.fromDegrees(i[i.length-3],i[i.length-2],i[i.length-1]),ellipsoid:{radii:new Cesium.Cartesian3(1737400,1737400,1737400),material:new Cesium.ImageMaterialProperty({image:o})}})}else{var n=getAstroImage(e.control.satSel);viewer.entities.add({name:e.control.satSel,description:a,position:Cesium.Cartesian3.fromDegrees(i[i.length-3],i[i.length-2],i[i.length-1]),billboard:{image:n}})}$("#alert").dialog("close")}else{n=getAstroImage(e.control.satSel);viewer.entities.add({name:e.control.satSel,description:a,position:Cesium.Cartesian3.fromDegrees(i[i.length-3],i[i.length-2]),billboard:{image:n}}),$("#alert").dialog("close")}isMobile()||viewer.zoomTo(viewer.entities)}}function displayPlotOrbit(e,A){for(var t={name:"orbitGif",value:"error"},a={name:"orbitPdf",value:"error"},i=$(A).find("Name").map(function(){return $(this).text()}).get(),r=0;r<i.length;r++)i[r].indexOf(".gif")===i[r].length-4?(e.orbitGif=i[r],t.value=i[r]):i[r].indexOf(".pdf")===i[r].length-4&&(e.orbitPdf=i[r],a.value=i[r]);addSatelliteDetail(e,t,a)}function displayPlotMapped(e,A){for(var t={name:"mappedGif",value:"error"},a={name:"mappedPdf",value:"error"},i=$(A).find("Name").map(function(){return $(this).text()}).get(),r=0;r<i.length;r++)i[r].indexOf(".gif")===i[r].length-4?(e.mappedGif=i[r],t.value=i[r]):i[r].indexOf(".pdf")===i[r].length-4&&(e.mappedPdf=i[r],a.value=i[r]);addSatelliteDetail(e,t,a)}function displayPlot(e,A){for(var t={name:"seriesGif",value:"error"},a={name:"seriesPdf",value:"error"},i=$(A).find("Name").map(function(){return $(this).text()}).get(),r=0;r<i.length;r++)i[r].indexOf(".gif")===i[r].length-4?(e.seriesGif=i[r],t.value=i[r]):i[r].indexOf(".pdf")===i[r].length-4&&(e.seriesPdf=i[r],a.value=i[r]);addSatelliteDetail(e,t,a)}function getIso8601FromInput(e){for(var A=iso8601RegExp.exec(e),t=0;t<A.length;t++)void 0===A[t]&&(A[t]="00");return A[1]+"-"+A[2]+"-"+A[3]+"T"+A[5]+":"+A[7]+":"+A[9]+".000Z"}function plotError(e,A,t){var a=$.parseXML(e.responseText);jAlert2("Server request error:\n HTTP error: "+t+"\n "+$(a).find(".ErrorMessage").text()+"\n "+$(a).find(".ErrorDescription").text(),"error")}function getGraphOptions(e){return"Orbit"==e?'<GraphOptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="OrbitGraphOptions"><CoordinateSystem>Gse</CoordinateSystem><Combined>true</Combined><XyView>true</XyView><XzView>true</XzView><YzView>true</YzView><XrView>true</XrView><SunToRight>false</SunToRight><EvenAxesScale>false</EvenAxesScale><ShowBowShockMagnetopause>true</ShowBowShockMagnetopause><SolarWindPressure>2.1</SolarWindPressure><ImfBz>0.0</ImfBz></GraphOptions>':"Mapped"==e?'<GraphOptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MapProjectionGraphOptions"><Trace>BFieldNorth</Trace><CoordinateSystem>Geo</CoordinateSystem><ShowContinents>true</ShowContinents><Projection>Cylindrical</Projection><GroundStations>FSMI</GroundStations><GroundStations>WHOR</GroundStations><GroundStations>FSIM</GroundStations><GroundStations>GAK</GroundStations><MapLimits><MinLatitude>-90.0</MinLatitude><MaxLatitude>90.0</MaxLatitude><MinLongitude>-180.0</MinLongitude><MaxLongitude>180.0</MaxLongitude></MapLimits><PolarMapOrientation>Equatorial</PolarMapOrientation><LongitudeVerticalDown>0.0</LongitudeVerticalDown><Title>Mapped Plot Test</Title></GraphOptions>':'<GraphOptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="TimeSeriesGraphOptions"><CoordinateOptions><CoordinateSystem>Gse</CoordinateSystem><Component>X</Component></CoordinateOptions><CoordinateOptions><CoordinateSystem>Gse</CoordinateSystem><Component>Y</Component></CoordinateOptions><CoordinateOptions><CoordinateSystem>Gse</CoordinateSystem><Component>Z</Component></CoordinateOptions><ValueOptions><RadialDistance>true</RadialDistance><BFieldStrength>true</BFieldStrength><DipoleLValue>true</DipoleLValue><DipoleInvLat>true</DipoleInvLat></ValueOptions><DistanceFromOptions><NeutralSheet>true</NeutralSheet><BowShock>true</BowShock><MPause>true</MPause><BGseXYZ>true</BGseXYZ></DistanceFromOptions><BFieldTraceOptions><CoordinateSystem>Geo</CoordinateSystem><Hemisphere>North</Hemisphere><FootpointLatitude>true</FootpointLatitude><FootpointLongitude>true</FootpointLongitude><FieldLineLength>true</FieldLineLength></BFieldTraceOptions></GraphOptions>'}function getDateFromIso8601(e){for(var A=iso8601RegExp.exec(e),t=0;t<A.length;t++)void 0===A[t]&&(A[t]=0);return new Date(Date.UTC(A[1],A[2]-1,A[3],A[5],A[7],A[9],A[11]))}function validTimeRange(e,A,t){var a=getDateFromIso8601(e.StartTime),i=getDateFromIso8601(e.EndTime);return A>=a&&t<=i?"":"Time range outside of data for "+e.Name+".\n\nIt must be within "+e.StartTime+"\nto "+e.EndTime+"."}function displayObservatories(e){excelData=[],observatoriesCache=[],observatoriesRealTime=[];var A,t={id:"",timeStart:"",timeEnd:""},a=new Object;e.Observatory[1].sort(function(e,A){return e.Name<A.Name?-1:e.Name>A.Name?1:0});for(var i=0;i<e.Observatory[1].length;i++){observ=e.Observatory[1][i];var r=[observ.Id,observ.Name,observ.Resolution,observ.StartTime[1],observ.EndTime[1],observ.ResourceId];if(excelData.push(r),A!=observ.Name)if(a[observ.Id]=observ,"ace"==observ.Id){$("#satSel").append('<option value="'+observ.Id+'" title="'+observ.StartTime[1]+" to "+observ.EndTime[1]+'" selected="selected">'+observ.Name+"</option>");t={id:observ.Id,timeStart:observ.StartTime[1],timeEnd:observ.EndTime[1]};observatoriesCache.push(t),moment.utc(t.timeEnd).isAfter(moment.utc(new Date))&&observatoriesRealTime.push(t)}else{$("#satSel").append('<option value="'+observ.Id+'" title="'+observ.StartTime[1]+" to "+observ.EndTime[1]+'">'+observ.Name+"</option>");t={id:observ.Id,timeStart:observ.StartTime[1],timeEnd:observ.EndTime[1]};observatoriesCache.push(t),moment.utc(t.timeEnd).isAfter(moment.utc(new Date))&&observatoriesRealTime.push(t)}A=observ.Name}createPopup()}function displayObservatoriesError(e,A,t){jAlert2("Server request error:\n HTTP error: "+t+"\n "+A+"\n ","error")}function jAlert2(e,A){var t="alert-success_dialog";A&&"error"==A?(t="alert-danger_dialog",_.delay(function(){$("#alert").dialog("close")},5e3)):A&&"warning"==A&&(t="alert-warning_dialog",_.delay(function(){$("#alert").dialog("close")},5e3)),$("#alert").dialog("instance")&&($($("#alert").siblings()[1]).removeClass("alert-danger_dialog"),$($("#alert").siblings()[1]).removeClass("alert-success_dialog"),$($("#alert").siblings()[1]).removeClass("alert-warning_dialog"),$($("#alert").siblings()[1]).addClass(t),$("#alert.ui-widget-content").css({color:"#ffffff"}));var a=$("#toolbar");$("#alert").html(e).dialog({resizable:!1,modal:!1,dialogClass:t,show:"blind",hide:"blind",create:function(e,A){$($("#alert").siblings()[0]).hide(),$($("#alert").siblings()[1]).addClass(t),$("#alert.ui-widget-content").css({color:"#ffffff"})},position:{my:"left top",at:"left+10 top+45",of:a},buttons:[{text:"Close",click:function(){$(this).dialog("close")},class:t}]})}function isMobile(){return!!(screen.availWidth<=800||window.innerWidth<=800||navigator.userAgent.toLowerCase().includes("mobile"))}function getAstroImage(e){return"moon"==e||"mars"==e||"mercury"==e||"sun"==e?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AMGCiIWfTugnwAAB6lJREFUeNrt3U+IXVcdwPHv6EQtCd1kIVFrAi3UjS5KK5pI06q4daCIYpW3sAuLVFG6rYuuFFFEKbowYISIVNRZi2ItJF20Ff8hBTUaqqmC2YRJrTY1Lu4J73Uys+iqmdvPBx5z3zn3nMWBmfObc3/n3AIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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XBmC6cTBN0o4+qNpgK/27EwvXrvuSoIxru+IyeA8HdAtqMMwYVGpip3dA5c37fnsi55AMCi6L7hGAq6u7kjA/x9bIuIyyQkjDbUwZbFBOLavV+91Pfrqprclcv0cJ4TgpR27+Ims8ttQLPoUlZRmpn0XIDgKFXsy/s6LzVs/AcADSANQAKgAUlaBJc6aRdo59cuKc3JMD5PxwHvvbHqzjRBy48rkDUatNddirlr5wOyS8oo1VP+3UY9/9ExfryvmvjgYARADEJ60mwEIALIAUgwgV1fN0Xp9/nAwHE2qKjLkFntaQzOs3l5QaJJjEToUDmcURUkAiANITb79VB+xkxDNJCg5ecmTFd6EQFFTD2sAaAHQV+VbbtgpEDfp/fHiOwnplaP+68lRAAAAAElFTkSuQmCC"}function getGroundStationsSuccess(e){if(e&&e.GroundStation&&e.GroundStation[1]){for(var A=0;A<e.GroundStation[1].length;A++){var t=e.GroundStation[1][A],a=t.Name,i=t.Location.Latitude,r=t.Location.Longitude;"LAL"!=t.Id&&"AFA"!=t.Id&&"SLU"!=t.Id||r>0&&(r*=-1);var o=sph2car(6370.2,i,r),n=geo2gdz(o[0],o[1],o[2]),s=$("#satelliteDetailInit").html();s=(s=(s=s.replace("longs",n[0])).replace("lats",n[1])).replace("alts",0),viewer.entities.add({name:a,description:s,position:Cesium.Cartesian3.fromDegrees(n[0],n[1]),billboard:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAdZnpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZtpcly7sp3/YxQeAvpmOGgjPAMP398CihSpd971scNiSMXq9gaQmatJQGb/r/95zP/gTwm2mphKzS1ny5/YYvOdX6p9f96js/H++558ved+v26+3/C8FHgM72nen893Xk9/vlDi5/Xx+3VT5uc69XMh933h+yfozvr987n6uVDw73X3eW7a53s9/pjO56+fn8t+Lv7381hYjJW4XvDG7+CC5d+qu4T3t/M38K8LSR/ip4cUGv/GEP557cz3r38t3vdvf62d7Z/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VLP2TOzbx8GcRiuEtZrNW+slcqMa1UqF7ZpJs17HaTXxPQ9Jk3G9LpICsmuTaBphGNB1E07MTOObJVK6cu3MmTMLACKf6fn7v95aZNNLWK67XLt6Gb0/T3lri2q1wna1ilWv0WpaeG0Hz23TIxIkSUbqtOl4LkcLD/D5x06C+TZdu4EQ4hsbGxv/ebTv/eClH3d6cl8eO3CA0uKbdFIG26aJtb2N02zguW26vke+R6NX16g0mvSnVWY//FF27dxBpreHUqlEu91G1/WfnDt37kt3oOLBsdFnLv3uDw9KVnl26uRpGjWTumnS8V3CICCOIoZ3jnBk/BBGJouRTrEj04vfspDiCNu231mmKFdGR0fP/1dUXLhwIRdF8e8nJyce2rVnL4rRj6rraJoGcYTntLDMMnWzCkBfXx+GYaCqKp1OB8/zLqmq+uTZs2fbd2XRxYsXM67r/kzX9U/kcjn6+/vJZrPIsozjOJTLZSzLIkkSDMMgl8shSVK70+l8Z3p6+sWBgYH3YOc9LLIsi6tXr34hnU6/kMlkdmezWXp7e6nX66ytrVEul4miiGw2y/Dw8EsjIyPfmpiYuGuU3pWmpmkqW1tbT/T09JzWdX1idXX1Y81mU02lUui6TrFYZGV19ekXnn/+h++bB1EUiSRJpuI43h/H8WAURXKSJDuAfKFQEHEcy1999lnl1MmT6uzsLLt376ZarWJZFv253HOO44wDpiRJNVmWAyHEthBiTZKkf8iyHCndbvf7pmmet20b3/cJgoAwDInjmDiOSZKE8cOH8TyPYrFIHMfUajXK5QqKqo7Ozc2dF0IgyzKapqHrOplMhnw+/1Pgi1IQBGNBEHw6DMMDYRj2JkkyEsdxNo5jEcexSJJETpKEJEnuzFohkCQpEkLEQohYkqSmEKKsKEpbluWbmqb9SlXV5X8D7arHDsmnt6IAAAAASUVORK5CYII="}})}$("#alert").dialog("close")}else jAlert2("No data","error")}function downloadSatellites(){var e=new ExcelJS.Workbook,A=e.addWorksheet("Info");A.addRow(["Id","Name","Resolution","Start Time","End Time","Resource"]).eachCell(function(e,A){e.fill={type:"pattern",pattern:"solid",fgColor:{argb:"0781AB"},bgColor:{argb:"0781AB"}},e.border={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}}}),A.getColumn(1).width=20,A.getColumn(2).width=25,A.getColumn(3).width=15,A.getColumn(4).width=35,A.getColumn(5).width=35,A.getColumn(6).width=50;var t=excelData;A.addRows(t),e.xlsx.writeBuffer().then(function(e){var A=new Blob([e],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),t="satellites&Astros"+(new Date).toUTCString()+".xlsx";if(navigator&&navigator.msSaveBlob)navigator.msSaveBlob(A,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},t);else{var a=document.createElement("a");url=URL.createObjectURL(A),a.href=url,a.download=t,document.body.appendChild(a),a.click(),a.remove()}})}function getCurrentDate(){var e=new Date,A="";A=1==(e.getMonth()+1).toString().length?"0"+(e.getMonth()+1):e.getMonth()+1;var t="";return t=1==e.getDate().toString().length?"0"+e.getDate():e.getDate(),e.getFullYear()+"-"+A+"-"+t}function showSatInRealTime(){_.each(minitIntervalList,function(e){clearInterval(e)}),minitCount=[];iso8601RegExp=new RegExp("(\\d{4})-(\\d{2})-(\\d{2})([T\\s](\\d{2}))?(:(\\d{2}))?(:(\\d{2}))?(\\.(\\d{3}))?Z?");var e=moment(new Date),A=moment(new Date).add(60,"minutes"),t=e.utc().format("YYYY-MM-DD HH:mm:ss"),a=A.utc().format("YYYY-MM-DD HH:mm:ss");if(iso8601RegExp.test(t)){t=getIso8601FromInput(t);if(iso8601RegExp.test(a)){a=getIso8601FromInput(a);if(getDateFromIso8601(t)>=getDateFromIso8601(a))jAlert2("Start Time must be less than Stop Time","error");else{$("#satSel").val();var i=t.replace(/-\s*/g,"");i=(i=i.replace(/:\s*/g,"")).replace(".000","");var r=a.replace(/-\s*/g,"");r=(r=r.replace(/:\s*/g,"")).replace(".000",""),$("#alert").dialog("close");var o=0;_.each(observatoriesRealTime,function(e){_.delay(function(){$.ajax({type:"GET",url:"https://sscweb.gsfc.nasa.gov/WS/sscr/2/locations/"+e.id+"/"+i+","+r+"/geo/",data:{},dataType:"json",contentType:"application/json",success:_.bind(addSatellitesInRealTimeToMap,this,e.id,t)})},o),o+=150})}}else jAlert2("Invalid Stop Time","error")}else jAlert2("Invalid Start Time","error")}function addSatellitesInRealTimeToMap(e,A,t){if(null!=t.Result.Data){for(var a=t.Result.Data[1][0].Coordinates[1][0].X[1],i=t.Result.Data[1][0].Coordinates[1][0].Y[1],r=t.Result.Data[1][0].Coordinates[1][0].Z[1],o=t.Result.Data[1][0].Time[1],n=[],s=[],l=0;l<a.length;l++){var d=geo2gdzProj4(a[l],i[l],r[l],6378.137,6356.7523142);n.push(d[0]),n.push(d[1]),n.push(1e3*d[2]),s.push(moment(o[l][1]).utc().format("YYYY-MM-DD HH:mm:ss"))}minitCount.push({id:e,coord:0,time:0}),paintSatellitesInRealTime(e,n,s),minitIntervalList.push(setInterval(_.bind(paintSatellitesInRealTime,this,e,n,s),6e4))}}function paintSatellitesInRealTime(e,A,t){var a=_.findWhere(minitCount,{id:e}),i=moment(new Date).utc().add(59,"seconds").format("YYYY-MM-DD HH:mm:ss"),r=moment(t[a.time]).format("YYYY-MM-DD HH:mm:ss");if(moment(i).isAfter(r)){var o=$("#satelliteDetailInit").html();o=(o=o.replace("longs",math.round(A[a.coord],2))).replace("lats",math.round(A[a.coord+1],2));var n=math.round(A[a.coord+2]/1e3,1);o=(o=o.replace("alts",n)).replace("dates",t[a.time]),a.coord=a.coord+3,a.time=a.time+1;var s=getAstroImage(e);if(null!=interval){var l=viewer.entities.getById(e);null!=l&&null!=l&&viewer.entities.remove(l),viewer.entities.add({id:e,name:e,description:o,position:Cesium.Cartesian3.fromDegrees(A[a.coord],A[a.coord+1]),billboard:{image:s}})}}}$(document).ready(function(){$("#satelliteDetail").load("https://sbesada.github.io/online.nasa.satellite.tracker.3d/templates/satelliteDetail.html"),$("#satelliteDetailInit").load("https://sbesada.github.io/online.nasa.satellite.tracker.3d/templates/satelliteDetailInit.html"),getSatelites(),$(location).attr("href").includes("sbesada")&&(Cesium.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlOGNiNWRhNC05ZWJhLTRiZWEtODk2ZC0yNDAzMzVkZjNiNTEiLCJpZCI6MjAzMTYsInNjb3BlcyI6WyJhc2wiLCJhc3IiLCJhc3ciLCJnYyJdLCJpYXQiOjE1NzcyMTE3Mzd9.DAwN8uXToLHhXiM0p92MBYF8tuMkfzOBOgScFQYu1NQ"),earthProvider=new Cesium.WebMapTileServiceImageryProvider({url:"https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/wmts.cgi?TIME=2020-03-21",layer:"BlueMarble_NextGeneration",style:"",format:"image/jpeg",tileMatrixSetID:"GoogleMapsCompatible_Level8",maximumLevel:8,tileWidth:256,tileHeight:256,tilingScheme:new Cesium.WebMercatorTilingScheme,credit:new Cesium.Credit("NASA Global Imagery Browse Services")}),viewer=new Cesium.Viewer("cesiumContainer",{sceneMode:Cesium.SceneMode.SCENE3D,imageryProvider:earthProvider,baseLayerPicker:!1,geocoder:!1,mapProjection:new Cesium.WebMercatorProjection}),viewer.scene.moon=new Cesium.Moon,viewer.scene.moon.show=!1,$("#control").on("click",function(){if(!$("#dialog").dialog("instance")||!$("#dialog").dialog("isOpen")){$("#layersDialog").dialog("instance")&&$("#layersDialog").dialog("isOpen")&&$("#layersDialog").dialog("close"),$("#aboutDialog").dialog("instance")&&$("#aboutDialog").dialog("isOpen")&&$("#aboutDialog").dialog("close");var e="Satellites & Astros (draggable)";isMobile()&&(e="Satellites & Astros",screen.availWidth>screen.availHeight||window.innerWidth>window.innerHeight)?jAlert2("Not available in landscape mode","error"):$("#dialog").dialog({minWidth:385,maxHeight:405,resizable:!1,title:e,dialogClass:"cesium-infoBox cesium-infoBox-visible"})}}),$("#add").on("click",function(){""!=$("#satSel").val()&&""!=$("#startDateDatepicker").val()&&""!=$("#startHourTimepicker").val()&&""!=$("#endDateDatepicker").val()&&""!=$("#endHourTimepicker").val()&&""!=$("#orbitType").val()&&""!=$("#inputColor").val()?(isMobile()&&$("#dialog").dialog("close"),jAlert2("Loading"),satelliteAdd()):jAlert2("All fileds are mandatory","error")}),$("#clean").on("click",function(){cleanAll(),$(".cesium-home-button").click()}),$("#layers").on("click",function(){if($("#dialog").dialog("instance")&&$("#dialog").dialog("isOpen")&&$("#dialog").dialog("close"),$("#aboutDialog").dialog("instance")&&$("#aboutDialog").dialog("isOpen")&&$("#aboutDialog").dialog("close"),!$("#layersDialog").dialog("instance")||!$("#layersDialog").dialog("isOpen")){var e="Layers (draggable)";isMobile()&&(e="Layers",screen.availWidth>screen.availHeight||window.innerWidth>window.innerHeight)?jAlert2("Not available in landscape mode","error"):$("#layersDialog").dialog({minWidth:370,maxHeight:405,resizable:!1,title:e,dialogClass:"cesium-infoBox cesium-infoBox-visible"})}}),$("#about").on("click",function(){if($("#dialog").dialog("instance")&&$("#dialog").dialog("isOpen")&&$("#dialog").dialog("close"),$("#layersDialog").dialog("instance")&&$("#layersDialog").dialog("isOpen")&&$("#layersDialog").dialog("close"),!$("#aboutDialog").dialog("instance")||!$("#aboutDialog").dialog("isOpen"))if(isMobile()&&(screen.availWidth>screen.availHeight||window.innerWidth>window.innerHeight))jAlert2("Not available in landscape mode","error");else{$("#aboutDialog").dialog({minWidth:385,maxHeight:400,resizable:!1,title:"About",dialogClass:"cesium-infoBox cesium-infoBox-visible"})}}),$("#addLayers").on("click",function(){if(jAlert2("Loading"),$("#groundStation").is(":checked")&&$.ajax({type:"GET",url:"https://sscweb.gsfc.nasa.gov/WS/sscr/2/groundStations",data:{request:"sbesada"},dataType:"json",contentType:"application/json",success:getGroundStationsSuccess,error:displayObservatoriesError}),interval=null,minitIntervalList=[],minitCount=[],$("#satRealTime").is(":checked")&&(showSatInRealTime(),interval=setInterval(showSatInRealTime,3e5)),$("#earthToday").is(":checked")){var e=new Cesium.WebMapTileServiceImageryProvider({url:"https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/wmts.cgi?TIME="+getCurrentDate(),layer:"MODIS_Terra_CorrectedReflectance_TrueColor",style:"",format:"image/jpeg",tileMatrixSetID:"GoogleMapsCompatible_Level9",maximumLevel:9,tileWidth:256,tileHeight:256,tilingScheme:new Cesium.WebMercatorTilingScheme,credit:new Cesium.Credit("NASA Global Imagery Browse Services")});viewer.imageryLayers.addImageryProvider(e),$("#alert").dialog("close")}else if($("#openStreet").is(":checked")){var A=new Cesium.OpenStreetMapImageryProvider({url:"https://a.tile.openstreetmap.org/"});viewer.imageryLayers.addImageryProvider(A),$("#alert").dialog("close")}else if($("#nightEarth").is(":checked")){var t=new Cesium.WebMapTileServiceImageryProvider({url:"https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/wmts.cgi",layer:"VIIRS_Black_Marble",style:"",format:"image/png",tileMatrixSetID:"GoogleMapsCompatible_Level8",maximumLevel:8,tileWidth:256,tileHeight:256,tilingScheme:new Cesium.WebMercatorTilingScheme,credit:new Cesium.Credit("NASA Global Imagery Browse Services")});viewer.imageryLayers.addImageryProvider(t),$("#alert").dialog("close")}else if($("#mapboxStreet").is(":checked")){var a=new Cesium.MapboxImageryProvider({mapId:"mapbox.streets",accessToken:"pk.eyJ1Ijoic2Jlc2FkYSIsImEiOiJja2llcjMwcjcwZWJhMzJsYjdkcjdqZDBrIn0.QNR_lQ5qEkwyE7gWL0a79w"});viewer.imageryLayers.addImageryProvider(a),$("#alert").dialog("close")}else if($("#esriWorld").is(":checked")){var i=new Cesium.ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",credit:new Cesium.Credit("ESRI, i-cubed, USDA FSA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGP")});viewer.imageryLayers.addImageryProvider(i),$("#alert").dialog("close")}}),$("#cleanAllLayers").on("click",function(){cleanAll(),viewer.imageryLayers.addImageryProvider(earthProvider),null!=interval&&(clearInterval(interval),interval=null),_.each(minitIntervalList,function(e){clearInterval(e)}),minitCount=[]}),$("#downloadSatellites").on("click",function(){downloadSatellites()}),$("#earthToday").on("click",function(){$("#earthToday").is(":checked")&&($("#nightEarth").prop("checked",!1),$("#openStreet").prop("checked",!1),$("#mapboxStreet").prop("checked",!1),$("#esriWorld").prop("checked",!1))}),$("#nightEarth").on("click",function(){$("#nightEarth").is(":checked")&&($("#earthToday").prop("checked",!1),$("#openStreet").prop("checked",!1),$("#mapboxStreet").prop("checked",!1),$("#esriWorld").prop("checked",!1))}),$("#openStreet").on("click",function(){$("#openStreet").is(":checked")&&($("#nightEarth").prop("checked",!1),$("#earthToday").prop("checked",!1),$("#mapboxStreet").prop("checked",!1),$("#esriWorld").prop("checked",!1))}),$("#mapboxStreet").on("click",function(){$("#mapboxStreet").is(":checked")&&($("#nightEarth").prop("checked",!1),$("#earthToday").prop("checked",!1),$("#openStreet").prop("checked",!1),$("#esriWorld").prop("checked",!1))}),$("#esriWorld").on("click",function(){$("#esriWorld").is(":checked")&&($("#nightEarth").prop("checked",!1),$("#earthToday").prop("checked",!1),$("#mapboxStreet").prop("checked",!1),$("#openStreet").prop("checked",!1))})});