Exemple #1
0
        public void mouseWindow(int windowID)
        {
            Cell cell = hoverCell.Value;

            float lat = WeatherFunctions.GetCellLatitude(cell);
            float lon = WeatherFunctions.GetCellLongitude(cell);

            GUILayout.BeginVertical();

            GUILayout.Label(String.Format("Cell: {0:D5}   cycle: {1:D}", cell.Index, CellUpdater.run));
            GUILayout.Label("Lat: " + lat + " °");
            GUILayout.Label("Lon: " + lon + " °");
            GUILayout.Label(String.Format("Geodesic: {0:G}", Math.Sqrt(cell.Position.x * cell.Position.x + cell.Position.y * cell.Position.y + cell.Position.z * cell.Position.z)));
            GUILayout.Label(String.Format("ΔT(KSP-KWS): {0:+0.000;-0.000}°", (WeatherSimulator.GetInitTemperature(PD, currentLayer, cell) - WeatherFunctions.GetCellTemperature(PD.index, currentLayer, cell))));
            double DDD  = 0.0;
            double DDD2 = 0.0;
            int    n    = 0;

            foreach (Cell neighbor in cell.GetNeighbors(PD.gridLevel))
            {
                double DeltaDistance = WeatherFunctions.GetDistanceBetweenCells(PD.index, cell, neighbor, WeatherFunctions.GetCellAltitude(PD.index, currentLayer, cell));
                DDD  += DeltaDistance;
                DDD2 += DeltaDistance * DeltaDistance;
                n++;
            }
            DDD  /= n;
            DDD2 /= n;
            GUILayout.Label(String.Format("ΔDistanceδ:  {0:0.000000}", Math.Sqrt(Math.Abs(DDD2 - DDD * DDD)) / DDD));
            GUILayout.Label(String.Format("flowPChange: {0:+00.000;-00.000}", PD.LiveMap[currentLayer][cell].flowPChange));
            GUILayout.EndVertical();
        }
Exemple #2
0
        public void mouseWindow(int windowID)
        {
            Cell cell = hoverCell.Value;

            float lat = WeatherFunctions.GetCellLatitude(cell);
            float lon = WeatherFunctions.GetCellLongitude(cell);

            GUILayout.BeginVertical();

            GUILayout.Label(String.Format("Cell: {0:D5}   cycle: {1:D}", cell.Index, CellUpdater.run));
            GUILayout.Label("Lat: " + lat + " °");
            GUILayout.Label("Lon: " + lon + " °");
            GUILayout.Label(String.Format("Geodesic: {0:G}", Math.Sqrt(cell.Position.x * cell.Position.x + cell.Position.y * cell.Position.y + cell.Position.z * cell.Position.z)));
            GUILayout.Label(String.Format("ΔT(KSP-KWS): {0:+0.000;-0.000}°", (WeatherSimulator.GetInitTemperature(PD, currentLayer, cell) - WeatherFunctions.GetCellTemperature(PD.index, currentLayer, cell))));
            GUILayout.Label(String.Format("δ Temp: {0:+0.000000;-0.000000}°/s", currentLayer < PD.LiveMap.Count ? PD.LiveMap[currentLayer][cell].TempChange : PD.LiveStratoMap[currentLayer - PD.LiveMap.Count][cell].TempChange));
            double DDD  = 0.0;
            double DDD2 = 0.0;
            int    n    = 0;

            foreach (Cell neighbor in cell.GetNeighbors(PD.gridLevel))
            {
                double DeltaDistance = WeatherFunctions.GetDistanceBetweenCells(PD.index, cell.Position, neighbor.Position, WeatherFunctions.GetCellAltitude(PD.index, currentLayer, cell));
                DDD  += DeltaDistance;
                DDD2 += DeltaDistance * DeltaDistance;
                n++;
            }
            DDD  /= n;
            DDD2 /= n;
            GUILayout.Label(String.Format("ΔDistanceδ:  {0:0.000000}", Math.Sqrt(Math.Abs(DDD2 - DDD * DDD)) / DDD));
            GUILayout.Label(String.Format("CentroidΔ: {0:0.000000}", (cell.Position - PD.LiveSoilMap[cell].centroid).magnitude));
            GUILayout.Label(String.Format("flowPChange: {0:+00.000;-00.000}", currentLayer < PD.LiveMap.Count ? PD.LiveMap[currentLayer][cell].flowPChange : PD.LiveStratoMap[currentLayer - PD.LiveMap.Count][cell].flowPChange));
            GUILayout.Label(String.Format("Pressure Δ: {0:+000.00;-000.00}", currentLayer < PD.LiveMap.Count ?
                                          ((PD.LiveMap[0][cell].pressure - FlightGlobals.getStaticPressure(0, PD.body) * 1000) * PD.LiveMap[currentLayer][cell].pressure / PD.LiveMap[0][cell].pressure + PD.LiveMap[currentLayer][cell].flowPChange) :
                                          ((PD.LiveMap[0][cell].pressure - FlightGlobals.getStaticPressure(0, PD.body) * 1000) * PD.LiveStratoMap[currentLayer - PD.LiveMap.Count][cell].pressure / PD.LiveMap[0][cell].pressure + PD.LiveStratoMap[currentLayer - PD.LiveMap.Count][cell].flowPChange)));
            GUILayout.EndVertical();
        }
Exemple #3
0
 internal static void InitBiomeMap(PlanetData PD)
 {
     foreach (Cell cell in Cell.AtLevel(PD.gridLevel))
     {
         PD.biomes[cell] = ScienceUtil.GetExperimentBiome(PD.body, WeatherFunctions.GetCellLatitude(cell), WeatherFunctions.GetCellLongitude(cell));
     }
 }