Skip to content

CaseFile

RuiyuZhang.SD edited this page Aug 8, 2024 · 12 revisions

Overview of the CaseFile/CLI Scraping

When WindNinja_cli is run from terminal, all possible options that are used in cli.cpp to run windninja are displayed. the casefile attempts to scrape and match gui input from the user to the cli options and put this in a config file. This file is user inputs. We will also scrape output vtk files for each run:

https://github.com/firelab/windninja/commits/casefile/

GUI Overview:

WindNinja Tree:

Within the windninja GUI the solve page has a button called "Generate a CaseFile" it is default set to on. When it is on and solve is clicked, a zip file with naming conventions: DEM-{currenttime}.ninja is generated. The zip file will contain:

Domain Average Run

in the root of the zip there will be:

  • the DEM
  • config.cfg
  • folders containing output vtk files for each run corresponding to the time of the run.
  • a folder called DomainRuns - within this folder, each run and it's settings so the dates of when it was run and the input speed, etc (in later iteration we can change it so that these run.cfg files are put in its corresponding time with the output vtk files).

point initialization:

  • the DEM
  • config.cfg
  • a folder called "pointInitialization"
    • all of the possible stations - some will be in the root of this folder, some in a folder called "wx-stations" ..
    • a selectedstation.csv which contains the selected stations.
  • folders with the output vtks

WXmodel initialization:

  • the DEM
  • config.cfg
  • a folder called weatherfile where the weatherfile that was used for a wx run is stored
  • output VTKs like before.

CLI Overview:

Same thing as GUI except:

  • instead of having a button there will be an option called "write_casefile" default is true
  • For domain average runs there cannot be multiple runs unless you run multiple commands. For this casefile, each command you run will generate a zip.
  • For pointinitialization there will be no scraping of multiple stations because there is only one station file. This file will either be in the root of the zip as a .csv or in a folder called "wx_station .. " - All station files are .csv

In code explanation: All changes can be found within this area of code and commit nickname e6e167c (hash e6e167c5fb10f7406d7105ec6b5e7ad4f749252c) in the casefile branch, commit name "casefile full":

_ Casefile itself:_

  • inputs are all handled in mainwindow.cpp and cli.cpp for the command line
  • adding to the zip file itself is handled in casefile.cpp
  • casefile.cpp also has important information regarding how certain inputs are statically set. for example in order to get the bounding box for the DEM, we cannot access that through the WindNinjatree class in mainwindow because those are local variables in the class that handles the bounding box, so we set a static variable in casefile.cpp

pointinitialization:

mainwindow.cpp - solve() - for scraping inputs to the config file

stationfetchwidget.cpp - scraping the input for if a user is downloading stations from the internet. things like scraping the "station_buffer_units"

pointinput.cpp - generateFullFileList() - essentially filters all files that are .csv or under wx-station folders - these files we know are probably station files. This allows us to create the folder called "pointinitialization" in the gui which contains all possible station files.

WidgetDownloadDem.cpp - this is where we scrape and set static vars for an internet download of a DEM ninja.cpp - handles all writing of vtk files to casefile.

-Rui Zhang