Esempio n. 1
0
 private void WarmOcclusionS(CloudORPS orp)
 {
     if (windDirection >= Util.windDirectionToInt["JZ"])
     {
         List <float> parameters = new List <float>()
         {
             (orp.temperature_850 >= 14 && orp.temperature_850 <= 17)?1:0,
             (orp.frontogenesis_850 >= 0.4f)?1:0,
             (orp.wetBulb >= 51)?1:0,
             //orp.dls>=15?1:0,
             (orp.sreh_3km >= 100f)?1:0,
             (orp.wind_300 >= 24f)?1:0
         };
         if (IsDay())
         {
             parameters.Add((orp.mlcape >= 100 && orp.mlcape <= 3600) ? 1 : 0);
         }
         else
         {
             parameters.Add((orp.mucape >= 75 && orp.mucape <= 5500) ? 1 : 0);
         }
         orp.warmOcclusionS = SumArray(parameters) / parameters.Count;
         orp.convectionTypeResults["Teplá okluze - supercelární bouře"] = orp.warmOcclusionS;
     }
     else
     {
         orp.warmOcclusionS = 0;
     }
 }
Esempio n. 2
0
 private void WavyColdFrontS(CloudORPS orp)
 {
     if (windDirection >= Util.windDirectionToInt["J"] && windDirection <= Util.windDirectionToInt["JZ"])
     {
         List <float> parameters = new List <float>()
         {
             (orp.temperature_850 >= 16 && orp.temperature_850 <= 20)?1:0,
             (orp.frontogenesis_850 >= 2f)?1:0,
             (orp.wetBulb >= 63f)?1:0,
             //orp.dls>=20?1:0,
             (orp.sreh_3km >= 300f)?1:0,
             (orp.wind_300 >= 21f)?1:0
         };
         if (IsDay())
         {
             parameters.Add((orp.mlcape >= 1000 && orp.mlcape <= 3600) ? 1 : 0);
         }
         else
         {
             parameters.Add((orp.mucape >= 1750 && orp.mucape <= 5500) ? 1 : 0);
         }
         orp.wavyColdFrontS = SumArray(parameters) / parameters.Count;
         orp.convectionTypeResults["Zvlněná studentá fronta - supercelární bouře"] = orp.wavyColdFrontS;
     }
     else
     {
         orp.wavyColdFrontS = 0;
     }
 }
Esempio n. 3
0
        public bool ORPSInsertOrUpdate(CloudORPS item)
        {
            using (IDbConnection conn = new SqlConnection(Model.ConnStr("Cloud")))
            {
                List <CloudORPS> records = new List <CloudORPS>();
                records.Add(item);
                conn.Execute("dbo.ORPS_InsertOrUpdateData @ID, @NAME", records);

                return(true);
            }
        }
Esempio n. 4
0
        private void QuasifontalConvection(CloudORPS orp)
        {
            if (windDirection >= Util.windDirectionToInt["Z"] || windDirection == Util.windDirectionToInt["S"])
            {
                float corfidiVectorCondition = 0;
                float mixrCondition          = 0;
                float wind_850Condition      = 0;
                float pwaterCondition        = 0;

                if (windDirection == Util.windDirectionToInt["Z"])
                {
                    corfidiVectorCondition = (orp.corfidiVector >= 6f && orp.corfidiVector <= 12f) ? 1 : 0;
                    mixrCondition          = (orp.mixr >= 8f && orp.mixr <= 14f) ? 1 : 0;
                    wind_850Condition      = (orp.wind_850 >= 1.5f && orp.wind_850 <= 17f) ? 1 : 0;
                    pwaterCondition        = (orp.pwater >= 22f && orp.pwater <= 40f) ? 1 : 0;
                }
                ;
                if (windDirection == Util.windDirectionToInt["SZ"])
                {
                    corfidiVectorCondition = (orp.corfidiVector >= 4f && orp.corfidiVector <= 15f) ? 1 : 0;
                    mixrCondition          = (orp.mixr >= 7f && orp.mixr <= 12f) ? 1 : 0;
                    wind_850Condition      = (orp.wind_850 >= 1.5f && orp.wind_850 <= 12f) ? 1 : 0;
                    pwaterCondition        = (orp.pwater >= 20f && orp.pwater <= 30f) ? 1 : 0;
                }
                ;
                if (windDirection == Util.windDirectionToInt["S"])
                {
                    corfidiVectorCondition = (orp.corfidiVector >= 2f && orp.corfidiVector <= 10f) ? 1 : 0;
                    mixrCondition          = (orp.mixr >= 6f && orp.mixr <= 12f) ? 1 : 0;
                    wind_850Condition      = (orp.wind_850 >= 1.5f && orp.wind_850 <= 12f) ? 1 : 0;
                    pwaterCondition        = (orp.pwater >= 15f && orp.pwater <= 30f) ? 1 : 0;
                }
                ;

                List <float> parameters = new List <float>()
                {
                    (orp.frontogenesis_850 >= -25f && orp.frontogenesis_850 <= -1.5f)?1:0,
                    (orp.potentional_orographic_lift >= 0.05f)?1:0,
                    corfidiVectorCondition,
                    mixrCondition,
                    wind_850Condition,
                    pwaterCondition
                };
                orp.quasifontalConvection = SumArray(parameters) / parameters.Count;
                orp.convectionTypeResults["Kvazifrontální konvekce"] = orp.quasifontalConvection;
            }
            else
            {
                orp.quasifontalConvection = 0;
            }
        }
Esempio n. 5
0
 private void OrographicConvection(CloudORPS orp)
 {
     if (windDirection == Util.windDirectionToInt["SZ"] || (windDirection >= Util.windDirectionToInt["SV"] && windDirection <= Util.windDirectionToInt["J"]))
     {
         List <float> parameters = new List <float>()
         {
             (orp.frontogenesis_850 >= -25f && orp.frontogenesis_850 <= 0.8f)?1:0,
             //orp.dls>=10?1:0,
             (orp.wind_850 <= 6f)?1:0,
             (orp.wind_300 <= 15)?1:0,
         };
         orp.orographicConvection = SumArray(parameters) / parameters.Count;
         orp.convectionTypeResults["Orografická konvekce"] = orp.orographicConvection;
     }
     else
     {
         orp.orographicConvection = 0;
     }
 }
Esempio n. 6
0
 private void WarmOcclusion(CloudORPS orp)
 {
     if (windDirection != Util.windDirectionToInt["S"] && windDirection != Util.windDirectionToInt["J"])
     {
         List <float> parameters = new List <float>()
         {
             (orp.frontogenesis_850 >= -0.2f)?1:0,
             //orp.dls>=10?1:0,
             (orp.sreh_3km >= 50f)?1:0,
             (orp.wind_300 >= 9f)?1:0,
         };
         orp.warmOcclusion = SumArray(parameters) / parameters.Count;
         orp.convectionTypeResults["Teplá okluze"] = orp.warmOcclusion;
     }
     else
     {
         orp.warmOcclusion = 0;
     }
 }
Esempio n. 7
0
 private void ColdOcclusion(CloudORPS orp)
 {
     if (windDirection >= Util.windDirectionToInt["Z"] || (windDirection >= Util.windDirectionToInt["SV"] && windDirection <= Util.windDirectionToInt["JV"]))
     {
         List <float> parameters = new List <float>()
         {
             (orp.frontogenesis_850 >= -0.2f && orp.frontogenesis_850 <= 0.8f)?1:0,
             (orp.corfidiVector >= 4f)?1:0,
             (orp.wetBulb >= 33f && orp.wetBulb <= 57f)?1:0,
             (orp.mixr >= 7f)?1:0,
             //orp.dls>=6?1:0
         };
         orp.coldOcclusion = SumArray(parameters) / parameters.Count;
         orp.convectionTypeResults["Studentá okluze"] = orp.coldOcclusion;
     }
     else
     {
         orp.coldOcclusion = 0;
     }
 }
Esempio n. 8
0
 private void ColdFront(CloudORPS orp)
 {
     if (windDirection >= Util.windDirectionToInt["Z"] || windDirection <= Util.windDirectionToInt["SV"])
     {
         List <float> parameters = new List <float>()
         {
             (orp.temperature_850 >= 10 && orp.temperature_850 <= 13)?1:0,
             (orp.frontogenesis_850 >= 1f)?1:0,
             (orp.corfidiVector >= 4f)?1:0,
             (orp.wetBulb >= 48f && orp.wetBulb <= 60f)?1:0,
             //orp.dls>=8?1:0
         };
         orp.coldFront = SumArray(parameters) / parameters.Count;
         orp.convectionTypeResults["Studentá fronta"] = orp.coldFront;
     }
     else
     {
         orp.coldFront = 0;
     }
 }
Esempio n. 9
0
 private void WavyColdFront(CloudORPS orp)
 {
     if (windDirection >= Util.windDirectionToInt["SV"] && windDirection <= Util.windDirectionToInt["JZ"])
     {
         List <float> parameters = new List <float>()
         {
             (orp.temperature_850 >= 14 && orp.temperature_850 <= 20)?1:0,
             (orp.frontogenesis_850 >= 2f)?1:0,
             (orp.corfidiVector >= 6f)?1:0,
             (orp.wetBulb >= 51f)?1:0,
             //orp.dls>=13?1:0
         };
         orp.wavyColdFront = SumArray(parameters) / parameters.Count;
         orp.convectionTypeResults["Zvlněná studentá fronta"] = orp.wavyColdFront;
     }
     else
     {
         orp.wavyColdFront = 0;
     }
 }
Esempio n. 10
0
 //Kombinovaná předpověď
 private void CombinePrecipitation(CloudORPS orp)
 {
     //Util.l($"Zvlněná studená fronta: {orp.convectionTypes.Keys.Contains("Zvlněná studentá fronta")}");
     if (orp.convectionTypes.Keys.Contains("Zvlněná studentá fronta"))
     {
         precipitationProbability(orp, 14, 20);
         precipitationProbability(orp, -300, 13, true); //Pouští se jen pro tento případ
     }
     if (orp.convectionTypes.Keys.Contains("Zvlněná studentá fronta - supercelární bouře"))
     {
         precipitationProbability(orp, 16, 20);
     }
     if (orp.convectionTypes.Keys.Contains("Studentá fronta"))
     {
         precipitationProbability(orp, 10, 13);
     }
     if (orp.convectionTypes.Keys.Contains("Studentá okluze"))
     {
         precipitationProbability(orp, 5, 13);
     }
     if (orp.convectionTypes.Keys.Contains("Teplá okluze"))
     {
         precipitationProbability(orp, 14, 18);
     }
     if (orp.convectionTypes.Keys.Contains("Teplá okluze - supercelární bouře"))
     {
         precipitationProbability(orp, 14, 17);
     }
     if (orp.convectionTypes.Keys.Contains("Kvazifrontální konvekce"))
     {
         precipitationProbability(orp, 7, 17);
     }
     if (orp.convectionTypes.Keys.Contains("Orografická konvekce"))
     {
         precipitationProbability(orp, 10, 19);
     }
     if (orp.convectionTypes.Keys.Contains("Orografická konvekce - linie konvergence"))
     {
         precipitationProbability(orp, 16, 19);
     }
 }
Esempio n. 11
0
 private void OrographicConvectionConvergenceLine(CloudORPS orp)
 {
     if (windDirection != Util.windDirectionToInt["S"] && windDirection != Util.windDirectionToInt["V"] && windDirection != Util.windDirectionToInt["Z"])
     {
         List <float> parameters = new List <float>()
         {
             (orp.temperature_850 >= 16 && orp.temperature_850 <= 19)?1:0,
             (orp.frontogenesis_850 >= -25f && orp.frontogenesis_850 <= 0.8f)?1:0,
             (orp.wetBulb >= 63f)?1:0,
             //orp.dls>=5f?1:0,
             (orp.wind_850 <= 3f)?1:0,
             (orp.pwater >= 38f)?1:0
         };
         orp.orographicConvectionConvergenceLine = SumArray(parameters) / parameters.Count;
         orp.convectionTypeResults["Orografická konvekce - linie konvergence"] = orp.orographicConvectionConvergenceLine;
     }
     else
     {
         orp.orographicConvectionConvergenceLine = 0;
     }
 }
Esempio n. 12
0
        public void ReadCSVFileORPS(string filename)
        {
            using (var reader = new StreamReader(filename)) {
                List <CloudORPS> listOfRecords = new List <CloudORPS>();
                var header = reader.ReadLine(); //načte hlavičku
                while (!reader.EndOfStream)
                {
                    var line   = reader.ReadLine();
                    var values = line.Split(';');

                    CloudORPS record = new CloudORPS(values[0], values[1]);
                    listOfRecords.Add(record);
                }

                Util.l(header);
                foreach (var r in listOfRecords)
                {
                    Util.l($"{r.id}:{r.name}");
                    Model.Cloud.ORPSInsertOrUpdate(r);
                }
            }
        }
Esempio n. 13
0
        //Předpověď typu konvekce
        private void ConvectionType(CloudORPS orp)
        {
            //Zvlněná studená fronta
            WavyColdFront(orp);
            //Zvlněná studená fronta - supercelární bouře
            WavyColdFrontS(orp);
            //Studená fronta
            ColdFront(orp);
            //Studená okluze
            ColdOcclusion(orp);
            //Teplá okluze
            WarmOcclusion(orp);
            //Teplá okluze - supercelární bouře
            WarmOcclusionS(orp);
            //Kvazifrontální konvekce
            QuasifontalConvection(orp);
            //Orografická konvekce
            OrographicConvection(orp);
            //Orografická konvekce - linie konvergence
            OrographicConvectionConvergenceLine(orp);

            var types = orp.convectionTypeResults.Where(p => p.Value.Equals(orp.convectionTypeResults.Values.Max()));

            foreach (var type in types)
            {
                //Util.l($" Nejvyšší hodnotu: {type.Value} má {type.Key}");
                orp.convectionTypes[type.Key] = type.Value;
            }

            /*
             * foreach (KeyValuePair<string, float> kvp in orp.convectionTypes)
             * {
             *  Console.WriteLine("ORP= {0}, Key = {1}, Value = {2}",
             *      orp.name, kvp.Key, kvp.Value);
             * }*/
        }
Esempio n. 14
0
        private void precipitationProbability(CloudORPS orp, float minT, float maxT, bool cold = false)
        {
            if (orp.temperature_850 >= minT && orp.temperature_850 <= maxT)
            {
                orp.warmWetSectorPlace = ValueToLevel(LevelScale, Probability(new List <float>()
                {
                    orp.temperature_850, orp.frontogenesis_850, orp.pressureMLSP, orp.mfdiv, orp.relativeVorticity, orp.rh_700
                }));
                orp.coldSectorPlace = (cold)?ValueToLevel(LevelScale, Probability(new List <float>()
                {
                    orp.pressureMLSP, orp.mfdiv, orp.relativeVorticity, orp.rh_700
                })):0;
                orp.combineSectorPlace = ValueToLevel(LevelScale, Probability(new List <float>()
                {
                    orp.warmWetSectorPlace, orp.coldSectorPlace
                }));

                //TODO podmínka na denní dobu (odpolední hodiny)
                //Předpověď lokálních podmínek
                orp.temperatureInfluence = ValueToLevel(LevelScale, Probability(new List <float>()
                {
                    orp.sklonitost_reliefu, orp.orientace_reliefu_tepelny_prohrev_odpoledne, orp.vegetace_pokryti, orp.ir_kontrast, orp.cloudy
                }));
                orp.windInfluence = ValueToLevel(LevelScale, Probability(new List <float>()
                {
                    orp.sidelni_utvar, orp.sirka_udoli, orp.obtekani_prekazky, orp.wind_1000
                }));
                orp.humidityInfluence = ValueToLevel(LevelScale, Probability(new List <float>()
                {
                    orp.rh_1000, orp.mfdiv
                }));
                orp.orographicInfluence = ValueToLevel(LevelScale, Probability(new List <float>()
                {
                    orp.polohy_nadmorskych_vysek, orp.sirka_hrebene, orp.mfdiv, orp.potentional_orographic_lift, orp.wind_850
                }));
                orp.combineInfluence = ValueToLevel(LevelScale, Probability(new List <float>()
                {
                    orp.temperatureInfluence, orp.windInfluence, orp.humidityInfluence, orp.orographicInfluence
                }));

                //Kombinovaná předpověď intenzity konvektivních srážek
                orp.significantPredictors = ValueToLevel(LevelScale, Probability(new List <float>()
                {
                    orp.combineInfluence, orp.temperature_850, orp.corfidiVector, orp.wetBulb, orp.dls
                }));
                orp.otherPredictors = ValueToLevel(LevelScale, Probability(new List <float>()
                {
                    orp.combineInfluence, orp.frontogenesis_850, orp.mlcape, orp.mlcin, orp.mixr, orp.sreh_3km, orp.wind_850, orp.wind_300, orp.pwater
                }));
                orp.combineIntensity = ValueToLevel(LevelScale, Probability(new List <float>()
                {
                    orp.combineInfluence, orp.significantPredictors, orp.otherPredictors
                }));

                //TODO
                orp.statisticalPrecipitation = 1;
                orp.finalPlace = ValueToLevel(LevelScale, Probability(new List <float>()
                {
                    orp.statisticalPrecipitation, orp.combineSectorPlace
                }));
                orp.finalStorm = ValueToLevel(LevelScale, Probability(new List <float>()
                {
                    orp.statisticalPrecipitation, orp.combineIntensity
                }));                                                                                                                             //chybí summmerge?
            }
        }