Esempio n. 1
0
        public static void UseGeogridToProcessTerrestrialData(WrfConfiguration config,
                                                              IProcessLauncher processLauncher)
        {
            string geogrid = config.GeogridFilePath;

            processLauncher.LaunchProcess(geogrid, "", false);
        }
Esempio n. 2
0
        public static void UseUngribToUnpackageGRIBFiles(WrfConfiguration config,
                                                         IProcessLauncher processLauncher)
        {
            string ungribPath = config.UngribFilePath;

            processLauncher.LaunchProcess(ungribPath, "", false);
        }
Esempio n. 3
0
        public static void MpiRunWrfExecutable(WrfConfiguration config, IProcessLauncher processLauncher)
        {
            string mpiRunPath        = config.MpiRunPath;
            string wrfExecutablePath = config.WrfExecutablePath;

            processLauncher.LaunchProcess(mpiRunPath, $"--allow-run-as-root -np 6 {wrfExecutablePath}", false);
        }
Esempio n. 4
0
        public static void UseMetgridToHorizontallyInterpolateData(WrfConfiguration config,
                                                                   IProcessLauncher processLauncher)
        {
            string metgridPath = config.MetgridFilePath;

            processLauncher.LaunchProcess(metgridPath, "", false);
        }
Esempio n. 5
0
        public static void UseLinkGribToCreateSymbolicLinks(WrfConfiguration config,
                                                            IProcessLauncher processLauncher)
        {
            string csh           = config.CSHFilePath;
            string linkGrib      = config.LinkGribCsh;
            string dataDirectory = config.DataDirectory;

            processLauncher.LaunchProcess(csh, $"-c \"{linkGrib} {dataDirectory}\"", true);
        }
Esempio n. 6
0
        public static void NclRunScript(WrfConfiguration config, IProcessLauncher processLauncher,
                                        string scriptName, string pathToWrfOutFile)
        {
            string scriptPath        = Path.Combine(config.ScriptsDirectory, scriptName);
            string nclExecutablePath = config.NCLPath;
            string arguments         = $"{scriptPath} netcdfFile=\\\"{pathToWrfOutFile}\\\"";

            Console.WriteLine("arguments = " + arguments);
            processLauncher.LaunchProcess(nclExecutablePath, arguments, false);
        }
Esempio n. 7
0
        public static void MakeVideoWithFFMPEG(WrfConfiguration config,
                                               IProcessLauncher iProcess, string script, string physicsModelName)
        {
            string scriptFileName = script.Substring(script.LastIndexOf('/') + 1);

            scriptFileName = scriptFileName.Substring(0, scriptFileName.IndexOf('.'));
            scriptFileName = scriptFileName.Replace("wrf_", "plt_");

            string wrfDirectory = config.WRFDirectory;
            string mp4Directory = config.MP4OutputDirectory;

            if (!mp4Directory.EndsWith("/"))
            {
                mp4Directory += "/";
            }

            string ffmpegPath = config.FFMPEGPath;

            iProcess.LaunchProcess(ffmpegPath,
                                   $"-y -r 4 -i {scriptFileName}.000%03d.png -c:v libx264 -pix_fmt yuv420p {mp4Directory}{physicsModelName}_{scriptFileName}.mp4",
                                   false);
        }